path
stringlengths
5
304
repo_name
stringlengths
6
79
content
stringlengths
27
1.05M
examples/js/manipulation/multi-search-table.js
dana2208/react-bootstrap-table
/* eslint max-len: 0 */ import React from 'react'; import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; const products = []; function addProducts(quantity) { const startId = products.length; const fruits = [ 'banana', 'apple', 'orange', 'tomato', 'strawberries', 'cherries' ]; for (let i = 0; i < quantity; i++) { const id = startId + i; products.push({ id: id, name: 'Fruits: ' + fruits[i] + ' and ' + fruits[i + 1], price: 2100 + i }); } } addProducts(5); export default class MultiSearchTable extends React.Component { render() { return ( <BootstrapTable data={ products } search={ true } multiColumnSearch={ true }> <TableHeaderColumn dataField='id' isKey={ true } searchable={ false }>Product ID</TableHeaderColumn> <TableHeaderColumn dataField='name'>Fruits</TableHeaderColumn> <TableHeaderColumn dataField='price'>Price</TableHeaderColumn> </BootstrapTable> ); } }
src/components/Button.js
shabib87/Albums
import React from 'react'; import { Text, TouchableOpacity } from 'react-native'; const Button = ({ onPress, children }) => { const { buttonStyle, textStyle } = styles; return ( <TouchableOpacity onPress={onPress} style={buttonStyle}> <Text style={textStyle}> {children} </Text> </TouchableOpacity> ); }; const styles = { buttonStyle: { flex: 1, alignSelf: 'stretch', backgroundColor: '#fff', borderRadius: 5, borderWidth: 1, borderColor: '#007aff', marginLeft: 5, marginRight: 5 }, textStyle: { alignSelf: 'center', color: '#007aff', fontSize: 16, fontWeight: '600', paddingTop: 10, paddingBottom: 10 } }; export default Button;
src/svg-icons/image/photo-album.js
mit-cml/iot-website-source
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImagePhotoAlbum = (props) => ( <SvgIcon {...props}> <path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 4h5v8l-2.5-1.5L6 12V4zm0 15l3-3.86 2.14 2.58 3-3.86L18 19H6z"/> </SvgIcon> ); ImagePhotoAlbum = pure(ImagePhotoAlbum); ImagePhotoAlbum.displayName = 'ImagePhotoAlbum'; ImagePhotoAlbum.muiName = 'SvgIcon'; export default ImagePhotoAlbum;
src/app/hero/list/heroes.js
nicolaspayot/react-tour-of-heroes
import React, { Component } from 'react'; import { hashHistory } from 'react-router'; import './heroes.scss'; export class Heroes extends Component { constructor(props) { super(props); this.state = {}; } onSelect(selectedHero) { this.setState({ selectedHero }); } gotoDetail() { const heroId = this.state.selectedHero.id; hashHistory.push(`/heroes/${heroId}`); } render() { const heroes = this.props.data; const heroNodes = heroes.map(hero => { return ( <li key={hero.id} className={this.state.selectedHero === hero ? 'selected' : null } onClick={() => this.onSelect(hero)}> <span className="badge">{hero.id}</span> {hero.name} </li> ); }); let selectedHeroNode; if (this.state.selectedHero) { selectedHeroNode = ( <div> <h2>{this.state.selectedHero.name.toUpperCase()} is my hero</h2> <button onClick={() => this.gotoDetail()}>View Details</button> </div> ); } const style = { marginTop: '20px' }; return ( <div style={style}> <h2>My heroes</h2> <ul className="heroes"> {heroNodes} </ul> {selectedHeroNode} </div> ); } }
docs/src/app/AppRoutes.js
pancho111203/material-ui
import React from 'react'; import { Route, Redirect, IndexRoute, } from 'react-router'; // Here we define all our material-ui ReactComponents. import Master from './components/Master'; import Home from './components/pages/Home'; import RequiredKnowledge from './components/pages/get-started/RequiredKnowledge'; import Installation from './components/pages/get-started/Installation'; import Usage from './components/pages/get-started/Usage'; import Examples from './components/pages/get-started/Examples'; import ServerRendering from './components/pages/get-started/ServerRendering'; import Colors from './components/pages/customization/Colors'; import Themes from './components/pages/customization/Themes'; import Styles from './components/pages/customization/Styles'; import AppBarPage from './components/pages/components/AppBar/Page'; import AutoCompletePage from './components/pages/components/AutoComplete/Page'; import AvatarPage from './components/pages/components/Avatar/Page'; import BadgePage from './components/pages/components/Badge/Page'; import BottomNavigationPage from './components/pages/components/BottomNavigation/Page'; import CardPage from './components/pages/components/Card/Page'; import ChipPage from './components/pages/components/Chip/Page'; import CircularProgressPage from './components/pages/components/CircularProgress/Page'; import CheckboxPage from './components/pages/components/Checkbox/Page'; import DatePicker from './components/pages/components/DatePicker/Page'; import DialogPage from './components/pages/components/Dialog/Page'; import DividerPage from './components/pages/components/Divider/Page'; import DrawerPage from './components/pages/components/Drawer/Page'; import DropDownMenuPage from './components/pages/components/DropDownMenu/Page'; import FlatButtonPage from './components/pages/components/FlatButton/Page'; import FloatingActionButtonPage from './components/pages/components/FloatingActionButton/Page'; import FontIconPage from './components/pages/components/FontIcon/Page'; import GridListPage from './components/pages/components/GridList/Page'; import IconButtonPage from './components/pages/components/IconButton/Page'; import IconMenuPage from './components/pages/components/IconMenu/Page'; import ListPage from './components/pages/components/List/Page'; import LinearProgressPage from './components/pages/components/LinearProgress/Page'; import PaperPage from './components/pages/components/Paper/Page'; import MenuPage from './components/pages/components/Menu/Page'; import PopoverPage from './components/pages/components/Popover/Page'; import RaisedButtonPage from './components/pages/components/RaisedButton/Page'; import RefreshIndicatorPage from './components/pages/components/RefreshIndicator/Page'; import RadioButtonPage from './components/pages/components/RadioButton/Page'; import SelectField from './components/pages/components/SelectField/Page'; import SliderPage from './components/pages/components/Slider/Page'; import SnackbarPage from './components/pages/components/Snackbar/Page'; import SvgIconPage from './components/pages/components/SvgIcon/Page'; import SubheaderPage from './components/pages/components/Subheader/Page'; import TablePage from './components/pages/components/Table/Page'; import TabsPage from './components/pages/components/Tabs/Page'; import TextFieldPage from './components/pages/components/TextField/Page'; import TimePickerPage from './components/pages/components/TimePicker/Page'; import TogglePage from './components/pages/components/Toggle/Page'; import ToolbarPage from './components/pages/components/Toolbar/Page'; import Community from './components/pages/discover-more/Community'; import Contributing from './components/pages/discover-more/Contributing'; import Showcase from './components/pages/discover-more/Showcase'; import RelatedProjects from './components/pages/discover-more/RelatedProjects'; import StepperPage from './components/pages/components/Stepper/Page'; /** * Routes: https://github.com/reactjs/react-router/blob/master/docs/API.md#route * * Routes are used to declare your view hierarchy. * * Say you go to http://material-ui.com/#/components/paper * The react router will search for a route named 'paper' and will recursively render its * handler and its parent handler like so: Paper > Components > Master */ const AppRoutes = ( <Route path="/" component={Master}> <IndexRoute component={Home} /> <Route path="home" component={Home} /> <Redirect from="get-started" to="/get-started/required-knowledge" /> <Route path="get-started"> <Route path="required-knowledge" component={RequiredKnowledge} /> <Route path="installation" component={Installation} /> <Route path="usage" component={Usage} /> <Route path="examples" component={Examples} /> <Route path="server-rendering" component={ServerRendering} /> </Route> <Redirect from="customization" to="/customization/themes" /> <Route path="customization"> <Route path="colors" component={Colors} /> <Route path="themes" component={Themes} /> <Route path="styles" component={Styles} /> </Route> <Redirect from="components" to="/components/app-bar" /> <Route path="components"> <Route path="app-bar" component={AppBarPage} /> <Route path="auto-complete" component={AutoCompletePage} /> <Route path="avatar" component={AvatarPage} /> <Route path="bottom-navigation" component={BottomNavigationPage} /> <Route path="badge" component={BadgePage} /> <Route path="card" component={CardPage} /> <Route path="chip" component={ChipPage} /> <Route path="circular-progress" component={CircularProgressPage} /> <Route path="checkbox" component={CheckboxPage} /> <Route path="date-picker" component={DatePicker} /> <Route path="dialog" component={DialogPage} /> <Route path="divider" component={DividerPage} /> <Route path="drawer" component={DrawerPage} /> <Route path="dropdown-menu" component={DropDownMenuPage} /> <Route path="font-icon" component={FontIconPage} /> <Route path="flat-button" component={FlatButtonPage} /> <Route path="floating-action-button" component={FloatingActionButtonPage} /> <Route path="grid-list" component={GridListPage} /> <Route path="icon-button" component={IconButtonPage} /> <Route path="icon-menu" component={IconMenuPage} /> <Route path="list" component={ListPage} /> <Route path="linear-progress" component={LinearProgressPage} /> <Route path="paper" component={PaperPage} /> <Route path="menu" component={MenuPage} /> <Route path="popover" component={PopoverPage} /> <Route path="refresh-indicator" component={RefreshIndicatorPage} /> <Route path="radio-button" component={RadioButtonPage} /> <Route path="raised-button" component={RaisedButtonPage} /> <Route path="select-field" component={SelectField} /> <Route path="svg-icon" component={SvgIconPage} /> <Route path="slider" component={SliderPage} /> <Route path="snackbar" component={SnackbarPage} /> <Route path="stepper" component={StepperPage} /> <Route path="subheader" component={SubheaderPage} /> <Route path="table" component={TablePage} /> <Route path="tabs" component={TabsPage} /> <Route path="text-field" component={TextFieldPage} /> <Route path="time-picker" component={TimePickerPage} /> <Route path="toggle" component={TogglePage} /> <Route path="toolbar" component={ToolbarPage} /> </Route> <Redirect from="discover-more" to="/discover-more/community" /> <Route path="discover-more"> <Route path="community" component={Community} /> <Route path="contributing" component={Contributing} /> <Route path="showcase" component={Showcase} /> <Route path="related-projects" component={RelatedProjects} /> </Route> </Route> ); export default AppRoutes;
public/js/vendor/jquery-1.6.2.min.js
drip/drip
/*! * jQuery JavaScript Library v1.6.2 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Thu Jun 30 14:16:56 2011 -0400 */ (function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return 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(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,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=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);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{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.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=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},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}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.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=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return 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)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=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}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={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,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(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){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j )}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
ajax/libs/react-router/0.12.3/ReactRouter.js
nolsherry/cdnjs
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react")); else if(typeof define === 'function' && define.amd) define(["react"], factory); else if(typeof exports === 'object') exports["ReactRouter"] = factory(require("react")); else root["ReactRouter"] = factory(root["React"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_21__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; exports.DefaultRoute = __webpack_require__(1); exports.Link = __webpack_require__(2); exports.NotFoundRoute = __webpack_require__(3); exports.Redirect = __webpack_require__(4); exports.Route = __webpack_require__(5); exports.RouteHandler = __webpack_require__(6); exports.HashLocation = __webpack_require__(7); exports.HistoryLocation = __webpack_require__(8); exports.RefreshLocation = __webpack_require__(9); exports.StaticLocation = __webpack_require__(10); exports.ImitateBrowserBehavior = __webpack_require__(11); exports.ScrollToTopBehavior = __webpack_require__(12); exports.History = __webpack_require__(13); exports.Navigation = __webpack_require__(14); exports.RouteHandlerMixin = __webpack_require__(15); exports.State = __webpack_require__(16); exports.createRoute = __webpack_require__(17).createRoute; exports.createDefaultRoute = __webpack_require__(17).createDefaultRoute; exports.createNotFoundRoute = __webpack_require__(17).createNotFoundRoute; exports.createRedirect = __webpack_require__(17).createRedirect; exports.createRoutesFromReactChildren = __webpack_require__(18); exports.create = __webpack_require__(19); exports.run = __webpack_require__(20); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var Configuration = __webpack_require__(22); var PropTypes = __webpack_require__(23); /** * A <DefaultRoute> component is a special kind of <Route> that * renders when its parent matches but none of its siblings do. * Only one such route may be used at any given level in the * route hierarchy. */ var DefaultRoute = React.createClass({ displayName: "DefaultRoute", mixins: [Configuration], propTypes: { name: PropTypes.string, path: PropTypes.falsy, children: PropTypes.falsy, handler: PropTypes.func.isRequired } }); module.exports = DefaultRoute; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var classSet = __webpack_require__(35); var assign = __webpack_require__(36); var Navigation = __webpack_require__(14); var State = __webpack_require__(16); var PropTypes = __webpack_require__(23); var Route = __webpack_require__(17); function isLeftClickEvent(event) { return event.button === 0; } function isModifiedEvent(event) { return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); } /** * <Link> components are 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 name="showPost" path="/posts/:postID" handler={Post}/> * * You could use the following component to link to that route: * * <Link to="showPost" params={{ postID: "123" }} /> * * In addition to params, links may pass along query string parameters * using the `query` prop. * * <Link to="showPost" params={{ postID: "123" }} query={{ show:true }}/> */ var Link = React.createClass({ displayName: "Link", mixins: [Navigation, State], propTypes: { activeClassName: PropTypes.string.isRequired, to: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Route)]), params: PropTypes.object, query: PropTypes.object, activeStyle: PropTypes.object, onClick: PropTypes.func }, getDefaultProps: function getDefaultProps() { return { activeClassName: "active" }; }, handleClick: function handleClick(event) { var allowTransition = true; var 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.transitionTo(this.props.to, this.props.params, this.props.query); }, /** * Returns the value of the "href" attribute to use on the DOM element. */ getHref: function getHref() { return this.makeHref(this.props.to, this.props.params, this.props.query); }, /** * Returns the value of the "class" attribute to use on the DOM element, which contains * the value of the activeClassName property when this <Link> is active. */ getClassName: function getClassName() { var classNames = {}; if (this.props.className) classNames[this.props.className] = true; if (this.getActiveState()) classNames[this.props.activeClassName] = true; return classSet(classNames); }, getActiveState: function getActiveState() { return this.isActive(this.props.to, this.props.params, this.props.query); }, render: function render() { var props = assign({}, this.props, { href: this.getHref(), className: this.getClassName(), onClick: this.handleClick }); if (props.activeStyle && this.getActiveState()) props.style = props.activeStyle; return React.DOM.a(props, this.props.children); } }); module.exports = Link; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var Configuration = __webpack_require__(22); var PropTypes = __webpack_require__(23); /** * A <NotFoundRoute> is a special kind of <Route> that * renders when the beginning of its parent's path matches * but none of its siblings do, including any <DefaultRoute>. * Only one such route may be used at any given level in the * route hierarchy. */ var NotFoundRoute = React.createClass({ displayName: "NotFoundRoute", mixins: [Configuration], propTypes: { name: PropTypes.string, path: PropTypes.falsy, children: PropTypes.falsy, handler: PropTypes.func.isRequired } }); module.exports = NotFoundRoute; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var Configuration = __webpack_require__(22); var PropTypes = __webpack_require__(23); /** * A <Redirect> component is a special kind of <Route> that always * redirects to another route when it matches. */ var Redirect = React.createClass({ displayName: "Redirect", mixins: [Configuration], propTypes: { path: PropTypes.string, from: PropTypes.string, // Alias for path. to: PropTypes.string, handler: PropTypes.falsy } }); module.exports = Redirect; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var Configuration = __webpack_require__(22); var PropTypes = __webpack_require__(23); var RouteHandler = __webpack_require__(6); /** * <Route> components specify components that are rendered to the page when the * URL matches a given pattern. * * Routes are arranged in a nested tree structure. When a new URL is requested, * the tree is searched depth-first to find a route whose path matches the URL. * When one is found, all routes in the tree that lead to it are considered * "active" and their components are rendered into the DOM, nested in the same * order as they are in the tree. * * The preferred way to configure a router is using JSX. The XML-like syntax is * a great way to visualize how routes are laid out in an application. * * var routes = [ * <Route handler={App}> * <Route name="login" handler={Login}/> * <Route name="logout" handler={Logout}/> * <Route name="about" handler={About}/> * </Route> * ]; * * Router.run(routes, function (Handler) { * React.render(<Handler/>, document.body); * }); * * Handlers for Route components that contain children can render their active * child route using a <RouteHandler> element. * * var App = React.createClass({ * render: function () { * return ( * <div class="application"> * <RouteHandler/> * </div> * ); * } * }); * * If no handler is provided for the route, it will render a matched child route. */ var Route = React.createClass({ displayName: "Route", mixins: [Configuration], propTypes: { name: PropTypes.string, path: PropTypes.string, handler: PropTypes.func, ignoreScrollBehavior: PropTypes.bool }, getDefaultProps: function getDefaultProps() { return { handler: RouteHandler }; } }); module.exports = Route; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var RouteHandlerMixin = __webpack_require__(15); /** * A <RouteHandler> component renders the active child route handler * when routes are nested. */ var RouteHandler = React.createClass({ displayName: "RouteHandler", mixins: [RouteHandlerMixin], render: function render() { return this.createChildRouteHandler(); } }); module.exports = RouteHandler; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var LocationActions = __webpack_require__(24); var History = __webpack_require__(13); /** * Returns the current URL path from the `hash` portion of the URL, including * query string. */ function getHashPath() { return decodeURI( // We can't use window.location.hash here because it's not // consistent across browsers - Firefox will pre-decode it! window.location.href.split("#")[1] || ""); } var _actionType; function ensureSlash() { var path = getHashPath(); if (path.charAt(0) === "/") { return true; }HashLocation.replace("/" + path); return false; } var _changeListeners = []; function notifyChange(type) { if (type === LocationActions.PUSH) History.length += 1; var change = { path: getHashPath(), type: type }; _changeListeners.forEach(function (listener) { listener(change); }); } var _isListening = false; function onHashChange() { if (ensureSlash()) { // If we don't have an _actionType then all we know is the hash // changed. It was probably caused by the user clicking the Back // button, but may have also been the Forward button or manual // manipulation. So just guess 'pop'. notifyChange(_actionType || LocationActions.POP); _actionType = null; } } /** * A Location that uses `window.location.hash`. */ var HashLocation = { addChangeListener: function addChangeListener(listener) { _changeListeners.push(listener); // Do this BEFORE listening for hashchange. ensureSlash(); if (!_isListening) { if (window.addEventListener) { window.addEventListener("hashchange", onHashChange, false); } else { window.attachEvent("onhashchange", onHashChange); } _isListening = true; } }, removeChangeListener: function removeChangeListener(listener) { _changeListeners = _changeListeners.filter(function (l) { return l !== listener; }); if (_changeListeners.length === 0) { if (window.removeEventListener) { window.removeEventListener("hashchange", onHashChange, false); } else { window.removeEvent("onhashchange", onHashChange); } _isListening = false; } }, push: function push(path) { _actionType = LocationActions.PUSH; window.location.hash = path; }, replace: function replace(path) { _actionType = LocationActions.REPLACE; window.location.replace(window.location.pathname + window.location.search + "#" + path); }, pop: function pop() { _actionType = LocationActions.POP; History.back(); }, getCurrentPath: getHashPath, toString: function toString() { return "<HashLocation>"; } }; module.exports = HashLocation; /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var LocationActions = __webpack_require__(24); var History = __webpack_require__(13); /** * Returns the current URL path from `window.location`, including query string. */ function getWindowPath() { return decodeURI(window.location.pathname + window.location.search); } var _changeListeners = []; function notifyChange(type) { var change = { path: getWindowPath(), type: type }; _changeListeners.forEach(function (listener) { listener(change); }); } var _isListening = false; function onPopState(event) { if (event.state === undefined) { return; } // Ignore extraneous popstate events in WebKit. notifyChange(LocationActions.POP); } /** * A Location that uses HTML5 history. */ var HistoryLocation = { addChangeListener: function addChangeListener(listener) { _changeListeners.push(listener); if (!_isListening) { if (window.addEventListener) { window.addEventListener("popstate", onPopState, false); } else { window.attachEvent("onpopstate", onPopState); } _isListening = true; } }, removeChangeListener: function removeChangeListener(listener) { _changeListeners = _changeListeners.filter(function (l) { return l !== listener; }); if (_changeListeners.length === 0) { if (window.addEventListener) { window.removeEventListener("popstate", onPopState, false); } else { window.removeEvent("onpopstate", onPopState); } _isListening = false; } }, push: function push(path) { window.history.pushState({ path: path }, "", path); History.length += 1; notifyChange(LocationActions.PUSH); }, replace: function replace(path) { window.history.replaceState({ path: path }, "", path); notifyChange(LocationActions.REPLACE); }, pop: History.back, getCurrentPath: getWindowPath, toString: function toString() { return "<HistoryLocation>"; } }; module.exports = HistoryLocation; /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var HistoryLocation = __webpack_require__(8); var History = __webpack_require__(13); /** * A Location that uses full page refreshes. This is used as * the fallback for HistoryLocation in browsers that do not * support the HTML5 history API. */ var RefreshLocation = { push: function push(path) { window.location = path; }, replace: function replace(path) { window.location.replace(path); }, pop: History.back, getCurrentPath: HistoryLocation.getCurrentPath, toString: function toString() { return "<RefreshLocation>"; } }; module.exports = RefreshLocation; /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var invariant = __webpack_require__(37); function throwCannotModify() { invariant(false, "You cannot modify a static location"); } /** * A location that only ever contains a single path. Useful in * stateless environments like servers where there is no path history, * only the path that was used in the request. */ var StaticLocation = (function () { function StaticLocation(path) { _classCallCheck(this, StaticLocation); this.path = path; } _prototypeProperties(StaticLocation, null, { getCurrentPath: { value: function getCurrentPath() { return this.path; }, writable: true, configurable: true }, toString: { value: function toString() { return "<StaticLocation path=\"" + this.path + "\">"; }, writable: true, configurable: true } }); return StaticLocation; })(); // TODO: Include these in the above class definition // once we can use ES7 property initializers. StaticLocation.prototype.push = throwCannotModify; StaticLocation.prototype.replace = throwCannotModify; StaticLocation.prototype.pop = throwCannotModify; module.exports = StaticLocation; /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var LocationActions = __webpack_require__(24); /** * A scroll behavior that attempts to imitate the default behavior * of modern browsers. */ var ImitateBrowserBehavior = { updateScrollPosition: function updateScrollPosition(position, actionType) { switch (actionType) { case LocationActions.PUSH: case LocationActions.REPLACE: window.scrollTo(0, 0); break; case LocationActions.POP: if (position) { window.scrollTo(position.x, position.y); } else { window.scrollTo(0, 0); } break; } } }; module.exports = ImitateBrowserBehavior; /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * A scroll behavior that always scrolls to the top of the page * after a transition. */ var ScrollToTopBehavior = { updateScrollPosition: function updateScrollPosition() { window.scrollTo(0, 0); } }; module.exports = ScrollToTopBehavior; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var invariant = __webpack_require__(37); var canUseDOM = __webpack_require__(38).canUseDOM; var History = { /** * The current number of entries in the history. * * Note: This property is read-only. */ length: 1, /** * Sends the browser back one entry in the history. */ back: function back() { invariant(canUseDOM, "Cannot use History.back without a DOM"); // Do this first so that History.length will // be accurate in location change listeners. History.length -= 1; window.history.back(); } }; module.exports = History; /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var PropTypes = __webpack_require__(23); /** * A mixin for components that modify the URL. * * Example: * * var MyLink = React.createClass({ * mixins: [ Router.Navigation ], * handleClick: function (event) { * event.preventDefault(); * this.transitionTo('aRoute', { the: 'params' }, { the: 'query' }); * }, * render: function () { * return ( * <a onClick={this.handleClick}>Click me!</a> * ); * } * }); */ var Navigation = { contextTypes: { makePath: PropTypes.func.isRequired, makeHref: PropTypes.func.isRequired, transitionTo: PropTypes.func.isRequired, replaceWith: PropTypes.func.isRequired, goBack: PropTypes.func.isRequired }, /** * Returns an absolute URL path created from the given route * name, URL parameters, and query values. */ makePath: function makePath(to, params, query) { return this.context.makePath(to, params, query); }, /** * Returns a string that may safely be used as the href of a * link to the route with the given name. */ makeHref: function makeHref(to, params, query) { return this.context.makeHref(to, params, query); }, /** * Transitions to the URL specified in the arguments by pushing * a new URL onto the history stack. */ transitionTo: function transitionTo(to, params, query) { this.context.transitionTo(to, params, query); }, /** * Transitions to the URL specified in the arguments by replacing * the current URL in the history stack. */ replaceWith: function replaceWith(to, params, query) { this.context.replaceWith(to, params, query); }, /** * Transitions to the previous URL. */ goBack: function goBack() { return this.context.goBack(); } }; module.exports = Navigation; /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); var assign = __webpack_require__(36); var PropTypes = __webpack_require__(23); var REF_NAME = "__routeHandler__"; var RouteHandlerMixin = { contextTypes: { getRouteAtDepth: PropTypes.func.isRequired, setRouteComponentAtDepth: PropTypes.func.isRequired, routeHandlers: PropTypes.array.isRequired }, childContextTypes: { routeHandlers: PropTypes.array.isRequired }, getChildContext: function getChildContext() { return { routeHandlers: this.context.routeHandlers.concat([this]) }; }, componentDidMount: function componentDidMount() { this._updateRouteComponent(this.refs[REF_NAME]); }, componentDidUpdate: function componentDidUpdate() { this._updateRouteComponent(this.refs[REF_NAME]); }, componentWillUnmount: function componentWillUnmount() { this._updateRouteComponent(null); }, _updateRouteComponent: function _updateRouteComponent(component) { this.context.setRouteComponentAtDepth(this.getRouteDepth(), component); }, getRouteDepth: function getRouteDepth() { return this.context.routeHandlers.length; }, createChildRouteHandler: function createChildRouteHandler(props) { var route = this.context.getRouteAtDepth(this.getRouteDepth()); return route ? React.createElement(route.handler, assign({}, props || this.props, { ref: REF_NAME })) : null; } }; module.exports = RouteHandlerMixin; /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var PropTypes = __webpack_require__(23); /** * A mixin for components that need to know the path, routes, URL * params and query that are currently active. * * Example: * * var AboutLink = React.createClass({ * mixins: [ Router.State ], * render: function () { * var className = this.props.className; * * if (this.isActive('about')) * className += ' is-active'; * * return React.DOM.a({ className: className }, this.props.children); * } * }); */ var State = { contextTypes: { getCurrentPath: PropTypes.func.isRequired, getCurrentRoutes: PropTypes.func.isRequired, getCurrentPathname: PropTypes.func.isRequired, getCurrentParams: PropTypes.func.isRequired, getCurrentQuery: PropTypes.func.isRequired, isActive: PropTypes.func.isRequired }, /** * Returns the current URL path. */ getPath: function getPath() { return this.context.getCurrentPath(); }, /** * Returns an array of the routes that are currently active. */ getRoutes: function getRoutes() { return this.context.getCurrentRoutes(); }, /** * Returns the current URL path without the query string. */ getPathname: function getPathname() { return this.context.getCurrentPathname(); }, /** * Returns an object of the URL params that are currently active. */ getParams: function getParams() { return this.context.getCurrentParams(); }, /** * Returns an object of the query params that are currently active. */ getQuery: function getQuery() { return this.context.getCurrentQuery(); }, /** * A helper method to determine if a given route, params, and query * are active. */ isActive: function isActive(to, params, query) { return this.context.isActive(to, params, query); } }; module.exports = State; /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var assign = __webpack_require__(36); var invariant = __webpack_require__(37); var warning = __webpack_require__(39); var PathUtils = __webpack_require__(25); var _currentRoute; var Route = (function () { function Route(name, path, ignoreScrollBehavior, isDefault, isNotFound, onEnter, onLeave, handler) { _classCallCheck(this, Route); this.name = name; this.path = path; this.paramNames = PathUtils.extractParamNames(this.path); this.ignoreScrollBehavior = !!ignoreScrollBehavior; this.isDefault = !!isDefault; this.isNotFound = !!isNotFound; this.onEnter = onEnter; this.onLeave = onLeave; this.handler = handler; } _prototypeProperties(Route, { createRoute: { /** * Creates and returns a new route. Options may be a URL pathname string * with placeholders for named params or an object with any of the following * properties: * * - name The name of the route. This is used to lookup a * route relative to its parent route and should be * unique among all child routes of the same parent * - path A URL pathname string with optional placeholders * that specify the names of params to extract from * the URL when the path matches. Defaults to `/${name}` * when there is a name given, or the path of the parent * route, or / * - ignoreScrollBehavior True to make this route (and all descendants) ignore * the scroll behavior of the router * - isDefault True to make this route the default route among all * its siblings * - isNotFound True to make this route the "not found" route among * all its siblings * - onEnter A transition hook that will be called when the * router is going to enter this route * - onLeave A transition hook that will be called when the * router is going to leave this route * - handler A React component that will be rendered when * this route is active * - parentRoute The parent route to use for this route. This option * is automatically supplied when creating routes inside * the callback to another invocation of createRoute. You * only ever need to use this when declaring routes * independently of one another to manually piece together * the route hierarchy * * The callback may be used to structure your route hierarchy. Any call to * createRoute, createDefaultRoute, createNotFoundRoute, or createRedirect * inside the callback automatically uses this route as its parent. */ value: function createRoute(options, callback) { options = options || {}; if (typeof options === "string") options = { path: options }; var parentRoute = _currentRoute; if (parentRoute) { warning(options.parentRoute == null || options.parentRoute === parentRoute, "You should not use parentRoute with createRoute inside another route's child callback; it is ignored"); } else { parentRoute = options.parentRoute; } var name = options.name; var path = options.path || name; if (path && !(options.isDefault || options.isNotFound)) { if (PathUtils.isAbsolute(path)) { if (parentRoute) { invariant(parentRoute.paramNames.length === 0, "You cannot nest path \"%s\" inside \"%s\"; the parent requires URL parameters", path, parentRoute.path); } } else if (parentRoute) { // Relative paths extend their parent. path = PathUtils.join(parentRoute.path, path); } else { path = "/" + path; } } else { path = parentRoute ? parentRoute.path : "/"; } if (options.isNotFound && !/\*$/.test(path)) path += "*"; // Auto-append * to the path of not found routes. var route = new Route(name, path, options.ignoreScrollBehavior, options.isDefault, options.isNotFound, options.onEnter, options.onLeave, options.handler); if (parentRoute) { if (route.isDefault) { invariant(parentRoute.defaultRoute == null, "%s may not have more than one default route", parentRoute); parentRoute.defaultRoute = route; } else if (route.isNotFound) { invariant(parentRoute.notFoundRoute == null, "%s may not have more than one not found route", parentRoute); parentRoute.notFoundRoute = route; } parentRoute.appendChild(route); } // Any routes created in the callback // use this route as their parent. if (typeof callback === "function") { var currentRoute = _currentRoute; _currentRoute = route; callback.call(route, route); _currentRoute = currentRoute; } return route; }, writable: true, configurable: true }, createDefaultRoute: { /** * Creates and returns a route that is rendered when its parent matches * the current URL. */ value: function createDefaultRoute(options) { return Route.createRoute(assign({}, options, { isDefault: true })); }, writable: true, configurable: true }, createNotFoundRoute: { /** * Creates and returns a route that is rendered when its parent matches * the current URL but none of its siblings do. */ value: function createNotFoundRoute(options) { return Route.createRoute(assign({}, options, { isNotFound: true })); }, writable: true, configurable: true }, createRedirect: { /** * Creates and returns a route that automatically redirects the transition * to another route. In addition to the normal options to createRoute, this * function accepts the following options: * * - from An alias for the `path` option. Defaults to * * - to The path/route/route name to redirect to * - params The params to use in the redirect URL. Defaults * to using the current params * - query The query to use in the redirect URL. Defaults * to using the current query */ value: function createRedirect(options) { return Route.createRoute(assign({}, options, { path: options.path || options.from || "*", onEnter: function onEnter(transition, params, query) { transition.redirect(options.to, options.params || params, options.query || query); } })); }, writable: true, configurable: true } }, { appendChild: { /** * Appends the given route to this route's child routes. */ value: function appendChild(route) { invariant(route instanceof Route, "route.appendChild must use a valid Route"); if (!this.childRoutes) this.childRoutes = []; this.childRoutes.push(route); }, writable: true, configurable: true }, toString: { value: function toString() { var string = "<Route"; if (this.name) string += " name=\"" + this.name + "\""; string += " path=\"" + this.path + "\">"; return string; }, writable: true, configurable: true } }); return Route; })(); module.exports = Route; /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* jshint -W084 */ var React = __webpack_require__(21); var assign = __webpack_require__(36); var warning = __webpack_require__(39); var DefaultRouteType = __webpack_require__(1).type; var NotFoundRouteType = __webpack_require__(3).type; var RedirectType = __webpack_require__(4).type; var Route = __webpack_require__(17); function checkPropTypes(componentName, propTypes, props) { componentName = componentName || "UnknownComponent"; for (var propName in propTypes) { if (propTypes.hasOwnProperty(propName)) { var error = propTypes[propName](props, propName, componentName); if (error instanceof Error) warning(false, error.message); } } } function createRouteOptions(props) { var options = assign({}, props); var handler = options.handler; if (handler) { options.onEnter = handler.willTransitionTo; options.onLeave = handler.willTransitionFrom; } return options; } function createRouteFromReactElement(element) { if (!React.isValidElement(element)) { return; }var type = element.type; var props = element.props; if (type.propTypes) checkPropTypes(type.displayName, type.propTypes, props); if (type === DefaultRouteType) { return Route.createDefaultRoute(createRouteOptions(props)); }if (type === NotFoundRouteType) { return Route.createNotFoundRoute(createRouteOptions(props)); }if (type === RedirectType) { return Route.createRedirect(createRouteOptions(props)); }return Route.createRoute(createRouteOptions(props), function () { if (props.children) createRoutesFromReactChildren(props.children); }); } /** * Creates and returns an array of routes created from the given * ReactChildren, all of which should be one of <Route>, <DefaultRoute>, * <NotFoundRoute>, or <Redirect>, e.g.: * * var { createRoutesFromReactChildren, Route, Redirect } = require('react-router'); * * var routes = createRoutesFromReactChildren( * <Route path="/" handler={App}> * <Route name="user" path="/user/:userId" handler={User}> * <Route name="task" path="tasks/:taskId" handler={Task}/> * <Redirect from="todos/:taskId" to="task"/> * </Route> * </Route> * ); */ function createRoutesFromReactChildren(children) { var routes = []; React.Children.forEach(children, function (child) { if (child = createRouteFromReactElement(child)) routes.push(child); }); return routes; } module.exports = createRoutesFromReactChildren; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* jshint -W058 */ var React = __webpack_require__(21); var warning = __webpack_require__(39); var invariant = __webpack_require__(37); var canUseDOM = __webpack_require__(38).canUseDOM; var LocationActions = __webpack_require__(24); var ImitateBrowserBehavior = __webpack_require__(11); var HashLocation = __webpack_require__(7); var HistoryLocation = __webpack_require__(8); var RefreshLocation = __webpack_require__(9); var StaticLocation = __webpack_require__(10); var NavigationContext = __webpack_require__(26); var ScrollHistory = __webpack_require__(27); var StateContext = __webpack_require__(28); var createRoutesFromReactChildren = __webpack_require__(18); var isReactChildren = __webpack_require__(29); var Transition = __webpack_require__(30); var PropTypes = __webpack_require__(23); var Redirect = __webpack_require__(31); var History = __webpack_require__(13); var Cancellation = __webpack_require__(32); var Match = __webpack_require__(33); var Route = __webpack_require__(17); var supportsHistory = __webpack_require__(34); var PathUtils = __webpack_require__(25); /** * The default location for new routers. */ var DEFAULT_LOCATION = canUseDOM ? HashLocation : "/"; /** * The default scroll behavior for new routers. */ var DEFAULT_SCROLL_BEHAVIOR = canUseDOM ? ImitateBrowserBehavior : null; function hasProperties(object, properties) { for (var propertyName in properties) if (properties.hasOwnProperty(propertyName) && object[propertyName] !== properties[propertyName]) { return false; }return true; } function hasMatch(routes, route, prevParams, nextParams, prevQuery, nextQuery) { return routes.some(function (r) { if (r !== route) return false; var paramNames = route.paramNames; var paramName; // Ensure that all params the route cares about did not change. for (var i = 0, len = paramNames.length; i < len; ++i) { paramName = paramNames[i]; if (nextParams[paramName] !== prevParams[paramName]) return false; } // Ensure the query hasn't changed. return hasProperties(prevQuery, nextQuery) && hasProperties(nextQuery, prevQuery); }); } function addRoutesToNamedRoutes(routes, namedRoutes) { var route; for (var i = 0, len = routes.length; i < len; ++i) { route = routes[i]; if (route.name) { invariant(namedRoutes[route.name] == null, "You may not have more than one route named \"%s\"", route.name); namedRoutes[route.name] = route; } if (route.childRoutes) addRoutesToNamedRoutes(route.childRoutes, namedRoutes); } } /** * Creates and returns a new router using the given options. A router * is a ReactComponent class that knows how to react to changes in the * URL and keep the contents of the page in sync. * * Options may be any of the following: * * - routes (required) The route config * - location The location to use. Defaults to HashLocation when * the DOM is available, "/" otherwise * - scrollBehavior The scroll behavior to use. Defaults to ImitateBrowserBehavior * when the DOM is available, null otherwise * - onError A function that is used to handle errors * - onAbort A function that is used to handle aborted transitions * * When rendering in a server-side environment, the location should simply * be the URL path that was used in the request, including the query string. */ function createRouter(options) { options = options || {}; if (isReactChildren(options)) options = { routes: options }; var mountedComponents = []; var location = options.location || DEFAULT_LOCATION; var scrollBehavior = options.scrollBehavior || DEFAULT_SCROLL_BEHAVIOR; var state = {}; var nextState = {}; var pendingTransition = null; var dispatchHandler = null; if (typeof location === "string") location = new StaticLocation(location); if (location instanceof StaticLocation) { warning(!canUseDOM || ("production") === "test", "You should not use a static location in a DOM environment because " + "the router will not be kept in sync with the current URL"); } else { invariant(canUseDOM || location.needsDOM === false, "You cannot use %s without a DOM", location); } // Automatically fall back to full page refreshes in // browsers that don't support the HTML history API. if (location === HistoryLocation && !supportsHistory()) location = RefreshLocation; var Router = React.createClass({ displayName: "Router", statics: { isRunning: false, cancelPendingTransition: function cancelPendingTransition() { if (pendingTransition) { pendingTransition.cancel(); pendingTransition = null; } }, clearAllRoutes: function clearAllRoutes() { this.cancelPendingTransition(); this.namedRoutes = {}; this.routes = []; }, /** * Adds routes to this router from the given children object (see ReactChildren). */ addRoutes: function addRoutes(routes) { if (isReactChildren(routes)) routes = createRoutesFromReactChildren(routes); addRoutesToNamedRoutes(routes, this.namedRoutes); this.routes.push.apply(this.routes, routes); }, /** * Replaces routes of this router from the given children object (see ReactChildren). */ replaceRoutes: function replaceRoutes(routes) { this.clearAllRoutes(); this.addRoutes(routes); this.refresh(); }, /** * Performs a match of the given path against this router and returns an object * with the { routes, params, pathname, query } that match. Returns null if no * match can be made. */ match: function match(path) { return Match.findMatchForPath(this.routes, path); }, /** * Returns an absolute URL path created from the given route * name, URL parameters, and query. */ makePath: function makePath(to, params, query) { var path; if (PathUtils.isAbsolute(to)) { path = to; } else { var route = to instanceof Route ? to : this.namedRoutes[to]; invariant(route instanceof Route, "Cannot find a route named \"%s\"", to); path = route.path; } return PathUtils.withQuery(PathUtils.injectParams(path, params), query); }, /** * Returns a string that may safely be used as the href of a link * to the route with the given name, URL parameters, and query. */ makeHref: function makeHref(to, params, query) { var path = this.makePath(to, params, query); return location === HashLocation ? "#" + path : path; }, /** * Transitions to the URL specified in the arguments by pushing * a new URL onto the history stack. */ transitionTo: function transitionTo(to, params, query) { var path = this.makePath(to, params, query); if (pendingTransition) { // Replace so pending location does not stay in history. location.replace(path); } else { location.push(path); } }, /** * Transitions to the URL specified in the arguments by replacing * the current URL in the history stack. */ replaceWith: function replaceWith(to, params, query) { location.replace(this.makePath(to, params, query)); }, /** * Transitions to the previous URL if one is available. Returns true if the * router was able to go back, false otherwise. * * Note: The router only tracks history entries in your application, not the * current browser session, so you can safely call this function without guarding * against sending the user back to some other site. However, when using * RefreshLocation (which is the fallback for HistoryLocation in browsers that * don't support HTML5 history) this method will *always* send the client back * because we cannot reliably track history length. */ goBack: function goBack() { if (History.length > 1 || location === RefreshLocation) { location.pop(); return true; } warning(false, "goBack() was ignored because there is no router history"); return false; }, handleAbort: options.onAbort || function (abortReason) { if (location instanceof StaticLocation) throw new Error("Unhandled aborted transition! Reason: " + abortReason); if (abortReason instanceof Cancellation) { return; } else if (abortReason instanceof Redirect) { location.replace(this.makePath(abortReason.to, abortReason.params, abortReason.query)); } else { location.pop(); } }, handleError: options.onError || function (error) { // Throw so we don't silently swallow async errors. throw error; // This error probably originated in a transition hook. }, handleLocationChange: function handleLocationChange(change) { this.dispatch(change.path, change.type); }, /** * Performs a transition to the given path and calls callback(error, abortReason) * when the transition is finished. If both arguments are null the router's state * was updated. Otherwise the transition did not complete. * * In a transition, a router first determines which routes are involved by beginning * with the current route, up the route tree to the first parent route that is shared * with the destination route, and back down the tree to the destination route. The * willTransitionFrom hook is invoked on all route handlers we're transitioning away * from, in reverse nesting order. Likewise, the willTransitionTo hook is invoked on * all route handlers we're transitioning to. * * Both willTransitionFrom and willTransitionTo hooks may either abort or redirect the * transition. To resolve asynchronously, they may use the callback argument. If no * hooks wait, the transition is fully synchronous. */ dispatch: function dispatch(path, action) { this.cancelPendingTransition(); var prevPath = state.path; var isRefreshing = action == null; if (prevPath === path && !isRefreshing) { return; } // Nothing to do! // Record the scroll position as early as possible to // get it before browsers try update it automatically. if (prevPath && action === LocationActions.PUSH) this.recordScrollPosition(prevPath); var match = this.match(path); warning(match != null, "No route matches path \"%s\". Make sure you have <Route path=\"%s\"> somewhere in your routes", path, path); if (match == null) match = {}; var prevRoutes = state.routes || []; var prevParams = state.params || {}; var prevQuery = state.query || {}; var nextRoutes = match.routes || []; var nextParams = match.params || {}; var nextQuery = match.query || {}; var fromRoutes, toRoutes; if (prevRoutes.length) { fromRoutes = prevRoutes.filter(function (route) { return !hasMatch(nextRoutes, route, prevParams, nextParams, prevQuery, nextQuery); }); toRoutes = nextRoutes.filter(function (route) { return !hasMatch(prevRoutes, route, prevParams, nextParams, prevQuery, nextQuery); }); } else { fromRoutes = []; toRoutes = nextRoutes; } var transition = new Transition(path, this.replaceWith.bind(this, path)); pendingTransition = transition; var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length); Transition.from(transition, fromRoutes, fromComponents, function (error) { if (error || transition.abortReason) return dispatchHandler.call(Router, error, transition); // No need to continue. Transition.to(transition, toRoutes, nextParams, nextQuery, function (error) { dispatchHandler.call(Router, error, transition, { path: path, action: action, pathname: match.pathname, routes: nextRoutes, params: nextParams, query: nextQuery }); }); }); }, /** * Starts this router and calls callback(router, state) when the route changes. * * If the router's location is static (i.e. a URL path in a server environment) * the callback is called only once. Otherwise, the location should be one of the * Router.*Location objects (e.g. Router.HashLocation or Router.HistoryLocation). */ run: function run(callback) { invariant(!this.isRunning, "Router is already running"); dispatchHandler = function (error, transition, newState) { if (error) Router.handleError(error); if (pendingTransition !== transition) return; pendingTransition = null; if (transition.abortReason) { Router.handleAbort(transition.abortReason); } else { callback.call(this, this, nextState = newState); } }; if (!(location instanceof StaticLocation)) { if (location.addChangeListener) location.addChangeListener(Router.handleLocationChange); this.isRunning = true; } // Bootstrap using the current path. this.refresh(); }, refresh: function refresh() { Router.dispatch(location.getCurrentPath(), null); }, stop: function stop() { this.cancelPendingTransition(); if (location.removeChangeListener) location.removeChangeListener(Router.handleLocationChange); this.isRunning = false; }, getScrollBehavior: function getScrollBehavior() { return scrollBehavior; } }, mixins: [NavigationContext, StateContext, ScrollHistory], propTypes: { children: PropTypes.falsy }, childContextTypes: { getRouteAtDepth: React.PropTypes.func.isRequired, setRouteComponentAtDepth: React.PropTypes.func.isRequired, routeHandlers: React.PropTypes.array.isRequired }, getChildContext: function getChildContext() { return { getRouteAtDepth: this.getRouteAtDepth, setRouteComponentAtDepth: this.setRouteComponentAtDepth, routeHandlers: [this] }; }, getInitialState: function getInitialState() { return state = nextState; }, componentWillReceiveProps: function componentWillReceiveProps() { this.setState(state = nextState); }, componentWillUnmount: function componentWillUnmount() { Router.stop(); }, getLocation: function getLocation() { return location; }, getRouteAtDepth: function getRouteAtDepth(depth) { var routes = this.state.routes; return routes && routes[depth]; }, setRouteComponentAtDepth: function setRouteComponentAtDepth(depth, component) { mountedComponents[depth] = component; }, render: function render() { var route = this.getRouteAtDepth(0); return route ? React.createElement(route.handler, this.props) : null; } }); Router.clearAllRoutes(); if (options.routes) Router.addRoutes(options.routes); return Router; } module.exports = createRouter; /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var createRouter = __webpack_require__(19); /** * A high-level convenience method that creates, configures, and * runs a router in one shot. The method signature is: * * Router.run(routes[, location ], callback); * * Using `window.location.hash` to manage the URL, you could do: * * Router.run(routes, function (Handler) { * React.render(<Handler/>, document.body); * }); * * Using HTML5 history and a custom "cursor" prop: * * Router.run(routes, Router.HistoryLocation, function (Handler) { * React.render(<Handler cursor={cursor}/>, document.body); * }); * * Returns the newly created router. * * Note: If you need to specify further options for your router such * as error/abort handling or custom scroll behavior, use Router.create * instead. * * var router = Router.create(options); * router.run(function (Handler) { * // ... * }); */ function runRouter(routes, location, callback) { if (typeof location === "function") { callback = location; location = null; } var router = createRouter({ routes: routes, location: location }); router.run(callback); return router; } module.exports = runRouter; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { module.exports = __WEBPACK_EXTERNAL_MODULE_21__; /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var warning = __webpack_require__(39); var invariant = __webpack_require__(37); function checkPropTypes(componentName, propTypes, props) { for (var propName in propTypes) { if (propTypes.hasOwnProperty(propName)) { var error = propTypes[propName](props, propName, componentName); if (error instanceof Error) warning(false, error.message); } } } var Configuration = { statics: { validateProps: function validateProps(props) { checkPropTypes(this.displayName, this.propTypes, props); } }, render: function render() { invariant(false, "%s elements are for router configuration only and should not be rendered", this.constructor.displayName); } }; module.exports = Configuration; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var assign = __webpack_require__(36); var ReactPropTypes = __webpack_require__(21).PropTypes; var PropTypes = assign({ /** * Requires that the value of a prop be falsy. */ falsy: function falsy(props, propName, componentName) { if (props[propName]) { return new Error("<" + componentName + "> may not have a \"" + propName + "\" prop"); } } }, ReactPropTypes); module.exports = PropTypes; /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Actions that modify the URL. */ var LocationActions = { /** * Indicates a new location is being pushed to the history stack. */ PUSH: "push", /** * Indicates the current location should be replaced. */ REPLACE: "replace", /** * Indicates the most recent entry should be removed from the history stack. */ POP: "pop" }; module.exports = LocationActions; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var invariant = __webpack_require__(37); var merge = __webpack_require__(42).merge; var qs = __webpack_require__(41); var paramCompileMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g; var paramInjectMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g; var paramInjectTrailingSlashMatcher = /\/\/\?|\/\?\/|\/\?/g; var queryMatcher = /\?(.+)/; var _compiledPatterns = {}; function compilePattern(pattern) { if (!(pattern in _compiledPatterns)) { var paramNames = []; var source = pattern.replace(paramCompileMatcher, function (match, paramName) { if (paramName) { paramNames.push(paramName); return "([^/?#]+)"; } else if (match === "*") { paramNames.push("splat"); return "(.*?)"; } else { return "\\" + match; } }); _compiledPatterns[pattern] = { matcher: new RegExp("^" + source + "$", "i"), paramNames: paramNames }; } return _compiledPatterns[pattern]; } var PathUtils = { /** * Returns true if the given path is absolute. */ isAbsolute: function isAbsolute(path) { return path.charAt(0) === "/"; }, /** * Joins two URL paths together. */ join: function join(a, b) { return a.replace(/\/*$/, "/") + b; }, /** * Returns an array of the names of all parameters in the given pattern. */ extractParamNames: function extractParamNames(pattern) { return compilePattern(pattern).paramNames; }, /** * Extracts the portions of the given URL path that match the given pattern * and returns an object of param name => value pairs. Returns null if the * pattern does not match the given path. */ extractParams: function extractParams(pattern, path) { var _compilePattern = compilePattern(pattern); var matcher = _compilePattern.matcher; var paramNames = _compilePattern.paramNames; var match = path.match(matcher); if (!match) { return null; }var params = {}; paramNames.forEach(function (paramName, index) { params[paramName] = match[index + 1]; }); return params; }, /** * Returns a version of the given route path with params interpolated. Throws * if there is a dynamic segment of the route path for which there is no param. */ injectParams: function injectParams(pattern, params) { params = params || {}; var splatIndex = 0; return pattern.replace(paramInjectMatcher, function (match, paramName) { paramName = paramName || "splat"; // If param is optional don't check for existence if (paramName.slice(-1) === "?") { paramName = paramName.slice(0, -1); if (params[paramName] == null) return ""; } else { invariant(params[paramName] != null, "Missing \"%s\" parameter for path \"%s\"", paramName, pattern); } var segment; if (paramName === "splat" && Array.isArray(params[paramName])) { segment = params[paramName][splatIndex++]; invariant(segment != null, "Missing splat # %s for path \"%s\"", splatIndex, pattern); } else { segment = params[paramName]; } return segment; }).replace(paramInjectTrailingSlashMatcher, "/"); }, /** * Returns an object that is the result of parsing any query string contained * in the given path, null if the path contains no query string. */ extractQuery: function extractQuery(path) { var match = path.match(queryMatcher); return match && qs.parse(match[1]); }, /** * Returns a version of the given path without the query string. */ withoutQuery: function withoutQuery(path) { return path.replace(queryMatcher, ""); }, /** * Returns a version of the given path with the parameters in the given * query merged into the query string. */ withQuery: function withQuery(path, query) { var existingQuery = PathUtils.extractQuery(path); if (existingQuery) query = query ? merge(existingQuery, query) : existingQuery; var queryString = qs.stringify(query, { indices: false }); if (queryString) { return PathUtils.withoutQuery(path) + "?" + queryString; }return path; } }; module.exports = PathUtils; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var PropTypes = __webpack_require__(23); /** * Provides the router with context for Router.Navigation. */ var NavigationContext = { childContextTypes: { makePath: PropTypes.func.isRequired, makeHref: PropTypes.func.isRequired, transitionTo: PropTypes.func.isRequired, replaceWith: PropTypes.func.isRequired, goBack: PropTypes.func.isRequired }, getChildContext: function getChildContext() { return { makePath: this.constructor.makePath.bind(this.constructor), makeHref: this.constructor.makeHref.bind(this.constructor), transitionTo: this.constructor.transitionTo.bind(this.constructor), replaceWith: this.constructor.replaceWith.bind(this.constructor), goBack: this.constructor.goBack.bind(this.constructor) }; } }; module.exports = NavigationContext; /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var invariant = __webpack_require__(37); var canUseDOM = __webpack_require__(38).canUseDOM; var getWindowScrollPosition = __webpack_require__(40); function shouldUpdateScroll(state, prevState) { if (!prevState) { return true; } // Don't update scroll position when only the query has changed. if (state.pathname === prevState.pathname) { return false; }var routes = state.routes; var prevRoutes = prevState.routes; var sharedAncestorRoutes = routes.filter(function (route) { return prevRoutes.indexOf(route) !== -1; }); return !sharedAncestorRoutes.some(function (route) { return route.ignoreScrollBehavior; }); } /** * Provides the router with the ability to manage window scroll position * according to its scroll behavior. */ var ScrollHistory = { statics: { /** * Records curent scroll position as the last known position for the given URL path. */ recordScrollPosition: function recordScrollPosition(path) { if (!this.scrollHistory) this.scrollHistory = {}; this.scrollHistory[path] = getWindowScrollPosition(); }, /** * Returns the last known scroll position for the given URL path. */ getScrollPosition: function getScrollPosition(path) { if (!this.scrollHistory) this.scrollHistory = {}; return this.scrollHistory[path] || null; } }, componentWillMount: function componentWillMount() { invariant(this.constructor.getScrollBehavior() == null || canUseDOM, "Cannot use scroll behavior without a DOM"); }, componentDidMount: function componentDidMount() { this._updateScroll(); }, componentDidUpdate: function componentDidUpdate(prevProps, prevState) { this._updateScroll(prevState); }, _updateScroll: function _updateScroll(prevState) { if (!shouldUpdateScroll(this.state, prevState)) { return; }var scrollBehavior = this.constructor.getScrollBehavior(); if (scrollBehavior) scrollBehavior.updateScrollPosition(this.constructor.getScrollPosition(this.state.path), this.state.action); } }; module.exports = ScrollHistory; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var assign = __webpack_require__(36); var PropTypes = __webpack_require__(23); var PathUtils = __webpack_require__(25); function routeIsActive(activeRoutes, routeName) { return activeRoutes.some(function (route) { return route.name === routeName; }); } function paramsAreActive(activeParams, params) { for (var property in params) if (String(activeParams[property]) !== String(params[property])) { return false; }return true; } function queryIsActive(activeQuery, query) { for (var property in query) if (String(activeQuery[property]) !== String(query[property])) { return false; }return true; } /** * Provides the router with context for Router.State. */ var StateContext = { /** * Returns the current URL path + query string. */ getCurrentPath: function getCurrentPath() { return this.state.path; }, /** * Returns a read-only array of the currently active routes. */ getCurrentRoutes: function getCurrentRoutes() { return this.state.routes.slice(0); }, /** * Returns the current URL path without the query string. */ getCurrentPathname: function getCurrentPathname() { return this.state.pathname; }, /** * Returns a read-only object of the currently active URL parameters. */ getCurrentParams: function getCurrentParams() { return assign({}, this.state.params); }, /** * Returns a read-only object of the currently active query parameters. */ getCurrentQuery: function getCurrentQuery() { return assign({}, this.state.query); }, /** * Returns true if the given route, params, and query are active. */ isActive: function isActive(to, params, query) { if (PathUtils.isAbsolute(to)) { return to === this.state.path; }return routeIsActive(this.state.routes, to) && paramsAreActive(this.state.params, params) && (query == null || queryIsActive(this.state.query, query)); }, childContextTypes: { getCurrentPath: PropTypes.func.isRequired, getCurrentRoutes: PropTypes.func.isRequired, getCurrentPathname: PropTypes.func.isRequired, getCurrentParams: PropTypes.func.isRequired, getCurrentQuery: PropTypes.func.isRequired, isActive: PropTypes.func.isRequired }, getChildContext: function getChildContext() { return { getCurrentPath: this.getCurrentPath, getCurrentRoutes: this.getCurrentRoutes, getCurrentPathname: this.getCurrentPathname, getCurrentParams: this.getCurrentParams, getCurrentQuery: this.getCurrentQuery, isActive: this.isActive }; } }; module.exports = StateContext; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(21); function isValidChild(object) { return object == null || React.isValidElement(object); } function isReactChildren(object) { return isValidChild(object) || Array.isArray(object) && object.every(isValidChild); } module.exports = isReactChildren; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* jshint -W058 */ var Cancellation = __webpack_require__(32); var Redirect = __webpack_require__(31); /** * Encapsulates a transition to a given path. * * The willTransitionTo and willTransitionFrom handlers receive * an instance of this class as their first argument. */ function Transition(path, retry) { this.path = path; this.abortReason = null; // TODO: Change this to router.retryTransition(transition) this.retry = retry.bind(this); } Transition.prototype.abort = function (reason) { if (this.abortReason == null) this.abortReason = reason || "ABORT"; }; Transition.prototype.redirect = function (to, params, query) { this.abort(new Redirect(to, params, query)); }; Transition.prototype.cancel = function () { this.abort(new Cancellation()); }; Transition.from = function (transition, routes, components, callback) { routes.reduce(function (callback, route, index) { return function (error) { if (error || transition.abortReason) { callback(error); } else if (route.onLeave) { try { route.onLeave(transition, components[index], callback); // If there is no callback in the argument list, call it automatically. if (route.onLeave.length < 3) callback(); } catch (e) { callback(e); } } else { callback(); } }; }, callback)(); }; Transition.to = function (transition, routes, params, query, callback) { routes.reduceRight(function (callback, route) { return function (error) { if (error || transition.abortReason) { callback(error); } else if (route.onEnter) { try { route.onEnter(transition, params, query, callback); // If there is no callback in the argument list, call it automatically. if (route.onEnter.length < 4) callback(); } catch (e) { callback(e); } } else { callback(); } }; }, callback)(); }; module.exports = Transition; /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Encapsulates a redirect to the given route. */ function Redirect(to, params, query) { this.to = to; this.params = params; this.query = query; } module.exports = Redirect; /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Represents a cancellation caused by navigating away * before the previous transition has fully resolved. */ function Cancellation() {} module.exports = Cancellation; /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; /* jshint -W084 */ var PathUtils = __webpack_require__(25); var Match = function Match(pathname, params, query, routes) { _classCallCheck(this, Match); this.pathname = pathname; this.params = params; this.query = query; this.routes = routes; }; function deepSearch(route, pathname, query) { // Check the subtree first to find the most deeply-nested match. var childRoutes = route.childRoutes; if (childRoutes) { var match, childRoute; for (var i = 0, len = childRoutes.length; i < len; ++i) { childRoute = childRoutes[i]; if (childRoute.isDefault || childRoute.isNotFound) continue; // Check these in order later. if (match = deepSearch(childRoute, pathname, query)) { // A route in the subtree matched! Add this route and we're done. match.routes.unshift(route); return match; } } } // No child routes matched; try the default route. var defaultRoute = route.defaultRoute; if (defaultRoute && (params = PathUtils.extractParams(defaultRoute.path, pathname))) { return new Match(pathname, params, query, [route, defaultRoute]); } // Does the "not found" route match? var notFoundRoute = route.notFoundRoute; if (notFoundRoute && (params = PathUtils.extractParams(notFoundRoute.path, pathname))) { return new Match(pathname, params, query, [route, notFoundRoute]); } // Last attempt: check this route. var params = PathUtils.extractParams(route.path, pathname); if (params) { return new Match(pathname, params, query, [route]); }return null; } /** * Attempts to match depth-first a route in the given route's * subtree against the given path and returns the match if it * succeeds, null if no match can be made. */ Match.findMatchForPath = function (routes, path) { var pathname = PathUtils.withoutQuery(path); var query = PathUtils.extractQuery(path); var match = null; for (var i = 0, len = routes.length; match == null && i < len; ++i) match = deepSearch(routes[i], pathname, query); return match; }; module.exports = Match; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function supportsHistory() { /*! 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/rackt/react-router/issues/586 */ var ua = 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; } module.exports = supportsHistory; /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * 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. * * @providesModule cx */ /** * This function is used to mark string literals representing CSS class names * so that they can be transformed statically. This allows for modularization * and minification of CSS class names. * * In static_upstream, this function is actually implemented, but it should * eventually be replaced with something more descriptive, and the transform * that is used in the main stack should be ported for use elsewhere. * * @param string|object className to modularize, or an object of key/values. * In the object case, the values are conditions that * determine if the className keys should be included. * @param [string ...] Variable list of classNames in the string case. * @return string Renderable space-separated CSS className. */ function cx(classNames) { if (typeof classNames == "object") { return Object.keys(classNames).filter(function (className) { return classNames[className]; }).join(" "); } else { return Array.prototype.join.call(arguments, " "); } } module.exports = cx; /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 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. * * @providesModule Object.assign */ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign function assign(target, sources) { if (target == null) { throw new TypeError("Object.assign target cannot be null or undefined"); } var to = Object(target); var hasOwnProperty = Object.prototype.hasOwnProperty; for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { var nextSource = arguments[nextIndex]; if (nextSource == null) { continue; } var from = Object(nextSource); // We don't currently support accessors nor proxies. Therefore this // copy cannot throw. If we ever supported this then we must handle // exceptions and side-effects. We don't support symbols so they won't // be transferred. for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } } return to; }; module.exports = assign; /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { "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 invariant(condition, format, a, b, c, d, e, f) { if (false) { 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("Invariant Violation: " + format.replace(/%s/g, function () { return args[argIndex++]; })); } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } }; module.exports = invariant; /** * 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. * * @providesModule invariant */ /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); /** * Simple, lightweight module assisting with the detection and context of * Worker. Helps avoid circular dependencies and allows code to reason about * whether or not they are in a Worker, even if they never include the main * `ReactWorker` dependency. */ var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== "undefined", canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; /** * 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. * * @providesModule ExecutionEnvironment */ /*jslint evil: true */ /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var emptyFunction = __webpack_require__(43); /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = emptyFunction; if (false) { warning = function (condition, format) { for (var args = [], $__0 = 2, $__1 = arguments.length; $__0 < $__1; $__0++) args.push(arguments[$__0]); if (format === undefined) { throw new Error("`warning(condition, format, ...args)` requires a warning " + "message argument"); } if (!condition) { var argIndex = 0; console.warn("Warning: " + format.replace(/%s/g, function () { return args[argIndex++]; })); } }; } module.exports = warning; /** * Copyright 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. * * @providesModule warning */ /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var invariant = __webpack_require__(37); var canUseDOM = __webpack_require__(38).canUseDOM; /** * Returns the current scroll position of the window as { x, y }. */ function getWindowScrollPosition() { invariant(canUseDOM, "Cannot get current scroll position without a DOM"); return { x: window.pageXOffset || document.documentElement.scrollLeft, y: window.pageYOffset || document.documentElement.scrollTop }; } module.exports = getWindowScrollPosition; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(44); /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { "use strict"; // Load modules // Declare internals var internals = {}; exports.arrayToObject = function (source) { var obj = {}; for (var i = 0, il = source.length; i < il; ++i) { if (typeof source[i] !== "undefined") { obj[i] = source[i]; } } return obj; }; exports.merge = function (target, source) { if (!source) { return target; } if (typeof source !== "object") { if (Array.isArray(target)) { target.push(source); } else { target[source] = true; } return target; } if (typeof target !== "object") { target = [target].concat(source); return target; } if (Array.isArray(target) && !Array.isArray(source)) { target = exports.arrayToObject(target); } var keys = Object.keys(source); for (var k = 0, kl = keys.length; k < kl; ++k) { var key = keys[k]; var value = source[key]; if (!target[key]) { target[key] = value; } else { target[key] = exports.merge(target[key], value); } } return target; }; exports.decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, " ")); } catch (e) { return str; } }; exports.compact = function (obj, refs) { if (typeof obj !== "object" || obj === null) { return obj; } refs = refs || []; var lookup = refs.indexOf(obj); if (lookup !== -1) { return refs[lookup]; } refs.push(obj); if (Array.isArray(obj)) { var compacted = []; for (var i = 0, il = obj.length; i < il; ++i) { if (typeof obj[i] !== "undefined") { compacted.push(obj[i]); } } return compacted; } var keys = Object.keys(obj); for (i = 0, il = keys.length; i < il; ++i) { var key = keys[i]; obj[key] = exports.compact(obj[key], refs); } return obj; }; exports.isRegExp = function (obj) { return Object.prototype.toString.call(obj) === "[object RegExp]"; }; exports.isBuffer = function (obj) { if (obj === null || typeof obj === "undefined") { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /** * 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. * * @providesModule emptyFunction */ function makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ function emptyFunction() {} emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; module.exports = emptyFunction; /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { "use strict"; // Load modules var Stringify = __webpack_require__(45); var Parse = __webpack_require__(46); // Declare internals var internals = {}; module.exports = { stringify: Stringify, parse: Parse }; /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { "use strict"; // Load modules var Utils = __webpack_require__(42); // Declare internals var internals = { delimiter: "&", indices: true }; internals.stringify = function (obj, prefix, options) { if (Utils.isBuffer(obj)) { obj = obj.toString(); } else if (obj instanceof Date) { obj = obj.toISOString(); } else if (obj === null) { obj = ""; } if (typeof obj === "string" || typeof obj === "number" || typeof obj === "boolean") { return [encodeURIComponent(prefix) + "=" + encodeURIComponent(obj)]; } var values = []; if (typeof obj === "undefined") { return values; } var objKeys = Object.keys(obj); for (var i = 0, il = objKeys.length; i < il; ++i) { var key = objKeys[i]; if (!options.indices && Array.isArray(obj)) { values = values.concat(internals.stringify(obj[key], prefix, options)); } else { values = values.concat(internals.stringify(obj[key], prefix + "[" + key + "]", options)); } } return values; }; module.exports = function (obj, options) { options = options || {}; var delimiter = typeof options.delimiter === "undefined" ? internals.delimiter : options.delimiter; options.indices = typeof options.indices === "boolean" ? options.indices : internals.indices; var keys = []; if (typeof obj !== "object" || obj === null) { return ""; } var objKeys = Object.keys(obj); for (var i = 0, il = objKeys.length; i < il; ++i) { var key = objKeys[i]; keys = keys.concat(internals.stringify(obj[key], key, options)); } return keys.join(delimiter); }; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { "use strict"; // Load modules var Utils = __webpack_require__(42); // Declare internals var internals = { delimiter: "&", depth: 5, arrayLimit: 20, parameterLimit: 1000 }; internals.parseValues = function (str, options) { var obj = {}; var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); for (var i = 0, il = parts.length; i < il; ++i) { var part = parts[i]; var pos = part.indexOf("]=") === -1 ? part.indexOf("=") : part.indexOf("]=") + 1; if (pos === -1) { obj[Utils.decode(part)] = ""; } else { var key = Utils.decode(part.slice(0, pos)); var val = Utils.decode(part.slice(pos + 1)); if (!obj.hasOwnProperty(key)) { obj[key] = val; } else { obj[key] = [].concat(obj[key]).concat(val); } } } return obj; }; internals.parseObject = function (chain, val, options) { if (!chain.length) { return val; } var root = chain.shift(); var obj = {}; if (root === "[]") { obj = []; obj = obj.concat(internals.parseObject(chain, val, options)); } else { var cleanRoot = root[0] === "[" && root[root.length - 1] === "]" ? root.slice(1, root.length - 1) : root; var index = parseInt(cleanRoot, 10); var indexString = "" + index; if (!isNaN(index) && root !== cleanRoot && indexString === cleanRoot && index >= 0 && index <= options.arrayLimit) { obj = []; obj[index] = internals.parseObject(chain, val, options); } else { obj[cleanRoot] = internals.parseObject(chain, val, options); } } return obj; }; internals.parseKeys = function (key, val, options) { if (!key) { return; } // The regex chunks var parent = /^([^\[\]]*)/; var child = /(\[[^\[\]]*\])/g; // Get the parent var segment = parent.exec(key); // Don't allow them to overwrite object prototype properties if (Object.prototype.hasOwnProperty(segment[1])) { return; } // Stash the parent if it exists var keys = []; if (segment[1]) { keys.push(segment[1]); } // Loop through children appending to the array until we hit depth var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { ++i; if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ""))) { keys.push(segment[1]); } } // If there's a remainder, just add whatever is left if (segment) { keys.push("[" + key.slice(segment.index) + "]"); } return internals.parseObject(keys, val, options); }; module.exports = function (str, options) { if (str === "" || str === null || typeof str === "undefined") { return {}; } options = options || {}; options.delimiter = typeof options.delimiter === "string" || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; options.depth = typeof options.depth === "number" ? options.depth : internals.depth; options.arrayLimit = typeof options.arrayLimit === "number" ? options.arrayLimit : internals.arrayLimit; options.parameterLimit = typeof options.parameterLimit === "number" ? options.parameterLimit : internals.parameterLimit; var tempObj = typeof str === "string" ? internals.parseValues(str, options) : str; var obj = {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0, il = keys.length; i < il; ++i) { var key = keys[i]; var newObj = internals.parseKeys(key, tempObj[key], options); obj = Utils.merge(obj, newObj); } return Utils.compact(obj); }; /***/ } /******/ ]) });
src/components/Shell.js
react-in-action/letters-social
import React from 'react'; import { Provider } from 'react-redux'; import configureStore from '../store/configureStore'; import initialReduxState from '../constants/initialState'; const store = configureStore(initialReduxState); /** * App shell, wraps everything in the provider * @method Shell * @param {[type]} props [description] */ const Shell = props => <Provider store={store}>{props.children}</Provider>; export default Shell;
CompositeUi/src/views/component/SelectorOption.js
kreta-io/kreta
/* * This file is part of the Kreta package. * * (c) Beñat Espiña <benatespina@gmail.com> * (c) Gorka Laucirica <gorka.lauzirika@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import './../../scss/components/_selector-option.scss'; import React from 'react'; import classnames from 'classnames'; class SelectorOption extends React.Component { static propTypes = { alignLeft: React.PropTypes.bool, label: React.PropTypes.string, text: React.PropTypes.string.isRequired, thumbnail: React.PropTypes.element, value: React.PropTypes.string.isRequired, }; render() { const {alignLeft, label, text, thumbnail, ...otherProps} = this.props, classes = classnames('selector-option', { 'selector-option--left': alignLeft, }); let thumbnailEl = ''; if (thumbnail) { thumbnailEl = ( <div className="selector-option__thumbnail"> {thumbnail} </div> ); } return ( <div className={classes} {...otherProps}> {thumbnailEl} <span className="selector-option__label"> {label} </span> <span className="selector-option__value"> {text} </span> </div> ); } } export default SelectorOption;
ajax/libs/6to5/2.1.0/browser-polyfill.js
fbender/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){require("core-js/shim");require("regenerator/runtime")},{"core-js/shim":2,"regenerator/runtime":3}],2:[function(require,module,exports){!function(returnThis,framework,undefined){"use strict";var global=returnThis(),OBJECT="Object",FUNCTION="Function",ARRAY="Array",STRING="String",NUMBER="Number",REGEXP="RegExp",DATE="Date",MAP="Map",SET="Set",WEAKMAP="WeakMap",WEAKSET="WeakSet",SYMBOL="Symbol",PROMISE="Promise",MATH="Math",ARGUMENTS="Arguments",PROTOTYPE="prototype",CONSTRUCTOR="constructor",TO_STRING="toString",TO_LOCALE="toLocaleString",HAS_OWN="hasOwnProperty",FOR_EACH="forEach",PROCESS="process",CREATE_ELEMENT="createElement",Function=global[FUNCTION],Object=global[OBJECT],Array=global[ARRAY],String=global[STRING],Number=global[NUMBER],RegExp=global[REGEXP],Date=global[DATE],Map=global[MAP],Set=global[SET],WeakMap=global[WEAKMAP],WeakSet=global[WEAKSET],Symbol=global[SYMBOL],Math=global[MATH],TypeError=global.TypeError,setTimeout=global.setTimeout,clearTimeout=global.clearTimeout,setImmediate=global.setImmediate,clearImmediate=global.clearImmediate,process=global[PROCESS],nextTick=process&&process.nextTick,document=global.document,navigator=global.navigator,define=global.define,ArrayProto=Array[PROTOTYPE],ObjectProto=Object[PROTOTYPE],FunctionProto=Function[PROTOTYPE],Infinity=1/0,DOT=".";function isObject(it){return it!=null&&(typeof it=="object"||typeof it=="function")}function isFunction(it){return typeof it=="function"}var isNative=ctx(/./.test,/\[native code\]\s*\}\s*$/,1);var toString=ObjectProto[TO_STRING];var buildIn={Undefined:1,Null:1,Array:1,String:1,Arguments:1,Function:1,Error:1,Boolean:1,Number:1,Date:1,RegExp:1},TO_STRING_TAG=TO_STRING+"Tag";function setToStringTag(it,tag,stat){if(it)has(it=stat?it:it[PROTOTYPE],SYMBOL_TAG)||hidden(it,SYMBOL_TAG,tag)}function cof(it){return it==undefined?it===undefined?"Undefined":"Null":toString.call(it).slice(8,-1)}function classof(it){var klass=cof(it),tag;return klass==OBJECT&&(tag=it[SYMBOL_TAG])?has(buildIn,tag)?"~"+tag:tag:klass}var call=FunctionProto.call,REFERENCE_GET;function part(){var length=arguments.length,args=Array(length),i=0,_=path._,holder=false;while(length>i)if((args[i]=arguments[i++])===_)holder=true;return partial(this,args,length,holder,_,false)}function partial(fn,argsPart,lengthPart,holder,_,bind,context){assertFunction(fn);return function(){var that=bind?context:this,length=arguments.length,i=0,j=0,args;if(!holder&&!length)return invoke(fn,argsPart,that);args=argsPart.slice();if(holder)for(;lengthPart>i;i++)if(args[i]===_)args[i]=arguments[j++];while(length>j)args.push(arguments[j++]);return invoke(fn,args,that)}}function ctx(fn,that,length){assertFunction(fn);if(~length&&that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}function invoke(fn,args,that){var un=that===undefined;switch(args.length|0){case 0:return un?fn():fn.call(that);case 1:return un?fn(args[0]):fn.call(that,args[0]);case 2:return un?fn(args[0],args[1]):fn.call(that,args[0],args[1]);case 3:return un?fn(args[0],args[1],args[2]):fn.call(that,args[0],args[1],args[2]);case 4:return un?fn(args[0],args[1],args[2],args[3]):fn.call(that,args[0],args[1],args[2],args[3]);case 5:return un?fn(args[0],args[1],args[2],args[3],args[4]):fn.call(that,args[0],args[1],args[2],args[3],args[4])}return fn.apply(that,args)}var create=Object.create,getPrototypeOf=Object.getPrototypeOf,defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,getOwnDescriptor=Object.getOwnPropertyDescriptor,getKeys=Object.keys,getNames=Object.getOwnPropertyNames,getSymbols=Object.getOwnPropertySymbols,ownKeys=function(it){return getSymbols?getNames(it).concat(getSymbols(it)):getNames(it)},has=ctx(call,ObjectProto[HAS_OWN],2),ES5Object=Object;function get(object,key){if(has(object,key))return object[key]}var assign=Object.assign||function(target,source){var T=Object(assertDefined(target)),l=arguments.length,i=1;while(l>i){var S=ES5Object(arguments[i++]),keys=getKeys(S),length=keys.length,j=0,key;while(length>j)T[key=keys[j++]]=S[key]}return T};function keyOf(object,el){var O=ES5Object(object),keys=getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}function array(it){return String(it).split(",")}var push=ArrayProto.push,unshift=ArrayProto.unshift,slice=ArrayProto.slice,splice=ArrayProto.splice,indexOf=ArrayProto.indexOf,forEach=ArrayProto[FOR_EACH];function createArrayMethod(type){var isMap=type==1,isFilter=type==2,isSome=type==3,isEvery=type==4,isFindIndex=type==6,noholes=type==5||isFindIndex;return function(callbackfn,that){var O=Object(assertDefined(this)),self=ES5Object(O),f=ctx(callbackfn,that,3),length=toLength(self.length),index=0,result=isMap?Array(length):isFilter?[]:undefined,val,res;for(;length>index;index++)if(noholes||index in self){val=self[index];res=f(val,index,O);if(type){if(isMap)result[index]=res;else if(res)switch(type){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(isEvery)return false}}return isFindIndex?-1:isSome||isEvery?isEvery:result}}function createArrayContains(isContains){return function(el,fromIndex){var O=ES5Object(assertDefined(this)),length=toLength(O.length),index=toIndex(fromIndex,length);if(isContains&&el!=el){for(;length>index;index++)if(sameNaN(O[index]))return isContains||index}else for(;length>index;index++)if(isContains||index in O){if(O[index]===el)return isContains||index}return!isContains&&-1}}function turn(mapfn,target){assertFunction(mapfn);var memo=target==undefined?[]:Object(target),O=ES5Object(this),length=toLength(O.length),index=0;for(;length>index;index++){if(mapfn(memo,O[index],index,this)===false)break}return memo}function generic(A,B){return typeof A=="function"?A:B}var MAX_SAFE_INTEGER=9007199254740991,ceil=Math.ceil,floor=Math.floor,max=Math.max,min=Math.min,random=Math.random,trunc=Math.trunc||function(it){return(it>0?floor:ceil)(it)};function sameNaN(number){return number!=number}function toInteger(it){return isNaN(it)?0:trunc(it)}function toLength(it){return it>0?min(toInteger(it),MAX_SAFE_INTEGER):0}function toIndex(index,length){var index=toInteger(index);return index<0?max(index+length,0):min(index,length)}function createReplacer(regExp,replace,isStatic){var replacer=isObject(replace)?function(part){return replace[part]}:replace;return function(it){return String(isStatic?it:this).replace(regExp,replacer)}}function createPointAt(toString){return function(pos){var s=String(assertDefined(this)),i=toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return toString?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?toString?s.charAt(i):a:toString?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}var REDUCE_ERROR="Reduce of empty object with no initial value";function assert(condition,msg1,msg2){if(!condition)throw TypeError(msg2?msg1+msg2:msg1)}function assertDefined(it){if(it==undefined)throw TypeError("Function called on null or undefined");return it}function assertFunction(it){assert(isFunction(it),it," is not a function!");return it}function assertObject(it){assert(isObject(it),it," is not an object!");return it}function assertInstance(it,Constructor,name){assert(it instanceof Constructor,name,": use the 'new' operator!")}function descriptor(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}function simpleSet(object,key,value){object[key]=value;return object}function createDefiner(bitmap){return DESC?function(object,key,value){return defineProperty(object,key,descriptor(bitmap,value))}:simpleSet}function uid(key){return SYMBOL+"("+key+")_"+(++sid+random())[TO_STRING](36)}function getWellKnownSymbol(name,setter){return Symbol&&Symbol[name]||(setter?Symbol:safeSymbol)(SYMBOL+DOT+name)}var DESC=!!function(){try{return defineProperty({},0,ObjectProto)}catch(e){}}(),sid=0,hidden=createDefiner(1),set=Symbol?simpleSet:hidden,safeSymbol=Symbol||uid;var ITERATOR="iterator",SYMBOL_ITERATOR=getWellKnownSymbol(ITERATOR),SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG),FF_ITERATOR="@@"+ITERATOR,SUPPORT_FF_ITER=FF_ITERATOR in ArrayProto,ITER=safeSymbol("iter"),KEY=1,VALUE=2,Iterators={},IteratorPrototype={},NATIVE_ITERATORS=SYMBOL_ITERATOR in ArrayProto,BUGGY_ITERATORS="keys"in ArrayProto&&!("next"in[].keys());setIterator(IteratorPrototype,returnThis);function setIterator(O,value){hidden(O,SYMBOL_ITERATOR,value);SUPPORT_FF_ITER&&hidden(O,FF_ITERATOR,value)}function createIterator(Constructor,NAME,next,proto){Constructor[PROTOTYPE]=create(proto||IteratorPrototype,{next:descriptor(1,next)});setToStringTag(Constructor,NAME+" Iterator")}function defineIterator(Constructor,NAME,value,DEFAULT){var proto=Constructor[PROTOTYPE],iter=get(proto,SYMBOL_ITERATOR)||get(proto,FF_ITERATOR)||DEFAULT&&get(proto,DEFAULT)||value;if(framework){setIterator(proto,iter);if(iter!==value){var iterProto=getPrototypeOf(iter.call(new Constructor));setToStringTag(iterProto,NAME+" Iterator",true);has(proto,FF_ITERATOR)&&setIterator(iterProto,returnThis)}}Iterators[NAME]=iter;Iterators[NAME+" Iterator"]=returnThis}function defineStdIterators(Base,NAME,Constructor,next,DEFAULT){function createIter(kind){return function(){return new Constructor(this,kind)}}createIterator(Constructor,NAME,next);defineIterator(Base,NAME,createIter(DEFAULT),DEFAULT==VALUE?"values":"entries");DEFAULT&&$define(PROTO+FORCED*BUGGY_ITERATORS,NAME,{entries:createIter(KEY+VALUE),keys:createIter(KEY),values:createIter(VALUE)})}function iterResult(done,value){return{value:value,done:!!done}}function isIterable(it){var O=Object(it);return SYMBOL_ITERATOR in O||has(Iterators,classof(O))}function getIterator(it){return assertObject((it[SYMBOL_ITERATOR]||Iterators[classof(it)]).call(it))}function stepCall(fn,value,entries){return entries?invoke(fn,value):fn(value)}function forOf(iterable,entries,fn,that){var iterator=getIterator(iterable),f=ctx(fn,that,entries?2:1),step;while(!(step=iterator.next()).done)if(stepCall(f,step.value,entries)===false)return}var html=document&&document.documentElement;var NODE=cof(process)==PROCESS,core={},path=framework?global:core,old=global.core,FORCED=1,GLOBAL=2,STATIC=4,PROTO=8,BIND=16,WRAP=32;function assignHidden(target,src){for(var key in src)hidden(target,key,src[key]);return target}function $define(type,name,source){var key,own,out,exp,isGlobal=type&GLOBAL,target=isGlobal?global:type&STATIC?global[name]:(global[name]||ObjectProto)[PROTOTYPE],exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&FORCED)&&target&&key in target&&(!isFunction(target[key])||isNative(target[key]));out=(own?target:source)[key];if(type&BIND&&own)exp=ctx(out,global);else if(type&WRAP&&!framework&&target[key]==out){exp=function(param){return this instanceof out?new out(param):out(param)};exp[PROTOTYPE]=out[PROTOTYPE]}else exp=type&PROTO&&isFunction(out)?ctx(call,out):out;if(exports[key]!=out)hidden(exports,key,exp);if(framework&&target&&!own){if(isGlobal)target[key]=out;else delete target[key]&&hidden(target,key,out)}}}if(NODE)module.exports=core;if(isFunction(define)&&define.amd)define(function(){return core});if(!NODE||framework){core.noConflict=function(){global.core=old;return core};global.core=core}$define(GLOBAL+FORCED,{global:global});!function(TAG,SymbolRegistry,setter){if(!isNative(Symbol)){Symbol=function(description){assert(!(this instanceof Symbol),SYMBOL+" is not a "+CONSTRUCTOR);var tag=uid(description);setter&&defineProperty(ObjectProto,tag,{configurable:true,set:function(value){hidden(this,tag,value)}});return set(create(Symbol[PROTOTYPE]),TAG,tag)};hidden(Symbol[PROTOTYPE],TO_STRING,function(){return this[TAG]})}$define(GLOBAL+WRAP,{Symbol:Symbol});var symbolStatics={"for":function(key){return has(SymbolRegistry,key+="")?SymbolRegistry[key]:SymbolRegistry[key]=Symbol(key)},iterator:SYMBOL_ITERATOR,keyFor:part.call(keyOf,SymbolRegistry),toStringTag:SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG,true),pure:safeSymbol,set:set,useSetter:function(){setter=true},useSimple:function(){setter=false}};forEach.call(array("hasInstance,isConcatSpreadable,match,replace,search,"+"species,split,toPrimitive,unscopables"),function(it){symbolStatics[it]=getWellKnownSymbol(it)});$define(STATIC,SYMBOL,symbolStatics);setToStringTag(Symbol,SYMBOL);$define(GLOBAL,{Reflect:{ownKeys:ownKeys}})}(safeSymbol("tag"),{},true);!function(isFinite,tmp){var RangeError=global.RangeError,isInteger=Number.isInteger||function(it){return!isObject(it)&&isFinite(it)&&floor(it)===it},sign=Math.sign||function sign(it){return(it=+it)==0||it!=it?it:it<0?-1:1},pow=Math.pow,abs=Math.abs,exp=Math.exp,log=Math.log,sqrt=Math.sqrt,fcc=String.fromCharCode,at=createPointAt(true);var objectStatic={assign:assign,is:function(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}};"__proto__"in ObjectProto&&function(buggy,set){try{set=ctx(call,getOwnDescriptor(ObjectProto,"__proto__").set,2);set({},ArrayProto)}catch(e){buggy=true}objectStatic.setPrototypeOf=function(O,proto){assertObject(O);assert(proto===null||isObject(proto),proto,": can't set as prototype!");if(buggy)O.__proto__=proto;else set(O,proto);return O}}();$define(STATIC,OBJECT,objectStatic);function asinh(x){return!isFinite(x=+x)||x==0?x:x<0?-asinh(-x):log(x+sqrt(x*x+1))}$define(STATIC,NUMBER,{EPSILON:pow(2,-52),isFinite:function(it){return typeof it=="number"&&isFinite(it)},isInteger:isInteger,isNaN:sameNaN,isSafeInteger:function(number){return isInteger(number)&&abs(number)<=MAX_SAFE_INTEGER},MAX_SAFE_INTEGER:MAX_SAFE_INTEGER,MIN_SAFE_INTEGER:-MAX_SAFE_INTEGER,parseFloat:parseFloat,parseInt:parseInt});$define(STATIC,MATH,{acosh:function(x){return x<1?NaN:log(x+sqrt(x*x-1))},asinh:asinh,atanh:function(x){return x==0?+x:log((1+ +x)/(1-x))/2},cbrt:function(x){return sign(x)*pow(abs(x),1/3)},clz32:function(x){return(x>>>=0)?32-x[TO_STRING](2).length:32},cosh:function(x){return(exp(x)+exp(-x))/2},expm1:function(x){return x==0?+x:x>-1e-6&&x<1e-6?+x+x*x/2:exp(x)-1},fround:function(x){return new Float32Array([x])[0]},hypot:function(value1,value2){var sum=0,length=arguments.length,value;while(length--){value=+arguments[length];if(value==Infinity||value==-Infinity)return Infinity;sum+=value*value}return sqrt(sum)},imul:function(x,y){var UInt16=65535,xl=UInt16&x,yl=UInt16&y;return 0|xl*yl+((UInt16&x>>>16)*yl+xl*(UInt16&y>>>16)<<16>>>0)},log1p:function(x){return x>-1e-8&&x<1e-8?x-x*x/2:log(1+ +x)},log10:function(x){return log(x)/Math.LN10},log2:function(x){return log(x)/Math.LN2},sign:sign,sinh:function(x){return x==0?+x:(exp(x)-exp(-x))/2},tanh:function(x){return isFinite(x)?x==0?+x:(exp(x)-exp(-x))/(exp(x)+exp(-x)):sign(x)},trunc:trunc});setToStringTag(Math,MATH,true);function assertNotRegExp(it){if(isObject(it)&&it instanceof RegExp)throw TypeError()}$define(STATIC,STRING,{fromCodePoint:function(){var res=[],len=arguments.length,i=0,code;while(len>i){code=+arguments[i++];if(toIndex(code,1114111)!==code)throw RangeError(code+" is not a valid code point");res.push(code<65536?fcc(code):fcc(((code-=65536)>>10)+55296,code%1024+56320))}return res.join("")},raw:function(callSite){var raw=ES5Object(assertDefined(callSite.raw)),len=toLength(raw.length),sln=arguments.length,res=[],i=0;while(len>i){res.push(String(raw[i++]));if(i<sln)res.push(String(arguments[i]))}return res.join("")}});$define(PROTO,STRING,{codePointAt:createPointAt(false),endsWith:function(searchString,endPosition){assertNotRegExp(searchString);var len=this.length,end=endPosition===undefined?len:min(toLength(endPosition),len);searchString+="";return String(this).slice(end-searchString.length,end)===searchString},includes:function(searchString,position){return!!~String(assertDefined(this)).indexOf(searchString,position)},repeat:function(count){var str=String(assertDefined(this)),res="",n=toInteger(count);if(0>n||n==Infinity)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res},startsWith:function(searchString,position){assertNotRegExp(searchString);var index=toLength(min(position,this.length));searchString+="";return String(this).slice(index,index+searchString.length)===searchString}});defineStdIterators(String,STRING,function(iterated){set(this,ITER,{o:String(iterated),i:0})},function(){var iter=this[ITER],O=iter.o,index=iter.i,point;if(index>=O.length)return iterResult(1);point=at.call(O,index);iter.i+=point.length;return iterResult(0,point)});$define(STATIC,ARRAY,{from:function(arrayLike,mapfn,that){var O=Object(assertDefined(arrayLike)),result=new(generic(this,Array)),mapping=mapfn!==undefined,f=mapping?ctx(mapfn,that,2):undefined,index=0,length;if(isIterable(O))for(var iter=getIterator(O),step;!(step=iter.next()).done;index++){result[index]=mapping?f(step.value,index):step.value}else for(length=toLength(O.length);length>index;index++){result[index]=mapping?f(O[index],index):O[index]}result.length=index;return result},of:function(){var index=0,length=arguments.length,result=new(generic(this,Array))(length);while(length>index)result[index]=arguments[index++];result.length=length;return result}});$define(PROTO,ARRAY,{copyWithin:function(target,start,end){var O=Object(assertDefined(this)),len=toLength(O.length),to=toIndex(target,len),from=toIndex(start,len),fin=end===undefined?len:toIndex(end,len),count=min(fin-from,len-to),inc=1;if(from<to&&to<from+count){inc=-1;from=from+count-1;to=to+count-1}while(count-->0){if(from in O)O[to]=O[from];else delete O[to];to+=inc;from+=inc}return O},fill:function(value,start,end){var O=Object(assertDefined(this)),length=toLength(O.length),index=toIndex(start,length),endPos=end===undefined?length:toIndex(end,length);while(endPos>index)O[index++]=value;return O},find:createArrayMethod(5),findIndex:createArrayMethod(6)});defineStdIterators(Array,ARRAY,function(iterated,kind){set(this,ITER,{o:ES5Object(iterated),i:0,k:kind})},function(){var iter=this[ITER],O=iter.o,index=iter.i++;if(!O||index>=O.length)return iter.o=undefined,iterResult(1);switch(iter.k){case KEY:return iterResult(0,index);case VALUE:return iterResult(0,O[index])}return iterResult(0,[index,O[index]])},VALUE);Iterators[ARGUMENTS]=Iterators[ARRAY];setToStringTag(global.JSON,"JSON",true);if(framework){tmp[SYMBOL_TAG]=DOT;if(cof(tmp)!=DOT)hidden(ObjectProto,TO_STRING,function(){return"[object "+classof(this)+"]"});if(/./g.flags!="g")defineProperty(RegExp[PROTOTYPE],"flags",{configurable:true,get:createReplacer(/^.*\/(\w*)$/,"$1")})}}(isFinite,{});isFunction(setImmediate)&&isFunction(clearImmediate)||function(ONREADYSTATECHANGE){var postMessage=global.postMessage,addEventListener=global.addEventListener,MessageChannel=global.MessageChannel,counter=0,queue={},defer,channel,port;setImmediate=function(fn){var args=[],i=1;while(arguments.length>i)args.push(arguments[i++]);queue[++counter]=function(){invoke(isFunction(fn)?fn:Function(fn),args)};defer(counter);return counter};clearImmediate=function(id){delete queue[id]};function run(id){if(has(queue,id)){var fn=queue[id];delete queue[id];fn()}}function listner(event){run(event.data)}if(NODE){defer=function(id){nextTick(part.call(run,id))}}else if(addEventListener&&isFunction(postMessage)&&!global.importScripts){defer=function(id){postMessage(id,"*")};addEventListener("message",listner,false)}else if(isFunction(MessageChannel)){channel=new MessageChannel;port=channel.port2;channel.port1.onmessage=listner;defer=ctx(port.postMessage,port,1)}else if(document&&ONREADYSTATECHANGE in document[CREATE_ELEMENT]("script")){defer=function(id){html.appendChild(document[CREATE_ELEMENT]("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this);run(id)}}}else{defer=function(id){setTimeout(part.call(run,id),0)}}}("onreadystatechange");$define(GLOBAL+BIND,{setImmediate:setImmediate,clearImmediate:clearImmediate});!function(Promise,test){isFunction(Promise)&&isFunction(Promise.resolve)&&Promise.resolve(test=new Promise(Function()))==test||function(asap,DEF){function isThenable(o){var then;if(isObject(o))then=o.then;return isFunction(then)?then:false}function notify(def){var chain=def.chain;chain.length&&asap(function(){var msg=def.msg,ok=def.state==1,i=0;while(chain.length>i)!function(react){var cb=ok?react.ok:react.fail,ret,then;try{if(cb){ret=cb===true?msg:cb(msg);if(ret===react.P){react.rej(TypeError(PROMISE+"-chain cycle"))}else if(then=isThenable(ret)){then.call(ret,react.res,react.rej)}else react.res(ret)}else react.rej(msg)}catch(err){react.rej(err)}}(chain[i++]);chain.length=0})}function resolve(msg){var def=this,then,wrapper;if(def.done)return;def.done=true;def=def.def||def;try{if(then=isThenable(msg)){wrapper={def:def,done:false};then.call(msg,ctx(resolve,wrapper,1),ctx(reject,wrapper,1))}else{def.msg=msg;def.state=1;notify(def)}}catch(err){reject.call(wrapper||{def:def,done:false},err)}}function reject(msg){var def=this;if(def.done)return;def.done=true;def=def.def||def;def.msg=msg;def.state=2;notify(def)}Promise=function(executor){assertFunction(executor);assertInstance(this,Promise,PROMISE);var def={chain:[],state:0,done:false,msg:undefined};hidden(this,DEF,def);try{executor(ctx(resolve,def,1),ctx(reject,def,1))}catch(err){reject.call(def,err)}};assignHidden(Promise[PROTOTYPE],{then:function(onFulfilled,onRejected){var react={ok:isFunction(onFulfilled)?onFulfilled:true,fail:isFunction(onRejected)?onRejected:false},P=react.P=new this[CONSTRUCTOR](function(resolve,reject){react.res=assertFunction(resolve);react.rej=assertFunction(reject)}),def=this[DEF];def.chain.push(react);def.state&&notify(def);return P},"catch":function(onRejected){return this.then(undefined,onRejected)}});assignHidden(Promise,{all:function(iterable){var Promise=this,values=[];return new Promise(function(resolve,reject){forOf(iterable,false,push,values);var remaining=values.length,results=Array(remaining);if(remaining)forEach.call(values,function(promise,index){Promise.resolve(promise).then(function(value){results[index]=value;--remaining||resolve(results)},reject)});else resolve(results)})},race:function(iterable){var Promise=this;return new Promise(function(resolve,reject){forOf(iterable,false,function(promise){Promise.resolve(promise).then(resolve,reject)})})},reject:function(r){return new this(function(resolve,reject){reject(r)})},resolve:function(x){return isObject(x)&&getPrototypeOf(x)===this[PROTOTYPE]?x:new this(function(resolve,reject){resolve(x)})}})}(nextTick||setImmediate,safeSymbol("def"));setToStringTag(Promise,PROMISE);$define(GLOBAL+FORCED*!isNative(Promise),{Promise:Promise})}(global[PROMISE]);!function(){var DATA=safeSymbol("data"),UID=safeSymbol("uid"),LAST=safeSymbol("last"),FIRST=safeSymbol("first"),WEAKDATA=safeSymbol("weakData"),WEAKID=safeSymbol("weakId"),SIZE=DESC?safeSymbol("size"):"size",uid=0,wid=0;function getCollection(C,NAME,methods,commonMethods,isMap,isWeak){var ADDER=isMap?"set":"add",proto=C&&C[PROTOTYPE],O={};function initFromIterable(that,iterable){if(iterable!=undefined)forOf(iterable,isMap,that[ADDER],that);return that}function fixSVZ(key,chain){var method=proto[key];framework&&hidden(proto,key,function(a,b){var result=method.call(this,a===0?0:a,b);return chain?this:result})}if(BUGGY_ITERATORS||!(isNative(C)&&(isWeak||has(proto,FOR_EACH)&&has(proto,"entries")))){C=isWeak?function(iterable){assertInstance(this,C,NAME);set(this,WEAKID,wid++);initFromIterable(this,iterable)}:function(iterable){var that=this;assertInstance(that,C,NAME);set(that,DATA,create(null));set(that,SIZE,0);set(that,LAST,undefined);set(that,FIRST,undefined);initFromIterable(that,iterable)};assignHidden(assignHidden(C[PROTOTYPE],methods),commonMethods);isWeak||defineProperty(C[PROTOTYPE],"size",{get:function(){return assertDefined(this[SIZE])}})}else{var Native=C,inst=new C,chain=inst[ADDER](isWeak?{}:-0,1),buggyZero;if(!NATIVE_ITERATORS||!C.length){C=function(iterable){assertInstance(this,C,NAME);return initFromIterable(new Native,iterable)};C[PROTOTYPE]=proto}isWeak||inst[FOR_EACH](function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixSVZ("delete");fixSVZ("has");isMap&&fixSVZ("get")}if(buggyZero||chain!==inst)fixSVZ(ADDER,true)}setToStringTag(C,NAME);O[NAME]=C;$define(GLOBAL+WRAP+FORCED*!isNative(C),O);return C}function fastKey(it,create){if(!isObject(it))return(typeof it=="string"?"S":"P")+it;if(!has(it,UID)){if(create)hidden(it,UID,++uid);else return""}return"O"+it[UID]}function def(that,key,value){var index=fastKey(key,true),data=that[DATA],last=that[LAST],entry;if(index in data)data[index].v=value;else{entry=data[index]={k:key,v:value,p:last};if(!that[FIRST])that[FIRST]=entry;if(last)last.n=entry;that[LAST]=entry;that[SIZE]++}return that}function del(that,index){var data=that[DATA],entry=data[index],next=entry.n,prev=entry.p;delete data[index];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that[FIRST]==entry)that[FIRST]=next;if(that[LAST]==entry)that[LAST]=prev;that[SIZE]--}var collectionMethods={clear:function(){for(var index in this[DATA])del(this,index)},"delete":function(key){var index=fastKey(key),contains=index in this[DATA];if(contains)del(this,index);return contains},forEach:function(callbackfn,that){var f=ctx(callbackfn,that,3),entry;while(entry=entry?entry.n:this[FIRST]){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function(key){return fastKey(key)in this[DATA]}};Map=getCollection(Map,MAP,{get:function(key){var entry=this[DATA][fastKey(key)];return entry&&entry.v},set:function(key,value){return def(this,key===0?0:key,value)}},collectionMethods,true);Set=getCollection(Set,SET,{add:function(value){return def(this,value=value===0?0:value,value)}},collectionMethods);function getWeakData(it){has(it,WEAKDATA)||hidden(it,WEAKDATA,{});return it[WEAKDATA]}function weakCollectionHas(key){return isObject(key)&&has(key,WEAKDATA)&&has(key[WEAKDATA],this[WEAKID])}var weakCollectionMethods={"delete":function(key){return weakCollectionHas.call(this,key)&&delete key[WEAKDATA][this[WEAKID]]},has:weakCollectionHas};WeakMap=getCollection(WeakMap,WEAKMAP,{get:function(key){if(isObject(key)&&has(key,WEAKDATA))return key[WEAKDATA][this[WEAKID]]},set:function(key,value){getWeakData(assertObject(key))[this[WEAKID]]=value;return this}},weakCollectionMethods,true,true);WeakSet=getCollection(WeakSet,WEAKSET,{add:function(value){getWeakData(assertObject(value))[this[WEAKID]]=true;return this}},weakCollectionMethods,false,true);function defineCollectionIterators(C,NAME,DEFAULT){defineStdIterators(C,NAME,function(iterated,kind){set(this,ITER,{o:iterated,k:kind})},function(){var iter=this[ITER],O=iter.o,entry=iter.l;while(entry&&entry.r)entry=entry.p;if(!O||!(iter.l=entry=entry?entry.n:O[FIRST]))return iter.o=undefined,iterResult(1);switch(iter.k){case KEY:return iterResult(0,entry.k);case VALUE:return iterResult(0,entry.v)}return iterResult(0,[entry.k,entry.v])},DEFAULT)}defineCollectionIterators(Map,MAP,KEY+VALUE);defineCollectionIterators(Set,SET,VALUE)}();!function(){$define(PROTO,ARRAY,{includes:createArrayContains(true)});$define(PROTO,STRING,{at:createPointAt(true)});function createObjectToArray(isEntries){return function(object){var O=ES5Object(object),keys=getKeys(object),length=keys.length,i=0,result=Array(length),key;if(isEntries)while(length>i)result[i]=[key=keys[i++],O[key]];else while(length>i)result[i]=O[keys[i++]];return result}}$define(STATIC,OBJECT,{values:createObjectToArray(false),entries:createObjectToArray(true)});$define(STATIC,REGEXP,{escape:createReplacer(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",true)})}();!function(REFERENCE){REFERENCE_GET=getWellKnownSymbol(REFERENCE+"Get",true);var REFERENCE_SET=getWellKnownSymbol(REFERENCE+SET,true),REFERENCE_DELETE=getWellKnownSymbol(REFERENCE+"Delete",true);$define(STATIC,SYMBOL,{referenceGet:REFERENCE_GET,referenceSet:REFERENCE_SET,referenceDelete:REFERENCE_DELETE});hidden(FunctionProto,REFERENCE_GET,returnThis);function setMapMethods(Constructor){if(Constructor){var MapProto=Constructor[PROTOTYPE];hidden(MapProto,REFERENCE_GET,MapProto.get);hidden(MapProto,REFERENCE_SET,MapProto.set);hidden(MapProto,REFERENCE_DELETE,MapProto["delete"])}}setMapMethods(Map);setMapMethods(WeakMap)}("reference");!function(){function setArrayStatics(keys,length){$define(STATIC,ARRAY,turn.call(array(keys),function(memo,key){if(key in ArrayProto)memo[key]=ctx(call,ArrayProto[key],length)},{}))}setArrayStatics("pop,reverse,shift,keys,values,entries",1);setArrayStatics("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3);setArrayStatics("join,slice,concat,push,splice,unshift,sort,lastIndexOf,"+"reduce,reduceRight,copyWithin,fill,turn")}();!function(console,apply,enabled){try{delete global.console}catch(e){}$define(GLOBAL+FORCED,{console:turn.call(array("assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,"+"groupEnd,info,isIndependentlyComposed,log,markTimeline,profile,profileEnd,"+"table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn"),function(memo,key){var fn=console[key];memo[key]=function(){if(enabled&&fn)return apply.call(fn,console,arguments)}},{enable:function(){enabled=true},disable:function(){enabled=false}})})}(global.console||{},FunctionProto.apply,true)}(Function("return this"),true)},{}],3:[function(require,module,exports){!function(){var hasOwn=Object.prototype.hasOwnProperty;var undefined;var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";if(typeof regeneratorRuntime==="object"){return}var runtime=regeneratorRuntime=typeof exports==="undefined"?{}:exports;function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])}runtime.wrap=wrap;var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype;GeneratorFunction.prototype=Gp.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunction.displayName="GeneratorFunction";runtime.isGeneratorFunction=function(genFun){var ctor=typeof genFun==="function"&&genFun.constructor;return ctor?ctor===GeneratorFunction||(ctor.displayName||ctor.name)==="GeneratorFunction":false};runtime.mark=function(genFun){genFun.__proto__=GeneratorFunctionPrototype;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){try{var info=this(arg);var 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){return doneResult()}while(true){var delegate=context.delegate;if(delegate){try{var 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;var 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){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;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{next:doneResult}}runtime.values=values;function doneResult(){return{value:undefined,done:true}}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;if(record.type==="throw"){var 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}}}()},{}]},{},[1]);
react/src/components/BlogButtons.js
sdcaulley/sdcaulley-portfolio
import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; export function BlogButton(props) { return ( <div> <button name={props.name}> <Link to='/blog/edit'>{props.value}</Link> </button> </div> ); } BlogButton.propTypes = { name: PropTypes.string, value: PropTypes.string };
admin/client/App/shared/Portal.js
w01fgang/keystone
/** * Used by the Popout component and the Lightbox component of the fields for * popouts. Renders a non-react DOM node. */ import React from 'react'; import ReactDOM from 'react-dom'; module.exports = React.createClass({ displayName: 'Portal', portalElement: null, // eslint-disable-line react/sort-comp componentDidMount () { const el = document.createElement('div'); document.body.appendChild(el); this.portalElement = el; this.componentDidUpdate(); }, componentWillUnmount () { document.body.removeChild(this.portalElement); }, componentDidUpdate () { ReactDOM.render(<div {...this.props} />, this.portalElement); }, getPortalDOMNode () { return this.portalElement; }, render () { return null; }, });
Resume/src/Resume.Web/wwwroot/lib/jquery-validation/lib/jquery-1.7.2.js
ProjectThemes/BUUResume
/*! * jQuery JavaScript Library v1.7.2 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Wed Mar 21 12:46:34 2012 -0700 */ (function( window, undefined ) { // Use the correct document accordingly with window argument (sandbox) var document = window.document, navigator = window.navigator, location = window.location; var jQuery = (function() { // Define a local copy of jQuery var jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // A central reference to the root jQuery(document) rootjQuery, // A simple way to check for HTML strings or ID strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, // Check if a string has a non-whitespace character in it rnotwhite = /\S/, // Used for trimming whitespace trimLeft = /^\s+/, trimRight = /\s+$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, // Useragent RegExp rwebkit = /(webkit)[ \/]([\w.]+)/, ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, rmsie = /(msie) ([\w.]+)/, rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, // Matches dashed string for camelizing rdashAlpha = /-([a-z]|[0-9])/ig, rmsPrefix = /^-ms-/, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return ( letter + "" ).toUpperCase(); }, // Keep a UserAgent string for use with jQuery.browser userAgent = navigator.userAgent, // For matching the engine and version of the browser browserMatch, // The deferred used on DOM ready readyList, // The ready event handler DOMContentLoaded, // Save a reference to some core methods toString = Object.prototype.toString, hasOwn = Object.prototype.hasOwnProperty, push = Array.prototype.push, slice = Array.prototype.slice, trim = String.prototype.trim, indexOf = Array.prototype.indexOf, // [[Class]] -> type pairs class2type = {}; jQuery.fn = jQuery.prototype = { constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem, ret, doc; // Handle $(""), $(null), or $(undefined) if ( !selector ) { return this; } // Handle $(DOMElement) if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; } // The body element only exists once, optimize finding it if ( selector === "body" && !context && document.body ) { this.context = document; this[0] = document.body; this.selector = selector; this.length = 1; return this; } // Handle HTML strings if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = quickExpr.exec( selector ); } // Verify a match, and that no context was specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; doc = ( context ? context.ownerDocument || context : document ); // If a single string is passed in and it's a single tag // just do a createElement and skip the rest ret = rsingleTag.exec( selector ); if ( ret ) { if ( jQuery.isPlainObject( context ) ) { selector = [ document.createElement( ret[1] ) ]; jQuery.fn.attr.call( selector, context, true ); } else { selector = [ doc.createElement( ret[1] ) ]; } } else { ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; } return jQuery.merge( this, selector ); // HANDLE: $("#id") } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The current version of jQuery being used jquery: "1.7.2", // The default length of a jQuery object is 0 length: 0, // The number of elements contained in the matched element set size: function() { return this.length; }, toArray: function() { return slice.call( this, 0 ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = this.constructor(); if ( jQuery.isArray( elems ) ) { push.apply( ret, elems ); } else { jQuery.merge( ret, elems ); } // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; if ( name === "find" ) { ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; } else if ( name ) { ret.selector = this.selector + "." + name + "(" + selector + ")"; } // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Attach the listeners jQuery.bindReady(); // Add the callback readyList.add( fn ); return this; }, eq: function( i ) { i = +i; return i === -1 ? this.slice( i ) : this.slice( i, i + 1 ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ), "slice", slice.call(arguments).join(",") ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Either a released hold or an DOMready/load event and not yet ready if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready, 1 ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.fireWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger( "ready" ).off( "ready" ); } } }, bindReady: function() { if ( readyList ) { return; } readyList = jQuery.Callbacks( "once memory" ); // Catch cases where $(document).ready() is called after the // browser event has already occurred. if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready return setTimeout( jQuery.ready, 1 ); } // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", jQuery.ready, false ); // If IE event model is used } else if ( document.attachEvent ) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent( "onreadystatechange", DOMContentLoaded ); // A fallback to window.onload, that will always work window.attachEvent( "onload", jQuery.ready ); // If IE and not a frame // continually check to see if the document is ready var toplevel = false; try { toplevel = window.frameElement == null; } catch(e) {} if ( document.documentElement.doScroll && toplevel ) { doScrollCheck(); } } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { return obj == null ? String( obj ) : class2type[ toString.call(obj) ] || "object"; }, isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { for ( var name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, parseJSON: function( data ) { if ( typeof data !== "string" || !data ) { return null; } // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { if ( typeof data !== "string" || !data ) { return null; } var xml, tmp; try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && rnotwhite.test( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); }, // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length, isObj = length === undefined || jQuery.isFunction( object ); if ( args ) { if ( isObj ) { for ( name in object ) { if ( callback.apply( object[ name ], args ) === false ) { break; } } } else { for ( ; i < length; ) { if ( callback.apply( object[ i++ ], args ) === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isObj ) { for ( name in object ) { if ( callback.call( object[ name ], name, object[ name ] ) === false ) { break; } } } else { for ( ; i < length; ) { if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { break; } } } } return object; }, // Use native String.trim function wherever possible trim: trim ? function( text ) { return text == null ? "" : trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); }, // results is for internal usage only makeArray: function( array, results ) { var ret = results || []; if ( array != null ) { // The window, strings (and functions) also have 'length' // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 var type = jQuery.type( array ); if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { push.call( ret, array ); } else { jQuery.merge( ret, array ); } } return ret; }, inArray: function( elem, array, i ) { var len; if ( array ) { if ( indexOf ) { return indexOf.call( array, elem, i ); } len = array.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in array && array[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var i = first.length, j = 0; if ( typeof second.length === "number" ) { for ( var l = second.length; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var ret = [], retVal; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( var i = 0, length = elems.length; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, key, ret = [], i = 0, length = elems.length, // jquery objects are treated as arrays isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( key in elems ) { value = callback( elems[ key ], key, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return ret.concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { if ( typeof context === "string" ) { var tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind var args = slice.call( arguments, 2 ), proxy = function() { return fn.apply( context, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; return proxy; }, // Mutifunctional method to get and set values to a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, pass ) { var exec, bulk = key == null, i = 0, length = elems.length; // Sets many values if ( key && typeof key === "object" ) { for ( i in key ) { jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); } chainable = 1; // Sets one value } else if ( value !== undefined ) { // Optionally, function values get executed if exec is true exec = pass === undefined && jQuery.isFunction( value ); if ( bulk ) { // Bulk operations only iterate when executing function values if ( exec ) { exec = fn; fn = function( elem, key, value ) { return exec.call( jQuery( elem ), value ); }; // Otherwise they run against the entire set } else { fn.call( elems, value ); fn = null; } } if ( fn ) { for (; i < length; i++ ) { fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); } } chainable = 1; } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // Use of jQuery.browser is frowned upon. // More details: http://docs.jquery.com/Utilities/jQuery.browser uaMatch: function( ua ) { ua = ua.toLowerCase(); var match = rwebkit.exec( ua ) || ropera.exec( ua ) || rmsie.exec( ua ) || ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || []; return { browser: match[1] || "", version: match[2] || "0" }; }, sub: function() { function jQuerySub( selector, context ) { return new jQuerySub.fn.init( selector, context ); } jQuery.extend( true, jQuerySub, this ); jQuerySub.superclass = this; jQuerySub.fn = jQuerySub.prototype = this(); jQuerySub.fn.constructor = jQuerySub; jQuerySub.sub = this.sub; jQuerySub.fn.init = function init( selector, context ) { if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { context = jQuerySub( context ); } return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); }; jQuerySub.fn.init.prototype = jQuerySub.fn; var rootjQuerySub = jQuerySub(document); return jQuerySub; }, browser: {} }); // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); browserMatch = jQuery.uaMatch( userAgent ); if ( browserMatch.browser ) { jQuery.browser[ browserMatch.browser ] = true; jQuery.browser.version = browserMatch.version; } // Deprecated, use jQuery.browser.webkit instead if ( jQuery.browser.webkit ) { jQuery.browser.safari = true; } // IE doesn't match non-breaking spaces with \s if ( rnotwhite.test( "\xA0" ) ) { trimLeft = /^[\s\xA0]+/; trimRight = /[\s\xA0]+$/; } // All jQuery objects should point back to these rootjQuery = jQuery(document); // Cleanup functions for the document ready method if ( document.addEventListener ) { DOMContentLoaded = function() { document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); jQuery.ready(); }; } else if ( document.attachEvent ) { DOMContentLoaded = function() { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", DOMContentLoaded ); jQuery.ready(); } }; } // The DOM ready check for Internet Explorer function doScrollCheck() { if ( jQuery.isReady ) { return; } try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch(e) { setTimeout( doScrollCheck, 1 ); return; } // and execute any waiting functions jQuery.ready(); } return jQuery; })(); // String to Object flags format cache var flagsCache = {}; // Convert String-formatted flags into Object-formatted ones and store in cache function createFlags( flags ) { var object = flagsCache[ flags ] = {}, i, length; flags = flags.split( /\s+/ ); for ( i = 0, length = flags.length; i < length; i++ ) { object[ flags[i] ] = true; } return object; } /* * Create a callback list using the following parameters: * * flags: an optional list of space-separated flags that will change how * the callback list behaves * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible flags: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( flags ) { // Convert flags from String-formatted to Object-formatted // (we check in cache first) flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; var // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = [], // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // Flag to know if list is currently firing firing, // First callback to fire (used internally by add and fireWith) firingStart, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // Add one or several callbacks to the list add = function( args ) { var i, length, elem, type, actual; for ( i = 0, length = args.length; i < length; i++ ) { elem = args[ i ]; type = jQuery.type( elem ); if ( type === "array" ) { // Inspect recursively add( elem ); } else if ( type === "function" ) { // Add if not in unique mode and callback is not in if ( !flags.unique || !self.has( elem ) ) { list.push( elem ); } } } }, // Fire callbacks fire = function( context, args ) { args = args || []; memory = !flags.memory || [ context, args ]; fired = true; firing = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { memory = true; // Mark as halted break; } } firing = false; if ( list ) { if ( !flags.once ) { if ( stack && stack.length ) { memory = stack.shift(); self.fireWith( memory[ 0 ], memory[ 1 ] ); } } else if ( memory === true ) { self.disable(); } else { list = []; } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { var length = list.length; add( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away, unless previous // firing was halted (stopOnFalse) } else if ( memory && memory !== true ) { firingStart = length; fire( memory[ 0 ], memory[ 1 ] ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { var args = arguments, argIndex = 0, argLength = args.length; for ( ; argIndex < argLength ; argIndex++ ) { for ( var i = 0; i < list.length; i++ ) { if ( args[ argIndex ] === list[ i ] ) { // Handle firingIndex and firingLength if ( firing ) { if ( i <= firingLength ) { firingLength--; if ( i <= firingIndex ) { firingIndex--; } } } // Remove the element list.splice( i--, 1 ); // If we have some unicity property then // we only need to do this once if ( flags.unique ) { break; } } } } } return this; }, // Control if a given callback is in the list has: function( fn ) { if ( list ) { var i = 0, length = list.length; for ( ; i < length; i++ ) { if ( fn === list[ i ] ) { return true; } } } return false; }, // Remove all callbacks from the list empty: function() { list = []; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory || memory === true ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( stack ) { if ( firing ) { if ( !flags.once ) { stack.push( [ context, args ] ); } } else if ( !( flags.once && memory ) ) { fire( context, args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; var // Static reference to slice sliceDeferred = [].slice; jQuery.extend({ Deferred: function( func ) { var doneList = jQuery.Callbacks( "once memory" ), failList = jQuery.Callbacks( "once memory" ), progressList = jQuery.Callbacks( "memory" ), state = "pending", lists = { resolve: doneList, reject: failList, notify: progressList }, promise = { done: doneList.add, fail: failList.add, progress: progressList.add, state: function() { return state; }, // Deprecated isResolved: doneList.fired, isRejected: failList.fired, then: function( doneCallbacks, failCallbacks, progressCallbacks ) { deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); return this; }, always: function() { deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); return this; }, pipe: function( fnDone, fnFail, fnProgress ) { return jQuery.Deferred(function( newDefer ) { jQuery.each( { done: [ fnDone, "resolve" ], fail: [ fnFail, "reject" ], progress: [ fnProgress, "notify" ] }, function( handler, data ) { var fn = data[ 0 ], action = data[ 1 ], returned; if ( jQuery.isFunction( fn ) ) { deferred[ handler ](function() { returned = fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); } else { newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); } }); } else { deferred[ handler ]( newDefer[ action ] ); } }); }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { if ( obj == null ) { obj = promise; } else { for ( var key in promise ) { obj[ key ] = promise[ key ]; } } return obj; } }, deferred = promise.promise({}), key; for ( key in lists ) { deferred[ key ] = lists[ key ].fire; deferred[ key + "With" ] = lists[ key ].fireWith; } // Handle state deferred.done( function() { state = "resolved"; }, failList.disable, progressList.lock ).fail( function() { state = "rejected"; }, doneList.disable, progressList.lock ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( firstParam ) { var args = sliceDeferred.call( arguments, 0 ), i = 0, length = args.length, pValues = new Array( length ), count = length, pCount = length, deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? firstParam : jQuery.Deferred(), promise = deferred.promise(); function resolveFunc( i ) { return function( value ) { args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; if ( !( --count ) ) { deferred.resolveWith( deferred, args ); } }; } function progressFunc( i ) { return function( value ) { pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; deferred.notifyWith( promise, pValues ); }; } if ( length > 1 ) { for ( ; i < length; i++ ) { if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); } else { --count; } } if ( !count ) { deferred.resolveWith( deferred, args ); } } else if ( deferred !== firstParam ) { deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); } return promise; } }); jQuery.support = (function() { var support, all, a, select, opt, input, fragment, tds, events, eventName, i, isSupported, div = document.createElement( "div" ), documentElement = document.documentElement; // Preliminary tests div.setAttribute("className", "t"); div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; all = div.getElementsByTagName( "*" ); a = div.getElementsByTagName( "a" )[ 0 ]; // Can't get basic test support if ( !all || !all.length || !a ) { return {}; } // First batch of supports tests select = document.createElement( "select" ); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName( "input" )[ 0 ]; support = { // IE strips leading whitespace when .innerHTML is used leadingWhitespace: ( div.firstChild.nodeType === 3 ), // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText instead) style: /top/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: ( a.getAttribute("href") === "/a" ), // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 opacity: /^0.55/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Make sure that if no value is specified for a checkbox // that it defaults to "on". // (WebKit defaults to "" instead) checkOn: ( input.value === "on" ), // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) optSelected: opt.selected, // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) getSetAttribute: div.className !== "t", // Tests for enctype support on a form(#6743) enctype: !!document.createElement("form").enctype, // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", // Will be defined later submitBubbles: true, changeBubbles: true, focusinBubbles: false, deleteExpando: true, noCloneEvent: true, inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableMarginRight: true, pixelMargin: true }; // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Test to see if it's possible to delete an expando from an element // Fails in Internet Explorer try { delete div.test; } catch( e ) { support.deleteExpando = false; } if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { div.attachEvent( "onclick", function() { // Cloning a node shouldn't copy over any // bound event handlers (IE does this) support.noCloneEvent = false; }); div.cloneNode( true ).fireEvent( "onclick" ); } // Check if a radio maintains its value // after being appended to the DOM input = document.createElement("input"); input.value = "t"; input.setAttribute("type", "radio"); support.radioValue = input.value === "t"; input.setAttribute("checked", "checked"); // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "name", "t" ); div.appendChild( input ); fragment = document.createDocumentFragment(); fragment.appendChild( div.lastChild ); // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; fragment.removeChild( input ); fragment.appendChild( div ); // Technique from Juriy Zaytsev // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ // We only care about the case where non-standard event systems // are used, namely in IE. Short-circuiting here helps us to // avoid an eval call (in setAttribute) which can cause CSP // to go haywire. See: https://developer.mozilla.org/en/Security/CSP if ( div.attachEvent ) { for ( i in { submit: 1, change: 1, focusin: 1 }) { eventName = "on" + i; isSupported = ( eventName in div ); if ( !isSupported ) { div.setAttribute( eventName, "return;" ); isSupported = ( typeof div[ eventName ] === "function" ); } support[ i + "Bubbles" ] = isSupported; } } fragment.removeChild( div ); // Null elements to avoid leaks in IE fragment = select = opt = div = input = null; // Run tests that need a body at doc ready jQuery(function() { var container, outer, inner, table, td, offsetSupport, marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, paddingMarginBorderVisibility, paddingMarginBorder, body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } conMarginTop = 1; paddingMarginBorder = "padding:0;margin:0;border:"; positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" + "<table " + style + "' cellpadding='0' cellspacing='0'>" + "<tr><td></td></tr></table>"; container = document.createElement("div"); container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; body.insertBefore( container, body.firstChild ); // Construct the test element div = document.createElement("div"); container.appendChild( div ); // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). // (only IE 8 fails this test) div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>"; tds = div.getElementsByTagName( "td" ); isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Check if empty table cells still have offsetWidth/Height // (IE <= 8 fail this test) support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. For more // info see bug #3333 // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right if ( window.getComputedStyle ) { div.innerHTML = ""; marginDiv = document.createElement( "div" ); marginDiv.style.width = "0"; marginDiv.style.marginRight = "0"; div.style.width = "2px"; div.appendChild( marginDiv ); support.reliableMarginRight = ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; } if ( typeof div.style.zoom !== "undefined" ) { // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout // (IE < 8 does this) div.innerHTML = ""; div.style.width = div.style.padding = "1px"; div.style.border = 0; div.style.overflow = "hidden"; div.style.display = "inline"; div.style.zoom = 1; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Check if elements with layout shrink-wrap their children // (IE 6 does this) div.style.display = "block"; div.style.overflow = "visible"; div.innerHTML = "<div style='width:5px;'></div>"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); } div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; div.innerHTML = html; outer = div.firstChild; inner = outer.firstChild; td = outer.nextSibling.firstChild.firstChild; offsetSupport = { doesNotAddBorder: ( inner.offsetTop !== 5 ), doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) }; inner.style.position = "fixed"; inner.style.top = "20px"; // safari subtracts parent border width here which is 5px offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); inner.style.position = inner.style.top = ""; outer.style.overflow = "hidden"; outer.style.position = "relative"; offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); if ( window.getComputedStyle ) { div.style.marginTop = "1%"; support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; } if ( typeof container.style.zoom !== "undefined" ) { container.style.zoom = 1; } body.removeChild( container ); marginDiv = div = container = null; jQuery.extend( support, offsetSupport ); }); return support; })(); var rbrace = /^(?:\{.*\}|\[.*\])$/, rmultiDash = /([A-Z])/g; jQuery.extend({ cache: {}, // Please use with caution uuid: 0, // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "applet": true }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var privateCache, thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, isEvents = name === "events"; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { elem[ internalKey ] = id = ++jQuery.uuid; } else { id = internalKey; } } if ( !cache[ id ] ) { cache[ id ] = {}; // Avoids exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify if ( !isNode ) { cache[ id ].toJSON = jQuery.noop; } } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } privateCache = thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Users should not attempt to inspect the internal events object using jQuery.data, // it is undocumented and subject to change. But does anyone listen? No. if ( isEvents && !thisCache[ name ] ) { return privateCache.events; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( getByName ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; }, removeData: function( elem, name, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, l, // Reference to internal data cache key internalKey = jQuery.expando, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, // See jQuery.data for more information id = isNode ? elem[ internalKey ] : internalKey; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split( " " ); } } } for ( i = 0, l = name.length; i < l; i++ ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject(cache[ id ]) ) { return; } } // Browsers that fail expando deletion also refuse to delete expandos on // the window, but it will allow it on all other JS objects; other browsers // don't care // Ensure that `cache` is not a window object #10080 if ( jQuery.support.deleteExpando || !cache.setInterval ) { delete cache[ id ]; } else { cache[ id ] = null; } // We destroyed the cache and need to eliminate the expando on the node to avoid // false lookups in the cache for entries that no longer exist if ( isNode ) { // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( jQuery.support.deleteExpando ) { delete elem[ internalKey ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } } }, // For internal use only. _data: function( elem, name, data ) { return jQuery.data( elem, name, data, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { if ( elem.nodeName ) { var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; if ( match ) { return !(match === true || elem.getAttribute("classid") !== match); } } return true; } }); jQuery.fn.extend({ data: function( key, value ) { var parts, part, attr, name, l, elem = this[0], i = 0, data = null; // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attr = elem.attributes; for ( l = attr.length; i < l; i++ ) { name = attr[i].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.substring(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } parts = key.split( ".", 2 ); parts[1] = parts[1] ? "." + parts[1] : ""; part = parts[1] + "!"; return jQuery.access( this, function( value ) { if ( value === undefined ) { data = this.triggerHandler( "getData" + part, [ parts[0] ] ); // Try to fetch any internally stored data first if ( data === undefined && elem ) { data = jQuery.data( elem, key ); data = dataAttr( elem, key, data ); } return data === undefined && parts[1] ? this.data( parts[0] ) : data; } parts[1] = value; this.each(function() { var self = jQuery( this ); self.triggerHandler( "setData" + part, parts ); jQuery.data( this, key, value ); self.triggerHandler( "changeData" + part, parts ); }); }, null, value, arguments.length > 1, null, false ); }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : jQuery.isNumeric( data ) ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { for ( var name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } function handleQueueMarkDefer( elem, type, src ) { var deferDataKey = type + "defer", queueDataKey = type + "queue", markDataKey = type + "mark", defer = jQuery._data( elem, deferDataKey ); if ( defer && ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { // Give room for hard-coded callbacks to fire first // and eventually mark/queue something else on the element setTimeout( function() { if ( !jQuery._data( elem, queueDataKey ) && !jQuery._data( elem, markDataKey ) ) { jQuery.removeData( elem, deferDataKey, true ); defer.fire(); } }, 0 ); } } jQuery.extend({ _mark: function( elem, type ) { if ( elem ) { type = ( type || "fx" ) + "mark"; jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); } }, _unmark: function( force, elem, type ) { if ( force !== true ) { type = elem; elem = force; force = false; } if ( elem ) { type = type || "fx"; var key = type + "mark", count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); if ( count ) { jQuery._data( elem, key, count ); } else { jQuery.removeData( elem, key, true ); handleQueueMarkDefer( elem, type, "mark" ); } } }, queue: function( elem, type, data ) { var q; if ( elem ) { type = ( type || "fx" ) + "queue"; q = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !q || jQuery.isArray(data) ) { q = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { q.push( data ); } } return q || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), fn = queue.shift(), hooks = {}; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } jQuery._data( elem, type + ".run", hooks ); fn.call( elem, function() { jQuery.dequeue( elem, type ); }, hooks ); } if ( !queue.length ) { jQuery.removeData( elem, type + "queue " + type + ".run", true ); handleQueueMarkDefer( elem, type, "queue" ); } } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, object ) { if ( typeof type !== "string" ) { object = type; type = undefined; } type = type || "fx"; var defer = jQuery.Deferred(), elements = this, i = elements.length, count = 1, deferDataKey = type + "defer", queueDataKey = type + "queue", markDataKey = type + "mark", tmp; function resolve() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } } while( i-- ) { if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { count++; tmp.add( resolve ); } } resolve(); return defer.promise( object ); } }); var rclass = /[\n\t\r]/g, rspace = /\s+/, rreturn = /\r/g, rtype = /^(?:button|input)$/i, rfocusable = /^(?:button|input|object|select|textarea)$/i, rclickable = /^a(?:rea)?$/i, rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, nodeHook, boolHook, fixSpecified; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classNames, i, l, elem, setClass, c, cl; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call(this, j, this.className) ); }); } if ( value && typeof value === "string" ) { classNames = value.split( rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; if ( elem.nodeType === 1 ) { if ( !elem.className && classNames.length === 1 ) { elem.className = value; } else { setClass = " " + elem.className + " "; for ( c = 0, cl = classNames.length; c < cl; c++ ) { if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { setClass += classNames[ c ] + " "; } } elem.className = jQuery.trim( setClass ); } } } } return this; }, removeClass: function( value ) { var classNames, i, l, elem, className, c, cl; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call(this, j, this.className) ); }); } if ( (value && typeof value === "string") || value === undefined ) { classNames = ( value || "" ).split( rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; if ( elem.nodeType === 1 && elem.className ) { if ( value ) { className = (" " + elem.className + " ").replace( rclass, " " ); for ( c = 0, cl = classNames.length; c < cl; c++ ) { className = className.replace(" " + classNames[ c ] + " ", " "); } elem.className = jQuery.trim( className ); } else { elem.className = ""; } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.split( rspace ); while ( (className = classNames[ i++ ]) ) { // check each className given, space seperated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } } else if ( type === "undefined" || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // toggle whole className this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { return true; } } return false; }, val: function( value ) { var hooks, ret, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var self = jQuery(this), val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, self.val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // attributes.value is undefined in Blackberry 4.7 but // uses .value. See #6932 var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } }, select: { get: function( elem ) { var value, i, max, option, index = elem.selectedIndex, values = [], options = elem.options, one = elem.type === "select-one"; // Nothing was selected if ( index < 0 ) { return null; } // Loop through all the selected options i = one ? index : 0; max = one ? index + 1 : options.length; for ( ; i < max; i++ ) { option = options[ i ]; // Don't return options that are disabled or in a disabled optgroup if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } // Fixes Bug #2551 -- select.val() broken in IE after form.reset() if ( one && !values.length && options.length ) { return jQuery( options[ index ] ).val(); } return values; }, set: function( elem, value ) { var values = jQuery.makeArray( value ); jQuery(elem).find("option").each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { elem.selectedIndex = -1; } return values; } } }, attrFn: { val: true, css: true, html: true, text: true, data: true, width: true, height: true, offset: true }, attr: function( elem, name, value, pass ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } if ( pass && name in jQuery.attrFn ) { return jQuery( elem )[ name ]( value ); } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === "undefined" ) { return jQuery.prop( elem, name, value ); } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); // All attributes are lowercase // Grab necessary hook if one is defined if ( notxml ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); return; } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, "" + value ); return value; } } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = elem.getAttribute( name ); // Non-existent attributes return null, we normalize to undefined return ret === null ? undefined : ret; } }, removeAttr: function( elem, value ) { var propName, attrNames, name, l, isBool, i = 0; if ( value && elem.nodeType === 1 ) { attrNames = value.toLowerCase().split( rspace ); l = attrNames.length; for ( ; i < l; i++ ) { name = attrNames[ i ]; if ( name ) { propName = jQuery.propFix[ name ] || name; isBool = rboolean.test( name ); // See #9699 for explanation of this approach (setting first, then removal) // Do not do this for boolean attributes (see #10870) if ( !isBool ) { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); // Set corresponding property to false for boolean attributes if ( isBool && propName in elem ) { elem[ propName ] = false; } } } } }, attrHooks: { type: { set: function( elem, value ) { // We can't allow the type property to be changed (since it causes problems in IE) if ( rtype.test( elem.nodeName ) && elem.parentNode ) { jQuery.error( "type property can't be changed" ); } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to it's default in case type is set after value // This is for element creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } }, // Use the value property for back compat // Use the nodeHook for button elements in IE6/7 (#1954) value: { get: function( elem, name ) { if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { return nodeHook.get( elem, name ); } return name in elem ? elem.value : null; }, set: function( elem, value, name ) { if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { return nodeHook.set( elem, value, name ); } // Does not return so that setAttribute is also used elem.value = value; } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { return ( elem[ name ] = value ); } } else { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { return elem[ name ]; } } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ var attributeNode = elem.getAttributeNode("tabindex"); return attributeNode && attributeNode.specified ? parseInt( attributeNode.value, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } } } }); // Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; // Hook for boolean attributes boolHook = { get: function( elem, name ) { // Align boolean attributes with corresponding properties // Fall back to attribute presence where some booleans are not supported var attrNode, property = jQuery.prop( elem, name ); return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? name.toLowerCase() : undefined; }, set: function( elem, value, name ) { var propName; if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else { // value is true since we know at this point it's type boolean and not false // Set boolean attributes to the same name and set the DOM property propName = jQuery.propFix[ name ] || name; if ( propName in elem ) { // Only set the IDL specifically if it already exists on the element elem[ propName ] = true; } elem.setAttribute( name, name.toLowerCase() ); } return name; } }; // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { fixSpecified = { name: true, id: true, coords: true }; // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = jQuery.valHooks.button = { get: function( elem, name ) { var ret; ret = elem.getAttributeNode( name ); return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? ret.nodeValue : undefined; }, set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { ret = document.createAttribute( name ); elem.setAttributeNode( ret ); } return ( ret.nodeValue = value + "" ); } }; // Apply the nodeHook to tabindex jQuery.attrHooks.tabindex.set = nodeHook.set; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }); }); // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { get: nodeHook.get, set: function( elem, value, name ) { if ( value === "" ) { value = "false"; } nodeHook.set( elem, value, name ); } }; } // Some attributes require a special call on IE if ( !jQuery.support.hrefNormalized ) { jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { get: function( elem ) { var ret = elem.getAttribute( name, 2 ); return ret === null ? undefined : ret; } }); }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Normalize to lowercase since IE uppercases css property names return elem.style.cssText.toLowerCase() || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = "" + value ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }); } // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter if ( !jQuery.support.checkOn ) { jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { get: function( elem ) { // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; } }; }); } jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }); }); var rformElems = /^(?:textarea|input|select)$/i, rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, quickParse = function( selector ) { var quick = rquickIs.exec( selector ); if ( quick ) { // 0 1 2 3 // [ _, tag, id, class ] quick[1] = ( quick[1] || "" ).toLowerCase(); quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); } return quick; }, quickIs = function( elem, m ) { var attrs = elem.attributes || {}; return ( (!m[1] || elem.nodeName.toLowerCase() === m[1]) && (!m[2] || (attrs.id || {}).value === m[2]) && (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) ); }, hoverHack = function( events ) { return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); }; /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { add: function( elem, types, handler, data, selector ) { var elemData, eventHandle, events, t, tns, type, namespaces, handleObj, handleObjIn, quick, handlers, special; // Don't attach events to noData or text/comment nodes (allow plain objects tho) if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first events = elemData.events; if ( !events ) { elemData.events = events = {}; } eventHandle = elemData.handle; if ( !eventHandle ) { elemData.handle = eventHandle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = jQuery.trim( hoverHack(types) ).split( " " ); for ( t = 0; t < types.length; t++ ) { tns = rtypenamespace.exec( types[t] ) || []; type = tns[1]; namespaces = ( tns[2] || "" ).split( "." ).sort(); // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: tns[1], data: data, handler: handler, guid: handler.guid, selector: selector, quick: selector && quickParse( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first handlers = events[ type ]; if ( !handlers ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, global: {}, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), t, tns, type, origType, namespaces, origCount, j, events, special, handle, eventType, handleObj; if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = jQuery.trim( hoverHack( types || "" ) ).split(" "); for ( t = 0; t < types.length; t++ ) { tns = rtypenamespace.exec( types[t] ) || []; type = origType = tns[1]; namespaces = tns[2]; // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector? special.delegateType : special.bindType ) || type; eventType = events[ type ] || []; origCount = eventType.length; namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; // Remove matching events for ( j = 0; j < eventType.length; j++ ) { handleObj = eventType[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !namespaces || namespaces.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { eventType.splice( j--, 1 ); if ( handleObj.selector ) { eventType.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( eventType.length === 0 && origCount !== eventType.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { handle = elemData.handle; if ( handle ) { handle.elem = null; } // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery.removeData( elem, [ "events", "handle" ], true ); } }, // Events that are safe to short-circuit if no handlers are attached. // Native DOM events should not be added, they may have inline handlers. customEvent: { "getData": true, "setData": true, "changeData": true }, trigger: function( event, data, elem, onlyHandlers ) { // Don't do events on text and comment nodes if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { return; } // Event object or event type var type = event.type || event, namespaces = [], cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf( "!" ) >= 0 ) { // Exclusive events trigger only for the exact event (no namespaces) type = type.slice(0, -1); exclusive = true; } if ( type.indexOf( "." ) >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { // No jQuery handlers for this event type, and it can't have inline handlers return; } // Caller can pass in an Event, Object, or just an event type string event = typeof event === "object" ? // jQuery.Event object event[ jQuery.expando ] ? event : // Object literal new jQuery.Event( type, event ) : // Just the event type (string) new jQuery.Event( type ); event.type = type; event.isTrigger = true; event.exclusive = exclusive; event.namespace = namespaces.join( "." ); event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; // Handle a global trigger if ( !elem ) { // TODO: Stop taunting the data cache; remove global events and always attach to document cache = jQuery.cache; for ( i in cache ) { if ( cache[ i ].events && cache[ i ].events[ type ] ) { jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); } } return; } // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data != null ? jQuery.makeArray( data ) : []; data.unshift( event ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) eventPath = [[ elem, special.bindType || type ]]; if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; old = null; for ( ; cur; cur = cur.parentNode ) { eventPath.push([ cur, bubbleType ]); old = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( old && old === elem.ownerDocument ) { eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); } } // Fire handlers on the event path for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { cur = eventPath[i][0]; event.type = eventPath[i][1]; handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Note that this is a bare JS function and not a jQuery handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) // IE<9 dies on focus/blur to hidden element (#1486) if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method old = elem[ ontype ]; if ( old ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; elem[ type ](); jQuery.event.triggered = undefined; if ( old ) { elem[ ontype ] = old; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event || window.event ); var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), delegateCount = handlers.delegateCount, args = [].slice.call( arguments, 0 ), run_all = !event.exclusive && !event.namespace, special = jQuery.event.special[ event.type ] || {}, handlerQueue = [], i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers that should run if there are delegated events // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && !(event.button && event.type === "click") ) { // Pregenerate a single jQuery object for reuse with .is() jqcur = jQuery(this); jqcur.context = this.ownerDocument || this; for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { // Don't process events on disabled elements (#6911, #8165) if ( cur.disabled !== true ) { selMatch = {}; matches = []; jqcur[0] = cur; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; sel = handleObj.selector; if ( selMatch[ sel ] === undefined ) { selMatch[ sel ] = ( handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) ); } if ( selMatch[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, matches: matches }); } } } } // Add the remaining (directly-bound) handlers if ( handlers.length > delegateCount ) { handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); } // Run delegates first; they may want to stop propagation beneath us for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { matched = handlerQueue[ i ]; event.currentTarget = matched.elem; for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { handleObj = matched.matches[ j ]; // Triggered event must either 1) be non-exclusive and have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { event.data = handleObj.data; event.handleObj = handleObj; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { event.result = ret; if ( ret === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, // Includes some event props shared by KeyEvent and MouseEvent // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var eventDoc, doc, body, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, originalEvent = event, fixHook = jQuery.event.fixHooks[ event.type ] || {}, copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = jQuery.Event( originalEvent ); for ( i = copy.length; i; ) { prop = copy[ --i ]; event[ prop ] = originalEvent[ prop ]; } // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Target should not be a text node (#504, Safari) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) if ( event.metaKey === undefined ) { event.metaKey = event.ctrlKey; } return fixHook.filter? fixHook.filter( event, originalEvent ) : event; }, special: { ready: { // Make sure the ready event is setup setup: jQuery.bindReady }, load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function( data, namespaces, eventHandle ) { // We only want to do this special case on windows if ( jQuery.isWindow( this ) ) { this.onbeforeunload = eventHandle; } }, teardown: function( namespaces, eventHandle ) { if ( this.onbeforeunload === eventHandle ) { this.onbeforeunload = null; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; // Some plugins are using, but it's undocumented/deprecated and will be removed. // The 1.7 special event interface should provide all the hooks needed now. jQuery.event.handle = jQuery.event.dispatch; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { if ( elem.detachEvent ) { elem.detachEvent( "on" + type, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; function returnFalse() { return false; } function returnTrue() { return true; } // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { preventDefault: function() { this.isDefaultPrevented = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if preventDefault exists run it on the original event if ( e.preventDefault ) { e.preventDefault(); // otherwise set the returnValue property of the original event to false (IE) } else { e.returnValue = false; } }, stopPropagation: function() { this.isPropagationStopped = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if stopPropagation exists run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // otherwise set the cancelBubble property of the original event to true (IE) e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var target = this, related = event.relatedTarget, handleObj = event.handleObj, selector = handleObj.selector, ret; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !form._submit_attached ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); form._submit_attached = true; } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; jQuery.event.simulate( "change", this, event, true ); } }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); elem._change_attached = true; } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var origFn, type; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // && selector != null // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event var handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( var type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, live: function( types, data, fn ) { jQuery( this.context ).on( types, this.selector, data, fn ); return this; }, die: function( types, fn ) { jQuery( this.context ).off( types, this.selector || "**", fn ); return this; }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { if ( this[0] ) { return jQuery.event.trigger( type, data, this[0], true ); } }, toggle: function( fn ) { // Save reference to arguments for access in closure var args = arguments, guid = fn.guid || jQuery.guid++, i = 0, toggler = function( event ) { // Figure out which function to execute var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ lastToggle ].apply( this, arguments ) || false; }; // link all the functions, so any of them can unbind this click handler toggler.guid = guid; while ( i < args.length ) { args[ i++ ].guid = guid; } return this.click( toggler ); }, hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } }); jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { if ( fn == null ) { fn = data; data = null; } return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; if ( jQuery.attrFn ) { jQuery.attrFn[ name ] = true; } if ( rkeyEvent.test( name ) ) { jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; } if ( rmouseEvent.test( name ) ) { jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; } }); /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, expando = "sizcache" + (Math.random() + '').replace('.', ''), done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true, rBackslash = /\\/g, rReturn = /\r\n/g, rNonWord = /\W/; // Here we check if the JavaScript engine is using some sort of // optimization where it does not always call our comparision // function. If that is the case, discard the hasDuplicate value. // Thus far that includes Google Chrome. [0, 0].sort(function() { baseHasDuplicate = false; return 0; }); var Sizzle = function( selector, context, results, seed ) { results = results || []; context = context || document; var origContext = context; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var m, set, checkSet, extra, ret, cur, pop, i, prune = true, contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); m = chunker.exec( soFar ); if ( m ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } } while ( m ); if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context, seed ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) { selector += parts.shift(); } set = posProcess( selector, set, seed ); } } } else { // Take a shortcut and set the context if the root selector is an ID // (but not if it'll be faster if the inner selector is an ID) if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray( set ); } else { prune = false; } while ( parts.length ) { cur = parts.pop(); pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { Sizzle.error( cur || selector ); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function( results ) { if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort( sortOrder ); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[ i - 1 ] ) { results.splice( i--, 1 ); } } } } return results; }; Sizzle.matches = function( expr, set ) { return Sizzle( expr, null, null, set ); }; Sizzle.matchesSelector = function( node, expr ) { return Sizzle( expr, null, null, [node] ).length > 0; }; Sizzle.find = function( expr, context, isXML ) { var set, i, len, match, type, left; if ( !expr ) { return []; } for ( i = 0, len = Expr.order.length; i < len; i++ ) { type = Expr.order[i]; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { left = match[1]; match.splice( 1, 1 ); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace( rBackslash, "" ); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( "*" ) : []; } return { set: set, expr: expr }; }; Sizzle.filter = function( expr, set, inplace, not ) { var match, anyFound, type, found, item, filter, left, i, pass, old = expr, result = [], curLoop = set, isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); while ( expr && set.length ) { for ( type in Expr.filter ) { if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { filter = Expr.filter[ type ]; left = match[1]; anyFound = false; match.splice(1,1); if ( left.substr( left.length - 1 ) === "\\" ) { continue; } if ( curLoop === result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); pass = not ^ found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } // Improper expression if ( expr === old ) { if ( anyFound == null ) { Sizzle.error( expr ); } else { break; } } old = expr; } return curLoop; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Utility function for retreiving the text value of an array of DOM nodes * @param {Array|Element} elem */ var getText = Sizzle.getText = function( elem ) { var i, node, nodeType = elem.nodeType, ret = ""; if ( nodeType ) { if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent || innerText for elements if ( typeof elem.textContent === 'string' ) { return elem.textContent; } else if ( typeof elem.innerText === 'string' ) { // Replace IE's carriage returns return elem.innerText.replace( rReturn, '' ); } else { // Traverse it's children for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } } else { // If no nodeType, this is expected to be an array for ( i = 0; (node = elem[i]); i++ ) { // Do not traverse comment nodes if ( node.nodeType !== 8 ) { ret += getText( node ); } } } return ret; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function( elem ) { return elem.getAttribute( "href" ); }, type: function( elem ) { return elem.getAttribute( "type" ); } }, relative: { "+": function(checkSet, part){ var isPartStr = typeof part === "string", isTag = isPartStr && !rNonWord.test( part ), isPartStrNotTag = isPartStr && !isTag; if ( isTag ) { part = part.toLowerCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function( checkSet, part ) { var elem, isPartStr = typeof part === "string", i = 0, l = checkSet.length; if ( isPartStr && !rNonWord.test( part ) ) { part = part.toLowerCase(); for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; } } } else { for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !rNonWord.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); }, "~": function( checkSet, part, isXML ) { var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !rNonWord.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); } }, find: { ID: function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }, NAME: function( match, context ) { if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName( match[1] ); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function( match, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( match[1] ); } } }, preFilter: { CLASS: function( match, curLoop, inplace, result, not, isXML ) { match = " " + match[1].replace( rBackslash, "" ) + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { if ( !inplace ) { result.push( elem ); } } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function( match ) { return match[1].replace( rBackslash, "" ); }, TAG: function( match, curLoop ) { return match[1].replace( rBackslash, "" ).toLowerCase(); }, CHILD: function( match ) { if ( match[1] === "nth" ) { if ( !match[2] ) { Sizzle.error( match[0] ); } match[2] = match[2].replace(/^\+|\s*/g, ''); // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); // calculate the numbers (first)n+(last) including if they are negative match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } else if ( match[2] ) { Sizzle.error( match[0] ); } // TODO: Move to normal caching system match[0] = done++; return match; }, ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } // Handle if an un-quoted value was used match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function( match, curLoop, inplace, result, not ) { if ( match[1] === "not" ) { // If we're dealing with a complex expression, or a simple one if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function( match ) { match.unshift( true ); return match; } }, filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; }, disabled: function( elem ) { return elem.disabled === true; }, checked: function( elem ) { return elem.checked === true; }, selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, parent: function( elem ) { return !!elem.firstChild; }, empty: function( elem ) { return !elem.firstChild; }, has: function( elem, i, match ) { return !!Sizzle( match[3], elem ).length; }, header: function( elem ) { return (/h\d/i).test( elem.nodeName ); }, text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, radio: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; }, checkbox: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; }, file: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; }, password: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; }, submit: function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && "submit" === elem.type; }, image: function( elem ) { return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; }, reset: function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && "reset" === elem.type; }, button: function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && "button" === elem.type || name === "button"; }, input: function( elem ) { return (/input|select|textarea|button/i).test( elem.nodeName ); }, focus: function( elem ) { return elem === elem.ownerDocument.activeElement; } }, setFilters: { first: function( elem, i ) { return i === 0; }, last: function( elem, i, match, array ) { return i === array.length - 1; }, even: function( elem, i ) { return i % 2 === 0; }, odd: function( elem, i ) { return i % 2 === 1; }, lt: function( elem, i, match ) { return i < match[3] - 0; }, gt: function( elem, i, match ) { return i > match[3] - 0; }, nth: function( elem, i, match ) { return match[3] - 0 === i; }, eq: function( elem, i, match ) { return match[3] - 0 === i; } }, filter: { PSEUDO: function( elem, match, i, array ) { var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var j = 0, l = not.length; j < l; j++ ) { if ( not[j] === elem ) { return false; } } return true; } else { Sizzle.error( name ); } }, CHILD: function( elem, match ) { var first, last, doneName, parent, cache, count, diff, type = match[1], node = elem; switch ( type ) { case "only": case "first": while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) { return false; } } if ( type === "first" ) { return true; } node = elem; /* falls through */ case "last": while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) { return false; } } return true; case "nth": first = match[2]; last = match[3]; if ( first === 1 && last === 0 ) { return true; } doneName = match[0]; parent = elem.parentNode; if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent[ expando ] = doneName; } diff = elem.nodeIndex - last; if ( first === 0 ) { return diff === 0; } else { return ( diff % first === 0 && diff / first >= 0 ); } } }, ID: function( elem, match ) { return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; }, CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function( elem, match ) { var name = match[1], result = Sizzle.attr ? Sizzle.attr( elem, name ) : Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : !type && Sizzle.attr ? result != null : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value !== check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function( elem, match, i, array ) { var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS, fescape = function(all, num){ return "\\" + (num - 0 + 1); }; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); } // Expose origPOS // "global" as in regardless of relation to brackets/parens Expr.match.globalPOS = origPOS; var makeArray = function( array, results ) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; // Perform a simple check to determine if the browser is capable of // converting a NodeList to an array using builtin methods. // Also verifies that the returned array holds DOM nodes // (which is not the case in the Blackberry browser) try { Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; // Provide a fallback method if it does not work } catch( e ) { makeArray = function( array, results ) { var i = 0, ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( ; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder, siblingCheck; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { return a.compareDocumentPosition ? -1 : 1; } return a.compareDocumentPosition(b) & 4 ? -1 : 1; }; } else { sortOrder = function( a, b ) { // The nodes are identical, we can exit early if ( a === b ) { hasDuplicate = true; return 0; // Fallback to using sourceIndex (in IE) if it's available on both nodes } else if ( a.sourceIndex && b.sourceIndex ) { return a.sourceIndex - b.sourceIndex; } var al, bl, ap = [], bp = [], aup = a.parentNode, bup = b.parentNode, cur = aup; // If the nodes are siblings (or identical) we can do a quick check if ( aup === bup ) { return siblingCheck( a, b ); // If no parents were found then the nodes are disconnected } else if ( !aup ) { return -1; } else if ( !bup ) { return 1; } // Otherwise they're somewhere else in the tree so we need // to build up a full list of the parentNodes for comparison while ( cur ) { ap.unshift( cur ); cur = cur.parentNode; } cur = bup; while ( cur ) { bp.unshift( cur ); cur = cur.parentNode; } al = ap.length; bl = bp.length; // Start walking down the tree looking for a discrepancy for ( var i = 0; i < al && i < bl; i++ ) { if ( ap[i] !== bp[i] ) { return siblingCheck( ap[i], bp[i] ); } } // We ended someplace up the tree so do a sibling check return i === al ? siblingCheck( a, bp[i], -1 ) : siblingCheck( ap[i], b, 1 ); }; siblingCheck = function( a, b, ret ) { if ( a === b ) { return ret; } var cur = a.nextSibling; while ( cur ) { if ( cur === b ) { return -1; } cur = cur.nextSibling; } return 1; }; } // Check to see if the browser returns elements by name when // querying by getElementById (and provide a workaround) (function(){ // We're going to inject a fake input element with a specified name var form = document.createElement("div"), id = "script" + (new Date()).getTime(), root = document.documentElement; form.innerHTML = "<a name='" + id + "'/>"; // Inject it into the root element, check its status, and remove it quickly root.insertBefore( form, root.firstChild ); // The workaround has to do additional checks after a getElementById // Which slows things down for other browsers (hence the branching) if ( document.getElementById( id ) ) { Expr.find.ID = function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function( elem, match ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); // release memory in IE root = form = null; })(); (function(){ // Check to see if the browser returns only elements // when doing getElementsByTagName("*") // Create a fake element var div = document.createElement("div"); div.appendChild( document.createComment("") ); // Make sure no comments are found if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function( match, context ) { var results = context.getElementsByTagName( match[1] ); // Filter out possible comments if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } // Check to see if an attribute returns normalized href attributes div.innerHTML = "<a href='#'></a>"; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function( elem ) { return elem.getAttribute( "href", 2 ); }; } // release memory in IE div = null; })(); if ( document.querySelectorAll ) { (function(){ var oldSizzle = Sizzle, div = document.createElement("div"), id = "__sizzle__"; div.innerHTML = "<p class='TEST'></p>"; // Safari can't handle uppercase or unicode characters when // in quirks mode. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function( query, context, extra, seed ) { context = context || document; // Only use querySelectorAll on non-XML documents // (ID selectors don't work in non-HTML documents) if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } } else { return makeArray( [], extra ); } } try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { var oldContext = context, old = context.getAttribute( "id" ), nid = old || id, hasParent = context.parentNode, relativeHierarchySelector = /^\s*[+~]/.test( query ); if ( !old ) { context.setAttribute( "id", nid ); } else { nid = nid.replace( /'/g, "\\$&" ); } if ( relativeHierarchySelector && hasParent ) { context = context.parentNode; } try { if ( !relativeHierarchySelector || hasParent ) { return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); } } catch(pseudoError) { } finally { if ( !old ) { oldContext.removeAttribute( "id" ); } } } } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } // release memory in IE div = null; })(); } (function(){ var html = document.documentElement, matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; if ( matches ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9 fails this) var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), pseudoWorks = false; try { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); } catch( pseudoError ) { pseudoWorks = true; } Sizzle.matchesSelector = function( node, expr ) { // Make sure that attribute selectors are quoted expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || !disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9, so check for that node.document && node.document.nodeType !== 11 ) { return ret; } } } catch(e) {} } return Sizzle(expr, null, null, [node]).length > 0; }; } })(); (function(){ var div = document.createElement("div"); div.innerHTML = "<div class='test e'></div><div class='test'></div>"; // Opera can't find a second classname (in 9.6) // Also, make sure that getElementsByClassName actually exists if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { return; } // Safari caches class attributes, doesn't catch changes (in 3.2) div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) { return; } Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; // release memory in IE div = null; })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem[ expando ] === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem[ expando ] = doneName; elem.sizset = i; } if ( elem.nodeName.toLowerCase() === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem[ expando ] === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem[ expando ] = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } if ( document.documentElement.contains ) { Sizzle.contains = function( a, b ) { return a !== b && (a.contains ? a.contains(b) : true); }; } else if ( document.documentElement.compareDocumentPosition ) { Sizzle.contains = function( a, b ) { return !!(a.compareDocumentPosition(b) & 16); }; } else { Sizzle.contains = function() { return false; }; } Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; var posProcess = function( selector, context, seed ) { var match, tmpSet = [], later = "", root = context.nodeType ? [context] : context; // Position selectors must be done after the filter // And so must :not(positional) so we move all PSEUDOs to the end while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet, seed ); } return Sizzle.filter( later, tmpSet ); }; // EXPOSE // Override sizzle attribute retrieval Sizzle.attr = jQuery.attr; Sizzle.selectors.attrMap = {}; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })(); var runtil = /Until$/, rparentsprev = /^(?:parents|prevUntil|prevAll)/, // Note: This RegExp should be improved, or likely pulled from Sizzle rmultiselector = /,/, isSimple = /^.[^:#\[\.,]*$/, slice = Array.prototype.slice, POS = jQuery.expr.match.globalPOS, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var self = this, i, l; if ( typeof selector !== "string" ) { return jQuery( selector ).filter(function() { for ( i = 0, l = self.length; i < l; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }); } var ret = this.pushStack( "", "find", selector ), length, n, r; for ( i = 0, l = this.length; i < l; i++ ) { length = ret.length; jQuery.find( selector, this[i], ret ); if ( i > 0 ) { // Make sure that the results are unique for ( n = length; n < ret.length; n++ ) { for ( r = 0; r < length; r++ ) { if ( ret[r] === ret[n] ) { ret.splice(n--, 1); break; } } } } } return ret; }, has: function( target ) { var targets = jQuery( target ); return this.filter(function() { for ( var i = 0, l = targets.length; i < l; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false), "not", selector); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true), "filter", selector ); }, is: function( selector ) { return !!selector && ( typeof selector === "string" ? // If this is a positional selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". POS.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); }, closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; // Array (deprecated as of jQuery 1.7) if ( jQuery.isArray( selectors ) ) { var level = 1; while ( cur && cur.ownerDocument && cur !== context ) { for ( i = 0; i < selectors.length; i++ ) { if ( jQuery( cur ).is( selectors[ i ] ) ) { ret.push({ selector: selectors[ i ], elem: cur, level: level }); } } cur = cur.parentNode; level++; } return ret; } // String var pos = POS.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( i = 0, l = this.length; i < l; i++ ) { cur = this[i]; while ( cur ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; } else { cur = cur.parentNode; if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { break; } } } } ret = ret.length > 1 ? jQuery.unique( ret ) : ret; return this.pushStack( ret, "closest", selectors ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? all : jQuery.unique( all ) ); }, andSelf: function() { return this.add( this.prevObject ); } }); // A painfully simple check to see if an element is disconnected // from a document (should be improved, where feasible). function isDisconnected( node ) { return !node || !node.parentNode || node.parentNode.nodeType === 11; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return jQuery.nth( elem, 2, "nextSibling" ); }, prev: function( elem ) { return jQuery.nth( elem, 2, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.makeArray( elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( !runtil.test( name ) ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret, name, slice.call( arguments ).join(",") ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : jQuery.find.matches(expr, elems); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, nth: function( cur, result, dir, elem ) { result = result || 1; var num = 0; for ( ; cur; cur = cur[dir] ) { if ( cur.nodeType === 1 && ++num === result ) { break; } } return cur; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, keep ) { // Can't pass null or undefined to indexOf in Firefox 4 // Set to 0 to skip string check qualifier = qualifier || 0; if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem, i ) { return ( elem === qualifier ) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem, i ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style)/i, rnocache = /<(?:script|object|embed|option|style)/i, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /\/(java|ecma)script/i, rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], area: [ 1, "<map>", "</map>" ], _default: [ 0, "", "" ] }, safeFragment = createSafeFragment( document ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; // IE can't serialize <link> and <script> tags normally if ( !jQuery.support.htmlSerialize ) { wrapMap._default = [ 1, "div<div>", "</div>" ]; } jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); }, append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this ); }); } else if ( arguments.length ) { var set = jQuery.clean( arguments ); set.push.apply( set, this.toArray() ); return this.pushStack( set, "before", arguments ); } }, after: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this.nextSibling ); }); } else if ( arguments.length ) { var set = this.pushStack( this, "after", arguments ); set.push.apply( set, jQuery.clean(arguments) ); return set; } }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); jQuery.cleanData( [ elem ] ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : null; } if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName( "*" ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function( value ) { if ( this[0] && this[0].parentNode ) { // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( jQuery.isFunction( value ) ) { return this.each(function(i) { var self = jQuery(this), old = self.html(); self.replaceWith( value.call( this, i, old ) ); }); } if ( typeof value !== "string" ) { value = jQuery( value ).detach(); } return this.each(function() { var next = this.nextSibling, parent = this.parentNode; jQuery( this ).remove(); if ( next ) { jQuery(next).before( value ); } else { jQuery(parent).append( value ); } }); } else { return this.length ? this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : this; } }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { var results, first, fragment, parent, value = args[0], scripts = []; // We can't cloneNode fragments that contain checked, in WebKit if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { return this.each(function() { jQuery(this).domManip( args, table, callback, true ); }); } if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); args[0] = value.call(this, i, table ? self.html() : undefined); self.domManip( args, table, callback ); }); } if ( this[0] ) { parent = value && value.parentNode; // If we're in a fragment, just use that instead of building a new one if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { results = { fragment: parent }; } else { results = jQuery.buildFragment( args, this, scripts ); } fragment = results.fragment; if ( fragment.childNodes.length === 1 ) { first = fragment = fragment.firstChild; } else { first = fragment.firstChild; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) { callback.call( table ? root(this[i], first) : this[i], // Make sure that we do not leak memory by inadvertently discarding // the original fragment (which might have attached data) instead of // using it; in addition, use the original fragment object for the last // item instead of first because it can end up being emptied incorrectly // in certain situations (Bug #8070). // Fragments from the fragment cache must always be cloned and never used // in place. results.cacheable || ( l > 1 && i < lastIndex ) ? jQuery.clone( fragment, true, true ) : fragment ); } } if ( scripts.length ) { jQuery.each( scripts, function( i, elem ) { if ( elem.src ) { jQuery.ajax({ type: "GET", global: false, url: elem.src, async: false, dataType: "script" }); } else { jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } }); } } return this; } }); function root( elem, cur ) { return jQuery.nodeName(elem, "table") ? (elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody"))) : elem; } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function cloneFixAttributes( src, dest ) { var nodeName; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } // clearAttributes removes the attributes, which we don't want, // but also removes the attachEvent events, which we *do* want if ( dest.clearAttributes ) { dest.clearAttributes(); } // mergeAttributes, in contrast, only merges back on the // original attributes, not the events if ( dest.mergeAttributes ) { dest.mergeAttributes( src ); } nodeName = dest.nodeName.toLowerCase(); // IE6-8 fail to clone children inside object elements that use // the proprietary classid attribute value (rather than the type // attribute) to identify the type of content to display if ( nodeName === "object" ) { dest.outerHTML = src.outerHTML; } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set if ( src.checked ) { dest.defaultChecked = dest.checked = src.checked; } // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; // IE blanks contents when cloning scripts } else if ( nodeName === "script" && dest.text !== src.text ) { dest.text = src.text; } // Event data gets referenced instead of copied if the expando // gets copied too dest.removeAttribute( jQuery.expando ); // Clear flags for bubbling special change/submit events, they must // be reattached when the newly cloned events are first activated dest.removeAttribute( "_submit_attached" ); dest.removeAttribute( "_change_attached" ); } jQuery.buildFragment = function( args, nodes, scripts ) { var fragment, cacheable, cacheresults, doc, first = args[ 0 ]; // nodes may contain either an explicit document object, // a jQuery collection or context object. // If nodes[0] contains a valid object to assign to doc if ( nodes && nodes[0] ) { doc = nodes[0].ownerDocument || nodes[0]; } // Ensure that an attr object doesn't incorrectly stand in as a document object // Chrome and Firefox seem to allow this to occur and will throw exception // Fixes #8950 if ( !doc.createDocumentFragment ) { doc = document; } // Only cache "small" (1/2 KB) HTML strings that are associated with the main document // Cloning options loses the selected state, so don't cache them // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document && first.charAt(0) === "<" && !rnocache.test( first ) && (jQuery.support.checkClone || !rchecked.test( first )) && (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { cacheable = true; cacheresults = jQuery.fragments[ first ]; if ( cacheresults && cacheresults !== 1 ) { fragment = cacheresults; } } if ( !fragment ) { fragment = doc.createDocumentFragment(); jQuery.clean( args, doc, fragment, scripts ); } if ( cacheable ) { jQuery.fragments[ first ] = cacheresults ? fragment : 1; } return { fragment: fragment, cacheable: cacheable }; }; jQuery.fragments = {}; jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var ret = [], insert = jQuery( selector ), parent = this.length === 1 && this[0].parentNode; if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { insert[ original ]( this[0] ); return this; } else { for ( var i = 0, l = insert.length; i < l; i++ ) { var elems = ( i > 0 ? this.clone(true) : this ).get(); jQuery( insert[i] )[ original ]( elems ); ret = ret.concat( elems ); } return this.pushStack( ret, name, insert.selector ); } }; }); function getAll( elem ) { if ( typeof elem.getElementsByTagName !== "undefined" ) { return elem.getElementsByTagName( "*" ); } else if ( typeof elem.querySelectorAll !== "undefined" ) { return elem.querySelectorAll( "*" ); } else { return []; } } // Used in clean, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( elem.type === "checkbox" || elem.type === "radio" ) { elem.defaultChecked = elem.checked; } } // Finds all inputs and passes them to fixDefaultChecked function findInputs( elem ) { var nodeName = ( elem.nodeName || "" ).toLowerCase(); if ( nodeName === "input" ) { fixDefaultChecked( elem ); // Skip scripts, get other children } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) { jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); } } // Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js function shimCloneNode( elem ) { var div = document.createElement( "div" ); safeFragment.appendChild( div ); div.innerHTML = elem.outerHTML; return div.firstChild; } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var srcElements, destElements, i, // IE<=8 does not properly clone detached, unknown element nodes clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ? elem.cloneNode( true ) : shimCloneNode( elem ); if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // IE copies events bound via attachEvent when using cloneNode. // Calling detachEvent on the clone will also remove the events // from the original. In order to get around this, we use some // proprietary methods to clear the events. Thanks to MooTools // guys for this hotness. cloneFixAttributes( elem, clone ); // Using Sizzle here is crazy slow, so we use getElementsByTagName instead srcElements = getAll( elem ); destElements = getAll( clone ); // Weird iteration because IE will replace the length property // with an element if you are cloning the body and one of the // elements on the page has a name or id of "length" for ( i = 0; srcElements[i]; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { cloneFixAttributes( srcElements[i], destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { cloneCopyEvent( elem, clone ); if ( deepDataAndEvents ) { srcElements = getAll( elem ); destElements = getAll( clone ); for ( i = 0; srcElements[i]; ++i ) { cloneCopyEvent( srcElements[i], destElements[i] ); } } } srcElements = destElements = null; // Return the cloned set return clone; }, clean: function( elems, context, fragment, scripts ) { var checkScriptType, script, j, ret = []; context = context || document; // !context.createElement fails in IE with an error but returns typeof 'object' if ( typeof context.createElement === "undefined" ) { context = context.ownerDocument || context[0] && context[0].ownerDocument || document; } for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( typeof elem === "number" ) { elem += ""; } if ( !elem ) { continue; } // Convert html string into DOM nodes if ( typeof elem === "string" ) { if ( !rhtml.test( elem ) ) { elem = context.createTextNode( elem ); } else { // Fix "XHTML"-style tags in all browsers elem = elem.replace(rxhtmlTag, "<$1></$2>"); // Trim whitespace, otherwise indexOf won't work as expected var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(), wrap = wrapMap[ tag ] || wrapMap._default, depth = wrap[0], div = context.createElement("div"), safeChildNodes = safeFragment.childNodes, remove; // Append wrapper element to unknown element safe doc fragment if ( context === document ) { // Use the fragment we've already created for this document safeFragment.appendChild( div ); } else { // Use a fragment created with the owner document createSafeFragment( context ).appendChild( div ); } // Go to html and back, then peel off extra wrappers div.innerHTML = wrap[1] + elem + wrap[2]; // Move to the right depth while ( depth-- ) { div = div.lastChild; } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> var hasBody = rtbody.test(elem), tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !hasBody ? div.childNodes : []; for ( j = tbody.length - 1; j >= 0 ; --j ) { if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { tbody[ j ].parentNode.removeChild( tbody[ j ] ); } } } // IE completely kills leading whitespace when innerHTML is used if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); } elem = div.childNodes; // Clear elements from DocumentFragment (safeFragment or otherwise) // to avoid hoarding elements. Fixes #11356 if ( div ) { div.parentNode.removeChild( div ); // Guard against -1 index exceptions in FF3.6 if ( safeChildNodes.length > 0 ) { remove = safeChildNodes[ safeChildNodes.length - 1 ]; if ( remove && remove.parentNode ) { remove.parentNode.removeChild( remove ); } } } } } // Resets defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) var len; if ( !jQuery.support.appendChecked ) { if ( elem[0] && typeof (len = elem.length) === "number" ) { for ( j = 0; j < len; j++ ) { findInputs( elem[j] ); } } else { findInputs( elem ); } } if ( elem.nodeType ) { ret.push( elem ); } else { ret = jQuery.merge( ret, elem ); } } if ( fragment ) { checkScriptType = function( elem ) { return !elem.type || rscriptType.test( elem.type ); }; for ( i = 0; ret[i]; i++ ) { script = ret[i]; if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) { scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script ); } else { if ( script.nodeType === 1 ) { var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType ); ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); } fragment.appendChild( script ); } } } return ret; }, cleanData: function( elems ) { var data, id, cache = jQuery.cache, special = jQuery.event.special, deleteExpando = jQuery.support.deleteExpando; for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { continue; } id = elem[ jQuery.expando ]; if ( id ) { data = cache[ id ]; if ( data && data.events ) { for ( var type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } // Null the DOM reference to avoid IE6/7/8 leak (#7054) if ( data.handle ) { data.handle.elem = null; } } if ( deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } delete cache[ id ]; } } } }); var ralpha = /alpha\([^)]*\)/i, ropacity = /opacity=([^)]*)/, // fixed for IE9, see #8346 rupper = /([A-Z]|^ms)/g, rnum = /^[\-+]?(?:\d*\.)?\d+$/i, rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i, rrelNum = /^([\-+])=([\-+.\de]+)/, rmargin = /^margin/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, // order is important! cssExpand = [ "Top", "Right", "Bottom", "Left" ], curCSS, getComputedStyle, currentStyle; jQuery.fn.css = function( name, value ) { return jQuery.access( this, function( elem, name, value ) { return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }; jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } else { return elem.style.opacity; } } } }, // Exclude the following css properties to add px cssNumber: { "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, origName = jQuery.camelCase( name ), style = elem.style, hooks = jQuery.cssHooks[ origName ]; name = jQuery.cssProps[ origName ] || origName; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra ) { var ret, hooks; // Make sure that we're working with the right name name = jQuery.camelCase( name ); hooks = jQuery.cssHooks[ name ]; name = jQuery.cssProps[ name ] || name; // cssFloat needs a special treatment if ( name === "cssFloat" ) { name = "float"; } // If a hook was provided get the computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { return ret; // Otherwise, if a way to get the computed value exists, use that } else if ( curCSS ) { return curCSS( elem, name ); } }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { var old = {}, ret, name; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.call( elem ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); // DEPRECATED in 1.3, Use jQuery.css() instead jQuery.curCSS = jQuery.css; if ( document.defaultView && document.defaultView.getComputedStyle ) { getComputedStyle = function( elem, name ) { var ret, defaultView, computedStyle, width, style = elem.style; name = name.replace( rupper, "-$1" ).toLowerCase(); if ( (defaultView = elem.ownerDocument.defaultView) && (computedStyle = defaultView.getComputedStyle( elem, null )) ) { ret = computedStyle.getPropertyValue( name ); if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { ret = jQuery.style( elem, name ); } } // A tribute to the "awesome hack by Dean Edwards" // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) { width = style.width; style.width = ret; ret = computedStyle.width; style.width = width; } return ret; }; } if ( document.documentElement.currentStyle ) { currentStyle = function( elem, name ) { var left, rsLeft, uncomputed, ret = elem.currentStyle && elem.currentStyle[ name ], style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && (uncomputed = style[ name ]) ) { ret = uncomputed; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( rnumnonpx.test( ret ) ) { // Remember the original values left = style.left; rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; // Put in the new values to get a computed value out if ( rsLeft ) { elem.runtimeStyle.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { elem.runtimeStyle.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } curCSS = getComputedStyle || currentStyle; function getWidthOrHeight( elem, name, extra ) { // Start with offset property var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, i = name === "width" ? 1 : 0, len = 4; if ( val > 0 ) { if ( extra !== "border" ) { for ( ; i < len; i += 2 ) { if ( !extra ) { val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0; } if ( extra === "margin" ) { val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0; } else { val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; } } } return val + "px"; } // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; // Add padding, border, margin if ( extra ) { for ( ; i < len; i += 2 ) { val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0; if ( extra !== "padding" ) { val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; } if ( extra === "margin" ) { val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0; } } } return val + "px"; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { if ( elem.offsetWidth !== 0 ) { return getWidthOrHeight( elem, name, extra ); } else { return jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }); } } }, set: function( elem, value ) { return rnum.test( value ) ? value + "px" : value; } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( parseFloat( RegExp.$1 ) / 100 ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there there is no filter style applied in a css rule, we are done if ( currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } jQuery(function() { // This hook cannot be added until DOM ready because the support test // for it is not run until after DOM ready if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, function() { if ( computed ) { return curCSS( elem, "margin-right" ); } else { return elem.style.marginRight; } }); } }; } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { var width = elem.offsetWidth, height = elem.offsetHeight; return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ], expanded = {}; for ( i = 0; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rhash = /#.*$/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rquery = /\?/, rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, rselectTextarea = /^(?:select|textarea)/i, rspacesAjax = /\s+/, rts = /([?&])_=[^&]*/, rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Document location ajaxLocation, // Document location segments ajaxLocParts, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = ["*/"] + ["*"]; // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } if ( jQuery.isFunction( func ) ) { var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ), i = 0, length = dataTypes.length, dataType, list, placeBefore; // For each dataType in the dataTypeExpression for ( ; i < length; i++ ) { dataType = dataTypes[ i ]; // We control if we're asked to add before // any existing element placeBefore = /^\+/.test( dataType ); if ( placeBefore ) { dataType = dataType.substr( 1 ) || "*"; } list = structure[ dataType ] = structure[ dataType ] || []; // then we add to the structure accordingly list[ placeBefore ? "unshift" : "push" ]( func ); } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, dataType /* internal */, inspected /* internal */ ) { dataType = dataType || options.dataTypes[ 0 ]; inspected = inspected || {}; inspected[ dataType ] = true; var list = structure[ dataType ], i = 0, length = list ? list.length : 0, executeOnly = ( structure === prefilters ), selection; for ( ; i < length && ( executeOnly || !selection ); i++ ) { selection = list[ i ]( options, originalOptions, jqXHR ); // If we got redirected to another dataType // we try there if executing only and not done already if ( typeof selection === "string" ) { if ( !executeOnly || inspected[ selection ] ) { selection = undefined; } else { options.dataTypes.unshift( selection ); selection = inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, selection, inspected ); } } } // If we're only executing or nothing was selected // we try the catchall dataType if not done already if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { selection = inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, "*", inspected ); } // unnecessary when only executing (prefilters) // but it'll be ignored by the caller in that case return selection; } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } } jQuery.fn.extend({ load: function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); // Don't do a request if no elements are being requested } else if ( !this.length ) { return this; } var off = url.indexOf( " " ); if ( off >= 0 ) { var selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // Default to a GET request var type = "GET"; // If the second parameter was provided if ( params ) { // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( typeof params === "object" ) { params = jQuery.param( params, jQuery.ajaxSettings.traditional ); type = "POST"; } } var self = this; // Request the remote document jQuery.ajax({ url: url, type: type, dataType: "html", data: params, // Complete callback (responseText is used internally) complete: function( jqXHR, status, responseText ) { // Store the response as specified by the jqXHR object responseText = jqXHR.responseText; // If successful, inject the HTML into all the matched elements if ( jqXHR.isResolved() ) { // #4825: Get the actual response in case // a dataFilter is present in ajaxSettings jqXHR.done(function( r ) { responseText = r; }); // See if a selector was specified self.html( selector ? // Create a dummy div to hold the results jQuery("<div>") // inject the contents of the document in, removing the scripts // to avoid any 'Permission Denied' errors in IE .append(responseText.replace(rscript, "")) // Locate the specified elements .find(selector) : // If not, just inject the full result responseText ); } if ( callback ) { self.each( callback, [ responseText, status, jqXHR ] ); } } }); return this; }, serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ return this.elements ? jQuery.makeArray( this.elements ) : this; }) .filter(function(){ return this.name && !this.disabled && ( this.checked || rselectTextarea.test( this.nodeName ) || rinput.test( this.type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val, i ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); // Attach a bunch of functions for handling common AJAX events jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ jQuery.fn[ o ] = function( f ){ return this.on( o, f ); }; }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ type: method, url: url, data: data, success: callback, dataType: type }); }; }); jQuery.extend({ getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { if ( settings ) { // Building a settings object ajaxExtend( target, jQuery.ajaxSettings ); } else { // Extending ajaxSettings settings = target; target = jQuery.ajaxSettings; } ajaxExtend( target, settings ); return target; }, ajaxSettings: { url: ajaxLocation, isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, type: "GET", contentType: "application/x-www-form-urlencoded; charset=UTF-8", processData: true, async: true, /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, traditional: false, headers: {}, */ accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": allTypes }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, // List of data converters // 1) key format is "source_type destination_type" (a single space in-between) // 2) the catchall symbol "*" can be used for source_type converters: { // Convert anything to text "* text": window.String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { context: true, url: true } }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events // It's the callbackContext if one was provided in the options // and if it's a DOM node or a jQuery collection globalEventContext = callbackContext !== s && ( callbackContext.nodeType || callbackContext instanceof jQuery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks( "once memory" ), // Status-dependent callbacks statusCode = s.statusCode || {}, // ifModified key ifModifiedKey, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // Response headers responseHeadersString, responseHeaders, // transport transport, // timeout handle timeoutTimer, // Cross-domain detection vars parts, // The jqXHR state state = 0, // To know if global events are to be dispatched fireGlobals, // Loop variable i, // Fake xhr jqXHR = { readyState: 0, // Caches the header setRequestHeader: function( name, value ) { if ( !state ) { var lname = name.toLowerCase(); name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while( ( match = rheaders.exec( responseHeadersString ) ) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match === undefined ? null : match; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Cancel the request abort: function( statusText ) { statusText = statusText || "abort"; if ( transport ) { transport.abort( statusText ); } done( 0, statusText ); return this; } }; // Callback for when everything is done // It is defined here because jslint complains if it is declared // at the end of the function (which would be more logical and readable) function done( status, nativeStatusText, responses, headers ) { // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; var isSuccess, success, error, statusText = nativeStatusText, response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, lastModified, etag; // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) { jQuery.lastModified[ ifModifiedKey ] = lastModified; } if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) { jQuery.etag[ ifModifiedKey ] = etag; } } // If not modified if ( status === 304 ) { statusText = "notmodified"; isSuccess = true; // If we have data } else { try { success = ajaxConvert( s, response ); statusText = "success"; isSuccess = true; } catch(e) { // We have a parsererror statusText = "parsererror"; error = e; } } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( !statusText || status ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = "" + ( nativeStatusText || statusText ); // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } } // Attach deferreds deferred.promise( jqXHR ); jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; jqXHR.complete = completeDeferred.add; // Status-dependent callbacks jqXHR.statusCode = function( map ) { if ( map ) { var tmp; if ( state < 2 ) { for ( tmp in map ) { statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; } } else { tmp = map[ jqXHR.status ]; jqXHR.then( tmp, tmp ); } } return this; }; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // We also use the url parameter if available s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax ); // Determine if a cross-domain request is in order if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return false; } // We can fire global events as of now if asked to fireGlobals = s.global; // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Get ifModifiedKey before adding the anti-cache parameter ifModifiedKey = s.url; // Add anti-cache in url if needed if ( s.cache === false ) { var ts = jQuery.now(), // try replacing _= if it is there ret = s.url.replace( rts, "$1_=" + ts ); // if nothing was replaced, add timestamp to the end s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { ifModifiedKey = ifModifiedKey || s.url; if ( jQuery.lastModified[ ifModifiedKey ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); } if ( jQuery.etag[ ifModifiedKey ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); } } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already jqXHR.abort(); return false; } // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout( function(){ jqXHR.abort( "timeout" ); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch (e) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } return jqXHR; }, // Serialize an array of form elements or a set of // key/values into a query string param: function( a, traditional ) { var s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : value; s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( var prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); } }); function buildParams( prefix, obj, traditional, add ) { if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // If array item is non-scalar (array or object), encode its // numeric index to resolve deserialization ambiguity issues. // Note that rack (as of 1.0.0) can't currently deserialize // nested arrays properly, and attempting to do so may cause // a server error. Possible fixes are to modify rack's // deserialization algorithm or to provide an option or flag // to force array serialization to be shallow. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( var name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // This is still on the jQuery object... for now // Want to move this to jQuery.ajax some day jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {} }); /* Handles responses to an ajax request: * - sets all responseXXX fields accordingly * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields, ct, type, finalDataType, firstDataType; // Fill responseXXX fields for ( type in responseFields ) { if ( type in responses ) { jqXHR[ responseFields[type] ] = responses[ type ]; } } // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } // Chain conversions given the request and the original response function ajaxConvert( s, response ) { // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } var dataTypes = s.dataTypes, converters = {}, i, key, length = dataTypes.length, tmp, // Current and previous dataTypes current = dataTypes[ 0 ], prev, // Conversion expression conversion, // Conversion function conv, // Conversion functions (transitive conversion) conv1, conv2; // For each dataType in the chain for ( i = 1; i < length; i++ ) { // Create converters map // with lowercased keys if ( i === 1 ) { for ( key in s.converters ) { if ( typeof key === "string" ) { converters[ key.toLowerCase() ] = s.converters[ key ]; } } } // Get the dataTypes prev = current; current = dataTypes[ i ]; // If current is auto dataType, update it to prev if ( current === "*" ) { current = prev; // If no auto and dataTypes are actually different } else if ( prev !== "*" && prev !== current ) { // Get the converter conversion = prev + " " + current; conv = converters[ conversion ] || converters[ "* " + current ]; // If there is no direct converter, search transitively if ( !conv ) { conv2 = undefined; for ( conv1 in converters ) { tmp = conv1.split( " " ); if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) { conv2 = converters[ tmp[1] + " " + current ]; if ( conv2 ) { conv1 = converters[ conv1 ]; if ( conv1 === true ) { conv = conv2; } else if ( conv2 === true ) { conv = conv1; } break; } } } } // If we found no converter, dispatch an error if ( !( conv || conv2 ) ) { jQuery.error( "No conversion from " + conversion.replace(" "," to ") ); } // If found converter is not an equivalence if ( conv !== true ) { // Convert with 1 or 2 converters accordingly response = conv ? conv( response ) : conv2( conv1(response) ); } } } return response; } var jsc = jQuery.now(), jsre = /(\=)\?(&|$)|\?\?/i; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { return jQuery.expando + "_" + ( jsc++ ); } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType ); if ( s.dataTypes[ 0 ] === "jsonp" || s.jsonp !== false && ( jsre.test( s.url ) || inspectData && jsre.test( s.data ) ) ) { var responseContainer, jsonpCallback = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback, previous = window[ jsonpCallback ], url = s.url, data = s.data, replace = "$1" + jsonpCallback + "$2"; if ( s.jsonp !== false ) { url = url.replace( jsre, replace ); if ( s.url === url ) { if ( inspectData ) { data = data.replace( jsre, replace ); } if ( s.data === data ) { // Add callback manually url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback; } } } s.url = url; s.data = data; // Install callback window[ jsonpCallback ] = function( response ) { responseContainer = [ response ]; }; // Clean-up function jqXHR.always(function() { // Set callback back to previous value window[ jsonpCallback ] = previous; // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( previous ) ) { window[ jsonpCallback ]( responseContainer[ 0 ] ); } }); // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( jsonpCallback + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Delegate to script return "script"; } }); // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement( "script" ); script.async = "async"; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( head && script.parentNode ) { head.removeChild( script ); } // Dereference the script script = undefined; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709 and #4378). head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( 0, 1 ); } } }; } }); var // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject ? function() { // Abort all pending requests for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( 0, 1 ); } } : false, xhrId = 0, xhrCallbacks; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties (function( xhr ) { jQuery.extend( jQuery.support, { ajax: !!xhr, cors: !!xhr && ( "withCredentials" in xhr ) }); })( jQuery.ajaxSettings.xhr() ); // Create transport if the browser can provide an xhr if ( jQuery.support.ajax ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var xhr = s.xhr(), handle, i; // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers[ "X-Requested-With" ] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( _ ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, statusText, responseHeaders, responses, xml; // Firefox throws exceptions when accessing properties // of an xhr when a network error occured // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); responses = {}; xml = xhr.responseXML; // Construct response list if ( xml && xml.documentElement /* #4958 */ ) { responses.xml = xml; } // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) try { responses.text = xhr.responseText; } catch( _ ) { } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; // if we're in sync mode or it's in cache // and has been retrieved directly (IE6 & IE7) // we need to manually fire the callback if ( !s.async || xhr.readyState === 4 ) { callback(); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback(0,1); } } }; } }); } var elemdisplay = {}, iframe, iframeDoc, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, timerId, fxAttrs = [ // height animations [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], // width animations [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], // opacity animations [ "opacity" ] ], fxNow; jQuery.fn.extend({ show: function( speed, easing, callback ) { var elem, display; if ( speed || speed === 0 ) { return this.animate( genFx("show", 3), speed, easing, callback ); } else { for ( var i = 0, j = this.length; i < j; i++ ) { elem = this[ i ]; if ( elem.style ) { display = elem.style.display; // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !jQuery._data(elem, "olddisplay") && display === "none" ) { display = elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( (display === "" && jQuery.css(elem, "display") === "none") || !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( i = 0; i < j; i++ ) { elem = this[ i ]; if ( elem.style ) { display = elem.style.display; if ( display === "" || display === "none" ) { elem.style.display = jQuery._data( elem, "olddisplay" ) || ""; } } } return this; } }, hide: function( speed, easing, callback ) { if ( speed || speed === 0 ) { return this.animate( genFx("hide", 3), speed, easing, callback); } else { var elem, display, i = 0, j = this.length; for ( ; i < j; i++ ) { elem = this[i]; if ( elem.style ) { display = jQuery.css( elem, "display" ); if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) { jQuery._data( elem, "olddisplay", display ); } } } // Set the display of the elements in a second loop // to avoid the constant reflow for ( i = 0; i < j; i++ ) { if ( this[i].style ) { this[i].style.display = "none"; } } return this; } }, // Save the old toggle function _toggle: jQuery.fn.toggle, toggle: function( fn, fn2, callback ) { var bool = typeof fn === "boolean"; if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { this._toggle.apply( this, arguments ); } else if ( fn == null || bool ) { this.each(function() { var state = bool ? fn : jQuery(this).is(":hidden"); jQuery(this)[ state ? "show" : "hide" ](); }); } else { this.animate(genFx("toggle", 3), fn, fn2, callback); } return this; }, fadeTo: function( speed, to, easing, callback ) { return this.filter(":hidden").css("opacity", 0).show().end() .animate({opacity: to}, speed, easing, callback); }, animate: function( prop, speed, easing, callback ) { var optall = jQuery.speed( speed, easing, callback ); if ( jQuery.isEmptyObject( prop ) ) { return this.each( optall.complete, [ false ] ); } // Do not change referenced properties as per-property easing will be lost prop = jQuery.extend( {}, prop ); function doAnimation() { // XXX 'this' does not always have a nodeName when running the // test suite if ( optall.queue === false ) { jQuery._mark( this ); } var opt = jQuery.extend( {}, optall ), isElement = this.nodeType === 1, hidden = isElement && jQuery(this).is(":hidden"), name, val, p, e, hooks, replace, parts, start, end, unit, method; // will store per property easing and be used to determine when an animation is complete opt.animatedProperties = {}; // first pass over propertys to expand / normalize for ( p in prop ) { name = jQuery.camelCase( p ); if ( p !== name ) { prop[ name ] = prop[ p ]; delete prop[ p ]; } if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) { replace = hooks.expand( prop[ name ] ); delete prop[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'p' from above because we have the correct "name" for ( p in replace ) { if ( ! ( p in prop ) ) { prop[ p ] = replace[ p ]; } } } } for ( name in prop ) { val = prop[ name ]; // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) if ( jQuery.isArray( val ) ) { opt.animatedProperties[ name ] = val[ 1 ]; val = prop[ name ] = val[ 0 ]; } else { opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing'; } if ( val === "hide" && hidden || val === "show" && !hidden ) { return opt.complete.call( this ); } if ( isElement && ( name === "height" || name === "width" ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( this, "display" ) === "inline" && jQuery.css( this, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) { this.style.display = "inline-block"; } else { this.style.zoom = 1; } } } } if ( opt.overflow != null ) { this.style.overflow = "hidden"; } for ( p in prop ) { e = new jQuery.fx( this, opt, p ); val = prop[ p ]; if ( rfxtypes.test( val ) ) { // Tracks whether to show or hide based on private // data attached to the element method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 ); if ( method ) { jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" ); e[ method ](); } else { e[ val ](); } } else { parts = rfxnum.exec( val ); start = e.cur(); if ( parts ) { end = parseFloat( parts[2] ); unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" ); // We need to compute starting value if ( unit !== "px" ) { jQuery.style( this, p, (end || 1) + unit); start = ( (end || 1) / e.cur() ) * start; jQuery.style( this, p, start + unit); } // If a +=/-= token was provided, we're doing a relative animation if ( parts[1] ) { end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start; } e.custom( start, end, unit ); } else { e.custom( start, val, "" ); } } } // For JS strict compliance return true; } return optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var index, hadTimers = false, timers = jQuery.timers, data = jQuery._data( this ); // clear marker counters if we know they won't be if ( !gotoEnd ) { jQuery._unmark( true, this ); } function stopQueue( elem, data, index ) { var hooks = data[ index ]; jQuery.removeData( elem, index, true ); hooks.stop( gotoEnd ); } if ( type == null ) { for ( index in data ) { if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) { stopQueue( this, data, index ); } } } else if ( data[ index = type + ".run" ] && data[ index ].stop ){ stopQueue( this, data, index ); } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { if ( gotoEnd ) { // force the next step to be the last timers[ index ]( true ); } else { timers[ index ].saveState(); } hadTimers = true; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( !( gotoEnd && hadTimers ) ) { jQuery.dequeue( this, type ); } }); } }); // Animations created synchronously will run synchronously function createFxNow() { setTimeout( clearFxNow, 0 ); return ( fxNow = jQuery.now() ); } function clearFxNow() { fxNow = undefined; } // Generate parameters to create a standard animation function genFx( type, num ) { var obj = {}; jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() { obj[ this ] = type; }); return obj; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx( "show", 1 ), slideUp: genFx( "hide", 1 ), slideToggle: genFx( "toggle", 1 ), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.extend({ speed: function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function( noUnmark ) { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } else if ( noUnmark !== false ) { jQuery._unmark( this ); } }; return opt; }, easing: { linear: function( p ) { return p; }, swing: function( p ) { return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5; } }, timers: [], fx: function( elem, options, prop ) { this.options = options; this.elem = elem; this.prop = prop; options.orig = options.orig || {}; } }); jQuery.fx.prototype = { // Simple function for setting a style value update: function() { if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this ); }, // Get the current size cur: function() { if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) { return this.elem[ this.prop ]; } var parsed, r = jQuery.css( this.elem, this.prop ); // Empty strings, null, undefined and "auto" are converted to 0, // complex values such as "rotate(1rad)" are returned as is, // simple values such as "10px" are parsed to Float. return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed; }, // Start an animation from one number to another custom: function( from, to, unit ) { var self = this, fx = jQuery.fx; this.startTime = fxNow || createFxNow(); this.end = to; this.now = this.start = from; this.pos = this.state = 0; this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); function t( gotoEnd ) { return self.step( gotoEnd ); } t.queue = this.options.queue; t.elem = this.elem; t.saveState = function() { if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) { if ( self.options.hide ) { jQuery._data( self.elem, "fxshow" + self.prop, self.start ); } else if ( self.options.show ) { jQuery._data( self.elem, "fxshow" + self.prop, self.end ); } } }; if ( t() && jQuery.timers.push(t) && !timerId ) { timerId = setInterval( fx.tick, fx.interval ); } }, // Simple 'show' function show: function() { var dataShow = jQuery._data( this.elem, "fxshow" + this.prop ); // Remember where we started, so that we can go back to it later this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop ); this.options.show = true; // Begin the animation // Make sure that we start at a small width/height to avoid any flash of content if ( dataShow !== undefined ) { // This show is picking up where a previous hide or show left off this.custom( this.cur(), dataShow ); } else { this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() ); } // Start by showing the element jQuery( this.elem ).show(); }, // Simple 'hide' function hide: function() { // Remember where we started, so that we can go back to it later this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop ); this.options.hide = true; // Begin the animation this.custom( this.cur(), 0 ); }, // Each step of an animation step: function( gotoEnd ) { var p, n, complete, t = fxNow || createFxNow(), done = true, elem = this.elem, options = this.options; if ( gotoEnd || t >= options.duration + this.startTime ) { this.now = this.end; this.pos = this.state = 1; this.update(); options.animatedProperties[ this.prop ] = true; for ( p in options.animatedProperties ) { if ( options.animatedProperties[ p ] !== true ) { done = false; } } if ( done ) { // Reset the overflow if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { jQuery.each( [ "", "X", "Y" ], function( index, value ) { elem.style[ "overflow" + value ] = options.overflow[ index ]; }); } // Hide the element if the "hide" operation was done if ( options.hide ) { jQuery( elem ).hide(); } // Reset the properties, if the item has been hidden or shown if ( options.hide || options.show ) { for ( p in options.animatedProperties ) { jQuery.style( elem, p, options.orig[ p ] ); jQuery.removeData( elem, "fxshow" + p, true ); // Toggle data is no longer needed jQuery.removeData( elem, "toggle" + p, true ); } } // Execute the complete function // in the event that the complete function throws an exception // we must ensure it won't be called twice. #5684 complete = options.complete; if ( complete ) { options.complete = false; complete.call( elem ); } } return false; } else { // classical easing cannot be used with an Infinity duration if ( options.duration == Infinity ) { this.now = t; } else { n = t - this.startTime; this.state = n / options.duration; // Perform the easing function, defaults to swing this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration ); this.now = this.start + ( (this.end - this.start) * this.pos ); } // Perform the next step of the animation this.update(); } return true; } }; jQuery.extend( jQuery.fx, { tick: function() { var timer, timers = jQuery.timers, i = 0; for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } }, interval: 13, stop: function() { clearInterval( timerId ); timerId = null; }, speeds: { slow: 600, fast: 200, // Default speed _default: 400 }, step: { opacity: function( fx ) { jQuery.style( fx.elem, "opacity", fx.now ); }, _default: function( fx ) { if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { fx.elem.style[ fx.prop ] = fx.now + fx.unit; } else { fx.elem[ fx.prop ] = fx.now; } } } }); // Ensure props that can't be negative don't go there on undershoot easing jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) { // exclude marginTop, marginLeft, marginBottom and marginRight from this list if ( prop.indexOf( "margin" ) ) { jQuery.fx.step[ prop ] = function( fx ) { jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); }; } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } // Try to restore the default display value of an element function defaultDisplay( nodeName ) { if ( !elemdisplay[ nodeName ] ) { var body = document.body, elem = jQuery( "<" + nodeName + ">" ).appendTo( body ), display = elem.css( "display" ); elem.remove(); // If the simple way fails, // get element's real default display by attaching it to a temp iframe if ( display === "none" || display === "" ) { // No iframe to use yet, so create it if ( !iframe ) { iframe = document.createElement( "iframe" ); iframe.frameBorder = iframe.width = iframe.height = 0; } body.appendChild( iframe ); // Create a cacheable copy of the iframe document on first call. // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML // document to it; WebKit & Firefox won't allow reusing the iframe document. if ( !iframeDoc || !iframe.createElement ) { iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" ); iframeDoc.close(); } elem = iframeDoc.createElement( nodeName ); iframeDoc.body.appendChild( elem ); display = jQuery.css( elem, "display" ); body.removeChild( iframe ); } // Store the correct default display elemdisplay[ nodeName ] = display; } return elemdisplay[ nodeName ]; } var getOffset, rtable = /^t(?:able|d|h)$/i, rroot = /^(?:body|html)$/i; if ( "getBoundingClientRect" in document.documentElement ) { getOffset = function( elem, doc, docElem, box ) { try { box = elem.getBoundingClientRect(); } catch(e) {} // Make sure we're not dealing with a disconnected DOM node if ( !box || !jQuery.contains( docElem, elem ) ) { return box ? { top: box.top, left: box.left } : { top: 0, left: 0 }; } var body = doc.body, win = getWindow( doc ), clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop, scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft, top = box.top + scrollTop - clientTop, left = box.left + scrollLeft - clientLeft; return { top: top, left: left }; }; } else { getOffset = function( elem, doc, docElem ) { var computedStyle, offsetParent = elem.offsetParent, prevOffsetParent = elem, body = doc.body, defaultView = doc.defaultView, prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, top = elem.offsetTop, left = elem.offsetLeft; while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { break; } computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; top -= elem.scrollTop; left -= elem.scrollLeft; if ( elem === offsetParent ) { top += elem.offsetTop; left += elem.offsetLeft; if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevOffsetParent = offsetParent; offsetParent = elem.offsetParent; } if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevComputedStyle = computedStyle; } if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { top += body.offsetTop; left += body.offsetLeft; } if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { top += Math.max( docElem.scrollTop, body.scrollTop ); left += Math.max( docElem.scrollLeft, body.scrollLeft ); } return { top: top, left: left }; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var elem = this[0], doc = elem && elem.ownerDocument; if ( !doc ) { return null; } if ( elem === doc.body ) { return jQuery.offset.bodyOffset( elem ); } return getOffset( elem, doc, doc.documentElement ); }; jQuery.offset = { bodyOffset: function( body ) { var top = body.offsetTop, left = body.offsetLeft; if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) { top += parseFloat( jQuery.css(body, "marginTop") ) || 0; left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; } return { top: top, left: left }; }, setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[0] ) { return null; } var elem = this[0], // Get *real* offsetParent offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; // Add offsetParent borders parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; // Subtract the two offsets return { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.body; while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { offsetParent = offsetParent.offsetParent; } return offsetParent; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : jQuery.support.boxModel && win.document.documentElement[ method ] || win.document.body[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { var clientProp = "client" + name, scrollProp = "scroll" + name, offsetProp = "offset" + name; // innerHeight and innerWidth jQuery.fn[ "inner" + name ] = function() { var elem = this[0]; return elem ? elem.style ? parseFloat( jQuery.css( elem, type, "padding" ) ) : this[ type ]() : null; }; // outerHeight and outerWidth jQuery.fn[ "outer" + name ] = function( margin ) { var elem = this[0]; return elem ? elem.style ? parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : this[ type ]() : null; }; jQuery.fn[ type ] = function( value ) { return jQuery.access( this, function( elem, type, value ) { var doc, docElemProp, orig, ret; if ( jQuery.isWindow( elem ) ) { // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat doc = elem.document; docElemProp = doc.documentElement[ clientProp ]; return jQuery.support.boxModel && docElemProp || doc.body && doc.body[ clientProp ] || docElemProp; } // Get document width or height if ( elem.nodeType === 9 ) { // Either scroll[Width/Height] or offset[Width/Height], whichever is greater doc = elem.documentElement; // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height] // so we can't use max, as it'll choose the incorrect offset[Width/Height] // instead we use the correct client[Width/Height] // support:IE6 if ( doc[ clientProp ] >= doc[ scrollProp ] ) { return doc[ clientProp ]; } return Math.max( elem.body[ scrollProp ], doc[ scrollProp ], elem.body[ offsetProp ], doc[ offsetProp ] ); } // Get width or height on the element if ( value === undefined ) { orig = jQuery.css( elem, type ); ret = parseFloat( orig ); return jQuery.isNumeric( ret ) ? ret : orig; } // Set the width or height on the element jQuery( elem ).css( type, value ); }, type, value, arguments.length, null ); }; }); // Expose jQuery to the global object window.jQuery = window.$ = jQuery; // Expose jQuery as an AMD module, but only for AMD loaders that // understand the issues with loading multiple versions of jQuery // in a page that all might call define(). The loader will indicate // they have special allowances for multiple jQuery versions by // specifying define.amd.jQuery = true. Register as a named module, // since jQuery can be concatenated with other files that may use define, // but not use a proper concatenation script that understands anonymous // AMD modules. A named AMD is safest and most robust way to register. // Lowercase jquery is used because AMD module names are derived from // file names, and jQuery is normally delivered in a lowercase file name. // Do this after creating the global so that if an AMD module wants to call // noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } })( window );
packages/material-ui-icons/src/ImageSearch.js
kybarg/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5l-2-2zm-1.5 5h-11l2.75-3.53 1.96 2.36 2.75-3.54zm2.8-9.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12 19.3 8.89zM15.5 9C14.12 9 13 7.88 13 6.5S14.12 4 15.5 4 18 5.12 18 6.5 16.88 9 15.5 9z" /> , 'ImageSearch');
examples/04 Sortable/Stress Test/Container.js
randrianov/react-dnd
import React, { Component } from 'react'; import update from 'react/lib/update'; import { name } from 'faker'; import Card from './Card'; import { DragDropContext } from 'react-dnd'; import HTML5Backend from 'react-dnd/modules/backends/HTML5'; const style = { width: 400 }; @DragDropContext(HTML5Backend) export default class Container extends Component { constructor(props) { super(props); this.moveCard = this.moveCard.bind(this); this.drawFrame = this.drawFrame.bind(this); const cardsById = {}; const cardsByIndex = []; for (let i = 0; i < 1000; i++) { const card = { id: i, text: name.findName() }; cardsById[card.id] = card; cardsByIndex[i] = card; } this.state = { cardsById, cardsByIndex }; } moveCard(id, afterId) { const { cardsById, cardsByIndex } = this.state; const card = cardsById[id]; const afterCard = cardsById[afterId]; const cardIndex = cardsByIndex.indexOf(card); const afterIndex = cardsByIndex.indexOf(afterCard); this.scheduleUpdate({ cardsByIndex: { $splice: [ [cardIndex, 1], [afterIndex, 0, card] ] } }); } componentWillUnmount() { cancelAnimationFrame(this.requestedFrame); } scheduleUpdate(update) { this.pendingUpdate = update; if (!this.requestedFrame) { this.requestedFrame = requestAnimationFrame(this.drawFrame); } } drawFrame() { const nextState = update(this.state, this.pendingUpdate); this.setState(nextState); this.pendingUpdate = null; this.requestedFrame = null; } render() { const { cardsByIndex } = this.state; return ( <div style={style}> {cardsByIndex.map(card => { return ( <Card key={card.id} id={card.id} text={card.text} moveCard={this.moveCard} /> ); })} </div> ); } }
test/containers/CounterPage.spec.js
kimurakenshi/caravanas
import React from 'react'; import { mount } from 'enzyme'; import { Provider } from 'react-redux'; import { createBrowserHistory } from 'history'; import { ConnectedRouter } from 'react-router-redux'; import CounterPage from '../../app/containers/CounterPage'; import { configureStore } from '../../app/store/configureStore'; function setup(initialState) { const store = configureStore(initialState); const history = createBrowserHistory(); const app = mount( <Provider store={store}> <ConnectedRouter history={history}> <CounterPage /> </ConnectedRouter> </Provider> ); return { app, buttons: app.find('button'), p: app.find('.counter') }; } describe('containers', () => { describe('App', () => { it('should display initial count', () => { const { p } = setup(); expect(p.text()).toMatch(/^0$/); }); it('should display updated count after increment button click', () => { const { buttons, p } = setup(); buttons.at(0).simulate('click'); expect(p.text()).toMatch(/^1$/); }); it('should display updated count after descrement button click', () => { const { buttons, p } = setup(); buttons.at(1).simulate('click'); expect(p.text()).toMatch(/^-1$/); }); it('shouldnt change if even and if odd button clicked', () => { const { buttons, p } = setup(); buttons.at(2).simulate('click'); expect(p.text()).toMatch(/^0$/); }); it('should change if odd and if odd button clicked', () => { const { buttons, p } = setup({ counter: 1 }); buttons.at(2).simulate('click'); expect(p.text()).toMatch(/^2$/); }); }); });
src/routes.js
prgits/react-product
import React from 'react'; import {IndexRoute, Route} from 'react-router'; // import { isLoaded as isAuthLoaded, load as loadAuth } from 'redux/modules/auth'; import { App, // Chat, Home, // Widgets, // About, // Login, // LoginSuccess, // Survey, NotFound, // Pagination, } from 'containers'; export default () => { // const requireLogin = (nextState, replace, cb) => { // function checkAuth() { // const { auth: { user }} = store.getState(); // if (!user) { // // oops, not logged in, so can't be here! // replace('/'); // } // cb(); // } // if (!isAuthLoaded(store.getState())) { // store.dispatch(loadAuth()).then(checkAuth); // } else { // checkAuth(); // } // }; /** * Please keep routes in alphabetical order */ return ( <Route path="/" component={App}> { /* Home (main) route */ } <IndexRoute component={Home}/> { /* Catch all route */ } <Route path="*" component={NotFound} status={404} /> </Route> ); };
test/TableSpec.js
Terminux/react-bootstrap
import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import ReactDOM from 'react-dom'; import Table from '../src/Table'; describe('Table', () => { it('Should be a table', () => { let instance = ReactTestUtils.renderIntoDocument( <Table /> ); assert.equal(ReactDOM.findDOMNode(instance).nodeName, 'TABLE'); assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable\b/)); }); it('Should have correct class when striped', () => { let instance = ReactTestUtils.renderIntoDocument( <Table striped /> ); assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-striped\b/)); }); it('Should have correct class when hover', () => { let instance = ReactTestUtils.renderIntoDocument( <Table hover /> ); assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-hover\b/)); }); it('Should have correct class when bordered', () => { let instance = ReactTestUtils.renderIntoDocument( <Table bordered /> ); assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-bordered\b/)); }); it('Should have correct class when condensed', () => { let instance = ReactTestUtils.renderIntoDocument( <Table condensed /> ); assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-condensed\b/)); }); it('Should have responsive wrapper', () => { let instance = ReactTestUtils.renderIntoDocument( <Table responsive /> ); assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-responsive\b/)); assert.ok(ReactDOM.findDOMNode(instance).firstChild.className.match(/\btable\b/)); }); });
src/containers/pages/miscellaneous/container.js
vFujin/HearthLounge
import React from 'react'; import {Route} from 'react-router'; import {NavLink} from 'react-router-dom'; import _ from 'lodash'; import PrivacyPolicy from "./privacy-policy/privacy-policy"; import NotFound from "../../../components/not-found/not-found"; import TermsOfService from "./terms-of-service/terms-of-service"; import Welcome from "../welcome/welcome"; const misc = [ "welcome", "terms-of-service", "privacy-policy" // "rank-system", // "FAQ", // "contributing", ]; const components = { Welcome, PrivacyPolicy, TermsOfService }; const Miscellaneous = ({match}) =>{ const casedParam = _.startCase(match.params.misc).replace(/\s/g, ''); if(!misc.includes(match.params.misc)){ return <NotFound page={match.params.misc}/> } document.title = _.startCase(match.params.misc); const mapMisc = () =>{ return misc.map(m => <li key={m}> <NavLink to={`/${_.toLower(_.kebabCase(m))}`} activeClassName="active"> {_.startCase(m)} </NavLink> </li>) }; return ( <div className="container__page container__page--twoSidedCentralized miscellaneous"> <div className="sidebar"> <h2>Miscellaneous</h2> <ul> {mapMisc()} </ul> </div> {misc.map(m => m === match.params.misc && <Route to={`${m}`} key={m} component={components[casedParam]} />)} </div> ) }; export default Miscellaneous;
src/routes/home/index.js
jhlav/mpn-web-app
/** * 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 Home from './Home'; import newsQuery from './news.graphql'; import Layout from '../../components/Layout'; async function action({ client }) { const data = await client.query({ query: newsQuery, }); return { title: 'React Starter Kit', chunks: ['home'], component: ( <Layout> <Home news={data.reactjsGetAllNews} /> </Layout> ), }; } export default action;
modules/experimental/AsyncProps.js
sleexyz/react-router
import React from 'react'; function shallowEqual(a, b) { var ka = 0; var kb = 0; for (let key in a) { if (a.hasOwnProperty(key) && a[key] !== b[key]) return false; ka++; } for (let key in b) if (b.hasOwnProperty(key)) kb++; return ka === kb; } var AsyncProps = React.createClass({ statics: { createElement (Component, state) { return Component.loadProps ? <AsyncProps Component={Component} routing={state}/> : <Component {...state}/>; } }, getInitialState() { return { propsAreLoading: false, propsAreLoadingLong: false, asyncProps: null, previousRoutingState: null }; }, componentDidMount() { this.load(this.props); }, componentWillReceiveProps(nextProps) { var needToLoad = !shallowEqual( nextProps.routing.routeParams, this.props.routing.routeParams ); if (needToLoad) { var routerTransitioned = nextProps.routing.location !== this.props.routing.location; var keepPreviousRoutingState = this.state.propsAreLoadingLong && routerTransitioned; if (keepPreviousRoutingState) { this.load(nextProps); } else { this.setState({ previousRoutingState: this.props.routing }, () => this.load(nextProps)); } } }, /* * Could make this method much better, right now AsyncProps doesn't render its * children until it fetches data, causing a "waterfall" effect, when instead * it could look at the branch of components from it down to the end and load * up the props for all of them in parallel, waterfall will do for now... */ load(props) { var lastLoadTime = this._lastLoadTime = Date.now(); var { params } = props.routing; var { Component } = this.props; this.setState({ propsAreLoading: true }, () => { var longLoadTimer = setTimeout(() => { this.setState({ propsAreLoadingLong: true }); }, 300); // TODO: handle `error`s Component.loadProps(params, (error, asyncProps) => { clearTimeout(longLoadTimer); // if the router transitions between now and when the callback runs we will // ignore it to prevent setting state w/ the wrong data (earlier calls to // load that call back later than later calls to load) if (this._lastLoadTime !== lastLoadTime || !this.isMounted()) return; this.setState({ propsAreLoading: false, propsAreLoadingLong: false, asyncProps: asyncProps, previousRoutingState: null }); }); }); }, render() { var { Component } = this.props; var { asyncProps, propsAreLoading, propsAreLoadingLong } = this.state; var routing = this.state.previousRoutingState || this.props.routing; if (this.state.asyncProps === null) return Component.Loader ? <Component.Loader {...routing}/> : null; return <Component onPropsDidChange={() => this.load(this.props) } propsAreLoading={propsAreLoading} propsAreLoadingLong={propsAreLoadingLong} {...routing} {...asyncProps} />; } }); export default AsyncProps;
src/app/containers/LayoutBootstrap/LayoutBootstrap.js
harsh376/Hector
import React from 'react' import ConnectedCustomNavBar from '../../components/ConnectedCustomNavBar/ConnectedCustomNavBar' import Home from '../Home/Home' import Breadcrumbs from '../../components/Breadcrumbs/Breadcrumbs' import './stylesheets/Layout.scss' // TODO: Add tests for `LayoutBootstrap` component function LayoutBootstrap({ content, routes }) { return ( <div> <ConnectedCustomNavBar /> {/* <Breadcrumbs routes={routes} /> */} <div className="contentBoot topOffset">{content || <Home />}</div> </div> ) } LayoutBootstrap.propTypes = { content: React.PropTypes.oneOfType([ React.PropTypes.arrayOf(React.PropTypes.node), React.PropTypes.node, ]), routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, } LayoutBootstrap.defaultProps = { content: null, } export default LayoutBootstrap
docs-ui/components/tooltip.stories.js
gencer/sentry
import React from 'react'; import {storiesOf} from '@storybook/react'; import {withInfo} from '@storybook/addon-info'; import Tooltip from 'sentry-ui/tooltip'; import Button from 'sentry-ui/buttons/button'; storiesOf('Tooltip', module).add( 'default', withInfo('Description')(() => ( <div> <h1>Test</h1> <div> <Tooltip title="My tooltip"> <Button>Custom React Component</Button> </Tooltip> </div> <div> <Tooltip title="My tooltip with options" tooltipOptions={{ placement: 'bottom', }} > <button>Native button</button> </Tooltip> </div> </div> )) );
ajax/libs/rxjs/2.3.6/rx.all.js
pcarrier/cdnjs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. ;(function (undefined) { var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; var root = (objectTypes[typeof window] && window) || this, freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, freeModule = objectTypes[typeof module] && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports && freeExports, freeGlobal = objectTypes[typeof global] && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { root = freeGlobal; } var Rx = { internals: {}, config: { Promise: root.Promise // Detect if promise exists }, helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; }, isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; }, identity = Rx.helpers.identity = function (x) { return x; }, pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; }, just = Rx.helpers.just = function (value) { return function () { return value; }; }, defaultNow = Rx.helpers.defaultNow = Date.now, defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function'; }, asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); }, not = Rx.helpers.not = function (a) { return !a; }; // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } // Shim in iterator support var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || '_es6shim_iterator_'; // Bug for mozilla version if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } var doneEnumerator = { done: true, value: undefined }; /** `Object#toString` result shortcuts */ var argsClass = '[object Arguments]', arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', regexpClass = '[object RegExp]', stringClass = '[object String]'; var toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4 suportNodeClass, errorProto = Error.prototype, objectProto = Object.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable; try { suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); } catch(e) { suportNodeClass = true; } var shadowedProps = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var nonEnumProps = {}; nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; nonEnumProps[objectClass] = { 'constructor': true }; var support = {}; (function () { var ctor = function() { this.x = 1; }, props = []; ctor.prototype = { 'valueOf': 1, 'y': 1 }; for (var key in new ctor) { props.push(key); } for (key in arguments) { } // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); // Detect if `prototype` properties are enumerable by default. support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); // Detect if `arguments` object indexes are non-enumerable support.nonEnumArgs = key != 0; // Detect if properties shadowing those on `Object.prototype` are non-enumerable. support.nonEnumShadows = !/valueOf/.test(props); }(1)); function isObject(value) { // check if the value is the ECMAScript language type of Object // http://es5.github.io/#x8 // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; return value && (type == 'function' || type == 'object') || false; } function keysIn(object) { var result = []; if (!isObject(object)) { return result; } if (support.nonEnumArgs && object.length && isArguments(object)) { object = slice.call(object); } var skipProto = support.enumPrototypes && typeof object == 'function', skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error); for (var key in object) { if (!(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name'))) { result.push(key); } } if (support.nonEnumShadows && object !== objectProto) { var ctor = object.constructor, index = -1, length = shadowedProps.length; if (object === (ctor && ctor.prototype)) { var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), nonEnum = nonEnumProps[className]; } while (++index < length) { key = shadowedProps[index]; if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) { result.push(key); } } } return result; } function internalFor(object, callback, keysFunc) { var index = -1, props = keysFunc(object), length = props.length; while (++index < length) { var key = props[index]; if (callback(object[key], key, object) === false) { break; } } return object; } function internalForIn(object, callback) { return internalFor(object, callback, keysIn); } function isNode(value) { // IE < 9 presents DOM nodes as `Object` objects except they have `toString` // methods that are `typeof` "string" and still can coerce nodes to strings return typeof value.toString != 'function' && typeof (value + '') == 'string'; } function isArguments(value) { return (value && typeof value == 'object') ? toString.call(value) == argsClass : false; } // fallback for browsers that can't detect `arguments` objects by [[Class]] if (!supportsArgsClass) { isArguments = function(value) { return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false; }; } function isFunction(value) { return typeof value == 'function' || false; } // fallback for older versions of Chrome and Safari if (isFunction(/x/)) { isFunction = function(value) { return typeof value == 'function' && toString.call(value) == funcClass; }; } var isEqual = Rx.internals.isEqual = function (x, y) { return deepEquals(x, y, [], []); }; /** @private * Used for deep comparison **/ function deepEquals(a, b, stackA, stackB) { // exit early for identical values if (a === b) { // treat `+0` vs. `-0` as not equal return a !== 0 || (1 / a == 1 / b); } var type = typeof a, otherType = typeof b; // exit early for unlike primitive values if (a === a && (a == null || b == null || (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { return false; } // compare [[Class]] names var className = toString.call(a), otherClass = toString.call(b); if (className == argsClass) { className = objectClass; } if (otherClass == argsClass) { otherClass = objectClass; } if (className != otherClass) { return false; } switch (className) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0` treating invalid dates coerced to `NaN` as not equal return +a == +b; case numberClass: // treat `NaN` vs. `NaN` as equal return (a != +a) ? b != +b // but treat `-0` vs. `+0` as not equal : (a == 0 ? (1 / a == 1 / b) : a == +b); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal return a == String(b); } var isArr = className == arrayClass; if (!isArr) { // exit for functions and DOM nodes if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { return false; } // in older versions of Opera, `arguments` objects have `Array` constructors var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; // non `Object` object instances with different constructors are not equal if (ctorA != ctorB && !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && ('constructor' in a && 'constructor' in b) ) { return false; } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) var initedStack = !stackA; stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == a) { return stackB[length] == b; } } var size = 0; result = true; // add `a` and `b` to the stack of traversed objects stackA.push(a); stackB.push(b); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { // compare lengths to determine if a deep comparison is necessary length = a.length; size = b.length; result = size == length; if (result) { // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, value = b[size]; if (!(result = deepEquals(a[size], value, stackA, stackB))) { break; } } } } else { // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // which, in this case, is more costly internalForIn(b, function(value, key, b) { if (hasOwnProperty.call(b, key)) { // count the number of properties. size++; // deep compare each property value. return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB)); } }); if (result) { // ensure both objects have the same number of properties internalForIn(a, function(value, key, a) { if (hasOwnProperty.call(a, key)) { // `size` will be `-1` if `a` has more properties than `b` return (result = --size > -1); } }); } } stackA.pop(); stackB.pop(); return result; } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; /** @private */ var inherits = this.inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; /** @private */ var addProperties = Rx.internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; // Collection polyfills function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Collections var IndexedItem = function (id, value) { this.id = id; this.value = value; }; IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); if (c === 0) { c = this.id - other.id; } return c; }; // Priority Queue for Scheduling var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { if (index === undefined) { index = 0; } if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable. */ CompositeDisposablePrototype.clear = function () { var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } }; /** * Determines whether the CompositeDisposable contains a specific disposable. * @param {Mixed} item Disposable to search for. * @returns {Boolean} true if the disposable was found; otherwise, false. */ CompositeDisposablePrototype.contains = function (item) { return this.disposables.indexOf(item) !== -1; }; /** * Converts the existing CompositeDisposable to an array of disposables * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; var BooleanDisposable = (function () { function BooleanDisposable (isSingle) { this.isSingle = isSingle; this.isDisposed = false; this.current = null; } var booleanDisposablePrototype = BooleanDisposable.prototype; /** * Gets the underlying disposable. * @return The underlying disposable. */ booleanDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ booleanDisposablePrototype.setDisposable = function (value) { if (this.current && this.isSingle) { throw new Error('Disposable has already been assigned'); } var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } old && old.dispose(); shouldDispose && value && value.dispose(); }; /** * Disposes the underlying disposable as well as all future replacements. */ booleanDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } old && old.dispose(); }; return BooleanDisposable; }()); /** * Represents a disposable resource which only allows a single assignment of its underlying disposable resource. * If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an Error. */ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function (super_) { inherits(SingleAssignmentDisposable, super_); function SingleAssignmentDisposable() { super_.call(this, true); } return SingleAssignmentDisposable; }(BooleanDisposable)); /** * Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. */ var SerialDisposable = Rx.SerialDisposable = (function (super_) { inherits(SerialDisposable, super_); function SerialDisposable() { super_.call(this, false); } return SerialDisposable; }(BooleanDisposable)); /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler; this.disposable = disposable; this.isDisposed = false; } ScheduledDisposable.prototype.dispose = function () { var parent = this; this.scheduler.schedule(function () { if (!parent.isDisposed) { parent.isDisposed = true; parent.disposable.dispose(); } }); }; var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Schedules an action to be executed. * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * @param {Function} action Action to execute. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * @param {Function} action Action to execute. * @param {Number} dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { timeSpan < 0 && (timeSpan = 0); return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize; (function (schedulerProto) { function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function scheduleInnerRecursive(action, self) { action(function(dt) { self(action, dt); }); } /** * Schedules an action to be executed recursively. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, action); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodicWithState = function (state, period, action) { var s = state; var id = setInterval(function () { s = action(s); }, period); return disposableCreate(function () { clearInterval(id); }); }; }(Scheduler.prototype)); (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); } function scheduleRelative(state, dueTime, action) { var dt = normalizeTime(dt); while (dt - this.now() > 0) { } return action(this, state); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); }()); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = (function () { var queue; function runTrampoline (q) { var item; while (q.length > 0) { item = q.dequeue(); if (!item.isCancelled()) { // Note, do not schedule blocking work! while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } } function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt); if (!queue) { queue = new PriorityQueue(4); queue.enqueue(si); try { runTrampoline(queue); } catch (e) { throw e; } finally { queue = null; } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return !queue; }; currentScheduler.ensureTrampoline = function (action) { if (!queue) { this.schedule(action); } else { action(); } }; return currentScheduler; }()); var scheduleMethod, clearMethod = noop; (function () { var reNative = RegExp('^' + String(toString) .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/toString| for [^\]]+/g, '.*?') + '$' ); var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && !reNative.test(setImmediate) && setImmediate, clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' && !reNative.test(clearImmediate) && clearImmediate; function postMessageSupported () { // Ensure not in a worker if (!root.postMessage || root.importScripts) { return false; } var isAsync = false, oldHandler = root.onmessage; // Test for async root.onmessage = function () { isAsync = true; }; root.postMessage('','*'); root.onmessage = oldHandler; return isAsync; } // Use in order, nextTick, setImmediate, postMessage, MessageChannel, script readystatechanged, setTimeout if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = process.nextTick; } else if (typeof setImmediate === 'function') { scheduleMethod = setImmediate; clearMethod = clearImmediate; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; function onGlobalPostMessage(event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (root.addEventListener) { root.addEventListener('message', onGlobalPostMessage, false); } else { root.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; root.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!root.MessageChannel) { var channel = new root.MessageChannel(), channelTasks = {}, channelTaskId = 0; channel.port1.onmessage = function (event) { var id = event.data, action = channelTasks[id]; action(); delete channelTasks[id]; }; scheduleMethod = function (action) { var id = channelTaskId++; channelTasks[id] = action; channel.port2.postMessage(id); }; } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = root.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; root.document.documentElement.appendChild(scriptElement); }; } else { scheduleMethod = function (action) { return setTimeout(action, 0); }; clearMethod = clearTimeout; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var timeoutScheduler = Scheduler.timeout = (function () { function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = setTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { clearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); /** @private */ var CatchScheduler = (function (_super) { function localNow() { return this._scheduler.now(); } 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); /** @private */ function CatchScheduler(scheduler, handler) { this._scheduler = scheduler; this._handler = handler; this._recursiveOriginal = null; this._recursiveWrapper = null; _super.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute); } /** @private */ CatchScheduler.prototype._clone = function (scheduler) { return new CatchScheduler(scheduler, this._handler); }; /** @private */ 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; } }; }; /** @private */ 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; }; /** @private */ 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, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? this._acceptObservable(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notifications * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ Notification.prototype.toObservable = function (scheduler) { var notification = this; isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); notification.kind === 'N' && observer.onCompleted(); }); }); }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (exception) { var notification = new Notification('E'); notification.exception = exception; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); var Enumerator = Rx.internals.Enumerator = function (next) { this._next = next; }; Enumerator.prototype.next = function () { return this._next(); }; Enumerator.prototype[$iterator$] = function () { return this; } var Enumerable = Rx.internals.Enumerable = function (iterator) { this._iterator = iterator; }; Enumerable.prototype[$iterator$] = function () { return this._iterator(); }; Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch(err) { observer.onError(); return; } var isDisposed, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var currentItem; if (isDisposed) { return; } try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { observer.onCompleted(); return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; Enumerable.prototype.catchException = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch(err) { observer.onError(); return; } var isDisposed, lastException, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { if (isDisposed) { return; } var currentItem; try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount == null) { repeatCount = -1; } return new Enumerable(function () { var left = repeatCount; return new Enumerator(function () { if (left === 0) { return doneEnumerator; } if (left > 0) { left--; } return { done: false, value: value }; }); }); }; var enumerableFor = Enumerable.forEach = function (source, selector, thisArg) { selector || (selector = identity); return new Enumerable(function () { var index = -1; return new Enumerator( function () { return ++index < source.length ? { done: false, value: selector.call(thisArg, source[index], index, source) } : doneEnumerator; }); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * * @param observer Observer object. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * 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. * * @static * @memberOf Observer * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * * @static * @memberOf Observer * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler) { return new AnonymousObserver(function (x) { return handler(notificationCreateOnNext(x)); }, function (exception) { return handler(notificationCreateOnError(exception)); }, function () { return handler(notificationCreateOnCompleted()); }); }; /** * 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.notifyOn = function (scheduler) { return new ObserveOnObserver(scheduler, this); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.internals.AbstractObserver = (function (_super) { inherits(AbstractObserver, _super); /** * Creates a new observer in a non-stopped state. * * @constructor */ function AbstractObserver() { this.isStopped = false; _super.call(this); } /** * Notifies the observer of a new element in the sequence. * * @memberOf AbstractObserver * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * * @memberOf AbstractObserver * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (_super) { inherits(AnonymousObserver, _super); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { _super.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * @param {Any} error The error that has occurred. */ AnonymousObserver.prototype.error = function (exception) { this._onError(exception); }; /** * Calls the onCompleted action. */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var 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(); try { this._observer.onNext(value); } catch (e) { throw e; } finally { this._state = 0; } }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); try { this._observer.onError(err); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); try { this._observer.onCompleted(); } catch (e) { throw e; } finally { this._state = 2; } }; 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 (exception) { var self = this; this.queue.push(function () { self.observer.onError(exception); }); }; ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; ScheduledObserver.prototype.dispose = function () { _super.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); /** @private */ var ObserveOnObserver = (function (_super) { inherits(ObserveOnObserver, _super); /** @private */ function ObserveOnObserver() { _super.apply(this, arguments); } /** @private */ ObserveOnObserver.prototype.next = function (value) { _super.prototype.next.call(this, value); this.ensureActive(); }; /** @private */ ObserveOnObserver.prototype.error = function (e) { _super.prototype.error.call(this, e); this.ensureActive(); }; /** @private */ ObserveOnObserver.prototype.completed = function () { _super.prototype.completed.call(this); this.ensureActive(); }; return ObserveOnObserver; })(ScheduledObserver); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { function Observable(subscribe) { this._subscribe = subscribe; } observableProto = Observable.prototype; /** * Subscribes an observer to the observable sequence. * * @example * 1 - source.subscribe(); * 2 - source.subscribe(observer); * 3 - source.subscribe(function (x) { console.log(x); }); * 4 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }); * 5 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }, function () { console.log('done'); }); * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { var subscriber = typeof observerOrOnNext === 'object' ? observerOrOnNext : observerCreate(observerOrOnNext, onError, onCompleted); return this._subscribe(subscriber); }; return Observable; })(); /** * 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)); }); }; /** * 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; }); }; /** * Converts a Promise to an Observable sequence * @param {Promise} An ES6 Compliant promise. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ var observableFromPromise = Observable.fromPromise = function (promise) { return new AnonymousObservable(function (observer) { promise.then( function (value) { observer.onNext(value); observer.onCompleted(); }, function (reason) { observer.onError(reason); }); return function () { if (promise && promise.abort) { promise.abort(); } } }); }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); * * // With config * Rx.config.Promise = RSVP.Promise; * var promise = Rx.Observable.return(42).toPromise(); * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. */ observableProto.toPromise = function (promiseCtor) { promiseCtor || (promiseCtor = Rx.config.Promise); if (!promiseCtor) { throw new Error('Promise type not provided nor in Rx.config.Promise'); } var source = this; return new promiseCtor(function (resolve, reject) { // No cancellation can be done var value, hasValue = false; source.subscribe(function (v) { value = v; hasValue = true; }, function (err) { reject(err); }, function () { if (hasValue) { resolve(value); } }); }); }; /** * Creates a list from an observable sequence. * @returns An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { var self = this; return new AnonymousObservable(function(observer) { var arr = []; return self.subscribe( arr.push.bind(arr), observer.onError.bind(observer), function () { observer.onNext(arr); observer.onCompleted(); }); }); }; /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = Observable.createWithDisposable = function (subscribe) { return new AnonymousObservable(subscribe); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } isPromise(result) && (result = observableFromPromise(result)); return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; var maxSafeInteger = Math.pow(2, 53) - 1; function numberIsFinite(value) { return typeof value === 'number' && root.isFinite(value); } function isNan(n) { return n !== n; } function isIterable(o) { return o[$iterator$] !== undefined; } function sign(value) { var number = +value; if (number === 0) { return number; } if (isNaN(number)) { return number; } return number < 0 ? -1 : 1; } function toLength(o) { var len = +o.length; if (isNaN(len)) { return 0; } if (len === 0 || !numberIsFinite(len)) { return len; } len = sign(len) * Math.floor(Math.abs(len)); if (len <= 0) { return 0; } if (len > maxSafeInteger) { return maxSafeInteger; } return len; } function isCallable(f) { return Object.prototype.toString.call(f) === '[object Function]' && typeof f === 'function'; } /** * This method creates a new Observable sequence from an array-like or iterable object. * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. * @param {Function} [mapFn] Map function to call on every element of the array. * @param {Any} [thisArg] The context to use calling the mapFn if provided. * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ Observable.from = function (iterable, mapFn, thisArg, scheduler) { if (iterable == null) { throw new Error('iterable cannot be null.') } if (mapFn && !isCallable(mapFn)) { throw new Error('mapFn when provided must be a function'); } isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var list = Object(iterable), objIsIterable = isIterable(list), len = objIsIterable ? 0 : toLength(list), it = objIsIterable ? list[$iterator$]() : null, i = 0; return scheduler.scheduleRecursive(function (self) { if (i < len || objIsIterable) { var result; if (objIsIterable) { var next = it.next(); if (next.done) { observer.onCompleted(); return; } result = next.value; } else { result = list[i]; } if (mapFn && isCallable(mapFn)) { try { result = thisArg ? mapFn.call(thisArg, result, i) : mapFn(result, i); } catch (e) { observer.onError(e); return; } } observer.onNext(result); i++; self(); } else { observer.onCompleted(); } }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * * @example * var res = Rx.Observable.fromArray([1,2,3]); * var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0, len = array.length; return scheduler.scheduleRecursive(function (self) { if (count < len) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * 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 (observer) { var first = true, state = initialState; return scheduler.scheduleRecursive(function (self) { var hasResult, result; try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); } } catch (exception) { observer.onError(exception); return; } if (hasResult) { observer.onNext(result); self(); } else { observer.onCompleted(); } }); }); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.of(1,2,3); * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.of = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return observableFromArray(args); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.of(1,2,3); * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ var observableOf = Observable.ofWithScheduler = function (scheduler) { var len = arguments.length - 1, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i + 1]; } return observableFromArray(args, scheduler); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.range(0, 10); * var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.repeat(42); * var res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'just', and 'returnValue' for browsers <IE9. * * @example * var res = Rx.Observable.return(42); * var res = Rx.Observable.return(42, Rx.Scheduler.timeout); * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.returnValue = Observable.just = function (value, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwException' for browsers <IE9. * * @example * var res = Rx.Observable.throw(new Error('Error')); * var res = Rx.Observable.throw(new Error('Error'), Rx.Scheduler.timeout); * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = Observable.throwException = function (exception, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; /** * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. * * @example * var res = Rx.Observable.using(function () { return new AsyncSubject(); }, function (s) { return s; }); * @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(); if (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(); if (choice === leftChoice) { observer.onNext(left); } }, function (err) { choiceL(); if (choice === leftChoice) { observer.onError(err); } }, function () { choiceL(); if (choice === leftChoice) { observer.onCompleted(); } })); rightSubscription.setDisposable(rightSource.subscribe(function (right) { choiceR(); if (choice === rightChoice) { observer.onNext(right); } }, function (err) { choiceR(); if (choice === rightChoice) { observer.onError(err); } }, function () { choiceR(); if (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 = argsOrArray(arguments, 0); 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 (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } isPromise(result) && (result = observableFromPromise(result)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = observableProto.catchException = function (handlerOrSecond) { return typeof handlerOrSecond === 'function' ? observableCatchHandler(this, handlerOrSecond) : observableCatch([this, handlerOrSecond]); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.catchException(xs, ys, zs); * 2 - res = Rx.Observable.catchException([xs, ys, zs]); * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchException = Observable['catch'] = function () { var items = argsOrArray(arguments, 0); return enumerableFor(items).catchException(); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = args[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; }(idx)); } return new CompositeDisposable(subscriptions); }); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * * @example * 1 - res = Rx.Observable.concat(xs, ys, zs); * 2 - res = Rx.Observable.concat([xs, ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { var sources = argsOrArray(arguments, 0); return enumerableFor(sources).concat(); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatObservable = observableProto.concatAll =function () { return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = [], subscribe = function (xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); // Check for promises support if (isPromise(xs)) { xs = observableFromPromise(xs); } subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { var s; group.remove(subscription); if (q.length > 0) { s = q.shift(); subscribe(s); } else { activeCount--; if (isStopped && activeCount === 0) { observer.onCompleted(); } } })); }; group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; if (activeCount === 0) { observer.onCompleted(); } })); return group; }); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * * @example * 1 - merged = Rx.Observable.merge(xs, ys, zs); * 2 - merged = Rx.Observable.merge([xs, ys, zs]); * 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs); * 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]); * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (arguments[0].now) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableFromArray(sources, scheduler).mergeObservable(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeObservable = observableProto.mergeAll =function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); // Check if Promise or Observable if (isPromise(innerSource)) { innerSource = observableFromPromise(innerSource); } innerSubscription.setDisposable(innerSource.subscribe(function (x) { observer.onNext(x); }, observer.onError.bind(observer), function () { group.remove(innerSubscription); if (isStopped && group.length === 1) { observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; if (group.length === 1) { observer.onCompleted(); } })); return group; }); }; /** * 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 = argsOrArray(arguments, 0); 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), function () { self(); }, function () { 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 (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { isOpen && observer.onNext(left); }, observer.onError.bind(observer), function () { isOpen && observer.onCompleted(); })); isPromise(other) && (other = observableFromPromise(other)); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe(function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); // Check if Promise or Observable if (isPromise(innerSource)) { innerSource = observableFromPromise(innerSource); } d.setDisposable(innerSource.subscribe(function (x) { if (latest === id) { observer.onNext(x); } }, function (e) { if (latest === id) { observer.onError(e); } }, function () { if (latest === id) { hasLatest = false; if (isStopped) { observer.onCompleted(); } } })); }, observer.onError.bind(observer), function () { isStopped = true; if (!hasLatest) { observer.onCompleted(); } }); return new CompositeDisposable(subscription, innerSubscription); }); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { isPromise(other) && (other = observableFromPromise(other)); return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = sources[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var args = slice.call(arguments, 0), first = args.shift(); return first.zip.apply(first, args); }; /** * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. * @param arguments Observable sources. * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. */ Observable.zipArray = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { if (queues.every(function (x) { return x.length > 0; })) { var res = queues.map(function (x) { return x.shift(); }); observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); return; } }; function done(i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); return; } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } var compositeDisposable = new CompositeDisposable(subscriptions); compositeDisposable.add(disposableCreate(function () { for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) { queues[qIdx] = []; } })); return compositeDisposable; }); }; /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(observer); }); }; /** * 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 (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * var obs = observable.distinctUntilChanged(); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (exception) { observer.onError(exception); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (exception) { observer.onError(exception); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * * @example * var res = observable.do(observer); * var res = observable.do(onNext); * var res = observable.do(onNext, onError); * var res = observable.do(onNext, onError, onCompleted); * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.doAction = observableProto.tap = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (err) { if (!onError) { observer.onError(err); } else { try { onError(err); } catch (e) { observer.onError(e); } observer.onError(err); } }, function () { if (!onCompleted) { observer.onCompleted(); } else { try { onCompleted(); } catch (e) { observer.onError(e); } observer.onCompleted(); } }); }); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * * @example * var res = observable.finallyAction(function () { console.log('sequence ended'; }); * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = observableProto.finallyAction = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription; try { subscription = source.subscribe(observer); } catch (e) { action(); throw e; } return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (e) { observer.onNext(notificationCreateOnError(e)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * * @example * var res = repeated = source.repeat(); * var res = repeated = source.repeat(42); * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * Note if you encounter an error and want it to retry once, then you must use .retry(2); * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(2); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchException(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator, source = this; if (arguments.length === 2) { hasSeed = true; seed = arguments[0]; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return new AnonymousObservable(function (observer) { var hasAccumulation, accumulation, hasValue; return source.subscribe ( function (x) { try { if (!hasValue) { hasValue = true; } if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } } catch (e) { observer.onError(e); return; } observer.onNext(accumulation); }, observer.onError.bind(observer), function () { if (!hasValue && hasSeed) { observer.onNext(seed); } observer.onCompleted(); } ); }); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); if (q.length > count) { observer.onNext(q.shift()); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * * @memberOf Observable# * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && 'now' in Object(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableFor([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence. * * @example * var res = source.takeLast(5); * * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { while(q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); }); }); }; /** * 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 (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { observer.onNext(q); observer.onCompleted(); }); }); }; /** * 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; if (count <= 0) { throw new Error(argumentOutOfRange); } if (arguments.length === 1) { skip = count; } if (skip <= 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = [], createWindow = function () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); }; createWindow(); m.setDisposable(source.subscribe(function (x) { var s; for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; if (c >= 0 && c % skip === 0) { s = q.shift(); s.onCompleted(); } n++; if (n % skip === 0) { createWindow(); } }, function (exception) { while (q.length > 0) { q.shift().onError(exception); } observer.onError(exception); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); })); return refCountDisposable; }); }; function concatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i); return isPromise(result) ? observableFromPromise(result) : result; }).concatAll(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.concatMap(Rx.Observable.fromArray([1,2,3])); * @param selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) { if (resultSelector) { return this.concatMap(function (x, i) { var selectorResult = selector(x, i), result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult; return result.map(function (y) { return resultSelector(x, y, i); }); }); } return typeof selector === 'function' ? concatMap(this, selector, thisArg) : concatMap(this, function () { return selector; }); }; /** * Projects each 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; 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(); }); }).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; if (defaultValue === undefined) { defaultValue = null; } return new AnonymousObservable(function (observer) { var found = false; return source.subscribe(function (x) { found = true; observer.onNext(x); }, observer.onError.bind(observer), function () { if (!found) { observer.onNext(defaultValue); } observer.onCompleted(); }); }); }; // 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 (observer) { var hashSet = new HashSet(comparer); return source.subscribe(function (x) { var key = x; if (keySelector) { try { key = keySelector(x); } catch (e) { observer.onError(e); return; } } hashSet.push(key) && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * 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) { var map = new Dictionary(), groupDisposable = new CompositeDisposable(), refCountDisposable = new RefCountDisposable(groupDisposable); groupDisposable.add(source.subscribe(function (x) { var key, i, len, items; try { key = keySelector(x); } catch (e) { items = map.getValues(); for (i = 0, len = items.length; i < len; i++) { items[i].onError(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) { items = map.getValues(); for (i = 0, len = items.length; i < len; i++) { items[i].onError(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) { items = map.getValues(); for (i = 0, len = items.length; i < len; i++) { items[i].onError(exn); } observer.onError(exn); }, expire) ); } var element; try { element = elementSelector(x); } catch (e) { items = map.getValues(); for (i = 0, len = items.length; i < len; i++) { items[i].onError(e); } observer.onError(e); return; } writer.onNext(element); }, function (ex) { var items = map.getValues(); for(var i = 0, len = items.length; i < len; i++) { items[i].onError(ex); } observer.onError(ex); }, function () { var items = map.getValues(); for(var i = 0, len = items.length; i < len; i++) { items[i].onCompleted(); } observer.onCompleted(); })); return refCountDisposable; }); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = observableProto.map = function (selector, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var result; try { result = selector.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Retrieves the value of a specified property from all elements in the Observable sequence. * @param {String} property The property to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function (property) { return this.select(function (x) { return x[property]; }); }; function flatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i); return isPromise(result) ? observableFromPromise(result) : result; }).mergeObservable(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); * @param selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) { if (resultSelector) { return this.flatMap(function (x, i) { var selectorResult = selector(x, i), result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult; return result.map(function (y) { return resultSelector(x, y, i); }); }, thisArg); } return typeof selector === 'function' ? flatMap(this, selector, thisArg) : flatMap(this, function () { return selector; }); }; /** * Projects each 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(); }); }).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(); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } } if (running) { observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * var res = source.take(5); * var res = source.take(0, Rx.Scheduler.timeout); * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new Error(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining > 0) { remaining--; observer.onNext(x); if (remaining === 0) { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * * @example * var res = source.takeWhile(function (value) { return value < 10; }); * var res = source.takeWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var observable = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return observable.subscribe(function (x) { if (running) { try { running = predicate.call(thisArg, x, i++, observable); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * var res = source.where(function (value) { return value < 10; }); * var res = source.where(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = observableProto.filter = function (predicate, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } if (shouldRun) { observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; observableProto.finalValue = function () { var source = this; return new AnonymousObservable(function (observer) { var hasValue = false, value; return source.subscribe(function (x) { hasValue = true; value = x; }, observer.onError.bind(observer), function () { if (!hasValue) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); }; function extremaBy(source, keySelector, comparer) { return new AnonymousObservable(function (observer) { var hasValue = false, lastKey = null, list = []; return source.subscribe(function (x) { var comparison, key; try { key = keySelector(x); } catch (ex) { observer.onError(ex); return; } comparison = 0; if (!hasValue) { hasValue = true; lastKey = key; } else { try { comparison = comparer(key, lastKey); } catch (ex1) { observer.onError(ex1); return; } } if (comparison > 0) { lastKey = key; list = []; } if (comparison >= 0) { list.push(x); } }, observer.onError.bind(observer), function () { observer.onNext(list); observer.onCompleted(); }); }); } function firstOnly(x) { if (x.length === 0) { throw new Error(sequenceContainsNoElements); } 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. * @example * 1 - res = source.aggregate(function (acc, x) { return acc + x; }); * 2 - res = source.aggregate(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing a single element with the final accumulator value. */ observableProto.aggregate = function () { var seed, hasSeed, accumulator; if (arguments.length === 2) { seed = arguments[0]; hasSeed = true; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return hasSeed ? this.scan(seed, accumulator).startWith(seed).finalValue() : this.scan(accumulator).finalValue(); }; /** * 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. * @example * 1 - res = source.reduce(function (acc, x) { return acc + x; }); * 2 - res = source.reduce(function (acc, x) { return acc + x; }, 0); * @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 seed, hasSeed; if (arguments.length === 2) { hasSeed = true; seed = arguments[1]; } return hasSeed ? this.scan(seed, accumulator).startWith(seed).finalValue() : this.scan(accumulator).finalValue(); }; /** * Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence. * @example * var result = source.any(); * var result = source.any(function (x) { return x > 3; }); * @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 = observableProto.any = function (predicate, thisArg) { var source = this; return predicate ? source.where(predicate, thisArg).any() : new AnonymousObservable(function (observer) { return source.subscribe(function () { observer.onNext(true); observer.onCompleted(); }, observer.onError.bind(observer), function () { observer.onNext(false); observer.onCompleted(); }); }); }; /** * 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. * * 1 - res = source.all(function (value) { return value.length > 3; }); * @memberOf Observable# * @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 = observableProto.all = function (predicate, thisArg) { return this.where(function (v) { return !predicate(v); }, thisArg).any().select(function (b) { return !b; }); }; /** * Determines whether an observable sequence contains a specified element with an optional equality comparer. * @example * 1 - res = source.contains(42); * 2 - res = source.contains({ value: 42 }, function (x, y) { return x.value === y.value; }); * @param value The value to locate in the source sequence. * @param {Function} [comparer] An equality comparer to compare elements. * @returns {Observable} An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value. */ observableProto.contains = function (value, comparer) { comparer || (comparer = defaultComparer); return this.where(function (v) { return comparer(v, value); }).any(); }; /** * 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.where(predicate, thisArg).count() : this.aggregate(0, function (count) { return count + 1; }); }; /** * 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. * @example * var res = source.sum(); * var res = source.sum(function (x) { return x.value; }); * @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 ? this.select(keySelector, thisArg).sum() : this.aggregate(0, function (prev, curr) { return prev + curr; }); }; /** * 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).select(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).select(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. * @example * var res = res = source.average(); * var res = res = source.average(function (x) { return x.value; }); * @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 ? this.select(keySelector, thisArg).average() : this.scan({ sum: 0, count: 0 }, function (prev, cur) { return { sum: prev.sum + cur, count: prev.count + 1 }; }).finalValue().select(function (s) { if (s.count === 0) { throw new Error('The input sequence was empty'); } return s.sum / s.count; }); }; function sequenceEqualArray(first, second, comparer) { return new AnonymousObservable(function (observer) { var count = 0, len = second.length; return first.subscribe(function (value) { var equal = false; try { if (count < len) { equal = comparer(value, second[count++]); } } catch (e) { observer.onError(e); return; } if (!equal) { observer.onNext(false); observer.onCompleted(); } }, observer.onError.bind(observer), function () { observer.onNext(count === len); observer.onCompleted(); }); }); } /** * 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); if (Array.isArray(second)) { return sequenceEqualArray(first, second, comparer); } return new AnonymousObservable(function (observer) { 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) { observer.onError(e); return; } if (!equal) { observer.onNext(false); observer.onCompleted(); } } else if (doner) { observer.onNext(false); observer.onCompleted(); } else { ql.push(x); } }, observer.onError.bind(observer), function () { donel = true; if (ql.length === 0) { if (qr.length > 0) { observer.onNext(false); observer.onCompleted(); } else if (doner) { observer.onNext(true); observer.onCompleted(); } } }); isPromise(second) && (second = observableFromPromise(second)); var subscription2 = second.subscribe(function (x) { var equal, v; if (ql.length > 0) { v = ql.shift(); try { equal = comparer(v, x); } catch (exception) { observer.onError(exception); return; } if (!equal) { observer.onNext(false); observer.onCompleted(); } } else if (donel) { observer.onNext(false); observer.onCompleted(); } else { qr.push(x); } }, observer.onError.bind(observer), function () { doner = true; if (qr.length === 0) { if (ql.length > 0) { observer.onNext(false); observer.onCompleted(); } else if (donel) { observer.onNext(true); observer.onCompleted(); } } }); return new CompositeDisposable(subscription1, subscription2); }); }; function elementAtOrDefault(source, index, hasDefault, defaultValue) { if (index < 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var i = index; return source.subscribe(function (x) { if (i === 0) { observer.onNext(x); observer.onCompleted(); } i--; }, observer.onError.bind(observer), function () { if (!hasDefault) { observer.onError(new Error(argumentOutOfRange)); } else { observer.onNext(defaultValue); observer.onCompleted(); } }); }); } /** * 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 (observer) { var value = defaultValue, seenValue = false; return source.subscribe(function (x) { if (seenValue) { observer.onError(new Error('Sequence contains more than one element')); } else { value = x; seenValue = true; } }, observer.onError.bind(observer), function () { if (!seenValue && !hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); } /** * 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. * @example * var res = res = source.single(); * var res = res = source.single(function (x) { return x === 42; }); * @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 ? 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? this.where(predicate, thisArg).singleOrDefault(null, defaultValue) : singleOrDefaultAsync(this, true, defaultValue) }; function firstOrDefaultAsync(source, hasDefault, defaultValue) { return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { observer.onNext(x); observer.onCompleted(); }, observer.onError.bind(observer), function () { if (!hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(defaultValue); observer.onCompleted(); } }); }); } /** * 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. * @example * var res = res = source.firstOrDefault(); * var res = res = source.firstOrDefault(function (x) { return x > 3; }); * var res = source.firstOrDefault(function (x) { return x > 3; }, 0); * var res = source.firstOrDefault(null, 0); * @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 (observer) { var value = defaultValue, seenValue = false; return source.subscribe(function (x) { value = x; seenValue = true; }, observer.onError.bind(observer), function () { if (!seenValue && !hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); } /** * Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element. * @example * var res = source.last(); * var res = source.last(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 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. * @example * var res = source.lastOrDefault(); * var res = source.lastOrDefault(function (x) { return x > 3; }); * var res = source.lastOrDefault(function (x) { return x > 3; }, 0); * var res = source.lastOrDefault(null, 0); * @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) { return new AnonymousObservable(function (observer) { var i = 0; return source.subscribe(function (x) { var shouldRun; try { shouldRun = predicate.call(thisArg, x, i, source); } catch(e) { observer.onError(e); return; } if (shouldRun) { observer.onNext(yieldIndex ? i : x); observer.onCompleted(); } else { i++; } }, observer.onError.bind(observer), function () { observer.onNext(yieldIndex ? -1 : undefined); observer.onCompleted(); }); }); } /** * 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); }; /** * 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. * * @example * var res = Rx.Observable.toAsync(function (x, y) { return x + y; })(4, 3); * var res = Rx.Observable.toAsync(function (x, y) { return x + y; }, Rx.Scheduler.timeout)(4, 3); * var res = Rx.Observable.toAsync(function (x) { this.log(x); }, Rx.Scheduler.timeout, console)('hello'); * * @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 args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }); }; }; /** * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. * @param {Function} func The function to call * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. */ Observable.fromNodeCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(err) { if (err) { observer.onError(err); return; } var results = slice.call(arguments, 1); if (selector) { try { results = selector(results); } catch (e) { observer.onError(e); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }); }; }; function createListener (element, name, handler) { if (element.addEventListener) { element.addEventListener(name, handler, false); return disposableCreate(function () { element.removeEventListener(name, handler, false); }); } throw new Error('No listener found'); } function createEventListener (el, eventName, handler) { var disposables = new CompositeDisposable(); // Asume NodeList if (Object.prototype.toString.call(el) === '[object NodeList]') { for (var i = 0, len = el.length; i < len; i++) { disposables.add(createEventListener(el.item(i), eventName, handler)); } } else if (el) { disposables.add(createListener(el, eventName, handler)); } return disposables; } /** * Configuration option to determine whether to use native events only */ Rx.config.useNativeEvents = false; // Check for Angular/jQuery/Zepto support var jq = !!root.angular && !!angular.element ? angular.element : (!!root.jQuery ? root.jQuery : ( !!root.Zepto ? root.Zepto : null)); // Check for ember var ember = !!root.Ember && typeof root.Ember.addListener === 'function'; // Check for Backbone.Marionette. Note if using AMD add Marionette as a dependency of rxjs // for proper loading order! var marionette = !!root.Backbone && !!root.Backbone.Marionette; /** * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList. * * @example * var source = Rx.Observable.fromEvent(element, 'mouseup'); * * @param {Object} element The DOMElement or NodeList to attach a listener. * @param {String} eventName The event name to attach the observable sequence. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence of events from the specified element and the specified event. */ Observable.fromEvent = function (element, eventName, selector) { // Node.js specific if (element.addListener) { return fromEventPattern( function (h) { element.addListener(eventName, h); }, function (h) { element.removeListener(eventName, h); }, selector); } // Use only if non-native events are allowed if (!Rx.config.useNativeEvents) { if (marionette) { return fromEventPattern( function (h) { element.on(eventName, h); }, function (h) { element.off(eventName, h); }, selector); } if (ember) { return fromEventPattern( function (h) { Ember.addListener(element, eventName, h); }, function (h) { Ember.removeListener(element, eventName, h); }, selector); } if (jq) { var $elem = jq(element); return fromEventPattern( function (h) { $elem.on(eventName, h); }, function (h) { $elem.off(eventName, h); }, selector); } } return new AnonymousObservable(function (observer) { return createEventListener( element, eventName, function handler (e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return } } observer.onNext(results); }); }).publish().refCount(); }; /** * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair. * @param {Function} addHandler The function to add a handler to the emitter. * @param {Function} [removeHandler] The optional function to remove a handler from an emitter. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence which wraps an event from an event emitter */ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) { return new AnonymousObservable(function (observer) { function innerHandler (e) { var result = e; if (selector) { try { result = selector(arguments); } catch (err) { observer.onError(err); return; } } observer.onNext(result); } var returnValue = addHandler(innerHandler); return disposableCreate(function () { if (removeHandler) { removeHandler(innerHandler, returnValue); } }); }).publish().refCount(); }; /** * 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.subject.distinctUntilChanged().subscribe(function (b) { if (b) { connection = conn.connect(); } else { connection.dispose(); connection = disposableEmpty; } }); return new CompositeDisposable(subscription, connection, pausable); } function PausableObservable(source, subject) { this.source = source; this.subject = subject || new Subject(); this.isPaused = true; _super.call(this, subscribe); } PausableObservable.prototype.pause = function () { if (this.isPaused === true){ return; } this.isPaused = true; this.subject.onNext(false); }; PausableObservable.prototype.resume = function () { if (this.isPaused === false){ return; } this.isPaused = false; this.subject.onNext(true); }; return PausableObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausable(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausable = function (pauser) { return new PausableObservable(this, pauser); }; function combineLatestSource(source, subject, resultSelector) { return new AnonymousObservable(function (observer) { var n = 2, hasValue = [false, false], hasValueAll = false, isDone = false, values = new Array(n); function next(x, i) { values[i] = x var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone) { observer.onCompleted(); } } return new CompositeDisposable( source.subscribe( function (x) { next(x, 0); }, observer.onError.bind(observer), function () { isDone = true; observer.onCompleted(); }), subject.subscribe( function (x) { next(x, 1); }, observer.onError.bind(observer)) ); }); } var PausableBufferedObservable = (function (_super) { inherits(PausableBufferedObservable, _super); function subscribe(observer) { var q = [], previousShouldFire; var subscription = combineLatestSource( this.source, this.subject.distinctUntilChanged(), function (data, shouldFire) { return { data: data, shouldFire: shouldFire }; }) .subscribe( function (results) { if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) { // change in shouldFire if (results.shouldFire) { while (q.length > 0) { observer.onNext(q.shift()); } } } else { // new data if (results.shouldFire) { observer.onNext(results.data); } else { q.push(results.data); } } previousShouldFire = results.shouldFire; }, function (err) { // Empty buffer before sending error while (q.length > 0) { observer.onNext(q.shift()); } observer.onError(err); }, function () { // Empty buffer before sending completion while (q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); } ); this.subject.onNext(false); return subscription; } function PausableBufferedObservable(source, subject) { this.source = source; this.subject = subject || new Subject(); this.isPaused = true; _super.call(this, subscribe); } PausableBufferedObservable.prototype.pause = function () { if (this.isPaused === true){ return; } this.isPaused = true; this.subject.onNext(false); }; PausableBufferedObservable.prototype.resume = function () { if (this.isPaused === false){ return; } this.isPaused = false; this.subject.onNext(true); }; return PausableBufferedObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, * and yields the values that were buffered while paused. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausableBuffered(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausableBuffered = function (subject) { return new PausableBufferedObservable(this, subject); }; /** * Attaches a controller to the observable sequence with the ability to queue. * @example * var source = Rx.Observable.interval(100).controlled(); * source.request(3); // Reads 3 values * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.controlled = function (enableQueue) { if (enableQueue == null) { enableQueue = true; } return new ControlledObservable(this, enableQueue); }; var ControlledObservable = (function (_super) { inherits(ControlledObservable, _super); function subscribe (observer) { return this.source.subscribe(observer); } function ControlledObservable (source, enableQueue) { _super.call(this, subscribe); this.subject = new ControlledSubject(enableQueue); this.source = source.multicast(this.subject).refCount(); } ControlledObservable.prototype.request = function (numberOfItems) { if (numberOfItems == null) { numberOfItems = -1; } return this.subject.request(numberOfItems); }; return ControlledObservable; }(Observable)); var ControlledSubject = Rx.ControlledSubject = (function (_super) { function subscribe (observer) { return this.subject.subscribe(observer); } inherits(ControlledSubject, _super); function ControlledSubject(enableQueue) { if (enableQueue == null) { enableQueue = true; } _super.call(this, subscribe); this.subject = new Subject(); this.enableQueue = enableQueue; this.queue = enableQueue ? [] : null; this.requestedCount = 0; this.requestedDisposable = disposableEmpty; this.error = null; this.hasFailed = false; this.hasCompleted = false; this.controlledDisposable = disposableEmpty; } addProperties(ControlledSubject.prototype, Observer, { onCompleted: function () { checkDisposed.call(this); this.hasCompleted = true; if (!this.enableQueue || this.queue.length === 0) { this.subject.onCompleted(); } }, onError: function (error) { checkDisposed.call(this); this.hasFailed = true; this.error = error; if (!this.enableQueue || this.queue.length === 0) { this.subject.onError(error); } }, onNext: function (value) { checkDisposed.call(this); var hasRequested = false; if (this.requestedCount === 0) { if (this.enableQueue) { this.queue.push(value); } } else { if (this.requestedCount !== -1) { if (this.requestedCount-- === 0) { this.disposeCurrentRequest(); } } hasRequested = true; } if (hasRequested) { this.subject.onNext(value); } }, _processRequest: function (numberOfItems) { if (this.enableQueue) { //console.log('queue length', this.queue.length); while (this.queue.length >= numberOfItems && numberOfItems > 0) { //console.log('number of items', numberOfItems); this.subject.onNext(this.queue.shift()); numberOfItems--; } if (this.queue.length !== 0) { return { numberOfItems: numberOfItems, returnValue: true }; } else { return { numberOfItems: numberOfItems, returnValue: false }; } } if (this.hasFailed) { this.subject.onError(this.error); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } else if (this.hasCompleted) { this.subject.onCompleted(); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } return { numberOfItems: numberOfItems, returnValue: false }; }, request: function (number) { checkDisposed.call(this); this.disposeCurrentRequest(); var self = this, r = this._processRequest(number); number = r.numberOfItems; if (!r.returnValue) { this.requestedCount = number; this.requestedDisposable = disposableCreate(function () { self.requestedCount = 0; }); return this.requestedDisposable } else { return disposableEmpty; } }, disposeCurrentRequest: function () { this.requestedDisposable.dispose(); this.requestedDisposable = disposableEmpty; }, dispose: function () { this.isDisposed = true; this.error = null; this.subject.dispose(); this.requestedDisposable.dispose(); } }); return ControlledSubject; }(Observable)); /** * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. * * @example * 1 - res = source.multicast(observable); * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; }); * * @param {Function|Subject} subjectOrSubjectSelector * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. * Or: * Subject to push source elements into. * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.multicast = function (subjectOrSubjectSelector, selector) { var source = this; return typeof subjectOrSubjectSelector === 'function' ? new AnonymousObservable(function (observer) { var connectable = source.multicast(subjectOrSubjectSelector()); return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect()); }) : new ConnectableObservable(source, subjectOrSubjectSelector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of Multicast using a regular Subject. * * @example * var resres = source.publish(); * var res = source.publish(function (x) { return x; }); * * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publish = function (selector) { return !selector ? this.multicast(new Subject()) : this.multicast(function () { return new Subject(); }, selector); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.share(); * * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.share = function () { return this.publish(null).refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification. * This operator is a specialization of Multicast using a AsyncSubject. * * @example * var res = source.publishLast(); * var res = source.publishLast(function (x) { return x; }); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishLast = function (selector) { return !selector ? this.multicast(new AsyncSubject()) : this.multicast(function () { return new AsyncSubject(); }, selector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue. * This operator is a specialization of Multicast using a BehaviorSubject. * * @example * var res = source.publishValue(42); * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42); * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on. * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishValue = function (initialValueOrSelector, initialValue) { return arguments.length === 2 ? this.multicast(function () { return new BehaviorSubject(initialValue); }, initialValueOrSelector) : this.multicast(new BehaviorSubject(initialValueOrSelector)); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareValue(42); * * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareValue = function (initialValue) { return this.publishValue(initialValue). refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of Multicast using a ReplaySubject. * * @example * var res = source.replay(null, 3); * var res = source.replay(null, 3, 500); * var res = source.replay(null, 3, 500, scheduler); * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.replay = function (selector, bufferSize, window, scheduler) { return !selector ? this.multicast(new ReplaySubject(bufferSize, window, scheduler)) : this.multicast(function () { return new ReplaySubject(bufferSize, window, scheduler); }, selector); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareReplay(3); * var res = source.shareReplay(3, 500); * var res = source.shareReplay(3, 500, scheduler); * * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareReplay = function (bufferSize, window, scheduler) { return this.replay(null, bufferSize, window, scheduler).refCount(); }; /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents a value that changes over time. * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications. */ var BehaviorSubject = Rx.BehaviorSubject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); observer.onNext(this.value); return new InnerSubscription(this, observer); } var ex = this.exception; if (ex) { observer.onError(ex); } else { observer.onCompleted(); } return disposableEmpty; } inherits(BehaviorSubject, _super); /** * @constructor * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value. * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet. */ function BehaviorSubject(value) { _super.call(this, subscribe); this.value = value, this.observers = [], this.isDisposed = false, this.isStopped = false, this.exception = null; } addProperties(BehaviorSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = error; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { this.value = value; var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.value = null; this.exception = null; } }); return BehaviorSubject; }(Observable)); /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. */ var ReplaySubject = Rx.ReplaySubject = (function (_super) { function RemovableDisposable (subject, observer) { this.subject = subject; this.observer = observer; }; RemovableDisposable.prototype.dispose = function () { this.observer.dispose(); if (!this.subject.isDisposed) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); } }; function subscribe(observer) { var so = new ScheduledObserver(this.scheduler, observer), subscription = new RemovableDisposable(this, so); checkDisposed.call(this); this._trim(this.scheduler.now()); this.observers.push(so); var n = this.q.length; for (var i = 0, len = this.q.length; i < len; i++) { so.onNext(this.q[i].value); } if (this.hasError) { n++; so.onError(this.error); } else if (this.isStopped) { n++; so.onCompleted(); } so.ensureActive(n); return subscription; } inherits(ReplaySubject, _super); /** * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. * @param {Number} [bufferSize] Maximum element count of the replay buffer. * @param {Number} [windowSize] Maximum time length of the replay buffer. * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. */ function ReplaySubject(bufferSize, windowSize, scheduler) { this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize; this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize; this.scheduler = scheduler || currentThreadScheduler; this.q = []; this.observers = []; this.isStopped = false; this.isDisposed = false; this.hasError = false; this.error = null; _super.call(this, subscribe); } addProperties(ReplaySubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /* @private */ _trim: function (now) { while (this.q.length > this.bufferSize) { this.q.shift(); } while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { this.q.shift(); } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { var observer; checkDisposed.call(this); if (!this.isStopped) { var now = this.scheduler.now(); this.q.push({ interval: now, value: value }); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onNext(value); observer.ensureActive(); } } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { var observer; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; this.error = error; this.hasError = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onError(error); observer.ensureActive(); } this.observers = []; } }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { var observer; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onCompleted(); observer.ensureActive(); } this.observers = []; } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); return ReplaySubject; }(Observable)); var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) { inherits(ConnectableObservable, __super__); function ConnectableObservable(source, subject) { var hasSubscription = false, subscription, sourceObservable = source.asObservable(); this.connect = function () { if (!hasSubscription) { hasSubscription = true; subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () { hasSubscription = false; })); } return subscription; }; __super__.call(this, subject.subscribe.bind(subject)); } ConnectableObservable.prototype.refCount = function () { var connectableSubscription, count = 0, source = this; return new AnonymousObservable(function (observer) { var shouldConnect = ++count === 1, subscription = source.subscribe(observer); shouldConnect && (connectableSubscription = source.connect()); return function () { subscription.dispose(); --count === 0 && connectableSubscription.dispose(); }; }); }; return ConnectableObservable; }(Observable)); 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 obj === 'string') { return stringHashFn(valueOf); } } if (obj.getHashCode) { return obj.getHashCode(); } var id = 17 * uniqueIdCounter++; obj.getHashCode = 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 Error('out of range'); } 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) { return 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; }); }; /** * 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; }); }; /** * 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 observableWindowWithBounaries.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, function () { return observableEmpty(); }, function (_, window) { return window; }); } function observableWindowWithBounaries(windowBoundaries) { var source = this; return new AnonymousObservable(function (observer) { var window = new Subject(), d = new CompositeDisposable(), r = new RefCountDisposable(d); observer.onNext(addRef(window, r)); d.add(source.subscribe(function (x) { window.onNext(x); }, function (err) { window.onError(err); observer.onError(err); }, function () { window.onCompleted(); observer.onCompleted(); })); d.add(windowBoundaries.subscribe(function (w) { window.onCompleted(); window = new Subject(); observer.onNext(addRef(window, r)); }, function (err) { window.onError(err); observer.onError(err); }, function () { window.onCompleted(); observer.onCompleted(); })); return r; }); } function observableWindowWithClosingSelector(windowClosingSelector) { var source = this; return new AnonymousObservable(function (observer) { var createWindowClose, m = new SerialDisposable(), d = new CompositeDisposable(m), r = new RefCountDisposable(d), window = new Subject(); observer.onNext(addRef(window, r)); d.add(source.subscribe(function (x) { window.onNext(x); }, function (ex) { window.onError(ex); observer.onError(ex); }, function () { window.onCompleted(); observer.onCompleted(); })); createWindowClose = function () { var m1, windowClose; try { windowClose = windowClosingSelector(); } catch (exception) { observer.onError(exception); return; } m1 = new SingleAssignmentDisposable(); m.setDisposable(m1); m1.setDisposable(windowClose.take(1).subscribe(noop, function (ex) { window.onError(ex); observer.onError(ex); }, function () { window.onCompleted(); window = new Subject(); observer.onNext(addRef(window, r)); createWindowClose(); })); }; createWindowClose(); return r; }); } /** * 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)); }); }; /** * 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) { var published = this.publish().refCount(); return [ published.filter(predicate, thisArg), published.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); }) ]; }; function enumerableWhile(condition, source) { return new Enumerable(function () { return new Enumerator(function () { return condition() ? { done: false, value: source } : { done: true, value: undefined }; }); }); } /** * 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) { return enumerableFor(sources, resultSelector).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; }); }; /** * 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 = argsOrArray(arguments, 0); 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); }); }; /** * 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 = 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); }); }; 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.mergeObservable().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.throwException(e)); }, onNext: function (v) { this.tail.onNext(v); this.tail.onCompleted(); } }); return ChainObservable; }(Observable)); /** @private */ var Map = (function () { /** * @constructor * @private */ function Map() { this.keys = []; this.values = []; } /** * @private * @memberOf Map# */ Map.prototype['delete'] = function (key) { var i = this.keys.indexOf(key); if (i !== -1) { this.keys.splice(i, 1); this.values.splice(i, 1); } return i !== -1; }; /** * @private * @memberOf Map# */ Map.prototype.get = function (key, fallback) { var i = this.keys.indexOf(key); return i !== -1 ? this.values[i] : fallback; }; /** * @private * @memberOf Map# */ Map.prototype.set = function (key, value) { var i = this.keys.indexOf(key); if (i !== -1) { this.values[i] = value; } this.values[this.keys.push(key) - 1] = value; }; /** * @private * @memberOf Map# */ Map.prototype.size = function () { return this.keys.length; }; /** * @private * @memberOf Map# */ Map.prototype.has = function (key) { return this.keys.indexOf(key) !== -1; }; /** * @private * @memberOf Map# */ Map.prototype.getKeys = function () { return this.keys.slice(0); }; /** * @private * @memberOf Map# */ Map.prototype.getValues = function () { return this.values.slice(0); }; 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 object that matches when all observable sequences in the pattern have an available value. */ Pattern.prototype.and = function (other) { var patterns = this.patterns.slice(0); patterns.push(other); return new Pattern(patterns); }; /** * Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values. * * @param 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 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 (exception) { observer.onError(exception); 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; } // Active Plan function ActivePlan(joinObserverArray, onNext, onCompleted) { var i, joinObserver; this.joinObserverArray = joinObserverArray; this.onNext = onNext; this.onCompleted = onCompleted; this.joinObservers = new Map(); for (i = 0; i < this.joinObserverArray.length; i++) { joinObserver = this.joinObserverArray[i]; this.joinObservers.set(joinObserver, joinObserver); } } ActivePlan.prototype.dequeue = function () { var values = this.joinObservers.getValues(); for (var i = 0, len = values.length; i < len; i++) { values[i].queue.shift(); } }; ActivePlan.prototype.match = function () { var firstValues, i, len, isCompleted, values, hasValues = true; for (i = 0, len = this.joinObserverArray.length; i < len; i++) { if (this.joinObserverArray[i].queue.length === 0) { hasValues = false; break; } } if (hasValues) { firstValues = []; isCompleted = false; for (i = 0, len = this.joinObserverArray.length; i < len; i++) { firstValues.push(this.joinObserverArray[i].queue[0]); if (this.joinObserverArray[i].queue[0].kind === 'C') { isCompleted = true; } } if (isCompleted) { this.onCompleted(); } else { this.dequeue(); values = []; for (i = 0; i < firstValues.length; i++) { values.push(firstValues[i].value); } this.onNext.apply(this, values); } } }; /** @private */ var JoinObserver = (function (_super) { inherits(JoinObserver, _super); /** * @constructor * @private */ 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; /** * @memberOf JoinObserver# * @private */ JoinObserverPrototype.next = function (notification) { if (!this.isDisposed) { if (notification.kind === 'E') { this.onError(notification.exception); return; } this.queue.push(notification); var activePlans = this.activePlans.slice(0); for (var i = 0, len = activePlans.length; i < len; i++) { activePlans[i].match(); } } }; /** * @memberOf JoinObserver# * @private */ JoinObserverPrototype.error = noop; /** * @memberOf JoinObserver# * @private */ JoinObserverPrototype.completed = noop; /** * @memberOf JoinObserver# * @private */ JoinObserverPrototype.addActivePlan = function (activePlan) { this.activePlans.push(activePlan); }; /** * @memberOf JoinObserver# * @private */ JoinObserverPrototype.subscribe = function () { this.subscription.setDisposable(this.source.materialize().subscribe(this)); }; /** * @memberOf JoinObserver# * @private */ JoinObserverPrototype.removeActivePlan = function (activePlan) { var idx = this.activePlans.indexOf(activePlan); this.activePlans.splice(idx, 1); if (this.activePlans.length === 0) { this.dispose(); } }; /** * @memberOf JoinObserver# * @private */ 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 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 plans = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var activePlans = [], externalSubscriptions = new Map(), group, i, len, joinObserver, joinValues, outObserver; outObserver = observerCreate(observer.onNext.bind(observer), function (exception) { var values = externalSubscriptions.getValues(); for (var j = 0, jlen = values.length; j < jlen; j++) { values[j].onError(exception); } observer.onError(exception); }, observer.onCompleted.bind(observer)); try { for (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); if (activePlans.length === 0) { outObserver.onCompleted(); } })); } } catch (e) { observableThrow(e).subscribe(observer); } group = new CompositeDisposable(); joinValues = externalSubscriptions.getValues(); for (i = 0, len = joinValues.length; i < len; i++) { joinObserver = joinValues[i]; 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 count = 0, d = dueTime, p = normalizeTime(period); return scheduler.scheduleRecursiveWithAbsolute(d, function (self) { if (p > 0) { var now = scheduler.now(); d = d + p; d <= now && (d = now + p); } observer.onNext(count++); self(d); }); }); } function observableTimerTimeSpan(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) { return dueTime === period ? new AnonymousObservable(function (observer) { return scheduler.schedulePeriodicWithState(0, period, function (count) { observer.onNext(count); return count + 1; }); }) : observableDefer(function () { return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler); }); } /** * Returns an observable sequence that produces a value after each period. * * @example * 1 - res = Rx.Observable.interval(1000); * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout); * * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used. * @returns {Observable} An observable sequence that produces a value after each period. */ var observableinterval = Observable.interval = function (period, scheduler) { return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler); }; /** * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period. * * @example * 1 - res = Rx.Observable.timer(new Date()); * 2 - res = Rx.Observable.timer(new Date(), 1000); * 3 - res = Rx.Observable.timer(new Date(), Rx.Scheduler.timeout); * 4 - res = Rx.Observable.timer(new Date(), 1000, Rx.Scheduler.timeout); * * 5 - res = Rx.Observable.timer(5000); * 6 - res = Rx.Observable.timer(5000, 1000); * 7 - res = Rx.Observable.timer(5000, Rx.Scheduler.timeout); * 8 - res = Rx.Observable.timer(5000, 1000, Rx.Scheduler.timeout); * * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value. * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period. */ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { var period; isScheduler(scheduler) || (scheduler = timeoutScheduler); if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') { period = periodOrScheduler; } else if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'object') { scheduler = periodOrScheduler; } if (dueTime instanceof Date && period === undefined) { return observableTimerDate(dueTime.getTime(), scheduler); } if (dueTime instanceof Date && period !== undefined) { period = periodOrScheduler; return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler); } return period === undefined ? observableTimerTimeSpan(dueTime, scheduler) : observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); }; function observableDelayTimeSpan(source, dueTime, scheduler) { return new AnonymousObservable(function (observer) { var active = false, cancelable = new SerialDisposable(), exception = null, q = [], running = false, subscription; subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) { var d, shouldRun; if (notification.value.kind === 'E') { q = []; q.push(notification); exception = notification.value.exception; shouldRun = !running; } else { q.push({ value: notification.value, timestamp: notification.timestamp + dueTime }); shouldRun = !active; active = true; } if (shouldRun) { if (exception !== null) { observer.onError(exception); } else { d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) { var e, recurseDueTime, result, shouldRecurse; if (exception !== null) { return; } running = true; do { result = null; if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) { result = q.shift().value; } if (result !== null) { result.accept(observer); } } while (result !== null); shouldRecurse = false; recurseDueTime = 0; if (q.length > 0) { shouldRecurse = true; recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now()); } else { active = false; } e = exception; running = false; if (e !== null) { observer.onError(e); } else if (shouldRecurse) { self(recurseDueTime); } })); } } }); return new CompositeDisposable(subscription, cancelable); }); } function observableDelayDate(source, dueTime, scheduler) { return observableDefer(function () { return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler); }); } /** * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved. * * @example * 1 - res = Rx.Observable.delay(new Date()); * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout); * * 3 - res = Rx.Observable.delay(5000); * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout); * @memberOf Observable# * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delay = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return dueTime instanceof Date ? observableDelayDate(this, dueTime.getTime(), scheduler) : observableDelayTimeSpan(this, dueTime, scheduler); }; /** * Ignores values from an observable sequence which are followed by another value before dueTime. * * @example * 1 - res = source.throttle(5000); // 5 seconds * 2 - res = source.throttle(5000, scheduler); * * @param {Number} dueTime Duration of the throttle period for each value (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the throttle timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The throttled sequence. */ observableProto.throttle = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return this.throttleWithSelector(function () { return observableTimer(dueTime, scheduler); }) }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on timing information. * * @example * 1 - res = xs.windowWithTime(1000, scheduler); // non-overlapping segments of 1 second * 2 - res = xs.windowWithTime(1000, 500 , scheduler); // segments of 1 second with time shift 0.5 seconds * * @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 (typeof timeShiftOrScheduler === 'object') { 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); q.push(new Subject()); observer.onNext(addRef(q[0], refCountDisposable)); createTimer(); groupDisposable.add(source.subscribe(function (x) { var i, len; for (i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } }, function (e) { var i, len; for (i = 0, len = q.length; i < len; i++) { q[i].onError(e); } observer.onError(e); }, function () { var i, len; for (i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); } observer.onCompleted(); })); return refCountDisposable; 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; isSpan && (nextSpan += timeShift); isShift && (nextShift += timeShift); m.setDisposable(scheduler.scheduleWithRelative(ts, function () { var s; if (isShift) { s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } if (isSpan) { s = q.shift(); s.onCompleted(); } createTimer(); })); } }); }; /** * 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. * @example * 1 - res = source.windowWithTimeOrCount(5000, 50); // 5s or 50 items * 2 - res = source.windowWithTimeOrCount(5000, 50, scheduler); //5s or 50 items * * @memberOf Observable# * @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 createTimer, groupDisposable, n = 0, refCountDisposable, s = new Subject() timerD = new SerialDisposable(), windowId = 0; groupDisposable = new CompositeDisposable(timerD); refCountDisposable = new RefCountDisposable(groupDisposable); observer.onNext(addRef(s, refCountDisposable)); createTimer(0); groupDisposable.add(source.subscribe(function (x) { var newId = 0, newWindow = false; s.onNext(x); n++; 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; function createTimer(id) { var m = new SingleAssignmentDisposable(); timerD.setDisposable(m); m.setDisposable(scheduler.scheduleWithRelative(timeSpan, function () { var newId; if (id !== windowId) { return; } n = 0; newId = ++windowId; s.onCompleted(); s = new Subject(); observer.onNext(addRef(s, refCountDisposable)); createTimer(newId); })); } }); }; /** * 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.timeout); * * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with timestamp information on values. */ observableProto.timestamp = function (scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return this.map(function (x) { return { value: x, timestamp: scheduler.now() }; }); }; function sampleObservable(source, sampler) { return new AnonymousObservable(function (observer) { var atEnd, value, hasValue; function sampleSubscribe() { if (hasValue) { hasValue = false; observer.onNext(value); } atEnd && observer.onCompleted(); } return new CompositeDisposable( source.subscribe(function (newValue) { hasValue = true; value = newValue; }, observer.onError.bind(observer), function () { atEnd = true; }), sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleSubscribe) ); }); } /** * Samples the observable sequence at each interval. * * @example * 1 - res = source.sample(sampleObservable); // Sampler tick sequence * 2 - res = source.sample(5000); // 5 seconds * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable. * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Sampled observable sequence. */ observableProto.sample = function (intervalOrSampler, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return typeof intervalOrSampler === 'number' ? sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) : sampleObservable(this, intervalOrSampler); }; /** * Returns the source observable sequence or the other observable sequence if dueTime elapses. * * @example * 1 - res = source.timeout(new Date()); // As a date * 2 - res = source.timeout(5000); // 5 seconds * 3 - res = source.timeout(new Date(), Rx.Observable.returnValue(42)); // As a date and timeout observable * 4 - res = source.timeout(5000, Rx.Observable.returnValue(42)); // 5 seconds and timeout observable * 5 - res = source.timeout(new Date(), Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // As a date and timeout observable * 6 - res = source.timeout(5000, Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // 5 seconds and timeout observable * * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs. * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used. * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeout = function (dueTime, other, scheduler) { other || (other = observableThrow(new Error('Timeout'))); isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { var id = 0, original = new SingleAssignmentDisposable(), subscription = new SerialDisposable(), switched = false, timer = new SerialDisposable(); subscription.setDisposable(original); var createTimer = function () { var myId = id; timer.setDisposable(scheduler[schedulerMethod](dueTime, function () { if (id === myId) { isPromise(other) && (other = observableFromPromise(other)); subscription.setDisposable(other.subscribe(observer)); } })); }; createTimer(); original.setDisposable(source.subscribe(function (x) { if (!switched) { id++; observer.onNext(x); createTimer(); } }, function (e) { if (!switched) { id++; observer.onError(e); } }, function () { if (!switched) { id++; observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }); }; /** * 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, result, state = initialState, time; return scheduler.scheduleRecursiveWithAbsolute(scheduler.now(), function (self) { hasResult && observer.onNext(result); try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); time = timeSelector(state); } } catch (e) { observer.onError(e); return; } if (hasResult) { self(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, result, state = initialState, time; return scheduler.scheduleRecursiveWithRelative(0, function (self) { hasResult && observer.onNext(result); try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); time = timeSelector(state); } } catch (e) { observer.onError(e); return; } if (hasResult) { self(time); } else { observer.onCompleted(); } }); }); }; /** * Time shifts the observable sequence by delaying the subscription. * * @example * 1 - res = source.delaySubscription(5000); // 5s * 2 - res = source.delaySubscription(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Number} dueTime Absolute or relative time to perform the subscription at. * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delaySubscription = function (dueTime, scheduler) { return this.delayWithSelector(observableTimer(dueTime, isScheduler(scheduler) ? scheduler : timeoutScheduler), observableEmpty); }; /** * Time shifts the observable sequence based on a subscription delay and a delay selector function for each element. * * @example * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only * 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector * * @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source. * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element. * @returns {Observable} Time-shifted sequence. */ observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) { var source = this, subDelay, selector; if (typeof subscriptionDelay === 'function') { selector = subscriptionDelay; } else { subDelay = subscriptionDelay; selector = delayDurationSelector; } return new AnonymousObservable(function (observer) { var delays = new CompositeDisposable(), atEnd = false, done = function () { if (atEnd && delays.length === 0) { observer.onCompleted(); } }, subscription = new SerialDisposable(), start = function () { subscription.setDisposable(source.subscribe(function (x) { var delay; try { delay = selector(x); } catch (error) { observer.onError(error); return; } var d = new SingleAssignmentDisposable(); delays.add(d); d.setDisposable(delay.subscribe(function () { observer.onNext(x); delays.remove(d); done(); }, observer.onError.bind(observer), function () { observer.onNext(x); delays.remove(d); done(); })); }, observer.onError.bind(observer), function () { atEnd = true; subscription.dispose(); done(); })); }; if (!subDelay) { start(); } else { subscription.setDisposable(subDelay.subscribe(function () { start(); }, observer.onError.bind(observer), function () { start(); })); } return new CompositeDisposable(subscription, delays); }); }; /** * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled. * * @example * 1 - res = source.timeoutWithSelector(Rx.Observable.timer(500)); * 2 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); }); * 3 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); }, Rx.Observable.returnValue(42)); * * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never(). * @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException(). * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) { if (arguments.length === 1) { timeoutdurationSelector = firstTimeout; var firstTimeout = observableNever(); } other || (other = observableThrow(new Error('Timeout'))); var source = this; return new AnonymousObservable(function (observer) { var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable(); subscription.setDisposable(original); var id = 0, switched = false, setTimer = function (timeout) { var myId = id, timerWins = function () { return id === myId; }; var d = new SingleAssignmentDisposable(); timer.setDisposable(d); d.setDisposable(timeout.subscribe(function () { if (timerWins()) { subscription.setDisposable(other.subscribe(observer)); } d.dispose(); }, function (e) { if (timerWins()) { observer.onError(e); } }, function () { if (timerWins()) { subscription.setDisposable(other.subscribe(observer)); } })); }; setTimer(firstTimeout); var observerWins = function () { var res = !switched; if (res) { id++; } return res; }; original.setDisposable(source.subscribe(function (x) { if (observerWins()) { observer.onNext(x); var timeout; try { timeout = timeoutdurationSelector(x); } catch (e) { observer.onError(e); return; } setTimer(timeout); } }, function (e) { if (observerWins()) { observer.onError(e); } }, function () { if (observerWins()) { observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }); }; /** * Ignores values from an observable sequence which are followed by another value within a computed throttle duration. * * @example * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(x + x); }); * * @param {Function} throttleDurationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element. * @returns {Observable} The throttled sequence. */ observableProto.throttleWithSelector = function (throttleDurationSelector) { var source = this; return new AnonymousObservable(function (observer) { var value, hasValue = false, cancelable = new SerialDisposable(), id = 0, subscription = source.subscribe(function (x) { var throttle; try { throttle = throttleDurationSelector(x); } catch (e) { observer.onError(e); return; } hasValue = true; value = x; id++; var currentid = id, d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(throttle.subscribe(function () { if (hasValue && id === currentid) { observer.onNext(value); } hasValue = false; d.dispose(); }, observer.onError.bind(observer), function () { if (hasValue && id === currentid) { observer.onNext(value); } hasValue = false; d.dispose(); })); }, function (e) { cancelable.dispose(); observer.onError(e); hasValue = false; id++; }, function () { cancelable.dispose(); if (hasValue) { observer.onNext(value); } observer.onCompleted(); hasValue = false; id++; }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. * * 1 - res = source.skipLastWithTime(5000); * 2 - res = source.skipLastWithTime(5000, scheduler); * * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for skipping elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence. */ observableProto.skipLastWithTime = function (duration, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } observer.onCompleted(); }); }); }; /** * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements. * * @example * 1 - res = source.takeLastWithTime(5000, [optional timer scheduler], [optional loop scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence. */ observableProto.takeLastWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { q.shift(); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0) { var next = q.shift(); if (now - next.interval <= duration) { observer.onNext(next.value); } } observer.onCompleted(); }); }); }; /** * 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. * * @example * 1 - res = source.takeLastBufferWithTime(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 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 (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { q.shift(); } }, observer.onError.bind(observer), function () { var now = scheduler.now(), res = []; while (q.length > 0) { var next = q.shift(); if (now - next.interval <= duration) { res.push(next.value); } } observer.onNext(res); observer.onCompleted(); }); }); }; /** * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.takeWithTime(5000, [optional scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence. */ observableProto.takeWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { return new CompositeDisposable(scheduler.scheduleWithRelative(duration, observer.onCompleted.bind(observer)), source.subscribe(observer)); }); }; /** * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.skipWithTime(5000, [optional scheduler]); * * @description * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence. * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded * may not execute immediately, despite the zero due time. * * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration. * @param {Number} duration Duration for skipping elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence. */ observableProto.skipWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var open = false; return new CompositeDisposable( scheduler.scheduleWithRelative(duration, function () { open = true; }), source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer))); }); }; /** * 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(), [optional scheduler]); * 2 - res = source.skipUntilWithTime(5000, [optional scheduler]); * @param 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 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 (observer) { var open = false; return new CompositeDisposable( scheduler[schedulerMethod](startTime, function () { open = true; }), source.subscribe( function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer))); }); }; /** * Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers. * * @example * 1 - res = source.takeUntilWithTime(new Date(), [optional scheduler]); * 2 - res = source.takeUntilWithTime(5000, [optional scheduler]); * @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 (observer) { return new CompositeDisposable(scheduler[schedulerMethod](endTime, function () { observer.onCompleted(); }), source.subscribe(observer)); }); }; /* * Performs a exclusive waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @returns {Observable} A exclusive observable with only the results that happen when subscribed. */ observableProto.exclusive = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasCurrent = false, isStopped = false, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); var innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); innerSubscription.setDisposable(innerSource.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (!hasCurrent && g.length === 1) { observer.onCompleted(); } })); return g; }); }; /* * Performs a exclusive map waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @param {Function} selector Selector to invoke for every item in the current subscription. * @param {Any} [thisArg] An optional context to invoke with the selector parameter. * @returns {Observable} An exclusive observable with only the results that happen when subscribed. */ observableProto.exclusiveMap = function (selector, thisArg) { var sources = this; return new AnonymousObservable(function (observer) { var index = 0, hasCurrent = false, isStopped = true, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe( function (x) { var result; try { result = selector.call(thisArg, x, index++, innerSource); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (g.length === 1 && !hasCurrent) { observer.onCompleted(); } })); return g; }); }; /** Provides a set of extension methods for virtual time scheduling. */ Rx.VirtualTimeScheduler = (function (__super__) { function notImplemented() { throw new Error('Not implemented'); } 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 Error(argumentOutOfRange); } 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 Error(argumentOutOfRange); } 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 Error(argumentOutOfRange); } 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) { if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; } return typeof subscriber === 'function' ? disposableCreate(subscriber) : disposableEmpty; } function AnonymousObservable(subscribe) { if (!(this instanceof AnonymousObservable)) { return new AnonymousObservable(subscribe); } function s(observer) { var setDisposable = function () { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }; var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(setDisposable); } else { setDisposable(); } return autoDetachObserver; } __super__.call(this, s); } return AnonymousObservable; }(Observable)); /** @private */ var AutoDetachObserver = (function (_super) { inherits(AutoDetachObserver, _super); function AutoDetachObserver(observer) { _super.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { if (!noError) { this.dispose(); } } }; AutoDetachObserverPrototype.error = function (exn) { try { this.observer.onError(exn); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); }; /* @private */ AutoDetachObserverPrototype.disposable = function (value) { return arguments.length ? this.getDisposable() : setDisposable(value); }; AutoDetachObserverPrototype.dispose = function () { _super.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); /** @private */ var GroupedObservable = (function (_super) { inherits(GroupedObservable, _super); function subscribe(observer) { return this.underlyingObservable.subscribe(observer); } /** * @constructor * @private */ 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.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception, hv = this.hasValue, v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, _super); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { _super.call(this, subscribe); this.isDisposed = false; this.isStopped = false; this.value = null; this.hasValue = false; this.observers = []; this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { checkDisposed.call(this); return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var os = this.observers.slice(0), v = this.value, hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { this.value = value; this.hasValue = true; } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) { inherits(AnonymousSubject, __super__); function AnonymousSubject(observer, observable) { this.observer = observer; this.observable = observable; __super__.call(this, this.observable.subscribe.bind(this.observable)); } addProperties(AnonymousSubject.prototype, Observer, { onCompleted: function () { this.observer.onCompleted(); }, onError: function (exception) { this.observer.onError(exception); }, onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { root.Rx = Rx; define(function() { return Rx; }); } else if (freeExports && freeModule) { // in Node.js or RingoJS if (moduleExports) { (freeModule.exports = Rx).Rx = Rx; } else { freeExports.Rx = Rx; } } else { // in a browser or Rhino root.Rx = Rx; } }.call(this));
tests/react_children/component.js
claudiopro/flow
// @flow import React from 'react'; import type {Node} from 'react'; class MyComponent extends React.Component<{children: Node}, void> { render(): Node { // OK: Can pass a node down like so. return <MyComponent>{this.props.children}</MyComponent>; } } class MyComponentOptional extends React.Component<{children?: Node}, void> {} <MyComponent />; // Error: `children` is required. <MyComponent></MyComponent>; // Error: `children` is required. <MyComponent> </MyComponent>; // OK: `children` may be a string. <MyComponent>{}</MyComponent>; // Error: `children` is required. <MyComponentOptional />; // OK: `children` is optional. <MyComponentOptional></MyComponentOptional>; // OK: `children` is optional. <MyComponentOptional> </MyComponentOptional>; // OK: `children` may be a string. <MyComponentOptional>{}</MyComponentOptional>; // OK: `children` is optional. // OK: The `ReactNode` allows any children. <MyComponent> {} {undefined} {null} {true} {false} {0} {42} {'hello world'} foobar <buz /> {[undefined, null, true, false, 0, 42, 'hello world', 'foobar', <buz />]} </MyComponent>; // Error: Arbitrary objects are not allowed as children with `ReactNode`. <MyComponent> {{a: 1, b: 2, c: 3}} </MyComponent>;
ajax/libs/yasqe/1.0.0/yasqe.min.js
hanbyul-here/cdnjs
!function(e){if("object"==typeof exports)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.YASQE=e()}}(function(){var e;return function t(e,r,i){function n(s,a){if(!r[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var u=r[s]={exports:{}};e[s][0].call(u.exports,function(t){var r=e[s][1][t];return n(r?r:t)},u,u.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("codemirror")):"function"==typeof e&&e.amd?e(["codemirror"],n):n(CodeMirror)}(function(e){"use strict";e.defineMode("sparql11",function(e){function t(){var e,t,r="<[^<>\"'|{}^\\\x00- ]*>",i="[A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]",n=i+"|_",o="("+n+"|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])",s="("+n+"|[0-9])("+n+"|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])*",a="\\?"+s,l="\\$"+s,p="("+i+")((("+o+")|\\.)*("+o+"))?",c="[0-9A-Fa-f]",d="(%"+c+c+")",E="(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%])",h="("+d+"|"+E+")";"sparql11"==u?(e="("+n+"|:|[0-9]|"+h+")(("+o+"|\\.|:|"+h+")*("+o+"|:|"+h+"))?",t="_:("+n+"|[0-9])(("+o+"|\\.)*"+o+")?"):(e="("+n+"|[0-9])((("+o+")|\\.)*("+o+"))?",t="_:"+e);var f="("+p+")?:",m=f+e,g="@[a-zA-Z]+(-[a-zA-Z0-9]+)*",v="[eE][\\+-]?[0-9]+",x="[0-9]+",N="(([0-9]+\\.[0-9]*)|(\\.[0-9]+))",L="(([0-9]+\\.[0-9]*"+v+")|(\\.[0-9]+"+v+")|([0-9]+"+v+"))",I="\\+"+x,T="\\+"+N,A="\\+"+L,S="-"+x,y="-"+N,C="-"+L,R="\\\\[tbnrf\\\\\"']",O="'(([^\\x27\\x5C\\x0A\\x0D])|"+R+")*'",b='"(([^\\x22\\x5C\\x0A\\x0D])|'+R+')*"',P="'''(('|'')?([^'\\\\]|"+R+"))*'''",D='"""(("|"")?([^"\\\\]|'+R+'))*"""',_="[\\x20\\x09\\x0D\\x0A]",M="#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)",G="("+_+"|("+M+"))*",w="\\("+G+"\\)",k="\\["+G+"\\]",B={terminal:[{name:"WS",regex:new RegExp("^"+_+"+"),style:"ws"},{name:"COMMENT",regex:new RegExp("^"+M),style:"comment"},{name:"IRI_REF",regex:new RegExp("^"+r),style:"variable-3"},{name:"VAR1",regex:new RegExp("^"+a),style:"atom"},{name:"VAR2",regex:new RegExp("^"+l),style:"atom"},{name:"LANGTAG",regex:new RegExp("^"+g),style:"meta"},{name:"DOUBLE",regex:new RegExp("^"+L),style:"number"},{name:"DECIMAL",regex:new RegExp("^"+N),style:"number"},{name:"INTEGER",regex:new RegExp("^"+x),style:"number"},{name:"DOUBLE_POSITIVE",regex:new RegExp("^"+A),style:"number"},{name:"DECIMAL_POSITIVE",regex:new RegExp("^"+T),style:"number"},{name:"INTEGER_POSITIVE",regex:new RegExp("^"+I),style:"number"},{name:"DOUBLE_NEGATIVE",regex:new RegExp("^"+C),style:"number"},{name:"DECIMAL_NEGATIVE",regex:new RegExp("^"+y),style:"number"},{name:"INTEGER_NEGATIVE",regex:new RegExp("^"+S),style:"number"},{name:"STRING_LITERAL_LONG1",regex:new RegExp("^"+P),style:"string"},{name:"STRING_LITERAL_LONG2",regex:new RegExp("^"+D),style:"string"},{name:"STRING_LITERAL1",regex:new RegExp("^"+O),style:"string"},{name:"STRING_LITERAL2",regex:new RegExp("^"+b),style:"string"},{name:"NIL",regex:new RegExp("^"+w),style:"punc"},{name:"ANON",regex:new RegExp("^"+k),style:"punc"},{name:"PNAME_LN",regex:new RegExp("^"+m),style:"string-2"},{name:"PNAME_NS",regex:new RegExp("^"+f),style:"string-2"},{name:"BLANK_NODE_LABEL",regex:new RegExp("^"+t),style:"string-2"}]};return B}function r(e){var t=[],r=o[e];if(void 0!=r)for(var i in r)t.push(i.toString());else t.push(e);return t}function i(e,t){function i(){for(var t=null,r=0;r<E.length;++r)if(t=e.match(E[r].regex,!0,!1))return{cat:E[r].name,style:E[r].style,text:t[0]};return(t=e.match(s,!0,!1))?{cat:e.current().toUpperCase(),style:"keyword",text:t[0]}:(t=e.match(a,!0,!1))?{cat:e.current(),style:"punc",text:t[0]}:(t=e.match(/^.[A-Za-z0-9]*/,!0,!1),{cat:"<invalid_token>",style:"error",text:t[0]})}function n(){var r=e.column();t.errorStartPos=r,t.errorEndPos=r+c.text.length}function l(e){null==t.queryType&&("SELECT"==e||"CONSTRUCT"==e||"ASK"==e||"DESCRIBE"==e)&&(t.queryType=e)}function u(e){"disallowVars"==e?t.allowVars=!1:"allowVars"==e?t.allowVars=!0:"disallowBnodes"==e?t.allowBnodes=!1:"allowBnodes"==e?t.allowBnodes=!0:"storeProperty"==e&&(t.storeProperty=!0)}function p(e){return(t.allowVars||"var"!=e)&&(t.allowBnodes||"blankNode"!=e&&"blankNodePropertyList"!=e&&"blankNodePropertyListPath"!=e)}0==e.pos&&(t.possibleCurrent=t.possibleNext);var c=i();if("<invalid_token>"==c.cat)return 1==t.OK&&(t.OK=!1,n()),t.complete=!1,c.style;if("WS"==c.cat||"COMMENT"==c.cat)return t.possibleCurrent=t.possibleNext,c.style;for(var d,h=!1,f=c.cat;t.stack.length>0&&f&&t.OK&&!h;)if(d=t.stack.pop(),o[d]){var m=o[d][f];if(void 0!=m&&p(d)){for(var g=m.length-1;g>=0;--g)t.stack.push(m[g]);u(d)}else t.OK=!1,t.complete=!1,n(),t.stack.push(d)}else if(d==f){h=!0,l(d);for(var v=!0,x=t.stack.length;x>0;--x){var N=o[t.stack[x-1]];N&&N.$||(v=!1)}t.complete=v,t.storeProperty&&"punc"!=f.cat&&(t.lastProperty=c.text,t.storeProperty=!1)}else t.OK=!1,t.complete=!1,n();return!h&&t.OK&&(t.OK=!1,t.complete=!1,n()),t.possibleCurrent=t.possibleNext,t.possibleNext=r(t.stack[t.stack.length-1]),c.style}function n(t,r){var i=0,n=t.stack.length-1;if(/^[\}\]\)]/.test(r)){for(var o=r.substr(0,1);n>=0;--n)if(t.stack[n]==o){--n;break}}else{var s=h[t.stack[n]];s&&(i+=s,--n)}for(;n>=0;--n){var s=f[t.stack[n]];s&&(i+=s)}return i*e.indentUnit}var o=(e.indentUnit,{"*[&&,valueLogical]":{"&&":["[&&,valueLogical]","*[&&,valueLogical]"],AS:[],")":[],",":[],"||":[],";":[]},"*[,,expression]":{",":["[,,expression]","*[,,expression]"],")":[]},"*[,,objectPath]":{",":["[,,objectPath]","*[,,objectPath]"],".":[],";":[],"]":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[,,object]":{",":["[,,object]","*[,,object]"],".":[],";":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"*[/,pathEltOrInverse]":{"/":["[/,pathEltOrInverse]","*[/,pathEltOrInverse]"],"|":[],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"*[;,?[or([verbPath,verbSimple]),objectList]]":{";":["[;,?[or([verbPath,verbSimple]),objectList]]","*[;,?[or([verbPath,verbSimple]),objectList]]"],".":[],"]":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[;,?[verb,objectList]]":{";":["[;,?[verb,objectList]]","*[;,?[verb,objectList]]"],".":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"*[UNION,groupGraphPattern]":{UNION:["[UNION,groupGraphPattern]","*[UNION,groupGraphPattern]"],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],".":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[graphPatternNotTriples,?.,?triplesBlock]":{"{":["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],OPTIONAL:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],MINUS:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],GRAPH:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],SERVICE:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],FILTER:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],BIND:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],VALUES:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],"}":[]},"*[quadsNotTriples,?.,?triplesTemplate]":{GRAPH:["[quadsNotTriples,?.,?triplesTemplate]","*[quadsNotTriples,?.,?triplesTemplate]"],"}":[]},"*[|,pathOneInPropertySet]":{"|":["[|,pathOneInPropertySet]","*[|,pathOneInPropertySet]"],")":[]},"*[|,pathSequence]":{"|":["[|,pathSequence]","*[|,pathSequence]"],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"*[||,conditionalAndExpression]":{"||":["[||,conditionalAndExpression]","*[||,conditionalAndExpression]"],AS:[],")":[],",":[],";":[]},"*dataBlockValue":{UNDEF:["dataBlockValue","*dataBlockValue"],IRI_REF:["dataBlockValue","*dataBlockValue"],TRUE:["dataBlockValue","*dataBlockValue"],FALSE:["dataBlockValue","*dataBlockValue"],PNAME_LN:["dataBlockValue","*dataBlockValue"],PNAME_NS:["dataBlockValue","*dataBlockValue"],STRING_LITERAL1:["dataBlockValue","*dataBlockValue"],STRING_LITERAL2:["dataBlockValue","*dataBlockValue"],STRING_LITERAL_LONG1:["dataBlockValue","*dataBlockValue"],STRING_LITERAL_LONG2:["dataBlockValue","*dataBlockValue"],INTEGER:["dataBlockValue","*dataBlockValue"],DECIMAL:["dataBlockValue","*dataBlockValue"],DOUBLE:["dataBlockValue","*dataBlockValue"],INTEGER_POSITIVE:["dataBlockValue","*dataBlockValue"],DECIMAL_POSITIVE:["dataBlockValue","*dataBlockValue"],DOUBLE_POSITIVE:["dataBlockValue","*dataBlockValue"],INTEGER_NEGATIVE:["dataBlockValue","*dataBlockValue"],DECIMAL_NEGATIVE:["dataBlockValue","*dataBlockValue"],DOUBLE_NEGATIVE:["dataBlockValue","*dataBlockValue"],"}":[],")":[]},"*datasetClause":{FROM:["datasetClause","*datasetClause"],WHERE:[],"{":[]},"*describeDatasetClause":{FROM:["describeDatasetClause","*describeDatasetClause"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],WHERE:[],"{":[],VALUES:[],$:[]},"*graphNode":{"(":["graphNode","*graphNode"],"[":["graphNode","*graphNode"],VAR1:["graphNode","*graphNode"],VAR2:["graphNode","*graphNode"],NIL:["graphNode","*graphNode"],IRI_REF:["graphNode","*graphNode"],TRUE:["graphNode","*graphNode"],FALSE:["graphNode","*graphNode"],BLANK_NODE_LABEL:["graphNode","*graphNode"],ANON:["graphNode","*graphNode"],PNAME_LN:["graphNode","*graphNode"],PNAME_NS:["graphNode","*graphNode"],STRING_LITERAL1:["graphNode","*graphNode"],STRING_LITERAL2:["graphNode","*graphNode"],STRING_LITERAL_LONG1:["graphNode","*graphNode"],STRING_LITERAL_LONG2:["graphNode","*graphNode"],INTEGER:["graphNode","*graphNode"],DECIMAL:["graphNode","*graphNode"],DOUBLE:["graphNode","*graphNode"],INTEGER_POSITIVE:["graphNode","*graphNode"],DECIMAL_POSITIVE:["graphNode","*graphNode"],DOUBLE_POSITIVE:["graphNode","*graphNode"],INTEGER_NEGATIVE:["graphNode","*graphNode"],DECIMAL_NEGATIVE:["graphNode","*graphNode"],DOUBLE_NEGATIVE:["graphNode","*graphNode"],")":[]},"*graphNodePath":{"(":["graphNodePath","*graphNodePath"],"[":["graphNodePath","*graphNodePath"],VAR1:["graphNodePath","*graphNodePath"],VAR2:["graphNodePath","*graphNodePath"],NIL:["graphNodePath","*graphNodePath"],IRI_REF:["graphNodePath","*graphNodePath"],TRUE:["graphNodePath","*graphNodePath"],FALSE:["graphNodePath","*graphNodePath"],BLANK_NODE_LABEL:["graphNodePath","*graphNodePath"],ANON:["graphNodePath","*graphNodePath"],PNAME_LN:["graphNodePath","*graphNodePath"],PNAME_NS:["graphNodePath","*graphNodePath"],STRING_LITERAL1:["graphNodePath","*graphNodePath"],STRING_LITERAL2:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath","*graphNodePath"],INTEGER:["graphNodePath","*graphNodePath"],DECIMAL:["graphNodePath","*graphNodePath"],DOUBLE:["graphNodePath","*graphNodePath"],INTEGER_POSITIVE:["graphNodePath","*graphNodePath"],DECIMAL_POSITIVE:["graphNodePath","*graphNodePath"],DOUBLE_POSITIVE:["graphNodePath","*graphNodePath"],INTEGER_NEGATIVE:["graphNodePath","*graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath","*graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath","*graphNodePath"],")":[]},"*groupCondition":{"(":["groupCondition","*groupCondition"],STR:["groupCondition","*groupCondition"],LANG:["groupCondition","*groupCondition"],LANGMATCHES:["groupCondition","*groupCondition"],DATATYPE:["groupCondition","*groupCondition"],BOUND:["groupCondition","*groupCondition"],IRI:["groupCondition","*groupCondition"],URI:["groupCondition","*groupCondition"],BNODE:["groupCondition","*groupCondition"],RAND:["groupCondition","*groupCondition"],ABS:["groupCondition","*groupCondition"],CEIL:["groupCondition","*groupCondition"],FLOOR:["groupCondition","*groupCondition"],ROUND:["groupCondition","*groupCondition"],CONCAT:["groupCondition","*groupCondition"],STRLEN:["groupCondition","*groupCondition"],UCASE:["groupCondition","*groupCondition"],LCASE:["groupCondition","*groupCondition"],ENCODE_FOR_URI:["groupCondition","*groupCondition"],CONTAINS:["groupCondition","*groupCondition"],STRSTARTS:["groupCondition","*groupCondition"],STRENDS:["groupCondition","*groupCondition"],STRBEFORE:["groupCondition","*groupCondition"],STRAFTER:["groupCondition","*groupCondition"],YEAR:["groupCondition","*groupCondition"],MONTH:["groupCondition","*groupCondition"],DAY:["groupCondition","*groupCondition"],HOURS:["groupCondition","*groupCondition"],MINUTES:["groupCondition","*groupCondition"],SECONDS:["groupCondition","*groupCondition"],TIMEZONE:["groupCondition","*groupCondition"],TZ:["groupCondition","*groupCondition"],NOW:["groupCondition","*groupCondition"],UUID:["groupCondition","*groupCondition"],STRUUID:["groupCondition","*groupCondition"],MD5:["groupCondition","*groupCondition"],SHA1:["groupCondition","*groupCondition"],SHA256:["groupCondition","*groupCondition"],SHA384:["groupCondition","*groupCondition"],SHA512:["groupCondition","*groupCondition"],COALESCE:["groupCondition","*groupCondition"],IF:["groupCondition","*groupCondition"],STRLANG:["groupCondition","*groupCondition"],STRDT:["groupCondition","*groupCondition"],SAMETERM:["groupCondition","*groupCondition"],ISIRI:["groupCondition","*groupCondition"],ISURI:["groupCondition","*groupCondition"],ISBLANK:["groupCondition","*groupCondition"],ISLITERAL:["groupCondition","*groupCondition"],ISNUMERIC:["groupCondition","*groupCondition"],VAR1:["groupCondition","*groupCondition"],VAR2:["groupCondition","*groupCondition"],SUBSTR:["groupCondition","*groupCondition"],REPLACE:["groupCondition","*groupCondition"],REGEX:["groupCondition","*groupCondition"],EXISTS:["groupCondition","*groupCondition"],NOT:["groupCondition","*groupCondition"],IRI_REF:["groupCondition","*groupCondition"],PNAME_LN:["groupCondition","*groupCondition"],PNAME_NS:["groupCondition","*groupCondition"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],HAVING:[],$:[],"}":[]},"*havingCondition":{"(":["havingCondition","*havingCondition"],STR:["havingCondition","*havingCondition"],LANG:["havingCondition","*havingCondition"],LANGMATCHES:["havingCondition","*havingCondition"],DATATYPE:["havingCondition","*havingCondition"],BOUND:["havingCondition","*havingCondition"],IRI:["havingCondition","*havingCondition"],URI:["havingCondition","*havingCondition"],BNODE:["havingCondition","*havingCondition"],RAND:["havingCondition","*havingCondition"],ABS:["havingCondition","*havingCondition"],CEIL:["havingCondition","*havingCondition"],FLOOR:["havingCondition","*havingCondition"],ROUND:["havingCondition","*havingCondition"],CONCAT:["havingCondition","*havingCondition"],STRLEN:["havingCondition","*havingCondition"],UCASE:["havingCondition","*havingCondition"],LCASE:["havingCondition","*havingCondition"],ENCODE_FOR_URI:["havingCondition","*havingCondition"],CONTAINS:["havingCondition","*havingCondition"],STRSTARTS:["havingCondition","*havingCondition"],STRENDS:["havingCondition","*havingCondition"],STRBEFORE:["havingCondition","*havingCondition"],STRAFTER:["havingCondition","*havingCondition"],YEAR:["havingCondition","*havingCondition"],MONTH:["havingCondition","*havingCondition"],DAY:["havingCondition","*havingCondition"],HOURS:["havingCondition","*havingCondition"],MINUTES:["havingCondition","*havingCondition"],SECONDS:["havingCondition","*havingCondition"],TIMEZONE:["havingCondition","*havingCondition"],TZ:["havingCondition","*havingCondition"],NOW:["havingCondition","*havingCondition"],UUID:["havingCondition","*havingCondition"],STRUUID:["havingCondition","*havingCondition"],MD5:["havingCondition","*havingCondition"],SHA1:["havingCondition","*havingCondition"],SHA256:["havingCondition","*havingCondition"],SHA384:["havingCondition","*havingCondition"],SHA512:["havingCondition","*havingCondition"],COALESCE:["havingCondition","*havingCondition"],IF:["havingCondition","*havingCondition"],STRLANG:["havingCondition","*havingCondition"],STRDT:["havingCondition","*havingCondition"],SAMETERM:["havingCondition","*havingCondition"],ISIRI:["havingCondition","*havingCondition"],ISURI:["havingCondition","*havingCondition"],ISBLANK:["havingCondition","*havingCondition"],ISLITERAL:["havingCondition","*havingCondition"],ISNUMERIC:["havingCondition","*havingCondition"],SUBSTR:["havingCondition","*havingCondition"],REPLACE:["havingCondition","*havingCondition"],REGEX:["havingCondition","*havingCondition"],EXISTS:["havingCondition","*havingCondition"],NOT:["havingCondition","*havingCondition"],IRI_REF:["havingCondition","*havingCondition"],PNAME_LN:["havingCondition","*havingCondition"],PNAME_NS:["havingCondition","*havingCondition"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],$:[],"}":[]},"*or([[ (,*dataBlockValue,)],NIL])":{"(":["or([[ (,*dataBlockValue,)],NIL])","*or([[ (,*dataBlockValue,)],NIL])"],NIL:["or([[ (,*dataBlockValue,)],NIL])","*or([[ (,*dataBlockValue,)],NIL])"],"}":[]},"*or([[*,unaryExpression],[/,unaryExpression]])":{"*":["or([[*,unaryExpression],[/,unaryExpression]])","*or([[*,unaryExpression],[/,unaryExpression]])"],"/":["or([[*,unaryExpression],[/,unaryExpression]])","*or([[*,unaryExpression],[/,unaryExpression]])"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],";":[]},"*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])":{"+":["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"-":["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],";":[]},"*or([var,[ (,expression,AS,var,)]])":{"(":["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],VAR1:["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],VAR2:["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],WHERE:[],"{":[],FROM:[]},"*orderCondition":{ASC:["orderCondition","*orderCondition"],DESC:["orderCondition","*orderCondition"],VAR1:["orderCondition","*orderCondition"],VAR2:["orderCondition","*orderCondition"],"(":["orderCondition","*orderCondition"],STR:["orderCondition","*orderCondition"],LANG:["orderCondition","*orderCondition"],LANGMATCHES:["orderCondition","*orderCondition"],DATATYPE:["orderCondition","*orderCondition"],BOUND:["orderCondition","*orderCondition"],IRI:["orderCondition","*orderCondition"],URI:["orderCondition","*orderCondition"],BNODE:["orderCondition","*orderCondition"],RAND:["orderCondition","*orderCondition"],ABS:["orderCondition","*orderCondition"],CEIL:["orderCondition","*orderCondition"],FLOOR:["orderCondition","*orderCondition"],ROUND:["orderCondition","*orderCondition"],CONCAT:["orderCondition","*orderCondition"],STRLEN:["orderCondition","*orderCondition"],UCASE:["orderCondition","*orderCondition"],LCASE:["orderCondition","*orderCondition"],ENCODE_FOR_URI:["orderCondition","*orderCondition"],CONTAINS:["orderCondition","*orderCondition"],STRSTARTS:["orderCondition","*orderCondition"],STRENDS:["orderCondition","*orderCondition"],STRBEFORE:["orderCondition","*orderCondition"],STRAFTER:["orderCondition","*orderCondition"],YEAR:["orderCondition","*orderCondition"],MONTH:["orderCondition","*orderCondition"],DAY:["orderCondition","*orderCondition"],HOURS:["orderCondition","*orderCondition"],MINUTES:["orderCondition","*orderCondition"],SECONDS:["orderCondition","*orderCondition"],TIMEZONE:["orderCondition","*orderCondition"],TZ:["orderCondition","*orderCondition"],NOW:["orderCondition","*orderCondition"],UUID:["orderCondition","*orderCondition"],STRUUID:["orderCondition","*orderCondition"],MD5:["orderCondition","*orderCondition"],SHA1:["orderCondition","*orderCondition"],SHA256:["orderCondition","*orderCondition"],SHA384:["orderCondition","*orderCondition"],SHA512:["orderCondition","*orderCondition"],COALESCE:["orderCondition","*orderCondition"],IF:["orderCondition","*orderCondition"],STRLANG:["orderCondition","*orderCondition"],STRDT:["orderCondition","*orderCondition"],SAMETERM:["orderCondition","*orderCondition"],ISIRI:["orderCondition","*orderCondition"],ISURI:["orderCondition","*orderCondition"],ISBLANK:["orderCondition","*orderCondition"],ISLITERAL:["orderCondition","*orderCondition"],ISNUMERIC:["orderCondition","*orderCondition"],SUBSTR:["orderCondition","*orderCondition"],REPLACE:["orderCondition","*orderCondition"],REGEX:["orderCondition","*orderCondition"],EXISTS:["orderCondition","*orderCondition"],NOT:["orderCondition","*orderCondition"],IRI_REF:["orderCondition","*orderCondition"],PNAME_LN:["orderCondition","*orderCondition"],PNAME_NS:["orderCondition","*orderCondition"],VALUES:[],LIMIT:[],OFFSET:[],$:[],"}":[]},"*prefixDecl":{PREFIX:["prefixDecl","*prefixDecl"],$:[],CONSTRUCT:[],DESCRIBE:[],ASK:[],INSERT:[],DELETE:[],SELECT:[],LOAD:[],CLEAR:[],DROP:[],ADD:[],MOVE:[],COPY:[],CREATE:[],WITH:[]},"*usingClause":{USING:["usingClause","*usingClause"],WHERE:[]},"*var":{VAR1:["var","*var"],VAR2:["var","*var"],")":[]},"*varOrIRIref":{VAR1:["varOrIRIref","*varOrIRIref"],VAR2:["varOrIRIref","*varOrIRIref"],IRI_REF:["varOrIRIref","*varOrIRIref"],PNAME_LN:["varOrIRIref","*varOrIRIref"],PNAME_NS:["varOrIRIref","*varOrIRIref"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],WHERE:[],"{":[],FROM:[],VALUES:[],$:[]},"+graphNode":{"(":["graphNode","*graphNode"],"[":["graphNode","*graphNode"],VAR1:["graphNode","*graphNode"],VAR2:["graphNode","*graphNode"],NIL:["graphNode","*graphNode"],IRI_REF:["graphNode","*graphNode"],TRUE:["graphNode","*graphNode"],FALSE:["graphNode","*graphNode"],BLANK_NODE_LABEL:["graphNode","*graphNode"],ANON:["graphNode","*graphNode"],PNAME_LN:["graphNode","*graphNode"],PNAME_NS:["graphNode","*graphNode"],STRING_LITERAL1:["graphNode","*graphNode"],STRING_LITERAL2:["graphNode","*graphNode"],STRING_LITERAL_LONG1:["graphNode","*graphNode"],STRING_LITERAL_LONG2:["graphNode","*graphNode"],INTEGER:["graphNode","*graphNode"],DECIMAL:["graphNode","*graphNode"],DOUBLE:["graphNode","*graphNode"],INTEGER_POSITIVE:["graphNode","*graphNode"],DECIMAL_POSITIVE:["graphNode","*graphNode"],DOUBLE_POSITIVE:["graphNode","*graphNode"],INTEGER_NEGATIVE:["graphNode","*graphNode"],DECIMAL_NEGATIVE:["graphNode","*graphNode"],DOUBLE_NEGATIVE:["graphNode","*graphNode"]},"+graphNodePath":{"(":["graphNodePath","*graphNodePath"],"[":["graphNodePath","*graphNodePath"],VAR1:["graphNodePath","*graphNodePath"],VAR2:["graphNodePath","*graphNodePath"],NIL:["graphNodePath","*graphNodePath"],IRI_REF:["graphNodePath","*graphNodePath"],TRUE:["graphNodePath","*graphNodePath"],FALSE:["graphNodePath","*graphNodePath"],BLANK_NODE_LABEL:["graphNodePath","*graphNodePath"],ANON:["graphNodePath","*graphNodePath"],PNAME_LN:["graphNodePath","*graphNodePath"],PNAME_NS:["graphNodePath","*graphNodePath"],STRING_LITERAL1:["graphNodePath","*graphNodePath"],STRING_LITERAL2:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath","*graphNodePath"],INTEGER:["graphNodePath","*graphNodePath"],DECIMAL:["graphNodePath","*graphNodePath"],DOUBLE:["graphNodePath","*graphNodePath"],INTEGER_POSITIVE:["graphNodePath","*graphNodePath"],DECIMAL_POSITIVE:["graphNodePath","*graphNodePath"],DOUBLE_POSITIVE:["graphNodePath","*graphNodePath"],INTEGER_NEGATIVE:["graphNodePath","*graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath","*graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath","*graphNodePath"]},"+groupCondition":{"(":["groupCondition","*groupCondition"],STR:["groupCondition","*groupCondition"],LANG:["groupCondition","*groupCondition"],LANGMATCHES:["groupCondition","*groupCondition"],DATATYPE:["groupCondition","*groupCondition"],BOUND:["groupCondition","*groupCondition"],IRI:["groupCondition","*groupCondition"],URI:["groupCondition","*groupCondition"],BNODE:["groupCondition","*groupCondition"],RAND:["groupCondition","*groupCondition"],ABS:["groupCondition","*groupCondition"],CEIL:["groupCondition","*groupCondition"],FLOOR:["groupCondition","*groupCondition"],ROUND:["groupCondition","*groupCondition"],CONCAT:["groupCondition","*groupCondition"],STRLEN:["groupCondition","*groupCondition"],UCASE:["groupCondition","*groupCondition"],LCASE:["groupCondition","*groupCondition"],ENCODE_FOR_URI:["groupCondition","*groupCondition"],CONTAINS:["groupCondition","*groupCondition"],STRSTARTS:["groupCondition","*groupCondition"],STRENDS:["groupCondition","*groupCondition"],STRBEFORE:["groupCondition","*groupCondition"],STRAFTER:["groupCondition","*groupCondition"],YEAR:["groupCondition","*groupCondition"],MONTH:["groupCondition","*groupCondition"],DAY:["groupCondition","*groupCondition"],HOURS:["groupCondition","*groupCondition"],MINUTES:["groupCondition","*groupCondition"],SECONDS:["groupCondition","*groupCondition"],TIMEZONE:["groupCondition","*groupCondition"],TZ:["groupCondition","*groupCondition"],NOW:["groupCondition","*groupCondition"],UUID:["groupCondition","*groupCondition"],STRUUID:["groupCondition","*groupCondition"],MD5:["groupCondition","*groupCondition"],SHA1:["groupCondition","*groupCondition"],SHA256:["groupCondition","*groupCondition"],SHA384:["groupCondition","*groupCondition"],SHA512:["groupCondition","*groupCondition"],COALESCE:["groupCondition","*groupCondition"],IF:["groupCondition","*groupCondition"],STRLANG:["groupCondition","*groupCondition"],STRDT:["groupCondition","*groupCondition"],SAMETERM:["groupCondition","*groupCondition"],ISIRI:["groupCondition","*groupCondition"],ISURI:["groupCondition","*groupCondition"],ISBLANK:["groupCondition","*groupCondition"],ISLITERAL:["groupCondition","*groupCondition"],ISNUMERIC:["groupCondition","*groupCondition"],VAR1:["groupCondition","*groupCondition"],VAR2:["groupCondition","*groupCondition"],SUBSTR:["groupCondition","*groupCondition"],REPLACE:["groupCondition","*groupCondition"],REGEX:["groupCondition","*groupCondition"],EXISTS:["groupCondition","*groupCondition"],NOT:["groupCondition","*groupCondition"],IRI_REF:["groupCondition","*groupCondition"],PNAME_LN:["groupCondition","*groupCondition"],PNAME_NS:["groupCondition","*groupCondition"]},"+havingCondition":{"(":["havingCondition","*havingCondition"],STR:["havingCondition","*havingCondition"],LANG:["havingCondition","*havingCondition"],LANGMATCHES:["havingCondition","*havingCondition"],DATATYPE:["havingCondition","*havingCondition"],BOUND:["havingCondition","*havingCondition"],IRI:["havingCondition","*havingCondition"],URI:["havingCondition","*havingCondition"],BNODE:["havingCondition","*havingCondition"],RAND:["havingCondition","*havingCondition"],ABS:["havingCondition","*havingCondition"],CEIL:["havingCondition","*havingCondition"],FLOOR:["havingCondition","*havingCondition"],ROUND:["havingCondition","*havingCondition"],CONCAT:["havingCondition","*havingCondition"],STRLEN:["havingCondition","*havingCondition"],UCASE:["havingCondition","*havingCondition"],LCASE:["havingCondition","*havingCondition"],ENCODE_FOR_URI:["havingCondition","*havingCondition"],CONTAINS:["havingCondition","*havingCondition"],STRSTARTS:["havingCondition","*havingCondition"],STRENDS:["havingCondition","*havingCondition"],STRBEFORE:["havingCondition","*havingCondition"],STRAFTER:["havingCondition","*havingCondition"],YEAR:["havingCondition","*havingCondition"],MONTH:["havingCondition","*havingCondition"],DAY:["havingCondition","*havingCondition"],HOURS:["havingCondition","*havingCondition"],MINUTES:["havingCondition","*havingCondition"],SECONDS:["havingCondition","*havingCondition"],TIMEZONE:["havingCondition","*havingCondition"],TZ:["havingCondition","*havingCondition"],NOW:["havingCondition","*havingCondition"],UUID:["havingCondition","*havingCondition"],STRUUID:["havingCondition","*havingCondition"],MD5:["havingCondition","*havingCondition"],SHA1:["havingCondition","*havingCondition"],SHA256:["havingCondition","*havingCondition"],SHA384:["havingCondition","*havingCondition"],SHA512:["havingCondition","*havingCondition"],COALESCE:["havingCondition","*havingCondition"],IF:["havingCondition","*havingCondition"],STRLANG:["havingCondition","*havingCondition"],STRDT:["havingCondition","*havingCondition"],SAMETERM:["havingCondition","*havingCondition"],ISIRI:["havingCondition","*havingCondition"],ISURI:["havingCondition","*havingCondition"],ISBLANK:["havingCondition","*havingCondition"],ISLITERAL:["havingCondition","*havingCondition"],ISNUMERIC:["havingCondition","*havingCondition"],SUBSTR:["havingCondition","*havingCondition"],REPLACE:["havingCondition","*havingCondition"],REGEX:["havingCondition","*havingCondition"],EXISTS:["havingCondition","*havingCondition"],NOT:["havingCondition","*havingCondition"],IRI_REF:["havingCondition","*havingCondition"],PNAME_LN:["havingCondition","*havingCondition"],PNAME_NS:["havingCondition","*havingCondition"]},"+or([var,[ (,expression,AS,var,)]])":{"(":["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],VAR1:["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],VAR2:["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"]},"+orderCondition":{ASC:["orderCondition","*orderCondition"],DESC:["orderCondition","*orderCondition"],VAR1:["orderCondition","*orderCondition"],VAR2:["orderCondition","*orderCondition"],"(":["orderCondition","*orderCondition"],STR:["orderCondition","*orderCondition"],LANG:["orderCondition","*orderCondition"],LANGMATCHES:["orderCondition","*orderCondition"],DATATYPE:["orderCondition","*orderCondition"],BOUND:["orderCondition","*orderCondition"],IRI:["orderCondition","*orderCondition"],URI:["orderCondition","*orderCondition"],BNODE:["orderCondition","*orderCondition"],RAND:["orderCondition","*orderCondition"],ABS:["orderCondition","*orderCondition"],CEIL:["orderCondition","*orderCondition"],FLOOR:["orderCondition","*orderCondition"],ROUND:["orderCondition","*orderCondition"],CONCAT:["orderCondition","*orderCondition"],STRLEN:["orderCondition","*orderCondition"],UCASE:["orderCondition","*orderCondition"],LCASE:["orderCondition","*orderCondition"],ENCODE_FOR_URI:["orderCondition","*orderCondition"],CONTAINS:["orderCondition","*orderCondition"],STRSTARTS:["orderCondition","*orderCondition"],STRENDS:["orderCondition","*orderCondition"],STRBEFORE:["orderCondition","*orderCondition"],STRAFTER:["orderCondition","*orderCondition"],YEAR:["orderCondition","*orderCondition"],MONTH:["orderCondition","*orderCondition"],DAY:["orderCondition","*orderCondition"],HOURS:["orderCondition","*orderCondition"],MINUTES:["orderCondition","*orderCondition"],SECONDS:["orderCondition","*orderCondition"],TIMEZONE:["orderCondition","*orderCondition"],TZ:["orderCondition","*orderCondition"],NOW:["orderCondition","*orderCondition"],UUID:["orderCondition","*orderCondition"],STRUUID:["orderCondition","*orderCondition"],MD5:["orderCondition","*orderCondition"],SHA1:["orderCondition","*orderCondition"],SHA256:["orderCondition","*orderCondition"],SHA384:["orderCondition","*orderCondition"],SHA512:["orderCondition","*orderCondition"],COALESCE:["orderCondition","*orderCondition"],IF:["orderCondition","*orderCondition"],STRLANG:["orderCondition","*orderCondition"],STRDT:["orderCondition","*orderCondition"],SAMETERM:["orderCondition","*orderCondition"],ISIRI:["orderCondition","*orderCondition"],ISURI:["orderCondition","*orderCondition"],ISBLANK:["orderCondition","*orderCondition"],ISLITERAL:["orderCondition","*orderCondition"],ISNUMERIC:["orderCondition","*orderCondition"],SUBSTR:["orderCondition","*orderCondition"],REPLACE:["orderCondition","*orderCondition"],REGEX:["orderCondition","*orderCondition"],EXISTS:["orderCondition","*orderCondition"],NOT:["orderCondition","*orderCondition"],IRI_REF:["orderCondition","*orderCondition"],PNAME_LN:["orderCondition","*orderCondition"],PNAME_NS:["orderCondition","*orderCondition"]},"+varOrIRIref":{VAR1:["varOrIRIref","*varOrIRIref"],VAR2:["varOrIRIref","*varOrIRIref"],IRI_REF:["varOrIRIref","*varOrIRIref"],PNAME_LN:["varOrIRIref","*varOrIRIref"],PNAME_NS:["varOrIRIref","*varOrIRIref"]},"?.":{".":["."],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?DISTINCT":{DISTINCT:["DISTINCT"],"!":[],"+":[],"-":[],VAR1:[],VAR2:[],"(":[],STR:[],LANG:[],LANGMATCHES:[],DATATYPE:[],BOUND:[],IRI:[],URI:[],BNODE:[],RAND:[],ABS:[],CEIL:[],FLOOR:[],ROUND:[],CONCAT:[],STRLEN:[],UCASE:[],LCASE:[],ENCODE_FOR_URI:[],CONTAINS:[],STRSTARTS:[],STRENDS:[],STRBEFORE:[],STRAFTER:[],YEAR:[],MONTH:[],DAY:[],HOURS:[],MINUTES:[],SECONDS:[],TIMEZONE:[],TZ:[],NOW:[],UUID:[],STRUUID:[],MD5:[],SHA1:[],SHA256:[],SHA384:[],SHA512:[],COALESCE:[],IF:[],STRLANG:[],STRDT:[],SAMETERM:[],ISIRI:[],ISURI:[],ISBLANK:[],ISLITERAL:[],ISNUMERIC:[],TRUE:[],FALSE:[],COUNT:[],SUM:[],MIN:[],MAX:[],AVG:[],SAMPLE:[],GROUP_CONCAT:[],SUBSTR:[],REPLACE:[],REGEX:[],EXISTS:[],NOT:[],IRI_REF:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],PNAME_LN:[],PNAME_NS:[],"*":[]},"?GRAPH":{GRAPH:["GRAPH"],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT":{SILENT:["SILENT"],VAR1:[],VAR2:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT_1":{SILENT:["SILENT"],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT_2":{SILENT:["SILENT"],GRAPH:[],DEFAULT:[],NAMED:[],ALL:[]},"?SILENT_3":{SILENT:["SILENT"],GRAPH:[]},"?SILENT_4":{SILENT:["SILENT"],DEFAULT:[],GRAPH:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?WHERE":{WHERE:["WHERE"],"{":[]},"?[,,expression]":{",":["[,,expression]"],")":[]},"?[.,?constructTriples]":{".":["[.,?constructTriples]"],"}":[]},"?[.,?triplesBlock]":{".":["[.,?triplesBlock]"],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?[.,?triplesTemplate]":{".":["[.,?triplesTemplate]"],"}":[],GRAPH:[]},"?[;,SEPARATOR,=,string]":{";":["[;,SEPARATOR,=,string]"],")":[]},"?[;,update]":{";":["[;,update]"],$:[]},"?[AS,var]":{AS:["[AS,var]"],")":[]},"?[INTO,graphRef]":{INTO:["[INTO,graphRef]"],";":[],$:[]},"?[or([verbPath,verbSimple]),objectList]":{VAR1:["[or([verbPath,verbSimple]),objectList]"],VAR2:["[or([verbPath,verbSimple]),objectList]"],"^":["[or([verbPath,verbSimple]),objectList]"],a:["[or([verbPath,verbSimple]),objectList]"],"!":["[or([verbPath,verbSimple]),objectList]"],"(":["[or([verbPath,verbSimple]),objectList]"],IRI_REF:["[or([verbPath,verbSimple]),objectList]"],PNAME_LN:["[or([verbPath,verbSimple]),objectList]"],PNAME_NS:["[or([verbPath,verbSimple]),objectList]"],";":[],".":[],"]":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?[pathOneInPropertySet,*[|,pathOneInPropertySet]]":{a:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],"^":["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],IRI_REF:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],PNAME_LN:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],PNAME_NS:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],")":[]},"?[update1,?[;,update]]":{INSERT:["[update1,?[;,update]]"],DELETE:["[update1,?[;,update]]"],LOAD:["[update1,?[;,update]]"],CLEAR:["[update1,?[;,update]]"],DROP:["[update1,?[;,update]]"],ADD:["[update1,?[;,update]]"],MOVE:["[update1,?[;,update]]"],COPY:["[update1,?[;,update]]"],CREATE:["[update1,?[;,update]]"],WITH:["[update1,?[;,update]]"],$:[]},"?[verb,objectList]":{a:["[verb,objectList]"],VAR1:["[verb,objectList]"],VAR2:["[verb,objectList]"],IRI_REF:["[verb,objectList]"],PNAME_LN:["[verb,objectList]"],PNAME_NS:["[verb,objectList]"],";":[],".":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"?argList":{NIL:["argList"],"(":["argList"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],"*":[],"/":[],";":[]},"?baseDecl":{BASE:["baseDecl"],$:[],CONSTRUCT:[],DESCRIBE:[],ASK:[],INSERT:[],DELETE:[],SELECT:[],LOAD:[],CLEAR:[],DROP:[],ADD:[],MOVE:[],COPY:[],CREATE:[],WITH:[],PREFIX:[]},"?constructTriples":{VAR1:["constructTriples"],VAR2:["constructTriples"],NIL:["constructTriples"],"(":["constructTriples"],"[":["constructTriples"],IRI_REF:["constructTriples"],TRUE:["constructTriples"],FALSE:["constructTriples"],BLANK_NODE_LABEL:["constructTriples"],ANON:["constructTriples"],PNAME_LN:["constructTriples"],PNAME_NS:["constructTriples"],STRING_LITERAL1:["constructTriples"],STRING_LITERAL2:["constructTriples"],STRING_LITERAL_LONG1:["constructTriples"],STRING_LITERAL_LONG2:["constructTriples"],INTEGER:["constructTriples"],DECIMAL:["constructTriples"],DOUBLE:["constructTriples"],INTEGER_POSITIVE:["constructTriples"],DECIMAL_POSITIVE:["constructTriples"],DOUBLE_POSITIVE:["constructTriples"],INTEGER_NEGATIVE:["constructTriples"],DECIMAL_NEGATIVE:["constructTriples"],DOUBLE_NEGATIVE:["constructTriples"],"}":[]},"?groupClause":{GROUP:["groupClause"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],HAVING:[],$:[],"}":[]},"?havingClause":{HAVING:["havingClause"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],$:[],"}":[]},"?insertClause":{INSERT:["insertClause"],WHERE:[],USING:[]},"?limitClause":{LIMIT:["limitClause"],VALUES:[],$:[],"}":[]},"?limitOffsetClauses":{LIMIT:["limitOffsetClauses"],OFFSET:["limitOffsetClauses"],VALUES:[],$:[],"}":[]},"?offsetClause":{OFFSET:["offsetClause"],VALUES:[],$:[],"}":[]},"?or([DISTINCT,REDUCED])":{DISTINCT:["or([DISTINCT,REDUCED])"],REDUCED:["or([DISTINCT,REDUCED])"],"*":[],"(":[],VAR1:[],VAR2:[]},"?or([LANGTAG,[^^,iriRef]])":{LANGTAG:["or([LANGTAG,[^^,iriRef]])"],"^^":["or([LANGTAG,[^^,iriRef]])"],UNDEF:[],IRI_REF:[],TRUE:[],FALSE:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],a:[],VAR1:[],VAR2:[],"^":[],"!":[],"(":[],".":[],";":[],",":[],AS:[],")":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],"*":[],"/":[],"}":[],"[":[],NIL:[],BLANK_NODE_LABEL:[],ANON:[],"]":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"?or([[*,unaryExpression],[/,unaryExpression]])":{"*":["or([[*,unaryExpression],[/,unaryExpression]])"],"/":["or([[*,unaryExpression],[/,unaryExpression]])"],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],";":[]},"?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])":{"=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"!=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],">":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],">=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IN:["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOT:["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],AS:[],")":[],",":[],"||":[],"&&":[],";":[]},"?orderClause":{ORDER:["orderClause"],VALUES:[],LIMIT:[],OFFSET:[],$:[],"}":[]},"?pathMod":{"*":["pathMod"],"?":["pathMod"],"+":["pathMod"],"{":["pathMod"],"|":[],"/":[],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"?triplesBlock":{VAR1:["triplesBlock"],VAR2:["triplesBlock"],NIL:["triplesBlock"],"(":["triplesBlock"],"[":["triplesBlock"],IRI_REF:["triplesBlock"],TRUE:["triplesBlock"],FALSE:["triplesBlock"],BLANK_NODE_LABEL:["triplesBlock"],ANON:["triplesBlock"],PNAME_LN:["triplesBlock"],PNAME_NS:["triplesBlock"],STRING_LITERAL1:["triplesBlock"],STRING_LITERAL2:["triplesBlock"],STRING_LITERAL_LONG1:["triplesBlock"],STRING_LITERAL_LONG2:["triplesBlock"],INTEGER:["triplesBlock"],DECIMAL:["triplesBlock"],DOUBLE:["triplesBlock"],INTEGER_POSITIVE:["triplesBlock"],DECIMAL_POSITIVE:["triplesBlock"],DOUBLE_POSITIVE:["triplesBlock"],INTEGER_NEGATIVE:["triplesBlock"],DECIMAL_NEGATIVE:["triplesBlock"],DOUBLE_NEGATIVE:["triplesBlock"],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?triplesTemplate":{VAR1:["triplesTemplate"],VAR2:["triplesTemplate"],NIL:["triplesTemplate"],"(":["triplesTemplate"],"[":["triplesTemplate"],IRI_REF:["triplesTemplate"],TRUE:["triplesTemplate"],FALSE:["triplesTemplate"],BLANK_NODE_LABEL:["triplesTemplate"],ANON:["triplesTemplate"],PNAME_LN:["triplesTemplate"],PNAME_NS:["triplesTemplate"],STRING_LITERAL1:["triplesTemplate"],STRING_LITERAL2:["triplesTemplate"],STRING_LITERAL_LONG1:["triplesTemplate"],STRING_LITERAL_LONG2:["triplesTemplate"],INTEGER:["triplesTemplate"],DECIMAL:["triplesTemplate"],DOUBLE:["triplesTemplate"],INTEGER_POSITIVE:["triplesTemplate"],DECIMAL_POSITIVE:["triplesTemplate"],DOUBLE_POSITIVE:["triplesTemplate"],INTEGER_NEGATIVE:["triplesTemplate"],DECIMAL_NEGATIVE:["triplesTemplate"],DOUBLE_NEGATIVE:["triplesTemplate"],"}":[],GRAPH:[]},"?whereClause":{WHERE:["whereClause"],"{":["whereClause"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],VALUES:[],$:[]},"[ (,*dataBlockValue,)]":{"(":["(","*dataBlockValue",")"]},"[ (,*var,)]":{"(":["(","*var",")"]},"[ (,expression,)]":{"(":["(","expression",")"]},"[ (,expression,AS,var,)]":{"(":["(","expression","AS","var",")"]},"[!=,numericExpression]":{"!=":["!=","numericExpression"]},"[&&,valueLogical]":{"&&":["&&","valueLogical"]},"[*,unaryExpression]":{"*":["*","unaryExpression"]},"[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]":{WHERE:["*datasetClause","WHERE","{","?triplesTemplate","}","solutionModifier"],FROM:["*datasetClause","WHERE","{","?triplesTemplate","}","solutionModifier"]},"[+,multiplicativeExpression]":{"+":["+","multiplicativeExpression"]},"[,,expression]":{",":[",","expression"]},"[,,integer,}]":{",":[",","integer","}"]},"[,,objectPath]":{",":[",","objectPath"]},"[,,object]":{",":[",","object"]},"[,,or([},[integer,}]])]":{",":[",","or([},[integer,}]])"]},"[-,multiplicativeExpression]":{"-":["-","multiplicativeExpression"]},"[.,?constructTriples]":{".":[".","?constructTriples"]},"[.,?triplesBlock]":{".":[".","?triplesBlock"]},"[.,?triplesTemplate]":{".":[".","?triplesTemplate"]},"[/,pathEltOrInverse]":{"/":["/","pathEltOrInverse"]},"[/,unaryExpression]":{"/":["/","unaryExpression"]},"[;,?[or([verbPath,verbSimple]),objectList]]":{";":[";","?[or([verbPath,verbSimple]),objectList]"]},"[;,?[verb,objectList]]":{";":[";","?[verb,objectList]"]},"[;,SEPARATOR,=,string]":{";":[";","SEPARATOR","=","string"]},"[;,update]":{";":[";","update"]},"[<,numericExpression]":{"<":["<","numericExpression"]},"[<=,numericExpression]":{"<=":["<=","numericExpression"]},"[=,numericExpression]":{"=":["=","numericExpression"]},"[>,numericExpression]":{">":[">","numericExpression"]},"[>=,numericExpression]":{">=":[">=","numericExpression"]},"[AS,var]":{AS:["AS","var"]},"[IN,expressionList]":{IN:["IN","expressionList"]},"[INTO,graphRef]":{INTO:["INTO","graphRef"]},"[NAMED,iriRef]":{NAMED:["NAMED","iriRef"]},"[NOT,IN,expressionList]":{NOT:["NOT","IN","expressionList"]},"[UNION,groupGraphPattern]":{UNION:["UNION","groupGraphPattern"]},"[^^,iriRef]":{"^^":["^^","iriRef"]},"[constructTemplate,*datasetClause,whereClause,solutionModifier]":{"{":["constructTemplate","*datasetClause","whereClause","solutionModifier"]},"[deleteClause,?insertClause]":{DELETE:["deleteClause","?insertClause"]},"[graphPatternNotTriples,?.,?triplesBlock]":{"{":["graphPatternNotTriples","?.","?triplesBlock"],OPTIONAL:["graphPatternNotTriples","?.","?triplesBlock"],MINUS:["graphPatternNotTriples","?.","?triplesBlock"],GRAPH:["graphPatternNotTriples","?.","?triplesBlock"],SERVICE:["graphPatternNotTriples","?.","?triplesBlock"],FILTER:["graphPatternNotTriples","?.","?triplesBlock"],BIND:["graphPatternNotTriples","?.","?triplesBlock"],VALUES:["graphPatternNotTriples","?.","?triplesBlock"]},"[integer,or([[,,or([},[integer,}]])],}])]":{INTEGER:["integer","or([[,,or([},[integer,}]])],}])"]},"[integer,}]":{INTEGER:["integer","}"]},"[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]":{INTEGER_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"]},"[or([verbPath,verbSimple]),objectList]":{VAR1:["or([verbPath,verbSimple])","objectList"],VAR2:["or([verbPath,verbSimple])","objectList"],"^":["or([verbPath,verbSimple])","objectList"],a:["or([verbPath,verbSimple])","objectList"],"!":["or([verbPath,verbSimple])","objectList"],"(":["or([verbPath,verbSimple])","objectList"],IRI_REF:["or([verbPath,verbSimple])","objectList"],PNAME_LN:["or([verbPath,verbSimple])","objectList"],PNAME_NS:["or([verbPath,verbSimple])","objectList"]},"[pathOneInPropertySet,*[|,pathOneInPropertySet]]":{a:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],"^":["pathOneInPropertySet","*[|,pathOneInPropertySet]"],IRI_REF:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],PNAME_LN:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],PNAME_NS:["pathOneInPropertySet","*[|,pathOneInPropertySet]"]},"[quadsNotTriples,?.,?triplesTemplate]":{GRAPH:["quadsNotTriples","?.","?triplesTemplate"]},"[update1,?[;,update]]":{INSERT:["update1","?[;,update]"],DELETE:["update1","?[;,update]"],LOAD:["update1","?[;,update]"],CLEAR:["update1","?[;,update]"],DROP:["update1","?[;,update]"],ADD:["update1","?[;,update]"],MOVE:["update1","?[;,update]"],COPY:["update1","?[;,update]"],CREATE:["update1","?[;,update]"],WITH:["update1","?[;,update]"]},"[verb,objectList]":{a:["verb","objectList"],VAR1:["verb","objectList"],VAR2:["verb","objectList"],IRI_REF:["verb","objectList"],PNAME_LN:["verb","objectList"],PNAME_NS:["verb","objectList"]},"[|,pathOneInPropertySet]":{"|":["|","pathOneInPropertySet"]},"[|,pathSequence]":{"|":["|","pathSequence"]},"[||,conditionalAndExpression]":{"||":["||","conditionalAndExpression"]},add:{ADD:["ADD","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},additiveExpression:{"!":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"+":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"-":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],VAR1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],VAR2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"(":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LANG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LANGMATCHES:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DATATYPE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],BOUND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IRI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],URI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],BNODE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],RAND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ABS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CEIL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],FLOOR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ROUND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CONCAT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRLEN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],UCASE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LCASE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ENCODE_FOR_URI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CONTAINS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRSTARTS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRENDS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRBEFORE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRAFTER:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],YEAR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MONTH:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DAY:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],HOURS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MINUTES:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SECONDS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TIMEZONE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TZ:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],NOW:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],UUID:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRUUID:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MD5:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA256:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA384:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA512:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],COALESCE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IF:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRLANG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRDT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SAMETERM:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISIRI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISURI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISBLANK:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISLITERAL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISNUMERIC:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TRUE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],FALSE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],COUNT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SUM:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MIN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MAX:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],AVG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SAMPLE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],GROUP_CONCAT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SUBSTR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],REPLACE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],REGEX:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],EXISTS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],NOT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IRI_REF:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL_LONG1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL_LONG2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],PNAME_LN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],PNAME_NS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"]},aggregate:{COUNT:["COUNT","(","?DISTINCT","or([*,expression])",")"],SUM:["SUM","(","?DISTINCT","expression",")"],MIN:["MIN","(","?DISTINCT","expression",")"],MAX:["MAX","(","?DISTINCT","expression",")"],AVG:["AVG","(","?DISTINCT","expression",")"],SAMPLE:["SAMPLE","(","?DISTINCT","expression",")"],GROUP_CONCAT:["GROUP_CONCAT","(","?DISTINCT","expression","?[;,SEPARATOR,=,string]",")"]},allowBnodes:{"}":[]},allowVars:{"}":[]},argList:{NIL:["NIL"],"(":["(","?DISTINCT","expression","*[,,expression]",")"]},askQuery:{ASK:["ASK","*datasetClause","whereClause","solutionModifier"]},baseDecl:{BASE:["BASE","IRI_REF"]},bind:{BIND:["BIND","(","expression","AS","var",")"]},blankNode:{BLANK_NODE_LABEL:["BLANK_NODE_LABEL"],ANON:["ANON"]},blankNodePropertyList:{"[":["[","propertyListNotEmpty","]"]},blankNodePropertyListPath:{"[":["[","propertyListPathNotEmpty","]"]},booleanLiteral:{TRUE:["TRUE"],FALSE:["FALSE"]},brackettedExpression:{"(":["(","expression",")"]},builtInCall:{STR:["STR","(","expression",")"],LANG:["LANG","(","expression",")"],LANGMATCHES:["LANGMATCHES","(","expression",",","expression",")"],DATATYPE:["DATATYPE","(","expression",")"],BOUND:["BOUND","(","var",")"],IRI:["IRI","(","expression",")"],URI:["URI","(","expression",")"],BNODE:["BNODE","or([[ (,expression,)],NIL])"],RAND:["RAND","NIL"],ABS:["ABS","(","expression",")"],CEIL:["CEIL","(","expression",")"],FLOOR:["FLOOR","(","expression",")"],ROUND:["ROUND","(","expression",")"],CONCAT:["CONCAT","expressionList"],SUBSTR:["substringExpression"],STRLEN:["STRLEN","(","expression",")"],REPLACE:["strReplaceExpression"],UCASE:["UCASE","(","expression",")"],LCASE:["LCASE","(","expression",")"],ENCODE_FOR_URI:["ENCODE_FOR_URI","(","expression",")"],CONTAINS:["CONTAINS","(","expression",",","expression",")"],STRSTARTS:["STRSTARTS","(","expression",",","expression",")"],STRENDS:["STRENDS","(","expression",",","expression",")"],STRBEFORE:["STRBEFORE","(","expression",",","expression",")"],STRAFTER:["STRAFTER","(","expression",",","expression",")"],YEAR:["YEAR","(","expression",")"],MONTH:["MONTH","(","expression",")"],DAY:["DAY","(","expression",")"],HOURS:["HOURS","(","expression",")"],MINUTES:["MINUTES","(","expression",")"],SECONDS:["SECONDS","(","expression",")"],TIMEZONE:["TIMEZONE","(","expression",")"],TZ:["TZ","(","expression",")"],NOW:["NOW","NIL"],UUID:["UUID","NIL"],STRUUID:["STRUUID","NIL"],MD5:["MD5","(","expression",")"],SHA1:["SHA1","(","expression",")"],SHA256:["SHA256","(","expression",")"],SHA384:["SHA384","(","expression",")"],SHA512:["SHA512","(","expression",")"],COALESCE:["COALESCE","expressionList"],IF:["IF","(","expression",",","expression",",","expression",")"],STRLANG:["STRLANG","(","expression",",","expression",")"],STRDT:["STRDT","(","expression",",","expression",")"],SAMETERM:["SAMETERM","(","expression",",","expression",")"],ISIRI:["ISIRI","(","expression",")"],ISURI:["ISURI","(","expression",")"],ISBLANK:["ISBLANK","(","expression",")"],ISLITERAL:["ISLITERAL","(","expression",")"],ISNUMERIC:["ISNUMERIC","(","expression",")"],REGEX:["regexExpression"],EXISTS:["existsFunc"],NOT:["notExistsFunc"]},clear:{CLEAR:["CLEAR","?SILENT_2","graphRefAll"]},collection:{"(":["(","+graphNode",")"]},collectionPath:{"(":["(","+graphNodePath",")"]},conditionalAndExpression:{"!":["valueLogical","*[&&,valueLogical]"],"+":["valueLogical","*[&&,valueLogical]"],"-":["valueLogical","*[&&,valueLogical]"],VAR1:["valueLogical","*[&&,valueLogical]"],VAR2:["valueLogical","*[&&,valueLogical]"],"(":["valueLogical","*[&&,valueLogical]"],STR:["valueLogical","*[&&,valueLogical]"],LANG:["valueLogical","*[&&,valueLogical]"],LANGMATCHES:["valueLogical","*[&&,valueLogical]"],DATATYPE:["valueLogical","*[&&,valueLogical]"],BOUND:["valueLogical","*[&&,valueLogical]"],IRI:["valueLogical","*[&&,valueLogical]"],URI:["valueLogical","*[&&,valueLogical]"],BNODE:["valueLogical","*[&&,valueLogical]"],RAND:["valueLogical","*[&&,valueLogical]"],ABS:["valueLogical","*[&&,valueLogical]"],CEIL:["valueLogical","*[&&,valueLogical]"],FLOOR:["valueLogical","*[&&,valueLogical]"],ROUND:["valueLogical","*[&&,valueLogical]"],CONCAT:["valueLogical","*[&&,valueLogical]"],STRLEN:["valueLogical","*[&&,valueLogical]"],UCASE:["valueLogical","*[&&,valueLogical]"],LCASE:["valueLogical","*[&&,valueLogical]"],ENCODE_FOR_URI:["valueLogical","*[&&,valueLogical]"],CONTAINS:["valueLogical","*[&&,valueLogical]"],STRSTARTS:["valueLogical","*[&&,valueLogical]"],STRENDS:["valueLogical","*[&&,valueLogical]"],STRBEFORE:["valueLogical","*[&&,valueLogical]"],STRAFTER:["valueLogical","*[&&,valueLogical]"],YEAR:["valueLogical","*[&&,valueLogical]"],MONTH:["valueLogical","*[&&,valueLogical]"],DAY:["valueLogical","*[&&,valueLogical]"],HOURS:["valueLogical","*[&&,valueLogical]"],MINUTES:["valueLogical","*[&&,valueLogical]"],SECONDS:["valueLogical","*[&&,valueLogical]"],TIMEZONE:["valueLogical","*[&&,valueLogical]"],TZ:["valueLogical","*[&&,valueLogical]"],NOW:["valueLogical","*[&&,valueLogical]"],UUID:["valueLogical","*[&&,valueLogical]"],STRUUID:["valueLogical","*[&&,valueLogical]"],MD5:["valueLogical","*[&&,valueLogical]"],SHA1:["valueLogical","*[&&,valueLogical]"],SHA256:["valueLogical","*[&&,valueLogical]"],SHA384:["valueLogical","*[&&,valueLogical]"],SHA512:["valueLogical","*[&&,valueLogical]"],COALESCE:["valueLogical","*[&&,valueLogical]"],IF:["valueLogical","*[&&,valueLogical]"],STRLANG:["valueLogical","*[&&,valueLogical]"],STRDT:["valueLogical","*[&&,valueLogical]"],SAMETERM:["valueLogical","*[&&,valueLogical]"],ISIRI:["valueLogical","*[&&,valueLogical]"],ISURI:["valueLogical","*[&&,valueLogical]"],ISBLANK:["valueLogical","*[&&,valueLogical]"],ISLITERAL:["valueLogical","*[&&,valueLogical]"],ISNUMERIC:["valueLogical","*[&&,valueLogical]"],TRUE:["valueLogical","*[&&,valueLogical]"],FALSE:["valueLogical","*[&&,valueLogical]"],COUNT:["valueLogical","*[&&,valueLogical]"],SUM:["valueLogical","*[&&,valueLogical]"],MIN:["valueLogical","*[&&,valueLogical]"],MAX:["valueLogical","*[&&,valueLogical]"],AVG:["valueLogical","*[&&,valueLogical]"],SAMPLE:["valueLogical","*[&&,valueLogical]"],GROUP_CONCAT:["valueLogical","*[&&,valueLogical]"],SUBSTR:["valueLogical","*[&&,valueLogical]"],REPLACE:["valueLogical","*[&&,valueLogical]"],REGEX:["valueLogical","*[&&,valueLogical]"],EXISTS:["valueLogical","*[&&,valueLogical]"],NOT:["valueLogical","*[&&,valueLogical]"],IRI_REF:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL1:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL2:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL_LONG1:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL_LONG2:["valueLogical","*[&&,valueLogical]"],INTEGER:["valueLogical","*[&&,valueLogical]"],DECIMAL:["valueLogical","*[&&,valueLogical]"],DOUBLE:["valueLogical","*[&&,valueLogical]"],INTEGER_POSITIVE:["valueLogical","*[&&,valueLogical]"],DECIMAL_POSITIVE:["valueLogical","*[&&,valueLogical]"],DOUBLE_POSITIVE:["valueLogical","*[&&,valueLogical]"],INTEGER_NEGATIVE:["valueLogical","*[&&,valueLogical]"],DECIMAL_NEGATIVE:["valueLogical","*[&&,valueLogical]"],DOUBLE_NEGATIVE:["valueLogical","*[&&,valueLogical]"],PNAME_LN:["valueLogical","*[&&,valueLogical]"],PNAME_NS:["valueLogical","*[&&,valueLogical]"]},conditionalOrExpression:{"!":["conditionalAndExpression","*[||,conditionalAndExpression]"],"+":["conditionalAndExpression","*[||,conditionalAndExpression]"],"-":["conditionalAndExpression","*[||,conditionalAndExpression]"],VAR1:["conditionalAndExpression","*[||,conditionalAndExpression]"],VAR2:["conditionalAndExpression","*[||,conditionalAndExpression]"],"(":["conditionalAndExpression","*[||,conditionalAndExpression]"],STR:["conditionalAndExpression","*[||,conditionalAndExpression]"],LANG:["conditionalAndExpression","*[||,conditionalAndExpression]"],LANGMATCHES:["conditionalAndExpression","*[||,conditionalAndExpression]"],DATATYPE:["conditionalAndExpression","*[||,conditionalAndExpression]"],BOUND:["conditionalAndExpression","*[||,conditionalAndExpression]"],IRI:["conditionalAndExpression","*[||,conditionalAndExpression]"],URI:["conditionalAndExpression","*[||,conditionalAndExpression]"],BNODE:["conditionalAndExpression","*[||,conditionalAndExpression]"],RAND:["conditionalAndExpression","*[||,conditionalAndExpression]"],ABS:["conditionalAndExpression","*[||,conditionalAndExpression]"],CEIL:["conditionalAndExpression","*[||,conditionalAndExpression]"],FLOOR:["conditionalAndExpression","*[||,conditionalAndExpression]"],ROUND:["conditionalAndExpression","*[||,conditionalAndExpression]"],CONCAT:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRLEN:["conditionalAndExpression","*[||,conditionalAndExpression]"],UCASE:["conditionalAndExpression","*[||,conditionalAndExpression]"],LCASE:["conditionalAndExpression","*[||,conditionalAndExpression]"],ENCODE_FOR_URI:["conditionalAndExpression","*[||,conditionalAndExpression]"],CONTAINS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRSTARTS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRENDS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRBEFORE:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRAFTER:["conditionalAndExpression","*[||,conditionalAndExpression]"],YEAR:["conditionalAndExpression","*[||,conditionalAndExpression]"],MONTH:["conditionalAndExpression","*[||,conditionalAndExpression]"],DAY:["conditionalAndExpression","*[||,conditionalAndExpression]"],HOURS:["conditionalAndExpression","*[||,conditionalAndExpression]"],MINUTES:["conditionalAndExpression","*[||,conditionalAndExpression]"],SECONDS:["conditionalAndExpression","*[||,conditionalAndExpression]"],TIMEZONE:["conditionalAndExpression","*[||,conditionalAndExpression]"],TZ:["conditionalAndExpression","*[||,conditionalAndExpression]"],NOW:["conditionalAndExpression","*[||,conditionalAndExpression]"],UUID:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRUUID:["conditionalAndExpression","*[||,conditionalAndExpression]"],MD5:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA1:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA256:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA384:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA512:["conditionalAndExpression","*[||,conditionalAndExpression]"],COALESCE:["conditionalAndExpression","*[||,conditionalAndExpression]"],IF:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRLANG:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRDT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SAMETERM:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISIRI:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISURI:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISBLANK:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISLITERAL:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISNUMERIC:["conditionalAndExpression","*[||,conditionalAndExpression]"],TRUE:["conditionalAndExpression","*[||,conditionalAndExpression]"],FALSE:["conditionalAndExpression","*[||,conditionalAndExpression]"],COUNT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SUM:["conditionalAndExpression","*[||,conditionalAndExpression]"],MIN:["conditionalAndExpression","*[||,conditionalAndExpression]"],MAX:["conditionalAndExpression","*[||,conditionalAndExpression]"],AVG:["conditionalAndExpression","*[||,conditionalAndExpression]"],SAMPLE:["conditionalAndExpression","*[||,conditionalAndExpression]"],GROUP_CONCAT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SUBSTR:["conditionalAndExpression","*[||,conditionalAndExpression]"],REPLACE:["conditionalAndExpression","*[||,conditionalAndExpression]"],REGEX:["conditionalAndExpression","*[||,conditionalAndExpression]"],EXISTS:["conditionalAndExpression","*[||,conditionalAndExpression]"],NOT:["conditionalAndExpression","*[||,conditionalAndExpression]"],IRI_REF:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL1:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL2:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL_LONG1:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL_LONG2:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],PNAME_LN:["conditionalAndExpression","*[||,conditionalAndExpression]"],PNAME_NS:["conditionalAndExpression","*[||,conditionalAndExpression]"]},constraint:{"(":["brackettedExpression"],STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["functionCall"],PNAME_LN:["functionCall"],PNAME_NS:["functionCall"]},constructQuery:{CONSTRUCT:["CONSTRUCT","or([[constructTemplate,*datasetClause,whereClause,solutionModifier],[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]])"]},constructTemplate:{"{":["{","?constructTriples","}"]},constructTriples:{VAR1:["triplesSameSubject","?[.,?constructTriples]"],VAR2:["triplesSameSubject","?[.,?constructTriples]"],NIL:["triplesSameSubject","?[.,?constructTriples]"],"(":["triplesSameSubject","?[.,?constructTriples]"],"[":["triplesSameSubject","?[.,?constructTriples]"],IRI_REF:["triplesSameSubject","?[.,?constructTriples]"],TRUE:["triplesSameSubject","?[.,?constructTriples]"],FALSE:["triplesSameSubject","?[.,?constructTriples]"],BLANK_NODE_LABEL:["triplesSameSubject","?[.,?constructTriples]"],ANON:["triplesSameSubject","?[.,?constructTriples]"],PNAME_LN:["triplesSameSubject","?[.,?constructTriples]"],PNAME_NS:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL1:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL2:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL_LONG1:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL_LONG2:["triplesSameSubject","?[.,?constructTriples]"],INTEGER:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE:["triplesSameSubject","?[.,?constructTriples]"],INTEGER_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],INTEGER_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"]},copy:{COPY:["COPY","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},create:{CREATE:["CREATE","?SILENT_3","graphRef"]},dataBlock:{NIL:["or([inlineDataOneVar,inlineDataFull])"],"(":["or([inlineDataOneVar,inlineDataFull])"],VAR1:["or([inlineDataOneVar,inlineDataFull])"],VAR2:["or([inlineDataOneVar,inlineDataFull])"]},dataBlockValue:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],UNDEF:["UNDEF"]},datasetClause:{FROM:["FROM","or([defaultGraphClause,namedGraphClause])"]},defaultGraphClause:{IRI_REF:["sourceSelector"],PNAME_LN:["sourceSelector"],PNAME_NS:["sourceSelector"]},delete1:{DATA:["DATA","quadDataNoBnodes"],WHERE:["WHERE","quadPatternNoBnodes"],"{":["quadPatternNoBnodes","?insertClause","*usingClause","WHERE","groupGraphPattern"]},deleteClause:{DELETE:["DELETE","quadPattern"]},describeDatasetClause:{FROM:["FROM","or([defaultGraphClause,namedGraphClause])"]},describeQuery:{DESCRIBE:["DESCRIBE","or([+varOrIRIref,*])","*describeDatasetClause","?whereClause","solutionModifier"]},disallowBnodes:{"}":[],GRAPH:[],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},disallowVars:{"}":[],GRAPH:[],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},drop:{DROP:["DROP","?SILENT_2","graphRefAll"]},existsFunc:{EXISTS:["EXISTS","groupGraphPattern"]},expression:{"!":["conditionalOrExpression"],"+":["conditionalOrExpression"],"-":["conditionalOrExpression"],VAR1:["conditionalOrExpression"],VAR2:["conditionalOrExpression"],"(":["conditionalOrExpression"],STR:["conditionalOrExpression"],LANG:["conditionalOrExpression"],LANGMATCHES:["conditionalOrExpression"],DATATYPE:["conditionalOrExpression"],BOUND:["conditionalOrExpression"],IRI:["conditionalOrExpression"],URI:["conditionalOrExpression"],BNODE:["conditionalOrExpression"],RAND:["conditionalOrExpression"],ABS:["conditionalOrExpression"],CEIL:["conditionalOrExpression"],FLOOR:["conditionalOrExpression"],ROUND:["conditionalOrExpression"],CONCAT:["conditionalOrExpression"],STRLEN:["conditionalOrExpression"],UCASE:["conditionalOrExpression"],LCASE:["conditionalOrExpression"],ENCODE_FOR_URI:["conditionalOrExpression"],CONTAINS:["conditionalOrExpression"],STRSTARTS:["conditionalOrExpression"],STRENDS:["conditionalOrExpression"],STRBEFORE:["conditionalOrExpression"],STRAFTER:["conditionalOrExpression"],YEAR:["conditionalOrExpression"],MONTH:["conditionalOrExpression"],DAY:["conditionalOrExpression"],HOURS:["conditionalOrExpression"],MINUTES:["conditionalOrExpression"],SECONDS:["conditionalOrExpression"],TIMEZONE:["conditionalOrExpression"],TZ:["conditionalOrExpression"],NOW:["conditionalOrExpression"],UUID:["conditionalOrExpression"],STRUUID:["conditionalOrExpression"],MD5:["conditionalOrExpression"],SHA1:["conditionalOrExpression"],SHA256:["conditionalOrExpression"],SHA384:["conditionalOrExpression"],SHA512:["conditionalOrExpression"],COALESCE:["conditionalOrExpression"],IF:["conditionalOrExpression"],STRLANG:["conditionalOrExpression"],STRDT:["conditionalOrExpression"],SAMETERM:["conditionalOrExpression"],ISIRI:["conditionalOrExpression"],ISURI:["conditionalOrExpression"],ISBLANK:["conditionalOrExpression"],ISLITERAL:["conditionalOrExpression"],ISNUMERIC:["conditionalOrExpression"],TRUE:["conditionalOrExpression"],FALSE:["conditionalOrExpression"],COUNT:["conditionalOrExpression"],SUM:["conditionalOrExpression"],MIN:["conditionalOrExpression"],MAX:["conditionalOrExpression"],AVG:["conditionalOrExpression"],SAMPLE:["conditionalOrExpression"],GROUP_CONCAT:["conditionalOrExpression"],SUBSTR:["conditionalOrExpression"],REPLACE:["conditionalOrExpression"],REGEX:["conditionalOrExpression"],EXISTS:["conditionalOrExpression"],NOT:["conditionalOrExpression"],IRI_REF:["conditionalOrExpression"],STRING_LITERAL1:["conditionalOrExpression"],STRING_LITERAL2:["conditionalOrExpression"],STRING_LITERAL_LONG1:["conditionalOrExpression"],STRING_LITERAL_LONG2:["conditionalOrExpression"],INTEGER:["conditionalOrExpression"],DECIMAL:["conditionalOrExpression"],DOUBLE:["conditionalOrExpression"],INTEGER_POSITIVE:["conditionalOrExpression"],DECIMAL_POSITIVE:["conditionalOrExpression"],DOUBLE_POSITIVE:["conditionalOrExpression"],INTEGER_NEGATIVE:["conditionalOrExpression"],DECIMAL_NEGATIVE:["conditionalOrExpression"],DOUBLE_NEGATIVE:["conditionalOrExpression"],PNAME_LN:["conditionalOrExpression"],PNAME_NS:["conditionalOrExpression"]},expressionList:{NIL:["NIL"],"(":["(","expression","*[,,expression]",")"]},filter:{FILTER:["FILTER","constraint"]},functionCall:{IRI_REF:["iriRef","argList"],PNAME_LN:["iriRef","argList"],PNAME_NS:["iriRef","argList"]},graphGraphPattern:{GRAPH:["GRAPH","varOrIRIref","groupGraphPattern"]},graphNode:{VAR1:["varOrTerm"],VAR2:["varOrTerm"],NIL:["varOrTerm"],IRI_REF:["varOrTerm"],TRUE:["varOrTerm"],FALSE:["varOrTerm"],BLANK_NODE_LABEL:["varOrTerm"],ANON:["varOrTerm"],PNAME_LN:["varOrTerm"],PNAME_NS:["varOrTerm"],STRING_LITERAL1:["varOrTerm"],STRING_LITERAL2:["varOrTerm"],STRING_LITERAL_LONG1:["varOrTerm"],STRING_LITERAL_LONG2:["varOrTerm"],INTEGER:["varOrTerm"],DECIMAL:["varOrTerm"],DOUBLE:["varOrTerm"],INTEGER_POSITIVE:["varOrTerm"],DECIMAL_POSITIVE:["varOrTerm"],DOUBLE_POSITIVE:["varOrTerm"],INTEGER_NEGATIVE:["varOrTerm"],DECIMAL_NEGATIVE:["varOrTerm"],DOUBLE_NEGATIVE:["varOrTerm"],"(":["triplesNode"],"[":["triplesNode"]},graphNodePath:{VAR1:["varOrTerm"],VAR2:["varOrTerm"],NIL:["varOrTerm"],IRI_REF:["varOrTerm"],TRUE:["varOrTerm"],FALSE:["varOrTerm"],BLANK_NODE_LABEL:["varOrTerm"],ANON:["varOrTerm"],PNAME_LN:["varOrTerm"],PNAME_NS:["varOrTerm"],STRING_LITERAL1:["varOrTerm"],STRING_LITERAL2:["varOrTerm"],STRING_LITERAL_LONG1:["varOrTerm"],STRING_LITERAL_LONG2:["varOrTerm"],INTEGER:["varOrTerm"],DECIMAL:["varOrTerm"],DOUBLE:["varOrTerm"],INTEGER_POSITIVE:["varOrTerm"],DECIMAL_POSITIVE:["varOrTerm"],DOUBLE_POSITIVE:["varOrTerm"],INTEGER_NEGATIVE:["varOrTerm"],DECIMAL_NEGATIVE:["varOrTerm"],DOUBLE_NEGATIVE:["varOrTerm"],"(":["triplesNodePath"],"[":["triplesNodePath"]},graphOrDefault:{DEFAULT:["DEFAULT"],IRI_REF:["?GRAPH","iriRef"],PNAME_LN:["?GRAPH","iriRef"],PNAME_NS:["?GRAPH","iriRef"],GRAPH:["?GRAPH","iriRef"]},graphPatternNotTriples:{"{":["groupOrUnionGraphPattern"],OPTIONAL:["optionalGraphPattern"],MINUS:["minusGraphPattern"],GRAPH:["graphGraphPattern"],SERVICE:["serviceGraphPattern"],FILTER:["filter"],BIND:["bind"],VALUES:["inlineData"]},graphRef:{GRAPH:["GRAPH","iriRef"]},graphRefAll:{GRAPH:["graphRef"],DEFAULT:["DEFAULT"],NAMED:["NAMED"],ALL:["ALL"]},graphTerm:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],BLANK_NODE_LABEL:["blankNode"],ANON:["blankNode"],NIL:["NIL"]},groupClause:{GROUP:["GROUP","BY","+groupCondition"]},groupCondition:{STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["functionCall"],PNAME_LN:["functionCall"],PNAME_NS:["functionCall"],"(":["(","expression","?[AS,var]",")"],VAR1:["var"],VAR2:["var"]},groupGraphPattern:{"{":["{","or([subSelect,groupGraphPatternSub])","}"]},groupGraphPatternSub:{"{":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],OPTIONAL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],MINUS:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],GRAPH:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],SERVICE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],FILTER:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],BIND:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VALUES:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VAR1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VAR2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],NIL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"(":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"[":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],IRI_REF:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],TRUE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],FALSE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],BLANK_NODE_LABEL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],ANON:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],PNAME_LN:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],PNAME_NS:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL_LONG1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL_LONG2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"}":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"]},groupOrUnionGraphPattern:{"{":["groupGraphPattern","*[UNION,groupGraphPattern]"]},havingClause:{HAVING:["HAVING","+havingCondition"]},havingCondition:{"(":["constraint"],STR:["constraint"],LANG:["constraint"],LANGMATCHES:["constraint"],DATATYPE:["constraint"],BOUND:["constraint"],IRI:["constraint"],URI:["constraint"],BNODE:["constraint"],RAND:["constraint"],ABS:["constraint"],CEIL:["constraint"],FLOOR:["constraint"],ROUND:["constraint"],CONCAT:["constraint"],STRLEN:["constraint"],UCASE:["constraint"],LCASE:["constraint"],ENCODE_FOR_URI:["constraint"],CONTAINS:["constraint"],STRSTARTS:["constraint"],STRENDS:["constraint"],STRBEFORE:["constraint"],STRAFTER:["constraint"],YEAR:["constraint"],MONTH:["constraint"],DAY:["constraint"],HOURS:["constraint"],MINUTES:["constraint"],SECONDS:["constraint"],TIMEZONE:["constraint"],TZ:["constraint"],NOW:["constraint"],UUID:["constraint"],STRUUID:["constraint"],MD5:["constraint"],SHA1:["constraint"],SHA256:["constraint"],SHA384:["constraint"],SHA512:["constraint"],COALESCE:["constraint"],IF:["constraint"],STRLANG:["constraint"],STRDT:["constraint"],SAMETERM:["constraint"],ISIRI:["constraint"],ISURI:["constraint"],ISBLANK:["constraint"],ISLITERAL:["constraint"],ISNUMERIC:["constraint"],SUBSTR:["constraint"],REPLACE:["constraint"],REGEX:["constraint"],EXISTS:["constraint"],NOT:["constraint"],IRI_REF:["constraint"],PNAME_LN:["constraint"],PNAME_NS:["constraint"]},inlineData:{VALUES:["VALUES","dataBlock"]},inlineDataFull:{NIL:["or([NIL,[ (,*var,)]])","{","*or([[ (,*dataBlockValue,)],NIL])","}"],"(":["or([NIL,[ (,*var,)]])","{","*or([[ (,*dataBlockValue,)],NIL])","}"]},inlineDataOneVar:{VAR1:["var","{","*dataBlockValue","}"],VAR2:["var","{","*dataBlockValue","}"]},insert1:{DATA:["DATA","quadData"],"{":["quadPattern","*usingClause","WHERE","groupGraphPattern"]},insertClause:{INSERT:["INSERT","quadPattern"]},integer:{INTEGER:["INTEGER"]},iriRef:{IRI_REF:["IRI_REF"],PNAME_LN:["prefixedName"],PNAME_NS:["prefixedName"]},iriRefOrFunction:{IRI_REF:["iriRef","?argList"],PNAME_LN:["iriRef","?argList"],PNAME_NS:["iriRef","?argList"]},limitClause:{LIMIT:["LIMIT","INTEGER"]},limitOffsetClauses:{LIMIT:["limitClause","?offsetClause"],OFFSET:["offsetClause","?limitClause"]},load:{LOAD:["LOAD","?SILENT_1","iriRef","?[INTO,graphRef]"]},minusGraphPattern:{MINUS:["MINUS","groupGraphPattern"]},modify:{WITH:["WITH","iriRef","or([[deleteClause,?insertClause],insertClause])","*usingClause","WHERE","groupGraphPattern"]},move:{MOVE:["MOVE","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},multiplicativeExpression:{"!":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"+":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"-":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],VAR1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],VAR2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"(":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LANG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LANGMATCHES:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DATATYPE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],BOUND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IRI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],URI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],BNODE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],RAND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ABS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CEIL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],FLOOR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ROUND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CONCAT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRLEN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],UCASE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LCASE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ENCODE_FOR_URI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CONTAINS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRSTARTS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRENDS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRBEFORE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRAFTER:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],YEAR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MONTH:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DAY:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],HOURS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MINUTES:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SECONDS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TIMEZONE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TZ:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],NOW:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],UUID:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRUUID:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MD5:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA256:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA384:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA512:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],COALESCE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IF:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRLANG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRDT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SAMETERM:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISIRI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISURI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISBLANK:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISLITERAL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISNUMERIC:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TRUE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],FALSE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],COUNT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SUM:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MIN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MAX:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],AVG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SAMPLE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],GROUP_CONCAT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SUBSTR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],REPLACE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],REGEX:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],EXISTS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],NOT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IRI_REF:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL_LONG1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL_LONG2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],PNAME_LN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],PNAME_NS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"]},namedGraphClause:{NAMED:["NAMED","sourceSelector"]},notExistsFunc:{NOT:["NOT","EXISTS","groupGraphPattern"]},numericExpression:{"!":["additiveExpression"],"+":["additiveExpression"],"-":["additiveExpression"],VAR1:["additiveExpression"],VAR2:["additiveExpression"],"(":["additiveExpression"],STR:["additiveExpression"],LANG:["additiveExpression"],LANGMATCHES:["additiveExpression"],DATATYPE:["additiveExpression"],BOUND:["additiveExpression"],IRI:["additiveExpression"],URI:["additiveExpression"],BNODE:["additiveExpression"],RAND:["additiveExpression"],ABS:["additiveExpression"],CEIL:["additiveExpression"],FLOOR:["additiveExpression"],ROUND:["additiveExpression"],CONCAT:["additiveExpression"],STRLEN:["additiveExpression"],UCASE:["additiveExpression"],LCASE:["additiveExpression"],ENCODE_FOR_URI:["additiveExpression"],CONTAINS:["additiveExpression"],STRSTARTS:["additiveExpression"],STRENDS:["additiveExpression"],STRBEFORE:["additiveExpression"],STRAFTER:["additiveExpression"],YEAR:["additiveExpression"],MONTH:["additiveExpression"],DAY:["additiveExpression"],HOURS:["additiveExpression"],MINUTES:["additiveExpression"],SECONDS:["additiveExpression"],TIMEZONE:["additiveExpression"],TZ:["additiveExpression"],NOW:["additiveExpression"],UUID:["additiveExpression"],STRUUID:["additiveExpression"],MD5:["additiveExpression"],SHA1:["additiveExpression"],SHA256:["additiveExpression"],SHA384:["additiveExpression"],SHA512:["additiveExpression"],COALESCE:["additiveExpression"],IF:["additiveExpression"],STRLANG:["additiveExpression"],STRDT:["additiveExpression"],SAMETERM:["additiveExpression"],ISIRI:["additiveExpression"],ISURI:["additiveExpression"],ISBLANK:["additiveExpression"],ISLITERAL:["additiveExpression"],ISNUMERIC:["additiveExpression"],TRUE:["additiveExpression"],FALSE:["additiveExpression"],COUNT:["additiveExpression"],SUM:["additiveExpression"],MIN:["additiveExpression"],MAX:["additiveExpression"],AVG:["additiveExpression"],SAMPLE:["additiveExpression"],GROUP_CONCAT:["additiveExpression"],SUBSTR:["additiveExpression"],REPLACE:["additiveExpression"],REGEX:["additiveExpression"],EXISTS:["additiveExpression"],NOT:["additiveExpression"],IRI_REF:["additiveExpression"],STRING_LITERAL1:["additiveExpression"],STRING_LITERAL2:["additiveExpression"],STRING_LITERAL_LONG1:["additiveExpression"],STRING_LITERAL_LONG2:["additiveExpression"],INTEGER:["additiveExpression"],DECIMAL:["additiveExpression"],DOUBLE:["additiveExpression"],INTEGER_POSITIVE:["additiveExpression"],DECIMAL_POSITIVE:["additiveExpression"],DOUBLE_POSITIVE:["additiveExpression"],INTEGER_NEGATIVE:["additiveExpression"],DECIMAL_NEGATIVE:["additiveExpression"],DOUBLE_NEGATIVE:["additiveExpression"],PNAME_LN:["additiveExpression"],PNAME_NS:["additiveExpression"]},numericLiteral:{INTEGER:["numericLiteralUnsigned"],DECIMAL:["numericLiteralUnsigned"],DOUBLE:["numericLiteralUnsigned"],INTEGER_POSITIVE:["numericLiteralPositive"],DECIMAL_POSITIVE:["numericLiteralPositive"],DOUBLE_POSITIVE:["numericLiteralPositive"],INTEGER_NEGATIVE:["numericLiteralNegative"],DECIMAL_NEGATIVE:["numericLiteralNegative"],DOUBLE_NEGATIVE:["numericLiteralNegative"]},numericLiteralNegative:{INTEGER_NEGATIVE:["INTEGER_NEGATIVE"],DECIMAL_NEGATIVE:["DECIMAL_NEGATIVE"],DOUBLE_NEGATIVE:["DOUBLE_NEGATIVE"]},numericLiteralPositive:{INTEGER_POSITIVE:["INTEGER_POSITIVE"],DECIMAL_POSITIVE:["DECIMAL_POSITIVE"],DOUBLE_POSITIVE:["DOUBLE_POSITIVE"]},numericLiteralUnsigned:{INTEGER:["INTEGER"],DECIMAL:["DECIMAL"],DOUBLE:["DOUBLE"]},object:{"(":["graphNode"],"[":["graphNode"],VAR1:["graphNode"],VAR2:["graphNode"],NIL:["graphNode"],IRI_REF:["graphNode"],TRUE:["graphNode"],FALSE:["graphNode"],BLANK_NODE_LABEL:["graphNode"],ANON:["graphNode"],PNAME_LN:["graphNode"],PNAME_NS:["graphNode"],STRING_LITERAL1:["graphNode"],STRING_LITERAL2:["graphNode"],STRING_LITERAL_LONG1:["graphNode"],STRING_LITERAL_LONG2:["graphNode"],INTEGER:["graphNode"],DECIMAL:["graphNode"],DOUBLE:["graphNode"],INTEGER_POSITIVE:["graphNode"],DECIMAL_POSITIVE:["graphNode"],DOUBLE_POSITIVE:["graphNode"],INTEGER_NEGATIVE:["graphNode"],DECIMAL_NEGATIVE:["graphNode"],DOUBLE_NEGATIVE:["graphNode"]},objectList:{"(":["object","*[,,object]"],"[":["object","*[,,object]"],VAR1:["object","*[,,object]"],VAR2:["object","*[,,object]"],NIL:["object","*[,,object]"],IRI_REF:["object","*[,,object]"],TRUE:["object","*[,,object]"],FALSE:["object","*[,,object]"],BLANK_NODE_LABEL:["object","*[,,object]"],ANON:["object","*[,,object]"],PNAME_LN:["object","*[,,object]"],PNAME_NS:["object","*[,,object]"],STRING_LITERAL1:["object","*[,,object]"],STRING_LITERAL2:["object","*[,,object]"],STRING_LITERAL_LONG1:["object","*[,,object]"],STRING_LITERAL_LONG2:["object","*[,,object]"],INTEGER:["object","*[,,object]"],DECIMAL:["object","*[,,object]"],DOUBLE:["object","*[,,object]"],INTEGER_POSITIVE:["object","*[,,object]"],DECIMAL_POSITIVE:["object","*[,,object]"],DOUBLE_POSITIVE:["object","*[,,object]"],INTEGER_NEGATIVE:["object","*[,,object]"],DECIMAL_NEGATIVE:["object","*[,,object]"],DOUBLE_NEGATIVE:["object","*[,,object]"]},objectListPath:{"(":["objectPath","*[,,objectPath]"],"[":["objectPath","*[,,objectPath]"],VAR1:["objectPath","*[,,objectPath]"],VAR2:["objectPath","*[,,objectPath]"],NIL:["objectPath","*[,,objectPath]"],IRI_REF:["objectPath","*[,,objectPath]"],TRUE:["objectPath","*[,,objectPath]"],FALSE:["objectPath","*[,,objectPath]"],BLANK_NODE_LABEL:["objectPath","*[,,objectPath]"],ANON:["objectPath","*[,,objectPath]"],PNAME_LN:["objectPath","*[,,objectPath]"],PNAME_NS:["objectPath","*[,,objectPath]"],STRING_LITERAL1:["objectPath","*[,,objectPath]"],STRING_LITERAL2:["objectPath","*[,,objectPath]"],STRING_LITERAL_LONG1:["objectPath","*[,,objectPath]"],STRING_LITERAL_LONG2:["objectPath","*[,,objectPath]"],INTEGER:["objectPath","*[,,objectPath]"],DECIMAL:["objectPath","*[,,objectPath]"],DOUBLE:["objectPath","*[,,objectPath]"],INTEGER_POSITIVE:["objectPath","*[,,objectPath]"],DECIMAL_POSITIVE:["objectPath","*[,,objectPath]"],DOUBLE_POSITIVE:["objectPath","*[,,objectPath]"],INTEGER_NEGATIVE:["objectPath","*[,,objectPath]"],DECIMAL_NEGATIVE:["objectPath","*[,,objectPath]"],DOUBLE_NEGATIVE:["objectPath","*[,,objectPath]"]},objectPath:{"(":["graphNodePath"],"[":["graphNodePath"],VAR1:["graphNodePath"],VAR2:["graphNodePath"],NIL:["graphNodePath"],IRI_REF:["graphNodePath"],TRUE:["graphNodePath"],FALSE:["graphNodePath"],BLANK_NODE_LABEL:["graphNodePath"],ANON:["graphNodePath"],PNAME_LN:["graphNodePath"],PNAME_NS:["graphNodePath"],STRING_LITERAL1:["graphNodePath"],STRING_LITERAL2:["graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath"],INTEGER:["graphNodePath"],DECIMAL:["graphNodePath"],DOUBLE:["graphNodePath"],INTEGER_POSITIVE:["graphNodePath"],DECIMAL_POSITIVE:["graphNodePath"],DOUBLE_POSITIVE:["graphNodePath"],INTEGER_NEGATIVE:["graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath"]},offsetClause:{OFFSET:["OFFSET","INTEGER"]},optionalGraphPattern:{OPTIONAL:["OPTIONAL","groupGraphPattern"]},"or([*,expression])":{"*":["*"],"!":["expression"],"+":["expression"],"-":["expression"],VAR1:["expression"],VAR2:["expression"],"(":["expression"],STR:["expression"],LANG:["expression"],LANGMATCHES:["expression"],DATATYPE:["expression"],BOUND:["expression"],IRI:["expression"],URI:["expression"],BNODE:["expression"],RAND:["expression"],ABS:["expression"],CEIL:["expression"],FLOOR:["expression"],ROUND:["expression"],CONCAT:["expression"],STRLEN:["expression"],UCASE:["expression"],LCASE:["expression"],ENCODE_FOR_URI:["expression"],CONTAINS:["expression"],STRSTARTS:["expression"],STRENDS:["expression"],STRBEFORE:["expression"],STRAFTER:["expression"],YEAR:["expression"],MONTH:["expression"],DAY:["expression"],HOURS:["expression"],MINUTES:["expression"],SECONDS:["expression"],TIMEZONE:["expression"],TZ:["expression"],NOW:["expression"],UUID:["expression"],STRUUID:["expression"],MD5:["expression"],SHA1:["expression"],SHA256:["expression"],SHA384:["expression"],SHA512:["expression"],COALESCE:["expression"],IF:["expression"],STRLANG:["expression"],STRDT:["expression"],SAMETERM:["expression"],ISIRI:["expression"],ISURI:["expression"],ISBLANK:["expression"],ISLITERAL:["expression"],ISNUMERIC:["expression"],TRUE:["expression"],FALSE:["expression"],COUNT:["expression"],SUM:["expression"],MIN:["expression"],MAX:["expression"],AVG:["expression"],SAMPLE:["expression"],GROUP_CONCAT:["expression"],SUBSTR:["expression"],REPLACE:["expression"],REGEX:["expression"],EXISTS:["expression"],NOT:["expression"],IRI_REF:["expression"],STRING_LITERAL1:["expression"],STRING_LITERAL2:["expression"],STRING_LITERAL_LONG1:["expression"],STRING_LITERAL_LONG2:["expression"],INTEGER:["expression"],DECIMAL:["expression"],DOUBLE:["expression"],INTEGER_POSITIVE:["expression"],DECIMAL_POSITIVE:["expression"],DOUBLE_POSITIVE:["expression"],INTEGER_NEGATIVE:["expression"],DECIMAL_NEGATIVE:["expression"],DOUBLE_NEGATIVE:["expression"],PNAME_LN:["expression"],PNAME_NS:["expression"]},"or([+or([var,[ (,expression,AS,var,)]]),*])":{"(":["+or([var,[ (,expression,AS,var,)]])"],VAR1:["+or([var,[ (,expression,AS,var,)]])"],VAR2:["+or([var,[ (,expression,AS,var,)]])"],"*":["*"]},"or([+varOrIRIref,*])":{VAR1:["+varOrIRIref"],VAR2:["+varOrIRIref"],IRI_REF:["+varOrIRIref"],PNAME_LN:["+varOrIRIref"],PNAME_NS:["+varOrIRIref"],"*":["*"]},"or([ASC,DESC])":{ASC:["ASC"],DESC:["DESC"]},"or([DISTINCT,REDUCED])":{DISTINCT:["DISTINCT"],REDUCED:["REDUCED"]},"or([LANGTAG,[^^,iriRef]])":{LANGTAG:["LANGTAG"],"^^":["[^^,iriRef]"]},"or([NIL,[ (,*var,)]])":{NIL:["NIL"],"(":["[ (,*var,)]"]},"or([[ (,*dataBlockValue,)],NIL])":{"(":["[ (,*dataBlockValue,)]"],NIL:["NIL"]},"or([[ (,expression,)],NIL])":{"(":["[ (,expression,)]"],NIL:["NIL"]},"or([[*,unaryExpression],[/,unaryExpression]])":{"*":["[*,unaryExpression]"],"/":["[/,unaryExpression]"]},"or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])":{"+":["[+,multiplicativeExpression]"],"-":["[-,multiplicativeExpression]"],INTEGER_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DECIMAL_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DOUBLE_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],INTEGER_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DECIMAL_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DOUBLE_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"]},"or([[,,or([},[integer,}]])],}])":{",":["[,,or([},[integer,}]])]"],"}":["}"]},"or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])":{"=":["[=,numericExpression]"],"!=":["[!=,numericExpression]"],"<":["[<,numericExpression]"],">":["[>,numericExpression]"],"<=":["[<=,numericExpression]"],">=":["[>=,numericExpression]"],IN:["[IN,expressionList]"],NOT:["[NOT,IN,expressionList]"]},"or([[constructTemplate,*datasetClause,whereClause,solutionModifier],[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]])":{"{":["[constructTemplate,*datasetClause,whereClause,solutionModifier]"],WHERE:["[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]"],FROM:["[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]"]},"or([[deleteClause,?insertClause],insertClause])":{DELETE:["[deleteClause,?insertClause]"],INSERT:["insertClause"]},"or([[integer,or([[,,or([},[integer,}]])],}])],[,,integer,}]])":{INTEGER:["[integer,or([[,,or([},[integer,}]])],}])]"],",":["[,,integer,}]"]},"or([defaultGraphClause,namedGraphClause])":{IRI_REF:["defaultGraphClause"],PNAME_LN:["defaultGraphClause"],PNAME_NS:["defaultGraphClause"],NAMED:["namedGraphClause"]},"or([inlineDataOneVar,inlineDataFull])":{VAR1:["inlineDataOneVar"],VAR2:["inlineDataOneVar"],NIL:["inlineDataFull"],"(":["inlineDataFull"]},"or([iriRef,[NAMED,iriRef]])":{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],NAMED:["[NAMED,iriRef]"]},"or([iriRef,a])":{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],a:["a"]},"or([numericLiteralPositive,numericLiteralNegative])":{INTEGER_POSITIVE:["numericLiteralPositive"],DECIMAL_POSITIVE:["numericLiteralPositive"],DOUBLE_POSITIVE:["numericLiteralPositive"],INTEGER_NEGATIVE:["numericLiteralNegative"],DECIMAL_NEGATIVE:["numericLiteralNegative"],DOUBLE_NEGATIVE:["numericLiteralNegative"]},"or([queryAll,updateAll])":{CONSTRUCT:["queryAll"],DESCRIBE:["queryAll"],ASK:["queryAll"],SELECT:["queryAll"],INSERT:["updateAll"],DELETE:["updateAll"],LOAD:["updateAll"],CLEAR:["updateAll"],DROP:["updateAll"],ADD:["updateAll"],MOVE:["updateAll"],COPY:["updateAll"],CREATE:["updateAll"],WITH:["updateAll"],$:["updateAll"]},"or([selectQuery,constructQuery,describeQuery,askQuery])":{SELECT:["selectQuery"],CONSTRUCT:["constructQuery"],DESCRIBE:["describeQuery"],ASK:["askQuery"]},"or([subSelect,groupGraphPatternSub])":{SELECT:["subSelect"],"{":["groupGraphPatternSub"],OPTIONAL:["groupGraphPatternSub"],MINUS:["groupGraphPatternSub"],GRAPH:["groupGraphPatternSub"],SERVICE:["groupGraphPatternSub"],FILTER:["groupGraphPatternSub"],BIND:["groupGraphPatternSub"],VALUES:["groupGraphPatternSub"],VAR1:["groupGraphPatternSub"],VAR2:["groupGraphPatternSub"],NIL:["groupGraphPatternSub"],"(":["groupGraphPatternSub"],"[":["groupGraphPatternSub"],IRI_REF:["groupGraphPatternSub"],TRUE:["groupGraphPatternSub"],FALSE:["groupGraphPatternSub"],BLANK_NODE_LABEL:["groupGraphPatternSub"],ANON:["groupGraphPatternSub"],PNAME_LN:["groupGraphPatternSub"],PNAME_NS:["groupGraphPatternSub"],STRING_LITERAL1:["groupGraphPatternSub"],STRING_LITERAL2:["groupGraphPatternSub"],STRING_LITERAL_LONG1:["groupGraphPatternSub"],STRING_LITERAL_LONG2:["groupGraphPatternSub"],INTEGER:["groupGraphPatternSub"],DECIMAL:["groupGraphPatternSub"],DOUBLE:["groupGraphPatternSub"],INTEGER_POSITIVE:["groupGraphPatternSub"],DECIMAL_POSITIVE:["groupGraphPatternSub"],DOUBLE_POSITIVE:["groupGraphPatternSub"],INTEGER_NEGATIVE:["groupGraphPatternSub"],DECIMAL_NEGATIVE:["groupGraphPatternSub"],DOUBLE_NEGATIVE:["groupGraphPatternSub"],"}":["groupGraphPatternSub"]},"or([var,[ (,expression,AS,var,)]])":{VAR1:["var"],VAR2:["var"],"(":["[ (,expression,AS,var,)]"]},"or([verbPath,verbSimple])":{"^":["verbPath"],a:["verbPath"],"!":["verbPath"],"(":["verbPath"],IRI_REF:["verbPath"],PNAME_LN:["verbPath"],PNAME_NS:["verbPath"],VAR1:["verbSimple"],VAR2:["verbSimple"]},"or([},[integer,}]])":{"}":["}"],INTEGER:["[integer,}]"]},orderClause:{ORDER:["ORDER","BY","+orderCondition"]},orderCondition:{ASC:["or([ASC,DESC])","brackettedExpression"],DESC:["or([ASC,DESC])","brackettedExpression"],"(":["constraint"],STR:["constraint"],LANG:["constraint"],LANGMATCHES:["constraint"],DATATYPE:["constraint"],BOUND:["constraint"],IRI:["constraint"],URI:["constraint"],BNODE:["constraint"],RAND:["constraint"],ABS:["constraint"],CEIL:["constraint"],FLOOR:["constraint"],ROUND:["constraint"],CONCAT:["constraint"],STRLEN:["constraint"],UCASE:["constraint"],LCASE:["constraint"],ENCODE_FOR_URI:["constraint"],CONTAINS:["constraint"],STRSTARTS:["constraint"],STRENDS:["constraint"],STRBEFORE:["constraint"],STRAFTER:["constraint"],YEAR:["constraint"],MONTH:["constraint"],DAY:["constraint"],HOURS:["constraint"],MINUTES:["constraint"],SECONDS:["constraint"],TIMEZONE:["constraint"],TZ:["constraint"],NOW:["constraint"],UUID:["constraint"],STRUUID:["constraint"],MD5:["constraint"],SHA1:["constraint"],SHA256:["constraint"],SHA384:["constraint"],SHA512:["constraint"],COALESCE:["constraint"],IF:["constraint"],STRLANG:["constraint"],STRDT:["constraint"],SAMETERM:["constraint"],ISIRI:["constraint"],ISURI:["constraint"],ISBLANK:["constraint"],ISLITERAL:["constraint"],ISNUMERIC:["constraint"],SUBSTR:["constraint"],REPLACE:["constraint"],REGEX:["constraint"],EXISTS:["constraint"],NOT:["constraint"],IRI_REF:["constraint"],PNAME_LN:["constraint"],PNAME_NS:["constraint"],VAR1:["var"],VAR2:["var"]},path:{"^":["pathAlternative"],a:["pathAlternative"],"!":["pathAlternative"],"(":["pathAlternative"],IRI_REF:["pathAlternative"],PNAME_LN:["pathAlternative"],PNAME_NS:["pathAlternative"]},pathAlternative:{"^":["pathSequence","*[|,pathSequence]"],a:["pathSequence","*[|,pathSequence]"],"!":["pathSequence","*[|,pathSequence]"],"(":["pathSequence","*[|,pathSequence]"],IRI_REF:["pathSequence","*[|,pathSequence]"],PNAME_LN:["pathSequence","*[|,pathSequence]"],PNAME_NS:["pathSequence","*[|,pathSequence]"]},pathElt:{a:["pathPrimary","?pathMod"],"!":["pathPrimary","?pathMod"],"(":["pathPrimary","?pathMod"],IRI_REF:["pathPrimary","?pathMod"],PNAME_LN:["pathPrimary","?pathMod"],PNAME_NS:["pathPrimary","?pathMod"]},pathEltOrInverse:{a:["pathElt"],"!":["pathElt"],"(":["pathElt"],IRI_REF:["pathElt"],PNAME_LN:["pathElt"],PNAME_NS:["pathElt"],"^":["^","pathElt"]},pathMod:{"*":["*"],"?":["?"],"+":["+"],"{":["{","or([[integer,or([[,,or([},[integer,}]])],}])],[,,integer,}]])"]},pathNegatedPropertySet:{a:["pathOneInPropertySet"],"^":["pathOneInPropertySet"],IRI_REF:["pathOneInPropertySet"],PNAME_LN:["pathOneInPropertySet"],PNAME_NS:["pathOneInPropertySet"],"(":["(","?[pathOneInPropertySet,*[|,pathOneInPropertySet]]",")"]},pathOneInPropertySet:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],a:["a"],"^":["^","or([iriRef,a])"]},pathPrimary:{IRI_REF:["storeProperty","iriRef"],PNAME_LN:["storeProperty","iriRef"],PNAME_NS:["storeProperty","iriRef"],a:["storeProperty","a"],"!":["!","pathNegatedPropertySet"],"(":["(","path",")"]},pathSequence:{"^":["pathEltOrInverse","*[/,pathEltOrInverse]"],a:["pathEltOrInverse","*[/,pathEltOrInverse]"],"!":["pathEltOrInverse","*[/,pathEltOrInverse]"],"(":["pathEltOrInverse","*[/,pathEltOrInverse]"],IRI_REF:["pathEltOrInverse","*[/,pathEltOrInverse]"],PNAME_LN:["pathEltOrInverse","*[/,pathEltOrInverse]"],PNAME_NS:["pathEltOrInverse","*[/,pathEltOrInverse]"]},prefixDecl:{PREFIX:["PREFIX","PNAME_NS","IRI_REF"]},prefixedName:{PNAME_LN:["PNAME_LN"],PNAME_NS:["PNAME_NS"]},primaryExpression:{"(":["brackettedExpression"],STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["iriRefOrFunction"],PNAME_LN:["iriRefOrFunction"],PNAME_NS:["iriRefOrFunction"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],VAR1:["var"],VAR2:["var"],COUNT:["aggregate"],SUM:["aggregate"],MIN:["aggregate"],MAX:["aggregate"],AVG:["aggregate"],SAMPLE:["aggregate"],GROUP_CONCAT:["aggregate"]},prologue:{PREFIX:["?baseDecl","*prefixDecl"],BASE:["?baseDecl","*prefixDecl"],$:["?baseDecl","*prefixDecl"],CONSTRUCT:["?baseDecl","*prefixDecl"],DESCRIBE:["?baseDecl","*prefixDecl"],ASK:["?baseDecl","*prefixDecl"],INSERT:["?baseDecl","*prefixDecl"],DELETE:["?baseDecl","*prefixDecl"],SELECT:["?baseDecl","*prefixDecl"],LOAD:["?baseDecl","*prefixDecl"],CLEAR:["?baseDecl","*prefixDecl"],DROP:["?baseDecl","*prefixDecl"],ADD:["?baseDecl","*prefixDecl"],MOVE:["?baseDecl","*prefixDecl"],COPY:["?baseDecl","*prefixDecl"],CREATE:["?baseDecl","*prefixDecl"],WITH:["?baseDecl","*prefixDecl"]},propertyList:{a:["propertyListNotEmpty"],VAR1:["propertyListNotEmpty"],VAR2:["propertyListNotEmpty"],IRI_REF:["propertyListNotEmpty"],PNAME_LN:["propertyListNotEmpty"],PNAME_NS:["propertyListNotEmpty"],".":[],"}":[],GRAPH:[]},propertyListNotEmpty:{a:["verb","objectList","*[;,?[verb,objectList]]"],VAR1:["verb","objectList","*[;,?[verb,objectList]]"],VAR2:["verb","objectList","*[;,?[verb,objectList]]"],IRI_REF:["verb","objectList","*[;,?[verb,objectList]]"],PNAME_LN:["verb","objectList","*[;,?[verb,objectList]]"],PNAME_NS:["verb","objectList","*[;,?[verb,objectList]]"]},propertyListPath:{a:["propertyListNotEmpty"],VAR1:["propertyListNotEmpty"],VAR2:["propertyListNotEmpty"],IRI_REF:["propertyListNotEmpty"],PNAME_LN:["propertyListNotEmpty"],PNAME_NS:["propertyListNotEmpty"],".":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},propertyListPathNotEmpty:{VAR1:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],VAR2:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"^":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],a:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"!":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"(":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],IRI_REF:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_LN:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_NS:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"]},quadData:{"{":["{","disallowVars","quads","allowVars","}"]},quadDataNoBnodes:{"{":["{","disallowBnodes","disallowVars","quads","allowVars","allowBnodes","}"]},quadPattern:{"{":["{","quads","}"]},quadPatternNoBnodes:{"{":["{","disallowBnodes","quads","allowBnodes","}"]},quads:{GRAPH:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],VAR1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],VAR2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],NIL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"(":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"[":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],IRI_REF:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],TRUE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],FALSE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],BLANK_NODE_LABEL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],ANON:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],PNAME_LN:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],PNAME_NS:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL_LONG1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL_LONG2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"}":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"]},quadsNotTriples:{GRAPH:["GRAPH","varOrIRIref","{","?triplesTemplate","}"]},queryAll:{CONSTRUCT:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],DESCRIBE:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],ASK:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],SELECT:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"]},rdfLiteral:{STRING_LITERAL1:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL2:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL_LONG1:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL_LONG2:["string","?or([LANGTAG,[^^,iriRef]])"]},regexExpression:{REGEX:["REGEX","(","expression",",","expression","?[,,expression]",")"]},relationalExpression:{"!":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"+":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"-":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],VAR1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],VAR2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"(":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LANG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LANGMATCHES:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DATATYPE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],BOUND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IRI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],URI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],BNODE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],RAND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ABS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CEIL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],FLOOR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ROUND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CONCAT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRLEN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],UCASE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LCASE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ENCODE_FOR_URI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CONTAINS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRSTARTS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRENDS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRBEFORE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRAFTER:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],YEAR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MONTH:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DAY:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],HOURS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MINUTES:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SECONDS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TIMEZONE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TZ:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOW:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],UUID:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRUUID:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MD5:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA256:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA384:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA512:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],COALESCE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IF:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRLANG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRDT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SAMETERM:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISIRI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISURI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISBLANK:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISLITERAL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISNUMERIC:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TRUE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],FALSE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],COUNT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SUM:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MIN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MAX:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],AVG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SAMPLE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],GROUP_CONCAT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SUBSTR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],REPLACE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],REGEX:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],EXISTS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IRI_REF:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL_LONG1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL_LONG2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],PNAME_LN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],PNAME_NS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"]},selectClause:{SELECT:["SELECT","?or([DISTINCT,REDUCED])","or([+or([var,[ (,expression,AS,var,)]]),*])"]},selectQuery:{SELECT:["selectClause","*datasetClause","whereClause","solutionModifier"]},serviceGraphPattern:{SERVICE:["SERVICE","?SILENT","varOrIRIref","groupGraphPattern"]},solutionModifier:{LIMIT:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],OFFSET:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],ORDER:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],HAVING:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],GROUP:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],VALUES:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],$:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],"}":["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"]},sourceSelector:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"]},sparql11:{$:["prologue","or([queryAll,updateAll])","$"],CONSTRUCT:["prologue","or([queryAll,updateAll])","$"],DESCRIBE:["prologue","or([queryAll,updateAll])","$"],ASK:["prologue","or([queryAll,updateAll])","$"],INSERT:["prologue","or([queryAll,updateAll])","$"],DELETE:["prologue","or([queryAll,updateAll])","$"],SELECT:["prologue","or([queryAll,updateAll])","$"],LOAD:["prologue","or([queryAll,updateAll])","$"],CLEAR:["prologue","or([queryAll,updateAll])","$"],DROP:["prologue","or([queryAll,updateAll])","$"],ADD:["prologue","or([queryAll,updateAll])","$"],MOVE:["prologue","or([queryAll,updateAll])","$"],COPY:["prologue","or([queryAll,updateAll])","$"],CREATE:["prologue","or([queryAll,updateAll])","$"],WITH:["prologue","or([queryAll,updateAll])","$"],PREFIX:["prologue","or([queryAll,updateAll])","$"],BASE:["prologue","or([queryAll,updateAll])","$"]},storeProperty:{VAR1:[],VAR2:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[],a:[]},strReplaceExpression:{REPLACE:["REPLACE","(","expression",",","expression",",","expression","?[,,expression]",")"]},string:{STRING_LITERAL1:["STRING_LITERAL1"],STRING_LITERAL2:["STRING_LITERAL2"],STRING_LITERAL_LONG1:["STRING_LITERAL_LONG1"],STRING_LITERAL_LONG2:["STRING_LITERAL_LONG2"]},subSelect:{SELECT:["selectClause","whereClause","solutionModifier","valuesClause"]},substringExpression:{SUBSTR:["SUBSTR","(","expression",",","expression","?[,,expression]",")"]},triplesBlock:{VAR1:["triplesSameSubjectPath","?[.,?triplesBlock]"],VAR2:["triplesSameSubjectPath","?[.,?triplesBlock]"],NIL:["triplesSameSubjectPath","?[.,?triplesBlock]"],"(":["triplesSameSubjectPath","?[.,?triplesBlock]"],"[":["triplesSameSubjectPath","?[.,?triplesBlock]"],IRI_REF:["triplesSameSubjectPath","?[.,?triplesBlock]"],TRUE:["triplesSameSubjectPath","?[.,?triplesBlock]"],FALSE:["triplesSameSubjectPath","?[.,?triplesBlock]"],BLANK_NODE_LABEL:["triplesSameSubjectPath","?[.,?triplesBlock]"],ANON:["triplesSameSubjectPath","?[.,?triplesBlock]"],PNAME_LN:["triplesSameSubjectPath","?[.,?triplesBlock]"],PNAME_NS:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL1:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL2:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL_LONG1:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL_LONG2:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"]},triplesNode:{"(":["collection"],"[":["blankNodePropertyList"]},triplesNodePath:{"(":["collectionPath"],"[":["blankNodePropertyListPath"]},triplesSameSubject:{VAR1:["varOrTerm","propertyListNotEmpty"],VAR2:["varOrTerm","propertyListNotEmpty"],NIL:["varOrTerm","propertyListNotEmpty"],IRI_REF:["varOrTerm","propertyListNotEmpty"],TRUE:["varOrTerm","propertyListNotEmpty"],FALSE:["varOrTerm","propertyListNotEmpty"],BLANK_NODE_LABEL:["varOrTerm","propertyListNotEmpty"],ANON:["varOrTerm","propertyListNotEmpty"],PNAME_LN:["varOrTerm","propertyListNotEmpty"],PNAME_NS:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL1:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL2:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL_LONG1:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL_LONG2:["varOrTerm","propertyListNotEmpty"],INTEGER:["varOrTerm","propertyListNotEmpty"],DECIMAL:["varOrTerm","propertyListNotEmpty"],DOUBLE:["varOrTerm","propertyListNotEmpty"],INTEGER_POSITIVE:["varOrTerm","propertyListNotEmpty"],DECIMAL_POSITIVE:["varOrTerm","propertyListNotEmpty"],DOUBLE_POSITIVE:["varOrTerm","propertyListNotEmpty"],INTEGER_NEGATIVE:["varOrTerm","propertyListNotEmpty"],DECIMAL_NEGATIVE:["varOrTerm","propertyListNotEmpty"],DOUBLE_NEGATIVE:["varOrTerm","propertyListNotEmpty"],"(":["triplesNode","propertyList"],"[":["triplesNode","propertyList"]},triplesSameSubjectPath:{VAR1:["varOrTerm","propertyListPathNotEmpty"],VAR2:["varOrTerm","propertyListPathNotEmpty"],NIL:["varOrTerm","propertyListPathNotEmpty"],IRI_REF:["varOrTerm","propertyListPathNotEmpty"],TRUE:["varOrTerm","propertyListPathNotEmpty"],FALSE:["varOrTerm","propertyListPathNotEmpty"],BLANK_NODE_LABEL:["varOrTerm","propertyListPathNotEmpty"],ANON:["varOrTerm","propertyListPathNotEmpty"],PNAME_LN:["varOrTerm","propertyListPathNotEmpty"],PNAME_NS:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL1:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL2:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL_LONG1:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL_LONG2:["varOrTerm","propertyListPathNotEmpty"],INTEGER:["varOrTerm","propertyListPathNotEmpty"],DECIMAL:["varOrTerm","propertyListPathNotEmpty"],DOUBLE:["varOrTerm","propertyListPathNotEmpty"],INTEGER_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],DECIMAL_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],DOUBLE_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],INTEGER_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],DECIMAL_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],DOUBLE_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],"(":["triplesNodePath","propertyListPath"],"[":["triplesNodePath","propertyListPath"]},triplesTemplate:{VAR1:["triplesSameSubject","?[.,?triplesTemplate]"],VAR2:["triplesSameSubject","?[.,?triplesTemplate]"],NIL:["triplesSameSubject","?[.,?triplesTemplate]"],"(":["triplesSameSubject","?[.,?triplesTemplate]"],"[":["triplesSameSubject","?[.,?triplesTemplate]"],IRI_REF:["triplesSameSubject","?[.,?triplesTemplate]"],TRUE:["triplesSameSubject","?[.,?triplesTemplate]"],FALSE:["triplesSameSubject","?[.,?triplesTemplate]"],BLANK_NODE_LABEL:["triplesSameSubject","?[.,?triplesTemplate]"],ANON:["triplesSameSubject","?[.,?triplesTemplate]"],PNAME_LN:["triplesSameSubject","?[.,?triplesTemplate]"],PNAME_NS:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL1:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL2:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL_LONG1:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL_LONG2:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"]},unaryExpression:{"!":["!","primaryExpression"],"+":["+","primaryExpression"],"-":["-","primaryExpression"],VAR1:["primaryExpression"],VAR2:["primaryExpression"],"(":["primaryExpression"],STR:["primaryExpression"],LANG:["primaryExpression"],LANGMATCHES:["primaryExpression"],DATATYPE:["primaryExpression"],BOUND:["primaryExpression"],IRI:["primaryExpression"],URI:["primaryExpression"],BNODE:["primaryExpression"],RAND:["primaryExpression"],ABS:["primaryExpression"],CEIL:["primaryExpression"],FLOOR:["primaryExpression"],ROUND:["primaryExpression"],CONCAT:["primaryExpression"],STRLEN:["primaryExpression"],UCASE:["primaryExpression"],LCASE:["primaryExpression"],ENCODE_FOR_URI:["primaryExpression"],CONTAINS:["primaryExpression"],STRSTARTS:["primaryExpression"],STRENDS:["primaryExpression"],STRBEFORE:["primaryExpression"],STRAFTER:["primaryExpression"],YEAR:["primaryExpression"],MONTH:["primaryExpression"],DAY:["primaryExpression"],HOURS:["primaryExpression"],MINUTES:["primaryExpression"],SECONDS:["primaryExpression"],TIMEZONE:["primaryExpression"],TZ:["primaryExpression"],NOW:["primaryExpression"],UUID:["primaryExpression"],STRUUID:["primaryExpression"],MD5:["primaryExpression"],SHA1:["primaryExpression"],SHA256:["primaryExpression"],SHA384:["primaryExpression"],SHA512:["primaryExpression"],COALESCE:["primaryExpression"],IF:["primaryExpression"],STRLANG:["primaryExpression"],STRDT:["primaryExpression"],SAMETERM:["primaryExpression"],ISIRI:["primaryExpression"],ISURI:["primaryExpression"],ISBLANK:["primaryExpression"],ISLITERAL:["primaryExpression"],ISNUMERIC:["primaryExpression"],TRUE:["primaryExpression"],FALSE:["primaryExpression"],COUNT:["primaryExpression"],SUM:["primaryExpression"],MIN:["primaryExpression"],MAX:["primaryExpression"],AVG:["primaryExpression"],SAMPLE:["primaryExpression"],GROUP_CONCAT:["primaryExpression"],SUBSTR:["primaryExpression"],REPLACE:["primaryExpression"],REGEX:["primaryExpression"],EXISTS:["primaryExpression"],NOT:["primaryExpression"],IRI_REF:["primaryExpression"],STRING_LITERAL1:["primaryExpression"],STRING_LITERAL2:["primaryExpression"],STRING_LITERAL_LONG1:["primaryExpression"],STRING_LITERAL_LONG2:["primaryExpression"],INTEGER:["primaryExpression"],DECIMAL:["primaryExpression"],DOUBLE:["primaryExpression"],INTEGER_POSITIVE:["primaryExpression"],DECIMAL_POSITIVE:["primaryExpression"],DOUBLE_POSITIVE:["primaryExpression"],INTEGER_NEGATIVE:["primaryExpression"],DECIMAL_NEGATIVE:["primaryExpression"],DOUBLE_NEGATIVE:["primaryExpression"],PNAME_LN:["primaryExpression"],PNAME_NS:["primaryExpression"]},update:{INSERT:["prologue","?[update1,?[;,update]]"],DELETE:["prologue","?[update1,?[;,update]]"],LOAD:["prologue","?[update1,?[;,update]]"],CLEAR:["prologue","?[update1,?[;,update]]"],DROP:["prologue","?[update1,?[;,update]]"],ADD:["prologue","?[update1,?[;,update]]"],MOVE:["prologue","?[update1,?[;,update]]"],COPY:["prologue","?[update1,?[;,update]]"],CREATE:["prologue","?[update1,?[;,update]]"],WITH:["prologue","?[update1,?[;,update]]"],PREFIX:["prologue","?[update1,?[;,update]]"],BASE:["prologue","?[update1,?[;,update]]"],$:["prologue","?[update1,?[;,update]]"]},update1:{LOAD:["load"],CLEAR:["clear"],DROP:["drop"],ADD:["add"],MOVE:["move"],COPY:["copy"],CREATE:["create"],INSERT:["INSERT","insert1"],DELETE:["DELETE","delete1"],WITH:["modify"]},updateAll:{INSERT:["?[update1,?[;,update]]"],DELETE:["?[update1,?[;,update]]"],LOAD:["?[update1,?[;,update]]"],CLEAR:["?[update1,?[;,update]]"],DROP:["?[update1,?[;,update]]"],ADD:["?[update1,?[;,update]]"],MOVE:["?[update1,?[;,update]]"],COPY:["?[update1,?[;,update]]"],CREATE:["?[update1,?[;,update]]"],WITH:["?[update1,?[;,update]]"],$:["?[update1,?[;,update]]"]},usingClause:{USING:["USING","or([iriRef,[NAMED,iriRef]])"]},valueLogical:{"!":["relationalExpression"],"+":["relationalExpression"],"-":["relationalExpression"],VAR1:["relationalExpression"],VAR2:["relationalExpression"],"(":["relationalExpression"],STR:["relationalExpression"],LANG:["relationalExpression"],LANGMATCHES:["relationalExpression"],DATATYPE:["relationalExpression"],BOUND:["relationalExpression"],IRI:["relationalExpression"],URI:["relationalExpression"],BNODE:["relationalExpression"],RAND:["relationalExpression"],ABS:["relationalExpression"],CEIL:["relationalExpression"],FLOOR:["relationalExpression"],ROUND:["relationalExpression"],CONCAT:["relationalExpression"],STRLEN:["relationalExpression"],UCASE:["relationalExpression"],LCASE:["relationalExpression"],ENCODE_FOR_URI:["relationalExpression"],CONTAINS:["relationalExpression"],STRSTARTS:["relationalExpression"],STRENDS:["relationalExpression"],STRBEFORE:["relationalExpression"],STRAFTER:["relationalExpression"],YEAR:["relationalExpression"],MONTH:["relationalExpression"],DAY:["relationalExpression"],HOURS:["relationalExpression"],MINUTES:["relationalExpression"],SECONDS:["relationalExpression"],TIMEZONE:["relationalExpression"],TZ:["relationalExpression"],NOW:["relationalExpression"],UUID:["relationalExpression"],STRUUID:["relationalExpression"],MD5:["relationalExpression"],SHA1:["relationalExpression"],SHA256:["relationalExpression"],SHA384:["relationalExpression"],SHA512:["relationalExpression"],COALESCE:["relationalExpression"],IF:["relationalExpression"],STRLANG:["relationalExpression"],STRDT:["relationalExpression"],SAMETERM:["relationalExpression"],ISIRI:["relationalExpression"],ISURI:["relationalExpression"],ISBLANK:["relationalExpression"],ISLITERAL:["relationalExpression"],ISNUMERIC:["relationalExpression"],TRUE:["relationalExpression"],FALSE:["relationalExpression"],COUNT:["relationalExpression"],SUM:["relationalExpression"],MIN:["relationalExpression"],MAX:["relationalExpression"],AVG:["relationalExpression"],SAMPLE:["relationalExpression"],GROUP_CONCAT:["relationalExpression"],SUBSTR:["relationalExpression"],REPLACE:["relationalExpression"],REGEX:["relationalExpression"],EXISTS:["relationalExpression"],NOT:["relationalExpression"],IRI_REF:["relationalExpression"],STRING_LITERAL1:["relationalExpression"],STRING_LITERAL2:["relationalExpression"],STRING_LITERAL_LONG1:["relationalExpression"],STRING_LITERAL_LONG2:["relationalExpression"],INTEGER:["relationalExpression"],DECIMAL:["relationalExpression"],DOUBLE:["relationalExpression"],INTEGER_POSITIVE:["relationalExpression"],DECIMAL_POSITIVE:["relationalExpression"],DOUBLE_POSITIVE:["relationalExpression"],INTEGER_NEGATIVE:["relationalExpression"],DECIMAL_NEGATIVE:["relationalExpression"],DOUBLE_NEGATIVE:["relationalExpression"],PNAME_LN:["relationalExpression"],PNAME_NS:["relationalExpression"]},valuesClause:{VALUES:["VALUES","dataBlock"],$:[],"}":[]},"var":{VAR1:["VAR1"],VAR2:["VAR2"]},varOrIRIref:{VAR1:["var"],VAR2:["var"],IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"]},varOrTerm:{VAR1:["var"],VAR2:["var"],NIL:["graphTerm"],IRI_REF:["graphTerm"],TRUE:["graphTerm"],FALSE:["graphTerm"],BLANK_NODE_LABEL:["graphTerm"],ANON:["graphTerm"],PNAME_LN:["graphTerm"],PNAME_NS:["graphTerm"],STRING_LITERAL1:["graphTerm"],STRING_LITERAL2:["graphTerm"],STRING_LITERAL_LONG1:["graphTerm"],STRING_LITERAL_LONG2:["graphTerm"],INTEGER:["graphTerm"],DECIMAL:["graphTerm"],DOUBLE:["graphTerm"],INTEGER_POSITIVE:["graphTerm"],DECIMAL_POSITIVE:["graphTerm"],DOUBLE_POSITIVE:["graphTerm"],INTEGER_NEGATIVE:["graphTerm"],DECIMAL_NEGATIVE:["graphTerm"],DOUBLE_NEGATIVE:["graphTerm"]},verb:{VAR1:["storeProperty","varOrIRIref"],VAR2:["storeProperty","varOrIRIref"],IRI_REF:["storeProperty","varOrIRIref"],PNAME_LN:["storeProperty","varOrIRIref"],PNAME_NS:["storeProperty","varOrIRIref"],a:["storeProperty","a"]},verbPath:{"^":["path"],a:["path"],"!":["path"],"(":["path"],IRI_REF:["path"],PNAME_LN:["path"],PNAME_NS:["path"]},verbSimple:{VAR1:["var"],VAR2:["var"]},whereClause:{"{":["?WHERE","groupGraphPattern"],WHERE:["?WHERE","groupGraphPattern"]}}),s=/^(GROUP_CONCAT|DATATYPE|BASE|PREFIX|SELECT|CONSTRUCT|DESCRIBE|ASK|FROM|NAMED|ORDER|BY|LIMIT|ASC|DESC|OFFSET|DISTINCT|REDUCED|WHERE|GRAPH|OPTIONAL|UNION|FILTER|GROUP|HAVING|AS|VALUES|LOAD|CLEAR|DROP|CREATE|MOVE|COPY|SILENT|INSERT|DELETE|DATA|WITH|TO|USING|NAMED|MINUS|BIND|LANGMATCHES|LANG|BOUND|SAMETERM|ISIRI|ISURI|ISBLANK|ISLITERAL|REGEX|TRUE|FALSE|UNDEF|ADD|DEFAULT|ALL|SERVICE|INTO|IN|NOT|IRI|URI|BNODE|RAND|ABS|CEIL|FLOOR|ROUND|CONCAT|STRLEN|UCASE|LCASE|ENCODE_FOR_URI|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|NOW|UUID|STRUUID|MD5|SHA1|SHA256|SHA384|SHA512|COALESCE|IF|STRLANG|STRDT|ISNUMERIC|SUBSTR|REPLACE|EXISTS|COUNT|SUM|MIN|MAX|AVG|SAMPLE|SEPARATOR|STR)/i,a=/^(\*|a|\.|\{|\}|,|\(|\)|;|\[|\]|\|\||&&|=|!=|!|<=|>=|<|>|\+|-|\/|\^\^|\?|\||\^)/,l=null,u="sparql11",p="sparql11",c=!0,d=t(),E=d.terminal,h={"*[,, object]":3,"*[(,),object]":3,"*[(,),objectPath]":3,"*[/,pathEltOrInverse]":2,object:2,objectPath:2,objectList:2,objectListPath:2,storeProperty:2,pathMod:2,"?pathMod":2,propertyListNotEmpty:1,propertyList:1,propertyListPath:1,propertyListPathNotEmpty:1,"?[verb,objectList]":1,"?[or([verbPath, verbSimple]),objectList]":1},f={"}":1,"]":0,")":1,"{":-1,"(":-1,"*[;,?[or([verbPath,verbSimple]),objectList]]":1}; return{token:i,startState:function(){return{tokenize:i,OK:!0,complete:c,errorStartPos:null,errorEndPos:null,queryType:l,possibleCurrent:r(p),possibleNext:r(p),allowVars:!0,allowBnodes:!0,storeProperty:!1,lastProperty:"",stack:[p]}},indent:n,electricChars:"}])"}}),e.defineMIME("application/x-sparql-query","sparql11")})},{codemirror:7}],2:[function(e,t){t.exports=Trie=function(){this.words=0,this.prefixes=0,this.children=[]},Trie.prototype={insert:function(e,t){if(0!=e.length){var r,i,n=this;if(void 0===t&&(t=0),t===e.length)return void n.words++;n.prefixes++,r=e[t],void 0===n.children[r]&&(n.children[r]=new Trie),i=n.children[r],i.insert(e,t+1)}},remove:function(e,t){if(0!=e.length){var r,i,n=this;if(void 0===t&&(t=0),void 0!==n){if(t===e.length)return void n.words--;n.prefixes--,r=e[t],i=n.children[r],i.remove(e,t+1)}}},update:function(e,t){0!=e.length&&0!=t.length&&(this.remove(e),this.insert(t))},countWord:function(e,t){if(0==e.length)return 0;var r,i,n=this,o=0;return void 0===t&&(t=0),t===e.length?n.words:(r=e[t],i=n.children[r],void 0!==i&&(o=i.countWord(e,t+1)),o)},countPrefix:function(e,t){if(0==e.length)return 0;var r,i,n=this,o=0;if(void 0===t&&(t=0),t===e.length)return n.prefixes;var r=e[t];return i=n.children[r],void 0!==i&&(o=i.countPrefix(e,t+1)),o},find:function(e){return 0==e.length?!1:this.countWord(e)>0?!0:!1},getAllWords:function(e){var t,r,i=this,n=[];if(void 0===e&&(e=""),void 0===i)return[];i.words>0&&n.push(e);for(t in i.children)r=i.children[t],n=n.concat(r.getAllWords(e+t));return n},autoComplete:function(e,t){if(0==e.length)return[];var r,i,n=this;return void 0===t&&(t=0),r=e[t],i=n.children[r],void 0===i?[]:t===e.length-1?i.getAllWords(e):i.autoComplete(e,t+1)}}},{}],3:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){function t(e,t,i,n){var o=e.getLineHandle(t.line),l=t.ch-1,u=l>=0&&a[o.text.charAt(l)]||a[o.text.charAt(++l)];if(!u)return null;var p=">"==u.charAt(1)?1:-1;if(i&&p>0!=(l==t.ch))return null;var c=e.getTokenTypeAt(s(t.line,l+1)),d=r(e,s(t.line,l+(p>0?1:0)),p,c||null,n);return null==d?null:{from:s(t.line,l),to:d&&d.pos,match:d&&d.ch==u.charAt(0),forward:p>0}}function r(e,t,r,i,n){for(var o=n&&n.maxScanLineLength||1e4,l=n&&n.maxScanLines||1e3,u=[],p=n&&n.bracketRegex?n.bracketRegex:/[(){}[\]]/,c=r>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=c;d+=r){var E=e.getLine(d);if(E){var h=r>0?0:E.length-1,f=r>0?E.length:-1;if(!(E.length>o))for(d==t.line&&(h=t.ch-(0>r?1:0));h!=f;h+=r){var m=E.charAt(h);if(p.test(m)&&(void 0===i||e.getTokenTypeAt(s(d,h+1))==i)){var g=a[m];if(">"==g.charAt(1)==r>0)u.push(m);else{if(!u.length)return{pos:s(d,h),ch:m};u.pop()}}}}}return d-r==(r>0?e.lastLine():e.firstLine())?!1:null}function i(e,r,i){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,a=[],l=e.listSelections(),u=0;u<l.length;u++){var p=l[u].empty()&&t(e,l[u].head,!1,i);if(p&&e.getLine(p.from.line).length<=n){var c=p.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(e.markText(p.from,s(p.from.line,p.from.ch+1),{className:c})),p.to&&e.getLine(p.to.line).length<=n&&a.push(e.markText(p.to,s(p.to.line,p.to.ch+1),{className:c}))}}if(a.length){o&&e.state.focused&&e.display.input.focus();var d=function(){e.operation(function(){for(var e=0;e<a.length;e++)a[e].clear()})};if(!r)return d;setTimeout(d,800)}}function n(e){e.operation(function(){l&&(l(),l=null),l=i(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),s=e.Pos,a={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,r,i){i&&i!=e.Init&&t.off("cursorActivity",n),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",n))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,r,i){return t(this,e,r,i)}),e.defineExtension("scanForBracket",function(e,t,i,n){return r(this,e,t,i,n)})})},{"../../lib/codemirror":7}],4:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){"use strict";function t(e,t,r){this.cm=e,this.getHints=t,this.options=r,this.widget=this.onClose=null}function r(e){return"string"==typeof e?e:e.text}function i(e,t){function r(e,r){var o;o="string"!=typeof r?function(e){return r(e,t)}:i.hasOwnProperty(r)?i[r]:r,n[e]=o}var i={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(-t.menuSize()+1,!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},n=e.customKeys?{}:i;if(e.customKeys)for(var o in e.customKeys)e.customKeys.hasOwnProperty(o)&&r(o,e.customKeys[o]);if(e.extraKeys)for(var o in e.extraKeys)e.extraKeys.hasOwnProperty(o)&&r(o,e.extraKeys[o]);return n}function n(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function o(t,o){this.completion=t,this.data=o;var l=this,u=t.cm,p=t.options,c=this.hints=document.createElement("ul");c.className="CodeMirror-hints",this.selectedHint=p.getDefaultSelection?p.getDefaultSelection(u,p,o):0;for(var d=o.list,E=0;E<d.length;++E){var h=c.appendChild(document.createElement("li")),f=d[E],m=s+(E!=this.selectedHint?"":" "+a);null!=f.className&&(m=f.className+" "+m),h.className=m,f.render?f.render(h,o,f):h.appendChild(document.createTextNode(f.displayText||r(f))),h.hintId=E}var g=u.cursorCoords(p.alignWithWord!==!1?o.from:null),v=g.left,x=g.bottom,N=!0;c.style.left=v+"px",c.style.top=x+"px";var L=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),I=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(p.container||document.body).appendChild(c);var T=c.getBoundingClientRect(),A=T.bottom-I;if(A>0){var S=T.bottom-T.top,y=T.top-(g.bottom-g.top);if(y-S>0)c.style.top=(x=y-S)+"px",N=!1;else if(S>I){c.style.height=I-5+"px",c.style.top=(x=g.bottom-T.top)+"px";var C=u.getCursor();o.from.ch!=C.ch&&(g=u.cursorCoords(C),c.style.left=(v=g.left)+"px",T=c.getBoundingClientRect())}}var R=T.left-L;if(R>0&&(T.right-T.left>L&&(c.style.width=L-5+"px",R-=T.right-T.left-L),c.style.left=(v=g.left-R)+"px"),u.addKeyMap(this.keyMap=i(p,{moveFocus:function(e,t){l.changeActive(l.selectedHint+e,t)},setFocus:function(e){l.changeActive(e)},menuSize:function(){return l.screenAmount()},length:d.length,close:function(){t.close()},pick:function(){l.pick()},data:o})),p.closeOnUnfocus!==!1){var O;u.on("blur",this.onBlur=function(){O=setTimeout(function(){t.close()},100)}),u.on("focus",this.onFocus=function(){clearTimeout(O)})}var b=u.getScrollInfo();return u.on("scroll",this.onScroll=function(){var e=u.getScrollInfo(),r=u.getWrapperElement().getBoundingClientRect(),i=x+b.top-e.top,n=i-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return N||(n+=c.offsetHeight),n<=r.top||n>=r.bottom?t.close():(c.style.top=i+"px",void(c.style.left=v+b.left-e.left+"px"))}),e.on(c,"dblclick",function(e){var t=n(c,e.target||e.srcElement);t&&null!=t.hintId&&(l.changeActive(t.hintId),l.pick())}),e.on(c,"click",function(e){var t=n(c,e.target||e.srcElement);t&&null!=t.hintId&&(l.changeActive(t.hintId),p.completeOnSingleClick&&l.pick())}),e.on(c,"mousedown",function(){setTimeout(function(){u.focus()},20)}),e.signal(o,"select",d[0],c.firstChild),!0}var s="CodeMirror-hint",a="CodeMirror-hint-active";e.showHint=function(r,i,n){if(!(r.listSelections().length>1||r.somethingSelected())){if(null==i){if(n&&n.async)return;i=e.hint.auto}r.state.completionActive&&r.state.completionActive.close();var o=r.state.completionActive=new t(r,i,n||{});return e.signal(r,"startCompletion",r),o.options.async?void i(r,function(e){o.showHints(e)},o.options):o.showHints(i(r,o.options))}},t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.widget&&this.widget.close(),this.onClose&&this.onClose(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,i){var n=t.list[i];n.hint?n.hint(this.cm,t,n):this.cm.replaceRange(r(n),n.from||t.from,n.to||t.to,"complete"),e.signal(t,"pick",n),this.close()},showHints:function(e){return e&&e.list.length&&this.active()?void(0!=this.options.completeSingle&&1==e.list.length?this.pick(e,0):this.showWidget(e)):this.close()},showWidget:function(t){function r(){l||(l=!0,p.close(),p.cm.off("cursorActivity",a),t&&e.signal(t,"close"))}function i(){l||(e.signal(t,"update"),p.options.async?p.getHints(p.cm,n,p.options):n(p.getHints(p.cm,p.options)))}function n(e){if(t=e,!l){if(!t||!t.list.length)return r();p.widget&&p.widget.close(),p.widget=new o(p,t)}}function s(){u&&(f(u),u=0)}function a(){s();var e=p.cm.getCursor(),t=p.cm.getLine(e.line);e.line!=d.line||t.length-e.ch!=E-d.ch||e.ch<d.ch||p.cm.somethingSelected()||e.ch&&c.test(t.charAt(e.ch-1))?p.close():(u=h(i),p.widget&&p.widget.close())}this.widget=new o(this,t),e.signal(t,"shown");var l,u=0,p=this,c=this.options.closeCharacters||/[\s()\[\]{};:>,]/,d=this.cm.getCursor(),E=this.cm.getLine(d.line).length,h=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},f=window.cancelAnimationFrame||clearTimeout;this.cm.on("cursorActivity",a),this.onClose=r}},o.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus!==!1&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){if(t>=this.data.list.length?t=r?this.data.list.length-1:0:0>t&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i.className=i.className.replace(" "+a,""),i=this.hints.childNodes[this.selectedHint=t],i.className+=" "+a,i.offsetTop<this.hints.scrollTop?this.hints.scrollTop=i.offsetTop-3:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",function(t,r){var i,n=t.getHelpers(t.getCursor(),"hint");if(n.length)for(var o=0;o<n.length;o++){var s=n[o](t,r);if(s&&s.list.length)return s}else if(i=t.getHelper(t.getCursor(),"hintWords")){if(i)return e.hint.fromList(t,{words:i})}else if(e.hint.anyword)return e.hint.anyword(t,r)}),e.registerHelper("hint","fromList",function(t,r){for(var i=t.getCursor(),n=t.getTokenAt(i),o=[],s=0;s<r.words.length;s++){var a=r.words[s];a.slice(0,n.string.length)==n.string&&o.push(a)}return o.length?{list:o,from:e.Pos(i.line,n.start),to:e.Pos(i.line,n.end)}:void 0}),e.commands.autocomplete=e.showHint})},{"../../lib/codemirror":7}],5:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){"use strict";e.runMode=function(t,r,i,n){var o=e.getMode(e.defaults,r),s=/MSIE \d/.test(navigator.userAgent),a=s&&(null==document.documentMode||document.documentMode<9);if(1==i.nodeType){var l=n&&n.tabSize||e.defaults.tabSize,u=i,p=0;u.innerHTML="",i=function(e,t){if("\n"==e)return u.appendChild(document.createTextNode(a?"\r":e)),void(p=0);for(var r="",i=0;;){var n=e.indexOf(" ",i);if(-1==n){r+=e.slice(i),p+=e.length-i;break}p+=n-i,r+=e.slice(i,n);var o=l-p%l;p+=o;for(var s=0;o>s;++s)r+=" ";i=n+1}if(t){var c=u.appendChild(document.createElement("span"));c.className="cm-"+t.replace(/ +/g," cm-"),c.appendChild(document.createTextNode(r))}else u.appendChild(document.createTextNode(r))}}for(var c=e.splitLines(t),d=n&&n.state||e.startState(o),E=0,h=c.length;h>E;++E){E&&i("\n");var f=new e.StringStream(c[E]);for(!f.string&&o.blankLine&&o.blankLine();!f.eol();){var m=o.token(f,d);i(f.current(),m,E,f.start,d),f.start=f.pos}}}})},{"../../lib/codemirror":7}],6:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){"use strict";function t(e,t,n,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),n=n?e.clipPos(n):i(0,0),this.pos={from:n,to:n},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(r,n){if(r){t.lastIndex=0;for(var o,s,a=e.getLine(n.line).slice(0,n.ch),l=0;;){t.lastIndex=l;var u=t.exec(a);if(!u)break;if(o=u,s=o.index,l=o.index+(o[0].length||1),l==a.length)break}var p=o&&o[0].length||0;p||(0==s&&0==a.length?o=void 0:s!=e.getLine(n.line).length&&p++)}else{t.lastIndex=n.ch;var a=e.getLine(n.line),o=t.exec(a),p=o&&o[0].length||0,s=o&&o.index;s+p==a.length||p||(p=1)}return o&&p?{from:i(n.line,s),to:i(n.line,s+p),match:o}:void 0};else{var s=t;o&&(t=t.toLowerCase());var a=o?function(e){return e.toLowerCase()}:function(e){return e},l=t.split("\n");if(1==l.length)this.matches=t.length?function(n,o){if(n){var l=e.getLine(o.line).slice(0,o.ch),u=a(l),p=u.lastIndexOf(t);if(p>-1)return p=r(l,u,p),{from:i(o.line,p),to:i(o.line,p+s.length)}}else{var l=e.getLine(o.line).slice(o.ch),u=a(l),p=u.indexOf(t);if(p>-1)return p=r(l,u,p)+o.ch,{from:i(o.line,p),to:i(o.line,p+s.length)}}}:function(){};else{var u=s.split("\n");this.matches=function(t,r){var n=l.length-1;if(t){if(r.line-(l.length-1)<e.firstLine())return;if(a(e.getLine(r.line).slice(0,u[n].length))!=l[l.length-1])return;for(var o=i(r.line,u[n].length),s=r.line-1,p=n-1;p>=1;--p,--s)if(l[p]!=a(e.getLine(s)))return;var c=e.getLine(s),d=c.length-u[0].length;if(a(c.slice(d))!=l[0])return;return{from:i(s,d),to:o}}if(!(r.line+(l.length-1)>e.lastLine())){var c=e.getLine(r.line),d=c.length-u[0].length;if(a(c.slice(d))==l[0]){for(var E=i(r.line,d),s=r.line+1,p=1;n>p;++p,++s)if(l[p]!=a(e.getLine(s)))return;if(e.getLine(s).slice(0,u[n].length)==l[n])return{from:E,to:i(s,u[n].length)}}}}}}}function r(e,t,r){if(e.length==t.length)return r;for(var i=Math.min(r,e.length);;){var n=e.slice(0,i).toLowerCase().length;if(r>n)++i;else{if(!(n>r))return i;--i}}}var i=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=i(e,0);return r.pos={from:t,to:t},r.atOccurrence=!1,!1}for(var r=this,n=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,n))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!n.line)return t(0);n=i(n.line-1,this.doc.getLine(n.line-1).length)}else{var o=this.doc.lineCount();if(n.line==o-1)return t(o);n=i(n.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,r,i){return new t(this.doc,e,r,i)}),e.defineDocExtension("getSearchCursor",function(e,r,i){return new t(this,e,r,i)}),e.defineExtension("selectMatches",function(t,r){for(var i,n=[],o=this.getSearchCursor(t,this.getCursor("from"),r);(i=o.findNext())&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)n.push({anchor:o.from(),head:o.to()});n.length&&this.setSelections(n,0)})})},{"../../lib/codemirror":7}],7:[function(t,r,i){!function(t){if("object"==typeof i&&"object"==typeof r)r.exports=t();else{if("function"==typeof e&&e.amd)return e([],t);this.CodeMirror=t()}}(function(){"use strict";function e(r,i){if(!(this instanceof e))return new e(r,i);this.options=i=i||{},io(ms,i,!1),h(i);var n=i.value;"string"==typeof n&&(n=new Vs(n,i.mode)),this.doc=n;var o=this.display=new t(r,n);o.wrapper.CodeMirror=this,p(this),l(this),i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),i.autofocus&&!Ko&&Er(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new $n},_o&&setTimeout(no(dr,this,!0),20),mr(this);var s=this;$t(this,function(){s.curOp.forceUpdate=!0,gn(s,n),i.autofocus&&!Ko||co()==o.input?setTimeout(no(Br,s),20):Ur(s);for(var e in gs)gs.hasOwnProperty(e)&&gs[e](s,i[e],vs);for(var t=0;t<Is.length;++t)Is[t](s)})}function t(e,t){var r=this,i=r.input=ao("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");Uo?i.style.width="1000px":i.setAttribute("wrap","off"),Xo&&(i.style.border="1px solid black"),i.setAttribute("autocorrect","off"),i.setAttribute("autocapitalize","off"),i.setAttribute("spellcheck","false"),r.inputDiv=ao("div",[i],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),r.scrollbarH=ao("div",[ao("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar"),r.scrollbarV=ao("div",[ao("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r.scrollbarFiller=ao("div",null,"CodeMirror-scrollbar-filler"),r.gutterFiller=ao("div",null,"CodeMirror-gutter-filler"),r.lineDiv=ao("div",null,"CodeMirror-code"),r.selectionDiv=ao("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=ao("div",null,"CodeMirror-cursors"),r.measure=ao("div",null,"CodeMirror-measure"),r.lineMeasure=ao("div",null,"CodeMirror-measure"),r.lineSpace=ao("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=ao("div",[ao("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=ao("div",[r.mover],"CodeMirror-sizer"),r.heightForcer=ao("div",null,null,"position: absolute; height: "+Zs+"px; width: 1px;"),r.gutters=ao("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=ao("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=ao("div",[r.inputDiv,r.scrollbarH,r.scrollbarV,r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),Mo&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),Xo&&(i.style.width="0px"),Uo||(r.scroller.draggable=!0),Wo&&(r.inputDiv.style.height="1px",r.inputDiv.style.position="absolute"),Mo&&(r.scrollbarH.style.minHeight=r.scrollbarV.style.minWidth="18px"),e.appendChild?e.appendChild(r.wrapper):e(r.wrapper),r.viewFrom=r.viewTo=t.first,r.view=[],r.externalMeasured=null,r.viewOffset=0,r.lastSizeC=0,r.updateLineNumbers=null,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.prevInput="",r.alignWidgets=!1,r.pollingFast=!1,r.poll=new $n,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.inaccurateSelection=!1,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),i(t)}function i(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,vt(e,100),e.state.modeGen++,e.curOp&&rr(e)}function n(e){e.options.lineWrapping?(fo(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth=""):(ho(e.display.wrapper,"CodeMirror-wrap"),E(e)),s(e),rr(e),Gt(e),setTimeout(function(){m(e)},100)}function o(e){var t=zt(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/Xt(e.display)-3);return function(n){if(ji(e.doc,n))return 0;var o=0;if(n.widgets)for(var s=0;s<n.widgets.length;s++)n.widgets[s].height&&(o+=n.widgets[s].height);return r?o+(Math.ceil(n.text.length/i)||1)*t:o+t}}function s(e){var t=e.doc,r=o(e);t.iter(function(e){var t=r(e);t!=e.height&&Ln(e,t)})}function a(e){var t=Cs[e.options.keyMap],r=t.style;e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(r?" cm-keymap-"+r:"")}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gt(e)}function u(e){p(e),rr(e),setTimeout(function(){v(e)},20)}function p(e){var t=e.display.gutters,r=e.options.gutters;lo(t);for(var i=0;i<r.length;++i){var n=r[i],o=t.appendChild(ao("div",null,"CodeMirror-gutter "+n));"CodeMirror-linenumbers"==n&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=i?"":"none",c(e)}function c(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px",e.display.scrollbarH.style.left=e.options.fixedGutter?t+"px":0}function d(e){if(0==e.height)return 0;for(var t,r=e.text.length,i=e;t=wi(i);){var n=t.find(0,!0);i=n.from.line,r+=n.from.ch-n.to.ch}for(i=e;t=ki(i);){var n=t.find(0,!0);r-=i.text.length-n.from.ch,i=n.to.line,r+=i.text.length-n.to.ch}return r}function E(e){var t=e.display,r=e.doc;t.maxLine=vn(r,r.first),t.maxLineLength=d(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=d(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function h(e){var t=eo(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function f(e){var t=e.display.scroller;return{clientHeight:t.clientHeight,barHeight:e.display.scrollbarV.clientHeight,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth,barWidth:e.display.scrollbarH.clientWidth,docHeight:Math.round(e.doc.height+Tt(e.display))}}function m(e,t){t||(t=f(e));var r=e.display,i=t.docHeight+Zs,n=t.scrollWidth>t.clientWidth,o=i>t.clientHeight;if(o?(r.scrollbarV.style.display="block",r.scrollbarV.style.bottom=n?go(r.measure)+"px":"0",r.scrollbarV.firstChild.style.height=Math.max(0,i-t.clientHeight+(t.barHeight||r.scrollbarV.clientHeight))+"px"):(r.scrollbarV.style.display="",r.scrollbarV.firstChild.style.height="0"),n?(r.scrollbarH.style.display="block",r.scrollbarH.style.right=o?go(r.measure)+"px":"0",r.scrollbarH.firstChild.style.width=t.scrollWidth-t.clientWidth+(t.barWidth||r.scrollbarH.clientWidth)+"px"):(r.scrollbarH.style.display="",r.scrollbarH.firstChild.style.width="0"),n&&o?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=r.scrollbarFiller.style.width=go(r.measure)+"px"):r.scrollbarFiller.style.display="",n&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=go(r.measure)+"px",r.gutterFiller.style.width=r.gutters.offsetWidth+"px"):r.gutterFiller.style.display="",!e.state.checkedOverlayScrollbar&&t.clientHeight>0){if(0===go(r.measure)){var s=Yo&&!qo?"12px":"18px";r.scrollbarV.style.minWidth=r.scrollbarH.style.minHeight=s;var a=function(t){Fn(t)!=r.scrollbarV&&Fn(t)!=r.scrollbarH&&Zt(e,xr)(t)};Xs(r.scrollbarV,"mousedown",a),Xs(r.scrollbarH,"mousedown",a)}e.state.checkedOverlayScrollbar=!0}}function g(e,t,r){var i=r&&null!=r.top?r.top:e.scroller.scrollTop;i=Math.floor(i-It(e));var n=r&&null!=r.bottom?r.bottom:i+e.wrapper.clientHeight,o=Tn(t,i),s=Tn(t,n);if(r&&r.ensure){var a=r.ensure.from.line,l=r.ensure.to.line;if(o>a)return{from:a,to:Tn(t,An(vn(t,a))+e.wrapper.clientHeight)};if(Math.min(l,t.lastLine())>=s)return{from:Tn(t,An(vn(t,l))-e.wrapper.clientHeight),to:l}}return{from:o,to:s}}function v(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=i+"px",s=0;s<r.length;s++)if(!r[s].hidden){e.options.fixedGutter&&r[s].gutter&&(r[s].gutter.style.left=o);var a=r[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+n+"px")}}function x(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=N(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var n=i.measure.appendChild(ao("div",[ao("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=n.firstChild.offsetWidth,s=n.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-s),i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",c(e),!0}return!1}function N(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function L(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function I(e,t,r){for(var i,n=e.display.viewFrom,o=e.display.viewTo,s=g(e.display,e.doc,t),a=!0;;a=!1){var l=e.display.scroller.clientWidth;if(!T(e,s,r))break;i=!0,e.display.maxLineChanged&&!e.options.lineWrapping&&A(e);var u=f(e);if(ht(e),S(e,u),m(e,u),Uo&&e.options.lineWrapping&&y(e,u),a&&e.options.lineWrapping&&l!=e.display.scroller.clientWidth)r=!0;else if(r=!1,t&&null!=t.top&&(t={top:Math.min(u.docHeight-Zs-u.clientHeight,t.top)}),s=g(e.display,e.doc,t),s.from>=e.display.viewFrom&&s.to<=e.display.viewTo)break}return e.display.updateLineNumbers=null,i&&(Wn(e,"update",e),(e.display.viewFrom!=n||e.display.viewTo!=o)&&Wn(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo)),i}function T(e,t,r){var i=e.display,n=e.doc;if(!i.wrapper.offsetWidth)return void nr(e);if(!(!r&&t.from>=i.viewFrom&&t.to<=i.viewTo&&0==lr(e))){x(e)&&nr(e);var o=O(e),s=n.first+n.size,a=Math.max(t.from-e.options.viewportMargin,n.first),l=Math.min(s,t.to+e.options.viewportMargin);i.viewFrom<a&&a-i.viewFrom<20&&(a=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(s,i.viewTo)),ts&&(a=Hi(e.doc,a),l=Fi(e.doc,l));var u=a!=i.viewFrom||l!=i.viewTo||i.lastSizeC!=i.wrapper.clientHeight;ar(e,a,l),i.viewOffset=An(vn(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var p=lr(e);if(u||0!=p||r){var c=co();return p>4&&(i.lineDiv.style.display="none"),b(e,i.updateLineNumbers,o),p>4&&(i.lineDiv.style.display=""),c&&co()!=c&&c.offsetHeight&&c.focus(),lo(i.cursorDiv),lo(i.selectionDiv),u&&(i.lastSizeC=i.wrapper.clientHeight,vt(e,400)),C(e),!0}}}function A(e){var t=e.display,r=Rt(e,t.maxLine,t.maxLine.text.length).left;t.maxLineChanged=!1;var i=Math.max(0,r+3),n=Math.max(0,t.sizer.offsetLeft+i+Zs-t.scroller.clientWidth);t.sizer.style.minWidth=i+"px",n<e.doc.scrollLeft&&Rr(e,Math.min(t.scroller.scrollLeft,n),!0)}function S(e,t){e.display.sizer.style.minHeight=e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=Math.max(t.docHeight,t.clientHeight-Zs)+"px"}function y(e,t){e.display.sizer.offsetWidth+e.display.gutters.offsetWidth<e.display.scroller.clientWidth-1&&(e.display.sizer.style.minHeight=e.display.heightForcer.style.top="0px",e.display.gutters.style.height=t.docHeight+"px")}function C(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var n,o=t.view[i];if(!o.hidden){if(Mo){var s=o.node.offsetTop+o.node.offsetHeight;n=s-r,r=s}else{var a=o.node.getBoundingClientRect();n=a.bottom-a.top}var l=o.line.height-n;if(2>n&&(n=zt(t)),(l>.001||-.001>l)&&(Ln(o.line,n),R(o.line),o.rest))for(var u=0;u<o.rest.length;u++)R(o.rest[u])}}}function R(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function O(e){for(var t=e.display,r={},i={},n=t.gutters.firstChild,o=0;n;n=n.nextSibling,++o)r[e.options.gutters[o]]=n.offsetLeft,i[e.options.gutters[o]]=n.offsetWidth;return{fixedPos:L(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function b(e,t,r){function i(t){var r=t.nextSibling;return Uo&&Yo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var n=e.display,o=e.options.lineNumbers,s=n.lineDiv,a=s.firstChild,l=n.view,u=n.viewFrom,p=0;p<l.length;p++){var c=l[p];if(c.hidden);else if(c.node){for(;a!=c.node;)a=i(a);var d=o&&null!=t&&u>=t&&c.lineNumber;c.changes&&(eo(c.changes,"gutter")>-1&&(d=!1),P(e,c,u,r)),d&&(lo(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(N(e.options,u)))),a=c.node.nextSibling}else{var E=U(e,c,u,r);s.insertBefore(E,a)}u+=c.size}for(;a;)a=i(a)}function P(e,t,r,i){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];"text"==o?G(e,t):"gutter"==o?k(e,t,r,i):"class"==o?w(t):"widget"==o&&B(t,i)}t.changes=null}function D(e){return e.node==e.text&&(e.node=ao("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Mo&&(e.node.style.zIndex=2)),e.node}function _(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=D(e);e.background=r.insertBefore(ao("div",null,t),r.firstChild)}}function M(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):on(e,t)}function G(e,t){var r=t.text.className,i=M(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,w(t)):r&&(t.text.className=r)}function w(e){_(e),e.line.wrapClass?D(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function k(e,t,r,i){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var n=t.line.gutterMarkers;if(e.options.lineNumbers||n){var o=D(t),s=t.gutter=o.insertBefore(ao("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px"),t.text);if(!e.options.lineNumbers||n&&n["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(ao("div",N(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),n)for(var a=0;a<e.options.gutters.length;++a){var l=e.options.gutters[a],u=n.hasOwnProperty(l)&&n[l];u&&s.appendChild(ao("div",[u],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}function B(e,t){e.alignable&&(e.alignable=null);for(var r,i=e.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&e.node.removeChild(i)}V(e,t)}function U(e,t,r,i){var n=M(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),w(t),k(e,t,r,i),V(t,i),t.node}function V(e,t){if(H(e.line,e,t,!0),e.rest)for(var r=0;r<e.rest.length;r++)H(e.rest[r],e,t,!1)}function H(e,t,r,i){if(e.widgets)for(var n=D(t),o=0,s=e.widgets;o<s.length;++o){var a=s[o],l=ao("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||(l.ignoreEvents=!0),F(a,l,t,r),i&&a.above?n.insertBefore(l,t.gutter||t.text):n.appendChild(l),Wn(a,"redraw")}}function F(e,t,r,i){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var n=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(n-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function j(e){return rs(e.line,e.ch)}function W(e,t){return is(e,t)<0?t:e}function q(e,t){return is(e,t)<0?e:t}function z(e,t){this.ranges=e,this.primIndex=t}function X(e,t){this.anchor=e,this.head=t}function K(e,t){var r=e[t];e.sort(function(e,t){return is(e.from(),t.from())}),t=eo(e,r);for(var i=1;i<e.length;i++){var n=e[i],o=e[i-1];if(is(o.to(),n.from())>=0){var s=q(o.from(),n.from()),a=W(o.to(),n.to()),l=o.empty()?n.from()==n.head:o.from()==o.head;t>=i&&--t,e.splice(--i,2,new X(l?a:s,l?s:a))}}return new z(e,t)}function Y(e,t){return new z([new X(e,t||e)],0) }function $(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Z(e,t){if(t.line<e.first)return rs(e.first,0);var r=e.first+e.size-1;return t.line>r?rs(r,vn(e,r).text.length):Q(t,vn(e,t.line).text.length)}function Q(e,t){var r=e.ch;return null==r||r>t?rs(e.line,t):0>r?rs(e.line,0):e}function J(e,t){return t>=e.first&&t<e.first+e.size}function et(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=Z(e,t[i]);return r}function tt(e,t,r,i){if(e.cm&&e.cm.display.shift||e.extend){var n=t.anchor;if(i){var o=is(r,n)<0;o!=is(i,n)<0?(n=r,r=i):o!=is(r,i)<0&&(r=i)}return new X(n,r)}return new X(i||r,r)}function rt(e,t,r,i){lt(e,new z([tt(e,e.sel.primary(),t,r)],0),i)}function it(e,t,r){for(var i=[],n=0;n<e.sel.ranges.length;n++)i[n]=tt(e,e.sel.ranges[n],t[n],null);var o=K(i,e.sel.primIndex);lt(e,o,r)}function nt(e,t,r,i){var n=e.sel.ranges.slice(0);n[t]=r,lt(e,K(n,e.sel.primIndex),i)}function ot(e,t,r,i){lt(e,Y(t,r),i)}function st(e,t){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new X(Z(e,t[r].anchor),Z(e,t[r].head))}};return Ys(e,"beforeSelectionChange",e,r),e.cm&&Ys(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?K(r.ranges,r.ranges.length-1):t}function at(e,t,r){var i=e.history.done,n=Jn(i);n&&n.ranges?(i[i.length-1]=t,ut(e,t,r)):lt(e,t,r)}function lt(e,t,r){ut(e,t,r),Dn(e,e.sel,e.cm?e.cm.curOp.id:0/0,r)}function ut(e,t,r){(Kn(e,"beforeSelectionChange")||e.cm&&Kn(e.cm,"beforeSelectionChange"))&&(t=st(e,t));var i=is(t.primary().head,e.sel.primary().head)<0?-1:1;pt(e,dt(e,t,i,!0)),r&&r.scroll===!1||!e.cm||oi(e.cm)}function pt(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Xn(e.cm)),Wn(e,"cursorActivity",e))}function ct(e){pt(e,dt(e,e.sel,null,!1),Js)}function dt(e,t,r,i){for(var n,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=Et(e,s.anchor,r,i),l=Et(e,s.head,r,i);(n||a!=s.anchor||l!=s.head)&&(n||(n=t.ranges.slice(0,o)),n[o]=new X(a,l))}return n?K(n,t.primIndex):t}function Et(e,t,r,i){var n=!1,o=t,s=r||1;e.cantEdit=!1;e:for(;;){var a=vn(e,o.line);if(a.markedSpans)for(var l=0;l<a.markedSpans.length;++l){var u=a.markedSpans[l],p=u.marker;if((null==u.from||(p.inclusiveLeft?u.from<=o.ch:u.from<o.ch))&&(null==u.to||(p.inclusiveRight?u.to>=o.ch:u.to>o.ch))){if(i&&(Ys(p,"beforeCursorEnter"),p.explicitlyCleared)){if(a.markedSpans){--l;continue}break}if(!p.atomic)continue;var c=p.find(0>s?-1:1);if(0==is(c,o)&&(c.ch+=s,c.ch<0?c=c.line>e.first?Z(e,rs(c.line-1)):null:c.ch>a.text.length&&(c=c.line<e.first+e.size-1?rs(c.line+1,0):null),!c)){if(n)return i?(e.cantEdit=!0,rs(e.first,0)):Et(e,t,r,!0);n=!0,c=t,s=-s}o=c;continue e}}return o}}function ht(e){for(var t=e.display,r=e.doc,i=document.createDocumentFragment(),n=document.createDocumentFragment(),o=0;o<r.sel.ranges.length;o++){var s=r.sel.ranges[o],a=s.empty();(a||e.options.showCursorWhenSelecting)&&ft(e,s,i),a||mt(e,s,n)}if(e.options.moveInputWithCursor){var l=Ht(e,r.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),p=t.lineDiv.getBoundingClientRect(),c=Math.max(0,Math.min(t.wrapper.clientHeight-10,l.top+p.top-u.top)),d=Math.max(0,Math.min(t.wrapper.clientWidth-10,l.left+p.left-u.left));t.inputDiv.style.top=c+"px",t.inputDiv.style.left=d+"px"}uo(t.cursorDiv,i),uo(t.selectionDiv,n)}function ft(e,t,r){var i=Ht(e,t.head,"div"),n=r.appendChild(ao("div"," ","CodeMirror-cursor"));if(n.style.left=i.left+"px",n.style.top=i.top+"px",n.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var o=r.appendChild(ao("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function mt(e,t,r){function i(e,t,r,i){0>t&&(t=0),t=Math.round(t),i=Math.round(i),a.appendChild(ao("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?p-e:r)+"px; height: "+(i-t)+"px"))}function n(t,r,n){function o(r,i){return Vt(e,rs(t,r),"div",c,i)}var a,l,c=vn(s,t),d=c.text.length;return No(Sn(c),r||0,null==n?d:n,function(e,t,s){var c,E,h,f=o(e,"left");if(e==t)c=f,E=h=f.left;else{if(c=o(t-1,"right"),"rtl"==s){var m=f;f=c,c=m}E=f.left,h=c.right}null==r&&0==e&&(E=u),c.top-f.top>3&&(i(E,f.top,null,f.bottom),E=u,f.bottom<c.top&&i(E,f.bottom,null,c.top)),null==n&&t==d&&(h=p),(!a||f.top<a.top||f.top==a.top&&f.left<a.left)&&(a=f),(!l||c.bottom>l.bottom||c.bottom==l.bottom&&c.right>l.right)&&(l=c),u+1>E&&(E=u),i(E,c.top,h-E,c.bottom)}),{start:a,end:l}}var o=e.display,s=e.doc,a=document.createDocumentFragment(),l=At(e.display),u=l.left,p=o.lineSpace.offsetWidth-l.right,c=t.from(),d=t.to();if(c.line==d.line)n(c.line,c.ch,d.ch);else{var E=vn(s,c.line),h=vn(s,d.line),f=Ui(E)==Ui(h),m=n(c.line,c.ch,f?E.text.length+1:null).end,g=n(d.line,f?0:null,d.ch).start;f&&(m.top<g.top-2?(i(m.right,m.top,null,m.bottom),i(u,g.top,g.left,g.bottom)):i(m.right,m.top,g.left-m.right,m.bottom)),m.bottom<g.top&&i(u,m.bottom,null,g.top)}r.appendChild(a)}function gt(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0&&(t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate))}}function vt(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,no(xt,e))}function xt(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,i=As(t.mode,Lt(e,t.frontier));$t(e,function(){t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(n){if(t.frontier>=e.display.viewFrom){var o=n.styles,s=en(e,n,i,!0);n.styles=s.styles,s.classes?n.styleClasses=s.classes:n.styleClasses&&(n.styleClasses=null);for(var a=!o||o.length!=n.styles.length,l=0;!a&&l<o.length;++l)a=o[l]!=n.styles[l];a&&ir(e,t.frontier,"text"),n.stateAfter=As(t.mode,i)}else rn(e,n.text,i),n.stateAfter=t.frontier%5==0?As(t.mode,i):null;return++t.frontier,+new Date>r?(vt(e,e.options.workDelay),!0):void 0})})}}function Nt(e,t,r){for(var i,n,o=e.doc,s=r?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=vn(o,a-1);if(l.stateAfter&&(!r||a<=o.frontier))return a;var u=ra(l.text,null,e.options.tabSize);(null==n||i>u)&&(n=a-1,i=u)}return n}function Lt(e,t,r){var i=e.doc,n=e.display;if(!i.mode.startState)return!0;var o=Nt(e,t,r),s=o>i.first&&vn(i,o-1).stateAfter;return s=s?As(i.mode,s):Ss(i.mode),i.iter(o,t,function(r){rn(e,r.text,s);var a=o==t-1||o%5==0||o>=n.viewFrom&&o<n.viewTo;r.stateAfter=a?As(i.mode,s):null,++o}),r&&(i.frontier=o),s}function It(e){return e.lineSpace.offsetTop}function Tt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function At(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=uo(e.measure,ao("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function St(e,t,r){var i=e.options.lineWrapping,n=i&&e.display.scroller.clientWidth;if(!t.measure.heights||i&&t.measure.width!=n){var o=t.measure.heights=[];if(i){t.measure.width=n;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],u=s[a+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function yt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var i=0;i<e.rest.length;i++)if(In(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ct(e,t){t=Ui(t);var r=In(t),i=e.display.externalMeasured=new er(e.doc,t,r);i.lineN=r;var n=i.built=on(e,i);return i.text=n.pre,uo(e.display.lineMeasure,n.pre),i}function Rt(e,t,r,i){return Pt(e,bt(e,t),r,i)}function Ot(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[or(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function bt(e,t){var r=In(t),i=Ot(e,r);i&&!i.text?i=null:i&&i.changes&&P(e,i,r,O(e)),i||(i=Ct(e,t));var n=yt(i,t,r);return{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Pt(e,t,r,i){t.before&&(r=-1);var n,o=r+(i||"");return t.cache.hasOwnProperty(o)?n=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(St(e,t.view,t.rect),t.hasHeights=!0),n=Dt(e,t,r,i),n.bogus||(t.cache[o]=n)),{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function Dt(e,t,r,i){for(var n,o,s,a,l=t.map,u=0;u<l.length;u+=3){var p=l[u],c=l[u+1];if(p>r?(o=0,s=1,a="left"):c>r?(o=r-p,s=o+1):(u==l.length-3||r==c&&l[u+3]>r)&&(s=c-p,o=s-1,r>=c&&(a="right")),null!=o){if(n=l[u+2],p==c&&i==(n.insertLeft?"left":"right")&&(a=i),"left"==i&&0==o)for(;u&&l[u-2]==l[u-3]&&l[u-1].insertLeft;)n=l[(u-=3)+2],a="left";if("right"==i&&o==c-p)for(;u<l.length-3&&l[u+3]==l[u+4]&&!l[u+5].insertLeft;)n=l[(u+=3)+2],a="right";break}}var d;if(3==n.nodeType){for(;o&&so(t.line.text.charAt(p+o));)--o;for(;c>p+s&&so(t.line.text.charAt(p+s));)++s;if(Go&&0==o&&s==c-p)d=n.parentNode.getBoundingClientRect();else if(Bo&&e.options.lineWrapping){var E=oa(n,o,s).getClientRects();d=E.length?E["right"==i?E.length-1:0]:as}else d=oa(n,o,s).getBoundingClientRect()}else{o>0&&(a=i="right");var E;d=e.options.lineWrapping&&(E=n.getClientRects()).length>1?E["right"==i?E.length-1:0]:n.getBoundingClientRect()}if(Go&&!o&&(!d||!d.left&&!d.right)){var h=n.parentNode.getClientRects()[0];d=h?{left:h.left,right:h.left+Xt(e.display),top:h.top,bottom:h.bottom}:as}for(var f,m=(d.bottom+d.top)/2-t.rect.top,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);f=u?g[u-1]:0,m=g[u];var v={left:("right"==a?d.right:d.left)-t.rect.left,right:("left"==a?d.left:d.right)-t.rect.left,top:f,bottom:m};return d.left||d.right||(v.bogus=!0),v}function _t(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Mt(e){e.display.externalMeasure=null,lo(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)_t(e.display.view[t])}function Gt(e){Mt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function wt(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function kt(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function Bt(e,t,r,i){if(t.widgets)for(var n=0;n<t.widgets.length;++n)if(t.widgets[n].above){var o=zi(t.widgets[n]);r.top+=o,r.bottom+=o}if("line"==i)return r;i||(i="local");var s=An(t);if("local"==i?s+=It(e.display):s-=e.display.viewOffset,"page"==i||"window"==i){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==i?0:kt());var l=a.left+("window"==i?0:wt());r.left+=l,r.right+=l}return r.top+=s,r.bottom+=s,r}function Ut(e,t,r){if("div"==r)return t;var i=t.left,n=t.top;if("page"==r)i-=wt(),n-=kt();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();i+=o.left,n+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:i-s.left,top:n-s.top}}function Vt(e,t,r,i,n){return i||(i=vn(e.doc,t.line)),Bt(e,i,Rt(e,i,t.ch,n),r)}function Ht(e,t,r,i,n){function o(t,o){var s=Pt(e,n,t,o?"right":"left");return o?s.left=s.right:s.right=s.left,Bt(e,i,s,r)}function s(e,t){var r=a[t],i=r.level%2;return e==Lo(r)&&t&&r.level<a[t-1].level?(r=a[--t],e=Io(r)-(r.level%2?0:1),i=!0):e==Io(r)&&t<a.length-1&&r.level<a[t+1].level&&(r=a[++t],e=Lo(r)-r.level%2,i=!1),i&&e==r.to&&e>r.from?o(e-1):o(e,i)}i=i||vn(e.doc,t.line),n||(n=bt(e,i));var a=Sn(i),l=t.ch;if(!a)return o(l);var u=Ro(a,l),p=s(l,u);return null!=ga&&(p.other=s(l,ga)),p}function Ft(e,t){var r=0,t=Z(e.doc,t);e.options.lineWrapping||(r=Xt(e.display)*t.ch);var i=vn(e.doc,t.line),n=An(i)+It(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function jt(e,t,r,i){var n=rs(e,t);return n.xRel=i,r&&(n.outside=!0),n}function Wt(e,t,r){var i=e.doc;if(r+=e.display.viewOffset,0>r)return jt(i.first,0,!0,-1);var n=Tn(i,r),o=i.first+i.size-1;if(n>o)return jt(i.first+i.size-1,vn(i,o).text.length,!0,1);0>t&&(t=0);for(var s=vn(i,n);;){var a=qt(e,s,n,t,r),l=ki(s),u=l&&l.find(0,!0);if(!l||!(a.ch>u.from.ch||a.ch==u.from.ch&&a.xRel>0))return a;n=In(s=u.to.line)}}function qt(e,t,r,i,n){function o(i){var n=Ht(e,rs(r,i),"line",t,u);return a=!0,s>n.bottom?n.left-l:s<n.top?n.left+l:(a=!1,n.left)}var s=n-An(t),a=!1,l=2*e.display.wrapper.clientWidth,u=bt(e,t),p=Sn(t),c=t.text.length,d=To(t),E=Ao(t),h=o(d),f=a,m=o(E),g=a;if(i>m)return jt(r,E,g,1);for(;;){if(p?E==d||E==bo(t,d,1):1>=E-d){for(var v=h>i||m-i>=i-h?d:E,x=i-(v==d?h:m);so(t.text.charAt(v));)++v;var N=jt(r,v,v==d?f:g,-1>x?-1:x>1?1:0);return N}var L=Math.ceil(c/2),I=d+L;if(p){I=d;for(var T=0;L>T;++T)I=bo(t,I,1)}var A=o(I);A>i?(E=I,m=A,(g=a)&&(m+=1e3),c=L):(d=I,h=A,f=a,c-=L)}}function zt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ns){ns=ao("pre");for(var t=0;49>t;++t)ns.appendChild(document.createTextNode("x")),ns.appendChild(ao("br"));ns.appendChild(document.createTextNode("x"))}uo(e.measure,ns);var r=ns.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),lo(e.measure),r||1}function Xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=ao("span","xxxxxxxxxx"),r=ao("pre",[t]);uo(e.measure,r);var i=t.getBoundingClientRect(),n=(i.right-i.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function Kt(e){e.curOp={viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++ls},$s++||(js=[])}function Yt(e){var t=e.curOp,r=e.doc,i=e.display;if(e.curOp=null,t.updateMaxLine&&E(e),t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<i.viewFrom||t.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&e.options.lineWrapping){var n=I(e,{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate);e.display.scroller.offsetHeight&&(e.doc.scrollTop=e.display.scroller.scrollTop)}if(!n&&t.selectionChanged&&ht(e),n||t.startHeight==e.doc.height||m(e),null!=t.scrollTop&&i.scroller.scrollTop!=t.scrollTop){var o=Math.max(0,Math.min(i.scroller.scrollHeight-i.scroller.clientHeight,t.scrollTop));i.scroller.scrollTop=i.scrollbarV.scrollTop=r.scrollTop=o}if(null!=t.scrollLeft&&i.scroller.scrollLeft!=t.scrollLeft){var s=Math.max(0,Math.min(i.scroller.scrollWidth-i.scroller.clientWidth,t.scrollLeft));i.scroller.scrollLeft=i.scrollbarH.scrollLeft=r.scrollLeft=s,v(e)}if(t.scrollToPos){var a=ti(e,Z(e.doc,t.scrollToPos.from),Z(e.doc,t.scrollToPos.to),t.scrollToPos.margin);t.scrollToPos.isCursor&&e.state.focused&&ei(e,a)}t.selectionChanged&&gt(e),e.state.focused&&t.updateInput&&dr(e,t.typing);var l=t.maybeHiddenMarkers,u=t.maybeUnhiddenMarkers;if(l)for(var p=0;p<l.length;++p)l[p].lines.length||Ys(l[p],"hide");if(u)for(var p=0;p<u.length;++p)u[p].lines.length&&Ys(u[p],"unhide");var c;if(--$s||(c=js,js=null),t.changeObjs&&Ys(e,"changes",e,t.changeObjs),c)for(var p=0;p<c.length;++p)c[p]();if(t.cursorActivityHandlers)for(var p=0;p<t.cursorActivityHandlers.length;p++)t.cursorActivityHandlers[p](e)}function $t(e,t){if(e.curOp)return t();Kt(e);try{return t()}finally{Yt(e)}}function Zt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Kt(e);try{return t.apply(e,arguments)}finally{Yt(e)}}}function Qt(e){return function(){if(this.curOp)return e.apply(this,arguments);Kt(this);try{return e.apply(this,arguments)}finally{Yt(this)}}}function Jt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Kt(t);try{return e.apply(this,arguments)}finally{Yt(t)}}}function er(e,t,r){this.line=t,this.rest=Vi(t),this.size=this.rest?In(Jn(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ji(e,t)}function tr(e,t,r){for(var i,n=[],o=t;r>o;o=i){var s=new er(e.doc,vn(e.doc,o),o);i=o+s.size,n.push(s)}return n}function rr(e,t,r,i){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),i||(i=0);var n=e.display;if(i&&r<n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)ts&&Hi(e.doc,t)<n.viewTo&&nr(e);else if(r<=n.viewFrom)ts&&Fi(e.doc,r+i)>n.viewFrom?nr(e):(n.viewFrom+=i,n.viewTo+=i);else if(t<=n.viewFrom&&r>=n.viewTo)nr(e);else if(t<=n.viewFrom){var o=sr(e,r,r+i,1);o?(n.view=n.view.slice(o.index),n.viewFrom=o.lineN,n.viewTo+=i):nr(e)}else if(r>=n.viewTo){var o=sr(e,t,t,-1);o?(n.view=n.view.slice(0,o.index),n.viewTo=o.lineN):nr(e)}else{var s=sr(e,t,t,-1),a=sr(e,r,r+i,1);s&&a?(n.view=n.view.slice(0,s.index).concat(tr(e,s.lineN,a.lineN)).concat(n.view.slice(a.index)),n.viewTo+=i):nr(e)}var l=n.externalMeasured;l&&(r<l.lineN?l.lineN+=i:t<l.lineN+l.size&&(n.externalMeasured=null))}function ir(e,t,r){e.curOp.viewChanged=!0;var i=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[or(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==eo(s,r)&&s.push(r)}}}function nr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function or(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,i=0;i<r.length;i++)if(t-=r[i].size,0>t)return i}function sr(e,t,r,i){var n,o=or(e,t),s=e.display.view;if(!ts)return{index:o,lineN:r};for(var a=0,l=e.display.viewFrom;o>a;a++)l+=s[a].size;if(l!=t){if(i>0){if(o==s.length-1)return null;n=l+s[o].size-t,o++}else n=l-t;t+=n,r+=n}for(;Hi(e.doc,r)!=r;){if(o==(0>i?0:s.length-1))return null;r+=i*s[o-(0>i?1:0)].size,o+=i}return{index:o,lineN:r}}function ar(e,t,r){var i=e.display,n=i.view;0==n.length||t>=i.viewTo||r<=i.viewFrom?(i.view=tr(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=tr(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(or(e,t))),i.viewFrom=t,i.viewTo<r?i.view=i.view.concat(tr(e,i.viewTo,r)):i.viewTo>r&&(i.view=i.view.slice(0,or(e,r)))),i.viewTo=r}function lr(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var n=t[i];n.hidden||n.node&&!n.changes||++r}return r}function ur(e){e.display.pollingFast||e.display.poll.set(e.options.pollInterval,function(){cr(e),e.state.focused&&ur(e)})}function pr(e){function t(){var i=cr(e);i||r?(e.display.pollingFast=!1,ur(e)):(r=!0,e.display.poll.set(60,t))}var r=!1;e.display.pollingFast=!0,e.display.poll.set(20,t)}function cr(e){var t=e.display.input,r=e.display.prevInput,i=e.doc;if(!e.state.focused||ha(t)&&!r||fr(e)||e.options.disableInput)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(Bo&&!Go&&e.display.inputHasSelection===n)return dr(e),!1;var o=!e.curOp;o&&Kt(e),e.display.shift=!1;for(var s=0,a=Math.min(r.length,n.length);a>s&&r.charCodeAt(s)==n.charCodeAt(s);)++s;for(var l=n.slice(s),u=Ea(l),p=e.state.pasteIncoming&&u.length>1&&i.sel.ranges.length==u.length,c=i.sel.ranges.length-1;c>=0;c--){var d=i.sel.ranges[c],E=d.from(),h=d.to();s<r.length?E=rs(E.line,E.ch-(r.length-s)):e.state.overwrite&&d.empty()&&!e.state.pasteIncoming&&(h=rs(h.line,Math.min(vn(i,h.line).text.length,h.ch+Jn(u).length)));var f=e.curOp.updateInput,m={from:E,to:h,text:p?[u[c]]:u,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(Xr(e.doc,m),Wn(e,"inputRead",e,m),l&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&d.head.ch<100&&(!c||i.sel.ranges[c-1].head.line!=d.head.line)){var g=e.getModeAt(d.head);if(g.electricChars){for(var v=0;v<g.electricChars.length;v++)if(l.indexOf(g.electricChars.charAt(v))>-1){ai(e,d.head.line,"smart");break}}else if(g.electricInput){var x=fs(m);g.electricInput.test(vn(i,x.line).text.slice(0,x.ch))&&ai(e,d.head.line,"smart")}}}return oi(e),e.curOp.updateInput=f,e.curOp.typing=!0,n.length>1e3||n.indexOf("\n")>-1?t.value=e.display.prevInput="":e.display.prevInput=n,o&&Yt(e),e.state.pasteIncoming=e.state.cutIncoming=!1,!0}function dr(e,t){var r,i,n=e.doc;if(e.somethingSelected()){e.display.prevInput="";var o=n.sel.primary();r=fa&&(o.to().line-o.from().line>100||(i=e.getSelection()).length>1e3);var s=r?"-":i||e.getSelection();e.display.input.value=s,e.state.focused&&na(e.display.input),Bo&&!Go&&(e.display.inputHasSelection=s)}else t||(e.display.prevInput=e.display.input.value="",Bo&&!Go&&(e.display.inputHasSelection=null));e.display.inaccurateSelection=r}function Er(e){"nocursor"==e.options.readOnly||Ko&&co()==e.display.input||e.display.input.focus()}function hr(e){e.state.focused||(Er(e),Br(e))}function fr(e){return e.options.readOnly||e.doc.cantEdit}function mr(e){function t(){e.state.focused&&setTimeout(no(Er,e),0)}function r(){null==a&&(a=setTimeout(function(){a=null,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=ua=null,e.setSize()},100))}function i(){po(document.body,s.wrapper)?setTimeout(i,5e3):Ks(window,"resize",r)}function n(t){zn(e,t)||zs(t)}function o(t){if(e.somethingSelected())s.inaccurateSelection&&(s.prevInput="",s.inaccurateSelection=!1,s.input.value=e.getSelection(),na(s.input));else{for(var r="",i=[],n=0;n<e.doc.sel.ranges.length;n++){var o=e.doc.sel.ranges[n].head.line,a={anchor:rs(o,0),head:rs(o+1,0)};i.push(a),r+=e.getRange(a.anchor,a.head)}"cut"==t.type?e.setSelections(i,null,Js):(s.prevInput="",s.input.value=r,na(s.input))}"cut"==t.type&&(e.state.cutIncoming=!0)}var s=e.display;Xs(s.scroller,"mousedown",Zt(e,xr)),_o?Xs(s.scroller,"dblclick",Zt(e,function(t){if(!zn(e,t)){var r=vr(e,t);if(r&&!Ar(e,t)&&!gr(e.display,t)){Ws(t);var i=di(e.doc,r);rt(e.doc,i.anchor,i.head)}}})):Xs(s.scroller,"dblclick",function(t){zn(e,t)||Ws(t)}),Xs(s.lineSpace,"selectstart",function(e){gr(s,e)||Ws(e)}),Jo||Xs(s.scroller,"contextmenu",function(t){Vr(e,t)}),Xs(s.scroller,"scroll",function(){s.scroller.clientHeight&&(Cr(e,s.scroller.scrollTop),Rr(e,s.scroller.scrollLeft,!0),Ys(e,"scroll",e))}),Xs(s.scrollbarV,"scroll",function(){s.scroller.clientHeight&&Cr(e,s.scrollbarV.scrollTop)}),Xs(s.scrollbarH,"scroll",function(){s.scroller.clientHeight&&Rr(e,s.scrollbarH.scrollLeft)}),Xs(s.scroller,"mousewheel",function(t){Or(e,t)}),Xs(s.scroller,"DOMMouseScroll",function(t){Or(e,t)}),Xs(s.scrollbarH,"mousedown",t),Xs(s.scrollbarV,"mousedown",t),Xs(s.wrapper,"scroll",function(){s.wrapper.scrollTop=s.wrapper.scrollLeft=0});var a;Xs(window,"resize",r),setTimeout(i,5e3),Xs(s.input,"keyup",Zt(e,wr)),Xs(s.input,"input",function(){Bo&&!Go&&e.display.inputHasSelection&&(e.display.inputHasSelection=null),pr(e)}),Xs(s.input,"keydown",Zt(e,Mr)),Xs(s.input,"keypress",Zt(e,kr)),Xs(s.input,"focus",no(Br,e)),Xs(s.input,"blur",no(Ur,e)),e.options.dragDrop&&(Xs(s.scroller,"dragstart",function(t){yr(e,t)}),Xs(s.scroller,"dragenter",n),Xs(s.scroller,"dragover",n),Xs(s.scroller,"drop",Zt(e,Sr))),Xs(s.scroller,"paste",function(t){gr(s,t)||(e.state.pasteIncoming=!0,Er(e),pr(e))}),Xs(s.input,"paste",function(){if(Uo&&!e.state.fakedLastChar&&!(new Date-e.state.lastMiddleDown<200)){var t=s.input.selectionStart,r=s.input.selectionEnd;s.input.value+="$",s.input.selectionStart=t,s.input.selectionEnd=r,e.state.fakedLastChar=!0}e.state.pasteIncoming=!0,pr(e)}),Xs(s.input,"cut",o),Xs(s.input,"copy",o),Wo&&Xs(s.sizer,"mouseup",function(){co()==s.input&&s.input.blur(),Er(e)})}function gr(e,t){for(var r=Fn(t);r!=e.wrapper;r=r.parentNode)if(!r||r.ignoreEvents||r.parentNode==e.sizer&&r!=e.mover)return!0}function vr(e,t,r,i){var n=e.display;if(!r){var o=Fn(t);if(o==n.scrollbarH||o==n.scrollbarV||o==n.scrollbarFiller||o==n.gutterFiller)return null}var s,a,l=n.lineSpace.getBoundingClientRect();try{s=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var u,p=Wt(e,s,a);if(i&&1==p.xRel&&(u=vn(e.doc,p.line).text).length==p.ch){var c=ra(u,u.length,e.options.tabSize)-u.length;p=rs(p.line,Math.max(0,Math.round((s-At(e.display).left)/Xt(e.display))-c))}return p}function xr(e){if(!zn(this,e)){var t=this,r=t.display;if(r.shift=e.shiftKey,gr(r,e))return void(Uo||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Ar(t,e)){var i=vr(t,e);switch(window.focus(),jn(e)){case 1:i?Nr(t,e,i):Fn(e)==r.scroller&&Ws(e);break;case 2:Uo&&(t.state.lastMiddleDown=+new Date),i&&rt(t.doc,i),setTimeout(no(Er,t),20),Ws(e);break;case 3:Jo&&Vr(t,e)}}}}function Nr(e,t,r){setTimeout(no(hr,e),0);var i,n=+new Date;ss&&ss.time>n-400&&0==is(ss.pos,r)?i="triple":os&&os.time>n-400&&0==is(os.pos,r)?(i="double",ss={time:n,pos:r}):(i="single",os={time:n,pos:r});var o=e.doc.sel,s=Yo?t.metaKey:t.ctrlKey;e.options.dragDrop&&da&&!s&&!fr(e)&&"single"==i&&o.contains(r)>-1&&o.somethingSelected()?Lr(e,t,r):Ir(e,t,r,i,s)}function Lr(e,t,r){var i=e.display,n=Zt(e,function(o){Uo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ks(document,"mouseup",n),Ks(i.scroller,"drop",n),Math.abs(t.clientX-o.clientX)+Math.abs(t.clientY-o.clientY)<10&&(Ws(o),rt(e.doc,r),Er(e),_o&&!Go&&setTimeout(function(){document.body.focus(),Er(e)},20))});Uo&&(i.scroller.draggable=!0),e.state.draggingText=n,i.scroller.dragDrop&&i.scroller.dragDrop(),Xs(document,"mouseup",n),Xs(i.scroller,"drop",n)}function Ir(e,t,r,i,n){function o(t){if(0!=is(f,t))if(f=t,"rect"==i){for(var n=[],o=e.options.tabSize,s=ra(vn(u,r.line).text,r.ch,o),a=ra(vn(u,t.line).text,t.ch,o),l=Math.min(s,a),E=Math.max(s,a),h=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));m>=h;h++){var g=vn(u,h).text,v=Zn(g,l,o);l==E?n.push(new X(rs(h,v),rs(h,v))):g.length>v&&n.push(new X(rs(h,v),rs(h,Zn(g,E,o))))}n.length||n.push(new X(r,r)),lt(u,K(d.ranges.slice(0,c).concat(n),c),ea)}else{var x=p,N=x.anchor,L=t;if("single"!=i){if("double"==i)var I=di(u,t);else var I=new X(rs(t.line,0),Z(u,rs(t.line+1,0)));is(I.anchor,N)>0?(L=I.head,N=q(x.from(),I.anchor)):(L=I.anchor,N=W(x.to(),I.head))}var n=d.ranges.slice(0);n[c]=new X(Z(u,N),L),lt(u,K(n,c),ea)}}function s(t){var r=++v,n=vr(e,t,!0,"rect"==i);if(n)if(0!=is(n,f)){hr(e),o(n);var a=g(l,u);(n.line>=a.to||n.line<a.from)&&setTimeout(Zt(e,function(){v==r&&s(t)}),150)}else{var p=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;p&&setTimeout(Zt(e,function(){v==r&&(l.scroller.scrollTop+=p,s(t))}),50)}}function a(t){v=1/0,Ws(t),Er(e),Ks(document,"mousemove",x),Ks(document,"mouseup",N),u.history.lastSelOrigin=null}var l=e.display,u=e.doc;Ws(t);var p,c,d=u.sel;if(n&&!t.shiftKey?(c=u.sel.contains(r),p=c>-1?u.sel.ranges[c]:new X(r,r)):p=u.sel.primary(),t.altKey)i="rect",n||(p=new X(r,r)),r=vr(e,t,!0,!0),c=-1;else if("double"==i){var E=di(u,r);p=e.display.shift||u.extend?tt(u,p,E.anchor,E.head):E}else if("triple"==i){var h=new X(rs(r.line,0),Z(u,rs(r.line+1,0)));p=e.display.shift||u.extend?tt(u,p,h.anchor,h.head):h}else p=tt(u,p,r);n?c>-1?nt(u,c,p,ea):(c=u.sel.ranges.length,lt(u,K(u.sel.ranges.concat([p]),c),{scroll:!1,origin:"*mouse"})):(c=0,lt(u,new z([p],0),ea),d=u.sel);var f=r,m=l.wrapper.getBoundingClientRect(),v=0,x=Zt(e,function(e){(Bo&&!wo?e.buttons:jn(e))?s(e):a(e)}),N=Zt(e,a);Xs(document,"mousemove",x),Xs(document,"mouseup",N)}function Tr(e,t,r,i,n){try{var o=t.clientX,s=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&Ws(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(s>l.bottom||!Kn(e,r))return Hn(t);s-=l.top-a.viewOffset;for(var u=0;u<e.options.gutters.length;++u){var p=a.gutters.childNodes[u];if(p&&p.getBoundingClientRect().right>=o){var c=Tn(e.doc,s),d=e.options.gutters[u];return n(e,r,e,c,d,t),Hn(t)}}}function Ar(e,t){return Tr(e,t,"gutterClick",!0,Wn)}function Sr(e){var t=this;if(!zn(t,e)&&!gr(t.display,e)){Ws(e),Bo&&(us=+new Date);var r=vr(t,e,!0),i=e.dataTransfer.files;if(r&&!fr(t))if(i&&i.length&&window.FileReader&&window.File)for(var n=i.length,o=Array(n),s=0,a=function(e,i){var a=new FileReader;a.onload=Zt(t,function(){if(o[i]=a.result,++s==n){r=Z(t.doc,r);var e={from:r,to:r,text:Ea(o.join("\n")),origin:"paste"};Xr(t.doc,e),at(t.doc,Y(r,fs(e)))}}),a.readAsText(e)},l=0;n>l;++l)a(i[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(no(Er,t),20);try{var o=e.dataTransfer.getData("Text");if(o){var u=t.state.draggingText&&t.listSelections();if(ut(t.doc,Y(r,r)),u)for(var l=0;l<u.length;++l)Jr(t.doc,"",u[l].anchor,u[l].head,"drag");t.replaceSelection(o,"around","paste"),Er(t)}}catch(e){}}}}function yr(e,t){if(Bo&&(!e.state.draggingText||+new Date-us<100))return void zs(t);if(!zn(e,t)&&!gr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!jo)){var r=ao("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Fo&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),Fo&&r.parentNode.removeChild(r)}}function Cr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Do||I(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbarV.scrollTop!=t&&(e.display.scrollbarV.scrollTop=t),Do&&I(e),vt(e,100))}function Rr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,v(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbarH.scrollLeft!=t&&(e.display.scrollbarH.scrollLeft=t))}function Or(e,t){var r=t.wheelDeltaX,i=t.wheelDeltaY;null==r&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(r=t.detail),null==i&&t.detail&&t.axis==t.VERTICAL_AXIS?i=t.detail:null==i&&(i=t.wheelDelta);var n=e.display,o=n.scroller;if(r&&o.scrollWidth>o.clientWidth||i&&o.scrollHeight>o.clientHeight){if(i&&Yo&&Uo)e:for(var s=t.target,a=n.view;s!=o;s=s.parentNode)for(var l=0;l<a.length;l++)if(a[l].node==s){e.display.currentWheelTarget=s;break e}if(r&&!Do&&!Fo&&null!=cs)return i&&Cr(e,Math.max(0,Math.min(o.scrollTop+i*cs,o.scrollHeight-o.clientHeight))),Rr(e,Math.max(0,Math.min(o.scrollLeft+r*cs,o.scrollWidth-o.clientWidth))),Ws(t),void(n.wheelStartX=null);if(i&&null!=cs){var u=i*cs,p=e.doc.scrollTop,c=p+n.wrapper.clientHeight;0>u?p=Math.max(0,p+u-50):c=Math.min(e.doc.height,c+u+50),I(e,{top:p,bottom:c})}20>ps&&(null==n.wheelStartX?(n.wheelStartX=o.scrollLeft,n.wheelStartY=o.scrollTop,n.wheelDX=r,n.wheelDY=i,setTimeout(function(){if(null!=n.wheelStartX){var e=o.scrollLeft-n.wheelStartX,t=o.scrollTop-n.wheelStartY,r=t&&n.wheelDY&&t/n.wheelDY||e&&n.wheelDX&&e/n.wheelDX;n.wheelStartX=n.wheelStartY=null,r&&(cs=(cs*ps+r)/(ps+1),++ps)}},200)):(n.wheelDX+=r,n.wheelDY+=i))}}function br(e,t,r){if("string"==typeof t&&(t=ys[t],!t))return!1;e.display.pollingFast&&cr(e)&&(e.display.pollingFast=!1);var i=e.display.shift,n=!1;try{fr(e)&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),n=t(e)!=Qs}finally{e.display.shift=i,e.state.suppressEdits=!1}return n}function Pr(e){var t=e.state.keyMaps.slice(0);return e.options.extraKeys&&t.push(e.options.extraKeys),t.push(e.options.keyMap),t}function Dr(e,t){var r=hi(e.options.keyMap),i=r.auto;clearTimeout(ds),i&&!Os(t)&&(ds=setTimeout(function(){hi(e.options.keyMap)==r&&(e.options.keyMap=i.call?i.call(null,e):i,a(e))},50));var n=bs(t,!0),o=!1;if(!n)return!1;var s=Pr(e);return o=t.shiftKey?Rs("Shift-"+n,s,function(t){return br(e,t,!0)})||Rs(n,s,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?br(e,t):void 0}):Rs(n,s,function(t){return br(e,t)}),o&&(Ws(t),gt(e),Wn(e,"keyHandled",e,n,t)),o}function _r(e,t,r){var i=Rs("'"+r+"'",Pr(e),function(t){return br(e,t,!0)});return i&&(Ws(t),gt(e),Wn(e,"keyHandled",e,"'"+r+"'",t)),i}function Mr(e){var t=this;if(hr(t),!zn(t,e)){_o&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=Dr(t,e);Fo&&(hs=i?r:null,!i&&88==r&&!fa&&(Yo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||Gr(t) }}function Gr(e){function t(e){18!=e.keyCode&&e.altKey||(ho(r,"CodeMirror-crosshair"),Ks(document,"keyup",t),Ks(document,"mouseover",t))}var r=e.display.lineDiv;fo(r,"CodeMirror-crosshair"),Xs(document,"keyup",t),Xs(document,"mouseover",t)}function wr(e){zn(this,e)||16==e.keyCode&&(this.doc.sel.shift=!1)}function kr(e){var t=this;if(!zn(t,e)){var r=e.keyCode,i=e.charCode;if(Fo&&r==hs)return hs=null,void Ws(e);if(!(Fo&&(!e.which||e.which<10)||Wo)||!Dr(t,e)){var n=String.fromCharCode(null==i?r:i);_r(t,e,n)||(Bo&&!Go&&(t.display.inputHasSelection=null),pr(t))}}}function Br(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(Ys(e,"focus",e),e.state.focused=!0,fo(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu!=e.doc.sel||(dr(e),Uo&&setTimeout(no(dr,e,!0),0))),ur(e),gt(e))}function Ur(e){e.state.focused&&(Ys(e,"blur",e),e.state.focused=!1,ho(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vr(e,t){function r(){if(null!=n.input.selectionStart){var t=e.somethingSelected(),r=n.input.value="​"+(t?n.input.value:"");n.prevInput=t?"":"​",n.input.selectionStart=1,n.input.selectionEnd=r.length}}function i(){if(n.inputDiv.style.position="relative",n.input.style.cssText=l,Go&&(n.scrollbarV.scrollTop=n.scroller.scrollTop=s),ur(e),null!=n.input.selectionStart){(!Bo||Go)&&r(),clearTimeout(Es);var t=0,i=function(){n.selForContextMenu==e.doc.sel&&0==n.input.selectionStart?Zt(e,ys.selectAll)(e):t++<10?Es=setTimeout(i,500):dr(e)};Es=setTimeout(i,200)}}if(!zn(e,t,"contextmenu")){var n=e.display;if(!gr(n,t)&&!Hr(e,t)){var o=vr(e,t),s=n.scroller.scrollTop;if(o&&!Fo){var a=e.options.resetSelectionOnContextMenu;a&&-1==e.doc.sel.contains(o)&&Zt(e,lt)(e.doc,Y(o),Js);var l=n.input.style.cssText;if(n.inputDiv.style.position="absolute",n.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: "+(Bo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Er(e),dr(e),e.somethingSelected()||(n.input.value=n.prevInput=" "),n.selForContextMenu=e.doc.sel,Bo&&!Go&&r(),Jo){zs(t);var u=function(){Ks(window,"mouseup",u),setTimeout(i,20)};Xs(window,"mouseup",u)}else setTimeout(i,50)}}}}function Hr(e,t){return Kn(e,"gutterContextMenu")?Tr(e,t,"gutterContextMenu",!1,Ys):!1}function Fr(e,t){if(is(e,t.from)<0)return e;if(is(e,t.to)<=0)return fs(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=fs(t).ch-t.to.ch),rs(r,i)}function jr(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var n=e.sel.ranges[i];r.push(new X(Fr(n.anchor,t),Fr(n.head,t)))}return K(r,e.sel.primIndex)}function Wr(e,t,r){return e.line==t.line?rs(r.line,e.ch-t.ch+r.ch):rs(r.line+(e.line-t.line),e.ch)}function qr(e,t,r){for(var i=[],n=rs(e.first,0),o=n,s=0;s<t.length;s++){var a=t[s],l=Wr(a.from,n,o),u=Wr(fs(a),n,o);if(n=a.to,o=u,"around"==r){var p=e.sel.ranges[s],c=is(p.head,p.anchor)<0;i[s]=new X(c?u:l,c?l:u)}else i[s]=new X(l,l)}return new z(i,e.sel.primIndex)}function zr(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return r&&(i.update=function(t,r,i,n){t&&(this.from=Z(e,t)),r&&(this.to=Z(e,r)),i&&(this.text=i),void 0!==n&&(this.origin=n)}),Ys(e,"beforeChange",e,i),e.cm&&Ys(e.cm,"beforeChange",e.cm,i),i.canceled?null:{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Xr(e,t,r){if(e.cm){if(!e.cm.curOp)return Zt(e.cm,Xr)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Kn(e,"beforeChange")||e.cm&&Kn(e.cm,"beforeChange"))||(t=zr(e,t,!0))){var i=es&&!r&&Oi(e,t.from,t.to);if(i)for(var n=i.length-1;n>=0;--n)Kr(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text});else Kr(e,t)}}function Kr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=is(t.from,t.to)){var r=jr(e,t);bn(e,t,r,e.cm?e.cm.curOp.id:0/0),Zr(e,t,r,yi(e,t));var i=[];mn(e,function(e,r){r||-1!=eo(i,e.history)||(Vn(e.history,t),i.push(e.history)),Zr(e,t,null,yi(e,t))})}}function Yr(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var i,n=e.history,o=e.sel,s="undo"==t?n.done:n.undone,a="undo"==t?n.undone:n.done,l=0;l<s.length&&(i=s[l],r?!i.ranges||i.equals(e.sel):i.ranges);l++);if(l!=s.length){for(n.lastOrigin=n.lastSelOrigin=null;i=s.pop(),i.ranges;){if(_n(i,a),r&&!i.equals(e.sel))return void lt(e,i,{clearRedo:!1});o=i}var u=[];_n(o,a),a.push({changes:u,generation:n.generation}),n.generation=i.generation||++n.maxGeneration;for(var p=Kn(e,"beforeChange")||e.cm&&Kn(e.cm,"beforeChange"),l=i.changes.length-1;l>=0;--l){var c=i.changes[l];if(c.origin=t,p&&!zr(e,c,!1))return void(s.length=0);u.push(Cn(e,c));var d=l?jr(e,c,null):Jn(s);Zr(e,c,d,Ri(e,c)),e.cm&&oi(e.cm);var E=[];mn(e,function(e,t){t||-1!=eo(E,e.history)||(Vn(e.history,c),E.push(e.history)),Zr(e,c,null,Ri(e,c))})}}}}function $r(e,t){e.first+=t,e.sel=new z(to(e.sel.ranges,function(e){return new X(rs(e.anchor.line+t,e.anchor.ch),rs(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm&&rr(e.cm,e.first,e.first-t,t)}function Zr(e,t,r,i){if(e.cm&&!e.cm.curOp)return Zt(e.cm,Zr)(e,t,r,i);if(t.to.line<e.first)return void $r(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);$r(e,n),t={from:rs(e.first,0),to:rs(t.to.line+n,t.to.ch),text:[Jn(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:rs(o,vn(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=xn(e,t.from,t.to),r||(r=jr(e,t,null)),e.cm?Qr(e.cm,t,i):En(e,t,i),ut(e,r,Js)}}function Qr(e,t,r){var i=e.doc,n=e.display,s=t.from,a=t.to,l=!1,u=s.line;e.options.lineWrapping||(u=In(Ui(vn(i,s.line))),i.iter(u,a.line+1,function(e){return e==n.maxLine?(l=!0,!0):void 0})),i.sel.contains(t.from,t.to)>-1&&Xn(e),En(i,t,r,o(e)),e.options.lineWrapping||(i.iter(u,s.line+t.text.length,function(e){var t=d(e);t>n.maxLineLength&&(n.maxLine=e,n.maxLineLength=t,n.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),i.frontier=Math.min(i.frontier,s.line),vt(e,400);var p=t.text.length-(a.line-s.line)-1;s.line!=a.line||1!=t.text.length||dn(e.doc,t)?rr(e,s.line,a.line+1,p):ir(e,s.line,"text");var c=Kn(e,"changes"),E=Kn(e,"change");if(E||c){var h={from:s,to:a,text:t.text,removed:t.removed,origin:t.origin};E&&Wn(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}}function Jr(e,t,r,i,n){if(i||(i=r),is(i,r)<0){var o=i;i=r,r=o}"string"==typeof t&&(t=Ea(t)),Xr(e,{from:r,to:i,text:t,origin:n})}function ei(e,t){var r=e.display,i=r.sizer.getBoundingClientRect(),n=null;if(t.top+i.top<0?n=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),null!=n&&!zo){var o=ao("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset-It(e.display))+"px; height: "+(t.bottom-t.top+Zs)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(n),e.display.lineSpace.removeChild(o)}}function ti(e,t,r,i){for(null==i&&(i=0);;){var n=!1,o=Ht(e,t),s=r&&r!=t?Ht(e,r):o,a=ii(e,Math.min(o.left,s.left),Math.min(o.top,s.top)-i,Math.max(o.left,s.left),Math.max(o.bottom,s.bottom)+i),l=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=a.scrollTop&&(Cr(e,a.scrollTop),Math.abs(e.doc.scrollTop-l)>1&&(n=!0)),null!=a.scrollLeft&&(Rr(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(n=!0)),!n)return o}}function ri(e,t,r,i,n){var o=ii(e,t,r,i,n);null!=o.scrollTop&&Cr(e,o.scrollTop),null!=o.scrollLeft&&Rr(e,o.scrollLeft)}function ii(e,t,r,i,n){var o=e.display,s=zt(e.display);0>r&&(r=0);var a=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=o.scroller.clientHeight-Zs,u={},p=e.doc.height+Tt(o),c=s>r,d=n>p-s;if(a>r)u.scrollTop=c?0:r;else if(n>a+l){var E=Math.min(r,(d?p:n)-l);E!=a&&(u.scrollTop=E)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,f=o.scroller.clientWidth-Zs;t+=o.gutters.offsetWidth,i+=o.gutters.offsetWidth;var m=o.gutters.offsetWidth,g=m+10>t;return h+m>t||g?(g&&(t=0),u.scrollLeft=Math.max(0,t-10-m)):i>f+h-3&&(u.scrollLeft=i+10-f),u}function ni(e,t,r){(null!=t||null!=r)&&si(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function oi(e){si(e);var t=e.getCursor(),r=t,i=t;e.options.lineWrapping||(r=t.ch?rs(t.line,t.ch-1):t,i=rs(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:i,margin:e.options.cursorScrollMargin,isCursor:!0}}function si(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Ft(e,t.from),i=Ft(e,t.to),n=ii(e,Math.min(r.left,i.left),Math.min(r.top,i.top)-t.margin,Math.max(r.right,i.right),Math.max(r.bottom,i.bottom)+t.margin);e.scrollTo(n.scrollLeft,n.scrollTop)}}function ai(e,t,r,i){var n,o=e.doc;null==r&&(r="add"),"smart"==r&&(e.doc.mode.indent?n=Lt(e,t):r="prev");var s=e.options.tabSize,a=vn(o,t),l=ra(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,p=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==r&&(u=e.doc.mode.indent(n,a.text.slice(p.length),a.text),u==Qs)){if(!i)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?ra(vn(o,t-1).text,null,s):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var c="",d=0;if(e.options.indentWithTabs)for(var E=Math.floor(u/s);E;--E)d+=s,c+=" ";if(u>d&&(c+=Qn(u-d)),c!=p)Jr(e.doc,c,rs(t,0),rs(t,p.length),"+input");else for(var E=0;E<o.sel.ranges.length;E++){var h=o.sel.ranges[E];if(h.head.line==t&&h.head.ch<p.length){var d=rs(t,p.length);nt(o,E,new X(d,d));break}}a.stateAfter=null}function li(e,t,r,i){var n=t,o=t,s=e.doc;return"number"==typeof t?o=vn(s,$(s,t)):n=In(t),null==n?null:(i(o,n)&&ir(e,n,r),o)}function ui(e,t){for(var r=e.doc.sel.ranges,i=[],n=0;n<r.length;n++){for(var o=t(r[n]);i.length&&is(o.from,Jn(i).to)<=0;){var s=i.pop();if(is(s.from,o.from)<0){o.from=s.from;break}}i.push(o)}$t(e,function(){for(var t=i.length-1;t>=0;t--)Jr(e.doc,"",i[t].from,i[t].to,"+delete");oi(e)})}function pi(e,t,r,i,n){function o(){var t=a+r;return t<e.first||t>=e.first+e.size?c=!1:(a=t,p=vn(e,t))}function s(e){var t=(n?bo:Po)(p,l,r,!0);if(null==t){if(e||!o())return c=!1;l=n?(0>r?Ao:To)(p):0>r?p.text.length:0}else l=t;return!0}var a=t.line,l=t.ch,u=r,p=vn(e,a),c=!0;if("char"==i)s();else if("column"==i)s(!0);else if("word"==i||"group"==i)for(var d=null,E="group"==i,h=!0;!(0>r)||s(!h);h=!1){var f=p.text.charAt(l)||"\n",m=aa(f)?"w":E&&"\n"==f?"n":!E||/\s/.test(f)?null:"p";if(!E||h||m||(m="s"),d&&d!=m){0>r&&(r=1,s());break}if(m&&(d=m),r>0&&!s(!h))break}var g=Et(e,rs(a,l),u,!0);return c||(g.hitSide=!0),g}function ci(e,t,r,i){var n,o=e.doc,s=t.left;if("page"==i){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);n=t.top+r*(a-(0>r?1.5:.5)*zt(e.display))}else"line"==i&&(n=r>0?t.bottom+3:t.top-3);for(;;){var l=Wt(e,s,n);if(!l.outside)break;if(0>r?0>=n:n>=o.height){l.hitSide=!0;break}n+=5*r}return l}function di(e,t){var r=vn(e,t.line).text,i=t.ch,n=t.ch;if(r){(t.xRel<0||n==r.length)&&i?--i:++n;for(var o=r.charAt(i),s=aa(o)?aa:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!aa(e)};i>0&&s(r.charAt(i-1));)--i;for(;n<r.length&&s(r.charAt(n));)++n}return new X(rs(t.line,i),rs(t.line,n))}function Ei(t,r,i,n){e.defaults[t]=r,i&&(gs[t]=n?function(e,t,r){r!=vs&&i(e,t,r)}:i)}function hi(e){return"string"==typeof e?Cs[e]:e}function fi(e,t,r,i,n){if(i&&i.shared)return mi(e,t,r,i,n);if(e.cm&&!e.cm.curOp)return Zt(e.cm,fi)(e,t,r,i,n);var o=new Ds(e,n),s=is(t,r);if(i&&io(i,o,!1),s>0||0==s&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ao("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||(o.widgetNode.ignoreEvents=!0),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Bi(e,t.line,t,r,o)||t.line!=r.line&&Bi(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ts=!0}o.addToHistory&&bn(e,{from:t,to:r,origin:"markText"},e.sel,0/0);var a,l=t.line,u=e.cm;if(e.iter(l,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&Ui(e)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&Ln(e,0),Ti(e,new Ni(o,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l}),o.collapsed&&e.iter(t.line,r.line+1,function(t){ji(e,t)&&Ln(t,0)}),o.clearOnEnter&&Xs(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(es=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++_s,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)rr(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle)for(var p=t.line;p<=r.line;p++)ir(u,p,"text");o.atomic&&ct(u.doc),Wn(u,"markerAdded",u,o)}return o}function mi(e,t,r,i,n){i=io(i),i.shared=!1;var o=[fi(e,t,r,i,n)],s=o[0],a=i.widgetNode;return mn(e,function(e){a&&(i.widgetNode=a.cloneNode(!0)),o.push(fi(e,Z(e,t),Z(e,r),i,n));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=Jn(o)}),new Ms(o,s)}function gi(e){return e.findMarks(rs(e.first,0),e.clipPos(rs(e.lastLine())),function(e){return e.parent})}function vi(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=i.find(),o=e.clipPos(n.from),s=e.clipPos(n.to);if(is(o,s)){var a=fi(e,o,s,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}function xi(e){for(var t=0;t<e.length;t++){var r=e[t],i=[r.primary.doc];mn(r.primary.doc,function(e){i.push(e)});for(var n=0;n<r.markers.length;n++){var o=r.markers[n];-1==eo(i,o.doc)&&(o.parent=null,r.markers.splice(n--,1))}}}function Ni(e,t,r){this.marker=e,this.from=t,this.to=r}function Li(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function Ii(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r||(r=[])).push(e[i]);return r}function Ti(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ai(e,t,r){if(e)for(var i,n=0;n<e.length;++n){var o=e[n],s=o.marker,a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&"bookmark"==s.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Ni(s,o.from,l?null:o.to))}}return i}function Si(e,t,r){if(e)for(var i,n=0;n<e.length;++n){var o=e[n],s=o.marker,a=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&"bookmark"==s.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Ni(s,l?null:o.from-t,null==o.to?null:o.to-t))}}return i}function yi(e,t){var r=J(e,t.from.line)&&vn(e,t.from.line).markedSpans,i=J(e,t.to.line)&&vn(e,t.to.line).markedSpans;if(!r&&!i)return null;var n=t.from.ch,o=t.to.ch,s=0==is(t.from,t.to),a=Ai(r,n,s),l=Si(i,o,s),u=1==t.text.length,p=Jn(t.text).length+(u?n:0);if(a)for(var c=0;c<a.length;++c){var d=a[c];if(null==d.to){var E=Li(l,d.marker);E?u&&(d.to=null==E.to?null:E.to+p):d.to=n}}if(l)for(var c=0;c<l.length;++c){var d=l[c];if(null!=d.to&&(d.to+=p),null==d.from){var E=Li(a,d.marker);E||(d.from=p,u&&(a||(a=[])).push(d))}else d.from+=p,u&&(a||(a=[])).push(d)}a&&(a=Ci(a)),l&&l!=a&&(l=Ci(l));var h=[a];if(!u){var f,m=t.text.length-2;if(m>0&&a)for(var c=0;c<a.length;++c)null==a[c].to&&(f||(f=[])).push(new Ni(a[c].marker,null,null));for(var c=0;m>c;++c)h.push(f);h.push(l)}return h}function Ci(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ri(e,t){var r=wn(e,t),i=yi(e,t);if(!r)return i;if(!i)return r;for(var n=0;n<r.length;++n){var o=r[n],s=i[n];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else s&&(r[n]=s)}return r}function Oi(e,t,r){var i=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||i&&-1!=eo(i,r)||(i||(i=[])).push(r)}}),!i)return null;for(var n=[{from:t,to:r}],o=0;o<i.length;++o)for(var s=i[o],a=s.find(0),l=0;l<n.length;++l){var u=n[l];if(!(is(u.to,a.from)<0||is(u.from,a.to)>0)){var p=[l,1],c=is(u.from,a.from),d=is(u.to,a.to);(0>c||!s.inclusiveLeft&&!c)&&p.push({from:u.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&p.push({from:a.to,to:u.to}),n.splice.apply(n,p),l+=p.length-1}}return n}function bi(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Pi(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Di(e){return e.inclusiveLeft?-1:0}function _i(e){return e.inclusiveRight?1:0}function Mi(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var i=e.find(),n=t.find(),o=is(i.from,n.from)||Di(e)-Di(t);if(o)return-o;var s=is(i.to,n.to)||_i(e)-_i(t);return s?s:t.id-e.id}function Gi(e,t){var r,i=ts&&e.markedSpans;if(i)for(var n,o=0;o<i.length;++o)n=i[o],n.marker.collapsed&&null==(t?n.from:n.to)&&(!r||Mi(r,n.marker)<0)&&(r=n.marker);return r}function wi(e){return Gi(e,!0)}function ki(e){return Gi(e,!1)}function Bi(e,t,r,i,n){var o=vn(e,t),s=ts&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var u=l.marker.find(0),p=is(u.from,r)||Di(l.marker)-Di(n),c=is(u.to,i)||_i(l.marker)-_i(n);if(!(p>=0&&0>=c||0>=p&&c>=0)&&(0>=p&&(is(u.to,r)||_i(l.marker)-Di(n))>0||p>=0&&(is(u.from,i)||Di(l.marker)-_i(n))<0))return!0}}}function Ui(e){for(var t;t=wi(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t,r;t=ki(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Hi(e,t){var r=vn(e,t),i=Ui(r);return r==i?t:In(i)}function Fi(e,t){if(t>e.lastLine())return t;var r,i=vn(e,t);if(!ji(e,i))return t;for(;r=ki(i);)i=r.find(1,!0).line;return In(i)+1}function ji(e,t){var r=ts&&t.markedSpans;if(r)for(var i,n=0;n<r.length;++n)if(i=r[n],i.marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&Wi(e,t,i))return!0}}function Wi(e,t,r){if(null==r.to){var i=r.marker.find(1,!0);return Wi(e,i.line,Li(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var n,o=0;o<t.markedSpans.length;++o)if(n=t.markedSpans[o],n.marker.collapsed&&!n.marker.widgetNode&&n.from==r.to&&(null==n.to||n.to!=r.from)&&(n.marker.inclusiveLeft||r.marker.inclusiveRight)&&Wi(e,t,n))return!0}function qi(e,t,r){An(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ni(e,null,r)}function zi(e){return null!=e.height?e.height:(po(document.body,e.node)||uo(e.cm.display.measure,ao("div",[e.node],null,"position: relative")),e.height=e.node.offsetHeight)}function Xi(e,t,r,i){var n=new Gs(e,r,i);return n.noHScroll&&(e.display.alignWidgets=!0),li(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==n.insertAt?r.push(n):r.splice(Math.min(r.length-1,Math.max(0,n.insertAt)),0,n),n.line=t,!ji(e.doc,t)){var i=An(t)<e.doc.scrollTop;Ln(t,t.height+zi(n)),i&&ni(e,null,n.height),e.curOp.forceUpdate=!0}return!0}),n}function Ki(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),bi(e),Pi(e,r);var n=i?i(e):1;n!=e.height&&Ln(e,n)}function Yi(e){e.parent=null,bi(e)}function $i(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";null==t[i]?t[i]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[i])||(t[i]+=" "+r[2])}return e}function Zi(t,r){if(t.blankLine)return t.blankLine(r);if(t.innerMode){var i=e.innerMode(t,r);return i.mode.blankLine?i.mode.blankLine(i.state):void 0}}function Qi(e,t,r){var i=e.token(t,r);if(t.pos<=t.start)throw new Error("Mode "+e.name+" failed to advance stream.");return i}function Ji(t,r,i,n,o,s,a){var l=i.flattenSpans;null==l&&(l=t.options.flattenSpans);var u,p=0,c=null,d=new Ps(r,t.options.tabSize);for(""==r&&$i(Zi(i,n),s);!d.eol();){if(d.pos>t.options.maxHighlightLength?(l=!1,a&&rn(t,r,n,d.pos),d.pos=r.length,u=null):u=$i(Qi(i,d,n),s),t.options.addModeClass){var E=e.innerMode(i,n).mode.name;E&&(u="m-"+(u?E+" "+u:E))}l&&c==u||(p<d.start&&o(d.start,c),p=d.start,c=u),d.start=d.pos}for(;p<d.pos;){var h=Math.min(d.pos,p+5e4);o(h,c),p=h}}function en(e,t,r,i){var n=[e.state.modeGen],o={};Ji(e,t.text,e.doc.mode,r,function(e,t){n.push(e,t)},o,i);for(var s=0;s<e.state.overlays.length;++s){var a=e.state.overlays[s],l=1,u=0;Ji(e,t.text,a.mode,!0,function(e,t){for(var r=l;e>u;){var i=n[l];i>e&&n.splice(l,1,e,n[l+1],i),l+=2,u=Math.min(e,i)}if(t)if(a.opaque)n.splice(r,l-r,e,"cm-overlay "+t),l=r+2;else for(;l>r;r+=2){var o=n[r+1];n[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:n,classes:o.bgClass||o.textClass?o:null}}function tn(e,t){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=en(e,t,t.stateAfter=Lt(e,In(t)));t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null)}return t.styles}function rn(e,t,r,i){var n=e.doc.mode,o=new Ps(t,e.options.tabSize);for(o.start=o.pos=i||0,""==t&&Zi(n,r);!o.eol()&&o.pos<=e.options.maxHighlightLength;)Qi(n,o,r),o.start=o.pos}function nn(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Bs:ks;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function on(e,t){var r=ao("span",null,null,Uo?"padding-right: .1px":null),i={pre:ao("pre",[r]),content:r,col:0,pos:0,cm:e};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o,s=n?t.rest[n-1]:t.line;i.pos=0,i.addToken=an,(Bo||Uo)&&e.getOption("lineWrapping")&&(i.addToken=ln(i.addToken)),xo(e.display.measure)&&(o=Sn(s))&&(i.addToken=un(i.addToken,o)),i.map=[],cn(s,i,tn(e,s)),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=mo(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=mo(s.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(vo(e.display.measure))),0==n?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return Ys(e,"renderLine",e,t.line,i.pre),i}function sn(e){var t=ao("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t}function an(e,t,r,i,n,o){if(t){var s=e.cm.options.specialChars,a=!1;if(s.test(t))for(var l=document.createDocumentFragment(),u=0;;){s.lastIndex=u;var p=s.exec(t),c=p?p.index-u:t.length-u;if(c){var d=document.createTextNode(t.slice(u,u+c));l.appendChild(Go?ao("span",[d]):d),e.map.push(e.pos,e.pos+c,d),e.col+=c,e.pos+=c}if(!p)break;if(u+=c+1," "==p[0]){var E=e.cm.options.tabSize,h=E-e.col%E,d=l.appendChild(ao("span",Qn(h),"cm-tab"));e.col+=h}else{var d=e.cm.options.specialCharPlaceholder(p[0]);l.appendChild(Go?ao("span",[d]):d),e.col+=1}e.map.push(e.pos,e.pos+1,d),e.pos++}else{e.col+=t.length;var l=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,l),Go&&(a=!0),e.pos+=t.length}if(r||i||n||a){var f=r||"";i&&(f+=i),n&&(f+=n);var m=ao("span",[l],f);return o&&(m.title=o),e.content.appendChild(m)}e.content.appendChild(l)}}function ln(e){function t(e){for(var t=" ",r=0;r<e.length-2;++r)t+=r%2?" ":" ";return t+=" "}return function(r,i,n,o,s,a){e(r,i.replace(/ {3,}/g,t),n,o,s,a)}}function un(e,t){return function(r,i,n,o,s,a){n=n?n+" cm-force-border":"cm-force-border";for(var l=r.pos,u=l+i.length;;){for(var p=0;p<t.length;p++){var c=t[p];if(c.to>l&&c.from<=l)break}if(c.to>=u)return e(r,i,n,o,s,a);e(r,i.slice(0,c.to-l),n,o,null,a),o=null,i=i.slice(c.to-l),l=c.to}}}function pn(e,t,r,i){var n=!i&&r.widgetNode;n&&(e.map.push(e.pos,e.pos+t,n),e.content.appendChild(n)),e.pos+=t}function cn(e,t,r){var i=e.markedSpans,n=e.text,o=0;if(i)for(var s,a,l,u,p,c,d=n.length,E=0,h=1,f="",m=0;;){if(m==E){a=l=u=p="",c=null,m=1/0;for(var g=[],v=0;v<i.length;++v){var x=i[v],N=x.marker;x.from<=E&&(null==x.to||x.to>E)?(null!=x.to&&m>x.to&&(m=x.to,l=""),N.className&&(a+=" "+N.className),N.startStyle&&x.from==E&&(u+=" "+N.startStyle),N.endStyle&&x.to==m&&(l+=" "+N.endStyle),N.title&&!p&&(p=N.title),N.collapsed&&(!c||Mi(c.marker,N)<0)&&(c=x)):x.from>E&&m>x.from&&(m=x.from),"bookmark"==N.type&&x.from==E&&N.widgetNode&&g.push(N)}if(c&&(c.from||0)==E&&(pn(t,(null==c.to?d+1:c.to)-E,c.marker,null==c.from),null==c.to))return;if(!c&&g.length)for(var v=0;v<g.length;++v)pn(t,0,g[v])}if(E>=d)break;for(var L=Math.min(d,m);;){if(f){var I=E+f.length;if(!c){var T=I>L?f.slice(0,L-E):f;t.addToken(t,T,s?s+a:a,u,E+T.length==m?l:"",p)}if(I>=L){f=f.slice(L-E),E=L;break}E=I,u=""}f=n.slice(o,o=r[h++]),s=nn(r[h++],t.cm.options)}}else for(var h=1;h<r.length;h+=2)t.addToken(t,n.slice(o,o=r[h]),nn(r[h+1],t.cm.options))}function dn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Jn(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function En(e,t,r,i){function n(e){return r?r[e]:null}function o(e,r,n){Ki(e,r,n,i),Wn(e,"change",e,t)}var s=t.from,a=t.to,l=t.text,u=vn(e,s.line),p=vn(e,a.line),c=Jn(l),d=n(l.length-1),E=a.line-s.line;if(dn(e,t)){for(var h=0,f=[];h<l.length-1;++h)f.push(new ws(l[h],n(h),i));o(p,p.text,d),E&&e.remove(s.line,E),f.length&&e.insert(s.line,f)}else if(u==p)if(1==l.length)o(u,u.text.slice(0,s.ch)+c+u.text.slice(a.ch),d);else{for(var f=[],h=1;h<l.length-1;++h)f.push(new ws(l[h],n(h),i));f.push(new ws(c+u.text.slice(a.ch),d,i)),o(u,u.text.slice(0,s.ch)+l[0],n(0)),e.insert(s.line+1,f)}else if(1==l.length)o(u,u.text.slice(0,s.ch)+l[0]+p.text.slice(a.ch),n(0)),e.remove(s.line+1,E);else{o(u,u.text.slice(0,s.ch)+l[0],n(0)),o(p,c+p.text.slice(a.ch),d);for(var h=1,f=[];h<l.length-1;++h)f.push(new ws(l[h],n(h),i));E>1&&e.remove(s.line+1,E-1),e.insert(s.line+1,f)}Wn(e,"change",e,t)}function hn(e){this.lines=e,this.parent=null;for(var t=0,r=0;t<e.length;++t)e[t].parent=this,r+=e[t].height;this.height=r}function fn(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var n=e[i];t+=n.chunkSize(),r+=n.height,n.parent=this}this.size=t,this.height=r,this.parent=null}function mn(e,t,r){function i(e,n,o){if(e.linked)for(var s=0;s<e.linked.length;++s){var a=e.linked[s];if(a.doc!=n){var l=o&&a.sharedHist;(!r||l)&&(t(a.doc,l),i(a.doc,e,l))}}}i(e,null,!0)}function gn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,s(e),r(e),e.options.lineWrapping||E(e),e.options.mode=t.modeOption,rr(e)}function vn(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var i=0;;++i){var n=r.children[i],o=n.chunkSize();if(o>t){r=n;break}t-=o}return r.lines[t]}function xn(e,t,r){var i=[],n=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;n==r.line&&(o=o.slice(0,r.ch)),n==t.line&&(o=o.slice(t.ch)),i.push(o),++n}),i}function Nn(e,t,r){var i=[];return e.iter(t,r,function(e){i.push(e.text)}),i}function Ln(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function In(e){if(null==e.parent)return null;for(var t=e.parent,r=eo(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var n=0;i.children[n]!=t;++n)r+=i.children[n].chunkSize();return r+t.first}function Tn(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var n=e.children[i],o=n.height;if(o>t){e=n;continue e}t-=o,r+=n.chunkSize()}return r}while(!e.lines);for(var i=0;i<e.lines.length;++i){var s=e.lines[i],a=s.height;if(a>t)break;t-=a}return r+i}function An(e){e=Ui(e);for(var t=0,r=e.parent,i=0;i<r.lines.length;++i){var n=r.lines[i];if(n==e)break;t+=n.height}for(var o=r.parent;o;r=o,o=r.parent)for(var i=0;i<o.children.length;++i){var s=o.children[i];if(s==r)break;t+=s.height}return t}function Sn(e){var t=e.order;return null==t&&(t=e.order=va(e.text)),t}function yn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Cn(e,t){var r={from:j(t.from),to:fs(t),text:xn(e,t.from,t.to)};return Mn(e,r,t.from.line,t.to.line+1),mn(e,function(e){Mn(e,r,t.from.line,t.to.line+1)},!0),r}function Rn(e){for(;e.length;){var t=Jn(e);if(!t.ranges)break;e.pop()}}function On(e,t){return t?(Rn(e.done),Jn(e.done)):e.done.length&&!Jn(e.done).ranges?Jn(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Jn(e.done)):void 0}function bn(e,t,r,i){var n=e.history;n.undone.length=0;var o,s=+new Date;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&n.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=On(n,n.lastOp==i))){var a=Jn(o.changes);0==is(t.from,t.to)&&0==is(t.from,a.to)?a.to=fs(t):o.changes.push(Cn(e,t))}else{var l=Jn(n.done);for(l&&l.ranges||_n(e.sel,n.done),o={changes:[Cn(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(r),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=s,n.lastOp=i,n.lastOrigin=n.lastSelOrigin=t.origin,a||Ys(e,"historyAdded")}function Pn(e,t,r,i){var n=t.charAt(0);return"*"==n||"+"==n&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Dn(e,t,r,i){var n=e.history,o=i&&i.origin;r==n.lastOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Pn(e,o,Jn(n.done),t))?n.done[n.done.length-1]=t:_n(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastOp=r,i&&i.clearRedo!==!1&&Rn(n.undone)}function _n(e,t){var r=Jn(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Mn(e,t,r,i){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),function(r){r.markedSpans&&((n||(n=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function Gn(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function wn(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=0,n=[];i<t.text.length;++i)n.push(Gn(r[i]));return n}function kn(e,t,r){for(var i=0,n=[];i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?z.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];n.push({changes:a});for(var l=0;l<s.length;++l){var u,p=s[l];if(a.push({from:p.from,to:p.to,text:p.text}),t)for(var c in p)(u=c.match(/^spans_(\d+)$/))&&eo(t,Number(u[1]))>-1&&(Jn(a)[c]=p[c],delete p[c])}}}return n}function Bn(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Un(e,t,r,i){for(var n=0;n<e.length;++n){var o=e[n],s=!0;if(o.ranges){o.copied||(o=e[n]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)Bn(o.ranges[a].anchor,t,r,i),Bn(o.ranges[a].head,t,r,i)}else{for(var a=0;a<o.changes.length;++a){var l=o.changes[a];if(r<l.from.line)l.from=rs(l.from.line+i,l.from.ch),l.to=rs(l.to.line+i,l.to.ch);else if(t<=l.to.line){s=!1;break}}s||(e.splice(0,n+1),n=0)}}}function Vn(e,t){var r=t.from.line,i=t.to.line,n=t.text.length-(i-r)-1;Un(e.done,r,i,n),Un(e.undone,r,i,n)}function Hn(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Fn(e){return e.target||e.srcElement}function jn(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Yo&&e.ctrlKey&&1==t&&(t=3),t}function Wn(e,t){function r(e){return function(){e.apply(null,n)}}var i=e._handlers&&e._handlers[t];if(i){var n=Array.prototype.slice.call(arguments,2);js||(++$s,js=[],setTimeout(qn,0));for(var o=0;o<i.length;++o)js.push(r(i[o]))}}function qn(){--$s;var e=js;js=null;for(var t=0;t<e.length;++t)e[t]()}function zn(e,t,r){return Ys(e,r||t.type,e,t),Hn(t)||t.codemirrorIgnore}function Xn(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==eo(r,t[i])&&r.push(t[i])}function Kn(e,t){var r=e._handlers&&e._handlers[t];return r&&r.length>0}function Yn(e){e.prototype.on=function(e,t){Xs(this,e,t)},e.prototype.off=function(e,t){Ks(this,e,t)}}function $n(){this.id=null}function Zn(e,t,r){for(var i=0,n=0;;){var o=e.indexOf(" ",i);-1==o&&(o=e.length);var s=o-i;if(o==e.length||n+s>=t)return i+Math.min(s,t-n);if(n+=o-i,n+=r-n%r,i=o+1,n>=t)return i}}function Qn(e){for(;ia.length<=e;)ia.push(Jn(ia)+" "); return ia[e]}function Jn(e){return e[e.length-1]}function eo(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function to(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function ro(e,t){var r;if(Object.create)r=Object.create(e);else{var i=function(){};i.prototype=e,r=new i}return t&&io(t,r),r}function io(e,t,r){t||(t={});for(var i in e)!e.hasOwnProperty(i)||r===!1&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function no(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function oo(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function so(e){return e.charCodeAt(0)>=768&&la.test(e)}function ao(e,t,r,i){var n=document.createElement(e);if(r&&(n.className=r),i&&(n.style.cssText=i),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function lo(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function uo(e,t){return lo(e).appendChild(t)}function po(e,t){if(e.contains)return e.contains(t);for(;t=t.parentNode;)if(t==e)return!0}function co(){return document.activeElement}function Eo(e){return new RegExp("\\b"+e+"\\b\\s*")}function ho(e,t){var r=Eo(t);r.test(e.className)&&(e.className=e.className.replace(r,""))}function fo(e,t){Eo(t).test(e.className)||(e.className+=" "+t)}function mo(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!Eo(r[i]).test(t)&&(t+=" "+r[i]);return t}function go(e){if(null!=ua)return ua;var t=ao("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return uo(e,t),t.offsetWidth&&(ua=t.offsetHeight-t.clientHeight),ua||0}function vo(e){if(null==pa){var t=ao("span","​");uo(e,ao("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(pa=t.offsetWidth<=1&&t.offsetHeight>2&&!Mo)}return pa?ao("span","​"):ao("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function xo(e){if(null!=ca)return ca;var t=uo(e,document.createTextNode("AخA")),r=oa(t,0,1).getBoundingClientRect();if(r.left==r.right)return!1;var i=oa(t,1,2).getBoundingClientRect();return ca=i.right-r.right<3}function No(e,t,r,i){if(!e)return i(t,r,"ltr");for(var n=!1,o=0;o<e.length;++o){var s=e[o];(s.from<r&&s.to>t||t==r&&s.to==t)&&(i(Math.max(s.from,t),Math.min(s.to,r),1==s.level?"rtl":"ltr"),n=!0)}n||i(t,r,"ltr")}function Lo(e){return e.level%2?e.to:e.from}function Io(e){return e.level%2?e.from:e.to}function To(e){var t=Sn(e);return t?Lo(t[0]):0}function Ao(e){var t=Sn(e);return t?Io(Jn(t)):e.text.length}function So(e,t){var r=vn(e.doc,t),i=Ui(r);i!=r&&(t=In(i));var n=Sn(i),o=n?n[0].level%2?Ao(i):To(i):0;return rs(t,o)}function yo(e,t){for(var r,i=vn(e.doc,t);r=ki(i);)i=r.find(1,!0).line,t=null;var n=Sn(i),o=n?n[0].level%2?To(i):Ao(i):i.text.length;return rs(null==t?In(i):t,o)}function Co(e,t,r){var i=e[0].level;return t==i?!0:r==i?!1:r>t}function Ro(e,t){ga=null;for(var r,i=0;i<e.length;++i){var n=e[i];if(n.from<t&&n.to>t)return i;if(n.from==t||n.to==t){if(null!=r)return Co(e,n.level,e[r].level)?(n.from!=n.to&&(ga=r),i):(n.from!=n.to&&(ga=i),r);r=i}}return r}function Oo(e,t,r,i){if(!i)return t+r;do t+=r;while(t>0&&so(e.text.charAt(t)));return t}function bo(e,t,r,i){var n=Sn(e);if(!n)return Po(e,t,r,i);for(var o=Ro(n,t),s=n[o],a=Oo(e,t,s.level%2?-r:r,i);;){if(a>s.from&&a<s.to)return a;if(a==s.from||a==s.to)return Ro(n,a)==o?a:(s=n[o+=r],r>0==s.level%2?s.to:s.from);if(s=n[o+=r],!s)return null;a=r>0==s.level%2?Oo(e,s.to,-1,i):Oo(e,s.from,1,i)}}function Po(e,t,r,i){var n=t+r;if(i)for(;n>0&&so(e.text.charAt(n));)n+=r;return 0>n||n>e.text.length?null:n}var Do=/gecko\/\d/i.test(navigator.userAgent),_o=/MSIE \d/.test(navigator.userAgent),Mo=_o&&(null==document.documentMode||document.documentMode<8),Go=_o&&(null==document.documentMode||document.documentMode<9),wo=_o&&(null==document.documentMode||document.documentMode<10),ko=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),Bo=_o||ko,Uo=/WebKit\//.test(navigator.userAgent),Vo=Uo&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Ho=/Chrome\//.test(navigator.userAgent),Fo=/Opera\//.test(navigator.userAgent),jo=/Apple Computer/.test(navigator.vendor),Wo=/KHTML\//.test(navigator.userAgent),qo=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),zo=/PhantomJS/.test(navigator.userAgent),Xo=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Ko=Xo||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),Yo=Xo||/Mac/.test(navigator.platform),$o=/win/i.test(navigator.platform),Zo=Fo&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Zo&&(Zo=Number(Zo[1])),Zo&&Zo>=15&&(Fo=!1,Uo=!0);var Qo=Yo&&(Vo||Fo&&(null==Zo||12.11>Zo)),Jo=Do||Bo&&!Go,es=!1,ts=!1,rs=e.Pos=function(e,t){return this instanceof rs?(this.line=e,void(this.ch=t)):new rs(e,t)},is=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch};z.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],i=e.ranges[t];if(0!=is(r.anchor,i.anchor)||0!=is(r.head,i.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new X(j(this.ranges[t].anchor),j(this.ranges[t].head));return new z(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(is(t,i.from())>=0&&is(e,i.to())<=0)return r}return-1}},X.prototype={from:function(){return q(this.anchor,this.head)},to:function(){return W(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var ns,os,ss,as={left:0,right:0,top:0,bottom:0},ls=0,us=0,ps=0,cs=null;Bo?cs=-.53:Do?cs=15:Ho?cs=-.7:jo&&(cs=-1/3);var ds,Es,hs=null,fs=e.changeEnd=function(e){return e.text?rs(e.from.line+e.text.length-1,Jn(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),Er(this),pr(this)},setOption:function(e,t){var r=this.options,i=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,gs.hasOwnProperty(e)&&Zt(this,gs[e])(this,t,i))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](e)},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||"string"!=typeof t[r]&&t[r].name==e)return t.splice(r,1),!0},addOverlay:Qt(function(t,r){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:i,modeSpec:t,opaque:r&&r.opaque}),this.state.modeGen++,rr(this)}),removeOverlay:Qt(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var i=t[r].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(r,1),this.state.modeGen++,void rr(this)}}),indentLine:Qt(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),J(this.doc,e)&&ai(this,e,t,r)}),indentSelection:Qt(function(e){for(var t=this.doc.sel.ranges,r=-1,i=0;i<t.length;i++){var n=t[i];if(n.empty())n.head.line>r&&(ai(this,n.head.line,e,!0),r=n.head.line,i==this.doc.sel.primIndex&&oi(this));else{var o=Math.max(r,n.from().line),s=n.to();r=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var a=o;r>a;++a)ai(this,a,e)}}}),getTokenAt:function(e,t){var r=this.doc;e=Z(r,e);for(var i=Lt(this,e.line,t),n=this.doc.mode,o=vn(r,e.line),s=new Ps(o.text,this.options.tabSize);s.pos<e.ch&&!s.eol();){s.start=s.pos;var a=Qi(n,s,i)}return{start:s.start,end:s.pos,string:s.current(),type:a||null,state:i}},getTokenTypeAt:function(e){e=Z(this.doc,e);var t,r=tn(this,vn(this.doc,e.line)),i=0,n=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var s=i+n>>1;if((s?r[2*s-1]:0)>=o)n=s;else{if(!(r[2*s+1]<o)){t=r[2*s+2];break}i=s+1}}var a=t?t.indexOf("cm-overlay "):-1;return 0>a?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Ts.hasOwnProperty(t))return Ts;var i=Ts[t],n=this.getModeAt(e);if("string"==typeof n[t])i[n[t]]&&r.push(i[n[t]]);else if(n[t])for(var o=0;o<n[t].length;o++){var s=i[n[t][o]];s&&r.push(s)}else n.helperType&&i[n.helperType]?r.push(i[n.helperType]):i[n.name]&&r.push(i[n.name]);for(var o=0;o<i._global.length;o++){var a=i._global[o];a.pred(n,this)&&-1==eo(r,a.val)&&r.push(a.val)}return r},getStateAfter:function(e,t){var r=this.doc;return e=$(r,null==e?r.first+r.size-1:e),Lt(this,e+1,t)},cursorCoords:function(e,t){var r,i=this.doc.sel.primary();return r=null==e?i.head:"object"==typeof e?Z(this.doc,e):e?i.from():i.to(),Ht(this,r,t||"page")},charCoords:function(e,t){return Vt(this,Z(this.doc,e),t||"page")},coordsChar:function(e,t){return e=Ut(this,e,t||"page"),Wt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Ut(this,{top:e,left:0},t||"page").top,Tn(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r=!1,i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0);var n=vn(this.doc,e);return Bt(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-An(n):0)},defaultTextHeight:function(){return zt(this.display)},defaultCharWidth:function(){return Xt(this.display)},setGutterMarker:Qt(function(e,t,r){return li(this,e,"gutter",function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=r,!r&&oo(i)&&(e.gutterMarkers=null),!0})}),clearGutter:Qt(function(e){var t=this,r=t.doc,i=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,ir(t,i,"gutter"),oo(r.gutterMarkers)&&(r.gutterMarkers=null)),++i})}),addLineClass:Qt(function(e,t,r){return li(this,e,"class",function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"wrapClass";if(e[i]){if(new RegExp("(?:^|\\s)"+r+"(?:$|\\s)").test(e[i]))return!1;e[i]+=" "+r}else e[i]=r;return!0})}),removeLineClass:Qt(function(e,t,r){return li(this,e,"class",function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"wrapClass",n=e[i];if(!n)return!1;if(null==r)e[i]=null;else{var o=n.match(new RegExp("(?:^|\\s+)"+r+"(?:$|\\s+)"));if(!o)return!1;var s=o.index+o[0].length;e[i]=n.slice(0,o.index)+(o.index&&s!=n.length?" ":"")+n.slice(s)||null}return!0})}),addLineWidget:Qt(function(e,t,r){return Xi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!J(this.doc,e))return null;var t=e;if(e=vn(this.doc,e),!e)return null}else{var t=In(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,i,n){var o=this.display;e=Ht(this,Z(this.doc,e));var s=e.bottom,a=e.left;if(t.style.position="absolute",o.sizer.appendChild(t),"over"==i)s=e.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==n?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?a=0:"middle"==n&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),r&&ri(this,a,s,a+t.offsetWidth,s+t.offsetHeight)},triggerOnKeyDown:Qt(Mr),triggerOnKeyPress:Qt(kr),triggerOnKeyUp:Qt(wr),execCommand:function(e){return ys.hasOwnProperty(e)?ys[e](this):void 0},findPosH:function(e,t,r,i){var n=1;0>t&&(n=-1,t=-t);for(var o=0,s=Z(this.doc,e);t>o&&(s=pi(this.doc,s,n,r,i),!s.hitSide);++o);return s},moveH:Qt(function(e,t){var r=this;r.extendSelectionsBy(function(i){return r.display.shift||r.doc.extend||i.empty()?pi(r.doc,i.head,e,t,r.options.rtlMoveVisually):0>e?i.from():i.to()},ta)}),deleteH:Qt(function(e,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):ui(this,function(r){var n=pi(i,r.head,e,t,!1);return 0>e?{from:n,to:r.head}:{from:r.head,to:n}})}),findPosV:function(e,t,r,i){var n=1,o=i;0>t&&(n=-1,t=-t);for(var s=0,a=Z(this.doc,e);t>s;++s){var l=Ht(this,a,"div");if(null==o?o=l.left:l.left=o,a=ci(this,l,n,r),a.hitSide)break}return a},moveV:Qt(function(e,t){var r=this,i=this.doc,n=[],o=!r.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy(function(s){if(o)return 0>e?s.from():s.to();var a=Ht(r,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),n.push(a.left);var l=ci(r,a,e,t);return"page"==t&&s==i.sel.primary()&&ni(r,null,Vt(r,l,"div").top-a.top),l},ta),n.length)for(var s=0;s<i.sel.ranges.length;s++)i.sel.ranges[s].goalColumn=n[s]}),toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?fo(this.display.cursorDiv,"CodeMirror-overwrite"):ho(this.display.cursorDiv,"CodeMirror-overwrite"),Ys(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return co()==this.display.input},scrollTo:Qt(function(e,t){(null!=e||null!=t)&&si(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller,t=Zs;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t,width:e.scrollWidth-t,clientHeight:e.clientHeight-t,clientWidth:e.clientWidth-t}},scrollIntoView:Qt(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:rs(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)si(this),this.curOp.scrollToPos=e;else{var r=ii(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:Qt(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Mt(this),this.curOp.forceUpdate=!0,Ys(this,"refresh",this)}),operation:function(e){return $t(this,e)},refresh:Qt(function(){var e=this.display.cachedTextHeight;rr(this),this.curOp.forceUpdate=!0,Gt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),c(this),(null==e||Math.abs(e-zt(this.display))>.5)&&s(this),Ys(this,"refresh",this)}),swapDoc:Qt(function(e){var t=this.doc;return t.cm=null,gn(this,e),Gt(this),dr(this),this.scrollTo(e.scrollLeft,e.scrollTop),Wn(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Yn(e);var ms=e.defaults={},gs=e.optionHandlers={},vs=e.Init={toString:function(){return"CodeMirror.Init"}};Ei("value","",function(e,t){e.setValue(t)},!0),Ei("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Ei("indentUnit",2,r,!0),Ei("indentWithTabs",!1),Ei("smartIndent",!0),Ei("tabSize",4,function(e){i(e),Gt(e),rr(e)},!0),Ei("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g"),e.refresh()},!0),Ei("specialCharPlaceholder",sn,function(e){e.refresh()},!0),Ei("electricChars",!0),Ei("rtlMoveVisually",!$o),Ei("wholeLineUpdateBefore",!0),Ei("theme","default",function(e){l(e),u(e)},!0),Ei("keyMap","default",a),Ei("extraKeys",null),Ei("lineWrapping",!1,n,!0),Ei("gutters",[],function(e){h(e.options),u(e)},!0),Ei("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Ei("coverGutterNextToScrollbar",!1,m,!0),Ei("lineNumbers",!1,function(e){h(e.options),u(e)},!0),Ei("firstLineNumber",1,u,!0),Ei("lineNumberFormatter",function(e){return e},u,!0),Ei("showCursorWhenSelecting",!1,ht,!0),Ei("resetSelectionOnContextMenu",!0),Ei("readOnly",!1,function(e,t){"nocursor"==t?(Ur(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||dr(e))}),Ei("disableInput",!1,function(e,t){t||dr(e)},!0),Ei("dragDrop",!0),Ei("cursorBlinkRate",530),Ei("cursorScrollMargin",0),Ei("cursorHeight",1),Ei("workTime",100),Ei("workDelay",100),Ei("flattenSpans",!0,i,!0),Ei("addModeClass",!1,i,!0),Ei("pollInterval",100),Ei("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Ei("historyEventDelay",1250),Ei("viewportMargin",10,function(e){e.refresh()},!0),Ei("maxHighlightLength",1e4,i,!0),Ei("moveInputWithCursor",!0,function(e,t){t||(e.display.inputDiv.style.top=e.display.inputDiv.style.left=0)}),Ei("tabindex",null,function(e,t){e.display.input.tabIndex=t||""}),Ei("autofocus",null);var xs=e.modes={},Ns=e.mimeModes={};e.defineMode=function(t,r){if(e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2){r.dependencies=[];for(var i=2;i<arguments.length;++i)r.dependencies.push(arguments[i])}xs[t]=r},e.defineMIME=function(e,t){Ns[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Ns.hasOwnProperty(t))t=Ns[t];else if(t&&"string"==typeof t.name&&Ns.hasOwnProperty(t.name)){var r=Ns[t.name];"string"==typeof r&&(r={name:r}),t=ro(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),i=xs[r.name];if(!i)return e.getMode(t,"text/plain");var n=i(t,r);if(Ls.hasOwnProperty(r.name)){var o=Ls[r.name];for(var s in o)o.hasOwnProperty(s)&&(n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=o[s])}if(n.name=r.name,r.helperType&&(n.helperType=r.helperType),r.modeProps)for(var s in r.modeProps)n[s]=r.modeProps[s];return n},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var Ls=e.modeExtensions={};e.extendMode=function(e,t){var r=Ls.hasOwnProperty(e)?Ls[e]:Ls[e]={};io(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){Vs.prototype[e]=t},e.defineOption=Ei;var Is=[];e.defineInitHook=function(e){Is.push(e)};var Ts=e.helpers={};e.registerHelper=function(t,r,i){Ts.hasOwnProperty(t)||(Ts[t]=e[t]={_global:[]}),Ts[t][r]=i},e.registerGlobalHelper=function(t,r,i,n){e.registerHelper(t,r,n),Ts[t]._global.push({pred:i,val:n})};var As=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var n=t[i];n instanceof Array&&(n=n.concat([])),r[i]=n}return r},Ss=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var ys=e.commands={selectAll:function(e){e.setSelection(rs(e.firstLine(),0),rs(e.lastLine()),Js)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Js)},killLine:function(e){ui(e,function(t){if(t.empty()){var r=vn(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:rs(t.head.line+1,0)}:{from:t.head,to:rs(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){ui(e,function(t){return{from:rs(t.from().line,0),to:Z(e.doc,rs(t.to().line+1,0))}})},delLineLeft:function(e){ui(e,function(e){return{from:rs(e.from().line,0),to:e.from()}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(rs(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(rs(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return So(e,t.head.line)},ta)},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){var r=So(e,t.head.line),i=e.getLineHandle(r.line),n=Sn(i);if(!n||0==n[0].level){var o=Math.max(0,i.text.search(/\S/)),s=t.head.line==r.line&&t.head.ch<=o&&t.head.ch;return rs(r.line,s?0:o)}return r},ta)},goLineEnd:function(e){e.extendSelectionsBy(function(t){return yo(e,t.head.line)},ta)},goLineRight:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},ta)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},ta)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),i=e.options.tabSize,n=0;n<r.length;n++){var o=r[n].from(),s=ra(e.getLine(o.line),o.ch,i);t.push(new Array(i-s%i+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){$t(e,function(){for(var t=e.listSelections(),r=0;r<t.length;r++){var i=t[r].head,n=vn(e.doc,i.line).text;i.ch>0&&i.ch<n.length-1&&e.replaceRange(n.charAt(i.ch)+n.charAt(i.ch-1),rs(i.line,i.ch-1),rs(i.line,i.ch+1))}})},newlineAndIndent:function(e){$t(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var i=e.listSelections()[r];e.replaceRange("\n",i.anchor,i.head,"+input"),e.indentLine(i.from().line+1,null,!0),oi(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},Cs=e.keyMap={};Cs.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Cs.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Cs.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]},Cs.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},Cs["default"]=Yo?Cs.macDefault:Cs.pcDefault;var Rs=e.lookupKey=function(e,t,r){function i(t){t=hi(t);var n=t[e];if(n===!1)return"stop";if(null!=n&&r(n))return!0;if(t.nofallthrough)return"stop";var o=t.fallthrough;if(null==o)return!1;if("[object Array]"!=Object.prototype.toString.call(o))return i(o);for(var s=0;s<o.length;++s){var a=i(o[s]);if(a)return a}return!1}for(var n=0;n<t.length;++n){var o=i(t[n]);if(o)return"stop"!=o}},Os=e.isModifierKey=function(e){var t=ma[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},bs=e.keyName=function(e,t){if(Fo&&34==e.keyCode&&e["char"])return!1;var r=ma[e.keyCode];return null==r||e.altGraphKey?!1:(e.altKey&&(r="Alt-"+r),(Qo?e.metaKey:e.ctrlKey)&&(r="Ctrl-"+r),(Qo?e.ctrlKey:e.metaKey)&&(r="Cmd-"+r),!t&&e.shiftKey&&(r="Shift-"+r),r)};e.fromTextArea=function(t,r){function i(){t.value=u.getValue()}if(r||(r={}),r.value=t.value,!r.tabindex&&t.tabindex&&(r.tabindex=t.tabindex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),null==r.autofocus){var n=co();r.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}if(t.form&&(Xs(t.form,"submit",i),!r.leaveSubmitMethodAlone)){var o=t.form,s=o.submit;try{var a=o.submit=function(){i(),o.submit=s,o.submit(),o.submit=a}}catch(l){}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},r);return u.save=i,u.getTextArea=function(){return t},u.toTextArea=function(){i(),t.parentNode.removeChild(u.getWrapperElement()),t.style.display="",t.form&&(Ks(t.form,"submit",i),"function"==typeof t.form.submit&&(t.form.submit=s))},u};var Ps=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Ps.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var r=t==e;else var r=t&&(e.test?e.test(t):e(t));return r?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ra(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ra(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return ra(this.string,null,this.tabSize)-(this.lineStart?ra(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}var n=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return n(o)==n(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var Ds=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e};Yn(Ds),Ds.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kt(e),Kn(this,"clear")){var r=this.find();r&&Wn(this,"clear",r.from,r.to)}for(var i=null,n=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=Li(s.markedSpans,this);e&&!this.collapsed?ir(e,In(s),"text"):e&&(null!=a.to&&(n=In(s)),null!=a.from&&(i=In(s))),s.markedSpans=Ii(s.markedSpans,a),null==a.from&&this.collapsed&&!ji(this.doc,s)&&e&&Ln(s,zt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var l=Ui(this.lines[o]),u=d(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&rr(e,i,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ct(e.doc)),e&&Wn(e,"markerCleared",e,this),t&&Yt(e),this.parent&&this.parent.clear()}},Ds.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,i,n=0;n<this.lines.length;++n){var o=this.lines[n],s=Li(o.markedSpans,this);if(null!=s.from&&(r=rs(t?o:In(o),s.from),-1==e))return r;if(null!=s.to&&(i=rs(t?o:In(o),s.to),1==e))return i}return r&&{from:r,to:i}},Ds.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&$t(r,function(){var i=e.line,n=In(e.line),o=Ot(r,n);if(o&&(_t(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ji(t.doc,i)&&null!=t.height){var s=t.height;t.height=null;var a=zi(t)-s;a&&Ln(i,i.height+a)}})},Ds.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=eo(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ds.prototype.detachLine=function(e){if(this.lines.splice(eo(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var _s=0,Ms=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Yn(Ms),Ms.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Wn(this,"clear")}},Ms.prototype.find=function(e,t){return this.primary.find(e,t)};var Gs=e.LineWidget=function(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.cm=e,this.node=t};Yn(Gs),Gs.prototype.clear=function(){var e=this.cm,t=this.line.widgets,r=this.line,i=In(r);if(null!=i&&t){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(r.widgets=null);var o=zi(this);$t(e,function(){qi(e,r,-o),ir(e,i,"widget"),Ln(r,Math.max(0,r.height-o))})}},Gs.prototype.changed=function(){var e=this.height,t=this.cm,r=this.line;this.height=null;var i=zi(this)-e;i&&$t(t,function(){t.curOp.forceUpdate=!0,qi(t,r,i),Ln(r,r.height+i)})};var ws=e.Line=function(e,t,r){this.text=e,Pi(this,t),this.height=r?r(this):1};Yn(ws),ws.prototype.lineNo=function(){return In(this)};var ks={},Bs={};hn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,i=e+t;i>r;++r){var n=this.lines[r];this.height-=n.height,Yi(n),Wn(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;i>e;++e)if(r(this.lines[e]))return!0}},fn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],n=i.chunkSize();if(n>e){var o=Math.min(t,n-e),s=i.height;if(i.removeInner(e,o),this.height-=s-i.height,n==o&&(this.children.splice(r--,1),i.parent=null),0==(t-=o))break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof hn))){var a=[];this.collapse(a),this.children=[new hn(a)],this.children[0].parent=this }},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(o>=e){if(n.insertInner(e,t,r),n.lines&&n.lines.length>50){for(;n.lines.length>50;){var s=n.lines.splice(n.lines.length-25,25),a=new hn(s);n.height-=a.height,this.children.splice(i+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new fn(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=eo(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new fn(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(o>e){var s=Math.min(t,o-e);if(n.iterN(e,s,r))return!0;if(0==(t-=s))break;e=0}else e-=o}}};var Us=0,Vs=e.Doc=function(e,t,r){if(!(this instanceof Vs))return new Vs(e,t,r);null==r&&(r=0),fn.call(this,[new hn([new ws("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=rs(r,0);this.sel=Y(i),this.history=new yn(null),this.id=++Us,this.modeOption=t,"string"==typeof e&&(e=Ea(e)),En(this,{from:i,to:i,text:e}),lt(this,Y(i),Js)};Vs.prototype=ro(fn.prototype,{constructor:Vs,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Nn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:Jt(function(e){var t=rs(this.first,0),r=this.first+this.size-1;Xr(this,{from:t,to:rs(r,vn(this,r).text.length),text:Ea(e),origin:"setValue"},!0),lt(this,Y(t))}),replaceRange:function(e,t,r,i){t=Z(this,t),r=r?Z(this,r):t,Jr(this,e,t,r,i)},getRange:function(e,t,r){var i=xn(this,Z(this,e),Z(this,t));return r===!1?i:i.join(r||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return J(this,e)?vn(this,e):void 0},getLineNumber:function(e){return In(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=vn(this,e)),Ui(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Z(this,e)},getCursor:function(e){var t,r=this.sel.primary();return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||"to"==e||e===!1?r.to():r.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Jt(function(e,t,r){ot(this,Z(this,"number"==typeof e?rs(e,t||0):e),null,r)}),setSelection:Jt(function(e,t,r){ot(this,Z(this,e),Z(this,t||e),r)}),extendSelection:Jt(function(e,t,r){rt(this,Z(this,e),t&&Z(this,t),r)}),extendSelections:Jt(function(e,t){it(this,et(this,e,t))}),extendSelectionsBy:Jt(function(e,t){it(this,to(this.sel.ranges,e),t)}),setSelections:Jt(function(e,t,r){if(e.length){for(var i=0,n=[];i<e.length;i++)n[i]=new X(Z(this,e[i].anchor),Z(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),lt(this,K(n,t),r)}}),addSelection:Jt(function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new X(Z(this,e),Z(this,t||e))),lt(this,K(i,i.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,i=0;i<r.length;i++){var n=xn(this,r[i].from(),r[i].to());t=t?t.concat(n):n}return e===!1?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var n=xn(this,r[i].from(),r[i].to());e!==!1&&(n=n.join(e||"\n")),t[i]=n}return t},replaceSelection:function(e,t,r){for(var i=[],n=0;n<this.sel.ranges.length;n++)i[n]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:Jt(function(e,t,r){for(var i=[],n=this.sel,o=0;o<n.ranges.length;o++){var s=n.ranges[o];i[o]={from:s.from(),to:s.to(),text:Ea(e[o]),origin:r}}for(var a=t&&"end"!=t&&qr(this,i,t),o=i.length-1;o>=0;o--)Xr(this,i[o]);a?at(this,a):this.cm&&oi(this.cm)}),undo:Jt(function(){Yr(this,"undo")}),redo:Jt(function(){Yr(this,"redo")}),undoSelection:Jt(function(){Yr(this,"undo",!0)}),redoSelection:Jt(function(){Yr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new yn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:kn(this.history.done),undone:kn(this.history.undone)}},setHistory:function(e){var t=this.history=new yn(this.history.maxGeneration);t.done=kn(e.done.slice(0),null,!0),t.undone=kn(e.undone.slice(0),null,!0)},markText:function(e,t,r){return fi(this,Z(this,e),Z(this,t),r,"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared};return e=Z(this,e),fi(this,e,e,r,"bookmark")},findMarksAt:function(e){e=Z(this,e);var t=[],r=vn(this,e.line).markedSpans;if(r)for(var i=0;i<r.length;++i){var n=r[i];(null==n.from||n.from<=e.ch)&&(null==n.to||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,r){e=Z(this,e),t=Z(this,t);var i=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];n==e.line&&e.ch>l.to||null==l.from&&n!=e.line||n==t.line&&l.from>t.ch||r&&!r(l.marker)||i.push(l.marker.parent||l.marker)}++n}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)null!=r[i].from&&e.push(r[i].marker)}),e},posFromIndex:function(e){var t,r=this.first;return this.iter(function(i){var n=i.text.length+1;return n>e?(t=e,!0):(e-=n,void++r)}),Z(this,rs(r,t))},indexFromPos:function(e){e=Z(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new Vs(Nn(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var i=new Vs(Nn(this,t,r),e.mode||this.modeOption,t);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],vi(i,gi(this)),i},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var r=0;r<this.linked.length;++r){var i=this.linked[r];if(i.doc==t){this.linked.splice(r,1),t.unlinkDoc(this),xi(gi(this));break}}if(t.history==this.history){var n=[t.id];mn(t,function(e){n.push(e.id)},!0),t.history=new yn(null),t.history.done=kn(this.history.done,n),t.history.undone=kn(this.history.undone,n)}},iterLinkedDocs:function(e){mn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),Vs.prototype.eachLine=Vs.prototype.iter;var Hs="iter insert remove copy getEditor".split(" ");for(var Fs in Vs.prototype)Vs.prototype.hasOwnProperty(Fs)&&eo(Hs,Fs)<0&&(e.prototype[Fs]=function(e){return function(){return e.apply(this.doc,arguments)}}(Vs.prototype[Fs]));Yn(Vs);var js,Ws=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},qs=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},zs=e.e_stop=function(e){Ws(e),qs(e)},Xs=e.on=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var i=e._handlers||(e._handlers={}),n=i[t]||(i[t]=[]);n.push(r)}},Ks=e.off=function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var i=e._handlers&&e._handlers[t];if(!i)return;for(var n=0;n<i.length;++n)if(i[n]==r){i.splice(n,1);break}}},Ys=e.signal=function(e,t){var r=e._handlers&&e._handlers[t];if(r)for(var i=Array.prototype.slice.call(arguments,2),n=0;n<r.length;++n)r[n].apply(null,i)},$s=0,Zs=30,Qs=e.Pass={toString:function(){return"CodeMirror.Pass"}},Js={scroll:!1},ea={origin:"*mouse"},ta={origin:"+move"};$n.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var ra=e.countColumn=function(e,t,r,i,n){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=i||0,s=n||0;;){var a=e.indexOf(" ",o);if(0>a||a>=t)return s+(t-o);s+=a-o,s+=r-s%r,o=a+1}},ia=[""],na=function(e){e.select()};Xo?na=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Bo&&(na=function(e){try{e.select()}catch(t){}}),[].indexOf&&(eo=function(e,t){return e.indexOf(t)}),[].map&&(to=function(e,t){return e.map(t)});var oa,sa=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,aa=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||sa.test(e))},la=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;oa=document.createRange?function(e,t,r){var i=document.createRange();return i.setEnd(e,r),i.setStart(e,t),i}:function(e,t,r){var i=document.body.createTextRange();return i.moveToElementText(e.parentNode),i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i},_o&&(co=function(){try{return document.activeElement}catch(e){return document.body}});var ua,pa,ca,da=function(){if(Go)return!1;var e=ao("div");return"draggable"in e||"dragDrop"in e}(),Ea=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],i=e.length;i>=t;){var n=e.indexOf("\n",t);-1==n&&(n=e.length);var o=e.slice(t,"\r"==e.charAt(n-1)?n-1:n),s=o.indexOf("\r");-1!=s?(r.push(o.slice(0,s)),t+=s+1):(r.push(o),t=n+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ha=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},fa=function(){var e=ao("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ma={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=ma,function(){for(var e=0;10>e;e++)ma[e+48]=ma[e+96]=String(e);for(var e=65;90>=e;e++)ma[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)ma[e+111]=ma[e+63235]="F"+e}();var ga,va=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?i.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",i="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,s=/[LRr]/,a=/[Lb1n]/,l=/[1n]/,u="L";return function(r){if(!n.test(r))return!1;for(var i,p=r.length,c=[],d=0;p>d;++d)c.push(i=e(r.charCodeAt(d)));for(var d=0,E=u;p>d;++d){var i=c[d];"m"==i?c[d]=E:E=i}for(var d=0,h=u;p>d;++d){var i=c[d];"1"==i&&"r"==h?c[d]="n":s.test(i)&&(h=i,"r"==i&&(c[d]="R"))}for(var d=1,E=c[0];p-1>d;++d){var i=c[d];"+"==i&&"1"==E&&"1"==c[d+1]?c[d]="1":","!=i||E!=c[d+1]||"1"!=E&&"n"!=E||(c[d]=E),E=i}for(var d=0;p>d;++d){var i=c[d];if(","==i)c[d]="N";else if("%"==i){for(var f=d+1;p>f&&"%"==c[f];++f);for(var m=d&&"!"==c[d-1]||p>f&&"1"==c[f]?"1":"N",g=d;f>g;++g)c[g]=m;d=f-1}}for(var d=0,h=u;p>d;++d){var i=c[d];"L"==h&&"1"==i?c[d]="L":s.test(i)&&(h=i)}for(var d=0;p>d;++d)if(o.test(c[d])){for(var f=d+1;p>f&&o.test(c[f]);++f);for(var v="L"==(d?c[d-1]:u),x="L"==(p>f?c[f]:u),m=v||x?"L":"R",g=d;f>g;++g)c[g]=m;d=f-1}for(var N,L=[],d=0;p>d;)if(a.test(c[d])){var I=d;for(++d;p>d&&a.test(c[d]);++d);L.push(new t(0,I,d))}else{var T=d,A=L.length;for(++d;p>d&&"L"!=c[d];++d);for(var g=T;d>g;)if(l.test(c[g])){g>T&&L.splice(A,0,new t(1,T,g));var S=g;for(++g;d>g&&l.test(c[g]);++g);L.splice(A,0,new t(2,S,g)),T=g}else++g;d>T&&L.splice(A,0,new t(1,T,d))}return 1==L[0].level&&(N=r.match(/^\s+/))&&(L[0].from=N[0].length,L.unshift(new t(0,0,N[0].length))),1==Jn(L).level&&(N=r.match(/\s+$/))&&(Jn(L).to-=N[0].length,L.push(new t(0,p-N[0].length,p))),L[0].level!=Jn(L).level&&L.push(new t(L[0].level,p,p)),L}}();return e.version="4.1.0",e})},{}],8:[function(t,r){!function(e,t){"object"==typeof r&&"object"==typeof r.exports?r.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(t,r){function i(e){var t=e.length,r=ot.type(e);return"function"===r||ot.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e}function n(e,t,r){if(ot.isFunction(t))return ot.grep(e,function(e,i){return!!t.call(e,i,e)!==r});if(t.nodeType)return ot.grep(e,function(e){return e===t!==r});if("string"==typeof t){if(Et.test(t))return ot.filter(t,e,r);t=ot.filter(t,e)}return ot.grep(e,function(e){return ot.inArray(e,t)>=0!==r})}function o(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function s(e){var t=Lt[e]={};return ot.each(e.match(Nt)||[],function(e,r){t[r]=!0}),t}function a(){ft.addEventListener?(ft.removeEventListener("DOMContentLoaded",l,!1),t.removeEventListener("load",l,!1)):(ft.detachEvent("onreadystatechange",l),t.detachEvent("onload",l))}function l(){(ft.addEventListener||"load"===event.type||"complete"===ft.readyState)&&(a(),ot.ready())}function u(e,t,r){if(void 0===r&&1===e.nodeType){var i="data-"+t.replace(yt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:St.test(r)?ot.parseJSON(r):r}catch(n){}ot.data(e,t,r)}else r=void 0}return r}function p(e){var t;for(t in e)if(("data"!==t||!ot.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,r,i){if(ot.acceptData(e)){var n,o,s=ot.expando,a=e.nodeType,l=a?ot.cache:e,u=a?e[s]:e[s]&&s;if(u&&l[u]&&(i||l[u].data)||void 0!==r||"string"!=typeof t)return u||(u=a?e[s]=Y.pop()||ot.guid++:s),l[u]||(l[u]=a?{}:{toJSON:ot.noop}),("object"==typeof t||"function"==typeof t)&&(i?l[u]=ot.extend(l[u],t):l[u].data=ot.extend(l[u].data,t)),o=l[u],i||(o.data||(o.data={}),o=o.data),void 0!==r&&(o[ot.camelCase(t)]=r),"string"==typeof t?(n=o[t],null==n&&(n=o[ot.camelCase(t)])):n=o,n}}function d(e,t,r){if(ot.acceptData(e)){var i,n,o=e.nodeType,s=o?ot.cache:e,a=o?e[ot.expando]:ot.expando;if(s[a]){if(t&&(i=r?s[a]:s[a].data)){ot.isArray(t)?t=t.concat(ot.map(t,ot.camelCase)):t in i?t=[t]:(t=ot.camelCase(t),t=t in i?[t]:t.split(" ")),n=t.length;for(;n--;)delete i[t[n]];if(r?!p(i):!ot.isEmptyObject(i))return}(r||(delete s[a].data,p(s[a])))&&(o?ot.cleanData([e],!0):it.deleteExpando||s!=s.window?delete s[a]:s[a]=null)}}}function E(){return!0}function h(){return!1}function f(){try{return ft.activeElement}catch(e){}}function m(e){var t=kt.split("|"),r=e.createDocumentFragment();if(r.createElement)for(;t.length;)r.createElement(t.pop());return r}function g(e,t){var r,i,n=0,o=typeof e.getElementsByTagName!==At?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==At?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],r=e.childNodes||e;null!=(i=r[n]);n++)!t||ot.nodeName(i,t)?o.push(i):ot.merge(o,g(i,t));return void 0===t||t&&ot.nodeName(e,t)?ot.merge([e],o):o}function v(e){Pt.test(e.type)&&(e.defaultChecked=e.checked)}function x(e,t){return ot.nodeName(e,"table")&&ot.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function N(e){return e.type=(null!==ot.find.attr(e,"type"))+"/"+e.type,e}function L(e){var t=Kt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function I(e,t){for(var r,i=0;null!=(r=e[i]);i++)ot._data(r,"globalEval",!t||ot._data(t[i],"globalEval"))}function T(e,t){if(1===t.nodeType&&ot.hasData(e)){var r,i,n,o=ot._data(e),s=ot._data(t,o),a=o.events;if(a){delete s.handle,s.events={};for(r in a)for(i=0,n=a[r].length;n>i;i++)ot.event.add(t,r,a[r][i])}s.data&&(s.data=ot.extend({},s.data))}}function A(e,t){var r,i,n;if(1===t.nodeType){if(r=t.nodeName.toLowerCase(),!it.noCloneEvent&&t[ot.expando]){n=ot._data(t);for(i in n.events)ot.removeEvent(t,i,n.handle);t.removeAttribute(ot.expando)}"script"===r&&t.text!==e.text?(N(t).text=e.text,L(t)):"object"===r?(t.parentNode&&(t.outerHTML=e.outerHTML),it.html5Clone&&e.innerHTML&&!ot.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===r&&Pt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===r?t.defaultSelected=t.selected=e.defaultSelected:("input"===r||"textarea"===r)&&(t.defaultValue=e.defaultValue)}}function S(e,r){var i,n=ot(r.createElement(e)).appendTo(r.body),o=t.getDefaultComputedStyle&&(i=t.getDefaultComputedStyle(n[0]))?i.display:ot.css(n[0],"display");return n.detach(),o}function y(e){var t=ft,r=er[e];return r||(r=S(e,t),"none"!==r&&r||(Jt=(Jt||ot("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=(Jt[0].contentWindow||Jt[0].contentDocument).document,t.write(),t.close(),r=S(e,t),Jt.detach()),er[e]=r),r}function C(e,t){return{get:function(){var r=e();if(null!=r)return r?void delete this.get:(this.get=t).apply(this,arguments)}}}function R(e,t){if(t in e)return t;for(var r=t.charAt(0).toUpperCase()+t.slice(1),i=t,n=Er.length;n--;)if(t=Er[n]+r,t in e)return t;return i}function O(e,t){for(var r,i,n,o=[],s=0,a=e.length;a>s;s++)i=e[s],i.style&&(o[s]=ot._data(i,"olddisplay"),r=i.style.display,t?(o[s]||"none"!==r||(i.style.display=""),""===i.style.display&&Ot(i)&&(o[s]=ot._data(i,"olddisplay",y(i.nodeName)))):(n=Ot(i),(r&&"none"!==r||!n)&&ot._data(i,"olddisplay",n?r:ot.css(i,"display"))));for(s=0;a>s;s++)i=e[s],i.style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?o[s]||"":"none"));return e}function b(e,t,r){var i=ur.exec(t);return i?Math.max(0,i[1]-(r||0))+(i[2]||"px"):t}function P(e,t,r,i,n){for(var o=r===(i?"border":"content")?4:"width"===t?1:0,s=0;4>o;o+=2)"margin"===r&&(s+=ot.css(e,r+Rt[o],!0,n)),i?("content"===r&&(s-=ot.css(e,"padding"+Rt[o],!0,n)),"margin"!==r&&(s-=ot.css(e,"border"+Rt[o]+"Width",!0,n))):(s+=ot.css(e,"padding"+Rt[o],!0,n),"padding"!==r&&(s+=ot.css(e,"border"+Rt[o]+"Width",!0,n)));return s}function D(e,t,r){var i=!0,n="width"===t?e.offsetWidth:e.offsetHeight,o=tr(e),s=it.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,o);if(0>=n||null==n){if(n=rr(e,t,o),(0>n||null==n)&&(n=e.style[t]),nr.test(n))return n;i=s&&(it.boxSizingReliable()||n===e.style[t]),n=parseFloat(n)||0}return n+P(e,t,r||(s?"border":"content"),i,o)+"px"}function _(e,t,r,i,n){return new _.prototype.init(e,t,r,i,n)}function M(){return setTimeout(function(){hr=void 0}),hr=ot.now()}function G(e,t){var r,i={height:e},n=0;for(t=t?1:0;4>n;n+=2-t)r=Rt[n],i["margin"+r]=i["padding"+r]=e;return t&&(i.opacity=i.width=e),i}function w(e,t,r){for(var i,n=(Nr[t]||[]).concat(Nr["*"]),o=0,s=n.length;s>o;o++)if(i=n[o].call(r,t,e))return i}function k(e,t,r){var i,n,o,s,a,l,u,p,c=this,d={},E=e.style,h=e.nodeType&&Ot(e),f=ot._data(e,"fxshow");r.queue||(a=ot._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,c.always(function(){c.always(function(){a.unqueued--,ot.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(r.overflow=[E.overflow,E.overflowX,E.overflowY],u=ot.css(e,"display"),p="none"===u?ot._data(e,"olddisplay")||y(e.nodeName):u,"inline"===p&&"none"===ot.css(e,"float")&&(it.inlineBlockNeedsLayout&&"inline"!==y(e.nodeName)?E.zoom=1:E.display="inline-block")),r.overflow&&(E.overflow="hidden",it.shrinkWrapBlocks()||c.always(function(){E.overflow=r.overflow[0],E.overflowX=r.overflow[1],E.overflowY=r.overflow[2]}));for(i in t)if(n=t[i],mr.exec(n)){if(delete t[i],o=o||"toggle"===n,n===(h?"hide":"show")){if("show"!==n||!f||void 0===f[i])continue;h=!0}d[i]=f&&f[i]||ot.style(e,i)}else u=void 0;if(ot.isEmptyObject(d))"inline"===("none"===u?y(e.nodeName):u)&&(E.display=u);else{f?"hidden"in f&&(h=f.hidden):f=ot._data(e,"fxshow",{}),o&&(f.hidden=!h),h?ot(e).show():c.done(function(){ot(e).hide()}),c.done(function(){var t;ot._removeData(e,"fxshow");for(t in d)ot.style(e,t,d[t])});for(i in d)s=w(h?f[i]:0,i,c),i in f||(f[i]=s.start,h&&(s.end=s.start,s.start="width"===i||"height"===i?1:0))}}function B(e,t){var r,i,n,o,s;for(r in e)if(i=ot.camelCase(r),n=t[i],o=e[r],ot.isArray(o)&&(n=o[1],o=e[r]=o[0]),r!==i&&(e[i]=o,delete e[r]),s=ot.cssHooks[i],s&&"expand"in s){o=s.expand(o),delete e[i];for(r in o)r in e||(e[r]=o[r],t[r]=n)}else t[i]=n}function U(e,t,r){var i,n,o=0,s=xr.length,a=ot.Deferred().always(function(){delete l.elem}),l=function(){if(n)return!1;for(var t=hr||M(),r=Math.max(0,u.startTime+u.duration-t),i=r/u.duration||0,o=1-i,s=0,l=u.tweens.length;l>s;s++)u.tweens[s].run(o);return a.notifyWith(e,[u,o,r]),1>o&&l?r:(a.resolveWith(e,[u]),!1)},u=a.promise({elem:e,props:ot.extend({},t),opts:ot.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:hr||M(),duration:r.duration,tweens:[],createTween:function(t,r){var i=ot.Tween(e,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(i),i},stop:function(t){var r=0,i=t?u.tweens.length:0;if(n)return this;for(n=!0;i>r;r++)u.tweens[r].run(1);return t?a.resolveWith(e,[u,t]):a.rejectWith(e,[u,t]),this}}),p=u.props;for(B(p,u.opts.specialEasing);s>o;o++)if(i=xr[o].call(u,e,p,u.opts))return i;return ot.map(p,w,u),ot.isFunction(u.opts.start)&&u.opts.start.call(e,u),ot.fx.timer(ot.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function V(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var i,n=0,o=t.toLowerCase().match(Nt)||[];if(ot.isFunction(r))for(;i=o[n++];)"+"===i.charAt(0)?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(r)):(e[i]=e[i]||[]).push(r)}}function H(e,t,r,i){function n(a){var l;return o[a]=!0,ot.each(e[a]||[],function(e,a){var u=a(t,r,i);return"string"!=typeof u||s||o[u]?s?!(l=u):void 0:(t.dataTypes.unshift(u),n(u),!1)}),l}var o={},s=e===Wr;return n(t.dataTypes[0])||!o["*"]&&n("*")}function F(e,t){var r,i,n=ot.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((n[i]?e:r||(r={}))[i]=t[i]);return r&&ot.extend(!0,e,r),e}function j(e,t,r){for(var i,n,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(s in a)if(a[s]&&a[s].test(n)){l.unshift(s);break}if(l[0]in r)o=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){o=s;break}i||(i=s)}o=o||i}return o?(o!==l[0]&&l.unshift(o),r[o]):void 0}function W(e,t,r,i){var n,o,s,a,l,u={},p=e.dataTypes.slice();if(p[1])for(s in e.converters)u[s.toLowerCase()]=e.converters[s];for(o=p.shift();o;)if(e.responseFields[o]&&(r[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=p.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(s=u[l+" "+o]||u["* "+o],!s)for(n in u)if(a=n.split(" "),a[1]===o&&(s=u[l+" "+a[0]]||u["* "+a[0]])){s===!0?s=u[n]:u[n]!==!0&&(o=a[0],p.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(c){return{state:"parsererror",error:s?c:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}function q(e,t,r,i){var n;if(ot.isArray(t))ot.each(t,function(t,n){r||Kr.test(e)?i(e,n):q(e+"["+("object"==typeof n?t:"")+"]",n,r,i)});else if(r||"object"!==ot.type(t))i(e,t);else for(n in t)q(e+"["+n+"]",t[n],r,i)}function z(){try{return new t.XMLHttpRequest}catch(e){}}function X(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function K(e){return ot.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var Y=[],$=Y.slice,Z=Y.concat,Q=Y.push,J=Y.indexOf,et={},tt=et.toString,rt=et.hasOwnProperty,it={},nt="1.11.1",ot=function(e,t){return new ot.fn.init(e,t)},st=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,at=/^-ms-/,lt=/-([\da-z])/gi,ut=function(e,t){return t.toUpperCase()};ot.fn=ot.prototype={jquery:nt,constructor:ot,selector:"",length:0,toArray:function(){return $.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:$.call(this)},pushStack:function(e){var t=ot.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return ot.each(this,e,t)},map:function(e){return this.pushStack(ot.map(this,function(t,r){return e.call(t,r,t)}))},slice:function(){return this.pushStack($.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,r=+e+(0>e?t:0);return this.pushStack(r>=0&&t>r?[this[r]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:Q,sort:Y.sort,splice:Y.splice},ot.extend=ot.fn.extend=function(){var e,t,r,i,n,o,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||ot.isFunction(s)||(s={}),a===l&&(s=this,a--);l>a;a++)if(null!=(n=arguments[a]))for(i in n)e=s[i],r=n[i],s!==r&&(u&&r&&(ot.isPlainObject(r)||(t=ot.isArray(r)))?(t?(t=!1,o=e&&ot.isArray(e)?e:[]):o=e&&ot.isPlainObject(e)?e:{},s[i]=ot.extend(u,o,r)):void 0!==r&&(s[i]=r));return s},ot.extend({expando:"jQuery"+(nt+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===ot.type(e)},isArray:Array.isArray||function(e){return"array"===ot.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!ot.isArray(e)&&e-parseFloat(e)>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==ot.type(e)||e.nodeType||ot.isWindow(e))return!1;try{if(e.constructor&&!rt.call(e,"constructor")&&!rt.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(it.ownLast)for(t in e)return rt.call(e,t);for(t in e);return void 0===t||rt.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?et[tt.call(e)]||"object":typeof e},globalEval:function(e){e&&ot.trim(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(e){return e.replace(at,"ms-").replace(lt,ut)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var n,o=0,s=e.length,a=i(e);if(r){if(a)for(;s>o&&(n=t.apply(e[o],r),n!==!1);o++);else for(o in e)if(n=t.apply(e[o],r),n===!1)break}else if(a)for(;s>o&&(n=t.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=t.call(e[o],o,e[o]),n===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(st,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(i(Object(e))?ot.merge(r,"string"==typeof e?[e]:e):Q.call(r,e)),r},inArray:function(e,t,r){var i;if(t){if(J)return J.call(t,e,r);for(i=t.length,r=r?0>r?Math.max(0,i+r):r:0;i>r;r++)if(r in t&&t[r]===e)return r}return-1},merge:function(e,t){for(var r=+t.length,i=0,n=e.length;r>i;)e[n++]=t[i++];if(r!==r)for(;void 0!==t[i];)e[n++]=t[i++];return e.length=n,e},grep:function(e,t,r){for(var i,n=[],o=0,s=e.length,a=!r;s>o;o++)i=!t(e[o],o),i!==a&&n.push(e[o]);return n},map:function(e,t,r){var n,o=0,s=e.length,a=i(e),l=[];if(a)for(;s>o;o++)n=t(e[o],o,r),null!=n&&l.push(n);else for(o in e)n=t(e[o],o,r),null!=n&&l.push(n);return Z.apply([],l)},guid:1,proxy:function(e,t){var r,i,n;return"string"==typeof t&&(n=e[t],t=e,e=n),ot.isFunction(e)?(r=$.call(arguments,2),i=function(){return e.apply(t||this,r.concat($.call(arguments)))},i.guid=e.guid=e.guid||ot.guid++,i):void 0},now:function(){return+new Date},support:it}),ot.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){et["[object "+t+"]"]=t.toLowerCase()});var pt=function(e){function t(e,t,r,i){var n,o,s,a,l,u,c,E,h,f;if((t?t.ownerDocument||t:V)!==D&&P(t),t=t||D,r=r||[],!e||"string"!=typeof e)return r;if(1!==(a=t.nodeType)&&9!==a)return[];if(M&&!i){if(n=vt.exec(e))if(s=n[1]){if(9===a){if(o=t.getElementById(s),!o||!o.parentNode)return r;if(o.id===s)return r.push(o),r}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&B(t,o)&&o.id===s)return r.push(o),r}else{if(n[2])return J.apply(r,t.getElementsByTagName(e)),r;if((s=n[3])&&L.getElementsByClassName&&t.getElementsByClassName)return J.apply(r,t.getElementsByClassName(s)),r}if(L.qsa&&(!G||!G.test(e))){if(E=c=U,h=t,f=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){for(u=S(e),(c=t.getAttribute("id"))?E=c.replace(Nt,"\\$&"):t.setAttribute("id",E),E="[id='"+E+"'] ",l=u.length;l--;)u[l]=E+d(u[l]);h=xt.test(e)&&p(t.parentNode)||t,f=u.join(",")}if(f)try{return J.apply(r,h.querySelectorAll(f)),r}catch(m){}finally{c||t.removeAttribute("id") }}}return C(e.replace(lt,"$1"),t,r,i)}function r(){function e(r,i){return t.push(r+" ")>I.cacheLength&&delete e[t.shift()],e[r+" "]=i}var t=[];return e}function i(e){return e[U]=!0,e}function n(e){var t=D.createElement("div");try{return!!e(t)}catch(r){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var r=e.split("|"),i=e.length;i--;)I.attrHandle[r[i]]=t}function s(e,t){var r=t&&e,i=r&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||K)-(~e.sourceIndex||K);if(i)return i;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function a(e){return function(t){var r=t.nodeName.toLowerCase();return"input"===r&&t.type===e}}function l(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function u(e){return i(function(t){return t=+t,i(function(r,i){for(var n,o=e([],r.length,t),s=o.length;s--;)r[n=o[s]]&&(r[n]=!(i[n]=r[n]))})})}function p(e){return e&&typeof e.getElementsByTagName!==X&&e}function c(){}function d(e){for(var t=0,r=e.length,i="";r>t;t++)i+=e[t].value;return i}function E(e,t,r){var i=t.dir,n=r&&"parentNode"===i,o=F++;return t.first?function(t,r,o){for(;t=t[i];)if(1===t.nodeType||n)return e(t,r,o)}:function(t,r,s){var a,l,u=[H,o];if(s){for(;t=t[i];)if((1===t.nodeType||n)&&e(t,r,s))return!0}else for(;t=t[i];)if(1===t.nodeType||n){if(l=t[U]||(t[U]={}),(a=l[i])&&a[0]===H&&a[1]===o)return u[2]=a[2];if(l[i]=u,u[2]=e(t,r,s))return!0}}}function h(e){return e.length>1?function(t,r,i){for(var n=e.length;n--;)if(!e[n](t,r,i))return!1;return!0}:e[0]}function f(e,r,i){for(var n=0,o=r.length;o>n;n++)t(e,r[n],i);return i}function m(e,t,r,i,n){for(var o,s=[],a=0,l=e.length,u=null!=t;l>a;a++)(o=e[a])&&(!r||r(o,i,n))&&(s.push(o),u&&t.push(a));return s}function g(e,t,r,n,o,s){return n&&!n[U]&&(n=g(n)),o&&!o[U]&&(o=g(o,s)),i(function(i,s,a,l){var u,p,c,d=[],E=[],h=s.length,g=i||f(t||"*",a.nodeType?[a]:a,[]),v=!e||!i&&t?g:m(g,d,e,a,l),x=r?o||(i?e:h||n)?[]:s:v;if(r&&r(v,x,a,l),n)for(u=m(x,E),n(u,[],a,l),p=u.length;p--;)(c=u[p])&&(x[E[p]]=!(v[E[p]]=c));if(i){if(o||e){if(o){for(u=[],p=x.length;p--;)(c=x[p])&&u.push(v[p]=c);o(null,x=[],u,l)}for(p=x.length;p--;)(c=x[p])&&(u=o?tt.call(i,c):d[p])>-1&&(i[u]=!(s[u]=c))}}else x=m(x===s?x.splice(h,x.length):x),o?o(null,s,x,l):J.apply(s,x)})}function v(e){for(var t,r,i,n=e.length,o=I.relative[e[0].type],s=o||I.relative[" "],a=o?1:0,l=E(function(e){return e===t},s,!0),u=E(function(e){return tt.call(t,e)>-1},s,!0),p=[function(e,r,i){return!o&&(i||r!==R)||((t=r).nodeType?l(e,r,i):u(e,r,i))}];n>a;a++)if(r=I.relative[e[a].type])p=[E(h(p),r)];else{if(r=I.filter[e[a].type].apply(null,e[a].matches),r[U]){for(i=++a;n>i&&!I.relative[e[i].type];i++);return g(a>1&&h(p),a>1&&d(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(lt,"$1"),r,i>a&&v(e.slice(a,i)),n>i&&v(e=e.slice(i)),n>i&&d(e))}p.push(r)}return h(p)}function x(e,r){var n=r.length>0,o=e.length>0,s=function(i,s,a,l,u){var p,c,d,E=0,h="0",f=i&&[],g=[],v=R,x=i||o&&I.find.TAG("*",u),N=H+=null==v?1:Math.random()||.1,L=x.length;for(u&&(R=s!==D&&s);h!==L&&null!=(p=x[h]);h++){if(o&&p){for(c=0;d=e[c++];)if(d(p,s,a)){l.push(p);break}u&&(H=N)}n&&((p=!d&&p)&&E--,i&&f.push(p))}if(E+=h,n&&h!==E){for(c=0;d=r[c++];)d(f,g,s,a);if(i){if(E>0)for(;h--;)f[h]||g[h]||(g[h]=Z.call(l));g=m(g)}J.apply(l,g),u&&!i&&g.length>0&&E+r.length>1&&t.uniqueSort(l)}return u&&(H=N,R=v),f};return n?i(s):s}var N,L,I,T,A,S,y,C,R,O,b,P,D,_,M,G,w,k,B,U="sizzle"+-new Date,V=e.document,H=0,F=0,j=r(),W=r(),q=r(),z=function(e,t){return e===t&&(b=!0),0},X="undefined",K=1<<31,Y={}.hasOwnProperty,$=[],Z=$.pop,Q=$.push,J=$.push,et=$.slice,tt=$.indexOf||function(e){for(var t=0,r=this.length;r>t;t++)if(this[t]===e)return t;return-1},rt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",it="[\\x20\\t\\r\\n\\f]",nt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot=nt.replace("w","w#"),st="\\["+it+"*("+nt+")(?:"+it+"*([*^$|!~]?=)"+it+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ot+"))|)"+it+"*\\]",at=":("+nt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+st+")*)|.*)\\)|)",lt=new RegExp("^"+it+"+|((?:^|[^\\\\])(?:\\\\.)*)"+it+"+$","g"),ut=new RegExp("^"+it+"*,"+it+"*"),pt=new RegExp("^"+it+"*([>+~]|"+it+")"+it+"*"),ct=new RegExp("="+it+"*([^\\]'\"]*?)"+it+"*\\]","g"),dt=new RegExp(at),Et=new RegExp("^"+ot+"$"),ht={ID:new RegExp("^#("+nt+")"),CLASS:new RegExp("^\\.("+nt+")"),TAG:new RegExp("^("+nt.replace("w","w*")+")"),ATTR:new RegExp("^"+st),PSEUDO:new RegExp("^"+at),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+it+"*(even|odd|(([+-]|)(\\d*)n|)"+it+"*(?:([+-]|)"+it+"*(\\d+)|))"+it+"*\\)|)","i"),bool:new RegExp("^(?:"+rt+")$","i"),needsContext:new RegExp("^"+it+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+it+"*((?:-\\d)?\\d*)"+it+"*\\)|)(?=[^-]|$)","i")},ft=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,gt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,Nt=/'|\\/g,Lt=new RegExp("\\\\([\\da-f]{1,6}"+it+"?|("+it+")|.)","ig"),It=function(e,t,r){var i="0x"+t-65536;return i!==i||r?t:0>i?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)};try{J.apply($=et.call(V.childNodes),V.childNodes),$[V.childNodes.length].nodeType}catch(Tt){J={apply:$.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var r=e.length,i=0;e[r++]=t[i++];);e.length=r-1}}}L=t.support={},A=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},P=t.setDocument=function(e){var t,r=e?e.ownerDocument||e:V,i=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,_=r.documentElement,M=!A(r),i&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",function(){P()},!1):i.attachEvent&&i.attachEvent("onunload",function(){P()})),L.attributes=n(function(e){return e.className="i",!e.getAttribute("className")}),L.getElementsByTagName=n(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),L.getElementsByClassName=gt.test(r.getElementsByClassName)&&n(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),L.getById=n(function(e){return _.appendChild(e).id=U,!r.getElementsByName||!r.getElementsByName(U).length}),L.getById?(I.find.ID=function(e,t){if(typeof t.getElementById!==X&&M){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}},I.filter.ID=function(e){var t=e.replace(Lt,It);return function(e){return e.getAttribute("id")===t}}):(delete I.find.ID,I.filter.ID=function(e){var t=e.replace(Lt,It);return function(e){var r=typeof e.getAttributeNode!==X&&e.getAttributeNode("id");return r&&r.value===t}}),I.find.TAG=L.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==X?t.getElementsByTagName(e):void 0}:function(e,t){var r,i=[],n=0,o=t.getElementsByTagName(e);if("*"===e){for(;r=o[n++];)1===r.nodeType&&i.push(r);return i}return o},I.find.CLASS=L.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==X&&M?t.getElementsByClassName(e):void 0},w=[],G=[],(L.qsa=gt.test(r.querySelectorAll))&&(n(function(e){e.innerHTML="<select msallowclip=''><option selected=''></option></select>",e.querySelectorAll("[msallowclip^='']").length&&G.push("[*^$]="+it+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||G.push("\\["+it+"*(?:value|"+rt+")"),e.querySelectorAll(":checked").length||G.push(":checked")}),n(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&G.push("name"+it+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||G.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),G.push(",.*:")})),(L.matchesSelector=gt.test(k=_.matches||_.webkitMatchesSelector||_.mozMatchesSelector||_.oMatchesSelector||_.msMatchesSelector))&&n(function(e){L.disconnectedMatch=k.call(e,"div"),k.call(e,"[s!='']:x"),w.push("!=",at)}),G=G.length&&new RegExp(G.join("|")),w=w.length&&new RegExp(w.join("|")),t=gt.test(_.compareDocumentPosition),B=t||gt.test(_.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},z=t?function(e,t){if(e===t)return b=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!L.sortDetached&&t.compareDocumentPosition(e)===i?e===r||e.ownerDocument===V&&B(V,e)?-1:t===r||t.ownerDocument===V&&B(V,t)?1:O?tt.call(O,e)-tt.call(O,t):0:4&i?-1:1)}:function(e,t){if(e===t)return b=!0,0;var i,n=0,o=e.parentNode,a=t.parentNode,l=[e],u=[t];if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:O?tt.call(O,e)-tt.call(O,t):0;if(o===a)return s(e,t);for(i=e;i=i.parentNode;)l.unshift(i);for(i=t;i=i.parentNode;)u.unshift(i);for(;l[n]===u[n];)n++;return n?s(l[n],u[n]):l[n]===V?-1:u[n]===V?1:0},r):D},t.matches=function(e,r){return t(e,null,null,r)},t.matchesSelector=function(e,r){if((e.ownerDocument||e)!==D&&P(e),r=r.replace(ct,"='$1']"),!(!L.matchesSelector||!M||w&&w.test(r)||G&&G.test(r)))try{var i=k.call(e,r);if(i||L.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(n){}return t(r,D,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==D&&P(e),B(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==D&&P(e);var r=I.attrHandle[t.toLowerCase()],i=r&&Y.call(I.attrHandle,t.toLowerCase())?r(e,t,!M):void 0;return void 0!==i?i:L.attributes||!M?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,r=[],i=0,n=0;if(b=!L.detectDuplicates,O=!L.sortStable&&e.slice(0),e.sort(z),b){for(;t=e[n++];)t===e[n]&&(i=r.push(n));for(;i--;)e.splice(r[i],1)}return O=null,e},T=t.getText=function(e){var t,r="",i=0,n=e.nodeType;if(n){if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)r+=T(e)}else if(3===n||4===n)return e.nodeValue}else for(;t=e[i++];)r+=T(t);return r},I=t.selectors={cacheLength:50,createPseudo:i,match:ht,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Lt,It),e[3]=(e[3]||e[4]||e[5]||"").replace(Lt,It),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return ht.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&dt.test(r)&&(t=S(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Lt,It).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=j[e+" "];return t||(t=new RegExp("(^|"+it+")"+e+"("+it+"|$)"))&&j(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==X&&e.getAttribute("class")||"")})},ATTR:function(e,r,i){return function(n){var o=t.attr(n,e);return null==o?"!="===r:r?(o+="","="===r?o===i:"!="===r?o!==i:"^="===r?i&&0===o.indexOf(i):"*="===r?i&&o.indexOf(i)>-1:"$="===r?i&&o.slice(-i.length)===i:"~="===r?(" "+o+" ").indexOf(i)>-1:"|="===r?o===i||o.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(e,t,r,i,n){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===n?function(e){return!!e.parentNode}:function(t,r,l){var u,p,c,d,E,h,f=o!==s?"nextSibling":"previousSibling",m=t.parentNode,g=a&&t.nodeName.toLowerCase(),v=!l&&!a;if(m){if(o){for(;f;){for(c=t;c=c[f];)if(a?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;h=f="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&v){for(p=m[U]||(m[U]={}),u=p[e]||[],E=u[0]===H&&u[1],d=u[0]===H&&u[2],c=E&&m.childNodes[E];c=++E&&c&&c[f]||(d=E=0)||h.pop();)if(1===c.nodeType&&++d&&c===t){p[e]=[H,E,d];break}}else if(v&&(u=(t[U]||(t[U]={}))[e])&&u[0]===H)d=u[1];else for(;(c=++E&&c&&c[f]||(d=E=0)||h.pop())&&((a?c.nodeName.toLowerCase()!==g:1!==c.nodeType)||!++d||(v&&((c[U]||(c[U]={}))[e]=[H,d]),c!==t)););return d-=n,d===i||d%i===0&&d/i>=0}}},PSEUDO:function(e,r){var n,o=I.pseudos[e]||I.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[U]?o(r):o.length>1?(n=[e,e,"",r],I.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,t){for(var i,n=o(e,r),s=n.length;s--;)i=tt.call(e,n[s]),e[i]=!(t[i]=n[s])}):function(e){return o(e,0,n)}):o}},pseudos:{not:i(function(e){var t=[],r=[],n=y(e.replace(lt,"$1"));return n[U]?i(function(e,t,r,i){for(var o,s=n(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,n(t,null,o,r),!r.pop()}}),has:i(function(e){return function(r){return t(e,r).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||T(t)).indexOf(e)>-1}}),lang:i(function(e){return Et.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(Lt,It).toLowerCase(),function(t){var r;do if(r=M?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return r=r.toLowerCase(),r===e||0===r.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var r=e.location&&e.location.hash;return r&&r.slice(1)===t.id},root:function(e){return e===_},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!I.pseudos.empty(e)},header:function(e){return mt.test(e.nodeName)},input:function(e){return ft.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,r){return[0>r?r+t:r]}),even:u(function(e,t){for(var r=0;t>r;r+=2)e.push(r);return e}),odd:u(function(e,t){for(var r=1;t>r;r+=2)e.push(r);return e}),lt:u(function(e,t,r){for(var i=0>r?r+t:r;--i>=0;)e.push(i);return e}),gt:u(function(e,t,r){for(var i=0>r?r+t:r;++i<t;)e.push(i);return e})}},I.pseudos.nth=I.pseudos.eq;for(N in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})I.pseudos[N]=a(N);for(N in{submit:!0,reset:!0})I.pseudos[N]=l(N);return c.prototype=I.filters=I.pseudos,I.setFilters=new c,S=t.tokenize=function(e,r){var i,n,o,s,a,l,u,p=W[e+" "];if(p)return r?0:p.slice(0);for(a=e,l=[],u=I.preFilter;a;){(!i||(n=ut.exec(a)))&&(n&&(a=a.slice(n[0].length)||a),l.push(o=[])),i=!1,(n=pt.exec(a))&&(i=n.shift(),o.push({value:i,type:n[0].replace(lt," ")}),a=a.slice(i.length));for(s in I.filter)!(n=ht[s].exec(a))||u[s]&&!(n=u[s](n))||(i=n.shift(),o.push({value:i,type:s,matches:n}),a=a.slice(i.length));if(!i)break}return r?a.length:a?t.error(e):W(e,l).slice(0)},y=t.compile=function(e,t){var r,i=[],n=[],o=q[e+" "];if(!o){for(t||(t=S(e)),r=t.length;r--;)o=v(t[r]),o[U]?i.push(o):n.push(o);o=q(e,x(n,i)),o.selector=e}return o},C=t.select=function(e,t,r,i){var n,o,s,a,l,u="function"==typeof e&&e,c=!i&&S(e=u.selector||e);if(r=r||[],1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(s=o[0]).type&&L.getById&&9===t.nodeType&&M&&I.relative[o[1].type]){if(t=(I.find.ID(s.matches[0].replace(Lt,It),t)||[])[0],!t)return r;u&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(n=ht.needsContext.test(e)?0:o.length;n--&&(s=o[n],!I.relative[a=s.type]);)if((l=I.find[a])&&(i=l(s.matches[0].replace(Lt,It),xt.test(o[0].type)&&p(t.parentNode)||t))){if(o.splice(n,1),e=i.length&&d(o),!e)return J.apply(r,i),r;break}}return(u||y(e,c))(i,t,!M,r,xt.test(e)&&p(t.parentNode)||t),r},L.sortStable=U.split("").sort(z).join("")===U,L.detectDuplicates=!!b,P(),L.sortDetached=n(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),n(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,r){return r?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),L.attributes&&n(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,r){return r||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),n(function(e){return null==e.getAttribute("disabled")})||o(rt,function(e,t,r){var i;return r?void 0:e[t]===!0?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),t}(t);ot.find=pt,ot.expr=pt.selectors,ot.expr[":"]=ot.expr.pseudos,ot.unique=pt.uniqueSort,ot.text=pt.getText,ot.isXMLDoc=pt.isXML,ot.contains=pt.contains;var ct=ot.expr.match.needsContext,dt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Et=/^.[^:#\[\.,]*$/;ot.filter=function(e,t,r){var i=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?ot.find.matchesSelector(i,e)?[i]:[]:ot.find.matches(e,ot.grep(t,function(e){return 1===e.nodeType}))},ot.fn.extend({find:function(e){var t,r=[],i=this,n=i.length;if("string"!=typeof e)return this.pushStack(ot(e).filter(function(){for(t=0;n>t;t++)if(ot.contains(i[t],this))return!0}));for(t=0;n>t;t++)ot.find(e,i[t],r);return r=this.pushStack(n>1?ot.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(n(this,e||[],!1))},not:function(e){return this.pushStack(n(this,e||[],!0))},is:function(e){return!!n(this,"string"==typeof e&&ct.test(e)?ot(e):e||[],!1).length}});var ht,ft=t.document,mt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,gt=ot.fn.init=function(e,t){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:mt.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||ht).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ot?t[0]:t,ot.merge(this,ot.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ft,!0)),dt.test(r[1])&&ot.isPlainObject(t))for(r in t)ot.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=ft.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return ht.find(e);this.length=1,this[0]=i}return this.context=ft,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ot.isFunction(e)?"undefined"!=typeof ht.ready?ht.ready(e):e(ot):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),ot.makeArray(e,this))};gt.prototype=ot.fn,ht=ot(ft);var vt=/^(?:parents|prev(?:Until|All))/,xt={children:!0,contents:!0,next:!0,prev:!0};ot.extend({dir:function(e,t,r){for(var i=[],n=e[t];n&&9!==n.nodeType&&(void 0===r||1!==n.nodeType||!ot(n).is(r));)1===n.nodeType&&i.push(n),n=n[t];return i},sibling:function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r}}),ot.fn.extend({has:function(e){var t,r=ot(e,this),i=r.length;return this.filter(function(){for(t=0;i>t;t++)if(ot.contains(this,r[t]))return!0})},closest:function(e,t){for(var r,i=0,n=this.length,o=[],s=ct.test(e)||"string"!=typeof e?ot(e,t||this.context):0;n>i;i++)for(r=this[i];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(s?s.index(r)>-1:1===r.nodeType&&ot.find.matchesSelector(r,e))){o.push(r);break}return this.pushStack(o.length>1?ot.unique(o):o)},index:function(e){return e?"string"==typeof e?ot.inArray(this[0],ot(e)):ot.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ot.unique(ot.merge(this.get(),ot(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ot.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ot.dir(e,"parentNode")},parentsUntil:function(e,t,r){return ot.dir(e,"parentNode",r)},next:function(e){return o(e,"nextSibling")},prev:function(e){return o(e,"previousSibling")},nextAll:function(e){return ot.dir(e,"nextSibling")},prevAll:function(e){return ot.dir(e,"previousSibling")},nextUntil:function(e,t,r){return ot.dir(e,"nextSibling",r)},prevUntil:function(e,t,r){return ot.dir(e,"previousSibling",r)},siblings:function(e){return ot.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ot.sibling(e.firstChild)},contents:function(e){return ot.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:ot.merge([],e.childNodes)}},function(e,t){ot.fn[e]=function(r,i){var n=ot.map(this,t,r);return"Until"!==e.slice(-5)&&(i=r),i&&"string"==typeof i&&(n=ot.filter(i,n)),this.length>1&&(xt[e]||(n=ot.unique(n)),vt.test(e)&&(n=n.reverse())),this.pushStack(n)}});var Nt=/\S+/g,Lt={};ot.Callbacks=function(e){e="string"==typeof e?Lt[e]||s(e):ot.extend({},e);var t,r,i,n,o,a,l=[],u=!e.once&&[],p=function(s){for(r=e.memory&&s,i=!0,o=a||0,a=0,n=l.length,t=!0;l&&n>o;o++)if(l[o].apply(s[0],s[1])===!1&&e.stopOnFalse){r=!1;break}t=!1,l&&(u?u.length&&p(u.shift()):r?l=[]:c.disable())},c={add:function(){if(l){var i=l.length;!function o(t){ot.each(t,function(t,r){var i=ot.type(r);"function"===i?e.unique&&c.has(r)||l.push(r):r&&r.length&&"string"!==i&&o(r)})}(arguments),t?n=l.length:r&&(a=i,p(r))}return this},remove:function(){return l&&ot.each(arguments,function(e,r){for(var i;(i=ot.inArray(r,l,i))>-1;)l.splice(i,1),t&&(n>=i&&n--,o>=i&&o--)}),this},has:function(e){return e?ot.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],n=0,this},disable:function(){return l=u=r=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,r||c.disable(),this},locked:function(){return!u},fireWith:function(e,r){return!l||i&&!u||(r=r||[],r=[e,r.slice?r.slice():r],t?u.push(r):p(r)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},ot.extend({Deferred:function(e){var t=[["resolve","done",ot.Callbacks("once memory"),"resolved"],["reject","fail",ot.Callbacks("once memory"),"rejected"],["notify","progress",ot.Callbacks("memory")]],r="pending",i={state:function(){return r},always:function(){return n.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ot.Deferred(function(r){ot.each(t,function(t,o){var s=ot.isFunction(e[t])&&e[t];n[o[1]](function(){var e=s&&s.apply(this,arguments);e&&ot.isFunction(e.promise)?e.promise().done(r.resolve).fail(r.reject).progress(r.notify):r[o[0]+"With"](this===i?r.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ot.extend(e,i):i}},n={};return i.pipe=i.then,ot.each(t,function(e,o){var s=o[2],a=o[3];i[o[1]]=s.add,a&&s.add(function(){r=a},t[1^e][2].disable,t[2][2].lock),n[o[0]]=function(){return n[o[0]+"With"](this===n?i:this,arguments),this},n[o[0]+"With"]=s.fireWith}),i.promise(n),e&&e.call(n,n),n},when:function(e){var t,r,i,n=0,o=$.call(arguments),s=o.length,a=1!==s||e&&ot.isFunction(e.promise)?s:0,l=1===a?e:ot.Deferred(),u=function(e,r,i){return function(n){r[e]=this,i[e]=arguments.length>1?$.call(arguments):n,i===t?l.notifyWith(r,i):--a||l.resolveWith(r,i)}};if(s>1)for(t=new Array(s),r=new Array(s),i=new Array(s);s>n;n++)o[n]&&ot.isFunction(o[n].promise)?o[n].promise().done(u(n,i,o)).fail(l.reject).progress(u(n,r,t)):--a;return a||l.resolveWith(i,o),l.promise()}});var It;ot.fn.ready=function(e){return ot.ready.promise().done(e),this},ot.extend({isReady:!1,readyWait:1,holdReady:function(e){e?ot.readyWait++:ot.ready(!0)},ready:function(e){if(e===!0?!--ot.readyWait:!ot.isReady){if(!ft.body)return setTimeout(ot.ready);ot.isReady=!0,e!==!0&&--ot.readyWait>0||(It.resolveWith(ft,[ot]),ot.fn.triggerHandler&&(ot(ft).triggerHandler("ready"),ot(ft).off("ready")))}}}),ot.ready.promise=function(e){if(!It)if(It=ot.Deferred(),"complete"===ft.readyState)setTimeout(ot.ready);else if(ft.addEventListener)ft.addEventListener("DOMContentLoaded",l,!1),t.addEventListener("load",l,!1);else{ft.attachEvent("onreadystatechange",l),t.attachEvent("onload",l);var r=!1;try{r=null==t.frameElement&&ft.documentElement}catch(i){}r&&r.doScroll&&!function n(){if(!ot.isReady){try{r.doScroll("left")}catch(e){return setTimeout(n,50)}a(),ot.ready()}}()}return It.promise(e)};var Tt,At="undefined";for(Tt in ot(it))break;it.ownLast="0"!==Tt,it.inlineBlockNeedsLayout=!1,ot(function(){var e,t,r,i;r=ft.getElementsByTagName("body")[0],r&&r.style&&(t=ft.createElement("div"),i=ft.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(i).appendChild(t),typeof t.style.zoom!==At&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",it.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(r.style.zoom=1)),r.removeChild(i))}),function(){var e=ft.createElement("div");if(null==it.deleteExpando){it.deleteExpando=!0;try{delete e.test}catch(t){it.deleteExpando=!1}}e=null}(),ot.acceptData=function(e){var t=ot.noData[(e.nodeName+" ").toLowerCase()],r=+e.nodeType||1;return 1!==r&&9!==r?!1:!t||t!==!0&&e.getAttribute("classid")===t};var St=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,yt=/([A-Z])/g;ot.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?ot.cache[e[ot.expando]]:e[ot.expando],!!e&&!p(e)},data:function(e,t,r){return c(e,t,r)},removeData:function(e,t){return d(e,t)},_data:function(e,t,r){return c(e,t,r,!0)},_removeData:function(e,t){return d(e,t,!0)}}),ot.fn.extend({data:function(e,t){var r,i,n,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(n=ot.data(o),1===o.nodeType&&!ot._data(o,"parsedAttrs"))){for(r=s.length;r--;)s[r]&&(i=s[r].name,0===i.indexOf("data-")&&(i=ot.camelCase(i.slice(5)),u(o,i,n[i])));ot._data(o,"parsedAttrs",!0)}return n}return"object"==typeof e?this.each(function(){ot.data(this,e)}):arguments.length>1?this.each(function(){ot.data(this,e,t)}):o?u(o,e,ot.data(o,e)):void 0},removeData:function(e){return this.each(function(){ot.removeData(this,e)})}}),ot.extend({queue:function(e,t,r){var i;return e?(t=(t||"fx")+"queue",i=ot._data(e,t),r&&(!i||ot.isArray(r)?i=ot._data(e,t,ot.makeArray(r)):i.push(r)),i||[]):void 0},dequeue:function(e,t){t=t||"fx";var r=ot.queue(e,t),i=r.length,n=r.shift(),o=ot._queueHooks(e,t),s=function(){ot.dequeue(e,t)};"inprogress"===n&&(n=r.shift(),i--),n&&("fx"===t&&r.unshift("inprogress"),delete o.stop,n.call(e,s,o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return ot._data(e,r)||ot._data(e,r,{empty:ot.Callbacks("once memory").add(function(){ot._removeData(e,t+"queue"),ot._removeData(e,r)})})}}),ot.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length<r?ot.queue(this[0],e):void 0===t?this:this.each(function(){var r=ot.queue(this,e,t);ot._queueHooks(this,e),"fx"===e&&"inprogress"!==r[0]&&ot.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ot.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var r,i=1,n=ot.Deferred(),o=this,s=this.length,a=function(){--i||n.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)r=ot._data(o[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),n.promise(t)}});var Ct=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Rt=["Top","Right","Bottom","Left"],Ot=function(e,t){return e=t||e,"none"===ot.css(e,"display")||!ot.contains(e.ownerDocument,e)},bt=ot.access=function(e,t,r,i,n,o,s){var a=0,l=e.length,u=null==r;if("object"===ot.type(r)){n=!0;for(a in r)ot.access(e,t,a,r[a],!0,o,s)}else if(void 0!==i&&(n=!0,ot.isFunction(i)||(s=!0),u&&(s?(t.call(e,i),t=null):(u=t,t=function(e,t,r){return u.call(ot(e),r)})),t))for(;l>a;a++)t(e[a],r,s?i:i.call(e[a],a,t(e[a],r)));return n?e:u?t.call(e):l?t(e[0],r):o},Pt=/^(?:checkbox|radio)$/i;!function(){var e=ft.createElement("input"),t=ft.createElement("div"),r=ft.createDocumentFragment();if(t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",it.leadingWhitespace=3===t.firstChild.nodeType,it.tbody=!t.getElementsByTagName("tbody").length,it.htmlSerialize=!!t.getElementsByTagName("link").length,it.html5Clone="<:nav></:nav>"!==ft.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,r.appendChild(e),it.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",it.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,r.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",it.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,it.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){it.noCloneEvent=!1}),t.cloneNode(!0).click()),null==it.deleteExpando){it.deleteExpando=!0;try{delete t.test}catch(i){it.deleteExpando=!1}}}(),function(){var e,r,i=ft.createElement("div");for(e in{submit:!0,change:!0,focusin:!0})r="on"+e,(it[e+"Bubbles"]=r in t)||(i.setAttribute(r,"t"),it[e+"Bubbles"]=i.attributes[r].expando===!1);i=null}();var Dt=/^(?:input|select|textarea)$/i,_t=/^key/,Mt=/^(?:mouse|pointer|contextmenu)|click/,Gt=/^(?:focusinfocus|focusoutblur)$/,wt=/^([^.]*)(?:\.(.+)|)$/;ot.event={global:{},add:function(e,t,r,i,n){var o,s,a,l,u,p,c,d,E,h,f,m=ot._data(e);if(m){for(r.handler&&(l=r,r=l.handler,n=l.selector),r.guid||(r.guid=ot.guid++),(s=m.events)||(s=m.events={}),(p=m.handle)||(p=m.handle=function(e){return typeof ot===At||e&&ot.event.triggered===e.type?void 0:ot.event.dispatch.apply(p.elem,arguments)},p.elem=e),t=(t||"").match(Nt)||[""],a=t.length;a--;)o=wt.exec(t[a])||[],E=f=o[1],h=(o[2]||"").split(".").sort(),E&&(u=ot.event.special[E]||{},E=(n?u.delegateType:u.bindType)||E,u=ot.event.special[E]||{},c=ot.extend({type:E,origType:f,data:i,handler:r,guid:r.guid,selector:n,needsContext:n&&ot.expr.match.needsContext.test(n),namespace:h.join(".")},l),(d=s[E])||(d=s[E]=[],d.delegateCount=0,u.setup&&u.setup.call(e,i,h,p)!==!1||(e.addEventListener?e.addEventListener(E,p,!1):e.attachEvent&&e.attachEvent("on"+E,p))),u.add&&(u.add.call(e,c),c.handler.guid||(c.handler.guid=r.guid)),n?d.splice(d.delegateCount++,0,c):d.push(c),ot.event.global[E]=!0);e=null}},remove:function(e,t,r,i,n){var o,s,a,l,u,p,c,d,E,h,f,m=ot.hasData(e)&&ot._data(e);if(m&&(p=m.events)){for(t=(t||"").match(Nt)||[""],u=t.length;u--;)if(a=wt.exec(t[u])||[],E=f=a[1],h=(a[2]||"").split(".").sort(),E){for(c=ot.event.special[E]||{},E=(i?c.delegateType:c.bindType)||E,d=p[E]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=d.length;o--;)s=d[o],!n&&f!==s.origType||r&&r.guid!==s.guid||a&&!a.test(s.namespace)||i&&i!==s.selector&&("**"!==i||!s.selector)||(d.splice(o,1),s.selector&&d.delegateCount--,c.remove&&c.remove.call(e,s));l&&!d.length&&(c.teardown&&c.teardown.call(e,h,m.handle)!==!1||ot.removeEvent(e,E,m.handle),delete p[E])}else for(E in p)ot.event.remove(e,E+t[u],r,i,!0);ot.isEmptyObject(p)&&(delete m.handle,ot._removeData(e,"events"))}},trigger:function(e,r,i,n){var o,s,a,l,u,p,c,d=[i||ft],E=rt.call(e,"type")?e.type:e,h=rt.call(e,"namespace")?e.namespace.split("."):[];if(a=p=i=i||ft,3!==i.nodeType&&8!==i.nodeType&&!Gt.test(E+ot.event.triggered)&&(E.indexOf(".")>=0&&(h=E.split("."),E=h.shift(),h.sort()),s=E.indexOf(":")<0&&"on"+E,e=e[ot.expando]?e:new ot.Event(E,"object"==typeof e&&e),e.isTrigger=n?2:3,e.namespace=h.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),r=null==r?[e]:ot.makeArray(r,[e]),u=ot.event.special[E]||{},n||!u.trigger||u.trigger.apply(i,r)!==!1)){if(!n&&!u.noBubble&&!ot.isWindow(i)){for(l=u.delegateType||E,Gt.test(l+E)||(a=a.parentNode);a;a=a.parentNode)d.push(a),p=a; p===(i.ownerDocument||ft)&&d.push(p.defaultView||p.parentWindow||t)}for(c=0;(a=d[c++])&&!e.isPropagationStopped();)e.type=c>1?l:u.bindType||E,o=(ot._data(a,"events")||{})[e.type]&&ot._data(a,"handle"),o&&o.apply(a,r),o=s&&a[s],o&&o.apply&&ot.acceptData(a)&&(e.result=o.apply(a,r),e.result===!1&&e.preventDefault());if(e.type=E,!n&&!e.isDefaultPrevented()&&(!u._default||u._default.apply(d.pop(),r)===!1)&&ot.acceptData(i)&&s&&i[E]&&!ot.isWindow(i)){p=i[s],p&&(i[s]=null),ot.event.triggered=E;try{i[E]()}catch(f){}ot.event.triggered=void 0,p&&(i[s]=p)}return e.result}},dispatch:function(e){e=ot.event.fix(e);var t,r,i,n,o,s=[],a=$.call(arguments),l=(ot._data(this,"events")||{})[e.type]||[],u=ot.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(s=ot.event.handlers.call(this,e,l),t=0;(n=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=n.elem,o=0;(i=n.handlers[o++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((ot.event.special[i.origType]||{}).handle||i.handler).apply(n.elem,a),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var r,i,n,o,s=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(n=[],o=0;a>o;o++)i=t[o],r=i.selector+" ",void 0===n[r]&&(n[r]=i.needsContext?ot(r,this).index(l)>=0:ot.find(r,this,null,[l]).length),n[r]&&n.push(i);n.length&&s.push({elem:l,handlers:n})}return a<t.length&&s.push({elem:this,handlers:t.slice(a)}),s},fix:function(e){if(e[ot.expando])return e;var t,r,i,n=e.type,o=e,s=this.fixHooks[n];for(s||(this.fixHooks[n]=s=Mt.test(n)?this.mouseHooks:_t.test(n)?this.keyHooks:{}),i=s.props?this.props.concat(s.props):this.props,e=new ot.Event(o),t=i.length;t--;)r=i[t],e[r]=o[r];return e.target||(e.target=o.srcElement||ft),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var r,i,n,o=t.button,s=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=e.target.ownerDocument||ft,n=i.documentElement,r=i.body,e.pageX=t.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),e.pageY=t.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?t.toElement:s),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==f()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===f()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return ot.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(e){return ot.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,r,i){var n=ot.extend(new ot.Event,r,{type:e,isSimulated:!0,originalEvent:{}});i?ot.event.trigger(n,null,t):ot.event.dispatch.call(t,n),n.isDefaultPrevented()&&r.preventDefault()}},ot.removeEvent=ft.removeEventListener?function(e,t,r){e.removeEventListener&&e.removeEventListener(t,r,!1)}:function(e,t,r){var i="on"+t;e.detachEvent&&(typeof e[i]===At&&(e[i]=null),e.detachEvent(i,r))},ot.Event=function(e,t){return this instanceof ot.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?E:h):this.type=e,t&&ot.extend(this,t),this.timeStamp=e&&e.timeStamp||ot.now(),void(this[ot.expando]=!0)):new ot.Event(e,t)},ot.Event.prototype={isDefaultPrevented:h,isPropagationStopped:h,isImmediatePropagationStopped:h,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=E,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=E,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=E,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},ot.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){ot.event.special[e]={delegateType:t,bindType:t,handle:function(e){var r,i=this,n=e.relatedTarget,o=e.handleObj;return(!n||n!==i&&!ot.contains(i,n))&&(e.type=o.origType,r=o.handler.apply(this,arguments),e.type=t),r}}}),it.submitBubbles||(ot.event.special.submit={setup:function(){return ot.nodeName(this,"form")?!1:void ot.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,r=ot.nodeName(t,"input")||ot.nodeName(t,"button")?t.form:void 0;r&&!ot._data(r,"submitBubbles")&&(ot.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),ot._data(r,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&ot.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return ot.nodeName(this,"form")?!1:void ot.event.remove(this,"._submit")}}),it.changeBubbles||(ot.event.special.change={setup:function(){return Dt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(ot.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),ot.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),ot.event.simulate("change",this,e,!0)})),!1):void ot.event.add(this,"beforeactivate._change",function(e){var t=e.target;Dt.test(t.nodeName)&&!ot._data(t,"changeBubbles")&&(ot.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||ot.event.simulate("change",this.parentNode,e,!0)}),ot._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return ot.event.remove(this,"._change"),!Dt.test(this.nodeName)}}),it.focusinBubbles||ot.each({focus:"focusin",blur:"focusout"},function(e,t){var r=function(e){ot.event.simulate(t,e.target,ot.event.fix(e),!0)};ot.event.special[t]={setup:function(){var i=this.ownerDocument||this,n=ot._data(i,t);n||i.addEventListener(e,r,!0),ot._data(i,t,(n||0)+1)},teardown:function(){var i=this.ownerDocument||this,n=ot._data(i,t)-1;n?ot._data(i,t,n):(i.removeEventListener(e,r,!0),ot._removeData(i,t))}}}),ot.fn.extend({on:function(e,t,r,i,n){var o,s;if("object"==typeof e){"string"!=typeof t&&(r=r||t,t=void 0);for(o in e)this.on(o,t,r,e[o],n);return this}if(null==r&&null==i?(i=t,r=t=void 0):null==i&&("string"==typeof t?(i=r,r=void 0):(i=r,r=t,t=void 0)),i===!1)i=h;else if(!i)return this;return 1===n&&(s=i,i=function(e){return ot().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=ot.guid++)),this.each(function(){ot.event.add(this,e,i,r,t)})},one:function(e,t,r,i){return this.on(e,t,r,i,1)},off:function(e,t,r){var i,n;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,ot(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(n in e)this.off(n,t,e[n]);return this}return(t===!1||"function"==typeof t)&&(r=t,t=void 0),r===!1&&(r=h),this.each(function(){ot.event.remove(this,e,r,t)})},trigger:function(e,t){return this.each(function(){ot.event.trigger(e,t,this)})},triggerHandler:function(e,t){var r=this[0];return r?ot.event.trigger(e,t,r,!0):void 0}});var kt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Bt=/ jQuery\d+="(?:null|\d+)"/g,Ut=new RegExp("<(?:"+kt+")[\\s/>]","i"),Vt=/^\s+/,Ht=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ft=/<([\w:]+)/,jt=/<tbody/i,Wt=/<|&#?\w+;/,qt=/<(?:script|style|link)/i,zt=/checked\s*(?:[^=]|=\s*.checked.)/i,Xt=/^$|\/(?:java|ecma)script/i,Kt=/^true\/(.*)/,Yt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,$t={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:it.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Zt=m(ft),Qt=Zt.appendChild(ft.createElement("div"));$t.optgroup=$t.option,$t.tbody=$t.tfoot=$t.colgroup=$t.caption=$t.thead,$t.th=$t.td,ot.extend({clone:function(e,t,r){var i,n,o,s,a,l=ot.contains(e.ownerDocument,e);if(it.html5Clone||ot.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Qt.innerHTML=e.outerHTML,Qt.removeChild(o=Qt.firstChild)),!(it.noCloneEvent&&it.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ot.isXMLDoc(e)))for(i=g(o),a=g(e),s=0;null!=(n=a[s]);++s)i[s]&&A(n,i[s]);if(t)if(r)for(a=a||g(e),i=i||g(o),s=0;null!=(n=a[s]);s++)T(n,i[s]);else T(e,o);return i=g(o,"script"),i.length>0&&I(i,!l&&g(e,"script")),i=a=n=null,o},buildFragment:function(e,t,r,i){for(var n,o,s,a,l,u,p,c=e.length,d=m(t),E=[],h=0;c>h;h++)if(o=e[h],o||0===o)if("object"===ot.type(o))ot.merge(E,o.nodeType?[o]:o);else if(Wt.test(o)){for(a=a||d.appendChild(t.createElement("div")),l=(Ft.exec(o)||["",""])[1].toLowerCase(),p=$t[l]||$t._default,a.innerHTML=p[1]+o.replace(Ht,"<$1></$2>")+p[2],n=p[0];n--;)a=a.lastChild;if(!it.leadingWhitespace&&Vt.test(o)&&E.push(t.createTextNode(Vt.exec(o)[0])),!it.tbody)for(o="table"!==l||jt.test(o)?"<table>"!==p[1]||jt.test(o)?0:a:a.firstChild,n=o&&o.childNodes.length;n--;)ot.nodeName(u=o.childNodes[n],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(ot.merge(E,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=d.lastChild}else E.push(t.createTextNode(o));for(a&&d.removeChild(a),it.appendChecked||ot.grep(g(E,"input"),v),h=0;o=E[h++];)if((!i||-1===ot.inArray(o,i))&&(s=ot.contains(o.ownerDocument,o),a=g(d.appendChild(o),"script"),s&&I(a),r))for(n=0;o=a[n++];)Xt.test(o.type||"")&&r.push(o);return a=null,d},cleanData:function(e,t){for(var r,i,n,o,s=0,a=ot.expando,l=ot.cache,u=it.deleteExpando,p=ot.event.special;null!=(r=e[s]);s++)if((t||ot.acceptData(r))&&(n=r[a],o=n&&l[n])){if(o.events)for(i in o.events)p[i]?ot.event.remove(r,i):ot.removeEvent(r,i,o.handle);l[n]&&(delete l[n],u?delete r[a]:typeof r.removeAttribute!==At?r.removeAttribute(a):r[a]=null,Y.push(n))}}}),ot.fn.extend({text:function(e){return bt(this,function(e){return void 0===e?ot.text(this):this.empty().append((this[0]&&this[0].ownerDocument||ft).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=x(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=x(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var r,i=e?ot.filter(e,this):this,n=0;null!=(r=i[n]);n++)t||1!==r.nodeType||ot.cleanData(g(r)),r.parentNode&&(t&&ot.contains(r.ownerDocument,r)&&I(g(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&ot.cleanData(g(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&ot.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return ot.clone(this,e,t)})},html:function(e){return bt(this,function(e){var t=this[0]||{},r=0,i=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Bt,""):void 0;if(!("string"!=typeof e||qt.test(e)||!it.htmlSerialize&&Ut.test(e)||!it.leadingWhitespace&&Vt.test(e)||$t[(Ft.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Ht,"<$1></$2>");try{for(;i>r;r++)t=this[r]||{},1===t.nodeType&&(ot.cleanData(g(t,!1)),t.innerHTML=e);t=0}catch(n){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,ot.cleanData(g(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=Z.apply([],e);var r,i,n,o,s,a,l=0,u=this.length,p=this,c=u-1,d=e[0],E=ot.isFunction(d);if(E||u>1&&"string"==typeof d&&!it.checkClone&&zt.test(d))return this.each(function(r){var i=p.eq(r);E&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t)});if(u&&(a=ot.buildFragment(e,this[0].ownerDocument,!1,this),r=a.firstChild,1===a.childNodes.length&&(a=r),r)){for(o=ot.map(g(a,"script"),N),n=o.length;u>l;l++)i=a,l!==c&&(i=ot.clone(i,!0,!0),n&&ot.merge(o,g(i,"script"))),t.call(this[l],i,l);if(n)for(s=o[o.length-1].ownerDocument,ot.map(o,L),l=0;n>l;l++)i=o[l],Xt.test(i.type||"")&&!ot._data(i,"globalEval")&&ot.contains(s,i)&&(i.src?ot._evalUrl&&ot._evalUrl(i.src):ot.globalEval((i.text||i.textContent||i.innerHTML||"").replace(Yt,"")));a=r=null}return this}}),ot.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ot.fn[e]=function(e){for(var r,i=0,n=[],o=ot(e),s=o.length-1;s>=i;i++)r=i===s?this:this.clone(!0),ot(o[i])[t](r),Q.apply(n,r.get());return this.pushStack(n)}});var Jt,er={};!function(){var e;it.shrinkWrapBlocks=function(){if(null!=e)return e;e=!1;var t,r,i;return r=ft.getElementsByTagName("body")[0],r&&r.style?(t=ft.createElement("div"),i=ft.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(i).appendChild(t),typeof t.style.zoom!==At&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(ft.createElement("div")).style.width="5px",e=3!==t.offsetWidth),r.removeChild(i),e):void 0}}();var tr,rr,ir=/^margin/,nr=new RegExp("^("+Ct+")(?!px)[a-z%]+$","i"),or=/^(top|right|bottom|left)$/;t.getComputedStyle?(tr=function(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)},rr=function(e,t,r){var i,n,o,s,a=e.style;return r=r||tr(e),s=r?r.getPropertyValue(t)||r[t]:void 0,r&&(""!==s||ot.contains(e.ownerDocument,e)||(s=ot.style(e,t)),nr.test(s)&&ir.test(t)&&(i=a.width,n=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=r.width,a.width=i,a.minWidth=n,a.maxWidth=o)),void 0===s?s:s+""}):ft.documentElement.currentStyle&&(tr=function(e){return e.currentStyle},rr=function(e,t,r){var i,n,o,s,a=e.style;return r=r||tr(e),s=r?r[t]:void 0,null==s&&a&&a[t]&&(s=a[t]),nr.test(s)&&!or.test(t)&&(i=a.left,n=e.runtimeStyle,o=n&&n.left,o&&(n.left=e.currentStyle.left),a.left="fontSize"===t?"1em":s,s=a.pixelLeft+"px",a.left=i,o&&(n.left=o)),void 0===s?s:s+""||"auto"}),function(){function e(){var e,r,i,n;r=ft.getElementsByTagName("body")[0],r&&r.style&&(e=ft.createElement("div"),i=ft.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(i).appendChild(e),e.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=s=!1,l=!0,t.getComputedStyle&&(o="1%"!==(t.getComputedStyle(e,null)||{}).top,s="4px"===(t.getComputedStyle(e,null)||{width:"4px"}).width,n=e.appendChild(ft.createElement("div")),n.style.cssText=e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",e.style.width="1px",l=!parseFloat((t.getComputedStyle(n,null)||{}).marginRight)),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",n=e.getElementsByTagName("td"),n[0].style.cssText="margin:0;border:0;padding:0;display:none",a=0===n[0].offsetHeight,a&&(n[0].style.display="",n[1].style.display="none",a=0===n[0].offsetHeight),r.removeChild(i))}var r,i,n,o,s,a,l;r=ft.createElement("div"),r.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=r.getElementsByTagName("a")[0],i=n&&n.style,i&&(i.cssText="float:left;opacity:.5",it.opacity="0.5"===i.opacity,it.cssFloat=!!i.cssFloat,r.style.backgroundClip="content-box",r.cloneNode(!0).style.backgroundClip="",it.clearCloneStyle="content-box"===r.style.backgroundClip,it.boxSizing=""===i.boxSizing||""===i.MozBoxSizing||""===i.WebkitBoxSizing,ot.extend(it,{reliableHiddenOffsets:function(){return null==a&&e(),a},boxSizingReliable:function(){return null==s&&e(),s},pixelPosition:function(){return null==o&&e(),o},reliableMarginRight:function(){return null==l&&e(),l}}))}(),ot.swap=function(e,t,r,i){var n,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];n=r.apply(e,i||[]);for(o in t)e.style[o]=s[o];return n};var sr=/alpha\([^)]*\)/i,ar=/opacity\s*=\s*([^)]*)/,lr=/^(none|table(?!-c[ea]).+)/,ur=new RegExp("^("+Ct+")(.*)$","i"),pr=new RegExp("^([+-])=("+Ct+")","i"),cr={position:"absolute",visibility:"hidden",display:"block"},dr={letterSpacing:"0",fontWeight:"400"},Er=["Webkit","O","Moz","ms"];ot.extend({cssHooks:{opacity:{get:function(e,t){if(t){var r=rr(e,"opacity");return""===r?"1":r}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":it.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var n,o,s,a=ot.camelCase(t),l=e.style;if(t=ot.cssProps[a]||(ot.cssProps[a]=R(l,a)),s=ot.cssHooks[t]||ot.cssHooks[a],void 0===r)return s&&"get"in s&&void 0!==(n=s.get(e,!1,i))?n:l[t];if(o=typeof r,"string"===o&&(n=pr.exec(r))&&(r=(n[1]+1)*n[2]+parseFloat(ot.css(e,t)),o="number"),null!=r&&r===r&&("number"!==o||ot.cssNumber[a]||(r+="px"),it.clearCloneStyle||""!==r||0!==t.indexOf("background")||(l[t]="inherit"),!(s&&"set"in s&&void 0===(r=s.set(e,r,i)))))try{l[t]=r}catch(u){}}},css:function(e,t,r,i){var n,o,s,a=ot.camelCase(t);return t=ot.cssProps[a]||(ot.cssProps[a]=R(e.style,a)),s=ot.cssHooks[t]||ot.cssHooks[a],s&&"get"in s&&(o=s.get(e,!0,r)),void 0===o&&(o=rr(e,t,i)),"normal"===o&&t in dr&&(o=dr[t]),""===r||r?(n=parseFloat(o),r===!0||ot.isNumeric(n)?n||0:o):o}}),ot.each(["height","width"],function(e,t){ot.cssHooks[t]={get:function(e,r,i){return r?lr.test(ot.css(e,"display"))&&0===e.offsetWidth?ot.swap(e,cr,function(){return D(e,t,i)}):D(e,t,i):void 0},set:function(e,r,i){var n=i&&tr(e);return b(e,r,i?P(e,t,i,it.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,n),n):0)}}}),it.opacity||(ot.cssHooks.opacity={get:function(e,t){return ar.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var r=e.style,i=e.currentStyle,n=ot.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=i&&i.filter||r.filter||"";r.zoom=1,(t>=1||""===t)&&""===ot.trim(o.replace(sr,""))&&r.removeAttribute&&(r.removeAttribute("filter"),""===t||i&&!i.filter)||(r.filter=sr.test(o)?o.replace(sr,n):o+" "+n)}}),ot.cssHooks.marginRight=C(it.reliableMarginRight,function(e,t){return t?ot.swap(e,{display:"inline-block"},rr,[e,"marginRight"]):void 0}),ot.each({margin:"",padding:"",border:"Width"},function(e,t){ot.cssHooks[e+t]={expand:function(r){for(var i=0,n={},o="string"==typeof r?r.split(" "):[r];4>i;i++)n[e+Rt[i]+t]=o[i]||o[i-2]||o[0];return n}},ir.test(e)||(ot.cssHooks[e+t].set=b)}),ot.fn.extend({css:function(e,t){return bt(this,function(e,t,r){var i,n,o={},s=0;if(ot.isArray(t)){for(i=tr(e),n=t.length;n>s;s++)o[t[s]]=ot.css(e,t[s],!1,i);return o}return void 0!==r?ot.style(e,t,r):ot.css(e,t)},e,t,arguments.length>1)},show:function(){return O(this,!0)},hide:function(){return O(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ot(this)?ot(this).show():ot(this).hide()})}}),ot.Tween=_,_.prototype={constructor:_,init:function(e,t,r,i,n,o){this.elem=e,this.prop=r,this.easing=n||"swing",this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(ot.cssNumber[r]?"":"px")},cur:function(){var e=_.propHooks[this.prop];return e&&e.get?e.get(this):_.propHooks._default.get(this)},run:function(e){var t,r=_.propHooks[this.prop];return this.pos=t=this.options.duration?ot.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):_.propHooks._default.set(this),this}},_.prototype.init.prototype=_.prototype,_.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ot.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){ot.fx.step[e.prop]?ot.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ot.cssProps[e.prop]]||ot.cssHooks[e.prop])?ot.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},_.propHooks.scrollTop=_.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ot.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ot.fx=_.prototype.init,ot.fx.step={};var hr,fr,mr=/^(?:toggle|show|hide)$/,gr=new RegExp("^(?:([+-])=|)("+Ct+")([a-z%]*)$","i"),vr=/queueHooks$/,xr=[k],Nr={"*":[function(e,t){var r=this.createTween(e,t),i=r.cur(),n=gr.exec(t),o=n&&n[3]||(ot.cssNumber[e]?"":"px"),s=(ot.cssNumber[e]||"px"!==o&&+i)&&gr.exec(ot.css(r.elem,e)),a=1,l=20;if(s&&s[3]!==o){o=o||s[3],n=n||[],s=+i||1;do a=a||".5",s/=a,ot.style(r.elem,e,s+o);while(a!==(a=r.cur()/i)&&1!==a&&--l)}return n&&(s=r.start=+s||+i||0,r.unit=o,r.end=n[1]?s+(n[1]+1)*n[2]:+n[2]),r}]};ot.Animation=ot.extend(U,{tweener:function(e,t){ot.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var r,i=0,n=e.length;n>i;i++)r=e[i],Nr[r]=Nr[r]||[],Nr[r].unshift(t)},prefilter:function(e,t){t?xr.unshift(e):xr.push(e)}}),ot.speed=function(e,t,r){var i=e&&"object"==typeof e?ot.extend({},e):{complete:r||!r&&t||ot.isFunction(e)&&e,duration:e,easing:r&&t||t&&!ot.isFunction(t)&&t};return i.duration=ot.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in ot.fx.speeds?ot.fx.speeds[i.duration]:ot.fx.speeds._default,(null==i.queue||i.queue===!0)&&(i.queue="fx"),i.old=i.complete,i.complete=function(){ot.isFunction(i.old)&&i.old.call(this),i.queue&&ot.dequeue(this,i.queue)},i},ot.fn.extend({fadeTo:function(e,t,r,i){return this.filter(Ot).css("opacity",0).show().end().animate({opacity:t},e,r,i)},animate:function(e,t,r,i){var n=ot.isEmptyObject(e),o=ot.speed(t,r,i),s=function(){var t=U(this,ot.extend({},e),o);(n||ot._data(this,"finish"))&&t.stop(!0)};return s.finish=s,n||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=ot.timers,s=ot._data(this);if(n)s[n]&&s[n].stop&&i(s[n]);else for(n in s)s[n]&&s[n].stop&&vr.test(n)&&i(s[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&ot.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,r=ot._data(this),i=r[e+"queue"],n=r[e+"queueHooks"],o=ot.timers,s=i?i.length:0;for(r.finish=!0,ot.queue(this,e,[]),n&&n.stop&&n.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete r.finish})}}),ot.each(["toggle","show","hide"],function(e,t){var r=ot.fn[t];ot.fn[t]=function(e,i,n){return null==e||"boolean"==typeof e?r.apply(this,arguments):this.animate(G(t,!0),e,i,n)}}),ot.each({slideDown:G("show"),slideUp:G("hide"),slideToggle:G("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ot.fn[e]=function(e,r,i){return this.animate(t,e,r,i)}}),ot.timers=[],ot.fx.tick=function(){var e,t=ot.timers,r=0;for(hr=ot.now();r<t.length;r++)e=t[r],e()||t[r]!==e||t.splice(r--,1);t.length||ot.fx.stop(),hr=void 0},ot.fx.timer=function(e){ot.timers.push(e),e()?ot.fx.start():ot.timers.pop()},ot.fx.interval=13,ot.fx.start=function(){fr||(fr=setInterval(ot.fx.tick,ot.fx.interval))},ot.fx.stop=function(){clearInterval(fr),fr=null},ot.fx.speeds={slow:600,fast:200,_default:400},ot.fn.delay=function(e,t){return e=ot.fx?ot.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,r){var i=setTimeout(t,e);r.stop=function(){clearTimeout(i)}})},function(){var e,t,r,i,n;t=ft.createElement("div"),t.setAttribute("className","t"),t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",i=t.getElementsByTagName("a")[0],r=ft.createElement("select"),n=r.appendChild(ft.createElement("option")),e=t.getElementsByTagName("input")[0],i.style.cssText="top:1px",it.getSetAttribute="t"!==t.className,it.style=/top/.test(i.getAttribute("style")),it.hrefNormalized="/a"===i.getAttribute("href"),it.checkOn=!!e.value,it.optSelected=n.selected,it.enctype=!!ft.createElement("form").enctype,r.disabled=!0,it.optDisabled=!n.disabled,e=ft.createElement("input"),e.setAttribute("value",""),it.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),it.radioValue="t"===e.value}();var Lr=/\r/g;ot.fn.extend({val:function(e){var t,r,i,n=this[0];{if(arguments.length)return i=ot.isFunction(e),this.each(function(r){var n;1===this.nodeType&&(n=i?e.call(this,r,ot(this).val()):e,null==n?n="":"number"==typeof n?n+="":ot.isArray(n)&&(n=ot.map(n,function(e){return null==e?"":e+""})),t=ot.valHooks[this.type]||ot.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,n,"value")||(this.value=n))});if(n)return t=ot.valHooks[n.type]||ot.valHooks[n.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(r=t.get(n,"value"))?r:(r=n.value,"string"==typeof r?r.replace(Lr,""):null==r?"":r)}}}),ot.extend({valHooks:{option:{get:function(e){var t=ot.find.attr(e,"value");return null!=t?t:ot.trim(ot.text(e))}},select:{get:function(e){for(var t,r,i=e.options,n=e.selectedIndex,o="select-one"===e.type||0>n,s=o?null:[],a=o?n+1:i.length,l=0>n?a:o?n:0;a>l;l++)if(r=i[l],!(!r.selected&&l!==n||(it.optDisabled?r.disabled:null!==r.getAttribute("disabled"))||r.parentNode.disabled&&ot.nodeName(r.parentNode,"optgroup"))){if(t=ot(r).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var r,i,n=e.options,o=ot.makeArray(t),s=n.length;s--;)if(i=n[s],ot.inArray(ot.valHooks.option.get(i),o)>=0)try{i.selected=r=!0}catch(a){i.scrollHeight}else i.selected=!1;return r||(e.selectedIndex=-1),n}}}}),ot.each(["radio","checkbox"],function(){ot.valHooks[this]={set:function(e,t){return ot.isArray(t)?e.checked=ot.inArray(ot(e).val(),t)>=0:void 0}},it.checkOn||(ot.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Ir,Tr,Ar=ot.expr.attrHandle,Sr=/^(?:checked|selected)$/i,yr=it.getSetAttribute,Cr=it.input;ot.fn.extend({attr:function(e,t){return bt(this,ot.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ot.removeAttr(this,e)})}}),ot.extend({attr:function(e,t,r){var i,n,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===At?ot.prop(e,t,r):(1===o&&ot.isXMLDoc(e)||(t=t.toLowerCase(),i=ot.attrHooks[t]||(ot.expr.match.bool.test(t)?Tr:Ir)),void 0===r?i&&"get"in i&&null!==(n=i.get(e,t))?n:(n=ot.find.attr(e,t),null==n?void 0:n):null!==r?i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:(e.setAttribute(t,r+""),r):void ot.removeAttr(e,t))},removeAttr:function(e,t){var r,i,n=0,o=t&&t.match(Nt);if(o&&1===e.nodeType)for(;r=o[n++];)i=ot.propFix[r]||r,ot.expr.match.bool.test(r)?Cr&&yr||!Sr.test(r)?e[i]=!1:e[ot.camelCase("default-"+r)]=e[i]=!1:ot.attr(e,r,""),e.removeAttribute(yr?r:i)},attrHooks:{type:{set:function(e,t){if(!it.radioValue&&"radio"===t&&ot.nodeName(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}}}),Tr={set:function(e,t,r){return t===!1?ot.removeAttr(e,r):Cr&&yr||!Sr.test(r)?e.setAttribute(!yr&&ot.propFix[r]||r,r):e[ot.camelCase("default-"+r)]=e[r]=!0,r}},ot.each(ot.expr.match.bool.source.match(/\w+/g),function(e,t){var r=Ar[t]||ot.find.attr;Ar[t]=Cr&&yr||!Sr.test(t)?function(e,t,i){var n,o;return i||(o=Ar[t],Ar[t]=n,n=null!=r(e,t,i)?t.toLowerCase():null,Ar[t]=o),n}:function(e,t,r){return r?void 0:e[ot.camelCase("default-"+t)]?t.toLowerCase():null}}),Cr&&yr||(ot.attrHooks.value={set:function(e,t,r){return ot.nodeName(e,"input")?void(e.defaultValue=t):Ir&&Ir.set(e,t,r)}}),yr||(Ir={set:function(e,t,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=t+="","value"===r||t===e.getAttribute(r)?t:void 0}},Ar.id=Ar.name=Ar.coords=function(e,t,r){var i;return r?void 0:(i=e.getAttributeNode(t))&&""!==i.value?i.value:null},ot.valHooks.button={get:function(e,t){var r=e.getAttributeNode(t);return r&&r.specified?r.value:void 0},set:Ir.set},ot.attrHooks.contenteditable={set:function(e,t,r){Ir.set(e,""===t?!1:t,r)}},ot.each(["width","height"],function(e,t){ot.attrHooks[t]={set:function(e,r){return""===r?(e.setAttribute(t,"auto"),r):void 0}}})),it.style||(ot.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Rr=/^(?:input|select|textarea|button|object)$/i,Or=/^(?:a|area)$/i;ot.fn.extend({prop:function(e,t){return bt(this,ot.prop,e,t,arguments.length>1)},removeProp:function(e){return e=ot.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),ot.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,r){var i,n,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!ot.isXMLDoc(e),o&&(t=ot.propFix[t]||t,n=ot.propHooks[t]),void 0!==r?n&&"set"in n&&void 0!==(i=n.set(e,r,t))?i:e[t]=r:n&&"get"in n&&null!==(i=n.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=ot.find.attr(e,"tabindex");return t?parseInt(t,10):Rr.test(e.nodeName)||Or.test(e.nodeName)&&e.href?0:-1}}}}),it.hrefNormalized||ot.each(["href","src"],function(e,t){ot.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),it.optSelected||(ot.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),ot.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ot.propFix[this.toLowerCase()]=this}),it.enctype||(ot.propFix.enctype="encoding");var br=/[\t\r\n\f]/g;ot.fn.extend({addClass:function(e){var t,r,i,n,o,s,a=0,l=this.length,u="string"==typeof e&&e;if(ot.isFunction(e))return this.each(function(t){ot(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(Nt)||[];l>a;a++)if(r=this[a],i=1===r.nodeType&&(r.className?(" "+r.className+" ").replace(br," "):" ")){for(o=0;n=t[o++];)i.indexOf(" "+n+" ")<0&&(i+=n+" ");s=ot.trim(i),r.className!==s&&(r.className=s)}return this},removeClass:function(e){var t,r,i,n,o,s,a=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e; if(ot.isFunction(e))return this.each(function(t){ot(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(Nt)||[];l>a;a++)if(r=this[a],i=1===r.nodeType&&(r.className?(" "+r.className+" ").replace(br," "):"")){for(o=0;n=t[o++];)for(;i.indexOf(" "+n+" ")>=0;)i=i.replace(" "+n+" "," ");s=e?ot.trim(i):"",r.className!==s&&(r.className=s)}return this},toggleClass:function(e,t){var r=typeof e;return"boolean"==typeof t&&"string"===r?t?this.addClass(e):this.removeClass(e):this.each(ot.isFunction(e)?function(r){ot(this).toggleClass(e.call(this,r,this.className,t),t)}:function(){if("string"===r)for(var t,i=0,n=ot(this),o=e.match(Nt)||[];t=o[i++];)n.hasClass(t)?n.removeClass(t):n.addClass(t);else(r===At||"boolean"===r)&&(this.className&&ot._data(this,"__className__",this.className),this.className=this.className||e===!1?"":ot._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",r=0,i=this.length;i>r;r++)if(1===this[r].nodeType&&(" "+this[r].className+" ").replace(br," ").indexOf(t)>=0)return!0;return!1}}),ot.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){ot.fn[t]=function(e,r){return arguments.length>0?this.on(t,null,e,r):this.trigger(t)}}),ot.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,r){return this.on(e,null,t,r)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,r,i){return this.on(t,e,r,i)},undelegate:function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)}});var Pr=ot.now(),Dr=/\?/,_r=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;ot.parseJSON=function(e){if(t.JSON&&t.JSON.parse)return t.JSON.parse(e+"");var r,i=null,n=ot.trim(e+"");return n&&!ot.trim(n.replace(_r,function(e,t,n,o){return r&&t&&(i=0),0===i?e:(r=n||t,i+=!o-!n,"")}))?Function("return "+n)():ot.error("Invalid JSON: "+e)},ot.parseXML=function(e){var r,i;if(!e||"string"!=typeof e)return null;try{t.DOMParser?(i=new DOMParser,r=i.parseFromString(e,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(e))}catch(n){r=void 0}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||ot.error("Invalid XML: "+e),r};var Mr,Gr,wr=/#.*$/,kr=/([?&])_=[^&]*/,Br=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ur=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Vr=/^(?:GET|HEAD)$/,Hr=/^\/\//,Fr=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,jr={},Wr={},qr="*/".concat("*");try{Gr=location.href}catch(zr){Gr=ft.createElement("a"),Gr.href="",Gr=Gr.href}Mr=Fr.exec(Gr.toLowerCase())||[],ot.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Gr,type:"GET",isLocal:Ur.test(Mr[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qr,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ot.parseJSON,"text xml":ot.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?F(F(e,ot.ajaxSettings),t):F(ot.ajaxSettings,e)},ajaxPrefilter:V(jr),ajaxTransport:V(Wr),ajax:function(e,t){function r(e,t,r,i){var n,p,g,v,N,I=t;2!==x&&(x=2,a&&clearTimeout(a),u=void 0,s=i||"",L.readyState=e>0?4:0,n=e>=200&&300>e||304===e,r&&(v=j(c,L,r)),v=W(c,v,L,n),n?(c.ifModified&&(N=L.getResponseHeader("Last-Modified"),N&&(ot.lastModified[o]=N),N=L.getResponseHeader("etag"),N&&(ot.etag[o]=N)),204===e||"HEAD"===c.type?I="nocontent":304===e?I="notmodified":(I=v.state,p=v.data,g=v.error,n=!g)):(g=I,(e||!I)&&(I="error",0>e&&(e=0))),L.status=e,L.statusText=(t||I)+"",n?h.resolveWith(d,[p,I,L]):h.rejectWith(d,[L,I,g]),L.statusCode(m),m=void 0,l&&E.trigger(n?"ajaxSuccess":"ajaxError",[L,c,n?p:g]),f.fireWith(d,[L,I]),l&&(E.trigger("ajaxComplete",[L,c]),--ot.active||ot.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,n,o,s,a,l,u,p,c=ot.ajaxSetup({},t),d=c.context||c,E=c.context&&(d.nodeType||d.jquery)?ot(d):ot.event,h=ot.Deferred(),f=ot.Callbacks("once memory"),m=c.statusCode||{},g={},v={},x=0,N="canceled",L={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!p)for(p={};t=Br.exec(s);)p[t[1].toLowerCase()]=t[2];t=p[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?s:null},setRequestHeader:function(e,t){var r=e.toLowerCase();return x||(e=v[r]=v[r]||e,g[e]=t),this},overrideMimeType:function(e){return x||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else L.always(e[L.status]);return this},abort:function(e){var t=e||N;return u&&u.abort(t),r(0,t),this}};if(h.promise(L).complete=f.add,L.success=L.done,L.error=L.fail,c.url=((e||c.url||Gr)+"").replace(wr,"").replace(Hr,Mr[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=ot.trim(c.dataType||"*").toLowerCase().match(Nt)||[""],null==c.crossDomain&&(i=Fr.exec(c.url.toLowerCase()),c.crossDomain=!(!i||i[1]===Mr[1]&&i[2]===Mr[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(Mr[3]||("http:"===Mr[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=ot.param(c.data,c.traditional)),H(jr,c,t,L),2===x)return L;l=c.global,l&&0===ot.active++&&ot.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Vr.test(c.type),o=c.url,c.hasContent||(c.data&&(o=c.url+=(Dr.test(o)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=kr.test(o)?o.replace(kr,"$1_="+Pr++):o+(Dr.test(o)?"&":"?")+"_="+Pr++)),c.ifModified&&(ot.lastModified[o]&&L.setRequestHeader("If-Modified-Since",ot.lastModified[o]),ot.etag[o]&&L.setRequestHeader("If-None-Match",ot.etag[o])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&L.setRequestHeader("Content-Type",c.contentType),L.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+qr+"; q=0.01":""):c.accepts["*"]);for(n in c.headers)L.setRequestHeader(n,c.headers[n]);if(c.beforeSend&&(c.beforeSend.call(d,L,c)===!1||2===x))return L.abort();N="abort";for(n in{success:1,error:1,complete:1})L[n](c[n]);if(u=H(Wr,c,t,L)){L.readyState=1,l&&E.trigger("ajaxSend",[L,c]),c.async&&c.timeout>0&&(a=setTimeout(function(){L.abort("timeout")},c.timeout));try{x=1,u.send(g,r)}catch(I){if(!(2>x))throw I;r(-1,I)}}else r(-1,"No Transport");return L},getJSON:function(e,t,r){return ot.get(e,t,r,"json")},getScript:function(e,t){return ot.get(e,void 0,t,"script")}}),ot.each(["get","post"],function(e,t){ot[t]=function(e,r,i,n){return ot.isFunction(r)&&(n=n||i,i=r,r=void 0),ot.ajax({url:e,type:t,dataType:n,data:r,success:i})}}),ot.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ot.fn[t]=function(e){return this.on(t,e)}}),ot._evalUrl=function(e){return ot.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ot.fn.extend({wrapAll:function(e){if(ot.isFunction(e))return this.each(function(t){ot(this).wrapAll(e.call(this,t))});if(this[0]){var t=ot(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(ot.isFunction(e)?function(t){ot(this).wrapInner(e.call(this,t))}:function(){var t=ot(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)})},wrap:function(e){var t=ot.isFunction(e);return this.each(function(r){ot(this).wrapAll(t?e.call(this,r):e)})},unwrap:function(){return this.parent().each(function(){ot.nodeName(this,"body")||ot(this).replaceWith(this.childNodes)}).end()}}),ot.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!it.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||ot.css(e,"display"))},ot.expr.filters.visible=function(e){return!ot.expr.filters.hidden(e)};var Xr=/%20/g,Kr=/\[\]$/,Yr=/\r?\n/g,$r=/^(?:submit|button|image|reset|file)$/i,Zr=/^(?:input|select|textarea|keygen)/i;ot.param=function(e,t){var r,i=[],n=function(e,t){t=ot.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=ot.ajaxSettings&&ot.ajaxSettings.traditional),ot.isArray(e)||e.jquery&&!ot.isPlainObject(e))ot.each(e,function(){n(this.name,this.value)});else for(r in e)q(r,e[r],t,n);return i.join("&").replace(Xr,"+")},ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ot.prop(this,"elements");return e?ot.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ot(this).is(":disabled")&&Zr.test(this.nodeName)&&!$r.test(e)&&(this.checked||!Pt.test(e))}).map(function(e,t){var r=ot(this).val();return null==r?null:ot.isArray(r)?ot.map(r,function(e){return{name:t.name,value:e.replace(Yr,"\r\n")}}):{name:t.name,value:r.replace(Yr,"\r\n")}}).get()}}),ot.ajaxSettings.xhr=void 0!==t.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&z()||X()}:z;var Qr=0,Jr={},ei=ot.ajaxSettings.xhr();t.ActiveXObject&&ot(t).on("unload",function(){for(var e in Jr)Jr[e](void 0,!0)}),it.cors=!!ei&&"withCredentials"in ei,ei=it.ajax=!!ei,ei&&ot.ajaxTransport(function(e){if(!e.crossDomain||it.cors){var t;return{send:function(r,i){var n,o=e.xhr(),s=++Qr;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(n in e.xhrFields)o[n]=e.xhrFields[n];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(n in r)void 0!==r[n]&&o.setRequestHeader(n,r[n]+"");o.send(e.hasContent&&e.data||null),t=function(r,n){var a,l,u;if(t&&(n||4===o.readyState))if(delete Jr[s],t=void 0,o.onreadystatechange=ot.noop,n)4!==o.readyState&&o.abort();else{u={},a=o.status,"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(p){l=""}a||!e.isLocal||e.crossDomain?1223===a&&(a=204):a=u.text?200:404}u&&i(a,l,u,o.getAllResponseHeaders())},e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=Jr[s]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ot.globalEval(e),e}}}),ot.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),ot.ajaxTransport("script",function(e){if(e.crossDomain){var t,r=ft.head||ot("head")[0]||ft.documentElement;return{send:function(i,n){t=ft.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,r){(r||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,r||n(200,"success"))},r.insertBefore(t,r.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var ti=[],ri=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=ti.pop()||ot.expando+"_"+Pr++;return this[e]=!0,e}}),ot.ajaxPrefilter("json jsonp",function(e,r,i){var n,o,s,a=e.jsonp!==!1&&(ri.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&ri.test(e.data)&&"data");return a||"jsonp"===e.dataTypes[0]?(n=e.jsonpCallback=ot.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(ri,"$1"+n):e.jsonp!==!1&&(e.url+=(Dr.test(e.url)?"&":"?")+e.jsonp+"="+n),e.converters["script json"]=function(){return s||ot.error(n+" was not called"),s[0]},e.dataTypes[0]="json",o=t[n],t[n]=function(){s=arguments},i.always(function(){t[n]=o,e[n]&&(e.jsonpCallback=r.jsonpCallback,ti.push(n)),s&&ot.isFunction(o)&&o(s[0]),s=o=void 0}),"script"):void 0}),ot.parseHTML=function(e,t,r){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(r=t,t=!1),t=t||ft;var i=dt.exec(e),n=!r&&[];return i?[t.createElement(i[1])]:(i=ot.buildFragment([e],t,n),n&&n.length&&ot(n).remove(),ot.merge([],i.childNodes))};var ii=ot.fn.load;ot.fn.load=function(e,t,r){if("string"!=typeof e&&ii)return ii.apply(this,arguments);var i,n,o,s=this,a=e.indexOf(" ");return a>=0&&(i=ot.trim(e.slice(a,e.length)),e=e.slice(0,a)),ot.isFunction(t)?(r=t,t=void 0):t&&"object"==typeof t&&(o="POST"),s.length>0&&ot.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){n=arguments,s.html(i?ot("<div>").append(ot.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,n||[e.responseText,t,e])}),this},ot.expr.filters.animated=function(e){return ot.grep(ot.timers,function(t){return e===t.elem}).length};var ni=t.document.documentElement;ot.offset={setOffset:function(e,t,r){var i,n,o,s,a,l,u,p=ot.css(e,"position"),c=ot(e),d={};"static"===p&&(e.style.position="relative"),a=c.offset(),o=ot.css(e,"top"),l=ot.css(e,"left"),u=("absolute"===p||"fixed"===p)&&ot.inArray("auto",[o,l])>-1,u?(i=c.position(),s=i.top,n=i.left):(s=parseFloat(o)||0,n=parseFloat(l)||0),ot.isFunction(t)&&(t=t.call(e,r,a)),null!=t.top&&(d.top=t.top-a.top+s),null!=t.left&&(d.left=t.left-a.left+n),"using"in t?t.using.call(e,d):c.css(d)}},ot.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ot.offset.setOffset(this,e,t)});var t,r,i={top:0,left:0},n=this[0],o=n&&n.ownerDocument;if(o)return t=o.documentElement,ot.contains(t,n)?(typeof n.getBoundingClientRect!==At&&(i=n.getBoundingClientRect()),r=K(o),{top:i.top+(r.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(r.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):i},position:function(){if(this[0]){var e,t,r={top:0,left:0},i=this[0];return"fixed"===ot.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ot.nodeName(e[0],"html")||(r=e.offset()),r.top+=ot.css(e[0],"borderTopWidth",!0),r.left+=ot.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-ot.css(i,"marginTop",!0),left:t.left-r.left-ot.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||ni;e&&!ot.nodeName(e,"html")&&"static"===ot.css(e,"position");)e=e.offsetParent;return e||ni})}}),ot.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r=/Y/.test(t);ot.fn[e]=function(i){return bt(this,function(e,i,n){var o=K(e);return void 0===n?o?t in o?o[t]:o.document.documentElement[i]:e[i]:void(o?o.scrollTo(r?ot(o).scrollLeft():n,r?n:ot(o).scrollTop()):e[i]=n)},e,i,arguments.length,null)}}),ot.each(["top","left"],function(e,t){ot.cssHooks[t]=C(it.pixelPosition,function(e,r){return r?(r=rr(e,t),nr.test(r)?ot(e).position()[t]+"px":r):void 0})}),ot.each({Height:"height",Width:"width"},function(e,t){ot.each({padding:"inner"+e,content:t,"":"outer"+e},function(r,i){ot.fn[i]=function(i,n){var o=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||n===!0?"margin":"border");return bt(this,function(t,r,i){var n;return ot.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(n=t.documentElement,Math.max(t.body["scroll"+e],n["scroll"+e],t.body["offset"+e],n["offset"+e],n["client"+e])):void 0===i?ot.css(t,r,s):ot.style(t,r,i,s)},t,o?i:void 0,o,null)}})}),ot.fn.size=function(){return this.length},ot.fn.andSelf=ot.fn.addBack,"function"==typeof e&&e.amd&&e("jquery",[],function(){return ot});var oi=t.jQuery,si=t.$;return ot.noConflict=function(e){return t.$===ot&&(t.$=si),e&&t.jQuery===ot&&(t.jQuery=oi),ot},typeof r===At&&(t.jQuery=t.$=ot),ot})},{}],9:[function(t,r){!function(t){function i(){try{return u in t&&t[u]}catch(e){return!1}}function n(e){return function(){var t=Array.prototype.slice.call(arguments,0);t.unshift(s),c.appendChild(s),s.addBehavior("#default#userData"),s.load(u);var r=e.apply(a,t);return c.removeChild(s),r}}function o(e){return e.replace(/^d/,"___$&").replace(h,"___")}var s,a={},l=t.document,u="localStorage",p="script";if(a.disabled=!1,a.set=function(){},a.get=function(){},a.remove=function(){},a.clear=function(){},a.transact=function(e,t,r){var i=a.get(e);null==r&&(r=t,t=null),"undefined"==typeof i&&(i=t||{}),r(i),a.set(e,i)},a.getAll=function(){},a.forEach=function(){},a.serialize=function(e){return JSON.stringify(e)},a.deserialize=function(e){if("string"!=typeof e)return void 0;try{return JSON.parse(e)}catch(t){return e||void 0}},i())s=t[u],a.set=function(e,t){return void 0===t?a.remove(e):(s.setItem(e,a.serialize(t)),t)},a.get=function(e){return a.deserialize(s.getItem(e))},a.remove=function(e){s.removeItem(e)},a.clear=function(){s.clear()},a.getAll=function(){var e={};return a.forEach(function(t,r){e[t]=r}),e},a.forEach=function(e){for(var t=0;t<s.length;t++){var r=s.key(t);e(r,a.get(r))}};else if(l.documentElement.addBehavior){var c,d;try{d=new ActiveXObject("htmlfile"),d.open(),d.write("<"+p+">document.w=window</"+p+'><iframe src="/favicon.ico"></iframe>'),d.close(),c=d.w.frames[0].document,s=c.createElement("div")}catch(E){s=l.createElement("div"),c=l.body}var h=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");a.set=n(function(e,t,r){return t=o(t),void 0===r?a.remove(t):(e.setAttribute(t,a.serialize(r)),e.save(u),r)}),a.get=n(function(e,t){return t=o(t),a.deserialize(e.getAttribute(t))}),a.remove=n(function(e,t){t=o(t),e.removeAttribute(t),e.save(u)}),a.clear=n(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(u);for(var r,i=0;r=t[i];i++)e.removeAttribute(r.name);e.save(u)}),a.getAll=function(){var e={};return a.forEach(function(t,r){e[t]=r}),e},a.forEach=n(function(e,t){for(var r,i=e.XMLDocument.documentElement.attributes,n=0;r=i[n];++n)t(r.name,a.deserialize(e.getAttribute(r.name)))})}try{var f="__storejs__";a.set(f,f),a.get(f)!=f&&(a.disabled=!0),a.remove(f)}catch(E){a.disabled=!0}a.enabled=!a.disabled,"undefined"!=typeof r&&r.exports&&this.module!==r?r.exports=a:"function"==typeof e&&e.amd?e(a):t.store=a}(Function("return this")())},{}],10:[function(e,t){t.exports={name:"YASQE",description:"Yet Another SPARQL Query Editor",version:"1.0.0",main:"build/yasqe.js",licenses:[{type:"MIT",url:"https://github.com/LaurensRietveld/yasgui/blob/master/license.txt"}],devDependencies:{gulp:"~3.6.0","vinyl-source-stream":"~0.1.1",watchify:"^0.6.4","gulp-uglify":"^0.2.1","gulp-concat":"^2.2.0","gulp-minify-css":"^0.3.0","gulp-browserify":"^0.5.0","vinyl-buffer":"0.0.0",browserify:"^3.38.1",express:"^3.5.1","connect-livereload":"^0.3.2","gulp-livereload":"^1.3.1","gulp-util":"^2.2.14","gulp-connect":"^2.0.5","gulp-notify":"^1.2.5","gulp-embedlr":"^0.5.2","gulp-changed":"^0.3.0","gulp-imagemin":"^0.2.0","gulp-open":"^0.2.8",connect:"^2.14.4","gulp-debug":"^0.3.0",amplify:"0.0.11","twitter-bootstrap-3.0.0":"^3.0.0","gulp-yuidoc":"^0.1.2","gulp-jsvalidate":"^0.2.0"},bugs:"https://github.com/YASGUI/YASQE/issues/",keywords:["JavaScript","SPARQL","Editor","Semantic Web","Linked Data"],homepage:"http://yasgui.github.io/YASQE",maintainers:[{name:"Laurens Rietveld",email:"laurens.rietveld@gmail.com",web:"http://laurensrietveld.nl"}],repository:{type:"git",url:"todo"},readme:"TODO",dependencies:{jquery:"~ 1.11.0",codemirror:"~4.1.0",amplify:"0.0.11",store:"^1.3.14","twitter-bootstrap-3.0.0":"^3.0.0","browserify-shim":"~3.2.0"},"browserify-shim":{"twitter-bootstrap-3.0.0":"bootstrap"},browserify:{transform:["browserify-shim"]}}},{}],11:[function(e,t){"use strict";function r(e,t,i){var n=e.getTokenAt({line:t,ch:i.start});return null!=n&&"ws"==n.type&&(n=r(e,t,n)),n}var i=e("jquery"),n=e("codemirror");e("codemirror/addon/hint/show-hint.js"),e("codemirror/addon/search/searchcursor.js"),e("codemirror/addon/edit/matchbrackets.js"),e("codemirror/addon/runmode/runmode.js"),console=console||{log:function(){}},e("../lib/flint.js");var o=e("../lib/trie.js"),s=t.exports=function(e,t){t=a(t);var r=l(n(e,t));return u(r),r},a=function(e){var t=i.extend(!0,{},s.defaults,e);return t},l=function(t){return t.query=function(e){s.executeQuery(t,e)},t.storeBulkCompletions=function(r,i){p[r]=new o;for(var n=0;n<i.length;n++)p[r].insert(i[n]);var s=C(t,t.options.autocompletions[r].persistent);s&&e("./storage.js").set(s,i,"month")},t},u=function(t){var r=C(t,t.options.persistent);if(r){var i=e("./storage.js").get(r);i&&t.setValue(i)}if(t.on("blur",function(e){s.storeQuery(e)}),t.on("change",function(e){N(e,!0),s.autoComplete(e,!0),s.appendPrefixIfNeeded(e)}),N(t,!0),t.options.autocompletions)for(var n in t.options.autocompletions)t.options.autocompletions[n].bulk&&E(t,n)},p={},c={"string-2":"prefixed"},d=function(e,t){var r=!1;try{void 0!==e[t]&&(r=!0)}catch(i){}return r},E=function(t,r){var i=null;if(d(t.options.autocompletions[r],"get")&&(i=t.options.autocompletions[r].get),i instanceof Array)t.storeBulkCompletions(r,i);else{var n=null;if(C(t,t.options.autocompletions[r].persistent)&&(n=e("./storage.js").get(C(t,t.options.autocompletions[r].persistent))),n&&n instanceof Array&&n.length>0)t.storeBulkCompletions(r,n);else if(i instanceof Function){var o=i(t);o&&o instanceof Array&&o.length>0&&t.storeBulkCompletions(r,o)}}},h=function(e){for(var t={},r=e.lineCount(),i=0;r>i;i++){var n=g(e,i);if(null!=n&&"PREFIX"==n.string.toUpperCase()){var o=g(e,i,n.end+1);if(o){var s=g(e,i,o.end+1);if(null!=o&&o.string.length>0&&null!=s&&s.string.length>0){var a=s.string;0==a.indexOf("<")&&(a=a.substring(1)),">"==a.slice(-1)&&(a=a.substring(0,a.length-1)),t[o.string]=a}}}}return t},f=function(e,t){for(var r=null,i=0,n=e.lineCount(),o=0;n>o;o++){var s=g(e,o);null==s||"PREFIX"!=s.string&&"BASE"!=s.string||(r=s,i=o)}if(null==r)e.replaceRange("PREFIX "+t+"\n",{line:0,ch:0});else{var a=m(e,i);e.replaceRange("\n"+a+"PREFIX "+t,{line:i})}},m=function(e,t,r){void 0==r&&(r=1);var i=e.getTokenAt({line:t,ch:r});return null==i||void 0==i||"ws"!=i.type?"":i.string+m(e,t,i.end+1)},g=function(e,t,r){void 0==r&&(r=1);var i=e.getTokenAt({line:t,ch:r});return null==i||void 0==i||i.end<r?null:"ws"==i.type?g(e,t,i.end+1):i},v=!1,x=null,N=function(e,t){var r=!0;x&&(x(),x=null),e.clearGutter("gutterErrorBar");for(var i=null,n=0;n<e.lineCount();++n){var o=!1;if(v||(o=!0),i=e.getTokenAt({line:n,ch:e.getLine(n).length},o).state,0==i.OK){var s=document.createElement("span");s.innerHTML="&rarr;",s.className="gutterError",e.setGutterMarker(n,"gutterErrorBar",s),x=function(){e.markText({line:n,ch:i.errorStartPos},{line:n,ch:i.errorEndPos},"sp-error")},r=!1;break}}if(v=r,t&&null!=i&&void 0!=i.stack){var a=i.stack,l=i.stack.length;l>1?r=!1:1==l&&"solutionModifier"!=a[0]&&"?limitOffsetClauses"!=a[0]&&"?offsetClause"!=a[0]&&(r=!1)}};i.extend(s,n),s.fromTextArea=function(e,t){t=a(t);var r=l(n.fromTextArea(e,t));return u(r),r},s.fetchFromPrefixCc=function(e){i.get("http://prefix.cc/popular/all.file.json",function(t){var r=[];for(var i in t)if("bif"!=i){var n=i+": <"+t[i]+">";r.push(n)}e.storeBulkCompletions("prefixes",r)})},s.determineId=function(e){return i(e.getWrapperElement()).closest("[id]").attr("id")},s.storeQuery=function(t){var r=C(t,t.options.persistent);r&&e("./storage.js").set(r,t.getValue(),"month")},s.commentLines=function(e){for(var t=e.getCursor(!0).line,r=e.getCursor(!1).line,i=Math.min(t,r),n=Math.max(t,r),o=!0,s=i;n>=s;s++){var a=e.getLine(s);if(0==a.length||"#"!=a.substring(0,1)){o=!1;break}}for(var s=i;n>=s;s++)o?e.replaceRange("",{line:s,ch:0},{line:s,ch:1}):e.replaceRange("#",{line:s,ch:0})},s.copyLineUp=function(e){var t=e.getCursor(),r=e.lineCount();e.replaceRange("\n",{line:r-1,ch:e.getLine(r-1).length});for(var i=r;i>t.line;i--){var n=e.getLine(i-1);e.replaceRange(n,{line:i,ch:0},{line:i,ch:e.getLine(i).length})}},s.copyLineDown=function(e){s.copyLineUp(e);var t=e.getCursor();t.line++,e.setCursor(t)},s.doAutoFormat=function(e){if(e.somethingSelected()){var t={line:e.getCursor(!1).line,ch:e.getSelection().length};R(e,e.getCursor(!0),t)}else{var r=e.lineCount(),i=e.getTextArea().value.length;R(e,{line:0,ch:0},{line:r,ch:i})}},s.executeQuery=function(e,t){var r="function"==typeof t?t:null,n="object"==typeof t?t:{};if(e.options.query&&(n=i.extend({},e.options.query,n)),n.endpoint&&0!=n.endpoint.length){var o={url:n.endpoint,type:n.requestMethod,data:[{name:"query",value:e.getValue()}],headers:{Accept:n.acceptHeader}},s=!1;if(n.handlers)for(var a in n.handlers)n.handlers[a]&&(s=!0,o[a]=n.handlers[a]);if(s||r){if(r&&(o.complete=r),n.namedGraphs&&n.namedGraphs.length>0)for(var l=0;l<n.namedGraphs.length;l++)o.data.push({name:"named-graph-uri",value:n.namedGraphs[l]});if(n.defaultGraphs&&n.defaultGraphs.length>0)for(var l=0;l<n.defaultGraphs.length;l++)o.data.push({name:"default-graph-uri",value:n.defaultGraphs[l]});n.headers&&!i.isEmptyObject(n.headers)&&i.extend(o.headers,n.headers),n.args&&n.args.length>0&&i.merge(o.data,n.args),i.ajax(o)}}};var L={properties:function(e){var t=I(e);if("var"==t.type)return!1;if(i.inArray("a",t.state.possibleCurrent)>=0)return!0;var n=e.getCursor(),o=r(e,n.line,t);return"rdfs:subPropertyOf"==o.string?!0:!1},classes:function(e){var t=I(e);if("var"==t.type)return!1;var i=e.getCursor(),n=r(e,i.line,t);return"a"==n.string?!0:"rdf:type"==n.string?!0:"rdfs:domain"==n.string?!0:"rdfs:range"==n.string?!0:!1},prefixes:function(e){var t=e.getCursor(),r=e.getTokenAt(t);if(e.getLine(t.line).length>t.ch)return!1;if("ws"!=r.type&&(r=I(e)),0==!r.string.indexOf("a")&&-1==i.inArray("PNAME_NS",r.state.possibleCurrent))return!1;var n=g(e,t.line);return null==n||"PREFIX"!=n.string.toUpperCase()?!1:!0}};s.autoComplete=function(e,t){if(!e.somethingSelected()&&e.options.autocompletions){var r=function(r){if(t&&(!e.options.autocompletions[r].autoShow||e.options.autocompletions[r].async))return!1;var i={closeCharacters:/(?=a)b/,type:r,completeSingle:!1};e.options.autocompletions[r].async&&(i.async=!0);s.showHint(e,y[r],i);return!0};for(var i in e.options.autocompletions)if(L[i](e)&&(!e.options.autocompletions[i].handlers||!e.options.autocompletions[i].handlers.validPosition||e.options.autocompletions[i].handlers.validPosition(e)!==!1)){var n=r(i);if(n)break}}},s.appendPrefixIfNeeded=function(e){if(p.prefixes){var t=e.getCursor(),r=e.getTokenAt(t);if("prefixed"==c[r.type]){var i=r.string.indexOf(":");if(-1!==i){var n=g(e,t.line).string.toUpperCase(),o=e.getTokenAt({line:t.line,ch:r.start});if("PREFIX"!=n&&("ws"==o.type||null==o.type)){var s=r.string.substring(0,i+1),a=h(e);if(null==a[s]){var l=p.prefixes.autoComplete(s);l.length>0&&f(e,l[0])}}}}}};var I=function(e,t,r){r||(r=e.getCursor()),t||(t=e.getTokenAt(r));var i=e.getTokenAt({line:r.line,ch:t.start});return null!=i.type&&"ws"!=i.type?(t.start=i.start,t.string=i.string+t.string,I(e,t,{line:r.line,ch:i.start})):t},T=function(e,t){var r=null;if(t.string.indexOf(":")>-1||0==t.string.indexOf("<")){r={},t=I(e,t);var i=h(e);if(0==!t.string.indexOf("<")&&(r.tokenPrefix=t.string.substring(0,t.string.indexOf(":")+1),null!=i[r.tokenPrefix]&&(r.tokenPrefixUri=i[r.tokenPrefix])),r.uri=t.string,0==!t.string.indexOf("<")&&t.string.indexOf(":")>-1)for(var n in i)if(i.hasOwnProperty(n)&&0==t.string.indexOf(n)){r.uri=i[n],r.uri+=t.string.substring(n.length);break}0==r.uri.indexOf("<")&&(r.uri=r.uri.substring(1)),-1!==r.uri.indexOf(">",r.length-1)&&(r.uri=r.uri.substring(0,r.uri.length-1))}return r},A=function(e,t,r){var i=[];if(p[t])i=p[t].autoComplete(r);else if("function"==typeof e.options.autocompletions[t].get&&0==e.options.autocompletions[t].async)i=e.options.autocompletions[t].get(e,r,t);else if("object"==typeof e.options.autocompletions[t].get)for(var n=r.length,o=0;o<e.options.autocompletions[t].get.length;o++){var s=e.options.autocompletions[t].get[o];s.slice(0,n)==r&&i.push(s)}return i};s.fetchFromLov=function(e,t,r,n){var o=50,s={q:t,page:1};s.type="classes"==r?"class":"property";var a=[],l="",u=function(){l="http://lov.okfn.org/dataset/lov/api/v2/autocomplete/terms?"+i.param(s)};u();var p=function(){s.page++,u()},c=function(){i.get(l,function(e){for(var t=0;t<e.results.length;t++)a.push(e.results[t].uri);a.length<e.total_results&&a.length<o?(p(),c()):n(a)}).fail(function(e,t,r){console.log(r)})};c()};var S=function(e,t,r){r.text!=e.getTokenAt(e.getCursor()).string&&e.replaceRange(r.text,t.from,t.to)},y={};y.resourceHints=function(e,t,r){var i=function(r){for(var i=[],l=0;l<r.length;l++){var u=r[l];null!=a.tokenPrefix&&null!=a.uri?(u=u.substring(a.tokenPrefixUri.length),u=a.tokenPrefix+u):u="<"+u+">",i.push({text:u,displayText:u,hint:S,className:t+"Hint"})}var p={completionToken:a.uri,list:i,from:{line:o.line,ch:n.start},to:{line:o.line,ch:n.end}};if(e.options.autocompletions[t].handlers)for(var c in e.options.autocompletions[t].handlers)e.options.autocompletions[t].handlers[c]&&s.on(p,c,e.options.autocompletions[t].handlers[c]);return p},n=I(e),o=e.getCursor(),a=T(e,n);if(a){if(!e.options.autocompletions[t].async)return i(A(e,t,a.uri));var l=function(e){r(i(e))};e.options.autocompletions[t].get(e,a.uri,t,l)}},y.properties=function(e,t){return y.resourceHints(e,"properties",t)},y.classes=function(e,t){return y.resourceHints(e,"classes",t)},y.prefixes=function(e,t){var r="prefixes",i=I(e),n=e.getCursor(),o=function(){i=/\s*/.test(i.string)&&"PREFIX"==e.getTokenAt({line:n.line,ch:i.start}).string.toUpperCase()?{start:n.ch,end:n.ch,string:"",state:i.state}:I(e,i,n)},a=function(t){var o={completionToken:i.uri,list:t,from:{line:n.line,ch:i.start},to:{line:n.line,ch:i.end}};if(e.options.autocompletions[r].handlers)for(var a in e.options.autocompletions[r].handlers)e.options.autocompletions[r].handlers[a]&&s.on(o,a,e.options.autocompletions[r].handlers[a]);return o};if(o(),i){if(!e.options.autocompletions[r].async)return a(A(e,r,i.string));var l=function(e){t(a(e))};e.options.autocompletions[r].get(e,i.uri,r,l)}};var C=function(e,t){var r=null;return t&&(r="string"==typeof t?t:t(e)),r},R=function(e,t,r){var i=e.indexFromPos(t),n=e.indexFromPos(r),o=O(e.getValue(),i,n);e.operation(function(){e.replaceRange(o,t,r);for(var n=e.posFromIndex(i).line,s=e.posFromIndex(i+o.length).line,a=n;s>=a;a++)e.indentLine(a,"smart")})},O=function(e,t,r){e=e.substring(t,r);var o=[["keyword","ws","prefixed","ws","uri"],["keyword","ws","uri"]],s=["{",".",";"],a=["}"],l=function(e){for(var t=0;t<o.length;t++)if(c.valueOf().toString()==o[t].valueOf().toString())return 1;for(var t=0;t<s.length;t++)if(e==s[t])return 1;for(var t=0;t<a.length;t++)if(""!=i.trim(p)&&e==a[t])return-1;return 0},u="",p="",c=[];return n.runMode(e,"sparql11",function(e,t){c.push(t);var r=l(e,t);0!=r?(1==r?(u+=e+"\n",p=""):(u+="\n"+e,p=e),c=[]):(p+=e,u+=e),1==c.length&&"sp-ws"==c[0]&&(c=[])}),i.trim(u.replace(/\n\s*\n/g,"\n"))};s.defaults=i.extend(s.defaults,{mode:"sparql11",value:"SELECT * {?x ?y ?z} \nLIMIT 10",highlightSelectionMatches:{showToken:/\w/},tabMode:"indent",lineNumbers:!0,gutters:["gutterErrorBar","CodeMirror-linenumbers"],matchBrackets:!0,fixedGutter:!0,extraKeys:{"Ctrl-Space":s.autoComplete,"Cmd-Space":s.autoComplete,"Ctrl-D":s.deleteLine,"Ctrl-K":s.deleteLine,"Cmd-D":s.deleteLine,"Cmd-K":s.deleteLine,"Ctrl-/":s.commentLines,"Cmd-/":s.commentLines,"Ctrl-Alt-Down":s.copyLineDown,"Ctrl-Alt-Up":s.copyLineUp,"Cmd-Alt-Down":s.copyLineDown,"Cmd-Alt-Up":s.copyLineUp,"Shift-Ctrl-F":s.doAutoFormat,"Shift-Cmd-F":s.doAutoFormat,"Ctrl-]":s.indentMore,"Cmd-]":s.indentMore,"Ctrl-[":s.indentLess,"Cmd-[":s.indentLess,"Ctrl-S":s.storeQuery,"Cmd-S":s.storeQuery,"Ctrl-Enter":s.executeQuery,"Cmd-Enter":s.executeQuery},cursorHeight:.9,persistent:function(e){return"queryVal_"+s.determineId(e)},autocompletions:{prefixes:{get:s.getFromPrefixCc,async:!1,bulk:!0,autoShow:!0,autoAddDeclaration:!0,persistent:"prefixes",handlers:{validPosition:null,showHint:null,shown:null,select:null,pick:null,close:null}},properties:{get:s.fetchFromLov,async:!0,bulk:!1,autoShow:!1,persistent:"properties",handlers:{validPosition:null,showHint:null,shown:null,select:null,pick:null,close:null}},classes:{get:s.fetchFromLov,async:!0,bulk:!1,autoShow:!1,persistent:"classes",handlers:{validPosition:null,showHint:null,shown:null,select:null,pick:null,close:null}}},query:{endpoint:"http://dbpedia.org/sparql",requestMethod:"GET",acceptHeader:"application/sparql-results+json",namedGraphs:[],defaultGraphs:[],args:[],headers:{},handlers:{beforeSend:null,complete:null,error:null,success:null}}}),s.version={CodeMirror:n.version,YASQE:e("../package.json").version} },{"../lib/flint.js":1,"../lib/trie.js":2,"../package.json":10,"./storage.js":12,codemirror:7,"codemirror/addon/edit/matchbrackets.js":3,"codemirror/addon/hint/show-hint.js":4,"codemirror/addon/runmode/runmode.js":5,"codemirror/addon/search/searchcursor.js":6,jquery:8}],12:[function(e,t){{var r=e("store"),i={day:function(){return 864e5},month:function(){30*i.day()},year:function(){12*i.month()}};t.exports={set:function(e,t,n){"string"==typeof n&&(n=i[n]()),r.set(e,{val:t,exp:n,time:(new Date).getTime()})},get:function(e){var t=r.get(e);return t?t.exp&&(new Date).getTime()-t.time>t.exp?null:t.val:null}}}},{store:9}]},{},[11])(11)});
src/svg-icons/av/radio.js
lawrence-yu/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvRadio = (props) => ( <SvgIcon {...props}> <path d="M3.24 6.15C2.51 6.43 2 7.17 2 8v12c0 1.1.89 2 2 2h16c1.11 0 2-.9 2-2V8c0-1.11-.89-2-2-2H8.3l8.26-3.34L15.88 1 3.24 6.15zM7 20c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm13-8h-2v-2h-2v2H4V8h16v4z"/> </SvgIcon> ); AvRadio = pure(AvRadio); AvRadio.displayName = 'AvRadio'; AvRadio.muiName = 'SvgIcon'; export default AvRadio;
js/src/3rdparty/sms-verification/terms-of-service.js
BSDStudios/parity
// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // Parity is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with Parity. If not, see <http://www.gnu.org/licenses/>. import React from 'react'; export default ( <ul> <li>This privacy notice relates to your use of the Parity SMS verification service. We take your privacy seriously and deal in an honest, direct and transparent way when it comes to your data.</li> <li>We collect your phone number when you use this service. This is temporarily kept in memory, and then encrypted and stored in our EU servers. We only retain the cryptographic hash of the number to prevent duplicated accounts. You consent to this use.</li> <li>You pay a fee for the cost of this service using the account you want to verify.</li> <li>Your phone number is transmitted to a third party US SMS verification service Twilio for the sole purpose of the SMS verification. You consent to this use. Twilio’s privacy policy is here: <a href={ 'https://www.twilio.com/legal/privacy/developer' }>https://www.twilio.com/legal/privacy/developer</a>.</li> <li><i>Parity Technology Limited</i> is registered in England and Wales under company number <code>09760015</code> and complies with the Data Protection Act 1998 (UK). You may contact us via email at <a href={ 'mailto:admin@parity.io' }>admin@parity.io</a>. Our general privacy policy can be found here: <a href={ 'https://ethcore.io/legal.html' }>https://ethcore.io/legal.html</a>.</li> </ul> );
app/containers/users/list.js
DeividasK/my-future-ai
import React from 'react' import { Link } from 'react-router' import { connect } from 'react-redux' import { firebaseConnect, helpers } from 'react-redux-firebase' import { Container, Button, Card, CardBlock, CardImg, CardTitle, CardSubtitle, CardText, InputGroup, Input, InputGroupButton } from 'reactstrap' import PageHeading from 'components/helper/PageHeading' import UserCard from 'components/UserCard' import Empty from 'components/helper/Empty' import ViewButton from 'components/buttons/view' const populates = [{ child: 'goals', root: 'goals' }] @firebaseConnect(() => ([ { path: 'users', populates } ])) @connect(({ firebase }) => ({ allUsers: helpers.populatedDataToJS(firebase, 'users', populates), auth: helpers.pathToJS(firebase, 'auth') })) export default class UsersContainer extends React.Component { render () { if (this.props.auth.uid !== 'PpYyJpxIXEhn5i4tvS9xa3I8RHg1') { return <Empty /> } let connections = [] _.each(this.props.allUsers, (value, key) => { // Remove self from list if (key === this.props.auth.uid) { return } connections.push(_.assign(value, { uid: key })) }) return ( <Container> <PageHeading>Users</PageHeading> <div className="card-columns"> { connections.map((person, index) => { return ( <UserCard key={ index } profile={ person }> <ViewButton action={ `/users/${person.uid}` }/> </UserCard> ) }) } </div> </Container> ) } }
plugins/Wallet/js/components/transactionlist.js
NebulousLabs/New-Sia-UI
import PropTypes from 'prop-types' import React from 'react' import { List } from 'immutable' const TransactionList = ({ transactions, ntransactions, actions, filter }) => { if (transactions.size === 0) { return ( <div className='transaction-list'> <h3> No recent transactions </h3> </div> ) } const prettyTimestamp = timestamp => { const pad = n => String('0' + n).slice(-2) const yesterday = new Date() yesterday.setHours(yesterday.getHours() - 24) if (timestamp > yesterday) { return ( 'Today at ' + pad(timestamp.getHours()) + ':' + pad(timestamp.getMinutes()) ) } return ( timestamp.getFullYear() + '-' + pad(timestamp.getMonth() + 1) + '-' + pad(timestamp.getDate()) + ' ' + pad(timestamp.getHours()) + ':' + pad(timestamp.getMinutes()) ) } const transactionComponents = transactions .take(ntransactions) .filter(txn => { if (!filter) { return true } return ( txn.transactionsums.totalSiacoin.abs().gt(0) || txn.transactionsums.totalSiafund.abs().gt(0) || txn.transactionsums.totalMiner.abs().gt(0) ) }) .map((txn, key) => { let valueData = '' if (txn.transactionsums.totalSiacoin.abs().gt(0)) { valueData += txn.transactionsums.totalSiacoin .round(4) .toNumber() .toLocaleString() + ' SC ' } if (txn.transactionsums.totalSiafund.abs().gt(0)) { valueData += txn.transactionsums.totalSiafund .round(4) .toNumber() .toLocaleString() + ' SF ' } if (txn.transactionsums.totalMiner.abs().gt(0)) { valueData += txn.transactionsums.totalMiner .round(4) .toNumber() .toLocaleString() + ' SC (miner) ' } if (valueData === '') { valueData = '0 SC' } return ( <tr key={key}> <td> {txn.confirmed ? prettyTimestamp(txn.confirmationtimestamp) : 'Not Confirmed'} </td> <td>{valueData}</td> <td className='txid'>{txn.transactionid}</td> <td> {txn.confirmed ? ( <i className='fa fa-check-square confirmed-icon'> Confirmed </i> ) : ( <i className='fa fa-clock-o unconfirmed-icon'> Unconfirmed </i> )} </td> </tr> ) }) const onMoreClick = () => actions.showMoreTransactions() const onToggleFilter = () => actions.toggleFilter() return ( <div className='transaction-list'> <div className='transaction-header'> <h2> Recent Transactions </h2> <div className='filter-toggle'> <input type='checkbox' onClick={onToggleFilter} checked={filter} /> Hide 0SC Transactions </div> </div> <table className='pure-table transaction-table'> <thead> <tr> <th>Date</th> <th>Net Value</th> <th>Transaction ID</th> <th>Confirmation Status</th> </tr> </thead> <tbody>{transactionComponents}</tbody> </table> {transactions.size > ntransactions ? ( <div className='load-more'> <button className='load-more-button' onClick={onMoreClick}> More Transactions </button> </div> ) : null} </div> ) } TransactionList.propTypes = { transactions: PropTypes.instanceOf(List).isRequired, ntransactions: PropTypes.number.isRequired, filter: PropTypes.bool.isRequired } export default TransactionList
node_modules/react-navigation/lib-rn/views/Card.js
joan17cast/Enigma
import React from 'react'; import { Animated, StyleSheet } from 'react-native'; import createPointerEventsContainer from './PointerEventsContainer'; var babelPluginFlowReactPropTypes_proptype_NavigationSceneRendererProps = require('../TypeDefinition').babelPluginFlowReactPropTypes_proptype_NavigationSceneRendererProps || require('prop-types').any; /** * Component that renders the scene as card for the <NavigationCardStack />. */ class Card extends React.Component { render() { const { children, pointerEvents, style } = this.props; return <Animated.View pointerEvents={pointerEvents} ref={this.props.onComponentRef} style={[styles.main, style]}> {children} </Animated.View>; } } const styles = StyleSheet.create({ main: { backgroundColor: '#E9E9EF', bottom: 0, left: 0, position: 'absolute', right: 0, shadowColor: 'black', shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.4, shadowRadius: 10, top: 0 } }); Card = createPointerEventsContainer(Card); export default Card;
ajax/libs/yui/3.11.0/datatable-body/datatable-body.js
gauravarora/cdnjs
YUI.add('datatable-body', function (Y, NAME) { /** View class responsible for rendering the `<tbody>` section of a table. Used as the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes. @module datatable @submodule datatable-body @since 3.5.0 **/ var Lang = Y.Lang, isArray = Lang.isArray, isNumber = Lang.isNumber, isString = Lang.isString, fromTemplate = Lang.sub, htmlEscape = Y.Escape.html, toArray = Y.Array, bind = Y.bind, YObject = Y.Object, valueRegExp = /\{value\}/g; /** View class responsible for rendering the `<tbody>` section of a table. Used as the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes. Translates the provided `modelList` into a rendered `<tbody>` based on the data in the constituent Models, altered or amended by any special column configurations. The `columns` configuration, passed to the constructor, determines which columns will be rendered. The rendering process involves constructing an HTML template for a complete row of data, built by concatenating a customized copy of the instance's `CELL_TEMPLATE` into the `ROW_TEMPLATE` once for each column. This template is then populated with values from each Model in the `modelList`, aggregating a complete HTML string of all row and column data. A `<tbody>` Node is then created from the markup and any column `nodeFormatter`s are applied. Supported properties of the column objects include: * `key` - Used to link a column to an attribute in a Model. * `name` - Used for columns that don't relate to an attribute in the Model (`formatter` or `nodeFormatter` only) if the implementer wants a predictable name to refer to in their CSS. * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this column only. * `formatter` - Used to customize or override the content value from the Model. These do not have access to the cell or row Nodes and should return string (HTML) content. * `nodeFormatter` - Used to provide content for a cell as well as perform any custom modifications on the cell or row Node that could not be performed by `formatter`s. Should be used sparingly for better performance. * `emptyCellValue` - String (HTML) value to use if the Model data for a column, or the content generated by a `formatter`, is the empty string, `null`, or `undefined`. * `allowHTML` - Set to `true` if a column value, `formatter`, or `emptyCellValue` can contain HTML. This defaults to `false` to protect against XSS. * `className` - Space delimited CSS classes to add to all `<td>`s in a column. A column `formatter` can be: * a function, as described below. * a string which can be: * the name of a pre-defined formatter function which can be located in the `Y.DataTable.BodyView.Formatters` hash using the value of the `formatter` property as the index. * A template that can use the `{value}` placeholder to include the value for the current cell or the name of any field in the underlaying model also enclosed in curly braces. Any number and type of these placeholders can be used. Column `formatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `className` - Initially empty string to allow `formatter`s to add CSS classes to the cell's `<td>`. * `rowIndex` - The zero-based row number. * `rowClass` - Initially empty string to allow `formatter`s to add CSS classes to the cell's containing row `<tr>`. They may return a value or update `o.value` to assign specific HTML content. A returned value has higher precedence. Column `nodeFormatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `td` - The `<td>` Node instance. * `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`. When adding content to the cell, prefer appending into this property. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `rowIndex` - The zero-based row number. They are expected to inject content into the cell's Node directly, including any "empty" cell content. Each `nodeFormatter` will have access through the Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as it will not be attached yet. If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be `destroy()`ed to remove them from the Node cache and free up memory. The DOM elements will remain as will any content added to them. _It is highly advisable to always return `false` from your `nodeFormatter`s_. @class BodyView @namespace DataTable @extends View @since 3.5.0 **/ Y.namespace('DataTable').BodyView = Y.Base.create('tableBody', Y.View, [], { // -- Instance properties ------------------------------------------------- /** HTML template used to create table cells. @property CELL_TEMPLATE @type {HTML} @default '<td {headers} class="{className}">{content}</td>' @since 3.5.0 **/ CELL_TEMPLATE: '<td {headers} class="{className}">{content}</td>', /** CSS class applied to even rows. This is assigned at instantiation. For DataTable, this will be `yui3-datatable-even`. @property CLASS_EVEN @type {String} @default 'yui3-table-even' @since 3.5.0 **/ //CLASS_EVEN: null /** CSS class applied to odd rows. This is assigned at instantiation. When used by DataTable instances, this will be `yui3-datatable-odd`. @property CLASS_ODD @type {String} @default 'yui3-table-odd' @since 3.5.0 **/ //CLASS_ODD: null /** HTML template used to create table rows. @property ROW_TEMPLATE @type {HTML} @default '<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>' @since 3.5.0 **/ ROW_TEMPLATE : '<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>', /** The object that serves as the source of truth for column and row data. This property is assigned at instantiation from the `host` property of the configuration object passed to the constructor. @property host @type {Object} @default (initially unset) @since 3.5.0 **/ //TODO: should this be protected? //host: null, /** HTML templates used to create the `<tbody>` containing the table rows. @property TBODY_TEMPLATE @type {HTML} @default '<tbody class="{className}">{content}</tbody>' @since 3.6.0 **/ TBODY_TEMPLATE: '<tbody class="{className}"></tbody>', // -- Public methods ------------------------------------------------------ /** Returns the `<td>` Node from the given row and column index. Alternately, the `seed` can be a Node. If so, the nearest ancestor cell is returned. If the `seed` is a cell, it is returned. If there is no cell at the given coordinates, `null` is returned. Optionally, include an offset array or string to return a cell near the cell identified by the `seed`. The offset can be an array containing the number of rows to shift followed by the number of columns to shift, or one of "above", "below", "next", or "previous". <pre><code>// Previous cell in the previous row var cell = table.getCell(e.target, [-1, -1]); // Next cell var cell = table.getCell(e.target, 'next'); var cell = table.getCell(e.target, [0, 1];</pre></code> @method getCell @param {Number[]|Node} seed Array of row and column indexes, or a Node that is either the cell itself or a descendant of one. @param {Number[]|String} [shift] Offset by which to identify the returned cell Node @return {Node} @since 3.5.0 **/ getCell: function (seed, shift) { var tbody = this.tbodyNode, row, cell, index, rowIndexOffset; if (seed && tbody) { if (isArray(seed)) { row = tbody.get('children').item(seed[0]); cell = row && row.get('children').item(seed[1]); } else if (Y.instanceOf(seed, Y.Node)) { cell = seed.ancestor('.' + this.getClassName('cell'), true); } if (cell && shift) { rowIndexOffset = tbody.get('firstChild.rowIndex'); if (isString(shift)) { // TODO this should be a static object map switch (shift) { case 'above' : shift = [-1, 0]; break; case 'below' : shift = [1, 0]; break; case 'next' : shift = [0, 1]; break; case 'previous': shift = [0, -1]; break; } } if (isArray(shift)) { index = cell.get('parentNode.rowIndex') + shift[0] - rowIndexOffset; row = tbody.get('children').item(index); index = cell.get('cellIndex') + shift[1]; cell = row && row.get('children').item(index); } } } return cell || null; }, /** Returns the generated CSS classname based on the input. If the `host` attribute is configured, it will attempt to relay to its `getClassName` or use its static `NAME` property as a string base. If `host` is absent or has neither method nor `NAME`, a CSS classname will be generated using this class's `NAME`. @method getClassName @param {String} token* Any number of token strings to assemble the classname from. @return {String} @protected @since 3.5.0 **/ getClassName: function () { var host = this.host, args; if (host && host.getClassName) { return host.getClassName.apply(host, arguments); } else { args = toArray(arguments); args.unshift(this.constructor.NAME); return Y.ClassNameManager.getClassName .apply(Y.ClassNameManager, args); } }, /** Returns the Model associated to the row Node or id provided. Passing the Node or id for a descendant of the row also works. If no Model can be found, `null` is returned. @method getRecord @param {String|Node} seed Row Node or `id`, or one for a descendant of a row @return {Model} @since 3.5.0 **/ getRecord: function (seed) { var modelList = this.get('modelList'), tbody = this.tbodyNode, row = null, record; if (tbody) { if (isString(seed)) { seed = tbody.one('#' + seed); } if (Y.instanceOf(seed, Y.Node)) { row = seed.ancestor(function (node) { return node.get('parentNode').compareTo(tbody); }, true); record = row && modelList.getByClientId(row.getData('yui3-record')); } } return record || null; }, /** Returns the `<tr>` Node from the given row index, Model, or Model's `clientId`. If the rows haven't been rendered yet, or if the row can't be found by the input, `null` is returned. @method getRow @param {Number|String|Model} id Row index, Model instance, or clientId @return {Node} @since 3.5.0 **/ getRow: function (id) { var tbody = this.tbodyNode, row = null; if (tbody) { if (id) { id = this._idMap[id.get ? id.get('clientId') : id] || id; } row = isNumber(id) ? tbody.get('children').item(id) : tbody.one('#' + id); } return row; }, /** Creates the table's `<tbody>` content by assembling markup generated by populating the `ROW\_TEMPLATE`, and `CELL\_TEMPLATE` templates with content from the `columns` and `modelList` attributes. The rendering process happens in three stages: 1. A row template is assembled from the `columns` attribute (see `_createRowTemplate`) 2. An HTML string is built up by concatenating the application of the data in each Model in the `modelList` to the row template. For cells with `formatter`s, the function is called to generate cell content. Cells with `nodeFormatter`s are ignored. For all other cells, the data value from the Model attribute for the given column key is used. The accumulated row markup is then inserted into the container. 3. If any column is configured with a `nodeFormatter`, the `modelList` is iterated again to apply the `nodeFormatter`s. Supported properties of the column objects include: * `key` - Used to link a column to an attribute in a Model. * `name` - Used for columns that don't relate to an attribute in the Model (`formatter` or `nodeFormatter` only) if the implementer wants a predictable name to refer to in their CSS. * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this column only. * `formatter` - Used to customize or override the content value from the Model. These do not have access to the cell or row Nodes and should return string (HTML) content. * `nodeFormatter` - Used to provide content for a cell as well as perform any custom modifications on the cell or row Node that could not be performed by `formatter`s. Should be used sparingly for better performance. * `emptyCellValue` - String (HTML) value to use if the Model data for a column, or the content generated by a `formatter`, is the empty string, `null`, or `undefined`. * `allowHTML` - Set to `true` if a column value, `formatter`, or `emptyCellValue` can contain HTML. This defaults to `false` to protect against XSS. * `className` - Space delimited CSS classes to add to all `<td>`s in a column. Column `formatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `className` - Initially empty string to allow `formatter`s to add CSS classes to the cell's `<td>`. * `rowIndex` - The zero-based row number. * `rowClass` - Initially empty string to allow `formatter`s to add CSS classes to the cell's containing row `<tr>`. They may return a value or update `o.value` to assign specific HTML content. A returned value has higher precedence. Column `nodeFormatter`s are passed an object (`o`) with the following properties: * `value` - The current value of the column's associated attribute, if any. * `td` - The `<td>` Node instance. * `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`. When adding content to the cell, prefer appending into this property. * `data` - An object map of Model keys to their current values. * `record` - The Model instance. * `column` - The column configuration object for the current column. * `rowIndex` - The zero-based row number. They are expected to inject content into the cell's Node directly, including any "empty" cell content. Each `nodeFormatter` will have access through the Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as it will not be attached yet. If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be `destroy()`ed to remove them from the Node cache and free up memory. The DOM elements will remain as will any content added to them. _It is highly advisable to always return `false` from your `nodeFormatter`s_. @method render @return {BodyView} The instance @chainable @since 3.5.0 **/ render: function () { var table = this.get('container'), data = this.get('modelList'), columns = this.get('columns'), tbody = this.tbodyNode || (this.tbodyNode = this._createTBodyNode()); // Needed for mutation this._createRowTemplate(columns); if (data) { tbody.setHTML(this._createDataHTML(columns)); this._applyNodeFormatters(tbody, columns); } if (tbody.get('parentNode') !== table) { table.appendChild(tbody); } this.bindUI(); return this; }, /** Refreshes the provided row against the provided model and the Array of columns to be updated. @method refreshRow @param {Y.Node} row @param {Y.Model} model Y.Model representation of the row @param {Object[]} columns Array of column configuration objects @chainable */ refreshRow: function (row, model, columns) { var key, cell, len = columns.length, i; for (i = 0; i < len; i++) { key = columns[i]; cell = row.one('.' + this.getClassName('col', key)); this.refreshCell(cell, model); } return this; }, /** Refreshes the given cell with the provided model data and the provided column configuration. Uses the provided column formatter if aviable. @method refreshCell @param {Y.Node} cell Y.Node pointer to the cell element to be updated @param {Y.Model} [model] Y.Model representation of the row @param {Object} [col] Column configuration object for the cell @chainable */ refreshCell: function (cell, model, col) { var content, formatterFn, formatterData, data = model.toJSON(); cell = this.getCell(cell); model || (model = this.getRecord(cell)); col || (col = this.getColumn(cell)); if (col.nodeFormatter) { formatterData = { cell: cell.one('.' + this.getClassName('liner')) || cell, column: col, data: data, record: model, rowIndex: this._getRowIndex(cell.ancestor('tr')), td: cell, value: data[col.key] }; keep = col.nodeFormatter.call(host,formatterData); if (keep === false) { // Remove from the Node cache to reduce // memory footprint. This also purges events, // which you shouldn't be scoping to a cell // anyway. You've been warned. Incidentally, // you should always return false. Just sayin. cell.destroy(true); } } else if (col.formatter) { if (!col._formatterFn) { col = this._setColumnsFormatterFn([col])[0]; } formatterFn = col._formatterFn || null; if (formatterFn) { formatterData = { value : data[col.key], data : data, column : col, record : model, className: '', rowClass : '', rowIndex : this._getRowIndex(cell.ancestor('tr')) }; // Formatters can either return a value ... content = formatterFn.call(this.get('host'), formatterData); // ... or update the value property of the data obj passed if (content === undefined) { content = formatterData.value; } } if (content === undefined || content === null || content === '') { content = col.emptyCellValue || ''; } } else { content = data[col.key] || col.emptyCellValue || ''; } cell.setHTML(col.allowHTML ? content : Y.Escape.html(content)); return this; }, /** Returns column data from this.get('columns'). If a Y.Node is provided as the key, will try to determine the key from the classname @method getColumn @param {String|Y.Node} key @return {Object} Returns column configuration */ getColumn: function (key) { if (Y.instanceOf(key, Y.Node)) { // get column name from node key = key.get('className').match( new RegExp( this.getClassName('col') +'-([^ ]*)' ) )[1]; } var cols = this.get('columns'), col = null; Y.Array.some(cols, function (_col) { if (_col.key === key) { col = _col; return true; } }); return col; }, // -- Protected and private methods --------------------------------------- /** Handles changes in the source's columns attribute. Redraws the table data. @method _afterColumnsChange @param {EventFacade} e The `columnsChange` event object @protected @since 3.5.0 **/ // TODO: Preserve existing DOM // This will involve parsing and comparing the old and new column configs // and reacting to four types of changes: // 1. formatter, nodeFormatter, emptyCellValue changes // 2. column deletions // 3. column additions // 4. column moves (preserve cells) _afterColumnsChange: function () { this.render(); }, /** Handles modelList changes, including additions, deletions, and updates. Modifies the existing table DOM accordingly. @method _afterDataChange @param {EventFacade} e The `change` event from the ModelList @protected @since 3.5.0 **/ _afterDataChange: function (e) { var type = (e.type.match(/:(add|change|remove)$/) || [])[1], index = e.index, columns = this.get('columns'), col, changed = e.changed && Y.Object.keys(e.changed), key, row, i, len; for (i = 0, len = columns.length; i < len; i++ ) { col = columns[i]; // since nodeFormatters typcially make changes outside of it's // cell, we need to see if there are any columns that have a // nodeFormatter and if so, we need to do a full render() of the // tbody if (col.hasOwnProperty('nodeFormatter')) { this.render(); return; } } // TODO: if multiple rows are being added/remove/swapped, can we avoid the restriping? switch (type) { case 'change': for (i = 0, len = columns.length; i < len; i++) { col = columns[i]; key = col.key || col.name; if (col.formatter && !e.changed[key]) { changed.push(key); } } this.refreshRow(this.getRow(e.target), e.target, changed); break; case 'add': // we need to make sure we don't have an index larger than the data we have index = Math.min(index, this.get('modelList').size() - 1); // updates the columns with formatter functions this._setColumnsFormatterFn(columns); row = Y.Node.create(this._createRowHTML(e.model, index, columns)); this.tbodyNode.insert(row, index); this._restripe(index); break; case 'remove': this.getRow(index).remove(true); // we removed a row, so we need to back up our index to stripe this._restripe(index - 1); break; default: this.render(); } }, /** Toggles the odd/even classname of the row after the given index. This method is used to update rows after a row is inserted into or removed from the table. Note this event is delayed so the table is only restriped once when multiple rows are updated at one time. @protected @method _restripe @param {Number} [index] Index of row to start restriping after @since 3.11.0 */ _restripe: function (index) { var task = this._restripeTask, self; // index|0 to force int, avoid NaN. Math.max() to avoid neg indexes. index = Math.max((index|0), 0); if (!task) { self = this; this._restripeTask = { timer: setTimeout(function () { // Check for self existence before continuing if (!self || self.get('destroy') || !self.tbodyNode || !self.tbodyNode.inDoc()) { self._restripeTask = null; return; } var odd = [self.CLASS_ODD, self.CLASS_EVEN], even = [self.CLASS_EVEN, self.CLASS_ODD], index = self._restripeTask.index; self.tbodyNode.get('childNodes') .slice(index) .each(function (row, i) { // TODO: each vs batch row.replaceClass.apply(row, (index + i) % 2 ? even : odd); }); self._restripeTask = null; }, 0), index: index }; } else { task.index = Math.min(task.index, index); } }, /** Handles replacement of the modelList. Rerenders the `<tbody>` contents. @method _afterModelListChange @param {EventFacade} e The `modelListChange` event @protected @since 3.6.0 **/ _afterModelListChange: function () { var handles = this._eventHandles; if (handles.dataChange) { handles.dataChange.detach(); delete handles.dataChange; this.bindUI(); } if (this.tbodyNode) { this.render(); } }, /** Iterates the `modelList`, and calls any `nodeFormatter`s found in the `columns` param on the appropriate cell Nodes in the `tbody`. @method _applyNodeFormatters @param {Node} tbody The `<tbody>` Node whose columns to update @param {Object[]} columns The column configurations @protected @since 3.5.0 **/ _applyNodeFormatters: function (tbody, columns) { var host = this.host || this, data = this.get('modelList'), formatters = [], linerQuery = '.' + this.getClassName('liner'), rows, i, len; // Only iterate the ModelList again if there are nodeFormatters for (i = 0, len = columns.length; i < len; ++i) { if (columns[i].nodeFormatter) { formatters.push(i); } } if (data && formatters.length) { rows = tbody.get('childNodes'); data.each(function (record, index) { var formatterData = { data : record.toJSON(), record : record, rowIndex : index }, row = rows.item(index), i, len, col, key, cells, cell, keep; if (row) { cells = row.get('childNodes'); for (i = 0, len = formatters.length; i < len; ++i) { cell = cells.item(formatters[i]); if (cell) { col = formatterData.column = columns[formatters[i]]; key = col.key || col.id; formatterData.value = record.get(key); formatterData.td = cell; formatterData.cell = cell.one(linerQuery) || cell; keep = col.nodeFormatter.call(host,formatterData); if (keep === false) { // Remove from the Node cache to reduce // memory footprint. This also purges events, // which you shouldn't be scoping to a cell // anyway. You've been warned. Incidentally, // you should always return false. Just sayin. cell.destroy(true); } } } } }); } }, /** Binds event subscriptions from the UI and the host (if assigned). @method bindUI @protected @since 3.5.0 **/ bindUI: function () { var handles = this._eventHandles, modelList = this.get('modelList'), changeEvent = modelList.model.NAME + ':change'; if (!handles.columnsChange) { handles.columnsChange = this.after('columnsChange', bind('_afterColumnsChange', this)); } if (modelList && !handles.dataChange) { handles.dataChange = modelList.after( ['add', 'remove', 'reset', changeEvent], bind('_afterDataChange', this)); } }, /** Iterates the `modelList` and applies each Model to the `_rowTemplate`, allowing any column `formatter` or `emptyCellValue` to override cell content for the appropriate column. The aggregated HTML string is returned. @method _createDataHTML @param {Object[]} columns The column configurations to customize the generated cell content or class names @return {HTML} The markup for all Models in the `modelList`, each applied to the `_rowTemplate` @protected @since 3.5.0 **/ _createDataHTML: function (columns) { var data = this.get('modelList'), html = ''; if (data) { data.each(function (model, index) { html += this._createRowHTML(model, index, columns); }, this); } return html; }, /** Applies the data of a given Model, modified by any column formatters and supplemented by other template values to the instance's `_rowTemplate` (see `_createRowTemplate`). The generated string is then returned. The data from Model's attributes is fetched by `toJSON` and this data object is appended with other properties to supply values to {placeholders} in the template. For a template generated from a Model with 'foo' and 'bar' attributes, the data object would end up with the following properties before being used to populate the `_rowTemplate`: * `clientID` - From Model, used the assign the `<tr>`'s 'id' attribute. * `foo` - The value to populate the 'foo' column cell content. This value will be the value stored in the Model's `foo` attribute, or the result of the column's `formatter` if assigned. If the value is '', `null`, or `undefined`, and the column's `emptyCellValue` is assigned, that value will be used. * `bar` - Same for the 'bar' column cell content. * `foo-className` - String of CSS classes to apply to the `<td>`. * `bar-className` - Same. * `rowClass` - String of CSS classes to apply to the `<tr>`. This will be the odd/even class per the specified index plus any additional classes assigned by column formatters (via `o.rowClass`). Because this object is available to formatters, any additional properties can be added to fill in custom {placeholders} in the `_rowTemplate`. @method _createRowHTML @param {Model} model The Model instance to apply to the row template @param {Number} index The index the row will be appearing @param {Object[]} columns The column configurations @return {HTML} The markup for the provided Model, less any `nodeFormatter`s @protected @since 3.5.0 **/ _createRowHTML: function (model, index, columns) { var data = model.toJSON(), clientId = model.get('clientId'), values = { rowId : this._getRowId(clientId), clientId: clientId, rowClass: (index % 2) ? this.CLASS_ODD : this.CLASS_EVEN }, host = this.host || this, i, len, col, token, value, formatterData; for (i = 0, len = columns.length; i < len; ++i) { col = columns[i]; value = data[col.key]; token = col._id || col.key; values[token + '-className'] = ''; if (col._formatterFn) { formatterData = { value : value, data : data, column : col, record : model, className: '', rowClass : '', rowIndex : index }; // Formatters can either return a value value = col._formatterFn.call(host, formatterData); // or update the value property of the data obj passed if (value === undefined) { value = formatterData.value; } values[token + '-className'] = formatterData.className; values.rowClass += ' ' + formatterData.rowClass; } // if the token missing OR is the value a legit value if (!values.hasOwnProperty(token) || data.hasOwnProperty(col.key)) { if (value === undefined || value === null || value === '') { value = col.emptyCellValue || ''; } values[token] = col.allowHTML ? value : htmlEscape(value); } } // replace consecutive whitespace with a single space values.rowClass = values.rowClass.replace(/\s+/g, ' '); return fromTemplate(this._rowTemplate, values); }, /** Locates the row within the tbodyNode and returns the found index, or Null if it is not found in the tbodyNode @param {Y.Node} row @return {Number} Index of row in tbodyNode */ _getRowIndex: function (row) { var tbody = this.tbodyNode, index = 1; if (tbody && row) { //if row is not in the tbody, return if (row.ancestor('tbody') !== tbody) { return null; } // increment until we no longer have a previous node while (row = row.previous()) { // NOTE: assignment index++; } } return index; }, /** Creates a custom HTML template string for use in generating the markup for individual table rows with {placeholder}s to capture data from the Models in the `modelList` attribute or from column `formatter`s. Assigns the `_rowTemplate` property. @method _createRowTemplate @param {Object[]} columns Array of column configuration objects @protected @since 3.5.0 **/ _createRowTemplate: function (columns) { var html = '', cellTemplate = this.CELL_TEMPLATE, i, len, col, key, token, headers, tokenValues, formatter; this._setColumnsFormatterFn(columns); for (i = 0, len = columns.length; i < len; ++i) { col = columns[i]; key = col.key; token = col._id || key; formatter = col._formatterFn; // Only include headers if there are more than one headers = (col._headers || []).length > 1 ? 'headers="' + col._headers.join(' ') + '"' : ''; tokenValues = { content : '{' + token + '}', headers : headers, className: this.getClassName('col', token) + ' ' + (col.className || '') + ' ' + this.getClassName('cell') + ' {' + token + '-className}' }; if (!formatter && col.formatter) { tokenValues.content = col.formatter.replace(valueRegExp, tokenValues.content); } if (col.nodeFormatter) { // Defer all node decoration to the formatter tokenValues.content = ''; } html += fromTemplate(col.cellTemplate || cellTemplate, tokenValues); } this._rowTemplate = fromTemplate(this.ROW_TEMPLATE, { content: html }); }, /** Parses the columns array and defines the column's _formatterFn if there is a formatter available on the column @protected @method _setColumnsFormatterFn @param {Object[]} columns Array of column configuration objects @return {Object[]} Returns modified columns configuration Array */ _setColumnsFormatterFn: function (columns) { var Formatters = Y.DataTable.BodyView.Formatters, formatter, col, i, len; for (i = 0, len = columns.length; i < len; i++) { col = columns[i]; formatter = col.formatter; if (!col._formatterFn && formatter) { if (Lang.isFunction(formatter)) { col._formatterFn = formatter; } else if (formatter in Formatters) { col._formatterFn = Formatters[formatter].call(this.host || this, col); } } } return columns; }, /** Creates the `<tbody>` node that will store the data rows. @method _createTBodyNode @return {Node} @protected @since 3.6.0 **/ _createTBodyNode: function () { return Y.Node.create(fromTemplate(this.TBODY_TEMPLATE, { className: this.getClassName('data') })); }, /** Destroys the instance. @method destructor @protected @since 3.5.0 **/ destructor: function () { (new Y.EventHandle(YObject.values(this._eventHandles))).detach(); }, /** Holds the event subscriptions needing to be detached when the instance is `destroy()`ed. @property _eventHandles @type {Object} @default undefined (initially unset) @protected @since 3.5.0 **/ //_eventHandles: null, /** Returns the row ID associated with a Model's clientId. @method _getRowId @param {String} clientId The Model clientId @return {String} @protected **/ _getRowId: function (clientId) { return this._idMap[clientId] || (this._idMap[clientId] = Y.guid()); }, /** Map of Model clientIds to row ids. @property _idMap @type {Object} @protected **/ //_idMap, /** Initializes the instance. Reads the following configuration properties in addition to the instance attributes: * `columns` - (REQUIRED) The initial column information * `host` - The object to serve as source of truth for column info and for generating class names @method initializer @param {Object} config Configuration data @protected @since 3.5.0 **/ initializer: function (config) { this.host = config.host; this._eventHandles = { modelListChange: this.after('modelListChange', bind('_afterModelListChange', this)) }; this._idMap = {}; this.CLASS_ODD = this.getClassName('odd'); this.CLASS_EVEN = this.getClassName('even'); } /** The HTML template used to create a full row of markup for a single Model in the `modelList` plus any customizations defined in the column configurations. @property _rowTemplate @type {HTML} @default (initially unset) @protected @since 3.5.0 **/ //_rowTemplate: null },{ /** Hash of formatting functions for cell contents. This property can be populated with a hash of formatting functions by the developer or a set of pre-defined functions can be loaded via the `datatable-formatters` module. See: [DataTable.BodyView.Formatters](./DataTable.BodyView.Formatters.html) @property Formatters @type Object @since 3.8.0 @static **/ Formatters: {} }); }, '@VERSION@', {"requires": ["datatable-core", "view", "classnamemanager"]});
client/src/assets/icons/freeCodeCampLogo.js
BhaveshSGupta/FreeCodeCamp
/* eslint-disable max-len */ import React from 'react'; function freeCodeCampLogo() { return ( <svg aria-label='[freeCodeCamp Logo]' height={24} role='math' version='1.1' viewBox='0 0 210 24' width={210} xmlns='http://www.w3.org/2000/svg' xmlnsXlink='http://www.w3.org/1999/xlink' > <defs> <path d='m35.42 5.56 0.43 0.05 0.42 0.08 0.39 0.09 0.37 0.12 0.36 0.14 0.32 0.16 0.31 0.18 0.28 0.21 0.27 0.22 0.24 0.24 0.22 0.27 0.2 0.28 0.18 0.31 0.16 0.33 0.13 0.35 0.12 0.37 0.09 0.39 0.08 0.41 0.05 0.44 0.03 0.45 0.01 0.47v0.12 0.11l-0.01 0.1-0.04 0.2-0.04 0.18-0.03 0.08-0.07 0.15-0.04 0.06-0.05 0.06-0.04 0.06-0.06 0.05-0.05 0.05-0.06 0.03-0.06 0.04-0.07 0.03-0.08 0.02-0.07 0.02-0.16 0.02h-8.9v-0.07h-0.02v1.84l0.01 0.24 0.03 0.24 0.03 0.23 0.06 0.22 0.07 0.2 0.09 0.2 0.1 0.17 0.12 0.18 0.13 0.15 0.15 0.16 0.17 0.13 0.18 0.13 0.2 0.11 0.21 0.11 0.23 0.09 0.24 0.09 0.27 0.06 0.27 0.07 0.3 0.05 0.31 0.03 0.32 0.03 0.34 0.02 0.36 0.01h0.13l0.13-0.01h0.13l0.12-0.01h0.13l0.24-0.02 0.23-0.02 0.11-0.01 0.11-0.02 0.21-0.03 0.1-0.01 0.1-0.02 0.29-0.06 0.09-0.03 0.09-0.02 0.08-0.03 0.09-0.03 0.08-0.03 0.05-0.01 0.15-0.06 0.06-0.03 0.06-0.02 0.12-0.06 0.21-0.11 0.08-0.04 0.07-0.05 0.17-0.09 0.08-0.05 0.09-0.05 0.09-0.06 0.19-0.13 0.1-0.06 0.1-0.07 0.11-0.07 0.12-0.12 0.13-0.1 0.06-0.05 0.05-0.04 0.06-0.04 0.05-0.05 0.09-0.07 0.1-0.06 0.04-0.03 0.04-0.02 0.04-0.03 0.07-0.03 0.03-0.01 0.04-0.01 0.02-0.01 0.05-0.01h0.09l0.1 0.01 0.15 0.03 0.04 0.02 0.07 0.04 0.04 0.03 0.09 0.09 0.03 0.04 0.04 0.08 0.01 0.05 0.02 0.05 0.01 0.06 0.02 0.1v0.07 0.07 0.06l-0.01 0.07-0.01 0.06-0.01 0.07-0.06 0.2-0.03 0.06-0.04 0.07-0.03 0.07-0.04 0.07-0.05 0.07-0.05 0.06-0.1 0.14-0.13 0.13-0.13 0.14-0.16 0.14-0.09 0.06-0.08 0.08-0.15 0.1-0.15 0.11-0.32 0.2-0.17 0.09-0.18 0.09-0.18 0.08-0.19 0.07-0.19 0.08-0.21 0.07-0.42 0.12-0.22 0.05-0.23 0.05-0.47 0.09-0.5 0.06-0.52 0.04-0.27 0.01-0.28 0.01h-0.28-0.48l-0.47-0.03-0.45-0.04-0.42-0.07-0.41-0.07-0.38-0.09-0.36-0.11-0.34-0.13-0.31-0.15-0.3-0.16-0.27-0.18-0.26-0.2-0.22-0.21-0.21-0.23-0.19-0.25-0.16-0.26-0.14-0.29-0.13-0.29-0.1-0.32-0.07-0.34-0.06-0.35-0.03-0.37-0.01-0.39v-4.71l0.01-0.14 0.01-0.12 0.01-0.13 0.04-0.26 0.04-0.13 0.03-0.12 0.08-0.24 0.1-0.24 0.12-0.23 0.06-0.11 0.07-0.12 0.08-0.1 0.08-0.11 0.08-0.1 0.09-0.11 0.19-0.2 0.23-0.23 0.3-0.24 0.15-0.11 0.17-0.11 0.17-0.1 0.17-0.09 0.18-0.09 0.38-0.16 0.2-0.07 0.42-0.12 0.22-0.05 0.23-0.05 0.22-0.04 0.24-0.03 0.24-0.04 0.24-0.02 0.25-0.02 0.52-0.02h0.27l0.47 0.01 0.47 0.03zm-2.04 1.6-0.41 0.07-0.39 0.1-0.38 0.13-0.37 0.15-0.35 0.18-0.32 0.25-0.27 0.26-0.23 0.28-0.19 0.3-0.13 0.31-0.08 0.32-0.03 0.35v0.96h8.19l-0.09-0.98-0.25-0.83-0.43-0.69-0.6-0.53-0.76-0.38-0.95-0.23-1.11-0.07-0.43 0.01-0.42 0.04z' id='k' /> <path d='m107.21 5.56 0.43 0.05 0.42 0.08 0.39 0.09 0.37 0.12 0.35 0.14 0.33 0.16 0.31 0.18 0.29 0.21 0.26 0.22 0.24 0.24 0.22 0.27 0.21 0.28 0.17 0.31 0.16 0.33 0.14 0.35 0.11 0.37 0.1 0.39 0.07 0.41 0.05 0.44 0.03 0.45 0.01 0.47v0.12l-0.01 0.11-0.02 0.2-0.02 0.1-0.02 0.09-0.03 0.09-0.02 0.08-0.03 0.07-0.04 0.08-0.04 0.06-0.1 0.12-0.1 0.1-0.13 0.07-0.13 0.05-0.08 0.02-0.16 0.02-8.92 0.01v1.76l0.01 0.24 0.02 0.24 0.04 0.23 0.06 0.22 0.07 0.2 0.08 0.2 0.11 0.17 0.11 0.18 0.14 0.15 0.15 0.16 0.17 0.13 0.18 0.13 0.19 0.11 0.22 0.11 0.23 0.09 0.24 0.09 0.26 0.06 0.28 0.07 0.3 0.05 0.31 0.03 0.32 0.03 0.34 0.02 0.36 0.01h0.13l0.13-0.01h0.13l0.25-0.01 0.24-0.02 0.22-0.02 0.12-0.01 0.11-0.02 0.31-0.04 0.2-0.04 0.19-0.04 0.09-0.03 0.09-0.02 0.09-0.03 0.08-0.03 0.13-0.04 0.04-0.02 0.06-0.02 0.05-0.02 0.06-0.03 0.05-0.02 0.07-0.03 0.2-0.1 0.14-0.08 0.08-0.05 0.08-0.04 0.08-0.05 0.18-0.1 0.18-0.12 0.2-0.13 0.1-0.07 0.11-0.07 0.06-0.06 0.07-0.06 0.05-0.05 0.07-0.05 0.05-0.05 0.06-0.04 0.11-0.09 0.05-0.03 0.05-0.04 0.04-0.03 0.05-0.03 0.04-0.03 0.04-0.02 0.04-0.03 0.07-0.03 0.12-0.04h0.02 0.09 0.05l0.06 0.01 0.09 0.02 0.05 0.01 0.12 0.06 0.12 0.12 0.03 0.04 0.04 0.08 0.01 0.05 0.02 0.05 0.02 0.11 0.01 0.05v0.07 0.13l-0.01 0.07-0.01 0.06-0.01 0.07-0.04 0.14-0.02 0.06-0.03 0.06-0.04 0.07-0.03 0.07-0.09 0.14-0.05 0.06-0.05 0.07-0.11 0.14-0.21 0.2-0.23 0.2-0.09 0.08-0.3 0.21-0.15 0.1-0.17 0.1-0.17 0.09-0.18 0.09-0.18 0.08-0.19 0.07-0.2 0.08-0.2 0.07-0.42 0.12-0.22 0.05-0.23 0.05-0.23 0.04-0.24 0.05-0.5 0.06-0.52 0.04-0.55 0.02h-0.28-0.49l-0.46-0.03-0.45-0.04-0.43-0.07-0.39-0.07-0.39-0.09-0.36-0.11-0.33-0.13-0.33-0.15-0.29-0.16-0.27-0.18-0.25-0.2-0.23-0.21-0.22-0.23-0.18-0.25-0.17-0.26-0.14-0.29-0.12-0.29-0.1-0.32-0.08-0.34-0.05-0.35-0.04-0.37-0.01-0.39v-4.58l0.01-0.13v-0.14l0.02-0.12 0.01-0.13 0.02-0.13 0.05-0.26 0.12-0.36 0.1-0.24 0.11-0.23 0.07-0.11 0.07-0.12 0.07-0.1 0.09-0.11 0.08-0.1 0.09-0.11 0.19-0.2 0.1-0.1 0.14-0.13 0.14-0.12 0.15-0.12 0.15-0.11 0.17-0.11 0.17-0.1 0.17-0.09 0.19-0.09 0.18-0.08 0.19-0.08 0.2-0.07 0.42-0.12 0.44-0.1 0.23-0.04 0.23-0.03 0.25-0.04 0.24-0.02 0.25-0.02 0.52-0.02h0.27l0.48 0.01 0.46 0.03zm-2.04 1.6-0.41 0.07-0.39 0.1-0.38 0.13-0.37 0.15-0.34 0.18-0.34 0.25-0.29 0.26-0.23 0.28-0.17 0.3-0.13 0.31-0.07 0.32-0.03 0.35v0.96h8.19l-0.09-0.98-0.25-0.83-0.43-0.69-0.6-0.53-0.76-0.38-0.95-0.23-1.11-0.07-0.43 0.01-0.42 0.04z' id='j' /> <path d='m203.57 0.17c-0.12 0.12-0.24 0.29-0.24 0.45 0 0.29 0.34 0.69 0.97 1.33 2.63 2.53 3.95 5.62 3.94 9.35-0.01 4.13-1.4 7.45-4.1 10.01-0.57 0.51-0.8 0.91-0.8 1.25 0 0.17 0.12 0.34 0.23 0.51 0.11 0.12 0.34 0.23 0.51 0.23 0.62 0 1.5-0.73 2.64-2.17 2.22-2.72 3.22-5.73 3.28-9.82 0.05-4.1-1.23-6.88-3.75-9.75-0.9-1.03-1.66-1.56-2.17-1.56-0.17 0-0.35 0.06-0.51 0.17z' id='b' /> <path d='m124.75 1.76c1.14 0.86 1.73 2.07 1.73 3.55 0 0.68-0.29 1.02-0.86 1.02-0.39 0-0.68-0.34-0.85-1.02-0.11-0.57-0.34-1.08-0.62-1.62-0.52-0.9-1.61-1.32-3.32-1.32-1.49 0-2.52 0.34-3.14 1.08-0.57 0.68-0.91 1.72-0.91 3.26v5.95c0 1.55 0.34 2.63 0.97 3.31 0.68 0.74 1.72 1.13 3.2 1.13 2.23 0 3.54-0.79 3.82-2.34 0.12-0.57 0.17-0.86 0.17-0.91 0.12-0.34 0.35-0.51 0.68-0.51 0.57 0 0.86 0.34 0.86 1.02 0 1.44-0.57 2.52-1.78 3.38-0.97 0.62-2.18 0.96-3.77 0.96-1.84 0-3.26-0.4-4.3-1.25-1.16-0.8-1.73-2.16-1.73-3.94v-7.16c0-3.77 1.95-5.61 5.95-5.61 1.61 0 2.86 0.34 3.9 1.02z' id='n' /> <path d='m14.21 6.57c0-0.56 0.34-0.79 1.02-0.79h3.32c0.57 0 0.85 0.51 0.85 1.44 1.02-1.08 2.12-1.73 3.26-1.73 0.96 0 1.72 0.29 2.23 0.86 0.57 0.57 0.8 1.38 0.8 2.29 0 0.63-0.29 0.97-0.8 0.97-0.34 0-0.57-0.23-0.68-0.63-0.23-0.8-0.34-1.19-0.4-1.25-0.22-0.39-0.68-0.62-1.25-0.62-0.62 0-1.25 0.23-1.78 0.68-0.34 0.23-0.8 0.74-1.38 1.49v7.67h3.08c0.68 0 1.03 0.29 1.03 0.8 0 0.57-0.35 0.86-1.03 0.86h-7.33c-0.68 0-1.02-0.29-1.02-0.8 0-0.57 0.34-0.8 1.02-0.8h2.52v-0.07h0.02v-9.57h-2.46c-0.68 0-1.02-0.28-1.02-0.8z' id='l' /> <path d='m96.68 0.04 0.06 0.02 0.06 0.03 0.05 0.03 0.06 0.04 0.13 0.13 0.03 0.06 0.04 0.06 0.03 0.07 0.02 0.07 0.04 0.16 0.04 0.18 0.01 0.2v0.1 16.84 0.08l-0.01 0.07v0.07l-0.04 0.13-0.01 0.05-0.03 0.06-0.02 0.05-0.06 0.09-0.07 0.08-0.05 0.03-0.04 0.03-0.05 0.03-0.1 0.04-0.06 0.02-0.12 0.02-0.07 0.01h-0.11l-0.13-0.02-0.04-0.01-0.04-0.02-0.04-0.01-0.03-0.02-0.03-0.01-0.03-0.03-0.03-0.02-0.06-0.05-0.02-0.03-0.07-0.12-0.01-0.04-0.02-0.05-0.01-0.04-0.02-0.05v-0.05-0.08-0.04-0.04l-0.01-0.04v-0.04l-0.01-0.04v-0.04-0.04l-0.01-0.05v-0.04-0.05l-0.01-0.09v-0.06l-0.01-0.04v-0.06-0.11l-0.01-0.06v-0.13l-0.13 0.09-0.13 0.08-0.13 0.09-0.24 0.14-0.11 0.08-0.12 0.07-0.21 0.12-0.1 0.06-0.09 0.06-0.1 0.05-0.25 0.14-0.14 0.08-0.14 0.06-0.12 0.05-0.05 0.02-0.09 0.04-0.09 0.03-0.09 0.02-0.19 0.06-0.4 0.08-0.21 0.03-0.22 0.03-0.11 0.02-0.23 0.02h-0.12l-0.12 0.01h-0.11l-0.12 0.01h-0.46l-0.21-0.01-0.2-0.01-0.2-0.02-0.19-0.01-0.2-0.03-0.18-0.02-0.37-0.07-0.34-0.08-0.18-0.05-0.32-0.1-0.32-0.12-0.15-0.07-0.15-0.06-0.42-0.24-0.13-0.08-0.14-0.1-0.28-0.22-0.12-0.11-0.12-0.13-0.11-0.12-0.11-0.13-0.1-0.14-0.09-0.14-0.17-0.29-0.07-0.15-0.07-0.16-0.06-0.16-0.05-0.16-0.05-0.18-0.04-0.18-0.03-0.17-0.02-0.19-0.03-0.19-0.01-0.19v-5.21l0.01-0.19 0.03-0.18 0.02-0.18 0.03-0.18 0.08-0.34 0.05-0.16 0.06-0.16 0.06-0.15 0.08-0.15 0.07-0.15 0.18-0.28 0.2-0.26 0.1-0.12 0.24-0.24 0.26-0.22 0.14-0.1 0.39-0.24 0.15-0.07 0.28-0.14 0.31-0.12 0.15-0.05 0.33-0.1 0.33-0.08 0.72-0.12 0.37-0.03 0.38-0.02h0.45l0.25 0.02h0.12 0.13l0.12 0.02 0.12 0.01 0.22 0.02 0.22 0.04 0.11 0.01 0.21 0.04 0.1 0.02 0.09 0.02 0.28 0.08 0.09 0.03 0.09 0.04 0.08 0.03 0.09 0.03 0.08 0.04 0.09 0.03 0.09 0.04 0.1 0.05 0.17 0.09 0.29 0.16 0.09 0.05 0.29 0.19 0.2 0.14 0.09 0.07 0.4 0.32v-5.89l0.01-0.1v-0.2l0.04-0.18 0.01-0.08 0.03-0.08 0.02-0.07 0.03-0.07 0.03-0.06 0.04-0.06 0.04-0.04 0.04-0.05 0.04-0.04 0.05-0.04 0.1-0.06 0.06-0.02 0.13-0.03 0.06-0.01h0.14l0.07 0.01 0.14 0.03zm-5.7 7.19-0.26 0.03-0.26 0.02-0.25 0.05-0.24 0.05-0.23 0.05-0.42 0.16-0.19 0.09-0.18 0.1-0.2 0.15-0.2 0.16-0.17 0.17-0.15 0.17-0.14 0.19-0.11 0.2-0.1 0.2-0.08 0.23-0.05 0.23-0.04 0.23-0.01 0.26v4.52l0.01 0.26 0.03 0.25 0.05 0.23 0.07 0.23 0.09 0.21 0.12 0.2 0.13 0.19 0.16 0.17 0.17 0.16 0.2 0.14 0.22 0.14 0.19 0.09 0.42 0.16 0.22 0.07 0.22 0.06 0.24 0.06 0.25 0.04 0.26 0.04 0.27 0.03 0.56 0.02 0.47-0.01 0.44-0.04 0.43-0.06 0.21-0.04 0.2-0.06 0.38-0.12 0.17-0.07 0.14-0.1 0.16-0.11 0.15-0.11 0.16-0.12 0.17-0.12 0.16-0.13 0.18-0.13 0.17-0.15 0.18-0.15 0.36-0.32v-6.59l-0.21-0.16-0.21-0.14-0.2-0.14-0.2-0.13-0.19-0.12-0.18-0.11-0.17-0.11-0.16-0.09-0.3-0.14-0.13-0.06-0.19-0.07-0.38-0.12-0.2-0.05-0.4-0.08-0.21-0.03-0.21-0.02-0.21-0.01-0.43-0.01h-0.28l-0.27 0.01z' id='c' /> <path d='m195.66 12.04c-0.99-0.25 3.06-5.03-4.13-10.75 0 0 0.94 3-3.81 9.69-4.76 6.68 2.11 10.66 2.11 10.66s-3.22-1.72 0.53-7.84c0.67-1.11 1.55-2.11 2.64-4.38 0 0 0.96 1.37 0.46 4.32-0.75 4.47 3.27 3.19 3.33 3.25 1.41 1.65-1.16 4.56-1.32 4.65s7.34-4.5 2.01-11.42c-0.36 0.36-0.83 2.08-1.82 1.82z' id='e' /> <path d='m135.26 5.37 0.19 0.01 0.18 0.02 0.18 0.01 0.18 0.02 0.34 0.04 0.16 0.02 0.16 0.04 0.15 0.02 0.14 0.04 0.15 0.03 0.28 0.08 0.26 0.08 0.36 0.15 0.12 0.06 0.11 0.05 0.1 0.06 0.11 0.06 0.12 0.08 0.1 0.09 0.11 0.09 0.2 0.2 0.18 0.22 0.16 0.24 0.07 0.12 0.14 0.26 0.12 0.29 0.05 0.14 0.04 0.15 0.05 0.16 0.04 0.15 0.03 0.17 0.02 0.16 0.04 0.36 0.01 0.18 0.02 0.18v6.1 0.08 0.08l0.02 0.28 0.01 0.07 0.02 0.12 0.02 0.06 0.01 0.06 0.03 0.11 0.02 0.05 0.06 0.14 0.03 0.04 0.02 0.04 0.03 0.04 0.06 0.07 0.08 0.08 0.02 0.01v0.01h0.03l0.01 0.02 0.05 0.02 0.02 0.01 0.05 0.02 0.03 0.02 0.04 0.01 0.11 0.04 0.12 0.05 0.1 0.04 0.04 0.01 0.05 0.02 0.05 0.03 0.09 0.03 0.07 0.03 0.02 0.02 0.03 0.02 0.05 0.04 0.02 0.02 0.02 0.03 0.02 0.02 0.04 0.06 0.03 0.06 0.01 0.04 0.01 0.03 0.02 0.08v0.04l0.01 0.04 0.01 0.05v0.05l0.01 0.05v0.21l-0.02 0.05v0.04l-0.01 0.05-0.01 0.04-0.02 0.04-0.01 0.04-0.02 0.03-0.03 0.04-0.05 0.06-0.02 0.03-0.04 0.02-0.11 0.06-0.08 0.04-0.1 0.02-0.1 0.01h-0.06-0.11-0.02-0.01l-0.03-0.01h-0.02-0.02l-0.1-0.02-0.03-0.02h-0.03l-0.06-0.02-0.11-0.03-0.12-0.03-0.05-0.01-0.04-0.01-0.05-0.02-0.21-0.07-0.07-0.02-0.07-0.03-0.24-0.08-0.1-0.04-0.05-0.01-0.04-0.02-0.05-0.01-0.04-0.01-0.04-0.02-0.03-0.01-0.07-0.02-0.07-0.03-0.03-0.01-0.01-0.01-0.02-0.01h-0.03-0.04l-0.03-0.02-0.03-0.01-0.04-0.01-0.02-0.02-0.06-0.04-0.03-0.03-0.02-0.03-0.03-0.03-0.02-0.03-0.02-0.04-0.03-0.04-0.02-0.04-0.01-0.04-0.03-0.04-0.02-0.05-0.03-0.09-0.06-0.21-0.02-0.06-0.23 0.16-0.22 0.15-0.1 0.07-0.2 0.12-0.1 0.07-0.34 0.22-0.08 0.04-0.07 0.05-0.21 0.12-0.06 0.04-0.16 0.08-0.05 0.02-0.09 0.04-0.04 0.01-0.06 0.04-0.07 0.02-0.15 0.05-0.4 0.1-0.08 0.01-0.18 0.03-0.09 0.01-0.09 0.02-0.28 0.03-0.2 0.02h-0.1l-0.11 0.01h-0.1-0.49-0.16l-0.16-0.01-0.31-0.02-0.3-0.03-0.15-0.02-0.15-0.03-0.28-0.05-0.27-0.06-0.14-0.04-0.13-0.04-0.12-0.04-0.13-0.05-0.24-0.09-0.12-0.06-0.11-0.05-0.11-0.06-0.11-0.07-0.11-0.06-0.1-0.07-0.24-0.16-0.22-0.19-0.1-0.1-0.09-0.1-0.1-0.1-0.24-0.33-0.14-0.24-0.06-0.12-0.06-0.13-0.05-0.12-0.05-0.13-0.08-0.27-0.06-0.28-0.04-0.3-0.02-0.3v-0.32l0.01-0.15 0.01-0.16 0.02-0.14 0.05-0.3 0.07-0.28 0.05-0.14 0.11-0.26 0.12-0.26 0.15-0.24 0.16-0.22 0.09-0.11 0.1-0.11 0.2-0.2 0.11-0.09 0.23-0.18 0.13-0.08 0.33-0.24 0.24-0.13 0.26-0.13 0.13-0.05 0.26-0.11 0.14-0.05 0.42-0.12 0.15-0.03 0.14-0.04 0.15-0.02 0.15-0.03 0.16-0.02 0.15-0.01 0.16-0.02 0.48-0.03h0.3l0.13 0.01h0.14l0.29 0.02 0.14 0.02 0.15 0.02 0.14 0.02 0.16 0.02 0.14 0.02 0.15 0.04 0.16 0.02 0.15 0.03 0.32 0.08 0.49 0.12 0.16 0.05 0.51 0.15 0.36 0.12 0.17 0.06v-2.01-0.12l-0.01-0.11-0.01-0.1-0.01-0.12-0.02-0.09-0.02-0.11-0.04-0.1-0.03-0.1-0.03-0.09-0.05-0.09-0.04-0.09-0.11-0.16-0.06-0.09-0.06-0.07-0.07-0.08-0.15-0.14-0.08-0.07-0.18-0.12-0.1-0.06-0.2-0.1-0.11-0.06-0.07-0.03-0.16-0.06-0.34-0.11-0.26-0.06-0.1-0.02-0.09-0.01-0.1-0.02-0.09-0.01-0.3-0.03-0.1-0.02h-0.1l-0.11-0.01-0.1-0.01h-0.11-0.1-0.47l-0.25 0.01-0.24 0.01-0.23 0.02-0.42 0.06-0.2 0.03-0.19 0.04-0.17 0.05-0.17 0.06-0.16 0.05-0.15 0.07-0.14 0.07-0.13 0.07-0.12 0.09-0.12 0.08-0.1 0.1-0.09 0.1-0.09 0.11-0.08 0.11-0.06 0.11-0.06 0.13-0.05 0.13-0.04 0.14-0.03 0.14-0.01 0.07-0.02 0.06-0.04 0.22-0.02 0.09-0.01 0.05-0.01 0.04-0.01 0.03v0.04l-0.02 0.06-0.01 0.06-0.01 0.04v0.02l-0.01 0.02v0.01 0.01 0.03l-0.02 0.03-0.03 0.07-0.01 0.02-0.05 0.06-0.01 0.02-0.03 0.02-0.05 0.05-0.02 0.01-0.02 0.02-0.03 0.01-0.03 0.02-0.09 0.03-0.04 0.01-0.06 0.02h-0.04-0.04l-0.03 0.01h-0.15l-0.06-0.01-0.13-0.02-0.06-0.01-0.15-0.06-0.1-0.06-0.04-0.04-0.04-0.03-0.08-0.08-0.03-0.05-0.05-0.09-0.03-0.06-0.01-0.06-0.04-0.12-0.01-0.06v-0.07l-0.01-0.08v-0.17l0.01-0.1v-0.1l0.02-0.1 0.01-0.1 0.04-0.2 0.05-0.2 0.03-0.1 0.03-0.09 0.08-0.2 0.05-0.1 0.09-0.19 0.18-0.28 0.06-0.09 0.07-0.09 0.22-0.27 0.08-0.09 0.1-0.11 0.22-0.2 0.12-0.09 0.26-0.18 0.14-0.08 0.15-0.08 0.16-0.08 0.15-0.06 0.17-0.07 0.18-0.06 0.18-0.05 0.38-0.1 0.2-0.04 0.42-0.08 0.44-0.05 0.46-0.04 0.24-0.01h0.25l0.25-0.01h0.2l0.2 0.01h0.2zm-2.41 7.31-0.68 0.24-0.54 0.35-0.38 0.44-0.23 0.54-0.07 0.64 0.02 0.34 0.06 0.31 0.11 0.3 0.15 0.27 0.2 0.25 0.25 0.2 0.29 0.17 0.25 0.13 0.28 0.12 0.3 0.09 0.32 0.08 0.34 0.05 0.36 0.03 0.38 0.01 0.34-0.01 0.32-0.02 0.32-0.04 0.31-0.07 0.3-0.07 0.3-0.11 0.29-0.13 0.2-0.12 0.22-0.15 0.25-0.16 0.26-0.18 0.28-0.21 0.3-0.22 0.31-0.23v-2.41l-0.54-0.16-0.53-0.14-0.53-0.11-0.52-0.09-0.51-0.07-0.49-0.04-0.48-0.01-0.98 0.05-0.83 0.14z' id='m' /> <path d='m0.97 5.8h1.84v-1.61c0-2.8 1.44-4.19 4.24-4.19 1.14 0 2.12 0.23 2.86 0.63 0.96 0.57 1.5 1.5 1.5 2.58 0 0.73-0.29 1.02-0.8 1.02-0.34 0-0.68-0.23-0.86-0.63-0.22-0.73-0.45-1.13-0.56-1.32-0.34-0.4-1.03-0.63-2.01-0.63-1.72 0-2.57 0.85-2.57 2.58v1.55h3.31c0.74 0 1.08 0.29 1.08 0.79 0 0.57-0.34 0.8-1.08 0.8h-3.31v10.48c0 0.62-0.29 0.96-0.8 0.96-0.57 0-0.8-0.34-0.8-0.96v-10.46h-2.04c-0.63 0-0.97-0.28-0.97-0.79 0-0.58 0.34-0.8 0.97-0.8z' id='a' /> <path d='m78.8 5.55 0.61 0.08 0.56 0.12 0.52 0.15 0.48 0.18 0.43 0.22 0.38 0.25 0.34 0.29 0.29 0.32 0.25 0.35 0.21 0.39 0.16 0.42 0.11 0.45 0.07 0.49 0.02 0.51v4.71l-0.02 0.52-0.07 0.48-0.11 0.46-0.15 0.42-0.2 0.38-0.24 0.35-0.29 0.32-0.33 0.29-0.38 0.25-0.42 0.22-0.47 0.19-0.51 0.15-0.55 0.11-0.6 0.09-0.64 0.05-0.68 0.02-0.72-0.01-0.68-0.04-0.63-0.08-0.58-0.11-0.53-0.15-0.48-0.18-0.43-0.22-0.39-0.25-0.34-0.29-0.3-0.32-0.25-0.36-0.21-0.38-0.15-0.43-0.11-0.46-0.07-0.49-0.02-0.53v-4.71l0.02-0.51 0.07-0.49 0.11-0.45 0.16-0.42 0.2-0.39 0.26-0.35 0.29-0.32 0.34-0.29 0.39-0.25 0.43-0.22 0.47-0.18 0.52-0.15 0.56-0.12 0.61-0.08 0.65-0.06 0.7-0.01 0.69 0.01 0.65 0.06zm-2.67 1.61-0.53 0.1-0.47 0.13-0.42 0.17-0.37 0.21-0.31 0.24-0.25 0.28-0.2 0.32-0.14 0.35-0.09 0.39-0.02 0.42v4.71l0.02 0.42 0.09 0.39 0.14 0.36 0.21 0.31 0.26 0.28 0.31 0.24 0.37 0.2 0.43 0.17 0.49 0.12 0.55 0.09 0.6 0.04h0.66 0.64l0.59-0.04 0.54-0.08 0.48-0.12 0.42-0.16 0.37-0.2 0.31-0.23 0.26-0.28 0.2-0.32 0.14-0.36 0.09-0.4 0.03-0.43v-4.71l-0.03-0.42-0.09-0.39-0.14-0.35-0.2-0.32-0.27-0.28-0.31-0.24-0.38-0.21-0.44-0.17-0.49-0.13-0.55-0.1-0.62-0.05-0.67-0.02-0.63 0.02-0.58 0.05z' id='i' /> <path d='m181.88 0.18c0.12 0.11 0.23 0.28 0.23 0.45 0 0.29-0.34 0.68-0.97 1.32-2.62 2.53-3.94 5.62-3.93 9.36 0.01 4.12 1.4 7.44 4.1 10.01 0.56 0.5 0.8 0.9 0.8 1.24 0 0.17-0.12 0.35-0.23 0.51-0.11 0.12-0.34 0.24-0.51 0.24-0.63 0-1.5-0.74-2.64-2.18-2.22-2.72-3.22-5.72-3.28-9.82-0.05-4.1 1.23-6.88 3.75-9.75 0.9-1.02 1.66-1.56 2.17-1.56 0.17 0 0.34 0.06 0.51 0.18z' id='f' /> <path d='m149.59 6.94c0.45-0.57 0.85-0.92 1.25-1.08 0.39-0.23 0.96-0.34 1.6-0.34 1.96 0 2.98 0.96 2.98 2.85v9.29c0 0.79-0.28 1.14-0.85 1.14s-0.8-0.35-0.8-1.14v-8.7c0-1.19-0.51-1.83-1.49-1.83-0.74 0-1.5 0.45-2.12 1.32v9.29c0 0.79-0.29 1.13-0.8 1.13s-0.8-0.34-0.8-1.13v-8.59c0-1.33-0.56-1.95-1.61-1.95-0.68 0-1.32 0.46-2 1.33v9.22c0 0.8-0.29 1.14-0.86 1.14s-0.79-0.34-0.79-1.14v-11.38c0-0.57 0.22-0.8 0.68-0.8 0.23 0 0.45 0.17 0.57 0.51 0.11 0.15 0.17 0.44 0.17 0.78 0.53-0.57 0.87-0.91 1.02-1.03 0.34-0.22 0.8-0.34 1.44-0.34 0.91 0 1.72 0.46 2.41 1.45z' id='g' /> <path d='m49.79 5.56 0.44 0.05 0.41 0.08 0.4 0.09 0.37 0.12 0.35 0.14 0.33 0.16 0.31 0.18 0.28 0.21 0.27 0.22 0.24 0.24 0.22 0.27 0.2 0.28 0.18 0.31 0.16 0.33 0.13 0.35 0.11 0.37 0.1 0.39 0.07 0.41 0.06 0.44 0.03 0.45 0.01 0.47v0.12l-0.01 0.11-0.01 0.1-0.03 0.2-0.02 0.09-0.03 0.09-0.02 0.08-0.08 0.15-0.03 0.06-0.1 0.12-0.05 0.05-0.06 0.05-0.05 0.03-0.07 0.04-0.07 0.03-0.14 0.04-0.08 0.01-0.09 0.01h-8.89v-0.07h-0.02v1.84l0.01 0.24 0.02 0.24 0.04 0.23 0.06 0.22 0.06 0.2 0.09 0.2 0.1 0.17 0.12 0.18 0.14 0.15 0.15 0.16 0.16 0.13 0.18 0.13 0.2 0.11 0.22 0.11 0.22 0.09 0.25 0.09 0.26 0.06 0.28 0.07 0.29 0.05 0.31 0.03 0.33 0.03 0.34 0.02 0.36 0.01h0.13l0.13-0.01h0.12l0.13-0.01h0.12l0.24-0.02 0.23-0.02 0.11-0.01 0.12-0.02 0.31-0.04 0.1-0.02 0.09-0.02 0.1-0.02 0.09-0.02 0.1-0.03 0.09-0.02 0.16-0.06 0.09-0.03 0.04-0.01 0.05-0.02 0.06-0.02 0.05-0.02 0.05-0.03 0.06-0.02 0.06-0.03 0.07-0.03 0.14-0.07 0.14-0.08 0.08-0.05 0.08-0.04 0.08-0.05 0.18-0.1 0.08-0.06 0.19-0.13 0.1-0.06 0.11-0.07 0.1-0.07 0.13-0.12 0.13-0.1 0.05-0.05 0.06-0.04 0.05-0.04 0.06-0.05 0.09-0.07 0.09-0.06 0.05-0.03 0.04-0.02 0.04-0.03 0.07-0.03 0.09-0.03 0.05-0.01h0.09l0.1 0.01 0.15 0.03 0.04 0.02 0.07 0.04 0.04 0.03 0.09 0.09 0.03 0.04 0.04 0.08 0.02 0.1 0.02 0.06v0.05l0.01 0.05v0.07l0.01 0.07-0.01 0.06v0.07l-0.01 0.06-0.01 0.07-0.07 0.2-0.03 0.06-0.06 0.14-0.09 0.14-0.05 0.06-0.11 0.14-0.12 0.13-0.14 0.14-0.16 0.14-0.08 0.06-0.08 0.08-0.15 0.1-0.15 0.11-0.32 0.2-0.17 0.09-0.18 0.09-0.18 0.08-0.19 0.07-0.2 0.08-0.2 0.07-0.21 0.06-0.22 0.06-0.44 0.1-0.47 0.09-0.5 0.06-0.52 0.04-0.55 0.02h-0.28-0.49l-0.47-0.03-0.44-0.04-0.43-0.07-0.4-0.07-0.38-0.09-0.36-0.11-0.34-0.13-0.32-0.15-0.29-0.16-0.27-0.18-0.26-0.2-0.23-0.21-0.21-0.23-0.19-0.25-0.16-0.26-0.14-0.29-0.12-0.29-0.1-0.32-0.08-0.34-0.06-0.35-0.03-0.37-0.01-0.39v-4.71l0.01-0.14 0.01-0.12 0.06-0.39 0.03-0.13 0.03-0.12 0.05-0.12 0.08-0.24 0.06-0.12 0.11-0.23 0.07-0.11 0.07-0.12 0.07-0.1 0.08-0.11 0.09-0.1 0.09-0.11 0.18-0.2 0.1-0.1 0.14-0.13 0.29-0.24 0.32-0.22 0.17-0.1 0.36-0.18 0.38-0.16 0.2-0.07 0.42-0.12 0.44-0.1 0.23-0.04 0.23-0.03 0.24-0.04 0.24-0.02 0.26-0.02 0.52-0.02h0.26l0.48 0.01 0.46 0.03zm-2.04 1.6-0.4 0.07-0.4 0.1-0.38 0.13-0.36 0.15-0.35 0.18-0.34 0.25-0.28 0.26-0.23 0.28-0.17 0.3-0.13 0.31-0.08 0.32-0.02 0.35v0.96h8.18l-0.08-0.98-0.26-0.83-0.42-0.69-0.6-0.53-0.77-0.38-0.94-0.23-1.11-0.07-0.44 0.01-0.42 0.04z' id='h' /> <path d='m67.34 1.76c1.14 0.86 1.73 2.07 1.73 3.55 0 0.68-0.29 1.02-0.86 1.02-0.4 0-0.68-0.34-0.85-1.02-0.12-0.57-0.34-1.08-0.62-1.62-0.52-0.9-1.61-1.32-3.32-1.32-1.5 0-2.52 0.34-3.14 1.08-0.57 0.68-0.92 1.72-0.92 3.26v5.95c0 1.55 0.35 2.63 0.97 3.31 0.68 0.74 1.73 1.13 3.21 1.13 2.23 0 3.54-0.79 3.82-2.34 0.11-0.57 0.17-0.86 0.17-0.91 0.11-0.34 0.34-0.51 0.68-0.51 0.57 0 0.86 0.34 0.86 1.02 0 1.44-0.58 2.52-1.79 3.38-0.96 0.62-2.18 0.96-3.77 0.96-1.83 0-3.25-0.4-4.3-1.25-1.21-0.8-1.72-2.16-1.72-3.94v-7.16c0-3.77 1.93-5.61 5.95-5.61 1.61 0 2.86 0.34 3.9 1.02z' id='o' /> <path d='m158.79 5.43 0.12 0.04 0.03 0.02 0.03 0.01 0.03 0.03 0.06 0.04 0.03 0.03 0.03 0.02 0.1 0.14 0.06 0.08 0.02 0.05 0.02 0.04 0.01 0.04 0.02 0.09 0.01 0.04 0.02 0.04 0.01 0.05 0.01 0.04 0.02 0.04 0.01 0.05 0.05 0.12 0.02 0.05 0.03 0.08 0.01 0.05 0.03 0.12 0.02 0.04 0.02 0.08 0.25-0.12 0.49-0.23 0.24-0.11 0.23-0.1 0.46-0.18 0.22-0.08 0.21-0.08 0.21-0.07 0.2-0.06 0.2-0.07 0.2-0.05 0.38-0.09 0.19-0.04 0.34-0.06 0.17-0.02 0.32-0.02h0.16l0.46 0.01 0.44 0.03 0.43 0.04 0.39 0.06 0.38 0.09 0.36 0.1 0.33 0.12 0.31 0.14 0.29 0.15 0.27 0.17 0.25 0.2 0.22 0.2 0.21 0.23 0.18 0.24 0.16 0.26 0.14 0.28 0.12 0.3 0.09 0.31 0.08 0.33 0.06 0.35 0.03 0.36 0.01 0.38v4.76l-0.01 0.19-0.01 0.18-0.01 0.17-0.03 0.18-0.02 0.17-0.08 0.32-0.05 0.16-0.05 0.15-0.12 0.3-0.08 0.14-0.07 0.14-0.09 0.14-0.09 0.13-0.09 0.12-0.1 0.13-0.11 0.12-0.12 0.12-0.11 0.12-0.26 0.22-0.24 0.18-0.26 0.16-0.14 0.07-0.13 0.07-0.15 0.07-0.15 0.06-0.15 0.05-0.32 0.11-0.33 0.08-0.17 0.04-0.36 0.06-0.36 0.04-0.19 0.02-0.2 0.01h-0.19-0.44l-0.24-0.01-0.24-0.02-0.23-0.01-0.46-0.06-0.22-0.04-0.44-0.09-0.21-0.06-0.21-0.05-0.21-0.07-0.21-0.08-0.4-0.16-0.2-0.1-0.19-0.1-0.2-0.1-0.19-0.11-0.19-0.12-0.36-0.26v5.49l-0.02 0.2-0.01 0.09-0.02 0.09-0.06 0.24-0.03 0.07-0.04 0.07-0.03 0.05-0.04 0.06-0.08 0.1-0.1 0.08-0.06 0.02-0.05 0.03-0.06 0.02-0.06 0.01-0.07 0.01h-0.14-0.06l-0.07-0.02-0.05-0.02-0.06-0.02-0.11-0.06-0.04-0.04-0.05-0.04-0.08-0.1-0.04-0.06-0.03-0.06-0.02-0.07-0.03-0.08-0.04-0.16-0.02-0.1-0.01-0.09-0.01-0.11v-0.1-16.31-0.1l0.01-0.09 0.01-0.1 0.01-0.09 0.01-0.08 0.02-0.08 0.03-0.07 0.02-0.08 0.05-0.12 0.04-0.06 0.03-0.05 0.04-0.05 0.04-0.03 0.05-0.04 0.04-0.03 0.05-0.03 0.11-0.03 0.06-0.01h0.09l0.03 0.01h0.03zm4.49 1.74-0.46 0.04-0.22 0.03-0.21 0.03-0.21 0.05-0.38 0.1-0.36 0.14-0.15 0.07-0.16 0.08-0.15 0.1-0.17 0.11-0.16 0.12-0.17 0.14-0.17 0.15-0.18 0.16-0.18 0.18-0.2 0.19-0.2 0.2v6.54h0.06v-0.03l0.47 0.28 0.45 0.25 0.45 0.24 0.42 0.19 0.41 0.18 0.4 0.14 0.38 0.12 0.36 0.09 0.35 0.07 0.34 0.04 0.32 0.02 0.28-0.01 0.27-0.01 0.26-0.03 0.24-0.03 0.25-0.04 0.23-0.05 0.22-0.06 0.21-0.07 0.2-0.08 0.19-0.09 0.17-0.1 0.21-0.13 0.18-0.15 0.17-0.15 0.14-0.16 0.12-0.17 0.1-0.19 0.08-0.19 0.06-0.2 0.05-0.22 0.02-0.22 0.01-0.23v-4.75l-0.01-0.28-0.03-0.26-0.05-0.23-0.07-0.23-0.09-0.21-0.11-0.2-0.14-0.18-0.15-0.17-0.18-0.15-0.2-0.15-0.22-0.12-0.18-0.09-0.19-0.09-0.2-0.06-0.21-0.07-0.22-0.05-0.24-0.05-0.24-0.04-0.26-0.03-0.27-0.02-0.28-0.01-0.29-0.01-0.25 0.01h-0.26z' id='d' /> </defs> <use fill='#ffffff' xlinkHref='#k' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#k' /> <use fill='#ffffff' xlinkHref='#j' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#j' /> <use fill='#ffffff' xlinkHref='#b' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#b' /> <use fill='#ffffff' xlinkHref='#n' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#n' /> <use fill='#ffffff' xlinkHref='#l' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#l' /> <use fill='#ffffff' xlinkHref='#c' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#c' /> <use fill='#ffffff' xlinkHref='#e' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#e' /> <use fill='#ffffff' xlinkHref='#m' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#m' /> <use fill='#ffffff' xlinkHref='#a' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#a' /> <use fill='#ffffff' xlinkHref='#i' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#i' /> <use fill='#ffffff' xlinkHref='#f' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#f' /> <use fill='#ffffff' xlinkHref='#g' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#g' /> <use fill='#ffffff' xlinkHref='#h' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#h' /> <use fill='#ffffff' xlinkHref='#o' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#o' /> <use fill='#ffffff' xlinkHref='#d' /> <use fillOpacity={0} stroke='#000000' strokeOpacity={0} xlinkHref='#d' /> </svg> ); } freeCodeCampLogo.displayName = 'freeCodeCampLogo'; export default freeCodeCampLogo;
public/vendors/font-awesome/src/assets/js/jquery-1.7.1.min.js
gre/zound-live
/*! jQuery v1.7.1 jquery.com | jquery.org/license */ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return 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(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.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=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return 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){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);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{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._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,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.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,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.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,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.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):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.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;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return 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){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),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(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);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=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.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){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return 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(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return 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)}}),f.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){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=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}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={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,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(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){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() {for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
Truncate.js
jariz/react-truncate-html
/** * React port of ellipsis.js * Original ellipsis.js author: Gregory Linford * react-truncate-html author: Jari Zwarts (https://jari.io/) */ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import xss from 'xss'; const isServer = () => typeof window === 'undefined'; class Truncate extends Component { static propTypes = { ellipsis: PropTypes.string, debounce: PropTypes.number, responsive: PropTypes.bool, lines: PropTypes.number, portrait: PropTypes.number, breakWord: PropTypes.bool, }; static defaultProps = { ellipsis: '…', debounce: 100, responsive: true, lines: 2, portrait: null, breakWord: true, }; render () { // pass any additional props to the paragraph element const passedProps = { ...this.props }; for (let key of Object.keys(Truncate.propTypes)) { delete passedProps[key]; } if (this.props.children) { console.error('react-truncate-html: We can\'t handle react children at the moment.\nYou\'re %crequired%c to pass dangerouslySetInnerHTML to set contents. Sorry!', 'font-style:italic', 'font-style:normal'); return null; } const { dangerouslySetInnerHTML } = this.props; const { __html } = dangerouslySetInnerHTML; const html = { __html: xss(__html) }; return ( <span ref="paragraph" {...passedProps} dangerouslySetInnerHTML={html}/> ); } componentDidUpdate (prevProps) { if (prevProps.dangerouslySetInnerHTML !== this.props.dangerouslySetInnerHTML) { this.cached = this.refs.paragraph.innerHTML; this.add(); } } componentDidMount () { if (!isServer()) { this.lines = { props: this.props, get current () { if (this.props.portrait && window.innerHeight > window.innerWidth) { return this.props.portrait; } return this.props.lines; }, }; if (this.props.responsive) { this.cached = this.refs.paragraph.innerHTML; let debounce; const listener = function () { clearTimeout(debounce); debounce = setTimeout(function () { this.add(); }.bind(this), this.props.debounce); }; this._listener = listener.bind(this); window.addEventListener('resize', this._listener, false); } this.add(); } } componentWillUnmount () { if (this.props.responsive && this._listener) { window.removeEventListener('resize', this._listener, false); } } cached = null; createProp (element) { this.prop = { get height () { let viewportOffset = element.getBoundingClientRect(); return parseInt(viewportOffset.bottom - viewportOffset.top, 10); }, get lineheight () { let lineh = getComputedStyle(element).getPropertyValue('line-height'); if (String('normal|initial|inherit').indexOf(lineh) > -1) { //very specific case lineh = parseInt(getComputedStyle(element).getPropertyValue('font-size'), 10) + 2; } return parseInt(lineh, 10); }, }; } add () { if (this.props.responsive) { if (this.refs.paragraph.innerHTML !== this.cached) { this.refs.paragraph.innerHTML = this.cached; } } this.createProp(this.refs.paragraph); if (this.isNotCorrect()) { if (this.refs.paragraph.childNodes.length && this.refs.paragraph.childNodes.length > 1) { this.handleChilds(this.refs.paragraph); } else if (this.refs.paragraph.childNodes.length && this.refs.paragraph.childNodes.length === 1 && this.refs.paragraph.childNodes[0].nodeType === 3) { this.simpleText(this.refs.paragraph); } } } breakWord (str, str2, fix) { let words = str.split(' '); words.pop(); if (fix) { words.pop(); } if (!str2) { if (words[words.length - 1]) { words[words.length - 1] = words[words.length - 1].replace(/(,$)/g, '').replace(/(\.$)/g, ''); } words.push(this.conf.ellipsis); return words.join(' '); } else { if (words[words.length - 1]) { words[words.length - 1] = words[words.length - 1].replace(/(,$)/g, '').replace(/(\.$)/g, ''); words.push(this.conf.ellipsis); return [words.join(' '), str2]; } else if (!words[words.length - 1] && str2) { let st = ' ' + str2.trim().replace(/(,$)/g, '').replace(/(\.$)/g, '') + ' '; words.push(this.conf.ellipsis); return [words.join(' '), st]; } } } simpleText (element) { let childText = element.childNodes[0].nodeValue; while (this.prop.height > (this.prop.lineheight * this.lines.current)) { element.childNodes[0].nodeValue = childText.slice(0, -1); childText = element.childNodes[0].nodeValue; } if (this.props.breakWord) { element.childNodes[0].nodeValue = childText.slice(0, -this.props.ellipsis.length) + this.props.ellipsis; if (this.isNotCorrect()) { //edge case element.childNodes[0].nodeValue = ' ' + element.childNodes[0].nodeValue.slice(0, -(this.props.ellipsis.length + 1)).trim().slice(0, -(this.props.ellipsis.length)) + this.props.ellipsis; } } else { element.childNodes[0].nodeValue = this.breakWord(element.childNodes[0].nodeValue); if (this.isNotCorrect()) { //edge case element.childNodes[0].nodeValue = this.breakWord(element.childNodes[0].nodeValue, null, true); } } } isNotCorrect () { return this.prop.height > (this.prop.lineheight * this.lines.current); } processBreak (dOne, dTwo, fix) { let r = this.breakWord(dOne.innerHTML || dOne.nodeValue, dTwo.innerHTML || dTwo.nodeValue, fix); if (dOne.innerHTML) { dOne.innerHTML = r[0]; } else { dOne.nodeValue = r[0]; } if (dTwo.innerHTML) { dTwo.innerHTML = r[1]; } else { dTwo.nodeValue = r[1]; } } handleChilds (e) { let domChilds = e.childNodes; let childText; for (let i = domChilds.length - 1; i >= 0; i--) { let displayOrigin; if (domChilds[i].nodeType === 3) { displayOrigin = domChilds[i].nodeValue; domChilds[i].nodeValue = ''; } else if (domChilds[i].nodeType === 1) { displayOrigin = getComputedStyle(domChilds[i]).getPropertyValue('display'); domChilds[i].style.display = 'none'; } if (this.prop.height <= this.prop.lineheight * this.lines.current) { if (domChilds[i].nodeType === 3) { domChilds[i].nodeValue = displayOrigin; childText = domChilds[i].nodeValue; while (this.prop.height > (this.prop.lineheight * this.lines.current)) { domChilds[i].nodeValue = childText.slice(0, -1); childText = domChilds[i].nodeValue; } if (this.props.breakWord) { domChilds[i].nodeValue = childText.slice(0, -this.props.ellipsis.length) + this.props.ellipsis; if (this.isNotCorrect()) { //edge case domChilds[i].nodeValue = ' ' + domChilds[i].nodeValue.slice(0, -this.props.ellipsis.length).trim().slice(0, -this.props.ellipsis.length); if (domChilds[i].nodeValue.length > 1) { domChilds[i].nodeValue = domChilds[i].nodeValue.slice(0, -this.props.ellipsis.length) + this.props.ellipsis; } else { continue; } } } else { if (!domChilds[i].innerHTML && !domChilds[i].nodeValue) { continue; } this.processBreak(domChilds[i], domChilds[i - 1]); if (this.isNotCorrect()) { //edge case this.processBreak(domChilds[i], domChilds[i - 1], true); if (this.isNotCorrect()) { e.removeChild(domChilds[i]); continue; } } } } else { domChilds[i].style.display = displayOrigin; childText = domChilds[i].innerHTML; while (this.prop.height > (this.prop.lineheight * this.lines.current)) { domChilds[i].innerText = childText.slice(0, -1); childText = domChilds[i].innerText; } if (this.props.breakWord) { domChilds[i].innerHTML = childText.slice(0, -this.props.ellipsis.length) + this.props.ellipsis; if (this.isNotCorrect()) { //edge case domChilds[i].innerHTML = ' ' + domChilds[i].innerHTML.slice(0, -this.props.ellipsis.length).trim().slice(0, -this.props.ellipsis.length); if (domChilds[i].innerHTML.length > 1) { domChilds[i].innerHTML = domChilds[i].innerHTML.slice(0, -this.props.ellipsis.length) + this.props.ellipsis; } else { continue; } } } else { if (!domChilds[i].innerHTML && !domChilds[i].nodeValue) { continue; } this.processBreak(domChilds[i], domChilds[i - 1]); if (this.isNotCorrect()) { //edge case this.processBreak(domChilds[i], domChilds[i - 1], true); if (this.isNotCorrect()) { e.removeChild(domChilds[i]); continue; } } } } break; } else { e.removeChild(domChilds[i]); } } } } export default Truncate;
src/svg-icons/action/accessibility.js
andrejunges/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionAccessibility = (props) => ( <SvgIcon {...props}> <path d="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z"/> </SvgIcon> ); ActionAccessibility = pure(ActionAccessibility); ActionAccessibility.displayName = 'ActionAccessibility'; ActionAccessibility.muiName = 'SvgIcon'; export default ActionAccessibility;
src/svg-icons/image/wb-iridescent.js
matthewoates/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageWbIridescent = (props) => ( <SvgIcon {...props}> <path d="M5 14.5h14v-6H5v6zM11 .55V3.5h2V.55h-2zm8.04 2.5l-1.79 1.79 1.41 1.41 1.8-1.79-1.42-1.41zM13 22.45V19.5h-2v2.95h2zm7.45-3.91l-1.8-1.79-1.41 1.41 1.79 1.8 1.42-1.42zM3.55 4.46l1.79 1.79 1.41-1.41-1.79-1.79-1.41 1.41zm1.41 15.49l1.79-1.8-1.41-1.41-1.79 1.79 1.41 1.42z"/> </SvgIcon> ); ImageWbIridescent = pure(ImageWbIridescent); ImageWbIridescent.displayName = 'ImageWbIridescent'; ImageWbIridescent.muiName = 'SvgIcon'; export default ImageWbIridescent;
ajax/libs/react/0.13.0-beta.1/JSXTransformer.js
ruiaraujo/cdnjs
/** * JSXTransformer v0.13.0-beta.1 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSXTransformer=e()}}(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(_dereq_,module,exports){ /** * 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. */ /* jshint browser: true */ /* jslint evil: true */ 'use strict'; var buffer = _dereq_('buffer'); var transform = _dereq_('jstransform').transform; var typesSyntax = _dereq_('jstransform/visitors/type-syntax'); var visitors = _dereq_('./fbtransform/visitors'); var headEl; var dummyAnchor; var inlineScriptCount = 0; // The source-map library relies on Object.defineProperty, but IE8 doesn't // support it fully even with es5-sham. Indeed, es5-sham's defineProperty // throws when Object.prototype.__defineGetter__ is missing, so we skip building // the source map in that case. var supportsAccessors = Object.prototype.hasOwnProperty('__defineGetter__'); /** * Run provided code through jstransform. * * @param {string} source Original source code * @param {object?} options Options to pass to jstransform * @return {object} object as returned from jstransform */ function transformReact(source, options) { // TODO: just use react-tools options = options || {}; var visitorList; if (options.harmony) { visitorList = visitors.getAllVisitors(); } else { visitorList = visitors.transformVisitors.react; } if (options.stripTypes) { // Stripping types needs to happen before the other transforms // unfortunately, due to bad interactions. For example, // es6-rest-param-visitors conflict with stripping rest param type // annotation source = transform(typesSyntax.visitorList, source, options).code; } return transform(visitorList, source, { sourceMap: supportsAccessors && options.sourceMap }); } /** * Eval provided source after transforming it. * * @param {string} source Original source code * @param {object?} options Options to pass to jstransform */ function exec(source, options) { return eval(transformReact(source, options).code); } /** * This method returns a nicely formated line of code pointing to the exact * location of the error `e`. The line is limited in size so big lines of code * are also shown in a readable way. * * Example: * ... x', overflow:'scroll'}} id={} onScroll={this.scroll} class=" ... * ^ * * @param {string} code The full string of code * @param {Error} e The error being thrown * @return {string} formatted message * @internal */ function createSourceCodeErrorMessage(code, e) { var sourceLines = code.split('\n'); // e.lineNumber is non-standard so we can't depend on its availability. If // we're in a browser where it isn't supported, don't even bother trying to // format anything. We may also hit a case where the line number is reported // incorrectly and is outside the bounds of the actual code. Handle that too. if (!e.lineNumber || e.lineNumber > sourceLines.length) { return ''; } var erroneousLine = sourceLines[e.lineNumber - 1]; // Removes any leading indenting spaces and gets the number of // chars indenting the `erroneousLine` var indentation = 0; erroneousLine = erroneousLine.replace(/^\s+/, function(leadingSpaces) { indentation = leadingSpaces.length; return ''; }); // Defines the number of characters that are going to show // before and after the erroneous code var LIMIT = 30; var errorColumn = e.column - indentation; if (errorColumn > LIMIT) { erroneousLine = '... ' + erroneousLine.slice(errorColumn - LIMIT); errorColumn = 4 + LIMIT; } if (erroneousLine.length - errorColumn > LIMIT) { erroneousLine = erroneousLine.slice(0, errorColumn + LIMIT) + ' ...'; } var message = '\n\n' + erroneousLine + '\n'; message += new Array(errorColumn - 1).join(' ') + '^'; return message; } /** * Actually transform the code. * * @param {string} code * @param {string?} url * @param {object?} options * @return {string} The transformed code. * @internal */ function transformCode(code, url, options) { try { var transformed = transformReact(code, options); } catch(e) { e.message += '\n at '; if (url) { if ('fileName' in e) { // We set `fileName` if it's supported by this error object and // a `url` was provided. // The error will correctly point to `url` in Firefox. e.fileName = url; } e.message += url + ':' + e.lineNumber + ':' + e.columnNumber; } else { e.message += location.href; } e.message += createSourceCodeErrorMessage(code, e); throw e; } if (!transformed.sourceMap) { return transformed.code; } var map = transformed.sourceMap.toJSON(); var source; if (url == null) { source = "Inline JSX script"; inlineScriptCount++; if (inlineScriptCount > 1) { source += ' (' + inlineScriptCount + ')'; } } else if (dummyAnchor) { // Firefox has problems when the sourcemap source is a proper URL with a // protocol and hostname, so use the pathname. We could use just the // filename, but hopefully using the full path will prevent potential // issues where the same filename exists in multiple directories. dummyAnchor.href = url; source = dummyAnchor.pathname.substr(1); } map.sources = [source]; map.sourcesContent = [code]; return ( transformed.code + '\n//# sourceMappingURL=data:application/json;base64,' + buffer.Buffer(JSON.stringify(map)).toString('base64') ); } /** * Appends a script element at the end of the <head> with the content of code, * after transforming it. * * @param {string} code The original source code * @param {string?} url Where the code came from. null if inline * @param {object?} options Options to pass to jstransform * @internal */ function run(code, url, options) { var scriptEl = document.createElement('script'); scriptEl.text = transformCode(code, url, options); headEl.appendChild(scriptEl); } /** * Load script from the provided url and pass the content to the callback. * * @param {string} url The location of the script src * @param {function} callback Function to call with the content of url * @internal */ function load(url, successCallback, errorCallback) { var xhr; xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest(); // async, however scripts will be executed in the order they are in the // DOM to mirror normal script loading. xhr.open('GET', url, true); if ('overrideMimeType' in xhr) { xhr.overrideMimeType('text/plain'); } xhr.onreadystatechange = function() { if (xhr.readyState === 4) { if (xhr.status === 0 || xhr.status === 200) { successCallback(xhr.responseText); } else { errorCallback(); throw new Error("Could not load " + url); } } }; return xhr.send(null); } /** * Loop over provided script tags and get the content, via innerHTML if an * inline script, or by using XHR. Transforms are applied if needed. The scripts * are executed in the order they are found on the page. * * @param {array} scripts The <script> elements to load and run. * @internal */ function loadScripts(scripts) { var result = []; var count = scripts.length; function check() { var script, i; for (i = 0; i < count; i++) { script = result[i]; if (script.loaded && !script.executed) { script.executed = true; run(script.content, script.url, script.options); } else if (!script.loaded && !script.error && !script.async) { break; } } } scripts.forEach(function(script, i) { var options = { sourceMap: true }; if (/;harmony=true(;|$)/.test(script.type)) { options.harmony = true; } if (/;stripTypes=true(;|$)/.test(script.type)) { options.stripTypes = true; } // script.async is always true for non-javascript script tags var async = script.hasAttribute('async'); if (script.src) { result[i] = { async: async, error: false, executed: false, content: null, loaded: false, url: script.src, options: options }; load(script.src, function(content) { result[i].loaded = true; result[i].content = content; check(); }, function() { result[i].error = true; check(); }); } else { result[i] = { async: async, error: false, executed: false, content: script.innerHTML, loaded: true, url: null, options: options }; } }); check(); } /** * Find and run all script tags with type="text/jsx". * * @internal */ function runScripts() { var scripts = document.getElementsByTagName('script'); // Array.prototype.slice cannot be used on NodeList on IE8 var jsxScripts = []; for (var i = 0; i < scripts.length; i++) { if (/^text\/jsx(;|$)/.test(scripts.item(i).type)) { jsxScripts.push(scripts.item(i)); } } if (jsxScripts.length < 1) { return; } console.warn( 'You are using the in-browser JSX transformer. Be sure to precompile ' + 'your JSX for production - ' + 'http://facebook.github.io/react/docs/tooling-integration.html#jsx' ); loadScripts(jsxScripts); } // Listen for load event if we're in a browser and then kick off finding and // running of scripts. if (typeof window !== "undefined" && window !== null) { headEl = document.getElementsByTagName('head')[0]; dummyAnchor = document.createElement('a'); if (window.addEventListener) { window.addEventListener('DOMContentLoaded', runScripts, false); } else { window.attachEvent('onload', runScripts); } } module.exports = { transform: transformReact, exec: exec }; },{"./fbtransform/visitors":37,"buffer":2,"jstransform":21,"jstransform/visitors/type-syntax":33}],2:[function(_dereq_,module,exports){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ var base64 = _dereq_('base64-js') var ieee754 = _dereq_('ieee754') var isArray = _dereq_('is-array') exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 Buffer.poolSize = 8192 // not used by this implementation var kMaxLength = 0x3fffffff var rootParent = {} /** * 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+. * * Note: * * - Implementation must support adding new properties to `Uint8Array` instances. * Firefox 4-29 lacked support, fixed in Firefox 30+. * 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 will * get the Object implementation, which is slower but will work correctly. */ Buffer.TYPED_ARRAY_SUPPORT = (function () { try { var buf = new ArrayBuffer(0) var arr = new Uint8Array(buf) arr.foo = function () { return 42 } return 42 === arr.foo() && // typed array instances can be augmented typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` new Uint8Array(1).subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` } catch (e) { return false } })() /** * Class: Buffer * ============= * * The Buffer constructor returns instances of `Uint8Array` that are augmented * with function properties for all the node `Buffer` API functions. We use * `Uint8Array` so that square bracket notation works as expected -- it returns * a single octet. * * By augmenting the instances, we can avoid modifying the `Uint8Array` * prototype. */ function Buffer (subject, encoding, noZero) { if (!(this instanceof Buffer)) return new Buffer(subject, encoding, noZero) var type = typeof subject // Find the length var length if (type === 'number') length = subject > 0 ? subject >>> 0 : 0 else if (type === 'string') { length = Buffer.byteLength(subject, encoding) } else if (type === 'object' && subject !== null) { // assume object is array-like if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data length = +subject.length > 0 ? Math.floor(+subject.length) : 0 } else throw new TypeError('must start with number, buffer, array or string') if (length > kMaxLength) throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength.toString(16) + ' bytes') var buf if (Buffer.TYPED_ARRAY_SUPPORT) { // Preferred: Return an augmented `Uint8Array` instance for best performance buf = Buffer._augment(new Uint8Array(length)) } else { // Fallback: Return THIS instance of Buffer (created by `new`) buf = this buf.length = length buf._isBuffer = true } var i if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') { // Speed optimization -- use set if we're copying from a typed array buf._set(subject) } else if (isArrayish(subject)) { // Treat array-ish objects as a byte array if (Buffer.isBuffer(subject)) { for (i = 0; i < length; i++) buf[i] = subject.readUInt8(i) } else { for (i = 0; i < length; i++) buf[i] = ((subject[i] % 256) + 256) % 256 } } else if (type === 'string') { buf.write(subject, 0, encoding) } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT && !noZero) { for (i = 0; i < length; i++) { buf[i] = 0 } } if (length > 0 && length <= Buffer.poolSize) buf.parent = rootParent return buf } function SlowBuffer(subject, encoding, noZero) { if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding, noZero) var buf = new Buffer(subject, encoding, noZero) delete buf.parent return buf } Buffer.isBuffer = function (b) { return !!(b != null && b._isBuffer) } Buffer.compare = function (a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw new TypeError('Arguments must be Buffers') var x = a.length var y = b.length for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {} if (i !== len) { x = a[i] y = b[i] } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'raw': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function (list, totalLength) { if (!isArray(list)) throw new TypeError('Usage: Buffer.concat(list[, length])') if (list.length === 0) { return new Buffer(0) } else if (list.length === 1) { return list[0] } var i if (totalLength === undefined) { totalLength = 0 for (i = 0; i < list.length; i++) { totalLength += list[i].length } } var buf = new Buffer(totalLength) var pos = 0 for (i = 0; i < list.length; i++) { var item = list[i] item.copy(buf, pos) pos += item.length } return buf } Buffer.byteLength = function (str, encoding) { var ret str = str + '' switch (encoding || 'utf8') { case 'ascii': case 'binary': case 'raw': ret = str.length break case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': ret = str.length * 2 break case 'hex': ret = str.length >>> 1 break case 'utf8': case 'utf-8': ret = utf8ToBytes(str).length break case 'base64': ret = base64ToBytes(str).length break default: ret = str.length } return ret } // pre-set for values that may exist in the future Buffer.prototype.length = undefined Buffer.prototype.parent = undefined // toString(encoding, start=0, end=buffer.length) Buffer.prototype.toString = function (encoding, start, end) { var loweredCase = false start = start >>> 0 end = end === undefined || end === Infinity ? this.length : end >>> 0 if (!encoding) encoding = 'utf8' if (start < 0) start = 0 if (end > this.length) end = this.length if (end <= start) return '' 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 'binary': return binarySlice(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 } } } Buffer.prototype.equals = function (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function () { 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 (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') return Buffer.compare(this, b) } // `get` will be removed in Node 0.13+ Buffer.prototype.get = function (offset) { console.log('.get() is deprecated. Access using array indexes instead.') return this.readUInt8(offset) } // `set` will be removed in Node 0.13+ Buffer.prototype.set = function (v, offset) { console.log('.set() is deprecated. Access using array indexes instead.') return this.writeUInt8(v, offset) } 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 Error('Invalid hex string') if (length > strLen / 2) { length = strLen / 2 } for (var i = 0; i < length; i++) { var byte = parseInt(string.substr(i * 2, 2), 16) if (isNaN(byte)) throw new Error('Invalid hex string') buf[offset + i] = byte } return i } function utf8Write (buf, string, offset, length) { var charsWritten = blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) return charsWritten } function asciiWrite (buf, string, offset, length) { var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length) return charsWritten } function binaryWrite (buf, string, offset, length) { return asciiWrite(buf, string, offset, length) } function base64Write (buf, string, offset, length) { var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length) return charsWritten } function utf16leWrite (buf, string, offset, length) { var charsWritten = blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length, 2) return charsWritten } Buffer.prototype.write = function (string, offset, length, encoding) { // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) if (isFinite(offset)) { if (!isFinite(length)) { encoding = length length = undefined } } else { // legacy var swap = encoding encoding = offset offset = length length = swap } offset = Number(offset) || 0 if (length < 0 || offset < 0 || offset > this.length) throw new RangeError('attempt to write outside buffer bounds'); var remaining = this.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } encoding = String(encoding || 'utf8').toLowerCase() var ret switch (encoding) { case 'hex': ret = hexWrite(this, string, offset, length) break case 'utf8': case 'utf-8': ret = utf8Write(this, string, offset, length) break case 'ascii': ret = asciiWrite(this, string, offset, length) break case 'binary': ret = binaryWrite(this, string, offset, length) break case 'base64': ret = base64Write(this, string, offset, length) break case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': ret = utf16leWrite(this, string, offset, length) break default: throw new TypeError('Unknown encoding: ' + encoding) } return ret } Buffer.prototype.toJSON = function () { 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) { var res = '' var tmp = '' end = Math.min(buf.length, end) for (var i = start; i < end; i++) { if (buf[i] <= 0x7F) { res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]) tmp = '' } else { tmp += '%' + buf[i].toString(16) } } return res + decodeUtf8Char(tmp) } 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 binarySlice (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 (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 = Buffer._augment(this.subarray(start, end)) } else { var sliceLen = end - start newBuf = new Buffer(sliceLen, undefined, true) for (var i = 0; i < sliceLen; i++) { newBuf[i] = this[i + start] } } if (newBuf.length) newBuf.parent = this.parent || this 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 (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 (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 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUInt16LE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUInt16BE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUInt32LE = function (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 (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 (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 (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 (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 (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 (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 (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 (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 (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function (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 must be a Buffer instance') if (value > max || value < min) throw new RangeError('value is out of bounds') if (offset + ext > buf.length) throw new RangeError('index out of range') } Buffer.prototype.writeUIntLE = function (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) var mul = 1 var i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) this[offset + i] = (value / mul) >>> 0 & 0xFF return offset + byteLength } Buffer.prototype.writeUIntBE = function (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) var i = byteLength - 1 var mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) this[offset + i] = (value / mul) >>> 0 & 0xFF return offset + byteLength } Buffer.prototype.writeUInt8 = function (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 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 (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 this[offset + 1] = (value >>> 8) } else objectWriteUInt16(this, value, offset, true) return offset + 2 } Buffer.prototype.writeUInt16BE = function (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 } 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 (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 } else objectWriteUInt32(this, value, offset, true) return offset + 4 } Buffer.prototype.writeUInt32BE = function (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 } else objectWriteUInt32(this, value, offset, false) return offset + 4 } Buffer.prototype.writeIntLE = function (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength - 1) - 1, -Math.pow(2, 8 * byteLength - 1)) } var i = 0 var mul = 1 var sub = value < 0 ? 1 : 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) this[offset + i] = ((value / mul) >> 0) - sub & 0xFF return offset + byteLength } Buffer.prototype.writeIntBE = function (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength - 1) - 1, -Math.pow(2, 8 * byteLength - 1)) } var i = byteLength - 1 var mul = 1 var sub = value < 0 ? 1 : 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) this[offset + i] = ((value / mul) >> 0) - sub & 0xFF return offset + byteLength } Buffer.prototype.writeInt8 = function (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 return offset + 1 } Buffer.prototype.writeInt16LE = function (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 this[offset + 1] = (value >>> 8) } else objectWriteUInt16(this, value, offset, true) return offset + 2 } Buffer.prototype.writeInt16BE = function (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 } else objectWriteUInt16(this, value, offset, false) return offset + 2 } Buffer.prototype.writeInt32LE = function (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 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 (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 } else objectWriteUInt32(this, value, offset, false) return offset + 4 } function checkIEEE754 (buf, value, offset, ext, max, min) { if (value > max || value < min) throw new RangeError('value is out of bounds') 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 (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function (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 (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function (target, target_start, start, end) { var source = this if (!start) start = 0 if (!end && end !== 0) end = this.length if (target_start >= target.length) target_start = target.length if (!target_start) target_start = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || source.length === 0) return 0 // Fatal error conditions if (target_start < 0) throw new RangeError('targetStart out of bounds') if (start < 0 || start >= source.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 - target_start < end - start) end = target.length - target_start + start var len = end - start if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < len; i++) { target[i + target_start] = this[i + start] } } else { target._set(this.subarray(start, start + len), target_start) } return len } // fill(value, start=0, end=buffer.length) Buffer.prototype.fill = function (value, start, end) { if (!value) value = 0 if (!start) start = 0 if (!end) end = this.length if (end < start) throw new RangeError('end < start') // Fill 0 bytes; we're done if (end === start) return if (this.length === 0) return if (start < 0 || start >= this.length) throw new RangeError('start out of bounds') if (end < 0 || end > this.length) throw new RangeError('end out of bounds') var i if (typeof value === 'number') { for (i = start; i < end; i++) { this[i] = value } } else { var bytes = utf8ToBytes(value.toString()) var len = bytes.length for (i = start; i < end; i++) { this[i] = bytes[i % len] } } return this } /** * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. * Added in Node 0.12. Only available in browsers that support ArrayBuffer. */ Buffer.prototype.toArrayBuffer = function () { if (typeof Uint8Array !== 'undefined') { if (Buffer.TYPED_ARRAY_SUPPORT) { return (new Buffer(this)).buffer } else { var buf = new Uint8Array(this.length) for (var i = 0, len = buf.length; i < len; i += 1) { buf[i] = this[i] } return buf.buffer } } else { throw new TypeError('Buffer.toArrayBuffer not supported in this browser') } } // HELPER FUNCTIONS // ================ var BP = Buffer.prototype /** * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods */ Buffer._augment = function (arr) { arr.constructor = Buffer arr._isBuffer = true // save reference to original Uint8Array get/set methods before overwriting arr._get = arr.get arr._set = arr.set // deprecated, will be removed in node 0.13+ arr.get = BP.get arr.set = BP.set arr.write = BP.write arr.toString = BP.toString arr.toLocaleString = BP.toString arr.toJSON = BP.toJSON arr.equals = BP.equals arr.compare = BP.compare arr.copy = BP.copy arr.slice = BP.slice arr.readUIntLE = BP.readUIntLE arr.readUIntBE = BP.readUIntBE arr.readUInt8 = BP.readUInt8 arr.readUInt16LE = BP.readUInt16LE arr.readUInt16BE = BP.readUInt16BE arr.readUInt32LE = BP.readUInt32LE arr.readUInt32BE = BP.readUInt32BE arr.readIntLE = BP.readIntLE arr.readIntBE = BP.readIntBE arr.readInt8 = BP.readInt8 arr.readInt16LE = BP.readInt16LE arr.readInt16BE = BP.readInt16BE arr.readInt32LE = BP.readInt32LE arr.readInt32BE = BP.readInt32BE arr.readFloatLE = BP.readFloatLE arr.readFloatBE = BP.readFloatBE arr.readDoubleLE = BP.readDoubleLE arr.readDoubleBE = BP.readDoubleBE arr.writeUInt8 = BP.writeUInt8 arr.writeUIntLE = BP.writeUIntLE arr.writeUIntBE = BP.writeUIntBE arr.writeUInt16LE = BP.writeUInt16LE arr.writeUInt16BE = BP.writeUInt16BE arr.writeUInt32LE = BP.writeUInt32LE arr.writeUInt32BE = BP.writeUInt32BE arr.writeIntLE = BP.writeIntLE arr.writeIntBE = BP.writeIntBE arr.writeInt8 = BP.writeInt8 arr.writeInt16LE = BP.writeInt16LE arr.writeInt16BE = BP.writeInt16BE arr.writeInt32LE = BP.writeInt32LE arr.writeInt32BE = BP.writeInt32BE arr.writeFloatLE = BP.writeFloatLE arr.writeFloatBE = BP.writeFloatBE arr.writeDoubleLE = BP.writeDoubleLE arr.writeDoubleBE = BP.writeDoubleBE arr.fill = BP.fill arr.inspect = BP.inspect arr.toArrayBuffer = BP.toArrayBuffer return arr } var INVALID_BASE64_RE = /[^+\/0-9A-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 isArrayish (subject) { return isArray(subject) || Buffer.isBuffer(subject) || subject && typeof subject === 'object' && typeof subject.length === 'number' } function toHex (n) { if (n < 16) return '0' + n.toString(16) return n.toString(16) } function utf8ToBytes(string, units) { var codePoint, length = string.length var leadSurrogate = null units = units || Infinity var bytes = [] var i = 0 for (; i<length; i++) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (leadSurrogate) { // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair else { codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000 leadSurrogate = null } } // no lead yet else { // unexpected trail if (codePoint > 0xDBFF) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // unpaired lead else if (i + 1 === length) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead else { leadSurrogate = codePoint continue } } } // valid bmp char, but last char was a lead else if (leadSurrogate) { 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 < 0x200000) { 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, unitSize) { if (unitSize) length -= length % unitSize; for (var i = 0; i < length; i++) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } function decodeUtf8Char (str) { try { return decodeURIComponent(str) } catch (err) { return String.fromCharCode(0xFFFD) // UTF 8 invalid char } } },{"base64-js":3,"ieee754":4,"is-array":5}],3:[function(_dereq_,module,exports){ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; ;(function (exports) { 'use strict'; var Arr = (typeof Uint8Array !== 'undefined') ? Uint8Array : Array var PLUS = '+'.charCodeAt(0) var SLASH = '/'.charCodeAt(0) var NUMBER = '0'.charCodeAt(0) var LOWER = 'a'.charCodeAt(0) var UPPER = 'A'.charCodeAt(0) var PLUS_URL_SAFE = '-'.charCodeAt(0) var SLASH_URL_SAFE = '_'.charCodeAt(0) function decode (elt) { var code = elt.charCodeAt(0) if (code === PLUS || code === PLUS_URL_SAFE) return 62 // '+' if (code === SLASH || code === SLASH_URL_SAFE) return 63 // '/' if (code < NUMBER) return -1 //no match if (code < NUMBER + 10) return code - NUMBER + 26 + 26 if (code < UPPER + 26) return code - UPPER if (code < LOWER + 26) return code - LOWER + 26 } function b64ToByteArray (b64) { var i, j, l, tmp, placeHolders, arr if (b64.length % 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 var len = b64.length placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 // base64 is 4/3 + up to two characters of the original data arr = new Arr(b64.length * 3 / 4 - placeHolders) // if there are placeholders, only get up to the last complete 4 chars l = placeHolders > 0 ? b64.length - 4 : b64.length var L = 0 function push (v) { arr[L++] = v } for (i = 0, j = 0; i < l; i += 4, j += 3) { tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) push((tmp & 0xFF0000) >> 16) push((tmp & 0xFF00) >> 8) push(tmp & 0xFF) } if (placeHolders === 2) { tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) push(tmp & 0xFF) } else if (placeHolders === 1) { tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) push((tmp >> 8) & 0xFF) push(tmp & 0xFF) } return arr } function uint8ToBase64 (uint8) { var i, extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes output = "", temp, length function encode (num) { return lookup.charAt(num) } function tripletToBase64 (num) { return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) } // go through the array every three bytes, we'll deal with trailing stuff later for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) output += tripletToBase64(temp) } // pad the end with zeros, but make sure to not forget the extra bytes switch (extraBytes) { case 1: temp = uint8[uint8.length - 1] output += encode(temp >> 2) output += encode((temp << 4) & 0x3F) output += '==' break case 2: temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) output += encode(temp >> 10) output += encode((temp >> 4) & 0x3F) output += encode((temp << 2) & 0x3F) output += '=' break } return output } exports.toByteArray = b64ToByteArray exports.fromByteArray = uint8ToBase64 }(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) },{}],4:[function(_dereq_,module,exports){ exports.read = function(buffer, offset, isLE, mLen, nBytes) { var e, m, eLen = nBytes * 8 - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, nBits = -7, i = isLE ? (nBytes - 1) : 0, d = isLE ? -1 : 1, 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, eLen = nBytes * 8 - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), i = isLE ? 0 : (nBytes - 1), d = isLE ? 1 : -1, 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; }; },{}],5:[function(_dereq_,module,exports){ /** * isArray */ var isArray = Array.isArray; /** * toString */ var str = Object.prototype.toString; /** * Whether or not the given `val` * is an array. * * example: * * isArray([]); * // > true * isArray(arguments); * // > false * isArray(''); * // > false * * @param {mixed} val * @return {bool} */ module.exports = isArray || function (val) { return !! val && '[object Array]' == str.call(val); }; },{}],6:[function(_dereq_,module,exports){ (function (process){ // 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. // resolves . and .. elements in a path array with directory names there // must be no slashes, empty elements, or device names (c:\) in the array // (so also no leading and trailing slashes - it does not distinguish // relative and absolute paths) function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = parts.length - 1; i >= 0; i--) { var last = parts[i]; if (last === '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; } // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var splitPath = function(filename) { return splitPathRe.exec(filename).slice(1); }; // path.resolve([from ...], to) // posix version exports.resolve = function() { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = (i >= 0) ? arguments[i] : process.cwd(); // Skip empty and invalid entries if (typeof path !== 'string') { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { return !!p; }), !resolvedAbsolute).join('/'); return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; }; // path.normalize(path) // posix version exports.normalize = function(path) { var isAbsolute = exports.isAbsolute(path), trailingSlash = substr(path, -1) === '/'; // Normalize the path path = normalizeArray(filter(path.split('/'), function(p) { return !!p; }), !isAbsolute).join('/'); if (!path && !isAbsolute) { path = '.'; } if (path && trailingSlash) { path += '/'; } return (isAbsolute ? '/' : '') + path; }; // posix version exports.isAbsolute = function(path) { return path.charAt(0) === '/'; }; // posix version exports.join = function() { var paths = Array.prototype.slice.call(arguments, 0); return exports.normalize(filter(paths, function(p, index) { if (typeof p !== 'string') { throw new TypeError('Arguments to path.join must be strings'); } return p; }).join('/')); }; // path.relative(from, to) // posix version exports.relative = function(from, to) { from = exports.resolve(from).substr(1); to = exports.resolve(to).substr(1); function trim(arr) { var start = 0; for (; start < arr.length; start++) { if (arr[start] !== '') break; } var end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== '') break; } if (start > end) return []; return arr.slice(start, end - start + 1); } var fromParts = trim(from.split('/')); var toParts = trim(to.split('/')); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }; exports.sep = '/'; exports.delimiter = ':'; exports.dirname = function(path) { var result = splitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; exports.basename = function(path, ext) { var f = splitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; exports.extname = function(path) { return splitPath(path)[3]; }; function filter (xs, f) { if (xs.filter) return xs.filter(f); var res = []; for (var i = 0; i < xs.length; i++) { if (f(xs[i], i, xs)) res.push(xs[i]); } return res; } // String.prototype.substr - negative index don't work in IE8 var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) { return str.substr(start, len) } : function (str, start, len) { if (start < 0) start = str.length + start; return str.substr(start, len); } ; }).call(this,_dereq_('_process')) },{"_process":7}],7:[function(_dereq_,module,exports){ // shim for using process in browser var process = module.exports = {}; var queue = []; var draining = false; function drainQueue() { if (draining) { return; } draining = true; var currentQueue; var len = queue.length; while(len) { currentQueue = queue; queue = []; var i = -1; while (++i < len) { currentQueue[i](); } len = queue.length; } draining = false; } process.nextTick = function (fun) { queue.push(fun); if (!draining) { setTimeout(drainQueue, 0); } }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues 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; }; },{}],8:[function(_dereq_,module,exports){ var Base62 = (function (my) { my.chars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "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", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] my.encode = function(i){ if (i === 0) {return '0'} var s = '' while (i > 0) { s = this.chars[i % 62] + s i = Math.floor(i/62) } return s }; my.decode = function(a,b,c,d){ for ( b = c = ( a === (/\W|_|^$/.test(a += "") || a) ) - 1; d = a.charCodeAt(c++); ) b = b * 62 + d - [, 48, 29, 87][d >> 5]; return b }; return my; }({})); module.exports = Base62 },{}],9:[function(_dereq_,module,exports){ /* Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com> Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com> Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com> Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be> Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl> Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com> Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com> Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com> Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com> 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 <COPYRIGHT HOLDER> 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. */ /*jslint bitwise:true plusplus:true */ /*global esprima:true, define:true, exports:true, window: true, throwError: true, generateStatement: true, peek: true, parseAssignmentExpression: true, parseBlock: true, parseClassExpression: true, parseClassDeclaration: true, parseExpression: true, parseDeclareClass: true, parseDeclareFunction: true, parseDeclareModule: true, parseDeclareVariable: true, parseForStatement: true, parseFunctionDeclaration: true, parseFunctionExpression: true, parseFunctionSourceElements: true, parseVariableIdentifier: true, parseImportSpecifier: true, parseInterface: true, parseLeftHandSideExpression: true, parseParams: true, validateParam: true, parseSpreadOrAssignmentExpression: true, parseStatement: true, parseSourceElement: true, parseConciseBody: true, advanceXJSChild: true, isXJSIdentifierStart: true, isXJSIdentifierPart: true, scanXJSStringLiteral: true, scanXJSIdentifier: true, parseXJSAttributeValue: true, parseXJSChild: true, parseXJSElement: true, parseXJSExpressionContainer: true, parseXJSEmptyExpression: true, parseFunctionTypeParam: true, parsePrimaryType: true, parseTypeAlias: true, parseType: true, parseTypeAnnotatableIdentifier: true, parseTypeAnnotation: true, parseYieldExpression: true, parseAwaitExpression: true */ (function (root, factory) { 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, // Rhino, and plain browser loading. if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { factory(exports); } else { factory((root.esprima = {})); } }(this, function (exports) { 'use strict'; var Token, TokenName, FnExprTokens, Syntax, PropertyKind, Messages, Regex, SyntaxTreeDelegate, XHTMLEntities, ClassPropertyType, source, strict, index, lineNumber, lineStart, length, delegate, lookahead, state, extra; Token = { BooleanLiteral: 1, EOF: 2, Identifier: 3, Keyword: 4, NullLiteral: 5, NumericLiteral: 6, Punctuator: 7, StringLiteral: 8, RegularExpression: 9, Template: 10, XJSIdentifier: 11, XJSText: 12 }; TokenName = {}; TokenName[Token.BooleanLiteral] = 'Boolean'; TokenName[Token.EOF] = '<end>'; TokenName[Token.Identifier] = 'Identifier'; TokenName[Token.Keyword] = 'Keyword'; TokenName[Token.NullLiteral] = 'Null'; TokenName[Token.NumericLiteral] = 'Numeric'; TokenName[Token.Punctuator] = 'Punctuator'; TokenName[Token.StringLiteral] = 'String'; TokenName[Token.XJSIdentifier] = 'XJSIdentifier'; TokenName[Token.XJSText] = 'XJSText'; TokenName[Token.RegularExpression] = 'RegularExpression'; // A function following one of those tokens is an expression. FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new', 'return', 'case', 'delete', 'throw', 'void', // assignment operators '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=', '&=', '|=', '^=', ',', // binary/unary operators '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&', '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=', '<=', '<', '>', '!=', '!==']; Syntax = { AnyTypeAnnotation: 'AnyTypeAnnotation', ArrayExpression: 'ArrayExpression', ArrayPattern: 'ArrayPattern', ArrayTypeAnnotation: 'ArrayTypeAnnotation', ArrowFunctionExpression: 'ArrowFunctionExpression', AssignmentExpression: 'AssignmentExpression', BinaryExpression: 'BinaryExpression', BlockStatement: 'BlockStatement', BooleanTypeAnnotation: 'BooleanTypeAnnotation', BreakStatement: 'BreakStatement', CallExpression: 'CallExpression', CatchClause: 'CatchClause', ClassBody: 'ClassBody', ClassDeclaration: 'ClassDeclaration', ClassExpression: 'ClassExpression', ClassImplements: 'ClassImplements', ClassProperty: 'ClassProperty', ComprehensionBlock: 'ComprehensionBlock', ComprehensionExpression: 'ComprehensionExpression', ConditionalExpression: 'ConditionalExpression', ContinueStatement: 'ContinueStatement', DebuggerStatement: 'DebuggerStatement', DeclareClass: 'DeclareClass', DeclareFunction: 'DeclareFunction', DeclareModule: 'DeclareModule', DeclareVariable: 'DeclareVariable', DoWhileStatement: 'DoWhileStatement', EmptyStatement: 'EmptyStatement', ExportDeclaration: 'ExportDeclaration', ExportBatchSpecifier: 'ExportBatchSpecifier', ExportSpecifier: 'ExportSpecifier', ExpressionStatement: 'ExpressionStatement', ForInStatement: 'ForInStatement', ForOfStatement: 'ForOfStatement', ForStatement: 'ForStatement', FunctionDeclaration: 'FunctionDeclaration', FunctionExpression: 'FunctionExpression', FunctionTypeAnnotation: 'FunctionTypeAnnotation', FunctionTypeParam: 'FunctionTypeParam', GenericTypeAnnotation: 'GenericTypeAnnotation', Identifier: 'Identifier', IfStatement: 'IfStatement', ImportDeclaration: 'ImportDeclaration', ImportDefaultSpecifier: 'ImportDefaultSpecifier', ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', ImportSpecifier: 'ImportSpecifier', InterfaceDeclaration: 'InterfaceDeclaration', InterfaceExtends: 'InterfaceExtends', IntersectionTypeAnnotation: 'IntersectionTypeAnnotation', LabeledStatement: 'LabeledStatement', Literal: 'Literal', LogicalExpression: 'LogicalExpression', MemberExpression: 'MemberExpression', MethodDefinition: 'MethodDefinition', ModuleSpecifier: 'ModuleSpecifier', NewExpression: 'NewExpression', NullableTypeAnnotation: 'NullableTypeAnnotation', NumberTypeAnnotation: 'NumberTypeAnnotation', ObjectExpression: 'ObjectExpression', ObjectPattern: 'ObjectPattern', ObjectTypeAnnotation: 'ObjectTypeAnnotation', ObjectTypeCallProperty: 'ObjectTypeCallProperty', ObjectTypeIndexer: 'ObjectTypeIndexer', ObjectTypeProperty: 'ObjectTypeProperty', Program: 'Program', Property: 'Property', QualifiedTypeIdentifier: 'QualifiedTypeIdentifier', ReturnStatement: 'ReturnStatement', SequenceExpression: 'SequenceExpression', SpreadElement: 'SpreadElement', SpreadProperty: 'SpreadProperty', StringLiteralTypeAnnotation: 'StringLiteralTypeAnnotation', StringTypeAnnotation: 'StringTypeAnnotation', SwitchCase: 'SwitchCase', SwitchStatement: 'SwitchStatement', TaggedTemplateExpression: 'TaggedTemplateExpression', TemplateElement: 'TemplateElement', TemplateLiteral: 'TemplateLiteral', ThisExpression: 'ThisExpression', ThrowStatement: 'ThrowStatement', TupleTypeAnnotation: 'TupleTypeAnnotation', TryStatement: 'TryStatement', TypeAlias: 'TypeAlias', TypeAnnotation: 'TypeAnnotation', TypeofTypeAnnotation: 'TypeofTypeAnnotation', TypeParameterDeclaration: 'TypeParameterDeclaration', TypeParameterInstantiation: 'TypeParameterInstantiation', UnaryExpression: 'UnaryExpression', UnionTypeAnnotation: 'UnionTypeAnnotation', UpdateExpression: 'UpdateExpression', VariableDeclaration: 'VariableDeclaration', VariableDeclarator: 'VariableDeclarator', VoidTypeAnnotation: 'VoidTypeAnnotation', WhileStatement: 'WhileStatement', WithStatement: 'WithStatement', XJSIdentifier: 'XJSIdentifier', XJSNamespacedName: 'XJSNamespacedName', XJSMemberExpression: 'XJSMemberExpression', XJSEmptyExpression: 'XJSEmptyExpression', XJSExpressionContainer: 'XJSExpressionContainer', XJSElement: 'XJSElement', XJSClosingElement: 'XJSClosingElement', XJSOpeningElement: 'XJSOpeningElement', XJSAttribute: 'XJSAttribute', XJSSpreadAttribute: 'XJSSpreadAttribute', XJSText: 'XJSText', YieldExpression: 'YieldExpression', AwaitExpression: 'AwaitExpression' }; PropertyKind = { Data: 1, Get: 2, Set: 4 }; ClassPropertyType = { 'static': 'static', prototype: 'prototype' }; // Error messages should be identical to V8. Messages = { UnexpectedToken: 'Unexpected token %0', UnexpectedNumber: 'Unexpected number', UnexpectedString: 'Unexpected string', UnexpectedIdentifier: 'Unexpected identifier', UnexpectedReserved: 'Unexpected reserved word', UnexpectedTemplate: 'Unexpected quasi %0', UnexpectedEOS: 'Unexpected end of input', NewlineAfterThrow: 'Illegal newline after throw', InvalidRegExp: 'Invalid regular expression', UnterminatedRegExp: 'Invalid regular expression: missing /', InvalidLHSInAssignment: 'Invalid left-hand side in assignment', InvalidLHSInFormalsList: 'Invalid left-hand side in formals list', InvalidLHSInForIn: 'Invalid left-hand side in for-in', MultipleDefaultsInSwitch: 'More than one default clause in switch statement', NoCatchOrFinally: 'Missing catch or finally after try', UnknownLabel: 'Undefined label \'%0\'', Redeclaration: '%0 \'%1\' has already been declared', IllegalContinue: 'Illegal continue statement', IllegalBreak: 'Illegal break statement', IllegalDuplicateClassProperty: 'Illegal duplicate property in class definition', IllegalReturn: 'Illegal return statement', IllegalSpread: 'Illegal spread element', StrictModeWith: 'Strict mode code may not include a with statement', StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', StrictVarName: 'Variable name may not be eval or arguments in strict mode', StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', StrictParamDupe: 'Strict mode function may not have duplicate parameter names', ParameterAfterRestParameter: 'Rest parameter must be final parameter of an argument list', DefaultRestParameter: 'Rest parameter can not have a default value', ElementAfterSpreadElement: 'Spread must be the final element of an element list', PropertyAfterSpreadProperty: 'A rest property must be the final property of an object literal', ObjectPatternAsRestParameter: 'Invalid rest parameter', ObjectPatternAsSpread: 'Invalid spread argument', StrictFunctionName: 'Function name may not be eval or arguments in strict mode', StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', StrictDelete: 'Delete of an unqualified identifier in strict mode.', StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', StrictReservedWord: 'Use of future reserved word in strict mode', MissingFromClause: 'Missing from clause', NoAsAfterImportNamespace: 'Missing as after import *', InvalidModuleSpecifier: 'Invalid module specifier', NoUnintializedConst: 'Const must be initialized', ComprehensionRequiresBlock: 'Comprehension must have at least one block', ComprehensionError: 'Comprehension Error', EachNotAllowed: 'Each is not supported', InvalidXJSAttributeValue: 'XJS value should be either an expression or a quoted XJS text', ExpectedXJSClosingTag: 'Expected corresponding XJS closing tag for %0', AdjacentXJSElements: 'Adjacent XJS elements must be wrapped in an enclosing tag', ConfusedAboutFunctionType: 'Unexpected token =>. It looks like ' + 'you are trying to write a function type, but you ended up ' + 'writing a grouped type followed by an =>, which is a syntax ' + 'error. Remember, function type parameters are named so function ' + 'types look like (name1: type1, name2: type2) => returnType. You ' + 'probably wrote (type1) => returnType' }; // See also tools/generate-unicode-regex.py. Regex = { NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\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\u16ee-\u16f0\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\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-\ua6ef\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]'), NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\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\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\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\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\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-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'), LeadingZeros: new RegExp('^0+(?!$)') }; // Ensure the condition is true, otherwise throw an error. // This is only to have a better contract semantic, i.e. another safety net // to catch a logic error. The condition shall be fulfilled in normal case. // Do NOT use this to enforce a certain condition on any user input. function assert(condition, message) { if (!condition) { throw new Error('ASSERT: ' + message); } } function isDecimalDigit(ch) { return (ch >= 48 && ch <= 57); // 0..9 } function isHexDigit(ch) { return '0123456789abcdefABCDEF'.indexOf(ch) >= 0; } function isOctalDigit(ch) { return '01234567'.indexOf(ch) >= 0; } // 7.2 White Space function isWhiteSpace(ch) { return (ch === 32) || // space (ch === 9) || // tab (ch === 0xB) || (ch === 0xC) || (ch === 0xA0) || (ch >= 0x1680 && '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(String.fromCharCode(ch)) > 0); } // 7.3 Line Terminators function isLineTerminator(ch) { return (ch === 10) || (ch === 13) || (ch === 0x2028) || (ch === 0x2029); } // 7.6 Identifier Names and Identifiers function isIdentifierStart(ch) { return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore) (ch >= 65 && ch <= 90) || // A..Z (ch >= 97 && ch <= 122) || // a..z (ch === 92) || // \ (backslash) ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))); } function isIdentifierPart(ch) { return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore) (ch >= 65 && ch <= 90) || // A..Z (ch >= 97 && ch <= 122) || // a..z (ch >= 48 && ch <= 57) || // 0..9 (ch === 92) || // \ (backslash) ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))); } // 7.6.1.2 Future Reserved Words function isFutureReservedWord(id) { switch (id) { case 'class': case 'enum': case 'export': case 'extends': case 'import': case 'super': return true; default: return false; } } function isStrictModeReservedWord(id) { switch (id) { case 'implements': case 'interface': case 'package': case 'private': case 'protected': case 'public': case 'static': case 'yield': case 'let': return true; default: return false; } } function isRestrictedWord(id) { return id === 'eval' || id === 'arguments'; } // 7.6.1.1 Keywords function isKeyword(id) { if (strict && isStrictModeReservedWord(id)) { return true; } // 'const' is specialized as Keyword in V8. // 'yield' is only treated as a keyword in strict mode. // 'let' is for compatiblity with SpiderMonkey and ES.next. // Some others are from future reserved words. switch (id.length) { case 2: return (id === 'if') || (id === 'in') || (id === 'do'); case 3: return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try') || (id === 'let'); case 4: return (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with') || (id === 'enum'); case 5: return (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw') || (id === 'const') || (id === 'class') || (id === 'super'); case 6: return (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch') || (id === 'export') || (id === 'import'); case 7: return (id === 'default') || (id === 'finally') || (id === 'extends'); case 8: return (id === 'function') || (id === 'continue') || (id === 'debugger'); case 10: return (id === 'instanceof'); default: return false; } } // 7.4 Comments function skipComment() { var ch, blockComment, lineComment; blockComment = false; lineComment = false; while (index < length) { ch = source.charCodeAt(index); if (lineComment) { ++index; if (isLineTerminator(ch)) { lineComment = false; if (ch === 13 && source.charCodeAt(index) === 10) { ++index; } ++lineNumber; lineStart = index; } } else if (blockComment) { if (isLineTerminator(ch)) { if (ch === 13) { ++index; } if (ch !== 13 || source.charCodeAt(index) === 10) { ++lineNumber; ++index; lineStart = index; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } } else { ch = source.charCodeAt(index++); if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } // Block comment ends with '*/' (char #42, char #47). if (ch === 42) { ch = source.charCodeAt(index); if (ch === 47) { ++index; blockComment = false; } } } } else if (ch === 47) { ch = source.charCodeAt(index + 1); // Line comment starts with '//' (char #47, char #47). if (ch === 47) { index += 2; lineComment = true; } else if (ch === 42) { // Block comment starts with '/*' (char #47, char #42). index += 2; blockComment = true; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } else { break; } } else if (isWhiteSpace(ch)) { ++index; } else if (isLineTerminator(ch)) { ++index; if (ch === 13 && source.charCodeAt(index) === 10) { ++index; } ++lineNumber; lineStart = index; } else { break; } } } function scanHexEscape(prefix) { var i, len, ch, code = 0; len = (prefix === 'u') ? 4 : 2; for (i = 0; i < len; ++i) { if (index < length && isHexDigit(source[index])) { ch = source[index++]; code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); } else { return ''; } } return String.fromCharCode(code); } function scanUnicodeCodePointEscape() { var ch, code, cu1, cu2; ch = source[index]; code = 0; // At least, one hex digit is required. if (ch === '}') { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } while (index < length) { ch = source[index++]; if (!isHexDigit(ch)) { break; } code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); } if (code > 0x10FFFF || ch !== '}') { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } // UTF-16 Encoding if (code <= 0xFFFF) { return String.fromCharCode(code); } cu1 = ((code - 0x10000) >> 10) + 0xD800; cu2 = ((code - 0x10000) & 1023) + 0xDC00; return String.fromCharCode(cu1, cu2); } function getEscapedIdentifier() { var ch, id; ch = source.charCodeAt(index++); id = String.fromCharCode(ch); // '\u' (char #92, char #117) denotes an escaped character. if (ch === 92) { if (source.charCodeAt(index) !== 117) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } ++index; ch = scanHexEscape('u'); if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } id = ch; } while (index < length) { ch = source.charCodeAt(index); if (!isIdentifierPart(ch)) { break; } ++index; id += String.fromCharCode(ch); // '\u' (char #92, char #117) denotes an escaped character. if (ch === 92) { id = id.substr(0, id.length - 1); if (source.charCodeAt(index) !== 117) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } ++index; ch = scanHexEscape('u'); if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } id += ch; } } return id; } function getIdentifier() { var start, ch; start = index++; while (index < length) { ch = source.charCodeAt(index); if (ch === 92) { // Blackslash (char #92) marks Unicode escape sequence. index = start; return getEscapedIdentifier(); } if (isIdentifierPart(ch)) { ++index; } else { break; } } return source.slice(start, index); } function scanIdentifier() { var start, id, type; start = index; // Backslash (char #92) starts an escaped character. id = (source.charCodeAt(index) === 92) ? getEscapedIdentifier() : getIdentifier(); // There is no keyword or literal with only one character. // Thus, it must be an identifier. if (id.length === 1) { type = Token.Identifier; } else if (isKeyword(id)) { type = Token.Keyword; } else if (id === 'null') { type = Token.NullLiteral; } else if (id === 'true' || id === 'false') { type = Token.BooleanLiteral; } else { type = Token.Identifier; } return { type: type, value: id, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } // 7.7 Punctuators function scanPunctuator() { var start = index, code = source.charCodeAt(index), code2, ch1 = source[index], ch2, ch3, ch4; switch (code) { // Check for most common single-character punctuators. case 40: // ( open bracket case 41: // ) close bracket case 59: // ; semicolon case 44: // , comma case 123: // { open curly brace case 125: // } close curly brace case 91: // [ case 93: // ] case 58: // : case 63: // ? case 126: // ~ ++index; if (extra.tokenize) { if (code === 40) { extra.openParenToken = extra.tokens.length; } else if (code === 123) { extra.openCurlyToken = extra.tokens.length; } } return { type: Token.Punctuator, value: String.fromCharCode(code), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; default: code2 = source.charCodeAt(index + 1); // '=' (char #61) marks an assignment or comparison operator. if (code2 === 61) { switch (code) { case 37: // % case 38: // & case 42: // *: case 43: // + case 45: // - case 47: // / case 60: // < case 62: // > case 94: // ^ case 124: // | index += 2; return { type: Token.Punctuator, value: String.fromCharCode(code) + String.fromCharCode(code2), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; case 33: // ! case 61: // = index += 2; // !== and === if (source.charCodeAt(index) === 61) { ++index; } return { type: Token.Punctuator, value: source.slice(start, index), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; default: break; } } break; } // Peek more characters. ch2 = source[index + 1]; ch3 = source[index + 2]; ch4 = source[index + 3]; // 4-character punctuator: >>>= if (ch1 === '>' && ch2 === '>' && ch3 === '>') { if (ch4 === '=') { index += 4; return { type: Token.Punctuator, value: '>>>=', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } } // 3-character punctuators: === !== >>> <<= >>= if (ch1 === '>' && ch2 === '>' && ch3 === '>') { index += 3; return { type: Token.Punctuator, value: '>>>', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '<' && ch2 === '<' && ch3 === '=') { index += 3; return { type: Token.Punctuator, value: '<<=', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '>' && ch2 === '>' && ch3 === '=') { index += 3; return { type: Token.Punctuator, value: '>>=', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '.' && ch2 === '.' && ch3 === '.') { index += 3; return { type: Token.Punctuator, value: '...', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } // Other 2-character punctuators: ++ -- << >> && || // Don't match these tokens if we're in a type, since they never can // occur and can mess up types like Map<string, Array<string>> if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0) && !state.inType) { index += 2; return { type: Token.Punctuator, value: ch1 + ch2, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '=' && ch2 === '>') { index += 2; return { type: Token.Punctuator, value: '=>', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { ++index; return { type: Token.Punctuator, value: ch1, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '.') { ++index; return { type: Token.Punctuator, value: ch1, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } // 7.8.3 Numeric Literals function scanHexLiteral(start) { var number = ''; while (index < length) { if (!isHexDigit(source[index])) { break; } number += source[index++]; } if (number.length === 0) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } if (isIdentifierStart(source.charCodeAt(index))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.NumericLiteral, value: parseInt('0x' + number, 16), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanOctalLiteral(prefix, start) { var number, octal; if (isOctalDigit(prefix)) { octal = true; number = '0' + source[index++]; } else { octal = false; ++index; number = ''; } while (index < length) { if (!isOctalDigit(source[index])) { break; } number += source[index++]; } if (!octal && number.length === 0) { // only 0o or 0O throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.NumericLiteral, value: parseInt(number, 8), octal: octal, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanNumericLiteral() { var number, start, ch, octal; ch = source[index]; assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point'); start = index; number = ''; if (ch !== '.') { number = source[index++]; ch = source[index]; // Hex number starts with '0x'. // Octal number starts with '0'. // Octal number in ES6 starts with '0o'. // Binary number in ES6 starts with '0b'. if (number === '0') { if (ch === 'x' || ch === 'X') { ++index; return scanHexLiteral(start); } if (ch === 'b' || ch === 'B') { ++index; number = ''; while (index < length) { ch = source[index]; if (ch !== '0' && ch !== '1') { break; } number += source[index++]; } if (number.length === 0) { // only 0b or 0B throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } if (index < length) { ch = source.charCodeAt(index); if (isIdentifierStart(ch) || isDecimalDigit(ch)) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } return { type: Token.NumericLiteral, value: parseInt(number, 2), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch === 'o' || ch === 'O' || isOctalDigit(ch)) { return scanOctalLiteral(ch, start); } // decimal number starts with '0' such as '09' is illegal. if (ch && isDecimalDigit(ch.charCodeAt(0))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } ch = source[index]; } if (ch === '.') { number += source[index++]; while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } ch = source[index]; } if (ch === 'e' || ch === 'E') { number += source[index++]; ch = source[index]; if (ch === '+' || ch === '-') { number += source[index++]; } if (isDecimalDigit(source.charCodeAt(index))) { while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } } else { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } if (isIdentifierStart(source.charCodeAt(index))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.NumericLiteral, value: parseFloat(number), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } // 7.8.4 String Literals function scanStringLiteral() { var str = '', quote, start, ch, code, unescaped, restore, octal = false; quote = source[index]; assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote'); start = index; ++index; while (index < length) { ch = source[index++]; if (ch === quote) { quote = ''; break; } else if (ch === '\\') { ch = source[index++]; if (!ch || !isLineTerminator(ch.charCodeAt(0))) { switch (ch) { case 'n': str += '\n'; break; case 'r': str += '\r'; break; case 't': str += '\t'; break; case 'u': case 'x': if (source[index] === '{') { ++index; str += scanUnicodeCodePointEscape(); } else { restore = index; unescaped = scanHexEscape(ch); if (unescaped) { str += unescaped; } else { index = restore; str += ch; } } break; case 'b': str += '\b'; break; case 'f': str += '\f'; break; case 'v': str += '\x0B'; break; default: if (isOctalDigit(ch)) { code = '01234567'.indexOf(ch); // \0 is not octal escape sequence if (code !== 0) { octal = true; } if (index < length && isOctalDigit(source[index])) { octal = true; code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts // with 0, 1, 2, 3 if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) { code = code * 8 + '01234567'.indexOf(source[index++]); } } str += String.fromCharCode(code); } else { str += ch; } break; } } else { ++lineNumber; if (ch === '\r' && source[index] === '\n') { ++index; } lineStart = index; } } else if (isLineTerminator(ch.charCodeAt(0))) { break; } else { str += ch; } } if (quote !== '') { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.StringLiteral, value: str, octal: octal, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanTemplate() { var cooked = '', ch, start, terminated, tail, restore, unescaped, code, octal; terminated = false; tail = false; start = index; ++index; while (index < length) { ch = source[index++]; if (ch === '`') { tail = true; terminated = true; break; } else if (ch === '$') { if (source[index] === '{') { ++index; terminated = true; break; } cooked += ch; } else if (ch === '\\') { ch = source[index++]; if (!isLineTerminator(ch.charCodeAt(0))) { switch (ch) { case 'n': cooked += '\n'; break; case 'r': cooked += '\r'; break; case 't': cooked += '\t'; break; case 'u': case 'x': if (source[index] === '{') { ++index; cooked += scanUnicodeCodePointEscape(); } else { restore = index; unescaped = scanHexEscape(ch); if (unescaped) { cooked += unescaped; } else { index = restore; cooked += ch; } } break; case 'b': cooked += '\b'; break; case 'f': cooked += '\f'; break; case 'v': cooked += '\v'; break; default: if (isOctalDigit(ch)) { code = '01234567'.indexOf(ch); // \0 is not octal escape sequence if (code !== 0) { octal = true; } if (index < length && isOctalDigit(source[index])) { octal = true; code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts // with 0, 1, 2, 3 if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) { code = code * 8 + '01234567'.indexOf(source[index++]); } } cooked += String.fromCharCode(code); } else { cooked += ch; } break; } } else { ++lineNumber; if (ch === '\r' && source[index] === '\n') { ++index; } lineStart = index; } } else if (isLineTerminator(ch.charCodeAt(0))) { ++lineNumber; if (ch === '\r' && source[index] === '\n') { ++index; } lineStart = index; cooked += '\n'; } else { cooked += ch; } } if (!terminated) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.Template, value: { cooked: cooked, raw: source.slice(start + 1, index - ((tail) ? 1 : 2)) }, tail: tail, octal: octal, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanTemplateElement(option) { var startsWith, template; lookahead = null; skipComment(); startsWith = (option.head) ? '`' : '}'; if (source[index] !== startsWith) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } template = scanTemplate(); peek(); return template; } function scanRegExp() { var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false, tmp; lookahead = null; skipComment(); start = index; ch = source[index]; assert(ch === '/', 'Regular expression literal must start with a slash'); str = source[index++]; while (index < length) { ch = source[index++]; str += ch; if (classMarker) { if (ch === ']') { classMarker = false; } } else { if (ch === '\\') { ch = source[index++]; // ECMA-262 7.8.5 if (isLineTerminator(ch.charCodeAt(0))) { throwError({}, Messages.UnterminatedRegExp); } str += ch; } else if (ch === '/') { terminated = true; break; } else if (ch === '[') { classMarker = true; } else if (isLineTerminator(ch.charCodeAt(0))) { throwError({}, Messages.UnterminatedRegExp); } } } if (!terminated) { throwError({}, Messages.UnterminatedRegExp); } // Exclude leading and trailing slash. pattern = str.substr(1, str.length - 2); flags = ''; while (index < length) { ch = source[index]; if (!isIdentifierPart(ch.charCodeAt(0))) { break; } ++index; if (ch === '\\' && index < length) { ch = source[index]; if (ch === 'u') { ++index; restore = index; ch = scanHexEscape('u'); if (ch) { flags += ch; for (str += '\\u'; restore < index; ++restore) { str += source[restore]; } } else { index = restore; flags += 'u'; str += '\\u'; } } else { str += '\\'; } } else { flags += ch; str += ch; } } tmp = pattern; if (flags.indexOf('u') >= 0) { // Replace each astral symbol and every Unicode code point // escape sequence that represents such a symbol with a single // ASCII symbol to avoid throwing on regular expressions that // are only valid in combination with the `/u` flag. tmp = tmp .replace(/\\u\{([0-9a-fA-F]{5,6})\}/g, 'x') .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x'); } // First, detect invalid regular expressions. try { value = new RegExp(tmp); } catch (e) { throwError({}, Messages.InvalidRegExp); } // Return a regular expression object for this pattern-flag pair, or // `null` in case the current environment doesn't support the flags it // uses. try { value = new RegExp(pattern, flags); } catch (exception) { value = null; } peek(); if (extra.tokenize) { return { type: Token.RegularExpression, value: value, regex: { pattern: pattern, flags: flags }, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } return { literal: str, value: value, regex: { pattern: pattern, flags: flags }, range: [start, index] }; } function isIdentifierName(token) { return token.type === Token.Identifier || token.type === Token.Keyword || token.type === Token.BooleanLiteral || token.type === Token.NullLiteral; } function advanceSlash() { var prevToken, checkToken; // Using the following algorithm: // https://github.com/mozilla/sweet.js/wiki/design prevToken = extra.tokens[extra.tokens.length - 1]; if (!prevToken) { // Nothing before that: it cannot be a division. return scanRegExp(); } if (prevToken.type === 'Punctuator') { if (prevToken.value === ')') { checkToken = extra.tokens[extra.openParenToken - 1]; if (checkToken && checkToken.type === 'Keyword' && (checkToken.value === 'if' || checkToken.value === 'while' || checkToken.value === 'for' || checkToken.value === 'with')) { return scanRegExp(); } return scanPunctuator(); } if (prevToken.value === '}') { // Dividing a function by anything makes little sense, // but we have to check for that. if (extra.tokens[extra.openCurlyToken - 3] && extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') { // Anonymous function. checkToken = extra.tokens[extra.openCurlyToken - 4]; if (!checkToken) { return scanPunctuator(); } } else if (extra.tokens[extra.openCurlyToken - 4] && extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') { // Named function. checkToken = extra.tokens[extra.openCurlyToken - 5]; if (!checkToken) { return scanRegExp(); } } else { return scanPunctuator(); } // checkToken determines whether the function is // a declaration or an expression. if (FnExprTokens.indexOf(checkToken.value) >= 0) { // It is an expression. return scanPunctuator(); } // It is a declaration. return scanRegExp(); } return scanRegExp(); } if (prevToken.type === 'Keyword') { return scanRegExp(); } return scanPunctuator(); } function advance() { var ch; if (!state.inXJSChild) { skipComment(); } if (index >= length) { return { type: Token.EOF, lineNumber: lineNumber, lineStart: lineStart, range: [index, index] }; } if (state.inXJSChild) { return advanceXJSChild(); } ch = source.charCodeAt(index); // Very common: ( and ) and ; if (ch === 40 || ch === 41 || ch === 58) { return scanPunctuator(); } // String literal starts with single quote (#39) or double quote (#34). if (ch === 39 || ch === 34) { if (state.inXJSTag) { return scanXJSStringLiteral(); } return scanStringLiteral(); } if (state.inXJSTag && isXJSIdentifierStart(ch)) { return scanXJSIdentifier(); } if (ch === 96) { return scanTemplate(); } if (isIdentifierStart(ch)) { return scanIdentifier(); } // Dot (.) char #46 can also start a floating-point number, hence the need // to check the next character. if (ch === 46) { if (isDecimalDigit(source.charCodeAt(index + 1))) { return scanNumericLiteral(); } return scanPunctuator(); } if (isDecimalDigit(ch)) { return scanNumericLiteral(); } // Slash (/) char #47 can also start a regex. if (extra.tokenize && ch === 47) { return advanceSlash(); } return scanPunctuator(); } function lex() { var token; token = lookahead; index = token.range[1]; lineNumber = token.lineNumber; lineStart = token.lineStart; lookahead = advance(); index = token.range[1]; lineNumber = token.lineNumber; lineStart = token.lineStart; return token; } function peek() { var pos, line, start; pos = index; line = lineNumber; start = lineStart; lookahead = advance(); index = pos; lineNumber = line; lineStart = start; } function lookahead2() { var adv, pos, line, start, result; // If we are collecting the tokens, don't grab the next one yet. adv = (typeof extra.advance === 'function') ? extra.advance : advance; pos = index; line = lineNumber; start = lineStart; // Scan for the next immediate token. if (lookahead === null) { lookahead = adv(); } index = lookahead.range[1]; lineNumber = lookahead.lineNumber; lineStart = lookahead.lineStart; // Grab the token right after. result = adv(); index = pos; lineNumber = line; lineStart = start; return result; } function rewind(token) { index = token.range[0]; lineNumber = token.lineNumber; lineStart = token.lineStart; lookahead = token; } function markerCreate() { if (!extra.loc && !extra.range) { return undefined; } skipComment(); return {offset: index, line: lineNumber, col: index - lineStart}; } function markerCreatePreserveWhitespace() { if (!extra.loc && !extra.range) { return undefined; } return {offset: index, line: lineNumber, col: index - lineStart}; } function processComment(node) { var lastChild, trailingComments, bottomRight = extra.bottomRightStack, last = bottomRight[bottomRight.length - 1]; if (node.type === Syntax.Program) { if (node.body.length > 0) { return; } } if (extra.trailingComments.length > 0) { if (extra.trailingComments[0].range[0] >= node.range[1]) { trailingComments = extra.trailingComments; extra.trailingComments = []; } else { extra.trailingComments.length = 0; } } else { if (last && last.trailingComments && last.trailingComments[0].range[0] >= node.range[1]) { trailingComments = last.trailingComments; delete last.trailingComments; } } // Eating the stack. if (last) { while (last && last.range[0] >= node.range[0]) { lastChild = last; last = bottomRight.pop(); } } if (lastChild) { if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) { node.leadingComments = lastChild.leadingComments; delete lastChild.leadingComments; } } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) { node.leadingComments = extra.leadingComments; extra.leadingComments = []; } if (trailingComments) { node.trailingComments = trailingComments; } bottomRight.push(node); } function markerApply(marker, node) { if (extra.range) { node.range = [marker.offset, index]; } if (extra.loc) { node.loc = { start: { line: marker.line, column: marker.col }, end: { line: lineNumber, column: index - lineStart } }; node = delegate.postProcess(node); } if (extra.attachComment) { processComment(node); } return node; } SyntaxTreeDelegate = { name: 'SyntaxTree', postProcess: function (node) { return node; }, createArrayExpression: function (elements) { return { type: Syntax.ArrayExpression, elements: elements }; }, createAssignmentExpression: function (operator, left, right) { return { type: Syntax.AssignmentExpression, operator: operator, left: left, right: right }; }, createBinaryExpression: function (operator, left, right) { var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression; return { type: type, operator: operator, left: left, right: right }; }, createBlockStatement: function (body) { return { type: Syntax.BlockStatement, body: body }; }, createBreakStatement: function (label) { return { type: Syntax.BreakStatement, label: label }; }, createCallExpression: function (callee, args) { return { type: Syntax.CallExpression, callee: callee, 'arguments': args }; }, createCatchClause: function (param, body) { return { type: Syntax.CatchClause, param: param, body: body }; }, createConditionalExpression: function (test, consequent, alternate) { return { type: Syntax.ConditionalExpression, test: test, consequent: consequent, alternate: alternate }; }, createContinueStatement: function (label) { return { type: Syntax.ContinueStatement, label: label }; }, createDebuggerStatement: function () { return { type: Syntax.DebuggerStatement }; }, createDoWhileStatement: function (body, test) { return { type: Syntax.DoWhileStatement, body: body, test: test }; }, createEmptyStatement: function () { return { type: Syntax.EmptyStatement }; }, createExpressionStatement: function (expression) { return { type: Syntax.ExpressionStatement, expression: expression }; }, createForStatement: function (init, test, update, body) { return { type: Syntax.ForStatement, init: init, test: test, update: update, body: body }; }, createForInStatement: function (left, right, body) { return { type: Syntax.ForInStatement, left: left, right: right, body: body, each: false }; }, createForOfStatement: function (left, right, body) { return { type: Syntax.ForOfStatement, left: left, right: right, body: body }; }, createFunctionDeclaration: function (id, params, defaults, body, rest, generator, expression, isAsync, returnType, typeParameters) { var funDecl = { type: Syntax.FunctionDeclaration, id: id, params: params, defaults: defaults, body: body, rest: rest, generator: generator, expression: expression, returnType: returnType, typeParameters: typeParameters }; if (isAsync) { funDecl.async = true; } return funDecl; }, createFunctionExpression: function (id, params, defaults, body, rest, generator, expression, isAsync, returnType, typeParameters) { var funExpr = { type: Syntax.FunctionExpression, id: id, params: params, defaults: defaults, body: body, rest: rest, generator: generator, expression: expression, returnType: returnType, typeParameters: typeParameters }; if (isAsync) { funExpr.async = true; } return funExpr; }, createIdentifier: function (name) { return { type: Syntax.Identifier, name: name, // Only here to initialize the shape of the object to ensure // that the 'typeAnnotation' key is ordered before others that // are added later (like 'loc' and 'range'). This just helps // keep the shape of Identifier nodes consistent with everything // else. typeAnnotation: undefined, optional: undefined }; }, createTypeAnnotation: function (typeAnnotation) { return { type: Syntax.TypeAnnotation, typeAnnotation: typeAnnotation }; }, createFunctionTypeAnnotation: function (params, returnType, rest, typeParameters) { return { type: Syntax.FunctionTypeAnnotation, params: params, returnType: returnType, rest: rest, typeParameters: typeParameters }; }, createFunctionTypeParam: function (name, typeAnnotation, optional) { return { type: Syntax.FunctionTypeParam, name: name, typeAnnotation: typeAnnotation, optional: optional }; }, createNullableTypeAnnotation: function (typeAnnotation) { return { type: Syntax.NullableTypeAnnotation, typeAnnotation: typeAnnotation }; }, createArrayTypeAnnotation: function (elementType) { return { type: Syntax.ArrayTypeAnnotation, elementType: elementType }; }, createGenericTypeAnnotation: function (id, typeParameters) { return { type: Syntax.GenericTypeAnnotation, id: id, typeParameters: typeParameters }; }, createQualifiedTypeIdentifier: function (qualification, id) { return { type: Syntax.QualifiedTypeIdentifier, qualification: qualification, id: id }; }, createTypeParameterDeclaration: function (params) { return { type: Syntax.TypeParameterDeclaration, params: params }; }, createTypeParameterInstantiation: function (params) { return { type: Syntax.TypeParameterInstantiation, params: params }; }, createAnyTypeAnnotation: function () { return { type: Syntax.AnyTypeAnnotation }; }, createBooleanTypeAnnotation: function () { return { type: Syntax.BooleanTypeAnnotation }; }, createNumberTypeAnnotation: function () { return { type: Syntax.NumberTypeAnnotation }; }, createStringTypeAnnotation: function () { return { type: Syntax.StringTypeAnnotation }; }, createStringLiteralTypeAnnotation: function (token) { return { type: Syntax.StringLiteralTypeAnnotation, value: token.value, raw: source.slice(token.range[0], token.range[1]) }; }, createVoidTypeAnnotation: function () { return { type: Syntax.VoidTypeAnnotation }; }, createTypeofTypeAnnotation: function (argument) { return { type: Syntax.TypeofTypeAnnotation, argument: argument }; }, createTupleTypeAnnotation: function (types) { return { type: Syntax.TupleTypeAnnotation, types: types }; }, createObjectTypeAnnotation: function (properties, indexers, callProperties) { return { type: Syntax.ObjectTypeAnnotation, properties: properties, indexers: indexers, callProperties: callProperties }; }, createObjectTypeIndexer: function (id, key, value, isStatic) { return { type: Syntax.ObjectTypeIndexer, id: id, key: key, value: value, "static": isStatic }; }, createObjectTypeCallProperty: function (value, isStatic) { return { type: Syntax.ObjectTypeCallProperty, value: value, "static": isStatic }; }, createObjectTypeProperty: function (key, value, optional, isStatic) { return { type: Syntax.ObjectTypeProperty, key: key, value: value, optional: optional, "static": isStatic }; }, createUnionTypeAnnotation: function (types) { return { type: Syntax.UnionTypeAnnotation, types: types }; }, createIntersectionTypeAnnotation: function (types) { return { type: Syntax.IntersectionTypeAnnotation, types: types }; }, createTypeAlias: function (id, typeParameters, right) { return { type: Syntax.TypeAlias, id: id, typeParameters: typeParameters, right: right }; }, createInterface: function (id, typeParameters, body, extended) { return { type: Syntax.InterfaceDeclaration, id: id, typeParameters: typeParameters, body: body, "extends": extended }; }, createInterfaceExtends: function (id, typeParameters) { return { type: Syntax.InterfaceExtends, id: id, typeParameters: typeParameters }; }, createDeclareFunction: function (id) { return { type: Syntax.DeclareFunction, id: id }; }, createDeclareVariable: function (id) { return { type: Syntax.DeclareVariable, id: id }; }, createDeclareModule: function (id, body) { return { type: Syntax.DeclareModule, id: id, body: body }; }, createXJSAttribute: function (name, value) { return { type: Syntax.XJSAttribute, name: name, value: value || null }; }, createXJSSpreadAttribute: function (argument) { return { type: Syntax.XJSSpreadAttribute, argument: argument }; }, createXJSIdentifier: function (name) { return { type: Syntax.XJSIdentifier, name: name }; }, createXJSNamespacedName: function (namespace, name) { return { type: Syntax.XJSNamespacedName, namespace: namespace, name: name }; }, createXJSMemberExpression: function (object, property) { return { type: Syntax.XJSMemberExpression, object: object, property: property }; }, createXJSElement: function (openingElement, closingElement, children) { return { type: Syntax.XJSElement, openingElement: openingElement, closingElement: closingElement, children: children }; }, createXJSEmptyExpression: function () { return { type: Syntax.XJSEmptyExpression }; }, createXJSExpressionContainer: function (expression) { return { type: Syntax.XJSExpressionContainer, expression: expression }; }, createXJSOpeningElement: function (name, attributes, selfClosing) { return { type: Syntax.XJSOpeningElement, name: name, selfClosing: selfClosing, attributes: attributes }; }, createXJSClosingElement: function (name) { return { type: Syntax.XJSClosingElement, name: name }; }, createIfStatement: function (test, consequent, alternate) { return { type: Syntax.IfStatement, test: test, consequent: consequent, alternate: alternate }; }, createLabeledStatement: function (label, body) { return { type: Syntax.LabeledStatement, label: label, body: body }; }, createLiteral: function (token) { var object = { type: Syntax.Literal, value: token.value, raw: source.slice(token.range[0], token.range[1]) }; if (token.regex) { object.regex = token.regex; } return object; }, createMemberExpression: function (accessor, object, property) { return { type: Syntax.MemberExpression, computed: accessor === '[', object: object, property: property }; }, createNewExpression: function (callee, args) { return { type: Syntax.NewExpression, callee: callee, 'arguments': args }; }, createObjectExpression: function (properties) { return { type: Syntax.ObjectExpression, properties: properties }; }, createPostfixExpression: function (operator, argument) { return { type: Syntax.UpdateExpression, operator: operator, argument: argument, prefix: false }; }, createProgram: function (body) { return { type: Syntax.Program, body: body }; }, createProperty: function (kind, key, value, method, shorthand, computed) { return { type: Syntax.Property, key: key, value: value, kind: kind, method: method, shorthand: shorthand, computed: computed }; }, createReturnStatement: function (argument) { return { type: Syntax.ReturnStatement, argument: argument }; }, createSequenceExpression: function (expressions) { return { type: Syntax.SequenceExpression, expressions: expressions }; }, createSwitchCase: function (test, consequent) { return { type: Syntax.SwitchCase, test: test, consequent: consequent }; }, createSwitchStatement: function (discriminant, cases) { return { type: Syntax.SwitchStatement, discriminant: discriminant, cases: cases }; }, createThisExpression: function () { return { type: Syntax.ThisExpression }; }, createThrowStatement: function (argument) { return { type: Syntax.ThrowStatement, argument: argument }; }, createTryStatement: function (block, guardedHandlers, handlers, finalizer) { return { type: Syntax.TryStatement, block: block, guardedHandlers: guardedHandlers, handlers: handlers, finalizer: finalizer }; }, createUnaryExpression: function (operator, argument) { if (operator === '++' || operator === '--') { return { type: Syntax.UpdateExpression, operator: operator, argument: argument, prefix: true }; } return { type: Syntax.UnaryExpression, operator: operator, argument: argument, prefix: true }; }, createVariableDeclaration: function (declarations, kind) { return { type: Syntax.VariableDeclaration, declarations: declarations, kind: kind }; }, createVariableDeclarator: function (id, init) { return { type: Syntax.VariableDeclarator, id: id, init: init }; }, createWhileStatement: function (test, body) { return { type: Syntax.WhileStatement, test: test, body: body }; }, createWithStatement: function (object, body) { return { type: Syntax.WithStatement, object: object, body: body }; }, createTemplateElement: function (value, tail) { return { type: Syntax.TemplateElement, value: value, tail: tail }; }, createTemplateLiteral: function (quasis, expressions) { return { type: Syntax.TemplateLiteral, quasis: quasis, expressions: expressions }; }, createSpreadElement: function (argument) { return { type: Syntax.SpreadElement, argument: argument }; }, createSpreadProperty: function (argument) { return { type: Syntax.SpreadProperty, argument: argument }; }, createTaggedTemplateExpression: function (tag, quasi) { return { type: Syntax.TaggedTemplateExpression, tag: tag, quasi: quasi }; }, createArrowFunctionExpression: function (params, defaults, body, rest, expression, isAsync) { var arrowExpr = { type: Syntax.ArrowFunctionExpression, id: null, params: params, defaults: defaults, body: body, rest: rest, generator: false, expression: expression }; if (isAsync) { arrowExpr.async = true; } return arrowExpr; }, createMethodDefinition: function (propertyType, kind, key, value) { return { type: Syntax.MethodDefinition, key: key, value: value, kind: kind, 'static': propertyType === ClassPropertyType["static"] }; }, createClassProperty: function (key, typeAnnotation, computed, isStatic) { return { type: Syntax.ClassProperty, key: key, typeAnnotation: typeAnnotation, computed: computed, "static": isStatic }; }, createClassBody: function (body) { return { type: Syntax.ClassBody, body: body }; }, createClassImplements: function (id, typeParameters) { return { type: Syntax.ClassImplements, id: id, typeParameters: typeParameters }; }, createClassExpression: function (id, superClass, body, typeParameters, superTypeParameters, implemented) { return { type: Syntax.ClassExpression, id: id, superClass: superClass, body: body, typeParameters: typeParameters, superTypeParameters: superTypeParameters, "implements": implemented }; }, createClassDeclaration: function (id, superClass, body, typeParameters, superTypeParameters, implemented) { return { type: Syntax.ClassDeclaration, id: id, superClass: superClass, body: body, typeParameters: typeParameters, superTypeParameters: superTypeParameters, "implements": implemented }; }, createModuleSpecifier: function (token) { return { type: Syntax.ModuleSpecifier, value: token.value, raw: source.slice(token.range[0], token.range[1]) }; }, createExportSpecifier: function (id, name) { return { type: Syntax.ExportSpecifier, id: id, name: name }; }, createExportBatchSpecifier: function () { return { type: Syntax.ExportBatchSpecifier }; }, createImportDefaultSpecifier: function (id) { return { type: Syntax.ImportDefaultSpecifier, id: id }; }, createImportNamespaceSpecifier: function (id) { return { type: Syntax.ImportNamespaceSpecifier, id: id }; }, createExportDeclaration: function (isDefault, declaration, specifiers, source) { return { type: Syntax.ExportDeclaration, 'default': !!isDefault, declaration: declaration, specifiers: specifiers, source: source }; }, createImportSpecifier: function (id, name) { return { type: Syntax.ImportSpecifier, id: id, name: name }; }, createImportDeclaration: function (specifiers, source) { return { type: Syntax.ImportDeclaration, specifiers: specifiers, source: source }; }, createYieldExpression: function (argument, delegate) { return { type: Syntax.YieldExpression, argument: argument, delegate: delegate }; }, createAwaitExpression: function (argument) { return { type: Syntax.AwaitExpression, argument: argument }; }, createComprehensionExpression: function (filter, blocks, body) { return { type: Syntax.ComprehensionExpression, filter: filter, blocks: blocks, body: body }; } }; // Return true if there is a line terminator before the next token. function peekLineTerminator() { var pos, line, start, found; pos = index; line = lineNumber; start = lineStart; skipComment(); found = lineNumber !== line; index = pos; lineNumber = line; lineStart = start; return found; } // Throw an exception function throwError(token, messageFormat) { var error, args = Array.prototype.slice.call(arguments, 2), msg = messageFormat.replace( /%(\d)/g, function (whole, index) { assert(index < args.length, 'Message reference must be in range'); return args[index]; } ); if (typeof token.lineNumber === 'number') { error = new Error('Line ' + token.lineNumber + ': ' + msg); error.index = token.range[0]; error.lineNumber = token.lineNumber; error.column = token.range[0] - lineStart + 1; } else { error = new Error('Line ' + lineNumber + ': ' + msg); error.index = index; error.lineNumber = lineNumber; error.column = index - lineStart + 1; } error.description = msg; throw error; } function throwErrorTolerant() { try { throwError.apply(null, arguments); } catch (e) { if (extra.errors) { extra.errors.push(e); } else { throw e; } } } // Throw an exception because of the token. function throwUnexpected(token) { if (token.type === Token.EOF) { throwError(token, Messages.UnexpectedEOS); } if (token.type === Token.NumericLiteral) { throwError(token, Messages.UnexpectedNumber); } if (token.type === Token.StringLiteral || token.type === Token.XJSText) { throwError(token, Messages.UnexpectedString); } if (token.type === Token.Identifier) { throwError(token, Messages.UnexpectedIdentifier); } if (token.type === Token.Keyword) { if (isFutureReservedWord(token.value)) { throwError(token, Messages.UnexpectedReserved); } else if (strict && isStrictModeReservedWord(token.value)) { throwErrorTolerant(token, Messages.StrictReservedWord); return; } throwError(token, Messages.UnexpectedToken, token.value); } if (token.type === Token.Template) { throwError(token, Messages.UnexpectedTemplate, token.value.raw); } // BooleanLiteral, NullLiteral, or Punctuator. throwError(token, Messages.UnexpectedToken, token.value); } // Expect the next token to match the specified punctuator. // If not, an exception will be thrown. function expect(value) { var token = lex(); if (token.type !== Token.Punctuator || token.value !== value) { throwUnexpected(token); } } // Expect the next token to match the specified keyword. // If not, an exception will be thrown. function expectKeyword(keyword, contextual) { var token = lex(); if (token.type !== (contextual ? Token.Identifier : Token.Keyword) || token.value !== keyword) { throwUnexpected(token); } } // Expect the next token to match the specified contextual keyword. // If not, an exception will be thrown. function expectContextualKeyword(keyword) { return expectKeyword(keyword, true); } // Return true if the next token matches the specified punctuator. function match(value) { return lookahead.type === Token.Punctuator && lookahead.value === value; } // Return true if the next token matches the specified keyword function matchKeyword(keyword, contextual) { var expectedType = contextual ? Token.Identifier : Token.Keyword; return lookahead.type === expectedType && lookahead.value === keyword; } // Return true if the next token matches the specified contextual keyword function matchContextualKeyword(keyword) { return matchKeyword(keyword, true); } // Return true if the next token is an assignment operator function matchAssign() { var op; if (lookahead.type !== Token.Punctuator) { return false; } op = lookahead.value; return op === '=' || op === '*=' || op === '/=' || op === '%=' || op === '+=' || op === '-=' || op === '<<=' || op === '>>=' || op === '>>>=' || op === '&=' || op === '^=' || op === '|='; } // Note that 'yield' is treated as a keyword in strict mode, but a // contextual keyword (identifier) in non-strict mode, so we need to // use matchKeyword('yield', false) and matchKeyword('yield', true) // (i.e. matchContextualKeyword) appropriately. function matchYield() { return state.yieldAllowed && matchKeyword('yield', !strict); } function matchAsync() { var backtrackToken = lookahead, matches = false; if (matchContextualKeyword('async')) { lex(); // Make sure peekLineTerminator() starts after 'async'. matches = !peekLineTerminator(); rewind(backtrackToken); // Revert the lex(). } return matches; } function matchAwait() { return state.awaitAllowed && matchContextualKeyword('await'); } function consumeSemicolon() { var line, oldIndex = index, oldLineNumber = lineNumber, oldLineStart = lineStart, oldLookahead = lookahead; // Catch the very common case first: immediately a semicolon (char #59). if (source.charCodeAt(index) === 59) { lex(); return; } line = lineNumber; skipComment(); if (lineNumber !== line) { index = oldIndex; lineNumber = oldLineNumber; lineStart = oldLineStart; lookahead = oldLookahead; return; } if (match(';')) { lex(); return; } if (lookahead.type !== Token.EOF && !match('}')) { throwUnexpected(lookahead); } } // Return true if provided expression is LeftHandSideExpression function isLeftHandSide(expr) { return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression; } function isAssignableLeftHandSide(expr) { return isLeftHandSide(expr) || expr.type === Syntax.ObjectPattern || expr.type === Syntax.ArrayPattern; } // 11.1.4 Array Initialiser function parseArrayInitialiser() { var elements = [], blocks = [], filter = null, tmp, possiblecomprehension = true, body, marker = markerCreate(); expect('['); while (!match(']')) { if (lookahead.value === 'for' && lookahead.type === Token.Keyword) { if (!possiblecomprehension) { throwError({}, Messages.ComprehensionError); } matchKeyword('for'); tmp = parseForStatement({ignoreBody: true}); tmp.of = tmp.type === Syntax.ForOfStatement; tmp.type = Syntax.ComprehensionBlock; if (tmp.left.kind) { // can't be let or const throwError({}, Messages.ComprehensionError); } blocks.push(tmp); } else if (lookahead.value === 'if' && lookahead.type === Token.Keyword) { if (!possiblecomprehension) { throwError({}, Messages.ComprehensionError); } expectKeyword('if'); expect('('); filter = parseExpression(); expect(')'); } else if (lookahead.value === ',' && lookahead.type === Token.Punctuator) { possiblecomprehension = false; // no longer allowed. lex(); elements.push(null); } else { tmp = parseSpreadOrAssignmentExpression(); elements.push(tmp); if (tmp && tmp.type === Syntax.SpreadElement) { if (!match(']')) { throwError({}, Messages.ElementAfterSpreadElement); } } else if (!(match(']') || matchKeyword('for') || matchKeyword('if'))) { expect(','); // this lexes. possiblecomprehension = false; } } } expect(']'); if (filter && !blocks.length) { throwError({}, Messages.ComprehensionRequiresBlock); } if (blocks.length) { if (elements.length !== 1) { throwError({}, Messages.ComprehensionError); } return markerApply(marker, delegate.createComprehensionExpression(filter, blocks, elements[0])); } return markerApply(marker, delegate.createArrayExpression(elements)); } // 11.1.5 Object Initialiser function parsePropertyFunction(options) { var previousStrict, previousYieldAllowed, previousAwaitAllowed, params, defaults, body, marker = markerCreate(); previousStrict = strict; previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = options.generator; previousAwaitAllowed = state.awaitAllowed; state.awaitAllowed = options.async; params = options.params || []; defaults = options.defaults || []; body = parseConciseBody(); if (options.name && strict && isRestrictedWord(params[0].name)) { throwErrorTolerant(options.name, Messages.StrictParamName); } strict = previousStrict; state.yieldAllowed = previousYieldAllowed; state.awaitAllowed = previousAwaitAllowed; return markerApply(marker, delegate.createFunctionExpression( null, params, defaults, body, options.rest || null, options.generator, body.type !== Syntax.BlockStatement, options.async, options.returnType, options.typeParameters )); } function parsePropertyMethodFunction(options) { var previousStrict, tmp, method; previousStrict = strict; strict = true; tmp = parseParams(); if (tmp.stricted) { throwErrorTolerant(tmp.stricted, tmp.message); } method = parsePropertyFunction({ params: tmp.params, defaults: tmp.defaults, rest: tmp.rest, generator: options.generator, async: options.async, returnType: tmp.returnType, typeParameters: options.typeParameters }); strict = previousStrict; return method; } function parseObjectPropertyKey() { var marker = markerCreate(), token = lex(), propertyKey, result; // Note: This function is called only from parseObjectProperty(), where // EOF and Punctuator tokens are already filtered out. if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { if (strict && token.octal) { throwErrorTolerant(token, Messages.StrictOctalLiteral); } return markerApply(marker, delegate.createLiteral(token)); } if (token.type === Token.Punctuator && token.value === '[') { // For computed properties we should skip the [ and ], and // capture in marker only the assignment expression itself. marker = markerCreate(); propertyKey = parseAssignmentExpression(); result = markerApply(marker, propertyKey); expect(']'); return result; } return markerApply(marker, delegate.createIdentifier(token.value)); } function parseObjectProperty() { var token, key, id, value, param, expr, computed, marker = markerCreate(), returnType; token = lookahead; computed = (token.value === '['); if (token.type === Token.Identifier || computed || matchAsync()) { id = parseObjectPropertyKey(); if (match(':')) { lex(); return markerApply( marker, delegate.createProperty( 'init', id, parseAssignmentExpression(), false, false, computed ) ); } if (match('(')) { return markerApply( marker, delegate.createProperty( 'init', id, parsePropertyMethodFunction({ generator: false, async: false }), true, false, computed ) ); } // Property Assignment: Getter and Setter. if (token.value === 'get') { computed = (lookahead.value === '['); key = parseObjectPropertyKey(); expect('('); expect(')'); if (match(':')) { returnType = parseTypeAnnotation(); } return markerApply( marker, delegate.createProperty( 'get', key, parsePropertyFunction({ generator: false, async: false, returnType: returnType }), false, false, computed ) ); } if (token.value === 'set') { computed = (lookahead.value === '['); key = parseObjectPropertyKey(); expect('('); token = lookahead; param = [ parseTypeAnnotatableIdentifier() ]; expect(')'); if (match(':')) { returnType = parseTypeAnnotation(); } return markerApply( marker, delegate.createProperty( 'set', key, parsePropertyFunction({ params: param, generator: false, async: false, name: token, returnType: returnType }), false, false, computed ) ); } if (token.value === 'async') { computed = (lookahead.value === '['); key = parseObjectPropertyKey(); return markerApply( marker, delegate.createProperty( 'init', key, parsePropertyMethodFunction({ generator: false, async: true }), true, false, computed ) ); } if (computed) { // Computed properties can only be used with full notation. throwUnexpected(lookahead); } return markerApply( marker, delegate.createProperty('init', id, id, false, true, false) ); } if (token.type === Token.EOF || token.type === Token.Punctuator) { if (!match('*')) { throwUnexpected(token); } lex(); computed = (lookahead.type === Token.Punctuator && lookahead.value === '['); id = parseObjectPropertyKey(); if (!match('(')) { throwUnexpected(lex()); } return markerApply(marker, delegate.createProperty('init', id, parsePropertyMethodFunction({ generator: true }), true, false, computed)); } key = parseObjectPropertyKey(); if (match(':')) { lex(); return markerApply(marker, delegate.createProperty('init', key, parseAssignmentExpression(), false, false, false)); } if (match('(')) { return markerApply(marker, delegate.createProperty('init', key, parsePropertyMethodFunction({ generator: false }), true, false, false)); } throwUnexpected(lex()); } function parseObjectSpreadProperty() { var marker = markerCreate(); expect('...'); return markerApply(marker, delegate.createSpreadProperty(parseAssignmentExpression())); } function parseObjectInitialiser() { var properties = [], property, name, key, kind, map = {}, toString = String, marker = markerCreate(); expect('{'); while (!match('}')) { if (match('...')) { property = parseObjectSpreadProperty(); } else { property = parseObjectProperty(); if (property.key.type === Syntax.Identifier) { name = property.key.name; } else { name = toString(property.key.value); } kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; key = '$' + name; if (Object.prototype.hasOwnProperty.call(map, key)) { if (map[key] === PropertyKind.Data) { if (strict && kind === PropertyKind.Data) { throwErrorTolerant({}, Messages.StrictDuplicateProperty); } else if (kind !== PropertyKind.Data) { throwErrorTolerant({}, Messages.AccessorDataProperty); } } else { if (kind === PropertyKind.Data) { throwErrorTolerant({}, Messages.AccessorDataProperty); } else if (map[key] & kind) { throwErrorTolerant({}, Messages.AccessorGetSet); } } map[key] |= kind; } else { map[key] = kind; } } properties.push(property); if (!match('}')) { expect(','); } } expect('}'); return markerApply(marker, delegate.createObjectExpression(properties)); } function parseTemplateElement(option) { var marker = markerCreate(), token = scanTemplateElement(option); if (strict && token.octal) { throwError(token, Messages.StrictOctalLiteral); } return markerApply(marker, delegate.createTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail)); } function parseTemplateLiteral() { var quasi, quasis, expressions, marker = markerCreate(); quasi = parseTemplateElement({ head: true }); quasis = [ quasi ]; expressions = []; while (!quasi.tail) { expressions.push(parseExpression()); quasi = parseTemplateElement({ head: false }); quasis.push(quasi); } return markerApply(marker, delegate.createTemplateLiteral(quasis, expressions)); } // 11.1.6 The Grouping Operator function parseGroupExpression() { var expr; expect('('); ++state.parenthesizedCount; expr = parseExpression(); expect(')'); return expr; } function matchAsyncFuncExprOrDecl() { var token; if (matchAsync()) { token = lookahead2(); if (token.type === Token.Keyword && token.value === 'function') { return true; } } return false; } // 11.1 Primary Expressions function parsePrimaryExpression() { var marker, type, token, expr; type = lookahead.type; if (type === Token.Identifier) { marker = markerCreate(); return markerApply(marker, delegate.createIdentifier(lex().value)); } if (type === Token.StringLiteral || type === Token.NumericLiteral) { if (strict && lookahead.octal) { throwErrorTolerant(lookahead, Messages.StrictOctalLiteral); } marker = markerCreate(); return markerApply(marker, delegate.createLiteral(lex())); } if (type === Token.Keyword) { if (matchKeyword('this')) { marker = markerCreate(); lex(); return markerApply(marker, delegate.createThisExpression()); } if (matchKeyword('function')) { return parseFunctionExpression(); } if (matchKeyword('class')) { return parseClassExpression(); } if (matchKeyword('super')) { marker = markerCreate(); lex(); return markerApply(marker, delegate.createIdentifier('super')); } } if (type === Token.BooleanLiteral) { marker = markerCreate(); token = lex(); token.value = (token.value === 'true'); return markerApply(marker, delegate.createLiteral(token)); } if (type === Token.NullLiteral) { marker = markerCreate(); token = lex(); token.value = null; return markerApply(marker, delegate.createLiteral(token)); } if (match('[')) { return parseArrayInitialiser(); } if (match('{')) { return parseObjectInitialiser(); } if (match('(')) { return parseGroupExpression(); } if (match('/') || match('/=')) { marker = markerCreate(); return markerApply(marker, delegate.createLiteral(scanRegExp())); } if (type === Token.Template) { return parseTemplateLiteral(); } if (match('<')) { return parseXJSElement(); } throwUnexpected(lex()); } // 11.2 Left-Hand-Side Expressions function parseArguments() { var args = [], arg; expect('('); if (!match(')')) { while (index < length) { arg = parseSpreadOrAssignmentExpression(); args.push(arg); if (match(')')) { break; } else if (arg.type === Syntax.SpreadElement) { throwError({}, Messages.ElementAfterSpreadElement); } expect(','); } } expect(')'); return args; } function parseSpreadOrAssignmentExpression() { if (match('...')) { var marker = markerCreate(); lex(); return markerApply(marker, delegate.createSpreadElement(parseAssignmentExpression())); } return parseAssignmentExpression(); } function parseNonComputedProperty() { var marker = markerCreate(), token = lex(); if (!isIdentifierName(token)) { throwUnexpected(token); } return markerApply(marker, delegate.createIdentifier(token.value)); } function parseNonComputedMember() { expect('.'); return parseNonComputedProperty(); } function parseComputedMember() { var expr; expect('['); expr = parseExpression(); expect(']'); return expr; } function parseNewExpression() { var callee, args, marker = markerCreate(); expectKeyword('new'); callee = parseLeftHandSideExpression(); args = match('(') ? parseArguments() : []; return markerApply(marker, delegate.createNewExpression(callee, args)); } function parseLeftHandSideExpressionAllowCall() { var expr, args, marker = markerCreate(); expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); while (match('.') || match('[') || match('(') || lookahead.type === Token.Template) { if (match('(')) { args = parseArguments(); expr = markerApply(marker, delegate.createCallExpression(expr, args)); } else if (match('[')) { expr = markerApply(marker, delegate.createMemberExpression('[', expr, parseComputedMember())); } else if (match('.')) { expr = markerApply(marker, delegate.createMemberExpression('.', expr, parseNonComputedMember())); } else { expr = markerApply(marker, delegate.createTaggedTemplateExpression(expr, parseTemplateLiteral())); } } return expr; } function parseLeftHandSideExpression() { var expr, marker = markerCreate(); expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); while (match('.') || match('[') || lookahead.type === Token.Template) { if (match('[')) { expr = markerApply(marker, delegate.createMemberExpression('[', expr, parseComputedMember())); } else if (match('.')) { expr = markerApply(marker, delegate.createMemberExpression('.', expr, parseNonComputedMember())); } else { expr = markerApply(marker, delegate.createTaggedTemplateExpression(expr, parseTemplateLiteral())); } } return expr; } // 11.3 Postfix Expressions function parsePostfixExpression() { var marker = markerCreate(), expr = parseLeftHandSideExpressionAllowCall(), token; if (lookahead.type !== Token.Punctuator) { return expr; } if ((match('++') || match('--')) && !peekLineTerminator()) { // 11.3.1, 11.3.2 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { throwErrorTolerant({}, Messages.StrictLHSPostfix); } if (!isLeftHandSide(expr)) { throwError({}, Messages.InvalidLHSInAssignment); } token = lex(); expr = markerApply(marker, delegate.createPostfixExpression(token.value, expr)); } return expr; } // 11.4 Unary Operators function parseUnaryExpression() { var marker, token, expr; if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { return parsePostfixExpression(); } if (match('++') || match('--')) { marker = markerCreate(); token = lex(); expr = parseUnaryExpression(); // 11.4.4, 11.4.5 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { throwErrorTolerant({}, Messages.StrictLHSPrefix); } if (!isLeftHandSide(expr)) { throwError({}, Messages.InvalidLHSInAssignment); } return markerApply(marker, delegate.createUnaryExpression(token.value, expr)); } if (match('+') || match('-') || match('~') || match('!')) { marker = markerCreate(); token = lex(); expr = parseUnaryExpression(); return markerApply(marker, delegate.createUnaryExpression(token.value, expr)); } if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { marker = markerCreate(); token = lex(); expr = parseUnaryExpression(); expr = markerApply(marker, delegate.createUnaryExpression(token.value, expr)); if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { throwErrorTolerant({}, Messages.StrictDelete); } return expr; } return parsePostfixExpression(); } function binaryPrecedence(token, allowIn) { var prec = 0; if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { return 0; } switch (token.value) { case '||': prec = 1; break; case '&&': prec = 2; break; case '|': prec = 3; break; case '^': prec = 4; break; case '&': prec = 5; break; case '==': case '!=': case '===': case '!==': prec = 6; break; case '<': case '>': case '<=': case '>=': case 'instanceof': prec = 7; break; case 'in': prec = allowIn ? 7 : 0; break; case '<<': case '>>': case '>>>': prec = 8; break; case '+': case '-': prec = 9; break; case '*': case '/': case '%': prec = 11; break; default: break; } return prec; } // 11.5 Multiplicative Operators // 11.6 Additive Operators // 11.7 Bitwise Shift Operators // 11.8 Relational Operators // 11.9 Equality Operators // 11.10 Binary Bitwise Operators // 11.11 Binary Logical Operators function parseBinaryExpression() { var expr, token, prec, previousAllowIn, stack, right, operator, left, i, marker, markers; previousAllowIn = state.allowIn; state.allowIn = true; marker = markerCreate(); left = parseUnaryExpression(); token = lookahead; prec = binaryPrecedence(token, previousAllowIn); if (prec === 0) { return left; } token.prec = prec; lex(); markers = [marker, markerCreate()]; right = parseUnaryExpression(); stack = [left, token, right]; while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) { // Reduce: make a binary expression from the three topmost entries. while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { right = stack.pop(); operator = stack.pop().value; left = stack.pop(); expr = delegate.createBinaryExpression(operator, left, right); markers.pop(); marker = markers.pop(); markerApply(marker, expr); stack.push(expr); markers.push(marker); } // Shift. token = lex(); token.prec = prec; stack.push(token); markers.push(markerCreate()); expr = parseUnaryExpression(); stack.push(expr); } state.allowIn = previousAllowIn; // Final reduce to clean-up the stack. i = stack.length - 1; expr = stack[i]; markers.pop(); while (i > 1) { expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr); i -= 2; marker = markers.pop(); markerApply(marker, expr); } return expr; } // 11.12 Conditional Operator function parseConditionalExpression() { var expr, previousAllowIn, consequent, alternate, marker = markerCreate(); expr = parseBinaryExpression(); if (match('?')) { lex(); previousAllowIn = state.allowIn; state.allowIn = true; consequent = parseAssignmentExpression(); state.allowIn = previousAllowIn; expect(':'); alternate = parseAssignmentExpression(); expr = markerApply(marker, delegate.createConditionalExpression(expr, consequent, alternate)); } return expr; } // 11.13 Assignment Operators function reinterpretAsAssignmentBindingPattern(expr) { var i, len, property, element; if (expr.type === Syntax.ObjectExpression) { expr.type = Syntax.ObjectPattern; for (i = 0, len = expr.properties.length; i < len; i += 1) { property = expr.properties[i]; if (property.type === Syntax.SpreadProperty) { if (i < len - 1) { throwError({}, Messages.PropertyAfterSpreadProperty); } reinterpretAsAssignmentBindingPattern(property.argument); } else { if (property.kind !== 'init') { throwError({}, Messages.InvalidLHSInAssignment); } reinterpretAsAssignmentBindingPattern(property.value); } } } else if (expr.type === Syntax.ArrayExpression) { expr.type = Syntax.ArrayPattern; for (i = 0, len = expr.elements.length; i < len; i += 1) { element = expr.elements[i]; if (element) { reinterpretAsAssignmentBindingPattern(element); } } } else if (expr.type === Syntax.Identifier) { if (isRestrictedWord(expr.name)) { throwError({}, Messages.InvalidLHSInAssignment); } } else if (expr.type === Syntax.SpreadElement) { reinterpretAsAssignmentBindingPattern(expr.argument); if (expr.argument.type === Syntax.ObjectPattern) { throwError({}, Messages.ObjectPatternAsSpread); } } else { if (expr.type !== Syntax.MemberExpression && expr.type !== Syntax.CallExpression && expr.type !== Syntax.NewExpression) { throwError({}, Messages.InvalidLHSInAssignment); } } } function reinterpretAsDestructuredParameter(options, expr) { var i, len, property, element; if (expr.type === Syntax.ObjectExpression) { expr.type = Syntax.ObjectPattern; for (i = 0, len = expr.properties.length; i < len; i += 1) { property = expr.properties[i]; if (property.type === Syntax.SpreadProperty) { if (i < len - 1) { throwError({}, Messages.PropertyAfterSpreadProperty); } reinterpretAsDestructuredParameter(options, property.argument); } else { if (property.kind !== 'init') { throwError({}, Messages.InvalidLHSInFormalsList); } reinterpretAsDestructuredParameter(options, property.value); } } } else if (expr.type === Syntax.ArrayExpression) { expr.type = Syntax.ArrayPattern; for (i = 0, len = expr.elements.length; i < len; i += 1) { element = expr.elements[i]; if (element) { reinterpretAsDestructuredParameter(options, element); } } } else if (expr.type === Syntax.Identifier) { validateParam(options, expr, expr.name); } else { if (expr.type !== Syntax.MemberExpression) { throwError({}, Messages.InvalidLHSInFormalsList); } } } function reinterpretAsCoverFormalsList(expressions) { var i, len, param, params, defaults, defaultCount, options, rest; params = []; defaults = []; defaultCount = 0; rest = null; options = { paramSet: {} }; for (i = 0, len = expressions.length; i < len; i += 1) { param = expressions[i]; if (param.type === Syntax.Identifier) { params.push(param); defaults.push(null); validateParam(options, param, param.name); } else if (param.type === Syntax.ObjectExpression || param.type === Syntax.ArrayExpression) { reinterpretAsDestructuredParameter(options, param); params.push(param); defaults.push(null); } else if (param.type === Syntax.SpreadElement) { assert(i === len - 1, 'It is guaranteed that SpreadElement is last element by parseExpression'); reinterpretAsDestructuredParameter(options, param.argument); rest = param.argument; } else if (param.type === Syntax.AssignmentExpression) { params.push(param.left); defaults.push(param.right); ++defaultCount; validateParam(options, param.left, param.left.name); } else { return null; } } if (options.message === Messages.StrictParamDupe) { throwError( strict ? options.stricted : options.firstRestricted, options.message ); } if (defaultCount === 0) { defaults = []; } return { params: params, defaults: defaults, rest: rest, stricted: options.stricted, firstRestricted: options.firstRestricted, message: options.message }; } function parseArrowFunctionExpression(options, marker) { var previousStrict, previousYieldAllowed, previousAwaitAllowed, body; expect('=>'); previousStrict = strict; previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = false; previousAwaitAllowed = state.awaitAllowed; state.awaitAllowed = !!options.async; body = parseConciseBody(); if (strict && options.firstRestricted) { throwError(options.firstRestricted, options.message); } if (strict && options.stricted) { throwErrorTolerant(options.stricted, options.message); } strict = previousStrict; state.yieldAllowed = previousYieldAllowed; state.awaitAllowed = previousAwaitAllowed; return markerApply(marker, delegate.createArrowFunctionExpression( options.params, options.defaults, body, options.rest, body.type !== Syntax.BlockStatement, !!options.async )); } function parseAssignmentExpression() { var marker, expr, token, params, oldParenthesizedCount, backtrackToken = lookahead, possiblyAsync = false; if (matchYield()) { return parseYieldExpression(); } if (matchAwait()) { return parseAwaitExpression(); } oldParenthesizedCount = state.parenthesizedCount; marker = markerCreate(); if (matchAsyncFuncExprOrDecl()) { return parseFunctionExpression(); } if (matchAsync()) { // We can't be completely sure that this 'async' token is // actually a contextual keyword modifying a function // expression, so we might have to un-lex() it later by // calling rewind(backtrackToken). possiblyAsync = true; lex(); } if (match('(')) { token = lookahead2(); if ((token.type === Token.Punctuator && token.value === ')') || token.value === '...') { params = parseParams(); if (!match('=>')) { throwUnexpected(lex()); } params.async = possiblyAsync; return parseArrowFunctionExpression(params, marker); } } token = lookahead; // If the 'async' keyword is not followed by a '(' character or an // identifier, then it can't be an arrow function modifier, and we // should interpret it as a normal identifer. if (possiblyAsync && !match('(') && token.type !== Token.Identifier) { possiblyAsync = false; rewind(backtrackToken); } expr = parseConditionalExpression(); if (match('=>') && (state.parenthesizedCount === oldParenthesizedCount || state.parenthesizedCount === (oldParenthesizedCount + 1))) { if (expr.type === Syntax.Identifier) { params = reinterpretAsCoverFormalsList([ expr ]); } else if (expr.type === Syntax.SequenceExpression) { params = reinterpretAsCoverFormalsList(expr.expressions); } if (params) { params.async = possiblyAsync; return parseArrowFunctionExpression(params, marker); } } // If we haven't returned by now, then the 'async' keyword was not // a function modifier, and we should rewind and interpret it as a // normal identifier. if (possiblyAsync) { possiblyAsync = false; rewind(backtrackToken); expr = parseConditionalExpression(); } if (matchAssign()) { // 11.13.1 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { throwErrorTolerant(token, Messages.StrictLHSAssignment); } // ES.next draf 11.13 Runtime Semantics step 1 if (match('=') && (expr.type === Syntax.ObjectExpression || expr.type === Syntax.ArrayExpression)) { reinterpretAsAssignmentBindingPattern(expr); } else if (!isLeftHandSide(expr)) { throwError({}, Messages.InvalidLHSInAssignment); } expr = markerApply(marker, delegate.createAssignmentExpression(lex().value, expr, parseAssignmentExpression())); } return expr; } // 11.14 Comma Operator function parseExpression() { var marker, expr, expressions, sequence, coverFormalsList, spreadFound, oldParenthesizedCount; oldParenthesizedCount = state.parenthesizedCount; marker = markerCreate(); expr = parseAssignmentExpression(); expressions = [ expr ]; if (match(',')) { while (index < length) { if (!match(',')) { break; } lex(); expr = parseSpreadOrAssignmentExpression(); expressions.push(expr); if (expr.type === Syntax.SpreadElement) { spreadFound = true; if (!match(')')) { throwError({}, Messages.ElementAfterSpreadElement); } break; } } sequence = markerApply(marker, delegate.createSequenceExpression(expressions)); } if (match('=>')) { // Do not allow nested parentheses on the LHS of the =>. if (state.parenthesizedCount === oldParenthesizedCount || state.parenthesizedCount === (oldParenthesizedCount + 1)) { expr = expr.type === Syntax.SequenceExpression ? expr.expressions : expressions; coverFormalsList = reinterpretAsCoverFormalsList(expr); if (coverFormalsList) { return parseArrowFunctionExpression(coverFormalsList, marker); } } throwUnexpected(lex()); } if (spreadFound && lookahead2().value !== '=>') { throwError({}, Messages.IllegalSpread); } return sequence || expr; } // 12.1 Block function parseStatementList() { var list = [], statement; while (index < length) { if (match('}')) { break; } statement = parseSourceElement(); if (typeof statement === 'undefined') { break; } list.push(statement); } return list; } function parseBlock() { var block, marker = markerCreate(); expect('{'); block = parseStatementList(); expect('}'); return markerApply(marker, delegate.createBlockStatement(block)); } // 12.2 Variable Statement function parseTypeParameterDeclaration() { var marker = markerCreate(), paramTypes = []; expect('<'); while (!match('>')) { paramTypes.push(parseVariableIdentifier()); if (!match('>')) { expect(','); } } expect('>'); return markerApply(marker, delegate.createTypeParameterDeclaration( paramTypes )); } function parseTypeParameterInstantiation() { var marker = markerCreate(), oldInType = state.inType, paramTypes = []; state.inType = true; expect('<'); while (!match('>')) { paramTypes.push(parseType()); if (!match('>')) { expect(','); } } expect('>'); state.inType = oldInType; return markerApply(marker, delegate.createTypeParameterInstantiation( paramTypes )); } function parseObjectTypeIndexer(marker, isStatic) { var id, key, value; expect('['); id = parseObjectPropertyKey(); expect(':'); key = parseType(); expect(']'); expect(':'); value = parseType(); return markerApply(marker, delegate.createObjectTypeIndexer( id, key, value, isStatic )); } function parseObjectTypeMethodish(marker) { var params = [], rest = null, returnType, typeParameters = null; if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } expect('('); while (lookahead.type === Token.Identifier) { params.push(parseFunctionTypeParam()); if (!match(')')) { expect(','); } } if (match('...')) { lex(); rest = parseFunctionTypeParam(); } expect(')'); expect(':'); returnType = parseType(); return markerApply(marker, delegate.createFunctionTypeAnnotation( params, returnType, rest, typeParameters )); } function parseObjectTypeMethod(marker, isStatic, key) { var optional = false, value; value = parseObjectTypeMethodish(marker); return markerApply(marker, delegate.createObjectTypeProperty( key, value, optional, isStatic )); } function parseObjectTypeCallProperty(marker, isStatic) { var valueMarker = markerCreate(); return markerApply(marker, delegate.createObjectTypeCallProperty( parseObjectTypeMethodish(valueMarker), isStatic )); } function parseObjectType(allowStatic) { var callProperties = [], indexers = [], marker, optional = false, properties = [], property, propertyKey, propertyTypeAnnotation, token, isStatic; expect('{'); while (!match('}')) { marker = markerCreate(); if (allowStatic && matchContextualKeyword('static')) { token = lex(); isStatic = true; } if (match('[')) { indexers.push(parseObjectTypeIndexer(marker, isStatic)); } else if (match('(') || match('<')) { callProperties.push(parseObjectTypeCallProperty(marker, allowStatic)); } else { if (isStatic && match(':')) { propertyKey = markerApply(marker, delegate.createIdentifier(token)); throwErrorTolerant(token, Messages.StrictReservedWord); } else { propertyKey = parseObjectPropertyKey(); } if (match('<') || match('(')) { // This is a method property properties.push(parseObjectTypeMethod(marker, isStatic, propertyKey)); } else { if (match('?')) { lex(); optional = true; } expect(':'); propertyTypeAnnotation = parseType(); properties.push(markerApply(marker, delegate.createObjectTypeProperty( propertyKey, propertyTypeAnnotation, optional, isStatic ))); } } if (match(';')) { lex(); } else if (!match('}')) { throwUnexpected(lookahead); } } expect('}'); return delegate.createObjectTypeAnnotation( properties, indexers, callProperties ); } function parseGenericType() { var marker = markerCreate(), returnType = null, typeParameters = null, typeIdentifier, typeIdentifierMarker = markerCreate; typeIdentifier = parseVariableIdentifier(); while (match('.')) { expect('.'); typeIdentifier = markerApply(marker, delegate.createQualifiedTypeIdentifier( typeIdentifier, parseVariableIdentifier() )); } if (match('<')) { typeParameters = parseTypeParameterInstantiation(); } return markerApply(marker, delegate.createGenericTypeAnnotation( typeIdentifier, typeParameters )); } function parseVoidType() { var marker = markerCreate(); expectKeyword('void'); return markerApply(marker, delegate.createVoidTypeAnnotation()); } function parseTypeofType() { var argument, marker = markerCreate(); expectKeyword('typeof'); argument = parsePrimaryType(); return markerApply(marker, delegate.createTypeofTypeAnnotation( argument )); } function parseTupleType() { var marker = markerCreate(), types = []; expect('['); // We allow trailing commas while (index < length && !match(']')) { types.push(parseType()); if (match(']')) { break; } expect(','); } expect(']'); return markerApply(marker, delegate.createTupleTypeAnnotation( types )); } function parseFunctionTypeParam() { var marker = markerCreate(), name, optional = false, typeAnnotation; name = parseVariableIdentifier(); if (match('?')) { lex(); optional = true; } expect(':'); typeAnnotation = parseType(); return markerApply(marker, delegate.createFunctionTypeParam( name, typeAnnotation, optional )); } function parseFunctionTypeParams() { var ret = { params: [], rest: null }; while (lookahead.type === Token.Identifier) { ret.params.push(parseFunctionTypeParam()); if (!match(')')) { expect(','); } } if (match('...')) { lex(); ret.rest = parseFunctionTypeParam(); } return ret; } // The parsing of types roughly parallels the parsing of expressions, and // primary types are kind of like primary expressions...they're the // primitives with which other types are constructed. function parsePrimaryType() { var typeIdentifier = null, params = null, returnType = null, marker = markerCreate(), rest = null, tmp, typeParameters, token, type, isGroupedType = false; switch (lookahead.type) { case Token.Identifier: switch (lookahead.value) { case 'any': lex(); return markerApply(marker, delegate.createAnyTypeAnnotation()); case 'bool': // fallthrough case 'boolean': lex(); return markerApply(marker, delegate.createBooleanTypeAnnotation()); case 'number': lex(); return markerApply(marker, delegate.createNumberTypeAnnotation()); case 'string': lex(); return markerApply(marker, delegate.createStringTypeAnnotation()); } return markerApply(marker, parseGenericType()); case Token.Punctuator: switch (lookahead.value) { case '{': return markerApply(marker, parseObjectType()); case '[': return parseTupleType(); case '<': typeParameters = parseTypeParameterDeclaration(); expect('('); tmp = parseFunctionTypeParams(); params = tmp.params; rest = tmp.rest; expect(')'); expect('=>'); returnType = parseType(); return markerApply(marker, delegate.createFunctionTypeAnnotation( params, returnType, rest, typeParameters )); case '(': lex(); // Check to see if this is actually a grouped type if (!match(')') && !match('...')) { if (lookahead.type === Token.Identifier) { token = lookahead2(); isGroupedType = token.value !== '?' && token.value !== ':'; } else { isGroupedType = true; } } if (isGroupedType) { type = parseType(); expect(')'); // If we see a => next then someone was probably confused about // function types, so we can provide a better error message if (match('=>')) { throwError({}, Messages.ConfusedAboutFunctionType); } return type; } tmp = parseFunctionTypeParams(); params = tmp.params; rest = tmp.rest; expect(')'); expect('=>'); returnType = parseType(); return markerApply(marker, delegate.createFunctionTypeAnnotation( params, returnType, rest, null /* typeParameters */ )); } break; case Token.Keyword: switch (lookahead.value) { case 'void': return markerApply(marker, parseVoidType()); case 'typeof': return markerApply(marker, parseTypeofType()); } break; case Token.StringLiteral: token = lex(); if (token.octal) { throwError(token, Messages.StrictOctalLiteral); } return markerApply(marker, delegate.createStringLiteralTypeAnnotation( token )); } throwUnexpected(lookahead); } function parsePostfixType() { var marker = markerCreate(), t = parsePrimaryType(); if (match('[')) { expect('['); expect(']'); return markerApply(marker, delegate.createArrayTypeAnnotation(t)); } return t; } function parsePrefixType() { var marker = markerCreate(); if (match('?')) { lex(); return markerApply(marker, delegate.createNullableTypeAnnotation( parsePrefixType() )); } return parsePostfixType(); } function parseIntersectionType() { var marker = markerCreate(), type, types; type = parsePrefixType(); types = [type]; while (match('&')) { lex(); types.push(parsePrefixType()); } return types.length === 1 ? type : markerApply(marker, delegate.createIntersectionTypeAnnotation( types )); } function parseUnionType() { var marker = markerCreate(), type, types; type = parseIntersectionType(); types = [type]; while (match('|')) { lex(); types.push(parseIntersectionType()); } return types.length === 1 ? type : markerApply(marker, delegate.createUnionTypeAnnotation( types )); } function parseType() { var oldInType = state.inType, type; state.inType = true; type = parseUnionType(); state.inType = oldInType; return type; } function parseTypeAnnotation() { var marker = markerCreate(), type; expect(':'); type = parseType(); return markerApply(marker, delegate.createTypeAnnotation(type)); } function parseVariableIdentifier() { var marker = markerCreate(), token = lex(); if (token.type !== Token.Identifier) { throwUnexpected(token); } return markerApply(marker, delegate.createIdentifier(token.value)); } function parseTypeAnnotatableIdentifier(requireTypeAnnotation, canBeOptionalParam) { var marker = markerCreate(), ident = parseVariableIdentifier(), isOptionalParam = false; if (canBeOptionalParam && match('?')) { expect('?'); isOptionalParam = true; } if (requireTypeAnnotation || match(':')) { ident.typeAnnotation = parseTypeAnnotation(); ident = markerApply(marker, ident); } if (isOptionalParam) { ident.optional = true; ident = markerApply(marker, ident); } return ident; } function parseVariableDeclaration(kind) { var id, marker = markerCreate(), init = null, typeAnnotationMarker = markerCreate(); if (match('{')) { id = parseObjectInitialiser(); reinterpretAsAssignmentBindingPattern(id); if (match(':')) { id.typeAnnotation = parseTypeAnnotation(); markerApply(typeAnnotationMarker, id); } } else if (match('[')) { id = parseArrayInitialiser(); reinterpretAsAssignmentBindingPattern(id); if (match(':')) { id.typeAnnotation = parseTypeAnnotation(); markerApply(typeAnnotationMarker, id); } } else { id = state.allowKeyword ? parseNonComputedProperty() : parseTypeAnnotatableIdentifier(); // 12.2.1 if (strict && isRestrictedWord(id.name)) { throwErrorTolerant({}, Messages.StrictVarName); } } if (kind === 'const') { if (!match('=')) { throwError({}, Messages.NoUnintializedConst); } expect('='); init = parseAssignmentExpression(); } else if (match('=')) { lex(); init = parseAssignmentExpression(); } return markerApply(marker, delegate.createVariableDeclarator(id, init)); } function parseVariableDeclarationList(kind) { var list = []; do { list.push(parseVariableDeclaration(kind)); if (!match(',')) { break; } lex(); } while (index < length); return list; } function parseVariableStatement() { var declarations, marker = markerCreate(); expectKeyword('var'); declarations = parseVariableDeclarationList(); consumeSemicolon(); return markerApply(marker, delegate.createVariableDeclaration(declarations, 'var')); } // kind may be `const` or `let` // Both are experimental and not in the specification yet. // see http://wiki.ecmascript.org/doku.php?id=harmony:const // and http://wiki.ecmascript.org/doku.php?id=harmony:let function parseConstLetDeclaration(kind) { var declarations, marker = markerCreate(); expectKeyword(kind); declarations = parseVariableDeclarationList(kind); consumeSemicolon(); return markerApply(marker, delegate.createVariableDeclaration(declarations, kind)); } // people.mozilla.org/~jorendorff/es6-draft.html function parseModuleSpecifier() { var marker = markerCreate(), specifier; if (lookahead.type !== Token.StringLiteral) { throwError({}, Messages.InvalidModuleSpecifier); } specifier = delegate.createModuleSpecifier(lookahead); lex(); return markerApply(marker, specifier); } function parseExportBatchSpecifier() { var marker = markerCreate(); expect('*'); return markerApply(marker, delegate.createExportBatchSpecifier()); } function parseExportSpecifier() { var id, name = null, marker = markerCreate(), from; if (matchKeyword('default')) { lex(); id = markerApply(marker, delegate.createIdentifier('default')); // export {default} from "something"; } else { id = parseVariableIdentifier(); } if (matchContextualKeyword('as')) { lex(); name = parseNonComputedProperty(); } return markerApply(marker, delegate.createExportSpecifier(id, name)); } function parseExportDeclaration() { var backtrackToken, id, previousAllowKeyword, declaration = null, isExportFromIdentifier, src = null, specifiers = [], marker = markerCreate(); expectKeyword('export'); if (matchKeyword('default')) { // covers: // export default ... lex(); if (matchKeyword('function') || matchKeyword('class')) { backtrackToken = lookahead; lex(); if (isIdentifierName(lookahead)) { // covers: // export default function foo () {} // export default class foo {} id = parseNonComputedProperty(); rewind(backtrackToken); return markerApply(marker, delegate.createExportDeclaration(true, parseSourceElement(), [id], null)); } // covers: // export default function () {} // export default class {} rewind(backtrackToken); switch (lookahead.value) { case 'class': return markerApply(marker, delegate.createExportDeclaration(true, parseClassExpression(), [], null)); case 'function': return markerApply(marker, delegate.createExportDeclaration(true, parseFunctionExpression(), [], null)); } } if (matchContextualKeyword('from')) { throwError({}, Messages.UnexpectedToken, lookahead.value); } // covers: // export default {}; // export default []; if (match('{')) { declaration = parseObjectInitialiser(); } else if (match('[')) { declaration = parseArrayInitialiser(); } else { declaration = parseAssignmentExpression(); } consumeSemicolon(); return markerApply(marker, delegate.createExportDeclaration(true, declaration, [], null)); } // non-default export if (lookahead.type === Token.Keyword) { // covers: // export var f = 1; switch (lookahead.value) { case 'let': case 'const': case 'var': case 'class': case 'function': return markerApply(marker, delegate.createExportDeclaration(false, parseSourceElement(), specifiers, null)); } } if (match('*')) { // covers: // export * from "foo"; specifiers.push(parseExportBatchSpecifier()); if (!matchContextualKeyword('from')) { throwError({}, lookahead.value ? Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); } lex(); src = parseModuleSpecifier(); consumeSemicolon(); return markerApply(marker, delegate.createExportDeclaration(false, null, specifiers, src)); } expect('{'); do { isExportFromIdentifier = isExportFromIdentifier || matchKeyword('default'); specifiers.push(parseExportSpecifier()); } while (match(',') && lex()); expect('}'); if (matchContextualKeyword('from')) { // covering: // export {default} from "foo"; // export {foo} from "foo"; lex(); src = parseModuleSpecifier(); consumeSemicolon(); } else if (isExportFromIdentifier) { // covering: // export {default}; // missing fromClause throwError({}, lookahead.value ? Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); } else { // cover // export {foo}; consumeSemicolon(); } return markerApply(marker, delegate.createExportDeclaration(false, declaration, specifiers, src)); } function parseImportSpecifier() { // import {<foo as bar>} ...; var id, name = null, marker = markerCreate(); id = parseNonComputedProperty(); if (matchContextualKeyword('as')) { lex(); name = parseVariableIdentifier(); } return markerApply(marker, delegate.createImportSpecifier(id, name)); } function parseNamedImports() { var specifiers = []; // {foo, bar as bas} expect('{'); do { specifiers.push(parseImportSpecifier()); } while (match(',') && lex()); expect('}'); return specifiers; } function parseImportDefaultSpecifier() { // import <foo> ...; var id, marker = markerCreate(); id = parseNonComputedProperty(); return markerApply(marker, delegate.createImportDefaultSpecifier(id)); } function parseImportNamespaceSpecifier() { // import <* as foo> ...; var id, marker = markerCreate(); expect('*'); if (!matchContextualKeyword('as')) { throwError({}, Messages.NoAsAfterImportNamespace); } lex(); id = parseNonComputedProperty(); return markerApply(marker, delegate.createImportNamespaceSpecifier(id)); } function parseImportDeclaration() { var specifiers, src, marker = markerCreate(); expectKeyword('import'); specifiers = []; if (lookahead.type === Token.StringLiteral) { // covers: // import "foo"; src = parseModuleSpecifier(); consumeSemicolon(); return markerApply(marker, delegate.createImportDeclaration(specifiers, src)); } if (!matchKeyword('default') && isIdentifierName(lookahead)) { // covers: // import foo // import foo, ... specifiers.push(parseImportDefaultSpecifier()); if (match(',')) { lex(); } } if (match('*')) { // covers: // import foo, * as foo // import * as foo specifiers.push(parseImportNamespaceSpecifier()); } else if (match('{')) { // covers: // import foo, {bar} // import {bar} specifiers = specifiers.concat(parseNamedImports()); } if (!matchContextualKeyword('from')) { throwError({}, lookahead.value ? Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); } lex(); src = parseModuleSpecifier(); consumeSemicolon(); return markerApply(marker, delegate.createImportDeclaration(specifiers, src)); } // 12.3 Empty Statement function parseEmptyStatement() { var marker = markerCreate(); expect(';'); return markerApply(marker, delegate.createEmptyStatement()); } // 12.4 Expression Statement function parseExpressionStatement() { var marker = markerCreate(), expr = parseExpression(); consumeSemicolon(); return markerApply(marker, delegate.createExpressionStatement(expr)); } // 12.5 If statement function parseIfStatement() { var test, consequent, alternate, marker = markerCreate(); expectKeyword('if'); expect('('); test = parseExpression(); expect(')'); consequent = parseStatement(); if (matchKeyword('else')) { lex(); alternate = parseStatement(); } else { alternate = null; } return markerApply(marker, delegate.createIfStatement(test, consequent, alternate)); } // 12.6 Iteration Statements function parseDoWhileStatement() { var body, test, oldInIteration, marker = markerCreate(); expectKeyword('do'); oldInIteration = state.inIteration; state.inIteration = true; body = parseStatement(); state.inIteration = oldInIteration; expectKeyword('while'); expect('('); test = parseExpression(); expect(')'); if (match(';')) { lex(); } return markerApply(marker, delegate.createDoWhileStatement(body, test)); } function parseWhileStatement() { var test, body, oldInIteration, marker = markerCreate(); expectKeyword('while'); expect('('); test = parseExpression(); expect(')'); oldInIteration = state.inIteration; state.inIteration = true; body = parseStatement(); state.inIteration = oldInIteration; return markerApply(marker, delegate.createWhileStatement(test, body)); } function parseForVariableDeclaration() { var marker = markerCreate(), token = lex(), declarations = parseVariableDeclarationList(); return markerApply(marker, delegate.createVariableDeclaration(declarations, token.value)); } function parseForStatement(opts) { var init, test, update, left, right, body, operator, oldInIteration, marker = markerCreate(); init = test = update = null; expectKeyword('for'); // http://wiki.ecmascript.org/doku.php?id=proposals:iterators_and_generators&s=each if (matchContextualKeyword('each')) { throwError({}, Messages.EachNotAllowed); } expect('('); if (match(';')) { lex(); } else { if (matchKeyword('var') || matchKeyword('let') || matchKeyword('const')) { state.allowIn = false; init = parseForVariableDeclaration(); state.allowIn = true; if (init.declarations.length === 1) { if (matchKeyword('in') || matchContextualKeyword('of')) { operator = lookahead; if (!((operator.value === 'in' || init.kind !== 'var') && init.declarations[0].init)) { lex(); left = init; right = parseExpression(); init = null; } } } } else { state.allowIn = false; init = parseExpression(); state.allowIn = true; if (matchContextualKeyword('of')) { operator = lex(); left = init; right = parseExpression(); init = null; } else if (matchKeyword('in')) { // LeftHandSideExpression if (!isAssignableLeftHandSide(init)) { throwError({}, Messages.InvalidLHSInForIn); } operator = lex(); left = init; right = parseExpression(); init = null; } } if (typeof left === 'undefined') { expect(';'); } } if (typeof left === 'undefined') { if (!match(';')) { test = parseExpression(); } expect(';'); if (!match(')')) { update = parseExpression(); } } expect(')'); oldInIteration = state.inIteration; state.inIteration = true; if (!(opts !== undefined && opts.ignoreBody)) { body = parseStatement(); } state.inIteration = oldInIteration; if (typeof left === 'undefined') { return markerApply(marker, delegate.createForStatement(init, test, update, body)); } if (operator.value === 'in') { return markerApply(marker, delegate.createForInStatement(left, right, body)); } return markerApply(marker, delegate.createForOfStatement(left, right, body)); } // 12.7 The continue statement function parseContinueStatement() { var label = null, key, marker = markerCreate(); expectKeyword('continue'); // Optimize the most common form: 'continue;'. if (source.charCodeAt(index) === 59) { lex(); if (!state.inIteration) { throwError({}, Messages.IllegalContinue); } return markerApply(marker, delegate.createContinueStatement(null)); } if (peekLineTerminator()) { if (!state.inIteration) { throwError({}, Messages.IllegalContinue); } return markerApply(marker, delegate.createContinueStatement(null)); } if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); key = '$' + label.name; if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { throwError({}, Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !state.inIteration) { throwError({}, Messages.IllegalContinue); } return markerApply(marker, delegate.createContinueStatement(label)); } // 12.8 The break statement function parseBreakStatement() { var label = null, key, marker = markerCreate(); expectKeyword('break'); // Catch the very common case first: immediately a semicolon (char #59). if (source.charCodeAt(index) === 59) { lex(); if (!(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return markerApply(marker, delegate.createBreakStatement(null)); } if (peekLineTerminator()) { if (!(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return markerApply(marker, delegate.createBreakStatement(null)); } if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); key = '$' + label.name; if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { throwError({}, Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return markerApply(marker, delegate.createBreakStatement(label)); } // 12.9 The return statement function parseReturnStatement() { var argument = null, marker = markerCreate(); expectKeyword('return'); if (!state.inFunctionBody) { throwErrorTolerant({}, Messages.IllegalReturn); } // 'return' followed by a space and an identifier is very common. if (source.charCodeAt(index) === 32) { if (isIdentifierStart(source.charCodeAt(index + 1))) { argument = parseExpression(); consumeSemicolon(); return markerApply(marker, delegate.createReturnStatement(argument)); } } if (peekLineTerminator()) { return markerApply(marker, delegate.createReturnStatement(null)); } if (!match(';')) { if (!match('}') && lookahead.type !== Token.EOF) { argument = parseExpression(); } } consumeSemicolon(); return markerApply(marker, delegate.createReturnStatement(argument)); } // 12.10 The with statement function parseWithStatement() { var object, body, marker = markerCreate(); if (strict) { throwErrorTolerant({}, Messages.StrictModeWith); } expectKeyword('with'); expect('('); object = parseExpression(); expect(')'); body = parseStatement(); return markerApply(marker, delegate.createWithStatement(object, body)); } // 12.10 The swith statement function parseSwitchCase() { var test, consequent = [], sourceElement, marker = markerCreate(); if (matchKeyword('default')) { lex(); test = null; } else { expectKeyword('case'); test = parseExpression(); } expect(':'); while (index < length) { if (match('}') || matchKeyword('default') || matchKeyword('case')) { break; } sourceElement = parseSourceElement(); if (typeof sourceElement === 'undefined') { break; } consequent.push(sourceElement); } return markerApply(marker, delegate.createSwitchCase(test, consequent)); } function parseSwitchStatement() { var discriminant, cases, clause, oldInSwitch, defaultFound, marker = markerCreate(); expectKeyword('switch'); expect('('); discriminant = parseExpression(); expect(')'); expect('{'); cases = []; if (match('}')) { lex(); return markerApply(marker, delegate.createSwitchStatement(discriminant, cases)); } oldInSwitch = state.inSwitch; state.inSwitch = true; defaultFound = false; while (index < length) { if (match('}')) { break; } clause = parseSwitchCase(); if (clause.test === null) { if (defaultFound) { throwError({}, Messages.MultipleDefaultsInSwitch); } defaultFound = true; } cases.push(clause); } state.inSwitch = oldInSwitch; expect('}'); return markerApply(marker, delegate.createSwitchStatement(discriminant, cases)); } // 12.13 The throw statement function parseThrowStatement() { var argument, marker = markerCreate(); expectKeyword('throw'); if (peekLineTerminator()) { throwError({}, Messages.NewlineAfterThrow); } argument = parseExpression(); consumeSemicolon(); return markerApply(marker, delegate.createThrowStatement(argument)); } // 12.14 The try statement function parseCatchClause() { var param, body, marker = markerCreate(); expectKeyword('catch'); expect('('); if (match(')')) { throwUnexpected(lookahead); } param = parseExpression(); // 12.14.1 if (strict && param.type === Syntax.Identifier && isRestrictedWord(param.name)) { throwErrorTolerant({}, Messages.StrictCatchVariable); } expect(')'); body = parseBlock(); return markerApply(marker, delegate.createCatchClause(param, body)); } function parseTryStatement() { var block, handlers = [], finalizer = null, marker = markerCreate(); expectKeyword('try'); block = parseBlock(); if (matchKeyword('catch')) { handlers.push(parseCatchClause()); } if (matchKeyword('finally')) { lex(); finalizer = parseBlock(); } if (handlers.length === 0 && !finalizer) { throwError({}, Messages.NoCatchOrFinally); } return markerApply(marker, delegate.createTryStatement(block, [], handlers, finalizer)); } // 12.15 The debugger statement function parseDebuggerStatement() { var marker = markerCreate(); expectKeyword('debugger'); consumeSemicolon(); return markerApply(marker, delegate.createDebuggerStatement()); } // 12 Statements function parseStatement() { var type = lookahead.type, marker, expr, labeledBody, key; if (type === Token.EOF) { throwUnexpected(lookahead); } if (type === Token.Punctuator) { switch (lookahead.value) { case ';': return parseEmptyStatement(); case '{': return parseBlock(); case '(': return parseExpressionStatement(); default: break; } } if (type === Token.Keyword) { switch (lookahead.value) { case 'break': return parseBreakStatement(); case 'continue': return parseContinueStatement(); case 'debugger': return parseDebuggerStatement(); case 'do': return parseDoWhileStatement(); case 'for': return parseForStatement(); case 'function': return parseFunctionDeclaration(); case 'class': return parseClassDeclaration(); case 'if': return parseIfStatement(); case 'return': return parseReturnStatement(); case 'switch': return parseSwitchStatement(); case 'throw': return parseThrowStatement(); case 'try': return parseTryStatement(); case 'var': return parseVariableStatement(); case 'while': return parseWhileStatement(); case 'with': return parseWithStatement(); default: break; } } if (matchAsyncFuncExprOrDecl()) { return parseFunctionDeclaration(); } marker = markerCreate(); expr = parseExpression(); // 12.12 Labelled Statements if ((expr.type === Syntax.Identifier) && match(':')) { lex(); key = '$' + expr.name; if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) { throwError({}, Messages.Redeclaration, 'Label', expr.name); } state.labelSet[key] = true; labeledBody = parseStatement(); delete state.labelSet[key]; return markerApply(marker, delegate.createLabeledStatement(expr, labeledBody)); } consumeSemicolon(); return markerApply(marker, delegate.createExpressionStatement(expr)); } // 13 Function Definition function parseConciseBody() { if (match('{')) { return parseFunctionSourceElements(); } return parseAssignmentExpression(); } function parseFunctionSourceElements() { var sourceElement, sourceElements = [], token, directive, firstRestricted, oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesizedCount, marker = markerCreate(); expect('{'); while (index < length) { if (lookahead.type !== Token.StringLiteral) { break; } token = lookahead; sourceElement = parseSourceElement(); sourceElements.push(sourceElement); if (sourceElement.expression.type !== Syntax.Literal) { // this is not directive break; } directive = source.slice(token.range[0] + 1, token.range[1] - 1); if (directive === 'use strict') { strict = true; if (firstRestricted) { throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); } } else { if (!firstRestricted && token.octal) { firstRestricted = token; } } } oldLabelSet = state.labelSet; oldInIteration = state.inIteration; oldInSwitch = state.inSwitch; oldInFunctionBody = state.inFunctionBody; oldParenthesizedCount = state.parenthesizedCount; state.labelSet = {}; state.inIteration = false; state.inSwitch = false; state.inFunctionBody = true; state.parenthesizedCount = 0; while (index < length) { if (match('}')) { break; } sourceElement = parseSourceElement(); if (typeof sourceElement === 'undefined') { break; } sourceElements.push(sourceElement); } expect('}'); state.labelSet = oldLabelSet; state.inIteration = oldInIteration; state.inSwitch = oldInSwitch; state.inFunctionBody = oldInFunctionBody; state.parenthesizedCount = oldParenthesizedCount; return markerApply(marker, delegate.createBlockStatement(sourceElements)); } function validateParam(options, param, name) { var key = '$' + name; if (strict) { if (isRestrictedWord(name)) { options.stricted = param; options.message = Messages.StrictParamName; } if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { options.stricted = param; options.message = Messages.StrictParamDupe; } } else if (!options.firstRestricted) { if (isRestrictedWord(name)) { options.firstRestricted = param; options.message = Messages.StrictParamName; } else if (isStrictModeReservedWord(name)) { options.firstRestricted = param; options.message = Messages.StrictReservedWord; } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { options.firstRestricted = param; options.message = Messages.StrictParamDupe; } } options.paramSet[key] = true; } function parseParam(options) { var marker, token, rest, param, def; token = lookahead; if (token.value === '...') { token = lex(); rest = true; } if (match('[')) { marker = markerCreate(); param = parseArrayInitialiser(); reinterpretAsDestructuredParameter(options, param); if (match(':')) { param.typeAnnotation = parseTypeAnnotation(); markerApply(marker, param); } } else if (match('{')) { marker = markerCreate(); if (rest) { throwError({}, Messages.ObjectPatternAsRestParameter); } param = parseObjectInitialiser(); reinterpretAsDestructuredParameter(options, param); if (match(':')) { param.typeAnnotation = parseTypeAnnotation(); markerApply(marker, param); } } else { param = rest ? parseTypeAnnotatableIdentifier( false, /* requireTypeAnnotation */ false /* canBeOptionalParam */ ) : parseTypeAnnotatableIdentifier( false, /* requireTypeAnnotation */ true /* canBeOptionalParam */ ); validateParam(options, token, token.value); } if (match('=')) { if (rest) { throwErrorTolerant(lookahead, Messages.DefaultRestParameter); } lex(); def = parseAssignmentExpression(); ++options.defaultCount; } if (rest) { if (!match(')')) { throwError({}, Messages.ParameterAfterRestParameter); } options.rest = param; return false; } options.params.push(param); options.defaults.push(def); return !match(')'); } function parseParams(firstRestricted) { var options, marker = markerCreate(); options = { params: [], defaultCount: 0, defaults: [], rest: null, firstRestricted: firstRestricted }; expect('('); if (!match(')')) { options.paramSet = {}; while (index < length) { if (!parseParam(options)) { break; } expect(','); } } expect(')'); if (options.defaultCount === 0) { options.defaults = []; } if (match(':')) { options.returnType = parseTypeAnnotation(); } return markerApply(marker, options); } function parseFunctionDeclaration() { var id, body, token, tmp, firstRestricted, message, generator, isAsync, previousStrict, previousYieldAllowed, previousAwaitAllowed, marker = markerCreate(), typeParameters; isAsync = false; if (matchAsync()) { lex(); isAsync = true; } expectKeyword('function'); generator = false; if (match('*')) { lex(); generator = true; } token = lookahead; id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } if (strict) { if (isRestrictedWord(token.value)) { throwErrorTolerant(token, Messages.StrictFunctionName); } } else { if (isRestrictedWord(token.value)) { firstRestricted = token; message = Messages.StrictFunctionName; } else if (isStrictModeReservedWord(token.value)) { firstRestricted = token; message = Messages.StrictReservedWord; } } tmp = parseParams(firstRestricted); firstRestricted = tmp.firstRestricted; if (tmp.message) { message = tmp.message; } previousStrict = strict; previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = generator; previousAwaitAllowed = state.awaitAllowed; state.awaitAllowed = isAsync; body = parseFunctionSourceElements(); if (strict && firstRestricted) { throwError(firstRestricted, message); } if (strict && tmp.stricted) { throwErrorTolerant(tmp.stricted, message); } strict = previousStrict; state.yieldAllowed = previousYieldAllowed; state.awaitAllowed = previousAwaitAllowed; return markerApply( marker, delegate.createFunctionDeclaration( id, tmp.params, tmp.defaults, body, tmp.rest, generator, false, isAsync, tmp.returnType, typeParameters ) ); } function parseFunctionExpression() { var token, id = null, firstRestricted, message, tmp, body, generator, isAsync, previousStrict, previousYieldAllowed, previousAwaitAllowed, marker = markerCreate(), typeParameters; isAsync = false; if (matchAsync()) { lex(); isAsync = true; } expectKeyword('function'); generator = false; if (match('*')) { lex(); generator = true; } if (!match('(')) { if (!match('<')) { token = lookahead; id = parseVariableIdentifier(); if (strict) { if (isRestrictedWord(token.value)) { throwErrorTolerant(token, Messages.StrictFunctionName); } } else { if (isRestrictedWord(token.value)) { firstRestricted = token; message = Messages.StrictFunctionName; } else if (isStrictModeReservedWord(token.value)) { firstRestricted = token; message = Messages.StrictReservedWord; } } } if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } } tmp = parseParams(firstRestricted); firstRestricted = tmp.firstRestricted; if (tmp.message) { message = tmp.message; } previousStrict = strict; previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = generator; previousAwaitAllowed = state.awaitAllowed; state.awaitAllowed = isAsync; body = parseFunctionSourceElements(); if (strict && firstRestricted) { throwError(firstRestricted, message); } if (strict && tmp.stricted) { throwErrorTolerant(tmp.stricted, message); } strict = previousStrict; state.yieldAllowed = previousYieldAllowed; state.awaitAllowed = previousAwaitAllowed; return markerApply( marker, delegate.createFunctionExpression( id, tmp.params, tmp.defaults, body, tmp.rest, generator, false, isAsync, tmp.returnType, typeParameters ) ); } function parseYieldExpression() { var delegateFlag, expr, marker = markerCreate(); expectKeyword('yield', !strict); delegateFlag = false; if (match('*')) { lex(); delegateFlag = true; } expr = parseAssignmentExpression(); return markerApply(marker, delegate.createYieldExpression(expr, delegateFlag)); } function parseAwaitExpression() { var expr, marker = markerCreate(); expectContextualKeyword('await'); expr = parseAssignmentExpression(); return markerApply(marker, delegate.createAwaitExpression(expr)); } // 14 Classes function parseMethodDefinition(existingPropNames, key, isStatic, generator, computed) { var token, param, propType, isValidDuplicateProp = false, isAsync, typeParameters, tokenValue, returnType, annotationMarker; propType = isStatic ? ClassPropertyType["static"] : ClassPropertyType.prototype; if (generator) { return delegate.createMethodDefinition( propType, '', key, parsePropertyMethodFunction({ generator: true }) ); } tokenValue = key.type === 'Identifier' && key.name; if (tokenValue === 'get' && !match('(')) { key = parseObjectPropertyKey(); // It is a syntax error if any other properties have a name // duplicating this one unless they are a setter if (existingPropNames[propType].hasOwnProperty(key.name)) { isValidDuplicateProp = // There isn't already a getter for this prop existingPropNames[propType][key.name].get === undefined // There isn't already a data prop by this name && existingPropNames[propType][key.name].data === undefined // The only existing prop by this name is a setter && existingPropNames[propType][key.name].set !== undefined; if (!isValidDuplicateProp) { throwError(key, Messages.IllegalDuplicateClassProperty); } } else { existingPropNames[propType][key.name] = {}; } existingPropNames[propType][key.name].get = true; expect('('); expect(')'); if (match(':')) { returnType = parseTypeAnnotation(); } return delegate.createMethodDefinition( propType, 'get', key, parsePropertyFunction({ generator: false, returnType: returnType }) ); } if (tokenValue === 'set' && !match('(')) { key = parseObjectPropertyKey(); // It is a syntax error if any other properties have a name // duplicating this one unless they are a getter if (existingPropNames[propType].hasOwnProperty(key.name)) { isValidDuplicateProp = // There isn't already a setter for this prop existingPropNames[propType][key.name].set === undefined // There isn't already a data prop by this name && existingPropNames[propType][key.name].data === undefined // The only existing prop by this name is a getter && existingPropNames[propType][key.name].get !== undefined; if (!isValidDuplicateProp) { throwError(key, Messages.IllegalDuplicateClassProperty); } } else { existingPropNames[propType][key.name] = {}; } existingPropNames[propType][key.name].set = true; expect('('); token = lookahead; param = [ parseTypeAnnotatableIdentifier() ]; expect(')'); if (match(':')) { returnType = parseTypeAnnotation(); } return delegate.createMethodDefinition( propType, 'set', key, parsePropertyFunction({ params: param, generator: false, name: token, returnType: returnType }) ); } if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } isAsync = tokenValue === 'async' && !match('('); if (isAsync) { key = parseObjectPropertyKey(); } // It is a syntax error if any other properties have the same name as a // non-getter, non-setter method if (existingPropNames[propType].hasOwnProperty(key.name)) { throwError(key, Messages.IllegalDuplicateClassProperty); } else { existingPropNames[propType][key.name] = {}; } existingPropNames[propType][key.name].data = true; return delegate.createMethodDefinition( propType, '', key, parsePropertyMethodFunction({ generator: false, async: isAsync, typeParameters: typeParameters }) ); } function parseClassProperty(existingPropNames, key, computed, isStatic) { var typeAnnotation; typeAnnotation = parseTypeAnnotation(); expect(';'); return delegate.createClassProperty( key, typeAnnotation, computed, isStatic ); } function parseClassElement(existingProps) { var computed, generator = false, key, marker = markerCreate(), isStatic = false; if (match(';')) { lex(); return; } if (lookahead.value === 'static') { lex(); isStatic = true; } if (match('*')) { lex(); generator = true; } computed = (lookahead.value === '['); key = parseObjectPropertyKey(); if (!generator && lookahead.value === ':') { return markerApply(marker, parseClassProperty(existingProps, key, computed, isStatic)); } return markerApply(marker, parseMethodDefinition( existingProps, key, isStatic, generator, computed )); } function parseClassBody() { var classElement, classElements = [], existingProps = {}, marker = markerCreate(); existingProps[ClassPropertyType["static"]] = {}; existingProps[ClassPropertyType.prototype] = {}; expect('{'); while (index < length) { if (match('}')) { break; } classElement = parseClassElement(existingProps); if (typeof classElement !== 'undefined') { classElements.push(classElement); } } expect('}'); return markerApply(marker, delegate.createClassBody(classElements)); } function parseClassImplements() { var id, implemented = [], marker, typeParameters; expectContextualKeyword('implements'); while (index < length) { marker = markerCreate(); id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterInstantiation(); } else { typeParameters = null; } implemented.push(markerApply(marker, delegate.createClassImplements( id, typeParameters ))); if (!match(',')) { break; } expect(','); } return implemented; } function parseClassExpression() { var id, implemented, previousYieldAllowed, superClass = null, superTypeParameters, marker = markerCreate(), typeParameters; expectKeyword('class'); if (!matchKeyword('extends') && !matchContextualKeyword('implements') && !match('{')) { id = parseVariableIdentifier(); } if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } if (matchKeyword('extends')) { expectKeyword('extends'); previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = false; superClass = parseLeftHandSideExpressionAllowCall(); if (match('<')) { superTypeParameters = parseTypeParameterInstantiation(); } state.yieldAllowed = previousYieldAllowed; } if (matchContextualKeyword('implements')) { implemented = parseClassImplements(); } return markerApply(marker, delegate.createClassExpression( id, superClass, parseClassBody(), typeParameters, superTypeParameters, implemented )); } function parseClassDeclaration() { var id, implemented, previousYieldAllowed, superClass = null, superTypeParameters, marker = markerCreate(), typeParameters; expectKeyword('class'); id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } if (matchKeyword('extends')) { expectKeyword('extends'); previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = false; superClass = parseLeftHandSideExpressionAllowCall(); if (match('<')) { superTypeParameters = parseTypeParameterInstantiation(); } state.yieldAllowed = previousYieldAllowed; } if (matchContextualKeyword('implements')) { implemented = parseClassImplements(); } return markerApply(marker, delegate.createClassDeclaration( id, superClass, parseClassBody(), typeParameters, superTypeParameters, implemented )); } // 15 Program function parseSourceElement() { var token; if (lookahead.type === Token.Keyword) { switch (lookahead.value) { case 'const': case 'let': return parseConstLetDeclaration(lookahead.value); case 'function': return parseFunctionDeclaration(); default: return parseStatement(); } } if (matchContextualKeyword('type') && lookahead2().type === Token.Identifier) { return parseTypeAlias(); } if (matchContextualKeyword('interface') && lookahead2().type === Token.Identifier) { return parseInterface(); } if (matchContextualKeyword('declare')) { token = lookahead2(); if (token.type === Token.Keyword) { switch (token.value) { case 'class': return parseDeclareClass(); case 'function': return parseDeclareFunction(); case 'var': return parseDeclareVariable(); } } else if (token.type === Token.Identifier && token.value === 'module') { return parseDeclareModule(); } } if (lookahead.type !== Token.EOF) { return parseStatement(); } } function parseProgramElement() { if (lookahead.type === Token.Keyword) { switch (lookahead.value) { case 'export': return parseExportDeclaration(); case 'import': return parseImportDeclaration(); } } return parseSourceElement(); } function parseProgramElements() { var sourceElement, sourceElements = [], token, directive, firstRestricted; while (index < length) { token = lookahead; if (token.type !== Token.StringLiteral) { break; } sourceElement = parseProgramElement(); sourceElements.push(sourceElement); if (sourceElement.expression.type !== Syntax.Literal) { // this is not directive break; } directive = source.slice(token.range[0] + 1, token.range[1] - 1); if (directive === 'use strict') { strict = true; if (firstRestricted) { throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); } } else { if (!firstRestricted && token.octal) { firstRestricted = token; } } } while (index < length) { sourceElement = parseProgramElement(); if (typeof sourceElement === 'undefined') { break; } sourceElements.push(sourceElement); } return sourceElements; } function parseProgram() { var body, marker = markerCreate(); strict = false; peek(); body = parseProgramElements(); return markerApply(marker, delegate.createProgram(body)); } // The following functions are needed only when the option to preserve // the comments is active. function addComment(type, value, start, end, loc) { var comment; assert(typeof start === 'number', 'Comment must have valid position'); // Because the way the actual token is scanned, often the comments // (if any) are skipped twice during the lexical analysis. // Thus, we need to skip adding a comment if the comment array already // handled it. if (state.lastCommentStart >= start) { return; } state.lastCommentStart = start; comment = { type: type, value: value }; if (extra.range) { comment.range = [start, end]; } if (extra.loc) { comment.loc = loc; } extra.comments.push(comment); if (extra.attachComment) { extra.leadingComments.push(comment); extra.trailingComments.push(comment); } } function scanComment() { var comment, ch, loc, start, blockComment, lineComment; comment = ''; blockComment = false; lineComment = false; while (index < length) { ch = source[index]; if (lineComment) { ch = source[index++]; if (isLineTerminator(ch.charCodeAt(0))) { loc.end = { line: lineNumber, column: index - lineStart - 1 }; lineComment = false; addComment('Line', comment, start, index - 1, loc); if (ch === '\r' && source[index] === '\n') { ++index; } ++lineNumber; lineStart = index; comment = ''; } else if (index >= length) { lineComment = false; comment += ch; loc.end = { line: lineNumber, column: length - lineStart }; addComment('Line', comment, start, length, loc); } else { comment += ch; } } else if (blockComment) { if (isLineTerminator(ch.charCodeAt(0))) { if (ch === '\r') { ++index; comment += '\r'; } if (ch !== '\r' || source[index] === '\n') { comment += source[index]; ++lineNumber; ++index; lineStart = index; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } } else { ch = source[index++]; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } comment += ch; if (ch === '*') { ch = source[index]; if (ch === '/') { comment = comment.substr(0, comment.length - 1); blockComment = false; ++index; loc.end = { line: lineNumber, column: index - lineStart }; addComment('Block', comment, start, index, loc); comment = ''; } } } } else if (ch === '/') { ch = source[index + 1]; if (ch === '/') { loc = { start: { line: lineNumber, column: index - lineStart } }; start = index; index += 2; lineComment = true; if (index >= length) { loc.end = { line: lineNumber, column: index - lineStart }; lineComment = false; addComment('Line', comment, start, index, loc); } } else if (ch === '*') { start = index; index += 2; blockComment = true; loc = { start: { line: lineNumber, column: index - lineStart - 2 } }; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } else { break; } } else if (isWhiteSpace(ch.charCodeAt(0))) { ++index; } else if (isLineTerminator(ch.charCodeAt(0))) { ++index; if (ch === '\r' && source[index] === '\n') { ++index; } ++lineNumber; lineStart = index; } else { break; } } } // 16 XJS XHTMLEntities = { quot: '\u0022', amp: '&', apos: '\u0027', lt: '<', gt: '>', nbsp: '\u00A0', iexcl: '\u00A1', cent: '\u00A2', pound: '\u00A3', curren: '\u00A4', yen: '\u00A5', brvbar: '\u00A6', sect: '\u00A7', uml: '\u00A8', copy: '\u00A9', ordf: '\u00AA', laquo: '\u00AB', not: '\u00AC', shy: '\u00AD', reg: '\u00AE', macr: '\u00AF', deg: '\u00B0', plusmn: '\u00B1', sup2: '\u00B2', sup3: '\u00B3', acute: '\u00B4', micro: '\u00B5', para: '\u00B6', middot: '\u00B7', cedil: '\u00B8', sup1: '\u00B9', ordm: '\u00BA', raquo: '\u00BB', frac14: '\u00BC', frac12: '\u00BD', frac34: '\u00BE', iquest: '\u00BF', Agrave: '\u00C0', Aacute: '\u00C1', Acirc: '\u00C2', Atilde: '\u00C3', Auml: '\u00C4', Aring: '\u00C5', AElig: '\u00C6', Ccedil: '\u00C7', Egrave: '\u00C8', Eacute: '\u00C9', Ecirc: '\u00CA', Euml: '\u00CB', Igrave: '\u00CC', Iacute: '\u00CD', Icirc: '\u00CE', Iuml: '\u00CF', ETH: '\u00D0', Ntilde: '\u00D1', Ograve: '\u00D2', Oacute: '\u00D3', Ocirc: '\u00D4', Otilde: '\u00D5', Ouml: '\u00D6', times: '\u00D7', Oslash: '\u00D8', Ugrave: '\u00D9', Uacute: '\u00DA', Ucirc: '\u00DB', Uuml: '\u00DC', Yacute: '\u00DD', THORN: '\u00DE', szlig: '\u00DF', agrave: '\u00E0', aacute: '\u00E1', acirc: '\u00E2', atilde: '\u00E3', auml: '\u00E4', aring: '\u00E5', aelig: '\u00E6', ccedil: '\u00E7', egrave: '\u00E8', eacute: '\u00E9', ecirc: '\u00EA', euml: '\u00EB', igrave: '\u00EC', iacute: '\u00ED', icirc: '\u00EE', iuml: '\u00EF', eth: '\u00F0', ntilde: '\u00F1', ograve: '\u00F2', oacute: '\u00F3', ocirc: '\u00F4', otilde: '\u00F5', ouml: '\u00F6', divide: '\u00F7', oslash: '\u00F8', ugrave: '\u00F9', uacute: '\u00FA', ucirc: '\u00FB', uuml: '\u00FC', yacute: '\u00FD', thorn: '\u00FE', yuml: '\u00FF', OElig: '\u0152', oelig: '\u0153', Scaron: '\u0160', scaron: '\u0161', Yuml: '\u0178', fnof: '\u0192', circ: '\u02C6', tilde: '\u02DC', Alpha: '\u0391', Beta: '\u0392', Gamma: '\u0393', Delta: '\u0394', Epsilon: '\u0395', Zeta: '\u0396', Eta: '\u0397', Theta: '\u0398', Iota: '\u0399', Kappa: '\u039A', Lambda: '\u039B', Mu: '\u039C', Nu: '\u039D', Xi: '\u039E', Omicron: '\u039F', Pi: '\u03A0', Rho: '\u03A1', Sigma: '\u03A3', Tau: '\u03A4', Upsilon: '\u03A5', Phi: '\u03A6', Chi: '\u03A7', Psi: '\u03A8', Omega: '\u03A9', alpha: '\u03B1', beta: '\u03B2', gamma: '\u03B3', delta: '\u03B4', epsilon: '\u03B5', zeta: '\u03B6', eta: '\u03B7', theta: '\u03B8', iota: '\u03B9', kappa: '\u03BA', lambda: '\u03BB', mu: '\u03BC', nu: '\u03BD', xi: '\u03BE', omicron: '\u03BF', pi: '\u03C0', rho: '\u03C1', sigmaf: '\u03C2', sigma: '\u03C3', tau: '\u03C4', upsilon: '\u03C5', phi: '\u03C6', chi: '\u03C7', psi: '\u03C8', omega: '\u03C9', thetasym: '\u03D1', upsih: '\u03D2', piv: '\u03D6', ensp: '\u2002', emsp: '\u2003', thinsp: '\u2009', zwnj: '\u200C', zwj: '\u200D', lrm: '\u200E', rlm: '\u200F', ndash: '\u2013', mdash: '\u2014', lsquo: '\u2018', rsquo: '\u2019', sbquo: '\u201A', ldquo: '\u201C', rdquo: '\u201D', bdquo: '\u201E', dagger: '\u2020', Dagger: '\u2021', bull: '\u2022', hellip: '\u2026', permil: '\u2030', prime: '\u2032', Prime: '\u2033', lsaquo: '\u2039', rsaquo: '\u203A', oline: '\u203E', frasl: '\u2044', euro: '\u20AC', image: '\u2111', weierp: '\u2118', real: '\u211C', trade: '\u2122', alefsym: '\u2135', larr: '\u2190', uarr: '\u2191', rarr: '\u2192', darr: '\u2193', harr: '\u2194', crarr: '\u21B5', lArr: '\u21D0', uArr: '\u21D1', rArr: '\u21D2', dArr: '\u21D3', hArr: '\u21D4', forall: '\u2200', part: '\u2202', exist: '\u2203', empty: '\u2205', nabla: '\u2207', isin: '\u2208', notin: '\u2209', ni: '\u220B', prod: '\u220F', sum: '\u2211', minus: '\u2212', lowast: '\u2217', radic: '\u221A', prop: '\u221D', infin: '\u221E', ang: '\u2220', and: '\u2227', or: '\u2228', cap: '\u2229', cup: '\u222A', 'int': '\u222B', there4: '\u2234', sim: '\u223C', cong: '\u2245', asymp: '\u2248', ne: '\u2260', equiv: '\u2261', le: '\u2264', ge: '\u2265', sub: '\u2282', sup: '\u2283', nsub: '\u2284', sube: '\u2286', supe: '\u2287', oplus: '\u2295', otimes: '\u2297', perp: '\u22A5', sdot: '\u22C5', lceil: '\u2308', rceil: '\u2309', lfloor: '\u230A', rfloor: '\u230B', lang: '\u2329', rang: '\u232A', loz: '\u25CA', spades: '\u2660', clubs: '\u2663', hearts: '\u2665', diams: '\u2666' }; function getQualifiedXJSName(object) { if (object.type === Syntax.XJSIdentifier) { return object.name; } if (object.type === Syntax.XJSNamespacedName) { return object.namespace.name + ':' + object.name.name; } if (object.type === Syntax.XJSMemberExpression) { return ( getQualifiedXJSName(object.object) + '.' + getQualifiedXJSName(object.property) ); } } function isXJSIdentifierStart(ch) { // exclude backslash (\) return (ch !== 92) && isIdentifierStart(ch); } function isXJSIdentifierPart(ch) { // exclude backslash (\) and add hyphen (-) return (ch !== 92) && (ch === 45 || isIdentifierPart(ch)); } function scanXJSIdentifier() { var ch, start, value = ''; start = index; while (index < length) { ch = source.charCodeAt(index); if (!isXJSIdentifierPart(ch)) { break; } value += source[index++]; } return { type: Token.XJSIdentifier, value: value, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanXJSEntity() { var ch, str = '', start = index, count = 0, code; ch = source[index]; assert(ch === '&', 'Entity must start with an ampersand'); index++; while (index < length && count++ < 10) { ch = source[index++]; if (ch === ';') { break; } str += ch; } // Well-formed entity (ending was found). if (ch === ';') { // Numeric entity. if (str[0] === '#') { if (str[1] === 'x') { code = +('0' + str.substr(1)); } else { // Removing leading zeros in order to avoid treating as octal in old browsers. code = +str.substr(1).replace(Regex.LeadingZeros, ''); } if (!isNaN(code)) { return String.fromCharCode(code); } } else if (XHTMLEntities[str]) { return XHTMLEntities[str]; } } // Treat non-entity sequences as regular text. index = start + 1; return '&'; } function scanXJSText(stopChars) { var ch, str = '', start; start = index; while (index < length) { ch = source[index]; if (stopChars.indexOf(ch) !== -1) { break; } if (ch === '&') { str += scanXJSEntity(); } else { index++; if (ch === '\r' && source[index] === '\n') { str += ch; ch = source[index]; index++; } if (isLineTerminator(ch.charCodeAt(0))) { ++lineNumber; lineStart = index; } str += ch; } } return { type: Token.XJSText, value: str, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanXJSStringLiteral() { var innerToken, quote, start; quote = source[index]; assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote'); start = index; ++index; innerToken = scanXJSText([quote]); if (quote !== source[index]) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } ++index; innerToken.range = [start, index]; return innerToken; } /** * Between XJS opening and closing tags (e.g. <foo>HERE</foo>), anything that * is not another XJS tag and is not an expression wrapped by {} is text. */ function advanceXJSChild() { var ch = source.charCodeAt(index); // { (123) and < (60) if (ch !== 123 && ch !== 60) { return scanXJSText(['<', '{']); } return scanPunctuator(); } function parseXJSIdentifier() { var token, marker = markerCreate(); if (lookahead.type !== Token.XJSIdentifier) { throwUnexpected(lookahead); } token = lex(); return markerApply(marker, delegate.createXJSIdentifier(token.value)); } function parseXJSNamespacedName() { var namespace, name, marker = markerCreate(); namespace = parseXJSIdentifier(); expect(':'); name = parseXJSIdentifier(); return markerApply(marker, delegate.createXJSNamespacedName(namespace, name)); } function parseXJSMemberExpression() { var marker = markerCreate(), expr = parseXJSIdentifier(); while (match('.')) { lex(); expr = markerApply(marker, delegate.createXJSMemberExpression(expr, parseXJSIdentifier())); } return expr; } function parseXJSElementName() { if (lookahead2().value === ':') { return parseXJSNamespacedName(); } if (lookahead2().value === '.') { return parseXJSMemberExpression(); } return parseXJSIdentifier(); } function parseXJSAttributeName() { if (lookahead2().value === ':') { return parseXJSNamespacedName(); } return parseXJSIdentifier(); } function parseXJSAttributeValue() { var value, marker; if (match('{')) { value = parseXJSExpressionContainer(); if (value.expression.type === Syntax.XJSEmptyExpression) { throwError( value, 'XJS attributes must only be assigned a non-empty ' + 'expression' ); } } else if (match('<')) { value = parseXJSElement(); } else if (lookahead.type === Token.XJSText) { marker = markerCreate(); value = markerApply(marker, delegate.createLiteral(lex())); } else { throwError({}, Messages.InvalidXJSAttributeValue); } return value; } function parseXJSEmptyExpression() { var marker = markerCreatePreserveWhitespace(); while (source.charAt(index) !== '}') { index++; } return markerApply(marker, delegate.createXJSEmptyExpression()); } function parseXJSExpressionContainer() { var expression, origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; state.inXJSChild = false; state.inXJSTag = false; expect('{'); if (match('}')) { expression = parseXJSEmptyExpression(); } else { expression = parseExpression(); } state.inXJSChild = origInXJSChild; state.inXJSTag = origInXJSTag; expect('}'); return markerApply(marker, delegate.createXJSExpressionContainer(expression)); } function parseXJSSpreadAttribute() { var expression, origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; state.inXJSChild = false; state.inXJSTag = false; expect('{'); expect('...'); expression = parseAssignmentExpression(); state.inXJSChild = origInXJSChild; state.inXJSTag = origInXJSTag; expect('}'); return markerApply(marker, delegate.createXJSSpreadAttribute(expression)); } function parseXJSAttribute() { var name, marker; if (match('{')) { return parseXJSSpreadAttribute(); } marker = markerCreate(); name = parseXJSAttributeName(); // HTML empty attribute if (match('=')) { lex(); return markerApply(marker, delegate.createXJSAttribute(name, parseXJSAttributeValue())); } return markerApply(marker, delegate.createXJSAttribute(name)); } function parseXJSChild() { var token, marker; if (match('{')) { token = parseXJSExpressionContainer(); } else if (lookahead.type === Token.XJSText) { marker = markerCreatePreserveWhitespace(); token = markerApply(marker, delegate.createLiteral(lex())); } else { token = parseXJSElement(); } return token; } function parseXJSClosingElement() { var name, origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; state.inXJSChild = false; state.inXJSTag = true; expect('<'); expect('/'); name = parseXJSElementName(); // Because advance() (called by lex() called by expect()) expects there // to be a valid token after >, it needs to know whether to look for a // standard JS token or an XJS text node state.inXJSChild = origInXJSChild; state.inXJSTag = origInXJSTag; expect('>'); return markerApply(marker, delegate.createXJSClosingElement(name)); } function parseXJSOpeningElement() { var name, attribute, attributes = [], selfClosing = false, origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; state.inXJSChild = false; state.inXJSTag = true; expect('<'); name = parseXJSElementName(); while (index < length && lookahead.value !== '/' && lookahead.value !== '>') { attributes.push(parseXJSAttribute()); } state.inXJSTag = origInXJSTag; if (lookahead.value === '/') { expect('/'); // Because advance() (called by lex() called by expect()) expects // there to be a valid token after >, it needs to know whether to // look for a standard JS token or an XJS text node state.inXJSChild = origInXJSChild; expect('>'); selfClosing = true; } else { state.inXJSChild = true; expect('>'); } return markerApply(marker, delegate.createXJSOpeningElement(name, attributes, selfClosing)); } function parseXJSElement() { var openingElement, closingElement = null, children = [], origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; openingElement = parseXJSOpeningElement(); if (!openingElement.selfClosing) { while (index < length) { state.inXJSChild = false; // Call lookahead2() with inXJSChild = false because </ should not be considered in the child if (lookahead.value === '<' && lookahead2().value === '/') { break; } state.inXJSChild = true; children.push(parseXJSChild()); } state.inXJSChild = origInXJSChild; state.inXJSTag = origInXJSTag; closingElement = parseXJSClosingElement(); if (getQualifiedXJSName(closingElement.name) !== getQualifiedXJSName(openingElement.name)) { throwError({}, Messages.ExpectedXJSClosingTag, getQualifiedXJSName(openingElement.name)); } } // When (erroneously) writing two adjacent tags like // // var x = <div>one</div><div>two</div>; // // the default error message is a bit incomprehensible. Since it's // rarely (never?) useful to write a less-than sign after an XJS // element, we disallow it here in the parser in order to provide a // better error message. (In the rare case that the less-than operator // was intended, the left tag can be wrapped in parentheses.) if (!origInXJSChild && match('<')) { throwError(lookahead, Messages.AdjacentXJSElements); } return markerApply(marker, delegate.createXJSElement(openingElement, closingElement, children)); } function parseTypeAlias() { var id, marker = markerCreate(), typeParameters = null, right; expectContextualKeyword('type'); id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } expect('='); right = parseType(); consumeSemicolon(); return markerApply(marker, delegate.createTypeAlias(id, typeParameters, right)); } function parseInterfaceExtends() { var marker = markerCreate(), id, typeParameters = null; id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterInstantiation(); } return markerApply(marker, delegate.createInterfaceExtends( id, typeParameters )); } function parseInterfaceish(marker, allowStatic) { var body, bodyMarker, extended = [], id, typeParameters = null; id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } if (matchKeyword('extends')) { expectKeyword('extends'); while (index < length) { extended.push(parseInterfaceExtends()); if (!match(',')) { break; } expect(','); } } bodyMarker = markerCreate(); body = markerApply(bodyMarker, parseObjectType(allowStatic)); return markerApply(marker, delegate.createInterface( id, typeParameters, body, extended )); } function parseInterface() { var body, bodyMarker, extended = [], id, marker = markerCreate(), typeParameters = null; expectContextualKeyword('interface'); return parseInterfaceish(marker, /* allowStatic */false); } function parseDeclareClass() { var marker = markerCreate(), ret; expectContextualKeyword('declare'); expectKeyword('class'); ret = parseInterfaceish(marker, /* allowStatic */true); ret.type = Syntax.DeclareClass; return ret; } function parseDeclareFunction() { var id, idMarker, marker = markerCreate(), params, returnType, rest, tmp, typeParameters = null, value, valueMarker; expectContextualKeyword('declare'); expectKeyword('function'); idMarker = markerCreate(); id = parseVariableIdentifier(); valueMarker = markerCreate(); if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } expect('('); tmp = parseFunctionTypeParams(); params = tmp.params; rest = tmp.rest; expect(')'); expect(':'); returnType = parseType(); value = markerApply(valueMarker, delegate.createFunctionTypeAnnotation( params, returnType, rest, typeParameters )); id.typeAnnotation = markerApply(valueMarker, delegate.createTypeAnnotation( value )); markerApply(idMarker, id); consumeSemicolon(); return markerApply(marker, delegate.createDeclareFunction( id )); } function parseDeclareVariable() { var id, marker = markerCreate(); expectContextualKeyword('declare'); expectKeyword('var'); id = parseTypeAnnotatableIdentifier(); consumeSemicolon(); return markerApply(marker, delegate.createDeclareVariable( id )); } function parseDeclareModule() { var body = [], bodyMarker, id, idMarker, marker = markerCreate(), token; expectContextualKeyword('declare'); expectContextualKeyword('module'); if (lookahead.type === Token.StringLiteral) { if (strict && lookahead.octal) { throwErrorTolerant(lookahead, Messages.StrictOctalLiteral); } idMarker = markerCreate(); id = markerApply(idMarker, delegate.createLiteral(lex())); } else { id = parseVariableIdentifier(); } bodyMarker = markerCreate(); expect('{'); while (index < length && !match('}')) { token = lookahead2(); switch (token.value) { case 'class': body.push(parseDeclareClass()); break; case 'function': body.push(parseDeclareFunction()); break; case 'var': body.push(parseDeclareVariable()); break; default: throwUnexpected(lookahead); } } expect('}'); return markerApply(marker, delegate.createDeclareModule( id, markerApply(bodyMarker, delegate.createBlockStatement(body)) )); } function collectToken() { var start, loc, token, range, value, entry; if (!state.inXJSChild) { skipComment(); } start = index; loc = { start: { line: lineNumber, column: index - lineStart } }; token = extra.advance(); loc.end = { line: lineNumber, column: index - lineStart }; if (token.type !== Token.EOF) { range = [token.range[0], token.range[1]]; value = source.slice(token.range[0], token.range[1]); entry = { type: TokenName[token.type], value: value, range: range, loc: loc }; if (token.regex) { entry.regex = { pattern: token.regex.pattern, flags: token.regex.flags }; } extra.tokens.push(entry); } return token; } function collectRegex() { var pos, loc, regex, token; skipComment(); pos = index; loc = { start: { line: lineNumber, column: index - lineStart } }; regex = extra.scanRegExp(); loc.end = { line: lineNumber, column: index - lineStart }; if (!extra.tokenize) { // Pop the previous token, which is likely '/' or '/=' if (extra.tokens.length > 0) { token = extra.tokens[extra.tokens.length - 1]; if (token.range[0] === pos && token.type === 'Punctuator') { if (token.value === '/' || token.value === '/=') { extra.tokens.pop(); } } } extra.tokens.push({ type: 'RegularExpression', value: regex.literal, regex: regex.regex, range: [pos, index], loc: loc }); } return regex; } function filterTokenLocation() { var i, entry, token, tokens = []; for (i = 0; i < extra.tokens.length; ++i) { entry = extra.tokens[i]; token = { type: entry.type, value: entry.value }; if (entry.regex) { token.regex = { pattern: entry.regex.pattern, flags: entry.regex.flags }; } if (extra.range) { token.range = entry.range; } if (extra.loc) { token.loc = entry.loc; } tokens.push(token); } extra.tokens = tokens; } function patch() { if (extra.comments) { extra.skipComment = skipComment; skipComment = scanComment; } if (typeof extra.tokens !== 'undefined') { extra.advance = advance; extra.scanRegExp = scanRegExp; advance = collectToken; scanRegExp = collectRegex; } } function unpatch() { if (typeof extra.skipComment === 'function') { skipComment = extra.skipComment; } if (typeof extra.scanRegExp === 'function') { advance = extra.advance; scanRegExp = extra.scanRegExp; } } // This is used to modify the delegate. function extend(object, properties) { var entry, result = {}; for (entry in object) { if (object.hasOwnProperty(entry)) { result[entry] = object[entry]; } } for (entry in properties) { if (properties.hasOwnProperty(entry)) { result[entry] = properties[entry]; } } return result; } function tokenize(code, options) { var toString, token, tokens; toString = String; if (typeof code !== 'string' && !(code instanceof String)) { code = toString(code); } delegate = SyntaxTreeDelegate; source = code; index = 0; lineNumber = (source.length > 0) ? 1 : 0; lineStart = 0; length = source.length; lookahead = null; state = { allowKeyword: true, allowIn: true, labelSet: {}, inFunctionBody: false, inIteration: false, inSwitch: false, lastCommentStart: -1 }; extra = {}; // Options matching. options = options || {}; // Of course we collect tokens here. options.tokens = true; extra.tokens = []; extra.tokenize = true; // The following two fields are necessary to compute the Regex tokens. extra.openParenToken = -1; extra.openCurlyToken = -1; extra.range = (typeof options.range === 'boolean') && options.range; extra.loc = (typeof options.loc === 'boolean') && options.loc; if (typeof options.comment === 'boolean' && options.comment) { extra.comments = []; } if (typeof options.tolerant === 'boolean' && options.tolerant) { extra.errors = []; } if (length > 0) { if (typeof source[0] === 'undefined') { // Try first to convert to a string. This is good as fast path // for old IE which understands string indexing for string // literals only and not for string object. if (code instanceof String) { source = code.valueOf(); } } } patch(); try { peek(); if (lookahead.type === Token.EOF) { return extra.tokens; } token = lex(); while (lookahead.type !== Token.EOF) { try { token = lex(); } catch (lexError) { token = lookahead; if (extra.errors) { extra.errors.push(lexError); // We have to break on the first error // to avoid infinite loops. break; } else { throw lexError; } } } filterTokenLocation(); tokens = extra.tokens; if (typeof extra.comments !== 'undefined') { tokens.comments = extra.comments; } if (typeof extra.errors !== 'undefined') { tokens.errors = extra.errors; } } catch (e) { throw e; } finally { unpatch(); extra = {}; } return tokens; } function parse(code, options) { var program, toString; toString = String; if (typeof code !== 'string' && !(code instanceof String)) { code = toString(code); } delegate = SyntaxTreeDelegate; source = code; index = 0; lineNumber = (source.length > 0) ? 1 : 0; lineStart = 0; length = source.length; lookahead = null; state = { allowKeyword: false, allowIn: true, labelSet: {}, parenthesizedCount: 0, inFunctionBody: false, inIteration: false, inSwitch: false, inXJSChild: false, inXJSTag: false, inType: false, lastCommentStart: -1, yieldAllowed: false, awaitAllowed: false }; extra = {}; if (typeof options !== 'undefined') { extra.range = (typeof options.range === 'boolean') && options.range; extra.loc = (typeof options.loc === 'boolean') && options.loc; extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment; if (extra.loc && options.source !== null && options.source !== undefined) { delegate = extend(delegate, { 'postProcess': function (node) { node.loc.source = toString(options.source); return node; } }); } if (typeof options.tokens === 'boolean' && options.tokens) { extra.tokens = []; } if (typeof options.comment === 'boolean' && options.comment) { extra.comments = []; } if (typeof options.tolerant === 'boolean' && options.tolerant) { extra.errors = []; } if (extra.attachComment) { extra.range = true; extra.comments = []; extra.bottomRightStack = []; extra.trailingComments = []; extra.leadingComments = []; } } if (length > 0) { if (typeof source[0] === 'undefined') { // Try first to convert to a string. This is good as fast path // for old IE which understands string indexing for string // literals only and not for string object. if (code instanceof String) { source = code.valueOf(); } } } patch(); try { program = parseProgram(); if (typeof extra.comments !== 'undefined') { program.comments = extra.comments; } if (typeof extra.tokens !== 'undefined') { filterTokenLocation(); program.tokens = extra.tokens; } if (typeof extra.errors !== 'undefined') { program.errors = extra.errors; } } catch (e) { throw e; } finally { unpatch(); extra = {}; } return program; } // Sync with *.json manifests. exports.version = '8001.1001.0-dev-harmony-fb'; exports.tokenize = tokenize; exports.parse = parse; // Deep copy. exports.Syntax = (function () { var name, types = {}; if (typeof Object.create === 'function') { types = Object.create(null); } for (name in Syntax) { if (Syntax.hasOwnProperty(name)) { types[name] = Syntax[name]; } } if (typeof Object.freeze === 'function') { Object.freeze(types); } return types; }()); })); /* vim: set sw=4 ts=4 et tw=80 : */ },{}],10:[function(_dereq_,module,exports){ /* * Copyright 2009-2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ exports.SourceMapGenerator = _dereq_('./source-map/source-map-generator').SourceMapGenerator; exports.SourceMapConsumer = _dereq_('./source-map/source-map-consumer').SourceMapConsumer; exports.SourceNode = _dereq_('./source-map/source-node').SourceNode; },{"./source-map/source-map-consumer":15,"./source-map/source-map-generator":16,"./source-map/source-node":17}],11:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var util = _dereq_('./util'); /** * A data structure which is a combination of an array and a set. Adding a new * member is O(1), testing for membership is O(1), and finding the index of an * element is O(1). Removing elements from the set is not supported. Only * strings are supported for membership. */ function ArraySet() { this._array = []; this._set = {}; } /** * Static method for creating ArraySet instances from an existing array. */ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { var set = new ArraySet(); for (var i = 0, len = aArray.length; i < len; i++) { set.add(aArray[i], aAllowDuplicates); } return set; }; /** * Add the given string to this set. * * @param String aStr */ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { var isDuplicate = this.has(aStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { this._array.push(aStr); } if (!isDuplicate) { this._set[util.toSetString(aStr)] = idx; } }; /** * Is the given string a member of this set? * * @param String aStr */ ArraySet.prototype.has = function ArraySet_has(aStr) { return Object.prototype.hasOwnProperty.call(this._set, util.toSetString(aStr)); }; /** * What is the index of the given string in the array? * * @param String aStr */ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { if (this.has(aStr)) { return this._set[util.toSetString(aStr)]; } throw new Error('"' + aStr + '" is not in the set.'); }; /** * What is the element at the given index? * * @param Number aIdx */ ArraySet.prototype.at = function ArraySet_at(aIdx) { if (aIdx >= 0 && aIdx < this._array.length) { return this._array[aIdx]; } throw new Error('No element indexed by ' + aIdx); }; /** * Returns the array representation of this set (which has the proper indices * indicated by indexOf). Note that this is a copy of the internal array used * for storing the members so that no one can mess with internal state. */ ArraySet.prototype.toArray = function ArraySet_toArray() { return this._array.slice(); }; exports.ArraySet = ArraySet; }); },{"./util":18,"amdefine":19}],12:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause * * Based on the Base 64 VLQ implementation in Closure Compiler: * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java * * Copyright 2011 The Closure Compiler Authors. 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. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * 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 * OWNER 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. */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var base64 = _dereq_('./base64'); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, // the next four bits are the actual value, and the 6th bit is the // continuation bit. The continuation bit tells us whether there are more // digits in this value following this digit. // // Continuation // | Sign // | | // V V // 101011 var VLQ_BASE_SHIFT = 5; // binary: 100000 var VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111 var VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000 var VLQ_CONTINUATION_BIT = VLQ_BASE; /** * Converts from a two-complement value to a value where the sign bit is * is placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ function toVLQSigned(aValue) { return aValue < 0 ? ((-aValue) << 1) + 1 : (aValue << 1) + 0; } /** * Converts to a two-complement value from a value where the sign bit is * is placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ function fromVLQSigned(aValue) { var isNegative = (aValue & 1) === 1; var shifted = aValue >> 1; return isNegative ? -shifted : shifted; } /** * Returns the base 64 VLQ encoded value. */ exports.encode = function base64VLQ_encode(aValue) { var encoded = ""; var digit; var vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { // There are still more digits in this value, so we must make sure the // continuation bit is marked. digit |= VLQ_CONTINUATION_BIT; } encoded += base64.encode(digit); } while (vlq > 0); return encoded; }; /** * Decodes the next base 64 VLQ value from the given string and returns the * value and the rest of the string. */ exports.decode = function base64VLQ_decode(aStr) { var i = 0; var strLen = aStr.length; var result = 0; var shift = 0; var continuation, digit; do { if (i >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } digit = base64.decode(aStr.charAt(i++)); continuation = !!(digit & VLQ_CONTINUATION_BIT); digit &= VLQ_BASE_MASK; result = result + (digit << shift); shift += VLQ_BASE_SHIFT; } while (continuation); return { value: fromVLQSigned(result), rest: aStr.slice(i) }; }; }); },{"./base64":13,"amdefine":19}],13:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var charToIntMap = {}; var intToCharMap = {}; 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' .split('') .forEach(function (ch, index) { charToIntMap[ch] = index; intToCharMap[index] = ch; }); /** * Encode an integer in the range of 0 to 63 to a single base 64 digit. */ exports.encode = function base64_encode(aNumber) { if (aNumber in intToCharMap) { return intToCharMap[aNumber]; } throw new TypeError("Must be between 0 and 63: " + aNumber); }; /** * Decode a single base 64 digit to an integer. */ exports.decode = function base64_decode(aChar) { if (aChar in charToIntMap) { return charToIntMap[aChar]; } throw new TypeError("Not a valid base 64 digit: " + aChar); }; }); },{"amdefine":19}],14:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { /** * Recursive implementation of binary search. * * @param aLow Indices here and lower do not contain the needle. * @param aHigh Indices here and higher do not contain the needle. * @param aNeedle The element being searched for. * @param aHaystack The non-empty array being searched. * @param aCompare Function which takes two elements and returns -1, 0, or 1. */ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) { // This function terminates when one of the following is true: // // 1. We find the exact element we are looking for. // // 2. We did not find the exact element, but we can return the next // closest element that is less than that element. // // 3. We did not find the exact element, and there is no next-closest // element which is less than the one we are searching for, so we // return null. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. return aHaystack[mid]; } else if (cmp > 0) { // aHaystack[mid] is greater than our needle. if (aHigh - mid > 1) { // The element is in the upper half. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare); } // We did not find an exact match, return the next closest one // (termination case 2). return aHaystack[mid]; } else { // aHaystack[mid] is less than our needle. if (mid - aLow > 1) { // The element is in the lower half. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare); } // The exact needle element was not found in this haystack. Determine if // we are in termination case (2) or (3) and return the appropriate thing. return aLow < 0 ? null : aHaystack[aLow]; } } /** * This is an implementation of binary search which will always try and return * the next lowest value checked if there is no exact hit. This is because * mappings between original and generated line/col pairs are single points, * and there is an implicit region between each of them, so a miss just means * that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. * @param aCompare A function which takes the needle and an element in the * array and returns -1, 0, or 1 depending on whether the needle is less * than, equal to, or greater than the element, respectively. */ exports.search = function search(aNeedle, aHaystack, aCompare) { return aHaystack.length > 0 ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) : null; }; }); },{"amdefine":19}],15:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var util = _dereq_('./util'); var binarySearch = _dereq_('./binary-search'); var ArraySet = _dereq_('./array-set').ArraySet; var base64VLQ = _dereq_('./base64-vlq'); /** * A SourceMapConsumer instance represents a parsed source map which we can * query for information about the original file positions by giving it a file * position in the generated source. * * The only parameter is the raw source map (either as a JSON string, or * already parsed to an object). According to the spec, source maps have the * following attributes: * * - version: Which version of the source map spec this map is following. * - sources: An array of URLs to the original source files. * - names: An array of identifiers which can be referrenced by individual mappings. * - sourceRoot: Optional. The URL root from which all sources are relative. * - sourcesContent: Optional. An array of contents of the original source files. * - mappings: A string of base64 VLQs which contain the actual mappings. * - file: The generated file this source map is associated with. * * Here is an example source map, taken from the source map spec[0]: * * { * version : 3, * file: "out.js", * sourceRoot : "", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AA,AB;;ABCDE;" * } * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# */ function SourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } var version = util.getArg(sourceMap, 'version'); var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which // requires the array) to play nice here. var names = util.getArg(sourceMap, 'names', []); var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); var mappings = util.getArg(sourceMap, 'mappings'); var file = util.getArg(sourceMap, 'file', null); // Once again, Sass deviates from the spec and supplies the version as a // string rather than a number, so we use loose equality checking here. if (version != this._version) { throw new Error('Unsupported version: ' + version); } // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue // #72 and bugzil.la/889492. this._names = ArraySet.fromArray(names, true); this._sources = ArraySet.fromArray(sources, true); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; this._mappings = mappings; this.file = file; } /** * Create a SourceMapConsumer from a SourceMapGenerator. * * @param SourceMapGenerator aSourceMap * The source map that will be consumed. * @returns SourceMapConsumer */ SourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) { var smc = Object.create(SourceMapConsumer.prototype); smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); smc.sourceRoot = aSourceMap._sourceRoot; smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); smc.file = aSourceMap._file; smc.__generatedMappings = aSourceMap._mappings.slice() .sort(util.compareByGeneratedPositions); smc.__originalMappings = aSourceMap._mappings.slice() .sort(util.compareByOriginalPositions); return smc; }; /** * The version of the source mapping spec that we are consuming. */ SourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(SourceMapConsumer.prototype, 'sources', { get: function () { return this._sources.toArray().map(function (s) { return this.sourceRoot ? util.join(this.sourceRoot, s) : s; }, this); } }); // `__generatedMappings` and `__originalMappings` are arrays that hold the // parsed mapping coordinates from the source map's "mappings" attribute. They // are lazily instantiated, accessed via the `_generatedMappings` and // `_originalMappings` getters respectively, and we only parse the mappings // and create these arrays once queried for a source location. We jump through // these hoops because there can be many thousands of mappings, and parsing // them is expensive, so we only want to do it if we must. // // Each object in the arrays is of the form: // // { // generatedLine: The line number in the generated code, // generatedColumn: The column number in the generated code, // source: The path to the original source file that generated this // chunk of code, // originalLine: The line number in the original source that // corresponds to this chunk of generated code, // originalColumn: The column number in the original source that // corresponds to this chunk of generated code, // name: The name of the original symbol which generated this chunk of // code. // } // // All properties except for `generatedLine` and `generatedColumn` can be // `null`. // // `_generatedMappings` is ordered by the generated positions. // // `_originalMappings` is ordered by the original positions. SourceMapConsumer.prototype.__generatedMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { get: function () { if (!this.__generatedMappings) { this.__generatedMappings = []; this.__originalMappings = []; this._parseMappings(this._mappings, this.sourceRoot); } return this.__generatedMappings; } }); SourceMapConsumer.prototype.__originalMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { get: function () { if (!this.__originalMappings) { this.__generatedMappings = []; this.__originalMappings = []; this._parseMappings(this._mappings, this.sourceRoot); } return this.__originalMappings; } }); /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { var generatedLine = 1; var previousGeneratedColumn = 0; var previousOriginalLine = 0; var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; var mappingSeparator = /^[,;]/; var str = aStr; var mapping; var temp; while (str.length > 0) { if (str.charAt(0) === ';') { generatedLine++; str = str.slice(1); previousGeneratedColumn = 0; } else if (str.charAt(0) === ',') { str = str.slice(1); } else { mapping = {}; mapping.generatedLine = generatedLine; // Generated column. temp = base64VLQ.decode(str); mapping.generatedColumn = previousGeneratedColumn + temp.value; previousGeneratedColumn = mapping.generatedColumn; str = temp.rest; if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { // Original source. temp = base64VLQ.decode(str); mapping.source = this._sources.at(previousSource + temp.value); previousSource += temp.value; str = temp.rest; if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { throw new Error('Found a source, but no line and column'); } // Original line. temp = base64VLQ.decode(str); mapping.originalLine = previousOriginalLine + temp.value; previousOriginalLine = mapping.originalLine; // Lines are stored 0-based mapping.originalLine += 1; str = temp.rest; if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { throw new Error('Found a source and line, but no column'); } // Original column. temp = base64VLQ.decode(str); mapping.originalColumn = previousOriginalColumn + temp.value; previousOriginalColumn = mapping.originalColumn; str = temp.rest; if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { // Original name. temp = base64VLQ.decode(str); mapping.name = this._names.at(previousName + temp.value); previousName += temp.value; str = temp.rest; } } this.__generatedMappings.push(mapping); if (typeof mapping.originalLine === 'number') { this.__originalMappings.push(mapping); } } } this.__originalMappings.sort(util.compareByOriginalPositions); }; /** * Find the mapping that best matches the hypothetical "needle" mapping that * we are searching for in the given "haystack" of mappings. */ SourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator) { // To return the position we are searching for, we must first find the // mapping for the given position and then return the opposite position it // points to. Because the mappings are sorted, we can use binary search to // find the best mapping. if (aNeedle[aLineName] <= 0) { throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]); } if (aNeedle[aColumnName] < 0) { throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]); } return binarySearch.search(aNeedle, aMappings, aComparator); }; /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. * - column: The column number in the generated source. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. * - column: The column number in the original source, or null. * - name: The original identifier, or null. */ SourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; var mapping = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositions); if (mapping) { var source = util.getArg(mapping, 'source', null); if (source && this.sourceRoot) { source = util.join(this.sourceRoot, source); } return { source: source, line: util.getArg(mapping, 'originalLine', null), column: util.getArg(mapping, 'originalColumn', null), name: util.getArg(mapping, 'name', null) }; } return { source: null, line: null, column: null, name: null }; }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * availible. */ SourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource) { if (!this.sourcesContent) { return null; } if (this.sourceRoot) { aSource = util.relative(this.sourceRoot, aSource); } if (this._sources.has(aSource)) { return this.sourcesContent[this._sources.indexOf(aSource)]; } var url; if (this.sourceRoot && (url = util.urlParse(this.sourceRoot))) { // XXX: file:// URIs and absolute paths lead to unexpected behavior for // many users. We can help them out when they expect file:// URIs to // behave like it would if they were running a local HTTP server. See // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] } if ((!url.path || url.path == "/") && this._sources.has("/" + aSource)) { return this.sourcesContent[this._sources.indexOf("/" + aSource)]; } } throw new Error('"' + aSource + '" is not in the SourceMap.'); }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. * - column: The column number in the original source. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. * - column: The column number in the generated source, or null. */ SourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { var needle = { source: util.getArg(aArgs, 'source'), originalLine: util.getArg(aArgs, 'line'), originalColumn: util.getArg(aArgs, 'column') }; if (this.sourceRoot) { needle.source = util.relative(this.sourceRoot, needle.source); } var mapping = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions); if (mapping) { return { line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null) }; } return { line: null, column: null }; }; SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; /** * Iterate over each mapping between an original source/line/column and a * generated line/column in this source map. * * @param Function aCallback * The function that is called with each mapping. * @param Object aContext * Optional. If specified, this object will be the value of `this` every * time that `aCallback` is called. * @param aOrder * Either `SourceMapConsumer.GENERATED_ORDER` or * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to * iterate over the mappings sorted by the generated file's line/column * order or the original's source/line/column order, respectively. Defaults to * `SourceMapConsumer.GENERATED_ORDER`. */ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { var context = aContext || null; var order = aOrder || SourceMapConsumer.GENERATED_ORDER; var mappings; switch (order) { case SourceMapConsumer.GENERATED_ORDER: mappings = this._generatedMappings; break; case SourceMapConsumer.ORIGINAL_ORDER: mappings = this._originalMappings; break; default: throw new Error("Unknown order of iteration."); } var sourceRoot = this.sourceRoot; mappings.map(function (mapping) { var source = mapping.source; if (source && sourceRoot) { source = util.join(sourceRoot, source); } return { source: source, generatedLine: mapping.generatedLine, generatedColumn: mapping.generatedColumn, originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: mapping.name }; }).forEach(aCallback, context); }; exports.SourceMapConsumer = SourceMapConsumer; }); },{"./array-set":11,"./base64-vlq":12,"./binary-search":14,"./util":18,"amdefine":19}],16:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var base64VLQ = _dereq_('./base64-vlq'); var util = _dereq_('./util'); var ArraySet = _dereq_('./array-set').ArraySet; /** * An instance of the SourceMapGenerator represents a source map which is * being built incrementally. To create a new one, you must pass an object * with the following properties: * * - file: The filename of the generated source. * - sourceRoot: An optional root for all URLs in this source map. */ function SourceMapGenerator(aArgs) { this._file = util.getArg(aArgs, 'file'); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = []; this._sourcesContents = null; } SourceMapGenerator.prototype._version = 3; /** * Creates a new SourceMapGenerator based on a SourceMapConsumer * * @param aSourceMapConsumer The SourceMap. */ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { var sourceRoot = aSourceMapConsumer.sourceRoot; var generator = new SourceMapGenerator({ file: aSourceMapConsumer.file, sourceRoot: sourceRoot }); aSourceMapConsumer.eachMapping(function (mapping) { var newMapping = { generated: { line: mapping.generatedLine, column: mapping.generatedColumn } }; if (mapping.source) { newMapping.source = mapping.source; if (sourceRoot) { newMapping.source = util.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, column: mapping.originalColumn }; if (mapping.name) { newMapping.name = mapping.name; } } generator.addMapping(newMapping); }); aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content) { generator.setSourceContent(sourceFile, content); } }); return generator; }; /** * Add a single mapping from original source line and column to the generated * source's line and column for this source map being created. The mapping * object should have the following properties: * * - generated: An object with the generated line and column positions. * - original: An object with the original line and column positions. * - source: The original source file (relative to the sourceRoot). * - name: An optional original token name for this mapping. */ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { var generated = util.getArg(aArgs, 'generated'); var original = util.getArg(aArgs, 'original', null); var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); this._validateMapping(generated, original, source, name); if (source && !this._sources.has(source)) { this._sources.add(source); } if (name && !this._names.has(name)) { this._names.add(name); } this._mappings.push({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, originalColumn: original != null && original.column, source: source, name: name }); }; /** * Set the source content for a source file. */ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot) { source = util.relative(this._sourceRoot, source); } if (aSourceContent !== null) { // Add the source content to the _sourcesContents map. // Create a new _sourcesContents map if the property is null. if (!this._sourcesContents) { this._sourcesContents = {}; } this._sourcesContents[util.toSetString(source)] = aSourceContent; } else { // Remove the source file from the _sourcesContents map. // If the _sourcesContents map is empty, set the property to null. delete this._sourcesContents[util.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } } }; /** * Applies the mappings of a sub-source-map for a specific source file to the * source map being generated. Each mapping to the supplied source file is * rewritten using the supplied source map. Note: The resolution for the * resulting mappings is the minimium of this map and the supplied map. * * @param aSourceMapConsumer The source map to be applied. * @param aSourceFile Optional. The filename of the source file. * If omitted, SourceMapConsumer's file property will be used. */ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) { // If aSourceFile is omitted, we will use the file property of the SourceMap if (!aSourceFile) { aSourceFile = aSourceMapConsumer.file; } var sourceRoot = this._sourceRoot; // Make "aSourceFile" relative if an absolute Url is passed. if (sourceRoot) { aSourceFile = util.relative(sourceRoot, aSourceFile); } // Applying the SourceMap can add and remove items from the sources and // the names array. var newSources = new ArraySet(); var newNames = new ArraySet(); // Find mappings for the "aSourceFile" this._mappings.forEach(function (mapping) { if (mapping.source === aSourceFile && mapping.originalLine) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ line: mapping.originalLine, column: mapping.originalColumn }); if (original.source !== null) { // Copy mapping if (sourceRoot) { mapping.source = util.relative(sourceRoot, original.source); } else { mapping.source = original.source; } mapping.originalLine = original.line; mapping.originalColumn = original.column; if (original.name !== null && mapping.name !== null) { // Only use the identifier name if it's an identifier // in both SourceMaps mapping.name = original.name; } } } var source = mapping.source; if (source && !newSources.has(source)) { newSources.add(source); } var name = mapping.name; if (name && !newNames.has(name)) { newNames.add(name); } }, this); this._sources = newSources; this._names = newNames; // Copy sourcesContents of applied map. aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content) { if (sourceRoot) { sourceFile = util.relative(sourceRoot, sourceFile); } this.setSourceContent(sourceFile, content); } }, this); }; /** * A mapping can have one of the three levels of data: * * 1. Just the generated position. * 2. The Generated position, original position, and original source. * 3. Generated and original position, original source, as well as a name * token. * * To maintain consistency, we validate that any new mapping being added falls * in to one of these categories. */ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { // Case 1. return; } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { // Cases 2 and 3. return; } else { throw new Error('Invalid mapping: ' + JSON.stringify({ generated: aGenerated, source: aSource, orginal: aOriginal, name: aName })); } }; /** * Serialize the accumulated mappings in to the stream of base 64 VLQs * specified by the source map format. */ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { var previousGeneratedColumn = 0; var previousGeneratedLine = 1; var previousOriginalColumn = 0; var previousOriginalLine = 0; var previousName = 0; var previousSource = 0; var result = ''; var mapping; // The mappings must be guaranteed to be in sorted order before we start // serializing them or else the generated line numbers (which are defined // via the ';' separators) will be all messed up. Note: it might be more // performant to maintain the sorting as we insert them, rather than as we // serialize them, but the big O is the same either way. this._mappings.sort(util.compareByGeneratedPositions); for (var i = 0, len = this._mappings.length; i < len; i++) { mapping = this._mappings[i]; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; while (mapping.generatedLine !== previousGeneratedLine) { result += ';'; previousGeneratedLine++; } } else { if (i > 0) { if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) { continue; } result += ','; } } result += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); previousGeneratedColumn = mapping.generatedColumn; if (mapping.source) { result += base64VLQ.encode(this._sources.indexOf(mapping.source) - previousSource); previousSource = this._sources.indexOf(mapping.source); // lines are stored 0-based in SourceMap spec version 3 result += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); previousOriginalLine = mapping.originalLine - 1; result += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); previousOriginalColumn = mapping.originalColumn; if (mapping.name) { result += base64VLQ.encode(this._names.indexOf(mapping.name) - previousName); previousName = this._names.indexOf(mapping.name); } } } return result; }; SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { return aSources.map(function (source) { if (!this._sourcesContents) { return null; } if (aSourceRoot) { source = util.relative(aSourceRoot, source); } var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; /** * Externalize the source map. */ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { var map = { version: this._version, file: this._file, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() }; if (this._sourceRoot) { map.sourceRoot = this._sourceRoot; } if (this._sourcesContents) { map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); } return map; }; /** * Render the source map being generated to a string. */ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { return JSON.stringify(this); }; exports.SourceMapGenerator = SourceMapGenerator; }); },{"./array-set":11,"./base64-vlq":12,"./util":18,"amdefine":19}],17:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var SourceMapGenerator = _dereq_('./source-map-generator').SourceMapGenerator; var util = _dereq_('./util'); /** * SourceNodes provide a way to abstract over interpolating/concatenating * snippets of generated JavaScript source code while maintaining the line and * column information associated with the original source code. * * @param aLine The original line number. * @param aColumn The original column number. * @param aSource The original source's filename. * @param aChunks Optional. An array of strings which are snippets of * generated JS, or other SourceNodes. * @param aName The original identifier. */ function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; this.sourceContents = {}; this.line = aLine === undefined ? null : aLine; this.column = aColumn === undefined ? null : aColumn; this.source = aSource === undefined ? null : aSource; this.name = aName === undefined ? null : aName; if (aChunks != null) this.add(aChunks); } /** * Creates a SourceNode from generated code and a SourceMapConsumer. * * @param aGeneratedCode The generated code * @param aSourceMapConsumer The SourceMap for the generated code */ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) { // The SourceNode we want to fill with the generated code // and the SourceMap var node = new SourceNode(); // The generated code // Processed fragments are removed from this array. var remainingLines = aGeneratedCode.split('\n'); // We need to remember the position of "remainingLines" var lastGeneratedLine = 1, lastGeneratedColumn = 0; // The generate SourceNodes we need a code range. // To extract it current and last mapping is used. // Here we store the last mapping. var lastMapping = null; aSourceMapConsumer.eachMapping(function (mapping) { if (lastMapping === null) { // We add the generated code until the first mapping // to the SourceNode without any mapping. // Each line is added as separate string. while (lastGeneratedLine < mapping.generatedLine) { node.add(remainingLines.shift() + "\n"); lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[0]; node.add(nextLine.substr(0, mapping.generatedColumn)); remainingLines[0] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } } else { // We add the code from "lastMapping" to "mapping": // First check if there is a new line in between. if (lastGeneratedLine < mapping.generatedLine) { var code = ""; // Associate full lines with "lastMapping" do { code += remainingLines.shift() + "\n"; lastGeneratedLine++; lastGeneratedColumn = 0; } while (lastGeneratedLine < mapping.generatedLine); // When we reached the correct line, we add code until we // reach the correct column too. if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[0]; code += nextLine.substr(0, mapping.generatedColumn); remainingLines[0] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } // Create the SourceNode. addMappingWithCode(lastMapping, code); } else { // There is no new line in between. // Associate the code between "lastGeneratedColumn" and // "mapping.generatedColumn" with "lastMapping" var nextLine = remainingLines[0]; var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); remainingLines[0] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); lastGeneratedColumn = mapping.generatedColumn; addMappingWithCode(lastMapping, code); } } lastMapping = mapping; }, this); // We have processed all mappings. // Associate the remaining code in the current line with "lastMapping" // and add the remaining lines without any mapping addMappingWithCode(lastMapping, remainingLines.join("\n")); // Copy sourcesContent into SourceNode aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content) { node.setSourceContent(sourceFile, content); } }); return node; function addMappingWithCode(mapping, code) { if (mapping === null || mapping.source === undefined) { node.add(code); } else { node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, mapping.source, code, mapping.name)); } } }; /** * Add a chunk of generated JS to this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.add = function SourceNode_add(aChunk) { if (Array.isArray(aChunk)) { aChunk.forEach(function (chunk) { this.add(chunk); }, this); } else if (aChunk instanceof SourceNode || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; /** * Add a chunk of generated JS to the beginning of this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { if (Array.isArray(aChunk)) { for (var i = aChunk.length-1; i >= 0; i--) { this.prepend(aChunk[i]); } } else if (aChunk instanceof SourceNode || typeof aChunk === "string") { this.children.unshift(aChunk); } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; /** * Walk over the tree of JS snippets in this node and its children. The * walking function is called once for each snippet of JS and is passed that * snippet and the its original associated source's line/column location. * * @param aFn The traversal function. */ SourceNode.prototype.walk = function SourceNode_walk(aFn) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; if (chunk instanceof SourceNode) { chunk.walk(aFn); } else { if (chunk !== '') { aFn(chunk, { source: this.source, line: this.line, column: this.column, name: this.name }); } } } }; /** * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between * each of `this.children`. * * @param aSep The separator. */ SourceNode.prototype.join = function SourceNode_join(aSep) { var newChildren; var i; var len = this.children.length; if (len > 0) { newChildren = []; for (i = 0; i < len-1; i++) { newChildren.push(this.children[i]); newChildren.push(aSep); } newChildren.push(this.children[i]); this.children = newChildren; } return this; }; /** * Call String.prototype.replace on the very right-most source snippet. Useful * for trimming whitespace from the end of a source node, etc. * * @param aPattern The pattern to replace. * @param aReplacement The thing to replace the pattern with. */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; if (lastChild instanceof SourceNode) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); } else { this.children.push(''.replace(aPattern, aReplacement)); } return this; }; /** * Set the source content for a source file. This will be added to the SourceMapGenerator * in the sourcesContent field. * * @param aSourceFile The filename of the source file * @param aSourceContent The content of the source file */ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; }; /** * Walk over the tree of SourceNodes. The walking function is called for each * source file content and is passed the filename and source content. * * @param aFn The traversal function. */ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { if (this.children[i] instanceof SourceNode) { this.children[i].walkSourceContents(aFn); } } var sources = Object.keys(this.sourceContents); for (var i = 0, len = sources.length; i < len; i++) { aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); } }; /** * Return the string representation of this source node. Walks over the tree * and concatenates all the various snippets together to one string. */ SourceNode.prototype.toString = function SourceNode_toString() { var str = ""; this.walk(function (chunk) { str += chunk; }); return str; }; /** * Returns the string representation of this source node along with a source * map. */ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { var generated = { code: "", line: 1, column: 0 }; var map = new SourceMapGenerator(aArgs); var sourceMappingActive = false; var lastOriginalSource = null; var lastOriginalLine = null; var lastOriginalColumn = null; var lastOriginalName = null; this.walk(function (chunk, original) { generated.code += chunk; if (original.source !== null && original.line !== null && original.column !== null) { if(lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } lastOriginalSource = original.source; lastOriginalLine = original.line; lastOriginalColumn = original.column; lastOriginalName = original.name; sourceMappingActive = true; } else if (sourceMappingActive) { map.addMapping({ generated: { line: generated.line, column: generated.column } }); lastOriginalSource = null; sourceMappingActive = false; } chunk.split('').forEach(function (ch) { if (ch === '\n') { generated.line++; generated.column = 0; } else { generated.column++; } }); }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); }); return { code: generated.code, map: map }; }; exports.SourceNode = SourceNode; }); },{"./source-map-generator":16,"./util":18,"amdefine":19}],18:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { /** * This is a helper function for getting values from parameter/options * objects. * * @param args The object we are extracting values from * @param name The name of the property we are getting. * @param defaultValue An optional value to return if the property is missing * from the object. If this is not specified and the property is missing, an * error will be thrown. */ function getArg(aArgs, aName, aDefaultValue) { if (aName in aArgs) { return aArgs[aName]; } else if (arguments.length === 3) { return aDefaultValue; } else { throw new Error('"' + aName + '" is a required argument.'); } } exports.getArg = getArg; var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/; var dataUrlRegexp = /^data:.+\,.+/; function urlParse(aUrl) { var match = aUrl.match(urlRegexp); if (!match) { return null; } return { scheme: match[1], auth: match[3], host: match[4], port: match[6], path: match[7] }; } exports.urlParse = urlParse; function urlGenerate(aParsedUrl) { var url = aParsedUrl.scheme + "://"; if (aParsedUrl.auth) { url += aParsedUrl.auth + "@" } if (aParsedUrl.host) { url += aParsedUrl.host; } if (aParsedUrl.port) { url += ":" + aParsedUrl.port } if (aParsedUrl.path) { url += aParsedUrl.path; } return url; } exports.urlGenerate = urlGenerate; function join(aRoot, aPath) { var url; if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) { return aPath; } if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) { url.path = aPath; return urlGenerate(url); } return aRoot.replace(/\/$/, '') + '/' + aPath; } exports.join = join; /** * Because behavior goes wacky when you set `__proto__` on objects, we * have to prefix all the strings in our set with an arbitrary character. * * See https://github.com/mozilla/source-map/pull/31 and * https://github.com/mozilla/source-map/issues/30 * * @param String aStr */ function toSetString(aStr) { return '$' + aStr; } exports.toSetString = toSetString; function fromSetString(aStr) { return aStr.substr(1); } exports.fromSetString = fromSetString; function relative(aRoot, aPath) { aRoot = aRoot.replace(/\/$/, ''); var url = urlParse(aRoot); if (aPath.charAt(0) == "/" && url && url.path == "/") { return aPath.slice(1); } return aPath.indexOf(aRoot + '/') === 0 ? aPath.substr(aRoot.length + 1) : aPath; } exports.relative = relative; function strcmp(aStr1, aStr2) { var s1 = aStr1 || ""; var s2 = aStr2 || ""; return (s1 > s2) - (s1 < s2); } /** * Comparator between two mappings where the original positions are compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same original source/line/column, but different generated * line and column the same. Useful when searching for a mapping with a * stubbed out mapping. */ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { var cmp; cmp = strcmp(mappingA.source, mappingB.source); if (cmp) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp || onlyCompareOriginal) { return cmp; } cmp = strcmp(mappingA.name, mappingB.name); if (cmp) { return cmp; } cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp) { return cmp; } return mappingA.generatedColumn - mappingB.generatedColumn; }; exports.compareByOriginalPositions = compareByOriginalPositions; /** * Comparator between two mappings where the generated positions are * compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same generated line and column, but different * source/name/original line and column the same. Useful when searching for a * mapping with a stubbed out mapping. */ function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) { var cmp; cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp || onlyCompareGenerated) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp) { return cmp; } return strcmp(mappingA.name, mappingB.name); }; exports.compareByGeneratedPositions = compareByGeneratedPositions; }); },{"amdefine":19}],19:[function(_dereq_,module,exports){ (function (process,__filename){ /** vim: et:ts=4:sw=4:sts=4 * @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/amdefine for details */ /*jslint node: true */ /*global module, process */ 'use strict'; /** * Creates a define for node. * @param {Object} module the "module" object that is defined by Node for the * current module. * @param {Function} [requireFn]. Node's require function for the current module. * It only needs to be passed in Node versions before 0.5, when module.require * did not exist. * @returns {Function} a define function that is usable for the current node * module. */ function amdefine(module, requireFn) { 'use strict'; var defineCache = {}, loaderCache = {}, alreadyCalled = false, path = _dereq_('path'), makeRequire, stringRequire; /** * Trims the . and .. from an array of path segments. * It will keep a leading path segment if a .. will become * the first path segment, to help with module name lookups, * which act like paths, but can be remapped. But the end result, * all paths that use this function should look normalized. * NOTE: this method MODIFIES the input array. * @param {Array} ary the array of path segments. */ function trimDots(ary) { var i, part; for (i = 0; ary[i]; i+= 1) { part = ary[i]; if (part === '.') { ary.splice(i, 1); i -= 1; } else if (part === '..') { if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { //End of the line. Keep at least one non-dot //path segment at the front so it can be mapped //correctly to disk. Otherwise, there is likely //no path mapping for a path starting with '..'. //This can still fail, but catches the most reasonable //uses of .. break; } else if (i > 0) { ary.splice(i - 1, 2); i -= 2; } } } } function normalize(name, baseName) { var baseParts; //Adjust any relative paths. if (name && name.charAt(0) === '.') { //If have a base name, try to normalize against it, //otherwise, assume it is a top-level require that will //be relative to baseUrl in the end. if (baseName) { baseParts = baseName.split('/'); baseParts = baseParts.slice(0, baseParts.length - 1); baseParts = baseParts.concat(name.split('/')); trimDots(baseParts); name = baseParts.join('/'); } } return name; } /** * Create the normalize() function passed to a loader plugin's * normalize method. */ function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(id) { function load(value) { loaderCache[id] = value; } load.fromText = function (id, text) { //This one is difficult because the text can/probably uses //define, and any relative paths and requires should be relative //to that id was it would be found on disk. But this would require //bootstrapping a module/require fairly deeply from node core. //Not sure how best to go about that yet. throw new Error('amdefine does not implement load.fromText'); }; return load; } makeRequire = function (systemRequire, exports, module, relId) { function amdRequire(deps, callback) { if (typeof deps === 'string') { //Synchronous, single module require('') return stringRequire(systemRequire, exports, module, deps, relId); } else { //Array of dependencies with a callback. //Convert the dependencies to modules. deps = deps.map(function (depName) { return stringRequire(systemRequire, exports, module, depName, relId); }); //Wait for next tick to call back the require call. process.nextTick(function () { callback.apply(null, deps); }); } } amdRequire.toUrl = function (filePath) { if (filePath.indexOf('.') === 0) { return normalize(filePath, path.dirname(module.filename)); } else { return filePath; } }; return amdRequire; }; //Favor explicit value, passed in if the module wants to support Node 0.4. requireFn = requireFn || function req() { return module.require.apply(module, arguments); }; function runFactory(id, deps, factory) { var r, e, m, result; if (id) { e = loaderCache[id] = {}; m = { id: id, uri: __filename, exports: e }; r = makeRequire(requireFn, e, m, id); } else { //Only support one define call per file if (alreadyCalled) { throw new Error('amdefine with no module ID cannot be called more than once per file.'); } alreadyCalled = true; //Use the real variables from node //Use module.exports for exports, since //the exports in here is amdefine exports. e = module.exports; m = module; r = makeRequire(requireFn, e, m, module.id); } //If there are dependencies, they are strings, so need //to convert them to dependency values. if (deps) { deps = deps.map(function (depName) { return r(depName); }); } //Call the factory with the right dependencies. if (typeof factory === 'function') { result = factory.apply(m.exports, deps); } else { result = factory; } if (result !== undefined) { m.exports = result; if (id) { loaderCache[id] = m.exports; } } } stringRequire = function (systemRequire, exports, module, id, relId) { //Split the ID by a ! so that var index = id.indexOf('!'), originalId = id, prefix, plugin; if (index === -1) { id = normalize(id, relId); //Straight module lookup. If it is one of the special dependencies, //deal with it, otherwise, delegate to node. if (id === 'require') { return makeRequire(systemRequire, exports, module, relId); } else if (id === 'exports') { return exports; } else if (id === 'module') { return module; } else if (loaderCache.hasOwnProperty(id)) { return loaderCache[id]; } else if (defineCache[id]) { runFactory.apply(null, defineCache[id]); return loaderCache[id]; } else { if(systemRequire) { return systemRequire(originalId); } else { throw new Error('No module with ID: ' + id); } } } else { //There is a plugin in play. prefix = id.substring(0, index); id = id.substring(index + 1, id.length); plugin = stringRequire(systemRequire, exports, module, prefix, relId); if (plugin.normalize) { id = plugin.normalize(id, makeNormalize(relId)); } else { //Normalize the ID normally. id = normalize(id, relId); } if (loaderCache[id]) { return loaderCache[id]; } else { plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {}); return loaderCache[id]; } } }; //Create a define function specific to the module asking for amdefine. function define(id, deps, factory) { if (Array.isArray(id)) { factory = deps; deps = id; id = undefined; } else if (typeof id !== 'string') { factory = id; id = deps = undefined; } if (deps && !Array.isArray(deps)) { factory = deps; deps = undefined; } if (!deps) { deps = ['require', 'exports', 'module']; } //Set up properties for this module. If an ID, then use //internal cache. If no ID, then use the external variables //for this node module. if (id) { //Put the module in deep freeze until there is a //require call for it. defineCache[id] = [id, deps, factory]; } else { runFactory(id, deps, factory); } } //define.require, which has access to all the values in the //cache. Useful for AMD modules that all have IDs in the file, //but need to finally export a value to node based on one of those //IDs. define.require = function (id) { if (loaderCache[id]) { return loaderCache[id]; } if (defineCache[id]) { runFactory.apply(null, defineCache[id]); return loaderCache[id]; } }; define.amd = {}; return define; } module.exports = amdefine; }).call(this,_dereq_('_process'),"/node_modules/jstransform/node_modules/source-map/node_modules/amdefine/amdefine.js") },{"_process":7,"path":6}],20:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ var docblockRe = /^\s*(\/\*\*(.|\r?\n)*?\*\/)/; var ltrimRe = /^\s*/; /** * @param {String} contents * @return {String} */ function extract(contents) { var match = contents.match(docblockRe); if (match) { return match[0].replace(ltrimRe, '') || ''; } return ''; } var commentStartRe = /^\/\*\*?/; var commentEndRe = /\*+\/$/; var wsRe = /[\t ]+/g; var stringStartRe = /(\r?\n|^) *\*/g; var multilineRe = /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *([^@\r\n\s][^@\r\n]+?) *\r?\n/g; var propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g; /** * @param {String} contents * @return {Array} */ function parse(docblock) { docblock = docblock .replace(commentStartRe, '') .replace(commentEndRe, '') .replace(wsRe, ' ') .replace(stringStartRe, '$1'); // Normalize multi-line directives var prev = ''; while (prev != docblock) { prev = docblock; docblock = docblock.replace(multilineRe, "\n$1 $2\n"); } docblock = docblock.trim(); var result = []; var match; while (match = propertyRe.exec(docblock)) { result.push([match[1], match[2]]); } return result; } /** * Same as parse but returns an object of prop: value instead of array of paris * If a property appers more than once the last one will be returned * * @param {String} contents * @return {Object} */ function parseAsObject(docblock) { var pairs = parse(docblock); var result = {}; for (var i = 0; i < pairs.length; i++) { result[pairs[i][0]] = pairs[i][1]; } return result; } exports.extract = extract; exports.parse = parse; exports.parseAsObject = parseAsObject; },{}],21:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*jslint node: true*/ "use strict"; var esprima = _dereq_('esprima-fb'); var utils = _dereq_('./utils'); var getBoundaryNode = utils.getBoundaryNode; var declareIdentInScope = utils.declareIdentInLocalScope; var initScopeMetadata = utils.initScopeMetadata; var Syntax = esprima.Syntax; /** * @param {object} node * @param {object} parentNode * @return {boolean} */ function _nodeIsClosureScopeBoundary(node, parentNode) { if (node.type === Syntax.Program) { return true; } var parentIsFunction = parentNode.type === Syntax.FunctionDeclaration || parentNode.type === Syntax.FunctionExpression || parentNode.type === Syntax.ArrowFunctionExpression; return node.type === Syntax.BlockStatement && parentIsFunction; } function _nodeIsBlockScopeBoundary(node, parentNode) { if (node.type === Syntax.Program) { return false; } return node.type === Syntax.BlockStatement && parentNode.type === Syntax.CatchClause; } /** * @param {object} node * @param {array} path * @param {object} state */ function traverse(node, path, state) { // Create a scope stack entry if this is the first node we've encountered in // its local scope var parentNode = path[0]; if (!Array.isArray(node) && state.localScope.parentNode !== parentNode) { if (_nodeIsClosureScopeBoundary(node, parentNode)) { var scopeIsStrict = state.scopeIsStrict || node.body.length > 0 && node.body[0].type === Syntax.ExpressionStatement && node.body[0].expression.type === Syntax.Literal && node.body[0].expression.value === 'use strict'; if (node.type === Syntax.Program) { state = utils.updateState(state, { scopeIsStrict: scopeIsStrict }); } else { state = utils.updateState(state, { localScope: { parentNode: parentNode, parentScope: state.localScope, identifiers: {}, tempVarIndex: 0 }, scopeIsStrict: scopeIsStrict }); // All functions have an implicit 'arguments' object in scope declareIdentInScope('arguments', initScopeMetadata(node), state); // Include function arg identifiers in the scope boundaries of the // function if (parentNode.params.length > 0) { var param; for (var i = 0; i < parentNode.params.length; i++) { param = parentNode.params[i]; if (param.type === Syntax.Identifier) { declareIdentInScope( param.name, initScopeMetadata(parentNode), state ); } } } // Named FunctionExpressions scope their name within the body block of // themselves only if (parentNode.type === Syntax.FunctionExpression && parentNode.id) { var metaData = initScopeMetadata(parentNode, path.parentNodeslice, parentNode); declareIdentInScope(parentNode.id.name, metaData, state); } } // Traverse and find all local identifiers in this closure first to // account for function/variable declaration hoisting collectClosureIdentsAndTraverse(node, path, state); } if (_nodeIsBlockScopeBoundary(node, parentNode)) { state = utils.updateState(state, { localScope: { parentNode: parentNode, parentScope: state.localScope, identifiers: {} } }); if (parentNode.type === Syntax.CatchClause) { declareIdentInScope( parentNode.param.name, initScopeMetadata(parentNode), state ); } collectBlockIdentsAndTraverse(node, path, state); } } // Only catchup() before and after traversing a child node function traverser(node, path, state) { node.range && utils.catchup(node.range[0], state); traverse(node, path, state); node.range && utils.catchup(node.range[1], state); } utils.analyzeAndTraverse(walker, traverser, node, path, state); } function collectClosureIdentsAndTraverse(node, path, state) { utils.analyzeAndTraverse( visitLocalClosureIdentifiers, collectClosureIdentsAndTraverse, node, path, state ); } function collectBlockIdentsAndTraverse(node, path, state) { utils.analyzeAndTraverse( visitLocalBlockIdentifiers, collectBlockIdentsAndTraverse, node, path, state ); } function visitLocalClosureIdentifiers(node, path, state) { var metaData; switch (node.type) { case Syntax.FunctionExpression: // Function expressions don't get their names (if there is one) added to // the closure scope they're defined in return false; case Syntax.ClassDeclaration: case Syntax.ClassExpression: case Syntax.FunctionDeclaration: if (node.id) { metaData = initScopeMetadata(getBoundaryNode(path), path.slice(), node); declareIdentInScope(node.id.name, metaData, state); } return false; case Syntax.VariableDeclarator: // Variables have function-local scope if (path[0].kind === 'var') { metaData = initScopeMetadata(getBoundaryNode(path), path.slice(), node); declareIdentInScope(node.id.name, metaData, state); } break; } } function visitLocalBlockIdentifiers(node, path, state) { // TODO: Support 'let' here...maybe...one day...or something... if (node.type === Syntax.CatchClause) { return false; } } function walker(node, path, state) { var visitors = state.g.visitors; for (var i = 0; i < visitors.length; i++) { if (visitors[i].test(node, path, state)) { return visitors[i](traverse, node, path, state); } } } var _astCache = {}; /** * Applies all available transformations to the source * @param {array} visitors * @param {string} source * @param {?object} options * @return {object} */ function transform(visitors, source, options) { options = options || {}; var ast; try { var cachedAst = _astCache[source]; ast = cachedAst || (_astCache[source] = esprima.parse(source, { comment: true, loc: true, range: true })); } catch (e) { e.message = 'Parse Error: ' + e.message; throw e; } var state = utils.createState(source, ast, options); state.g.visitors = visitors; if (options.sourceMap) { var SourceMapGenerator = _dereq_('source-map').SourceMapGenerator; state.g.sourceMap = new SourceMapGenerator({file: options.filename || 'transformed.js'}); } traverse(ast, [], state); utils.catchup(source.length, state); var ret = {code: state.g.buffer, extra: state.g.extra}; if (options.sourceMap) { ret.sourceMap = state.g.sourceMap; ret.sourceMapFilename = options.filename || 'source.js'; } return ret; } exports.transform = transform; exports.Syntax = Syntax; },{"./utils":22,"esprima-fb":9,"source-map":10}],22:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*jslint node: true*/ var Syntax = _dereq_('esprima-fb').Syntax; var leadingIndentRegexp = /(^|\n)( {2}|\t)/g; var nonWhiteRegexp = /(\S)/g; /** * A `state` object represents the state of the parser. It has "local" and * "global" parts. Global contains parser position, source, etc. Local contains * scope based properties like current class name. State should contain all the * info required for transformation. It's the only mandatory object that is * being passed to every function in transform chain. * * @param {string} source * @param {object} transformOptions * @return {object} */ function createState(source, rootNode, transformOptions) { return { /** * A tree representing the current local scope (and its lexical scope chain) * Useful for tracking identifiers from parent scopes, etc. * @type {Object} */ localScope: { parentNode: rootNode, parentScope: null, identifiers: {}, tempVarIndex: 0 }, /** * The name (and, if applicable, expression) of the super class * @type {Object} */ superClass: null, /** * The namespace to use when munging identifiers * @type {String} */ mungeNamespace: '', /** * Ref to the node for the current MethodDefinition * @type {Object} */ methodNode: null, /** * Ref to the node for the FunctionExpression of the enclosing * MethodDefinition * @type {Object} */ methodFuncNode: null, /** * Name of the enclosing class * @type {String} */ className: null, /** * Whether we're currently within a `strict` scope * @type {Bool} */ scopeIsStrict: null, /** * Indentation offset * @type {Number} */ indentBy: 0, /** * Global state (not affected by updateState) * @type {Object} */ g: { /** * A set of general options that transformations can consider while doing * a transformation: * * - minify * Specifies that transformation steps should do their best to minify * the output source when possible. This is useful for places where * minification optimizations are possible with higher-level context * info than what jsxmin can provide. * * For example, the ES6 class transform will minify munged private * variables if this flag is set. */ opts: transformOptions, /** * Current position in the source code * @type {Number} */ position: 0, /** * Auxiliary data to be returned by transforms * @type {Object} */ extra: {}, /** * Buffer containing the result * @type {String} */ buffer: '', /** * Source that is being transformed * @type {String} */ source: source, /** * Cached parsed docblock (see getDocblock) * @type {object} */ docblock: null, /** * Whether the thing was used * @type {Boolean} */ tagNamespaceUsed: false, /** * If using bolt xjs transformation * @type {Boolean} */ isBolt: undefined, /** * Whether to record source map (expensive) or not * @type {SourceMapGenerator|null} */ sourceMap: null, /** * Filename of the file being processed. Will be returned as a source * attribute in the source map */ sourceMapFilename: 'source.js', /** * Only when source map is used: last line in the source for which * source map was generated * @type {Number} */ sourceLine: 1, /** * Only when source map is used: last line in the buffer for which * source map was generated * @type {Number} */ bufferLine: 1, /** * The top-level Program AST for the original file. */ originalProgramAST: null, sourceColumn: 0, bufferColumn: 0 } }; } /** * Updates a copy of a given state with "update" and returns an updated state. * * @param {object} state * @param {object} update * @return {object} */ function updateState(state, update) { var ret = Object.create(state); Object.keys(update).forEach(function(updatedKey) { ret[updatedKey] = update[updatedKey]; }); return ret; } /** * Given a state fill the resulting buffer from the original source up to * the end * * @param {number} end * @param {object} state * @param {?function} contentTransformer Optional callback to transform newly * added content. */ function catchup(end, state, contentTransformer) { if (end < state.g.position) { // cannot move backwards return; } var source = state.g.source.substring(state.g.position, end); var transformed = updateIndent(source, state); if (state.g.sourceMap && transformed) { // record where we are state.g.sourceMap.addMapping({ generated: { line: state.g.bufferLine, column: state.g.bufferColumn }, original: { line: state.g.sourceLine, column: state.g.sourceColumn }, source: state.g.sourceMapFilename }); // record line breaks in transformed source var sourceLines = source.split('\n'); var transformedLines = transformed.split('\n'); // Add line break mappings between last known mapping and the end of the // added piece. So for the code piece // (foo, bar); // > var x = 2; // > var b = 3; // var c = // only add lines marked with ">": 2, 3. for (var i = 1; i < sourceLines.length - 1; i++) { state.g.sourceMap.addMapping({ generated: { line: state.g.bufferLine, column: 0 }, original: { line: state.g.sourceLine, column: 0 }, source: state.g.sourceMapFilename }); state.g.sourceLine++; state.g.bufferLine++; } // offset for the last piece if (sourceLines.length > 1) { state.g.sourceLine++; state.g.bufferLine++; state.g.sourceColumn = 0; state.g.bufferColumn = 0; } state.g.sourceColumn += sourceLines[sourceLines.length - 1].length; state.g.bufferColumn += transformedLines[transformedLines.length - 1].length; } state.g.buffer += contentTransformer ? contentTransformer(transformed) : transformed; state.g.position = end; } /** * Returns original source for an AST node. * @param {object} node * @param {object} state * @return {string} */ function getNodeSourceText(node, state) { return state.g.source.substring(node.range[0], node.range[1]); } function replaceNonWhite(value) { return value.replace(nonWhiteRegexp, ' '); } /** * Removes all non-whitespace characters */ function stripNonWhite(value) { return value.replace(nonWhiteRegexp, ''); } /** * Catches up as `catchup` but replaces non-whitespace chars with spaces. */ function catchupWhiteOut(end, state) { catchup(end, state, replaceNonWhite); } /** * Catches up as `catchup` but removes all non-whitespace characters. */ function catchupWhiteSpace(end, state) { catchup(end, state, stripNonWhite); } /** * Removes all non-newline characters */ var reNonNewline = /[^\n]/g; function stripNonNewline(value) { return value.replace(reNonNewline, function() { return ''; }); } /** * Catches up as `catchup` but removes all non-newline characters. * * Equivalent to appending as many newlines as there are in the original source * between the current position and `end`. */ function catchupNewlines(end, state) { catchup(end, state, stripNonNewline); } /** * Same as catchup but does not touch the buffer * * @param {number} end * @param {object} state */ function move(end, state) { // move the internal cursors if (state.g.sourceMap) { if (end < state.g.position) { state.g.position = 0; state.g.sourceLine = 1; state.g.sourceColumn = 0; } var source = state.g.source.substring(state.g.position, end); var sourceLines = source.split('\n'); if (sourceLines.length > 1) { state.g.sourceLine += sourceLines.length - 1; state.g.sourceColumn = 0; } state.g.sourceColumn += sourceLines[sourceLines.length - 1].length; } state.g.position = end; } /** * Appends a string of text to the buffer * * @param {string} str * @param {object} state */ function append(str, state) { if (state.g.sourceMap && str) { state.g.sourceMap.addMapping({ generated: { line: state.g.bufferLine, column: state.g.bufferColumn }, original: { line: state.g.sourceLine, column: state.g.sourceColumn }, source: state.g.sourceMapFilename }); var transformedLines = str.split('\n'); if (transformedLines.length > 1) { state.g.bufferLine += transformedLines.length - 1; state.g.bufferColumn = 0; } state.g.bufferColumn += transformedLines[transformedLines.length - 1].length; } state.g.buffer += str; } /** * Update indent using state.indentBy property. Indent is measured in * double spaces. Updates a single line only. * * @param {string} str * @param {object} state * @return {string} */ function updateIndent(str, state) { var indentBy = state.indentBy; if (indentBy < 0) { for (var i = 0; i < -indentBy; i++) { str = str.replace(leadingIndentRegexp, '$1'); } } else { for (var i = 0; i < indentBy; i++) { str = str.replace(leadingIndentRegexp, '$1$2$2'); } } return str; } /** * Calculates indent from the beginning of the line until "start" or the first * character before start. * @example * " foo.bar()" * ^ * start * indent will be " " * * @param {number} start * @param {object} state * @return {string} */ function indentBefore(start, state) { var end = start; start = start - 1; while (start > 0 && state.g.source[start] != '\n') { if (!state.g.source[start].match(/[ \t]/)) { end = start; } start--; } return state.g.source.substring(start + 1, end); } function getDocblock(state) { if (!state.g.docblock) { var docblock = _dereq_('./docblock'); state.g.docblock = docblock.parseAsObject(docblock.extract(state.g.source)); } return state.g.docblock; } function identWithinLexicalScope(identName, state, stopBeforeNode) { var currScope = state.localScope; while (currScope) { if (currScope.identifiers[identName] !== undefined) { return true; } if (stopBeforeNode && currScope.parentNode === stopBeforeNode) { break; } currScope = currScope.parentScope; } return false; } function identInLocalScope(identName, state) { return state.localScope.identifiers[identName] !== undefined; } /** * @param {object} boundaryNode * @param {?array} path * @return {?object} node */ function initScopeMetadata(boundaryNode, path, node) { return { boundaryNode: boundaryNode, bindingPath: path, bindingNode: node }; } function declareIdentInLocalScope(identName, metaData, state) { state.localScope.identifiers[identName] = { boundaryNode: metaData.boundaryNode, path: metaData.bindingPath, node: metaData.bindingNode, state: Object.create(state) }; } function getLexicalBindingMetadata(identName, state) { return state.localScope.identifiers[identName]; } /** * Apply the given analyzer function to the current node. If the analyzer * doesn't return false, traverse each child of the current node using the given * traverser function. * * @param {function} analyzer * @param {function} traverser * @param {object} node * @param {array} path * @param {object} state */ function analyzeAndTraverse(analyzer, traverser, node, path, state) { if (node.type) { if (analyzer(node, path, state) === false) { return; } path.unshift(node); } getOrderedChildren(node).forEach(function(child) { traverser(child, path, state); }); node.type && path.shift(); } /** * It is crucial that we traverse in order, or else catchup() on a later * node that is processed out of order can move the buffer past a node * that we haven't handled yet, preventing us from modifying that node. * * This can happen when a node has multiple properties containing children. * For example, XJSElement nodes have `openingElement`, `closingElement` and * `children`. If we traverse `openingElement`, then `closingElement`, then * when we get to `children`, the buffer has already caught up to the end of * the closing element, after the children. * * This is basically a Schwartzian transform. Collects an array of children, * each one represented as [child, startIndex]; sorts the array by start * index; then traverses the children in that order. */ function getOrderedChildren(node) { var queue = []; for (var key in node) { if (node.hasOwnProperty(key)) { enqueueNodeWithStartIndex(queue, node[key]); } } queue.sort(function(a, b) { return a[1] - b[1]; }); return queue.map(function(pair) { return pair[0]; }); } /** * Helper function for analyzeAndTraverse which queues up all of the children * of the given node. * * Children can also be found in arrays, so we basically want to merge all of * those arrays together so we can sort them and then traverse the children * in order. * * One example is the Program node. It contains `body` and `comments`, both * arrays. Lexographically, comments are interspersed throughout the body * nodes, but esprima's AST groups them together. */ function enqueueNodeWithStartIndex(queue, node) { if (typeof node !== 'object' || node === null) { return; } if (node.range) { queue.push([node, node.range[0]]); } else if (Array.isArray(node)) { for (var ii = 0; ii < node.length; ii++) { enqueueNodeWithStartIndex(queue, node[ii]); } } } /** * Checks whether a node or any of its sub-nodes contains * a syntactic construct of the passed type. * @param {object} node - AST node to test. * @param {string} type - node type to lookup. */ function containsChildOfType(node, type) { return containsChildMatching(node, function(node) { return node.type === type; }); } function containsChildMatching(node, matcher) { var foundMatchingChild = false; function nodeTypeAnalyzer(node) { if (matcher(node) === true) { foundMatchingChild = true; return false; } } function nodeTypeTraverser(child, path, state) { if (!foundMatchingChild) { foundMatchingChild = containsChildMatching(child, matcher); } } analyzeAndTraverse( nodeTypeAnalyzer, nodeTypeTraverser, node, [] ); return foundMatchingChild; } var scopeTypes = {}; scopeTypes[Syntax.FunctionExpression] = true; scopeTypes[Syntax.FunctionDeclaration] = true; scopeTypes[Syntax.Program] = true; function getBoundaryNode(path) { for (var ii = 0; ii < path.length; ++ii) { if (scopeTypes[path[ii].type]) { return path[ii]; } } throw new Error( 'Expected to find a node with one of the following types in path:\n' + JSON.stringify(Object.keys(scopeTypes)) ); } function getTempVar(tempVarIndex) { return '$__' + tempVarIndex; } function getTempVarWithValue(tempVarIndex, tempVarValue) { return getTempVar(tempVarIndex) + '=' + tempVarValue; } exports.append = append; exports.catchup = catchup; exports.catchupWhiteOut = catchupWhiteOut; exports.catchupWhiteSpace = catchupWhiteSpace; exports.catchupNewlines = catchupNewlines; exports.containsChildMatching = containsChildMatching; exports.containsChildOfType = containsChildOfType; exports.createState = createState; exports.declareIdentInLocalScope = declareIdentInLocalScope; exports.getBoundaryNode = getBoundaryNode; exports.getDocblock = getDocblock; exports.getLexicalBindingMetadata = getLexicalBindingMetadata; exports.initScopeMetadata = initScopeMetadata; exports.identWithinLexicalScope = identWithinLexicalScope; exports.identInLocalScope = identInLocalScope; exports.indentBefore = indentBefore; exports.move = move; exports.scopeTypes = scopeTypes; exports.updateIndent = updateIndent; exports.updateState = updateState; exports.analyzeAndTraverse = analyzeAndTraverse; exports.getOrderedChildren = getOrderedChildren; exports.getNodeSourceText = getNodeSourceText; exports.getTempVar = getTempVar; exports.getTempVarWithValue = getTempVarWithValue; },{"./docblock":20,"esprima-fb":9}],23:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*global exports:true*/ /** * Desugars ES6 Arrow functions to ES3 function expressions. * If the function contains `this` expression -- automatically * binds the function to current value of `this`. * * Single parameter, simple expression: * * [1, 2, 3].map(x => x * x); * * [1, 2, 3].map(function(x) { return x * x; }); * * Several parameters, complex block: * * this.users.forEach((user, idx) => { * return this.isActive(idx) && this.send(user); * }); * * this.users.forEach(function(user, idx) { * return this.isActive(idx) && this.send(user); * }.bind(this)); * */ var restParamVisitors = _dereq_('./es6-rest-param-visitors'); var destructuringVisitors = _dereq_('./es6-destructuring-visitors'); var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); /** * @public */ function visitArrowFunction(traverse, node, path, state) { var notInExpression = (path[0].type === Syntax.ExpressionStatement); // Wrap a function into a grouping operator, if it's not // in the expression position. if (notInExpression) { utils.append('(', state); } utils.append('function', state); renderParams(traverse, node, path, state); // Skip arrow. utils.catchupWhiteSpace(node.body.range[0], state); var renderBody = node.body.type == Syntax.BlockStatement ? renderStatementBody : renderExpressionBody; path.unshift(node); renderBody(traverse, node, path, state); path.shift(); // Bind the function only if `this` value is used // inside it or inside any sub-expression. var containsBindingSyntax = utils.containsChildMatching(node.body, function(node) { return node.type === Syntax.ThisExpression || (node.type === Syntax.Identifier && node.name === "super"); }); if (containsBindingSyntax) { utils.append('.bind(this)', state); } utils.catchupWhiteSpace(node.range[1], state); // Close wrapper if not in the expression. if (notInExpression) { utils.append(')', state); } return false; } function renderParams(traverse, node, path, state) { // To preserve inline typechecking directives, we // distinguish between parens-free and paranthesized single param. if (isParensFreeSingleParam(node, state) || !node.params.length) { utils.append('(', state); } if (node.params.length !== 0) { path.unshift(node); traverse(node.params, path, state); path.unshift(); } utils.append(')', state); } function isParensFreeSingleParam(node, state) { return node.params.length === 1 && state.g.source[state.g.position] !== '('; } function renderExpressionBody(traverse, node, path, state) { // Wrap simple expression bodies into a block // with explicit return statement. utils.append('{', state); // Special handling of rest param. if (node.rest) { utils.append( restParamVisitors.renderRestParamSetup(node, state), state ); } // Special handling of destructured params. destructuringVisitors.renderDestructuredComponents( node, utils.updateState(state, { localScope: { parentNode: state.parentNode, parentScope: state.parentScope, identifiers: state.identifiers, tempVarIndex: 0 } }) ); utils.append('return ', state); renderStatementBody(traverse, node, path, state); utils.append(';}', state); } function renderStatementBody(traverse, node, path, state) { traverse(node.body, path, state); utils.catchup(node.body.range[1], state); } visitArrowFunction.test = function(node, path, state) { return node.type === Syntax.ArrowFunctionExpression; }; exports.visitorList = [ visitArrowFunction ]; },{"../src/utils":22,"./es6-destructuring-visitors":25,"./es6-rest-param-visitors":28,"esprima-fb":9}],24:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*jslint node:true*/ /** * @typechecks */ 'use strict'; var base62 = _dereq_('base62'); var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); var reservedWordsHelper = _dereq_('./reserved-words-helper'); var declareIdentInLocalScope = utils.declareIdentInLocalScope; var initScopeMetadata = utils.initScopeMetadata; var SUPER_PROTO_IDENT_PREFIX = '____SuperProtoOf'; var _anonClassUUIDCounter = 0; var _mungedSymbolMaps = {}; function resetSymbols() { _anonClassUUIDCounter = 0; _mungedSymbolMaps = {}; } /** * Used to generate a unique class for use with code-gens for anonymous class * expressions. * * @param {object} state * @return {string} */ function _generateAnonymousClassName(state) { var mungeNamespace = state.mungeNamespace || ''; return '____Class' + mungeNamespace + base62.encode(_anonClassUUIDCounter++); } /** * Given an identifier name, munge it using the current state's mungeNamespace. * * @param {string} identName * @param {object} state * @return {string} */ function _getMungedName(identName, state) { var mungeNamespace = state.mungeNamespace; var shouldMinify = state.g.opts.minify; if (shouldMinify) { if (!_mungedSymbolMaps[mungeNamespace]) { _mungedSymbolMaps[mungeNamespace] = { symbolMap: {}, identUUIDCounter: 0 }; } var symbolMap = _mungedSymbolMaps[mungeNamespace].symbolMap; if (!symbolMap[identName]) { symbolMap[identName] = base62.encode(_mungedSymbolMaps[mungeNamespace].identUUIDCounter++); } identName = symbolMap[identName]; } return '$' + mungeNamespace + identName; } /** * Extracts super class information from a class node. * * Information includes name of the super class and/or the expression string * (if extending from an expression) * * @param {object} node * @param {object} state * @return {object} */ function _getSuperClassInfo(node, state) { var ret = { name: null, expression: null }; if (node.superClass) { if (node.superClass.type === Syntax.Identifier) { ret.name = node.superClass.name; } else { // Extension from an expression ret.name = _generateAnonymousClassName(state); ret.expression = state.g.source.substring( node.superClass.range[0], node.superClass.range[1] ); } } return ret; } /** * Used with .filter() to find the constructor method in a list of * MethodDefinition nodes. * * @param {object} classElement * @return {boolean} */ function _isConstructorMethod(classElement) { return classElement.type === Syntax.MethodDefinition && classElement.key.type === Syntax.Identifier && classElement.key.name === 'constructor'; } /** * @param {object} node * @param {object} state * @return {boolean} */ function _shouldMungeIdentifier(node, state) { return ( !!state.methodFuncNode && !utils.getDocblock(state).hasOwnProperty('preventMunge') && /^_(?!_)/.test(node.name) ); } /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitClassMethod(traverse, node, path, state) { if (!state.g.opts.es5 && (node.kind === 'get' || node.kind === 'set')) { throw new Error( 'This transform does not support ' + node.kind + 'ter methods for ES6 ' + 'classes. (line: ' + node.loc.start.line + ', col: ' + node.loc.start.column + ')' ); } state = utils.updateState(state, { methodNode: node }); utils.catchup(node.range[0], state); path.unshift(node); traverse(node.value, path, state); path.shift(); return false; } visitClassMethod.test = function(node, path, state) { return node.type === Syntax.MethodDefinition; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitClassFunctionExpression(traverse, node, path, state) { var methodNode = path[0]; var isGetter = methodNode.kind === 'get'; var isSetter = methodNode.kind === 'set'; state = utils.updateState(state, { methodFuncNode: node }); if (methodNode.key.name === 'constructor') { utils.append('function ' + state.className, state); } else { var methodAccessor; var prototypeOrStatic = methodNode["static"] ? '' : '.prototype'; var objectAccessor = state.className + prototypeOrStatic; if (methodNode.key.type === Syntax.Identifier) { // foo() {} methodAccessor = methodNode.key.name; if (_shouldMungeIdentifier(methodNode.key, state)) { methodAccessor = _getMungedName(methodAccessor, state); } if (isGetter || isSetter) { methodAccessor = JSON.stringify(methodAccessor); } else if (reservedWordsHelper.isReservedWord(methodAccessor)) { methodAccessor = '[' + JSON.stringify(methodAccessor) + ']'; } else { methodAccessor = '.' + methodAccessor; } } else if (methodNode.key.type === Syntax.Literal) { // 'foo bar'() {} | get 'foo bar'() {} | set 'foo bar'() {} methodAccessor = JSON.stringify(methodNode.key.value); if (!(isGetter || isSetter)) { methodAccessor = '[' + methodAccessor + ']'; } } if (isSetter || isGetter) { utils.append( 'Object.defineProperty(' + objectAccessor + ',' + methodAccessor + ',' + '{enumerable:true,configurable:true,' + methodNode.kind + ':function', state ); } else { utils.append( objectAccessor + methodAccessor + '=function' + (node.generator ? '*' : ''), state ); } } utils.move(methodNode.key.range[1], state); utils.append('(', state); var params = node.params; if (params.length > 0) { utils.catchupNewlines(params[0].range[0], state); for (var i = 0; i < params.length; i++) { utils.catchup(node.params[i].range[0], state); path.unshift(node); traverse(params[i], path, state); path.shift(); } } utils.append(')', state); utils.catchupWhiteSpace(node.body.range[0], state); utils.append('{', state); if (!state.scopeIsStrict) { utils.append('"use strict";', state); state = utils.updateState(state, { scopeIsStrict: true }); } utils.move(node.body.range[0] + '{'.length, state); path.unshift(node); traverse(node.body, path, state); path.shift(); utils.catchup(node.body.range[1], state); if (methodNode.key.name !== 'constructor') { if (isGetter || isSetter) { utils.append('})', state); } utils.append(';', state); } return false; } visitClassFunctionExpression.test = function(node, path, state) { return node.type === Syntax.FunctionExpression && path[0].type === Syntax.MethodDefinition; }; function visitClassMethodParam(traverse, node, path, state) { var paramName = node.name; if (_shouldMungeIdentifier(node, state)) { paramName = _getMungedName(node.name, state); } utils.append(paramName, state); utils.move(node.range[1], state); } visitClassMethodParam.test = function(node, path, state) { if (!path[0] || !path[1]) { return; } var parentFuncExpr = path[0]; var parentClassMethod = path[1]; return parentFuncExpr.type === Syntax.FunctionExpression && parentClassMethod.type === Syntax.MethodDefinition && node.type === Syntax.Identifier; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function _renderClassBody(traverse, node, path, state) { var className = state.className; var superClass = state.superClass; // Set up prototype of constructor on same line as `extends` for line-number // preservation. This relies on function-hoisting if a constructor function is // defined in the class body. if (superClass.name) { // If the super class is an expression, we need to memoize the output of the // expression into the generated class name variable and use that to refer // to the super class going forward. Example: // // class Foo extends mixin(Bar, Baz) {} // --transforms to-- // function Foo() {} var ____Class0Blah = mixin(Bar, Baz); if (superClass.expression !== null) { utils.append( 'var ' + superClass.name + '=' + superClass.expression + ';', state ); } var keyName = superClass.name + '____Key'; var keyNameDeclarator = ''; if (!utils.identWithinLexicalScope(keyName, state)) { keyNameDeclarator = 'var '; declareIdentInLocalScope(keyName, initScopeMetadata(node), state); } utils.append( 'for(' + keyNameDeclarator + keyName + ' in ' + superClass.name + '){' + 'if(' + superClass.name + '.hasOwnProperty(' + keyName + ')){' + className + '[' + keyName + ']=' + superClass.name + '[' + keyName + '];' + '}' + '}', state ); var superProtoIdentStr = SUPER_PROTO_IDENT_PREFIX + superClass.name; if (!utils.identWithinLexicalScope(superProtoIdentStr, state)) { utils.append( 'var ' + superProtoIdentStr + '=' + superClass.name + '===null?' + 'null:' + superClass.name + '.prototype;', state ); declareIdentInLocalScope(superProtoIdentStr, initScopeMetadata(node), state); } utils.append( className + '.prototype=Object.create(' + superProtoIdentStr + ');', state ); utils.append( className + '.prototype.constructor=' + className + ';', state ); utils.append( className + '.__superConstructor__=' + superClass.name + ';', state ); } // If there's no constructor method specified in the class body, create an // empty constructor function at the top (same line as the class keyword) if (!node.body.body.filter(_isConstructorMethod).pop()) { utils.append('function ' + className + '(){', state); if (!state.scopeIsStrict) { utils.append('"use strict";', state); } if (superClass.name) { utils.append( 'if(' + superClass.name + '!==null){' + superClass.name + '.apply(this,arguments);}', state ); } utils.append('}', state); } utils.move(node.body.range[0] + '{'.length, state); traverse(node.body, path, state); utils.catchupWhiteSpace(node.range[1], state); } /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitClassDeclaration(traverse, node, path, state) { var className = node.id.name; var superClass = _getSuperClassInfo(node, state); state = utils.updateState(state, { mungeNamespace: className, className: className, superClass: superClass }); _renderClassBody(traverse, node, path, state); return false; } visitClassDeclaration.test = function(node, path, state) { return node.type === Syntax.ClassDeclaration; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitClassExpression(traverse, node, path, state) { var className = node.id && node.id.name || _generateAnonymousClassName(state); var superClass = _getSuperClassInfo(node, state); utils.append('(function(){', state); state = utils.updateState(state, { mungeNamespace: className, className: className, superClass: superClass }); _renderClassBody(traverse, node, path, state); utils.append('return ' + className + ';})()', state); return false; } visitClassExpression.test = function(node, path, state) { return node.type === Syntax.ClassExpression; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitPrivateIdentifier(traverse, node, path, state) { utils.append(_getMungedName(node.name, state), state); utils.move(node.range[1], state); } visitPrivateIdentifier.test = function(node, path, state) { if (node.type === Syntax.Identifier && _shouldMungeIdentifier(node, state)) { // Always munge non-computed properties of MemberExpressions // (a la preventing access of properties of unowned objects) if (path[0].type === Syntax.MemberExpression && path[0].object !== node && path[0].computed === false) { return true; } // Always munge identifiers that were declared within the method function // scope if (utils.identWithinLexicalScope(node.name, state, state.methodFuncNode)) { return true; } // Always munge private keys on object literals defined within a method's // scope. if (path[0].type === Syntax.Property && path[1].type === Syntax.ObjectExpression) { return true; } // Always munge function parameters if (path[0].type === Syntax.FunctionExpression || path[0].type === Syntax.FunctionDeclaration || path[0].type === Syntax.ArrowFunctionExpression) { for (var i = 0; i < path[0].params.length; i++) { if (path[0].params[i] === node) { return true; } } } } return false; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitSuperCallExpression(traverse, node, path, state) { var superClassName = state.superClass.name; if (node.callee.type === Syntax.Identifier) { if (_isConstructorMethod(state.methodNode)) { utils.append(superClassName + '.call(', state); } else { var protoProp = SUPER_PROTO_IDENT_PREFIX + superClassName; if (state.methodNode.key.type === Syntax.Identifier) { protoProp += '.' + state.methodNode.key.name; } else if (state.methodNode.key.type === Syntax.Literal) { protoProp += '[' + JSON.stringify(state.methodNode.key.value) + ']'; } utils.append(protoProp + ".call(", state); } utils.move(node.callee.range[1], state); } else if (node.callee.type === Syntax.MemberExpression) { utils.append(SUPER_PROTO_IDENT_PREFIX + superClassName, state); utils.move(node.callee.object.range[1], state); if (node.callee.computed) { // ["a" + "b"] utils.catchup(node.callee.property.range[1] + ']'.length, state); } else { // .ab utils.append('.' + node.callee.property.name, state); } utils.append('.call(', state); utils.move(node.callee.range[1], state); } utils.append('this', state); if (node.arguments.length > 0) { utils.append(',', state); utils.catchupWhiteSpace(node.arguments[0].range[0], state); traverse(node.arguments, path, state); } utils.catchupWhiteSpace(node.range[1], state); utils.append(')', state); return false; } visitSuperCallExpression.test = function(node, path, state) { if (state.superClass && node.type === Syntax.CallExpression) { var callee = node.callee; if (callee.type === Syntax.Identifier && callee.name === 'super' || callee.type == Syntax.MemberExpression && callee.object.name === 'super') { return true; } } return false; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitSuperMemberExpression(traverse, node, path, state) { var superClassName = state.superClass.name; utils.append(SUPER_PROTO_IDENT_PREFIX + superClassName, state); utils.move(node.object.range[1], state); } visitSuperMemberExpression.test = function(node, path, state) { return state.superClass && node.type === Syntax.MemberExpression && node.object.type === Syntax.Identifier && node.object.name === 'super'; }; exports.resetSymbols = resetSymbols; exports.visitorList = [ visitClassDeclaration, visitClassExpression, visitClassFunctionExpression, visitClassMethod, visitClassMethodParam, visitPrivateIdentifier, visitSuperCallExpression, visitSuperMemberExpression ]; },{"../src/utils":22,"./reserved-words-helper":32,"base62":8,"esprima-fb":9}],25:[function(_dereq_,module,exports){ /** * Copyright 2014 Facebook, 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. */ /*global exports:true*/ /** * Implements ES6 destructuring assignment and pattern matchng. * * function init({port, ip, coords: [x, y]}) { * return (x && y) ? {id, port} : {ip}; * }; * * function init($__0) { * var * port = $__0.port, * ip = $__0.ip, * $__1 = $__0.coords, * x = $__1[0], * y = $__1[1]; * return (x && y) ? {id, port} : {ip}; * } * * var x, {ip, port} = init({ip, port}); * * var x, $__0 = init({ip, port}), ip = $__0.ip, port = $__0.port; * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); var reservedWordsHelper = _dereq_('./reserved-words-helper'); var restParamVisitors = _dereq_('./es6-rest-param-visitors'); var restPropertyHelpers = _dereq_('./es7-rest-property-helpers'); // ------------------------------------------------------- // 1. Structured variable declarations. // // var [a, b] = [b, a]; // var {x, y} = {y, x}; // ------------------------------------------------------- function visitStructuredVariable(traverse, node, path, state) { // Allocate new temp for the pattern. utils.append(utils.getTempVar(state.localScope.tempVarIndex) + '=', state); // Skip the pattern and assign the init to the temp. utils.catchupWhiteSpace(node.init.range[0], state); traverse(node.init, path, state); utils.catchup(node.init.range[1], state); // Render the destructured data. utils.append(',' + getDestructuredComponents(node.id, state), state); state.localScope.tempVarIndex++; return false; } visitStructuredVariable.test = function(node, path, state) { return node.type === Syntax.VariableDeclarator && isStructuredPattern(node.id); }; function isStructuredPattern(node) { return node.type === Syntax.ObjectPattern || node.type === Syntax.ArrayPattern; } // Main function which does actual recursive destructuring // of nested complex structures. function getDestructuredComponents(node, state) { var tmpIndex = state.localScope.tempVarIndex; var components = []; var patternItems = getPatternItems(node); for (var idx = 0; idx < patternItems.length; idx++) { var item = patternItems[idx]; if (!item) { continue; } if (item.type === Syntax.SpreadElement) { // Spread/rest of an array. // TODO(dmitrys): support spread in the middle of a pattern // and also for function param patterns: [x, ...xs, y] components.push(item.argument.name + '=Array.prototype.slice.call(' + utils.getTempVar(tmpIndex) + ',' + idx + ')' ); continue; } if (item.type === Syntax.SpreadProperty) { var restExpression = restPropertyHelpers.renderRestExpression( utils.getTempVar(tmpIndex), patternItems ); components.push(item.argument.name + '=' + restExpression); continue; } // Depending on pattern type (Array or Object), we get // corresponding pattern item parts. var accessor = getPatternItemAccessor(node, item, tmpIndex, idx); var value = getPatternItemValue(node, item); // TODO(dmitrys): implement default values: {x, y=5} if (value.type === Syntax.Identifier) { // Simple pattern item. components.push(value.name + '=' + accessor); } else { // Complex sub-structure. components.push( utils.getTempVarWithValue(++state.localScope.tempVarIndex, accessor) + ',' + getDestructuredComponents(value, state) ); } } return components.join(','); } function getPatternItems(node) { return node.properties || node.elements; } function getPatternItemAccessor(node, patternItem, tmpIndex, idx) { var tmpName = utils.getTempVar(tmpIndex); if (node.type === Syntax.ObjectPattern) { if (reservedWordsHelper.isReservedWord(patternItem.key.name)) { return tmpName + '["' + patternItem.key.name + '"]'; } else if (patternItem.key.type === Syntax.Literal) { return tmpName + '[' + JSON.stringify(patternItem.key.value) + ']'; } else if (patternItem.key.type === Syntax.Identifier) { return tmpName + '.' + patternItem.key.name; } } else if (node.type === Syntax.ArrayPattern) { return tmpName + '[' + idx + ']'; } } function getPatternItemValue(node, patternItem) { return node.type === Syntax.ObjectPattern ? patternItem.value : patternItem; } // ------------------------------------------------------- // 2. Assignment expression. // // [a, b] = [b, a]; // ({x, y} = {y, x}); // ------------------------------------------------------- function visitStructuredAssignment(traverse, node, path, state) { var exprNode = node.expression; utils.append('var ' + utils.getTempVar(state.localScope.tempVarIndex) + '=', state); utils.catchupWhiteSpace(exprNode.right.range[0], state); traverse(exprNode.right, path, state); utils.catchup(exprNode.right.range[1], state); utils.append( ';' + getDestructuredComponents(exprNode.left, state) + ';', state ); utils.catchupWhiteSpace(node.range[1], state); state.localScope.tempVarIndex++; return false; } visitStructuredAssignment.test = function(node, path, state) { // We consider the expression statement rather than just assignment // expression to cover case with object patters which should be // wrapped in grouping operator: ({x, y} = {y, x}); return node.type === Syntax.ExpressionStatement && node.expression.type === Syntax.AssignmentExpression && isStructuredPattern(node.expression.left); }; // ------------------------------------------------------- // 3. Structured parameter. // // function foo({x, y}) { ... } // ------------------------------------------------------- function visitStructuredParameter(traverse, node, path, state) { utils.append(utils.getTempVar(getParamIndex(node, path)), state); utils.catchupWhiteSpace(node.range[1], state); return true; } function getParamIndex(paramNode, path) { var funcNode = path[0]; var tmpIndex = 0; for (var k = 0; k < funcNode.params.length; k++) { var param = funcNode.params[k]; if (param === paramNode) { break; } if (isStructuredPattern(param)) { tmpIndex++; } } return tmpIndex; } visitStructuredParameter.test = function(node, path, state) { return isStructuredPattern(node) && isFunctionNode(path[0]); }; function isFunctionNode(node) { return (node.type == Syntax.FunctionDeclaration || node.type == Syntax.FunctionExpression || node.type == Syntax.MethodDefinition || node.type == Syntax.ArrowFunctionExpression); } // ------------------------------------------------------- // 4. Function body for structured parameters. // // function foo({x, y}) { x; y; } // ------------------------------------------------------- function visitFunctionBodyForStructuredParameter(traverse, node, path, state) { var funcNode = path[0]; utils.catchup(funcNode.body.range[0] + 1, state); renderDestructuredComponents(funcNode, state); if (funcNode.rest) { utils.append( restParamVisitors.renderRestParamSetup(funcNode, state), state ); } return true; } function renderDestructuredComponents(funcNode, state) { var destructuredComponents = []; for (var k = 0; k < funcNode.params.length; k++) { var param = funcNode.params[k]; if (isStructuredPattern(param)) { destructuredComponents.push( getDestructuredComponents(param, state) ); state.localScope.tempVarIndex++; } } if (destructuredComponents.length) { utils.append('var ' + destructuredComponents.join(',') + ';', state); } } visitFunctionBodyForStructuredParameter.test = function(node, path, state) { return node.type === Syntax.BlockStatement && isFunctionNode(path[0]); }; exports.visitorList = [ visitStructuredVariable, visitStructuredAssignment, visitStructuredParameter, visitFunctionBodyForStructuredParameter ]; exports.renderDestructuredComponents = renderDestructuredComponents; },{"../src/utils":22,"./es6-rest-param-visitors":28,"./es7-rest-property-helpers":30,"./reserved-words-helper":32,"esprima-fb":9}],26:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*jslint node:true*/ /** * Desugars concise methods of objects to function expressions. * * var foo = { * method(x, y) { ... } * }; * * var foo = { * method: function(x, y) { ... } * }; * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); var reservedWordsHelper = _dereq_('./reserved-words-helper'); function visitObjectConciseMethod(traverse, node, path, state) { var isGenerator = node.value.generator; if (isGenerator) { utils.catchupWhiteSpace(node.range[0] + 1, state); } if (node.computed) { // [<expr>]() { ...} utils.catchup(node.key.range[1] + 1, state); } else if (reservedWordsHelper.isReservedWord(node.key.name)) { utils.catchup(node.key.range[0], state); utils.append('"', state); utils.catchup(node.key.range[1], state); utils.append('"', state); } utils.catchup(node.key.range[1], state); utils.append( ':function' + (isGenerator ? '*' : ''), state ); path.unshift(node); traverse(node.value, path, state); path.shift(); return false; } visitObjectConciseMethod.test = function(node, path, state) { return node.type === Syntax.Property && node.value.type === Syntax.FunctionExpression && node.method === true; }; exports.visitorList = [ visitObjectConciseMethod ]; },{"../src/utils":22,"./reserved-words-helper":32,"esprima-fb":9}],27:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*jslint node: true*/ /** * Desugars ES6 Object Literal short notations into ES3 full notation. * * // Easier return values. * function foo(x, y) { * return {x, y}; // {x: x, y: y} * }; * * // Destructuring. * function init({port, ip, coords: {x, y}}) { ... } * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); /** * @public */ function visitObjectLiteralShortNotation(traverse, node, path, state) { utils.catchup(node.key.range[1], state); utils.append(':' + node.key.name, state); return false; } visitObjectLiteralShortNotation.test = function(node, path, state) { return node.type === Syntax.Property && node.kind === 'init' && node.shorthand === true && path[0].type !== Syntax.ObjectPattern; }; exports.visitorList = [ visitObjectLiteralShortNotation ]; },{"../src/utils":22,"esprima-fb":9}],28:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*jslint node:true*/ /** * Desugars ES6 rest parameters into an ES3 arguments array. * * function printf(template, ...args) { * args.forEach(...); * } * * We could use `Array.prototype.slice.call`, but that usage of arguments causes * functions to be deoptimized in V8, so instead we use a for-loop. * * function printf(template) { * for (var args = [], $__0 = 1, $__1 = arguments.length; $__0 < $__1; $__0++) * args.push(arguments[$__0]); * args.forEach(...); * } * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); function _nodeIsFunctionWithRestParam(node) { return (node.type === Syntax.FunctionDeclaration || node.type === Syntax.FunctionExpression || node.type === Syntax.ArrowFunctionExpression) && node.rest; } function visitFunctionParamsWithRestParam(traverse, node, path, state) { if (node.parametricType) { utils.catchup(node.parametricType.range[0], state); path.unshift(node); traverse(node.parametricType, path, state); path.shift(); } // Render params. if (node.params.length) { path.unshift(node); traverse(node.params, path, state); path.shift(); } else { // -3 is for ... of the rest. utils.catchup(node.rest.range[0] - 3, state); } utils.catchupWhiteSpace(node.rest.range[1], state); path.unshift(node); traverse(node.body, path, state); path.shift(); return false; } visitFunctionParamsWithRestParam.test = function(node, path, state) { return _nodeIsFunctionWithRestParam(node); }; function renderRestParamSetup(functionNode, state) { var idx = state.localScope.tempVarIndex++; var len = state.localScope.tempVarIndex++; return 'for (var ' + functionNode.rest.name + '=[],' + utils.getTempVarWithValue(idx, functionNode.params.length) + ',' + utils.getTempVarWithValue(len, 'arguments.length') + ';' + utils.getTempVar(idx) + '<' + utils.getTempVar(len) + ';' + utils.getTempVar(idx) + '++) ' + functionNode.rest.name + '.push(arguments[' + utils.getTempVar(idx) + ']);'; } function visitFunctionBodyWithRestParam(traverse, node, path, state) { utils.catchup(node.range[0] + 1, state); var parentNode = path[0]; utils.append(renderRestParamSetup(parentNode, state), state); return true; } visitFunctionBodyWithRestParam.test = function(node, path, state) { return node.type === Syntax.BlockStatement && _nodeIsFunctionWithRestParam(path[0]); }; exports.renderRestParamSetup = renderRestParamSetup; exports.visitorList = [ visitFunctionParamsWithRestParam, visitFunctionBodyWithRestParam ]; },{"../src/utils":22,"esprima-fb":9}],29:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*jslint node:true*/ /** * @typechecks */ 'use strict'; var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); /** * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.1.9 */ function visitTemplateLiteral(traverse, node, path, state) { var templateElements = node.quasis; utils.append('(', state); for (var ii = 0; ii < templateElements.length; ii++) { var templateElement = templateElements[ii]; if (templateElement.value.raw !== '') { utils.append(getCookedValue(templateElement), state); if (!templateElement.tail) { // + between element and substitution utils.append(' + ', state); } // maintain line numbers utils.move(templateElement.range[0], state); utils.catchupNewlines(templateElement.range[1], state); } else { // templateElement.value.raw === '' // Concatenat adjacent substitutions, e.g. `${x}${y}`. Empty templates // appear before the first and after the last element - nothing to add in // those cases. if (ii > 0 && !templateElement.tail) { // + between substitution and substitution utils.append(' + ', state); } } utils.move(templateElement.range[1], state); if (!templateElement.tail) { var substitution = node.expressions[ii]; if (substitution.type === Syntax.Identifier || substitution.type === Syntax.MemberExpression || substitution.type === Syntax.CallExpression) { utils.catchup(substitution.range[1], state); } else { utils.append('(', state); traverse(substitution, path, state); utils.catchup(substitution.range[1], state); utils.append(')', state); } // if next templateElement isn't empty... if (templateElements[ii + 1].value.cooked !== '') { utils.append(' + ', state); } } } utils.move(node.range[1], state); utils.append(')', state); return false; } visitTemplateLiteral.test = function(node, path, state) { return node.type === Syntax.TemplateLiteral; }; /** * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.2.6 */ function visitTaggedTemplateExpression(traverse, node, path, state) { var template = node.quasi; var numQuasis = template.quasis.length; // print the tag utils.move(node.tag.range[0], state); traverse(node.tag, path, state); utils.catchup(node.tag.range[1], state); // print array of template elements utils.append('(function() { var siteObj = [', state); for (var ii = 0; ii < numQuasis; ii++) { utils.append(getCookedValue(template.quasis[ii]), state); if (ii !== numQuasis - 1) { utils.append(', ', state); } } utils.append(']; siteObj.raw = [', state); for (ii = 0; ii < numQuasis; ii++) { utils.append(getRawValue(template.quasis[ii]), state); if (ii !== numQuasis - 1) { utils.append(', ', state); } } utils.append( ']; Object.freeze(siteObj.raw); Object.freeze(siteObj); return siteObj; }()', state ); // print substitutions if (numQuasis > 1) { for (ii = 0; ii < template.expressions.length; ii++) { var expression = template.expressions[ii]; utils.append(', ', state); // maintain line numbers by calling catchupWhiteSpace over the whole // previous TemplateElement utils.move(template.quasis[ii].range[0], state); utils.catchupNewlines(template.quasis[ii].range[1], state); utils.move(expression.range[0], state); traverse(expression, path, state); utils.catchup(expression.range[1], state); } } // print blank lines to push the closing ) down to account for the final // TemplateElement. utils.catchupNewlines(node.range[1], state); utils.append(')', state); return false; } visitTaggedTemplateExpression.test = function(node, path, state) { return node.type === Syntax.TaggedTemplateExpression; }; function getCookedValue(templateElement) { return JSON.stringify(templateElement.value.cooked); } function getRawValue(templateElement) { return JSON.stringify(templateElement.value.raw); } exports.visitorList = [ visitTemplateLiteral, visitTaggedTemplateExpression ]; },{"../src/utils":22,"esprima-fb":9}],30:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, 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. */ /*jslint node:true*/ /** * Desugars ES7 rest properties into ES5 object iteration. */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); // TODO: This is a pretty massive helper, it should only be defined once, in the // transform's runtime environment. We don't currently have a runtime though. var restFunction = '(function(source, exclusion) {' + 'var rest = {};' + 'var hasOwn = Object.prototype.hasOwnProperty;' + 'if (source == null) {' + 'throw new TypeError();' + '}' + 'for (var key in source) {' + 'if (hasOwn.call(source, key) && !hasOwn.call(exclusion, key)) {' + 'rest[key] = source[key];' + '}' + '}' + 'return rest;' + '})'; function getPropertyNames(properties) { var names = []; for (var i = 0; i < properties.length; i++) { var property = properties[i]; if (property.type === Syntax.SpreadProperty) { continue; } if (property.type === Syntax.Identifier) { names.push(property.name); } else { names.push(property.key.name); } } return names; } function getRestFunctionCall(source, exclusion) { return restFunction + '(' + source + ',' + exclusion + ')'; } function getSimpleShallowCopy(accessorExpression) { // This could be faster with 'Object.assign({}, ' + accessorExpression + ')' // but to unify code paths and avoid a ES6 dependency we use the same // helper as for the exclusion case. return getRestFunctionCall(accessorExpression, '{}'); } function renderRestExpression(accessorExpression, excludedProperties) { var excludedNames = getPropertyNames(excludedProperties); if (!excludedNames.length) { return getSimpleShallowCopy(accessorExpression); } return getRestFunctionCall( accessorExpression, '{' + excludedNames.join(':1,') + ':1}' ); } exports.renderRestExpression = renderRestExpression; },{"../src/utils":22,"esprima-fb":9}],31:[function(_dereq_,module,exports){ /** * Copyright 2004-present Facebook. All Rights Reserved. */ /*global exports:true*/ /** * Implements ES7 object spread property. * https://gist.github.com/sebmarkbage/aa849c7973cb4452c547 * * { ...a, x: 1 } * * Object.assign({}, a, {x: 1 }) * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); function visitObjectLiteralSpread(traverse, node, path, state) { utils.catchup(node.range[0], state); utils.append('Object.assign({', state); // Skip the original { utils.move(node.range[0] + 1, state); var previousWasSpread = false; for (var i = 0; i < node.properties.length; i++) { var property = node.properties[i]; if (property.type === Syntax.SpreadProperty) { // Close the previous object or initial object if (!previousWasSpread) { utils.append('}', state); } if (i === 0) { // Normally there will be a comma when we catch up, but not before // the first property. utils.append(',', state); } utils.catchup(property.range[0], state); // skip ... utils.move(property.range[0] + 3, state); traverse(property.argument, path, state); utils.catchup(property.range[1], state); previousWasSpread = true; } else { utils.catchup(property.range[0], state); if (previousWasSpread) { utils.append('{', state); } traverse(property, path, state); utils.catchup(property.range[1], state); previousWasSpread = false; } } // Strip any non-whitespace between the last item and the end. // We only catch up on whitespace so that we ignore any trailing commas which // are stripped out for IE8 support. Unfortunately, this also strips out any // trailing comments. utils.catchupWhiteSpace(node.range[1] - 1, state); // Skip the trailing } utils.move(node.range[1], state); if (!previousWasSpread) { utils.append('}', state); } utils.append(')', state); return false; } visitObjectLiteralSpread.test = function(node, path, state) { if (node.type !== Syntax.ObjectExpression) { return false; } // Tight loop optimization var hasAtLeastOneSpreadProperty = false; for (var i = 0; i < node.properties.length; i++) { var property = node.properties[i]; if (property.type === Syntax.SpreadProperty) { hasAtLeastOneSpreadProperty = true; } else if (property.kind !== 'init') { return false; } } return hasAtLeastOneSpreadProperty; }; exports.visitorList = [ visitObjectLiteralSpread ]; },{"../src/utils":22,"esprima-fb":9}],32:[function(_dereq_,module,exports){ /** * Copyright 2014 Facebook, 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. */ var KEYWORDS = [ 'break', 'do', 'in', 'typeof', 'case', 'else', 'instanceof', 'var', 'catch', 'export', 'new', 'void', 'class', 'extends', 'return', 'while', 'const', 'finally', 'super', 'with', 'continue', 'for', 'switch', 'yield', 'debugger', 'function', 'this', 'default', 'if', 'throw', 'delete', 'import', 'try' ]; var FUTURE_RESERVED_WORDS = [ 'enum', 'await', 'implements', 'package', 'protected', 'static', 'interface', 'private', 'public' ]; var LITERALS = [ 'null', 'true', 'false' ]; // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words var RESERVED_WORDS = [].concat( KEYWORDS, FUTURE_RESERVED_WORDS, LITERALS ); var reservedWordsMap = Object.create(null); RESERVED_WORDS.forEach(function(k) { reservedWordsMap[k] = true; }); exports.isReservedWord = function(word) { return !!reservedWordsMap[word]; }; },{}],33:[function(_dereq_,module,exports){ var esprima = _dereq_('esprima-fb'); var utils = _dereq_('../src/utils'); var Syntax = esprima.Syntax; function _isFunctionNode(node) { return node.type === Syntax.FunctionDeclaration || node.type === Syntax.FunctionExpression || node.type === Syntax.ArrowFunctionExpression; } function visitClassProperty(traverse, node, path, state) { utils.catchup(node.range[0], state); utils.catchupWhiteOut(node.range[1], state); return false; } visitClassProperty.test = function(node, path, state) { return node.type === Syntax.ClassProperty; }; function visitTypeAlias(traverse, node, path, state) { utils.catchupWhiteOut(node.range[1], state); return false; } visitTypeAlias.test = function(node, path, state) { return node.type === Syntax.TypeAlias; }; function visitInterfaceDeclaration(traverse, node, path, state) { utils.catchupWhiteOut(node.range[1], state); return false; } visitInterfaceDeclaration.test = function(node, path, state) { return node.type === Syntax.InterfaceDeclaration; }; function visitDeclare(traverse, node, path, state) { utils.catchupWhiteOut(node.range[1], state); return false; } visitDeclare.test = function(node, path, state) { switch (node.type) { case Syntax.DeclareVariable: case Syntax.DeclareFunction: case Syntax.DeclareClass: case Syntax.DeclareModule: return true } return false; } function visitFunctionParametricAnnotation(traverse, node, path, state) { utils.catchup(node.range[0], state); utils.catchupWhiteOut(node.range[1], state); return false; } visitFunctionParametricAnnotation.test = function(node, path, state) { return node.type === Syntax.TypeParameterDeclaration && path[0] && _isFunctionNode(path[0]) && node === path[0].typeParameters; }; function visitFunctionReturnAnnotation(traverse, node, path, state) { utils.catchup(node.range[0], state); utils.catchupWhiteOut(node.range[1], state); return false; } visitFunctionReturnAnnotation.test = function(node, path, state) { return path[0] && _isFunctionNode(path[0]) && node === path[0].returnType; }; function visitOptionalFunctionParameterAnnotation(traverse, node, path, state) { utils.catchup(node.range[0] + node.name.length, state); utils.catchupWhiteOut(node.range[1], state); return false; } visitOptionalFunctionParameterAnnotation.test = function(node, path, state) { return node.type === Syntax.Identifier && node.optional && path[0] && _isFunctionNode(path[0]); }; function visitTypeAnnotatedIdentifier(traverse, node, path, state) { utils.catchup(node.typeAnnotation.range[0], state); utils.catchupWhiteOut(node.typeAnnotation.range[1], state); return false; } visitTypeAnnotatedIdentifier.test = function(node, path, state) { return node.type === Syntax.Identifier && node.typeAnnotation; }; function visitTypeAnnotatedObjectOrArrayPattern(traverse, node, path, state) { utils.catchup(node.typeAnnotation.range[0], state); utils.catchupWhiteOut(node.typeAnnotation.range[1], state); return false; } visitTypeAnnotatedObjectOrArrayPattern.test = function(node, path, state) { var rightType = node.type === Syntax.ObjectPattern || node.type === Syntax.ArrayPattern; return rightType && node.typeAnnotation; }; /** * Methods cause trouble, since esprima parses them as a key/value pair, where * the location of the value starts at the method body. For example * { bar(x:number,...y:Array<number>):number {} } * is parsed as * { bar: function(x: number, ...y:Array<number>): number {} } * except that the location of the FunctionExpression value is 40-something, * which is the location of the function body. This means that by the time we * visit the params, rest param, and return type organically, we've already * catchup()'d passed them. */ function visitMethod(traverse, node, path, state) { path.unshift(node); traverse(node.key, path, state); path.unshift(node.value); traverse(node.value.params, path, state); node.value.rest && traverse(node.value.rest, path, state); node.value.returnType && traverse(node.value.returnType, path, state); traverse(node.value.body, path, state); path.shift(); path.shift(); return false; } visitMethod.test = function(node, path, state) { return (node.type === "Property" && (node.method || node.kind === "set" || node.kind === "get")) || (node.type === "MethodDefinition"); }; exports.visitorList = [ visitClassProperty, visitDeclare, visitInterfaceDeclaration, visitFunctionParametricAnnotation, visitFunctionReturnAnnotation, visitMethod, visitOptionalFunctionParameterAnnotation, visitTypeAlias, visitTypeAnnotatedIdentifier, visitTypeAnnotatedObjectOrArrayPattern ]; },{"../src/utils":22,"esprima-fb":9}],34:[function(_dereq_,module,exports){ /** * 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. */ /*global exports:true*/ "use strict"; var Syntax = _dereq_('jstransform').Syntax; var utils = _dereq_('jstransform/src/utils'); var renderXJSExpressionContainer = _dereq_('./xjs').renderXJSExpressionContainer; var renderXJSLiteral = _dereq_('./xjs').renderXJSLiteral; var quoteAttrName = _dereq_('./xjs').quoteAttrName; var trimLeft = _dereq_('./xjs').trimLeft; /** * Customized desugar processor for React JSX. Currently: * * <X> </X> => React.createElement(X, null) * <X prop="1" /> => React.createElement(X, {prop: '1'}, null) * <X prop="2"><Y /></X> => React.createElement(X, {prop:'2'}, * React.createElement(Y, null) * ) * <div /> => React.createElement("div", null) */ /** * Removes all non-whitespace/parenthesis characters */ var reNonWhiteParen = /([^\s\(\)])/g; function stripNonWhiteParen(value) { return value.replace(reNonWhiteParen, ''); } var tagConvention = /^[a-z]|\-/; function isTagName(name) { return tagConvention.test(name); } function visitReactTag(traverse, object, path, state) { var openingElement = object.openingElement; var nameObject = openingElement.name; var attributesObject = openingElement.attributes; utils.catchup(openingElement.range[0], state, trimLeft); if (nameObject.type === Syntax.XJSNamespacedName && nameObject.namespace) { throw new Error('Namespace tags are not supported. ReactJSX is not XML.'); } // We assume that the React runtime is already in scope utils.append('React.createElement(', state); // XJSMemberExpressions are not. if (nameObject.type === Syntax.XJSIdentifier && isTagName(nameObject.name)) { utils.append('"' + nameObject.name + '"', state); utils.move(nameObject.range[1], state); } else { // Use utils.catchup in this case so we can easily handle // XJSMemberExpressions which look like Foo.Bar.Baz. This also handles // XJSIdentifiers that aren't fallback tags. utils.move(nameObject.range[0], state); utils.catchup(nameObject.range[1], state); } utils.append(', ', state); var hasAttributes = attributesObject.length; var hasAtLeastOneSpreadProperty = attributesObject.some(function(attr) { return attr.type === Syntax.XJSSpreadAttribute; }); // if we don't have any attributes, pass in null if (hasAtLeastOneSpreadProperty) { utils.append('React.__spread({', state); } else if (hasAttributes) { utils.append('{', state); } else { utils.append('null', state); } // keep track of if the previous attribute was a spread attribute var previousWasSpread = false; // write attributes attributesObject.forEach(function(attr, index) { var isLast = index === attributesObject.length - 1; if (attr.type === Syntax.XJSSpreadAttribute) { // Close the previous object or initial object if (!previousWasSpread) { utils.append('}, ', state); } // Move to the expression start, ignoring everything except parenthesis // and whitespace. utils.catchup(attr.range[0], state, stripNonWhiteParen); // Plus 1 to skip `{`. utils.move(attr.range[0] + 1, state); utils.catchup(attr.argument.range[0], state, stripNonWhiteParen); traverse(attr.argument, path, state); utils.catchup(attr.argument.range[1], state); // Move to the end, ignoring parenthesis and the closing `}` utils.catchup(attr.range[1] - 1, state, stripNonWhiteParen); if (!isLast) { utils.append(', ', state); } utils.move(attr.range[1], state); previousWasSpread = true; return; } // If the next attribute is a spread, we're effective last in this object if (!isLast) { isLast = attributesObject[index + 1].type === Syntax.XJSSpreadAttribute; } if (attr.name.namespace) { throw new Error( 'Namespace attributes are not supported. ReactJSX is not XML.'); } var name = attr.name.name; utils.catchup(attr.range[0], state, trimLeft); if (previousWasSpread) { utils.append('{', state); } utils.append(quoteAttrName(name), state); utils.append(': ', state); if (!attr.value) { state.g.buffer += 'true'; state.g.position = attr.name.range[1]; if (!isLast) { utils.append(', ', state); } } else { utils.move(attr.name.range[1], state); // Use catchupNewlines to skip over the '=' in the attribute utils.catchupNewlines(attr.value.range[0], state); if (attr.value.type === Syntax.Literal) { renderXJSLiteral(attr.value, isLast, state); } else { renderXJSExpressionContainer(traverse, attr.value, isLast, path, state); } } utils.catchup(attr.range[1], state, trimLeft); previousWasSpread = false; }); if (!openingElement.selfClosing) { utils.catchup(openingElement.range[1] - 1, state, trimLeft); utils.move(openingElement.range[1], state); } if (hasAttributes && !previousWasSpread) { utils.append('}', state); } if (hasAtLeastOneSpreadProperty) { utils.append(')', state); } // filter out whitespace var childrenToRender = object.children.filter(function(child) { return !(child.type === Syntax.Literal && typeof child.value === 'string' && child.value.match(/^[ \t]*[\r\n][ \t\r\n]*$/)); }); if (childrenToRender.length > 0) { var lastRenderableIndex; childrenToRender.forEach(function(child, index) { if (child.type !== Syntax.XJSExpressionContainer || child.expression.type !== Syntax.XJSEmptyExpression) { lastRenderableIndex = index; } }); if (lastRenderableIndex !== undefined) { utils.append(', ', state); } childrenToRender.forEach(function(child, index) { utils.catchup(child.range[0], state, trimLeft); var isLast = index >= lastRenderableIndex; if (child.type === Syntax.Literal) { renderXJSLiteral(child, isLast, state); } else if (child.type === Syntax.XJSExpressionContainer) { renderXJSExpressionContainer(traverse, child, isLast, path, state); } else { traverse(child, path, state); if (!isLast) { utils.append(', ', state); } } utils.catchup(child.range[1], state, trimLeft); }); } if (openingElement.selfClosing) { // everything up to /> utils.catchup(openingElement.range[1] - 2, state, trimLeft); utils.move(openingElement.range[1], state); } else { // everything up to </ sdflksjfd> utils.catchup(object.closingElement.range[0], state, trimLeft); utils.move(object.closingElement.range[1], state); } utils.append(')', state); return false; } visitReactTag.test = function(object, path, state) { return object.type === Syntax.XJSElement; }; exports.visitorList = [ visitReactTag ]; },{"./xjs":36,"jstransform":21,"jstransform/src/utils":22}],35:[function(_dereq_,module,exports){ /** * 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. */ /*global exports:true*/ "use strict"; var Syntax = _dereq_('jstransform').Syntax; var utils = _dereq_('jstransform/src/utils'); function addDisplayName(displayName, object, state) { if (object && object.type === Syntax.CallExpression && object.callee.type === Syntax.MemberExpression && object.callee.object.type === Syntax.Identifier && object.callee.object.name === 'React' && object.callee.property.type === Syntax.Identifier && object.callee.property.name === 'createClass' && object['arguments'].length === 1 && object['arguments'][0].type === Syntax.ObjectExpression) { // Verify that the displayName property isn't already set var properties = object['arguments'][0].properties; var safe = properties.every(function(property) { var value = property.key.type === Syntax.Identifier ? property.key.name : property.key.value; return value !== 'displayName'; }); if (safe) { utils.catchup(object['arguments'][0].range[0] + 1, state); utils.append('displayName: "' + displayName + '",', state); } } } /** * Transforms the following: * * var MyComponent = React.createClass({ * render: ... * }); * * into: * * var MyComponent = React.createClass({ * displayName: 'MyComponent', * render: ... * }); * * Also catches: * * MyComponent = React.createClass(...); * exports.MyComponent = React.createClass(...); * module.exports = {MyComponent: React.createClass(...)}; */ function visitReactDisplayName(traverse, object, path, state) { var left, right; if (object.type === Syntax.AssignmentExpression) { left = object.left; right = object.right; } else if (object.type === Syntax.Property) { left = object.key; right = object.value; } else if (object.type === Syntax.VariableDeclarator) { left = object.id; right = object.init; } if (left && left.type === Syntax.MemberExpression) { left = left.property; } if (left && left.type === Syntax.Identifier) { addDisplayName(left.name, right, state); } } visitReactDisplayName.test = function(object, path, state) { return ( object.type === Syntax.AssignmentExpression || object.type === Syntax.Property || object.type === Syntax.VariableDeclarator ); }; exports.visitorList = [ visitReactDisplayName ]; },{"jstransform":21,"jstransform/src/utils":22}],36:[function(_dereq_,module,exports){ /** * 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. */ /*global exports:true*/ "use strict"; var Syntax = _dereq_('jstransform').Syntax; var utils = _dereq_('jstransform/src/utils'); function renderXJSLiteral(object, isLast, state, start, end) { var lines = object.value.split(/\r\n|\n|\r/); if (start) { utils.append(start, state); } var lastNonEmptyLine = 0; lines.forEach(function (line, index) { if (line.match(/[^ \t]/)) { lastNonEmptyLine = index; } }); lines.forEach(function (line, index) { var isFirstLine = index === 0; var isLastLine = index === lines.length - 1; var isLastNonEmptyLine = index === lastNonEmptyLine; // replace rendered whitespace tabs with spaces var trimmedLine = line.replace(/\t/g, ' '); // trim whitespace touching a newline if (!isFirstLine) { trimmedLine = trimmedLine.replace(/^[ ]+/, ''); } if (!isLastLine) { trimmedLine = trimmedLine.replace(/[ ]+$/, ''); } if (!isFirstLine) { utils.append(line.match(/^[ \t]*/)[0], state); } if (trimmedLine || isLastNonEmptyLine) { utils.append( JSON.stringify(trimmedLine) + (!isLastNonEmptyLine ? " + ' ' +" : ''), state); if (isLastNonEmptyLine) { if (end) { utils.append(end, state); } if (!isLast) { utils.append(', ', state); } } // only restore tail whitespace if line had literals if (trimmedLine && !isLastLine) { utils.append(line.match(/[ \t]*$/)[0], state); } } if (!isLastLine) { utils.append('\n', state); } }); utils.move(object.range[1], state); } function renderXJSExpressionContainer(traverse, object, isLast, path, state) { // Plus 1 to skip `{`. utils.move(object.range[0] + 1, state); utils.catchup(object.expression.range[0], state); traverse(object.expression, path, state); if (!isLast && object.expression.type !== Syntax.XJSEmptyExpression) { // If we need to append a comma, make sure to do so after the expression. utils.catchup(object.expression.range[1], state, trimLeft); utils.append(', ', state); } // Minus 1 to skip `}`. utils.catchup(object.range[1] - 1, state, trimLeft); utils.move(object.range[1], state); return false; } function quoteAttrName(attr) { // Quote invalid JS identifiers. if (!/^[a-z_$][a-z\d_$]*$/i.test(attr)) { return '"' + attr + '"'; } return attr; } function trimLeft(value) { return value.replace(/^[ ]+/, ''); } exports.renderXJSExpressionContainer = renderXJSExpressionContainer; exports.renderXJSLiteral = renderXJSLiteral; exports.quoteAttrName = quoteAttrName; exports.trimLeft = trimLeft; },{"jstransform":21,"jstransform/src/utils":22}],37:[function(_dereq_,module,exports){ /*global exports:true*/ var es6ArrowFunctions = _dereq_('jstransform/visitors/es6-arrow-function-visitors'); var es6Classes = _dereq_('jstransform/visitors/es6-class-visitors'); var es6Destructuring = _dereq_('jstransform/visitors/es6-destructuring-visitors'); var es6ObjectConciseMethod = _dereq_('jstransform/visitors/es6-object-concise-method-visitors'); var es6ObjectShortNotation = _dereq_('jstransform/visitors/es6-object-short-notation-visitors'); var es6RestParameters = _dereq_('jstransform/visitors/es6-rest-param-visitors'); var es6Templates = _dereq_('jstransform/visitors/es6-template-visitors'); var es7SpreadProperty = _dereq_('jstransform/visitors/es7-spread-property-visitors'); var react = _dereq_('./transforms/react'); var reactDisplayName = _dereq_('./transforms/reactDisplayName'); /** * Map from transformName => orderedListOfVisitors. */ var transformVisitors = { 'es6-arrow-functions': es6ArrowFunctions.visitorList, 'es6-classes': es6Classes.visitorList, 'es6-destructuring': es6Destructuring.visitorList, 'es6-object-concise-method': es6ObjectConciseMethod.visitorList, 'es6-object-short-notation': es6ObjectShortNotation.visitorList, 'es6-rest-params': es6RestParameters.visitorList, 'es6-templates': es6Templates.visitorList, 'es7-spread-property': es7SpreadProperty.visitorList, 'react': react.visitorList.concat(reactDisplayName.visitorList) }; var transformSets = { 'harmony': [ 'es6-arrow-functions', 'es6-object-concise-method', 'es6-object-short-notation', 'es6-classes', 'es6-rest-params', 'es6-templates', 'es6-destructuring', 'es7-spread-property' ], 'react': [ 'react' ] }; /** * Specifies the order in which each transform should run. */ var transformRunOrder = [ 'es6-arrow-functions', 'es6-object-concise-method', 'es6-object-short-notation', 'es6-classes', 'es6-rest-params', 'es6-templates', 'es6-destructuring', 'es7-spread-property', 'react' ]; /** * Given a list of transform names, return the ordered list of visitors to be * passed to the transform() function. * * @param {array?} excludes * @return {array} */ function getAllVisitors(excludes) { var ret = []; for (var i = 0, il = transformRunOrder.length; i < il; i++) { if (!excludes || excludes.indexOf(transformRunOrder[i]) === -1) { ret = ret.concat(transformVisitors[transformRunOrder[i]]); } } return ret; } /** * Given a list of visitor set names, return the ordered list of visitors to be * passed to jstransform. * * @param {array} * @return {array} */ function getVisitorsBySet(sets) { var visitorsToInclude = sets.reduce(function(visitors, set) { if (!transformSets.hasOwnProperty(set)) { throw new Error('Unknown visitor set: ' + set); } transformSets[set].forEach(function(visitor) { visitors[visitor] = true; }); return visitors; }, {}); var visitorList = []; for (var i = 0; i < transformRunOrder.length; i++) { if (visitorsToInclude.hasOwnProperty(transformRunOrder[i])) { visitorList = visitorList.concat(transformVisitors[transformRunOrder[i]]); } } return visitorList; } exports.getVisitorsBySet = getVisitorsBySet; exports.getAllVisitors = getAllVisitors; exports.transformVisitors = transformVisitors; },{"./transforms/react":34,"./transforms/reactDisplayName":35,"jstransform/visitors/es6-arrow-function-visitors":23,"jstransform/visitors/es6-class-visitors":24,"jstransform/visitors/es6-destructuring-visitors":25,"jstransform/visitors/es6-object-concise-method-visitors":26,"jstransform/visitors/es6-object-short-notation-visitors":27,"jstransform/visitors/es6-rest-param-visitors":28,"jstransform/visitors/es6-template-visitors":29,"jstransform/visitors/es7-spread-property-visitors":31}]},{},[1])(1) });
packages/ringcentral-widgets-docs/src/app/pages/Components/DropdownNavigationItem/index.js
ringcentral/ringcentral-js-widget
import React from 'react'; import { parse } from 'react-docgen'; import CodeExample from '../../../components/CodeExample'; import ComponentHeader from '../../../components/ComponentHeader'; import PropTypeDescription from '../../../components/PropTypeDescription'; import Demo from './Demo'; // eslint-disable-next-line import demoCode from '!raw-loader!./Demo'; // eslint-disable-next-line import componentCode from '!raw-loader!ringcentral-widgets/components/DropdownNavigationItem'; const DropdownNavigationItemPage = () => { const info = parse(componentCode); return ( <div> <ComponentHeader name="DropdownNavigationItem" description={info.description} /> <CodeExample code={demoCode} title="DropdownNavigationItem Example"> <Demo /> </CodeExample> <PropTypeDescription componentInfo={info} /> </div> ); }; export default DropdownNavigationItemPage;
app/containers/OnTheJob/index.js
HRR20-Lotus/affirmation
/* * * OnTheJob * */ import React from 'react'; import { connect } from 'react-redux'; import Helmet from 'react-helmet'; import selectOnTheJob from './selectors'; import PostPreview from '../../components/PostPreview/index'; export class OnTheJob extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function render() { return ( <div> <Helmet title="OnTheJob" meta={[ { name: 'description', content: 'Description of OnTheJob' }, ]} /> <PostPreview /> </div> ); } } const mapStateToProps = selectOnTheJob(); function mapDispatchToProps(dispatch) { return { dispatch, }; } export default connect(mapStateToProps, mapDispatchToProps)(OnTheJob);
src/ui/atom/SelectObjectDialog/index.js
jkubos/tickator-ide
import React from 'react' import {observer} from 'mobx-react' import styles from './style.less' import {UiState} from '~/src/business/UiState' import {BusinessSpace} from '~/src/business/BusinessSpace' import {Modals} from '~/src/business/Modals' import {ImageButton} from '~/src/ui/quark/ImageButton' import {InterfaceDefinition} from '~/src/tickator/definition/InterfaceDefinition' import {ComponentDefinition} from '~/src/tickator/definition/ComponentDefinition' @observer export class SelectObjectDialog extends React.Component { static contextTypes = { uiState: React.PropTypes.instanceOf(UiState).isRequired, space: React.PropTypes.instanceOf(BusinessSpace).isRequired } render() { if (this.context.uiState.openedModal!=Modals.SELECT_OBJECT_MODAL) { return null; } return <div className={styles.main} onClick={e=>this._onCancel(e)}> <div> <input ref="input" autoFocus className={styles.input} defaultValue="" onClick={e=>e.stopPropagation()} onChange={e=>this._onChange(e)} onFocus={e=>this._onFocus(e)} autoCapitalize="off" /> {this.context.space .findByTypes(this.context.uiState.openedModalParams.types) .filter(o=>o.name.includes(this.state ? this.state.input : '')) .map((o, i)=>{ return <div key={i}> <div className={styles.result} onClick={e=>this._onSelect(e, o.businessObject.uuid)}> {this._renderType(o)} {o.name} </div> </div> })} </div> </div> } _onSelect(e, uuid) { this.context.uiState.closeModal({confirmed: true, uuid}) e.stopPropagation() this.setState({input: ''}) } _onCancel(e) { this.context.uiState.closeModal({confirmed: false}) e.stopPropagation() this.setState({input: ''}) } _onFocus() { } _onChange() { this.setState({input: this.refs.input.value}) } _renderType(o) { if (o instanceof ComponentDefinition) { return <i className="fa fa-microchip"></i> } else if (o instanceof InterfaceDefinition) { return <i className="fa fa-exchange"></i> } return null } }
tests/routes/Counter/components/Counter.spec.js
k2data/svg-react-playground
import React from 'react' import { bindActionCreators } from 'redux' import { Counter } from 'routes/Counter/components/Counter' import { shallow } from 'enzyme' describe('(Component) Counter', () => { let _props, _spies, _wrapper beforeEach(() => { _spies = {} _props = { counter : 5, ...bindActionCreators({ doubleAsync : (_spies.doubleAsync = sinon.spy()), increment : (_spies.increment = sinon.spy()) }, _spies.dispatch = sinon.spy()) } _wrapper = shallow(<Counter {..._props} />) }) it('Should render as a <div>.', () => { expect(_wrapper.is('div')).to.equal(true) }) it('Should render with an <h2> that includes Sample Counter text.', () => { expect(_wrapper.find('h2').text()).to.match(/Counter:/) }) it('Should render props.counter at the end of the sample counter <h2>.', () => { expect(_wrapper.find('h2').text()).to.match(/5$/) _wrapper.setProps({ counter: 8 }) expect(_wrapper.find('h2').text()).to.match(/8$/) }) it('Should render exactly two buttons.', () => { expect(_wrapper.find('button')).to.have.length(2) }) describe('An increment button...', () => { let _button beforeEach(() => { _button = _wrapper.find('button').filterWhere(a => a.text() === 'Increment') }) it('has bootstrap classes', () => { expect(_button.hasClass('btn btn-default')).to.be.true }) it('Should dispatch a `increment` action when clicked', () => { _spies.dispatch.should.have.not.been.called _button.simulate('click') _spies.dispatch.should.have.been.called _spies.increment.should.have.been.called }) }) describe('A Double (Async) button...', () => { let _button beforeEach(() => { _button = _wrapper.find('button').filterWhere(a => a.text() === 'Double (Async)') }) it('has bootstrap classes', () => { expect(_button.hasClass('btn btn-default')).to.be.true }) it('Should dispatch a `doubleAsync` action when clicked', () => { _spies.dispatch.should.have.not.been.called _button.simulate('click') _spies.dispatch.should.have.been.called _spies.doubleAsync.should.have.been.called }) }) })
src/components/header/normal/lang-switcher.js
datea/datea-webapp-react
import React from 'react'; import classnames from 'classnames'; import Menu from '@material-ui/core/Menu'; import MenuItem from '@material-ui/core/MenuItem'; import MenuList from '@material-ui/core/MenuList'; import Button from '@material-ui/core/Button'; import {observer, inject} from 'mobx-react'; import {translatable} from '../../../i18n'; @inject('store') @translatable @observer export default class LangSwitcher extends React.Component { locales = ['es', 'fr']; constructor(props) { super(props); this.state = { open: false}; } handleTouchTap = (event) => { // This prevents ghost click. event.preventDefault(); this.setState({ open: true, anchorEl: event.currentTarget, }); }; handleRequestClose = () => { this.setState({ open: false, }); }; switchLang = (loc) => { this.props.store.user.setLocale(loc); this.setState({open: false}); } render() { const {user, ui} = this.props.store; if (ui.isMobile) return <span></span>; const btnStyle = { //border: '1px solid black', height: 40, width: 40, minWidth: 40, padding: 0, textAlign: 'center', borderRadius: '50%' } /*const labelStyle = { padding: 0 };*/ return ( <div className={classnames('lang-switcher', ui.isMobile && 'mobile')}> <Button onClick={this.handleTouchTap} style={btnStyle}> {user.locale} </Button> <Menu open={this.state.open} anchorEl={this.state.anchorEl} onClose={this.handleRequestClose} > <MenuList> {this.locales.filter(loc => loc != user.locale).map(loc => <MenuItem key={loc} onClick={() => this.switchLang(loc)}>{loc.toUpperCase()}</MenuItem> )} </MenuList> </Menu> </div> ); } }
packages/react-router-native/__tests__/index.android.js
OpenGov/react-router
import 'react-native'; import React from 'react'; import Index from '../index.android.js'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; it('renders correctly', () => { const tree = renderer.create( <Index /> ); });
app/containers/PastStays/index.js
projectcashmere/admin
/* * * PastStays * */ import React from 'react'; import { connect } from 'react-redux'; import format from 'date-fns/format'; import { FormattedMessage } from 'react-intl'; import { createStructuredSelector } from 'reselect'; import { getFormattedDate, getFormattedDuration } from 'utils/helpers'; import { selectHotelId } from 'containers/App/selectors'; import colors from 'themes/colors'; import TableContainer from 'components/Table/Container'; import HeaderRow from 'components/Table/HeaderRow'; import HeaderCol from 'components/Table/HeaderCol'; import BodyRow from 'components/Table/BodyRow'; import BodyCol from 'components/Table/BodyCol'; import ChargesModal from 'components/ChargesModal'; import { fetchStays, fetchCharges, closeModal, handleInputChange, addCharge, saveCharges, } from './actions'; import { selectHasLoaded, selectStays, selectStay, selectIsModalOpen, selectCharges, selectServiceInput, selectPriceInput, } from './selectors'; import messages from './messages'; import Container from './Container'; import SearchContainer from './SearchContainer'; // eslint-disable-next-line react/prefer-stateless-function export class PastStays extends React.PureComponent { componentDidMount() { this.props.fetchStays(this.props.hotelId); } onModalClose = () => { // perform some kind of check prior to closing? this.props.closeModal(); }; handleInputChange = event => { const key = event.target.name; const value = event.target.value; this.props.handleInputChange(key, value); }; handleAddCharge = () => { const { selectedStay, serviceInput, priceInput } = this.props; const charge = { stayId: selectedStay.get('id'), service: serviceInput, charge: (priceInput * 1).toFixed(2), status: 'Unsettled', updated: false, }; this.props.addCharge(charge); this.props.handleInputChange('serviceInput', ''); this.props.handleInputChange('priceInput', ''); }; handleUpdateCharges = () => { const newCharges = this.props.charges .toJS() .filter(charge => charge.updated === false); const newTotal = newCharges.reduce( (prev, current) => (prev * 1 + current.charge * 1).toFixed(2), this.props.selectedStay.get('totalCharge') * 1 ); const stayId = this.props.selectedStay.get('id'); this.props.saveCharges(newCharges, newTotal, stayId); }; render() { const { hasLoaded, stays, selectedStay, isModalOpen, charges, serviceInput, priceInput, } = this.props; if (!hasLoaded) { return <Container />; } return ( <Container> <SearchContainer /> <TableContainer> <HeaderRow mb="10px"> <HeaderCol> <FormattedMessage {...messages.dates} /> </HeaderCol> <HeaderCol width="204px"> <FormattedMessage {...messages.guest} /> </HeaderCol> <HeaderCol> <FormattedMessage {...messages.roomNumber} /> </HeaderCol> <HeaderCol> <FormattedMessage {...messages.checkIn} /> </HeaderCol> <HeaderCol> <FormattedMessage {...messages.checkOut} /> </HeaderCol> <HeaderCol> <FormattedMessage {...messages.duration} /> </HeaderCol> <HeaderCol> <FormattedMessage {...messages.roomRate} /> </HeaderCol> <HeaderCol> <FormattedMessage {...messages.surcharges} /> </HeaderCol> <HeaderCol> <FormattedMessage {...messages.totalAmount} /> </HeaderCol> </HeaderRow> {stays.toJS().map(stay => ( <BodyRow key={stay.id} onClick={() => this.props.fetchCharges(stay.id)} > <BodyCol> {getFormattedDate( new Date(stay.checkInTime), new Date(stay.checkOutTime) )} </BodyCol> <BodyCol width="204px">{stay.customerName}</BodyCol> <BodyCol>{stay.roomNumber}</BodyCol> <BodyCol>{format(new Date(stay.checkInTime), 'h:mm a')}</BodyCol> <BodyCol>{format(new Date(stay.checkOutTime), 'h:mm a')}</BodyCol> <BodyCol> {getFormattedDuration( new Date(stay.checkInTime), new Date(stay.checkOutTime) )} </BodyCol> <BodyCol> $ {(stay.roomCharge ? stay.roomCharge * 1 : 0).toFixed(2)} </BodyCol> <BodyCol color={colors.primary}> $ {(stay.totalCharge * 1 - stay.roomCharge * 1).toFixed(2)} </BodyCol> <BodyCol> $ {(stay.totalCharge ? stay.totalCharge * 1 : 0).toFixed(2)} </BodyCol> </BodyRow> ))} </TableContainer> <ChargesModal isOpen={isModalOpen} handleInputChange={this.handleInputChange} closeModal={this.onModalClose} charges={charges.toJS()} stay={selectedStay.toJS()} serviceInput={serviceInput} priceInput={priceInput} updateCharges={this.handleUpdateCharges} addCharge={this.handleAddCharge} /> </Container> ); } } const mapStateToProps = createStructuredSelector({ hotelId: selectHotelId(), hasLoaded: selectHasLoaded(), isModalOpen: selectIsModalOpen(), selectedStay: selectStay(), stays: selectStays(), charges: selectCharges(), serviceInput: selectServiceInput(), priceInput: selectPriceInput(), }); const mapDispatchToProps = { fetchStays, closeModal, handleInputChange, fetchCharges, addCharge, saveCharges, }; export default connect(mapStateToProps, mapDispatchToProps)(PastStays);
index/components/App.js
JDRomano2/VenomKB
import React from 'react'; import { Switch, Route } from 'react-router'; import Home from './Home'; import About from './About'; import Contact from './Contact'; import Publications from './Publications'; import Download from './Download'; import NotFound from './NotFound'; import SemanticQuery from './SemanticQuery'; import DataContainer from '../containers/DataContainer'; import DataDetailContainer from '../containers/DataDetailContainer'; const App = () => ( <Switch> <Route exact path="/" component={Home} /> <Route path="/about" component={About} /> <Route path="/contact" component={Contact} /> <Route path="/publications" component={Publications} /> <Route path="/data" component={DataContainer} /> <Route path="/download" component={Download} /> <Route path="/semantic" component={SemanticQuery} /> <Route path="/:index" component={DataDetailContainer} /> <Route path="*" component={NotFound} /> </Switch> ); export default App;
ajax/libs/vue-material/1.0.0-beta-5/components/MdApp/index.js
cdnjs/cdnjs
!(function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("vue"));else if("function"==typeof define&&define.amd)define(["vue"],t);else{var n=t("object"==typeof exports?require("vue"):e.Vue);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}})(this,(function(e){return (function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=399)})({0:function(e,t){e.exports=function(e,t,n,r,o,i){var a,l=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(a=e,l=e.default);var u="function"==typeof l?l.options:l;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o);var d;if(i?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=d):r&&(d=r),d){var c=u.functional,f=c?u.render:u.beforeCreate;c?(u._injectStyles=d,u.render=function(e,t){return d.call(t),f(e,t)}):u.beforeCreate=f?[].concat(f,d):[d]}return{esModule:a,exports:l,options:u}}},1:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={props:{mdTheme:null},computed:{$mdActiveTheme:function(){var e=i.default.enabled,t=i.default.getThemeName,n=i.default.getAncestorTheme;return e&&!1!==this.mdTheme?t(this.mdTheme||n(this)):null}}};return(0,l.default)(t,e)};var o=n(4),i=r(o),a=n(6),l=r(a)},114:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),i=r(o),a=n(115),l=r(a),s=n(123),u=r(s),d=n(126),c=r(d),f=n(129),p=r(f);t.default=function(e){(0,i.default)(e),e.component(l.default.name,l.default),e.component(u.default.name,u.default),e.component(c.default.name,c.default),e.component(p.default.name,p.default)}},115:function(e,t,n){"use strict";function r(e){n(116)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(117),i=n.n(o),a=n(0),l=r,s=a(i.a,null,!1,l,null,null);t.default=s.exports},116:function(e,t){},117:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r){var o=[];return e&&e.forEach((function(e){var i=e.componentOptions;i&&c.includes(i.tag)&&(e.data.slot=i.tag,e.data.provide=r.Ctor.options.provide,e.context=t,e.functionalContext=n,o.push(e))})),o}function i(e){var t=e.filter((function(e){return"md-app-drawer"===e.componentOptions.tag}));return t.length?t:[]}function a(e){var t=e&&e["md-permanent"];return t&&("clipped"===t||"card"===t)}Object.defineProperty(t,"__esModule",{value:!0});var l=n(118),s=r(l),u=n(120),d=r(u),c=["md-app-toolbar","md-app-drawer","md-app-content"];t.default={name:"MdApp",functional:!0,render:function(e,t){var n=t.children,r=t.props,l=s.default,u=e(l),c=u.context,f=u.functionalContext,p=u.componentOptions,h=o(n,c,f,p);return i(h).forEach((function(e){e&&a(e.data.attrs)&&(l=d.default)})),e(l,{attrs:r},h)}}},118:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(119),o=n.n(r),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"md-app md-app-side-drawer md-layout-row",class:e.appClasses},[e._t("md-app-drawer"),e._v(" "),n("main",{staticClass:"md-app-container md-flex md-layout-column",class:[e.$mdActiveTheme,e.scrollerClasses],style:e.contentStyles,on:{"&scroll":function(t){e.handleScroll(t)}}},[e._t("md-app-toolbar"),e._v(" "),n("div",{staticClass:"md-app-scroller md-layout-column md-flex",class:[e.$mdActiveTheme,e.scrollerClasses],style:e.containerStyles,on:{"&scroll":function(t){e.handleScroll(t)}}},[e._t("md-app-content")],2)],2)],2)},a=[],l={render:i,staticRenderFns:a},s=l,u=n(0),d=u(o.a,s,!1,null,null,null);t.default=d.exports},119:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(76),l=r(a);t.default=new i.default({name:"MdAppInternalSideDrawer",mixins:[l.default]})},12:function(e,t,n){(function(t){for(var r=n(15),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",l=o["request"+a],s=o["cancel"+a]||o["cancelRequest"+a],u=0;!l&&u<i.length;u++)l=o[i[u]+"Request"+a],s=o[i[u]+"Cancel"+a]||o[i[u]+"CancelRequest"+a];if(!l||!s){var d=0,c=0,f=[];l=function(e){if(0===f.length){var t=r(),n=Math.max(0,1e3/60-(t-d));d=n+t,setTimeout((function(){var e=f.slice(0);f.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(d)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(n))}return f.push({handle:++c,callback:e,cancelled:!1}),c},s=function(e){for(var t=0;t<f.length;t++)f[t].handle===e&&(f[t].cancelled=!0)}}e.exports=function(e){return l.call(o,e)},e.exports.cancel=function(){s.apply(o,arguments)},e.exports.polyfill=function(e){e||(e=o),e.requestAnimationFrame=l,e.cancelAnimationFrame=s}}).call(t,n(13))},120:function(e,t,n){"use strict";function r(e){n(121)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(122),i=n.n(o),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"md-app md-app-internal-drawer md-layout-column",class:e.appClasses},[e._t("md-app-toolbar"),e._v(" "),n("main",{staticClass:"md-app-container md-flex md-layout-row",class:[e.$mdActiveTheme,e.scrollerClasses],style:[e.containerStyles,e.contentStyles]},[e._t("md-app-drawer"),e._v(" "),n("div",{staticClass:"md-app-scroller md-layout-column md-flex",class:[e.$mdActiveTheme,e.scrollerClasses]},[e._t("md-app-content")],2)],2)],2)},l=[],s={render:a,staticRenderFns:l},u=s,d=n(0),c=r,f=d(i.a,u,!1,c,null,null);t.default=f.exports},121:function(e,t){},122:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(76),l=r(a);t.default=new i.default({name:"MdAppInternalDrawer",mixins:[l.default]})},123:function(e,t,n){"use strict";function r(e){n(124)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(125),i=n.n(o),a=function(){var e=this,t=e.$createElement;return(e._self._c||t)("md-toolbar",e._g(e._b({staticClass:"md-app-toolbar",class:e.toolbarClasses,style:e.toolbarStyles},"md-toolbar",e.$attrs,!1),e.$listeners),[e._t("default")],2)},l=[],s={render:a,staticRenderFns:l},u=s,d=n(0),c=r,f=d(i.a,u,!1,c,null,null);t.default=f.exports},124:function(e,t){},125:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"MdAppToolbar",inject:["MdApp"],computed:{toolbarClasses:function(){return{"md-no-elevation":!this.MdApp.toolbar.hasElevation,"md-reveal-active":this.MdApp.toolbar.revealActive,"md-fixed-last-active":this.MdApp.toolbar.fixedLastActive,"md-overlap-off":this.MdApp.toolbar.overlapOff}},toolbarStyles:function(){var e={top:this.MdApp.toolbar.top+"px"};return this.MdApp.toolbar.fixedLastActive&&(e.transform="translate3D(0, "+this.MdApp.toolbar.fixedLastHeight+"px, 0)"),e}},mounted:function(){var e=this.$el.querySelector(".md-title, .md-display-1, .md-display-2");this.MdApp.toolbar.element=this.$el,this.MdApp.toolbar.titleElement=e,e&&(this.MdApp.toolbar.titleSize=parseInt(window.getComputedStyle(e).fontSize,10))}}},126:function(e,t,n){"use strict";function r(e){n(127)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(128),i=n.n(o),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.showCard?n("md-card",e._g(e._b({staticClass:"md-app-content md-flex"},"md-card",e.$attrs,!1),e.$listeners),[e._t("default")],2):n("md-content",e._g(e._b({staticClass:"md-app-content md-flex"},"md-content",e.$attrs,!1),e.$listeners),[e._t("default")],2)},l=[],s={render:a,staticRenderFns:l},u=s,d=n(0),c=r,f=d(i.a,u,!1,c,null,null);t.default=f.exports},127:function(e,t){},128:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"MdAppContent",inject:["MdApp"],computed:{showCard:function(){return this.MdApp.options&&"overlap"===this.MdApp.options.mode}}}},129:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(130),o=n.n(r),i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("md-drawer",e._g(e._b({staticClass:"md-app-drawer"},"md-drawer",e.$attrs,!1),e.$listeners),[e._t("default")],2)},a=[],l={render:i,staticRenderFns:a},s=l,u=n(0),d=u(o.a,s,!1,null,null,null);t.default=d.exports},13:function(e,t){var n;n=(function(){return this})();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},130:function(e,t,n){"use strict";function r(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(o,i){try{var a=t[o](i),l=a.value}catch(e){return void n(e)}if(!a.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(l)}return r("next")})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"MdAppDrawer",inject:["MdApp"],data:function(){return{drawerElement:{mdActive:null,mode:null,submode:null}}},computed:{visible:function(){return this.drawerElement.mdActive},mode:function(){return this.drawerElement.mode},submode:function(){return this.drawerElement.submode}},watch:{visible:function(e){this.MdApp.drawer.width=this.getDrawerWidth(),this.MdApp.drawer.active=e},mode:function(e){this.MdApp.drawer.mode=e},submode:function(e){this.MdApp.drawer.submode=e}},methods:{getDrawerWidth:function(){return this.$el?window.getComputedStyle(this.$el).width:0}},mounted:(function(){function e(){return t.apply(this,arguments)}var t=r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.$nextTick();case 2:this.drawerElement=this.$children[0],this.MdApp.drawer.width=this.getDrawerWidth(),this.MdApp.drawer.active=this.visible,this.MdApp.drawer.mode=this.mode,this.MdApp.drawer.submode=this.submode,this.MdApp.drawer.initialWidth=this.$el.offsetWidth;case 8:case"end":return e.stop()}}),e,this)})));return e})()}},15:function(e,t,n){(function(t){(function(){var n,r,o,i,a,l;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:void 0!==t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},i=n(),l=1e9*t.uptime(),a=i-l):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(t,n(16))},16:function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(d===setTimeout)return setTimeout(e,0);if((d===n||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch(t){try{return d.call(null,e,0)}catch(t){return d.call(this,e,0)}}}function i(e){if(c===clearTimeout)return clearTimeout(e);if((c===r||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{return c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}function a(){m&&p&&(m=!1,p.length?h=p.concat(h):v=-1,h.length&&l())}function l(){if(!m){var e=o(a);m=!0;for(var t=h.length;t;){for(p=h,h=[];++v<t;)p&&p[v].run();v=-1,t=h.length}p=null,m=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function u(){}var d,c,f=e.exports={};!(function(){try{d="function"==typeof setTimeout?setTimeout:n}catch(e){d=n}try{c="function"==typeof clearTimeout?clearTimeout:r}catch(e){c=r}})();var p,h=[],m=!1,v=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new s(e,t)),1!==h.length||m||o(l)},s.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},2:function(t,n){t.exports=e},3:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),n(7);var o=n(5),i=r(o),a=n(4),l=r(a),s=function(){var e=new i.default({ripple:!0,theming:{},locale:{startYear:1900,endYear:2099,dateFormat:"YYYY-MM-DD",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shorterDays:["S","M","T","W","T","F","S"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],shorterMonths:["J","F","M","A","M","Ju","Ju","A","Se","O","N","D"]}});return Object.defineProperties(e.theming,{metaColors:{get:function(){return l.default.metaColors},set:function(e){l.default.metaColors=e}},theme:{get:function(){return l.default.theme},set:function(e){l.default.theme=e}},enabled:{get:function(){return l.default.enabled},set:function(e){l.default.enabled=e}}}),e};t.default=function(e){e.material||(e.material=s(),e.prototype.$material=e.material)}},399:function(e,t,n){e.exports=n(114)},4:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=(function(e){return e&&e.__esModule?e:{default:e}})(r),i=document.querySelector('[name="msapplication-TileColor"]'),a=document.querySelector('[name="theme-color"]'),l=document.querySelector('[rel="mask-icon"]');t.default=new o.default({data:function(){return{prefix:"md-theme-",theme:"default",enabled:!0,metaColors:!1,themeTarget:document.documentElement}},computed:{fullThemeName:function(){return this.getThemeName()}},watch:{enabled:{immediate:!0,handler:function(){var e=this.fullThemeName,t=this.themeTarget;this.enabled?(t.classList.add(e),this.metaColors&&this.setHtmlMetaColors(e)):(t.classList.remove(e),this.metaColors&&this.setHtmlMetaColors())}},theme:function(e,t){var n=this.getThemeName,r=this.themeTarget;e=n(e),r.classList.remove(n(t)),r.classList.add(e),this.metaColors&&this.setHtmlMetaColors(e)},metaColors:function(e){e?this.setHtmlMetaColors(this.fullThemeName):this.setHtmlMetaColors()}},methods:{getAncestorTheme:function(e){var t=this;if(e){var n=e.mdTheme;return (function e(r){if(r){var o=r.mdTheme,i=r.$parent;return o&&o!==n?o:e(i)}return t.theme})(e.$parent)}return null},getThemeName:function(e){var t=e||this.theme;return this.prefix+t},setMicrosoftColors:function(e){i&&i.setAttribute("content",e)},setThemeColors:function(e){a&&a.setAttribute("content",e)},setMaskColors:function(e){l&&l.setAttribute("color",e)},setHtmlMetaColors:function(e){var t="#fff";if(e){t=window.getComputedStyle(document.documentElement).getPropertyValue("--"+e+"-primary")}t&&(this.setMicrosoftColors(t),this.setThemeColors(t),this.setMaskColors(t))}},created:function(){var e=this;this.enabled&&this.metaColors&&window.addEventListener("load",(function(){e.setHtmlMetaColors(e.fullThemeName)}))}})},5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={};return o.default.util.defineReactive(t,"reactive",e),t.reactive};var r=n(2),o=(function(e){return e&&e.__esModule?e:{default:e}})(r)},6:function(e,t,n){"use strict";function r(e){return!!e&&"object"==typeof e}function o(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||i(e)}function i(e){return e.$$typeof===p}function a(e){return Array.isArray(e)?[]:{}}function l(e,t){return t&&!1===t.clone||!c(e)?e:d(a(e),e,t)}function s(e,t,n){return e.concat(t).map((function(e){return l(e,n)}))}function u(e,t,n){var r={};return c(e)&&Object.keys(e).forEach((function(t){r[t]=l(e[t],n)})),Object.keys(t).forEach((function(o){c(t[o])&&e[o]?r[o]=d(e[o],t[o],n):r[o]=l(t[o],n)})),r}function d(e,t,n){var r=Array.isArray(t),o=Array.isArray(e),i=n||{arrayMerge:s};if(r===o)return r?(i.arrayMerge||s)(e,t,n):u(e,t,n);return l(t,n)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(e){return r(e)&&!o(e)},f="function"==typeof Symbol&&Symbol.for,p=f?Symbol.for("react.element"):60103;d.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return d(e,n,t)}),{})};var h=d;t.default=h},7:function(e,t){},76:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(12),a=r(i),l=n(8),s=r(l),u=["fixed","fixed-last","reveal","overlap","flexible"];t.default={props:{mdMode:o({type:String},(0,s.default)("md-mode",u)),mdWaterfall:Boolean,mdScrollbar:{type:Boolean,default:!0}},data:function(){return{revealTimer:null,revealLastPos:0,manualTick:!1,MdApp:{options:{mode:null,waterfall:!1,flexible:!1},toolbar:{element:null,titleElement:null,height:"0px",initialHeight:0,top:0,titleSize:20,hasElevation:!0,revealActive:!1,fixedLastActive:!1,fixedLastHeight:!1,overlapOff:!1},drawer:{initialWidth:0,active:!1,mode:"temporary",width:0}}}},provide:function(){return{MdApp:this.MdApp}},computed:{contentStyles:function(){var e=this.MdApp.drawer;if(e.active&&"persistent"===e.mode&&"full"===e.submode)return{"padding-left":e.width}},containerStyles:function(){var e=this.MdApp.drawer,t={};return this.mdMode&&"fixed"!==this.mdMode&&(t["margin-top"]=this.MdApp.toolbar.initialHeight+"px"),"persistent"===e.mode&&"mini"===e.submode&&(t["padding-left"]=e.active?0:e.initialWidth+"px"),t},scrollerClasses:function(){if(this.mdScrollbar)return"md-scrollbar"},appClasses:function(){return{"md-waterfall":this.mdWaterfall,"md-flexible":"flexible"===this.mdMode,"md-fixed":"fixed"===this.mdMode,"md-fixed-last":"fixed-last"===this.mdMode,"md-reveal":"reveal"===this.mdMode,"md-overlap":"overlap"===this.mdMode,"md-drawer-active":this.MdApp.drawer.active}}},watch:{mdMode:function(e){this.MdApp.options.mode=e},mdWaterfall:function(e){this.MdApp.options.waterfall=e,this.setToolbarElevation()}},methods:{setToolbarElevation:function(){this.MdApp.toolbar.hasElevation=!this.mdWaterfall},setToolbarTimer:function(e){var t=this;window.clearTimeout(this.revealTimer),this.revealTimer=window.setTimeout((function(){t.revealLastPos=e}),100)},setToolbarMarginAndHeight:function(e,t){this.MdApp.toolbar.top=e,this.MdApp.toolbar.height=t},getToolbarConstrants:function(e){var t=this.MdApp.toolbar.element.offsetHeight,n=t+10,r=e.target.scrollTop;return this.MdApp.toolbar.initialHeight||(this.MdApp.toolbar.initialHeight=t),{toolbarHeight:t,safeAmount:10,threshold:n,scrollTop:r,initialHeight:this.MdApp.toolbar.initialHeight}},handleWaterfallScroll:function(e){var t=this.getToolbarConstrants(e),n=t.threshold,r=t.scrollTop,o=4;"reveal"===this.mdMode&&(o=n),this.MdApp.toolbar.hasElevation=r>=o},handleFlexibleMode:function(e){var t=this.getToolbarConstrants(e),n=t.scrollTop,r=t.initialHeight,o=this.MdApp.toolbar.element,i=o.querySelector(".md-toolbar-row:first-child"),a=i.offsetHeight,l=r-n,s=n<r-a;a&&(o.style.height=s?l+"px":a+"px");var u=this.MdApp.toolbar.titleElement;if(u){var d=this.MdApp.toolbar.titleSize;if(s){var c=Math.max(0,1-(n-d)/(l+d+1e-6))*(d-20)+20;u.style.fontSize=c+"px"}else u.style.fontSize="20px"}var f=this.getToolbarConstrants(e),p=f.threshold,h=f.toolbarHeight;this.setToolbarMarginAndHeight(n-p,h)},handleRevealMode:function(e){var t=this.getToolbarConstrants(e),n=t.toolbarHeight,r=t.safeAmount,o=t.threshold,i=t.scrollTop;this.setToolbarTimer(i),this.setToolbarMarginAndHeight(i-o,n),this.MdApp.toolbar.revealActive=!(i>=o)||this.revealLastPos>i+r},handleFixedLastMode:function(e){var t=this.getToolbarConstrants(e),n=t.scrollTop,r=t.toolbarHeight,o=t.safeAmount,i=this.MdApp.toolbar.element,a=i.querySelector(".md-toolbar-row:first-child"),l=a.offsetHeight;this.setToolbarTimer(n),this.setToolbarMarginAndHeight(n-l,r),this.MdApp.toolbar.fixedLastHeight=l,this.MdApp.toolbar.fixedLastActive=!(n>=l)||this.revealLastPos>n+o},handleOverlapMode:function(e){var t=this.getToolbarConstrants(e),n=t.toolbarHeight,r=t.scrollTop,o=t.initialHeight,i=this.MdApp.toolbar.element,a=i.querySelector(".md-toolbar-row:first-child"),l=a.offsetHeight,s=o-r-100*r/(o-l-l/1.5);l&&(r<o-l&&s>=l?(this.MdApp.toolbar.overlapOff=!1,i.style.height=s+"px"):(this.MdApp.toolbar.overlapOff=!0,i.style.height=l+"px")),this.setToolbarMarginAndHeight(r,n)},handleModeScroll:function(e){"reveal"===this.mdMode?this.handleRevealMode(e):"fixed-last"===this.mdMode?this.handleFixedLastMode(e):"overlap"===this.mdMode?this.handleOverlapMode(e):"flexible"===this.mdMode&&this.handleFlexibleMode(e)},handleScroll:function(e){var t=this;this.MdApp.toolbar.element&&(0,a.default)((function(){t.mdWaterfall&&t.handleWaterfallScroll(e),t.mdMode&&t.handleModeScroll(e)}))}},created:function(){this.MdApp.options.mode=this.mdMode,this.MdApp.options.waterfall=this.mdWaterfall,this.setToolbarElevation()},mounted:function(){var e={target:{scrollTop:0}};"reveal"===this.mdMode&&(this.MdApp.toolbar.revealActive=!0,this.handleRevealMode(e)),"flexible"===this.mdMode&&(this.MdApp.toolbar.revealActive=!0,this.handleFlexibleMode(e)),"fixed-last"===this.mdMode&&(this.MdApp.toolbar.fixedLastActive=!0,this.handleFixedLastMode(e)),"overlap"===this.mdMode&&this.handleOverlapMode(e)}}},8:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=(function(e){return e&&e.__esModule?e:{default:e}})(r);t.default=function(e,t){return{validator:function(n){return!!t.includes(n)||(o.default.util.warn("The "+e+" prop is invalid. Given value: "+n+". Available options: "+t.join(", ")+".",void 0),!1)}}}}})}));
Libraries/Components/Keyboard/Keyboard.js
Livyli/react-native
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Keyboard * @flow */ 'use strict'; const invariant = require('fbjs/lib/invariant'); const NativeEventEmitter = require('NativeEventEmitter'); const KeyboardObserver = require('NativeModules').KeyboardObserver; const dismissKeyboard = require('dismissKeyboard'); const KeyboardEventEmitter = new NativeEventEmitter(KeyboardObserver); type KeyboardEventName = | 'keyboardWillShow' | 'keyboardDidShow' | 'keyboardWillHide' | 'keyboardDidHide' | 'keyboardWillChangeFrame' | 'keyboardDidChangeFrame'; type KeyboardEventData = { endCoordinates: { width: number, height: number, screenX: number, screenY: number, }, }; type KeyboardEventListener = (e: KeyboardEventData) => void; // The following object exists for documentation purposes // Actual work happens in // https://github.com/facebook/react-native/blob/master/Libraries/EventEmitter/NativeEventEmitter.js /** * `Keyboard` module to control keyboard events. * * ### Usage * * The Keyboard module allows you to listen for native events and react to them, as * well as make changes to the keyboard, like dismissing it. * *``` * import React, { Component } from 'react'; * import { Keyboard, TextInput } from 'react-native'; * * class Example extends Component { * componentWillMount () { * this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow); * this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide); * } * * componentWillUnmount () { * this.keyboardDidShowListener.remove(); * this.keyboardDidHideListener.remove(); * } * * _keyboardDidShow () { * alert('Keyboard Shown'); * } * * _keyboardDidHide () { * alert('Keyboard Hidden'); * } * * render() { * return ( * <TextInput * onSubmitEditing={Keyboard.dismiss} * /> * ); * } * } *``` */ let Keyboard = { /** * The `addListener` function connects a JavaScript function to an identified native * keyboard notification event. * * This function then returns the reference to the listener. * * @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for. This *can be any of the following: * * - `keyboardWillShow` * - `keyboardDidShow` * - `keyboardWillHide` * - `keyboardDidHide` * - `keyboardWillChangeFrame` * - `keyboardDidChangeFrame` * * Note that if you set `android:windowSoftInputMode` to `adjustResize` or `adjustNothing`, * only `keyboardDidShow` and `keyboardDidHide` events will available on Android. * * @param {function} callback function to be called when the event fires. */ addListener(eventName: KeyboardEventName, callback: KeyboardEventListener) { invariant(false, 'Dummy method used for documentation'); }, /** * Removes a specific listener. * * @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for. * @param {function} callback function to be called when the event fires. */ removeListener(eventName: KeyboardEventName, callback: Function) { invariant(false, 'Dummy method used for documentation'); }, /** * Removes all listeners for a specific event type. * * @param {string} eventType The native event string listeners are watching which will be removed. */ removeAllListeners(eventName: KeyboardEventName) { invariant(false, 'Dummy method used for documentation'); }, /** * Dismisses the active keyboard and removes focus. */ dismiss() { invariant(false, 'Dummy method used for documentation'); } }; // Throw away the dummy object and reassign it to original module Keyboard = KeyboardEventEmitter; Keyboard.dismiss = dismissKeyboard; module.exports = Keyboard;
src/component/horizontalPostList/postPreview/index.js
Platane/january
import React from 'react' import style from './style.css' import { Image } from '../../image' import type { Post as Post_type } from '../../../../type' export type Props = Post_type export const PostPreview = ({ id, title, medias }: Props) => ( <div className={style.container}> <Image image={medias[0] && medias[0].image} width={180} height={120} label={medias[0] && medias[0].name} borderRadius={6} /> <div className={style.title}>{title}</div> </div> )
test/components/VotingComponent.spec.js
nilshartmann/react-vote-example
import expect from 'expect'; import jsdom from 'mocha-jsdom'; import React from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; import ReactTestUtils from 'react-addons-test-utils'; import VotingComponent from '../../src/common/components/VotingComponent'; import ChoiceBar from '../../src/common/components/ChoiceBar'; import vote from '../fixtures/convertedVote'; describe('VotingComponent', () => { jsdom(); let props, expectedTitles; beforeEach(() => { props = { vote: vote, onRegisterChoice: expect.createSpy(), // only needed to satisfy VotingComponents API onDismissVote: expect.createSpy() }; expectedTitles = vote.choices.map((vote) => vote.title); }); it('properly renders static markup', () => { const result = renderToStaticMarkup(<VotingComponent {...props}/>); expect(result).toBe('<div class="Row VotingRow Spacer"><div class="Head"><h1 class="Title">How is your day?<div class="Badge">20 Votes</div></h1><div class="Description Emphasis">Tell me: how has your day been so far?</div></div><div><div class="ChoiceBar"><div class="Progress" style="width:35%;"><div class="ChoiceBarTitle">Good</div></div><div class="ChoiceBarBadge">7</div></div><div class="ChoiceBar"><div class="Progress" style="width:60%;"><div class="ChoiceBarTitle">Bad</div></div><div class="ChoiceBarBadge">12</div></div><div class="ChoiceBar"><div class="Progress" style="width:5%;"><div class="ChoiceBarTitle">Not sure yet</div></div><div class="ChoiceBarBadge">1</div></div></div><div class="ButtonBar"><div class="Button">Vote later</div></div></div>'); // problem: what is the essence of this test? this breaks easily, we need more abstraction }); // http://simonsmith.io/unit-testing-react-components-without-a-dom/ it('properly renders shallow', () => { const renderer = ReactTestUtils.createRenderer(); renderer.render( <VotingComponent {...props}/> ); const tree = renderer.getRenderOutput(); // console.log(JSON.stringify(tree, null, ' ')); expect(tree.type).toBe('div'); expect(tree.props.children.length).toEqual(3); // head, choices, button bar const choices = tree.props.children[1]; expect(choices.type).toBe('div'); expect(choices.props.children.length).toEqual(3); const renderedChoiceTitles = choices.props.children.map((choice) => choice.props.title); expect(renderedChoiceTitles).toEqual(expectedTitles); // problem: this is brittle, choices have to be at index 1 of children }); it('properly renders', () => { const component = ReactTestUtils.renderIntoDocument( <VotingComponent {...props}/> ); expect(ReactTestUtils.isCompositeComponentWithType(component, VotingComponent)).toExist('Result should be a VotingComponent'); const choiceComponents = ReactTestUtils.findAllInRenderedTree(component, (component) => ReactTestUtils.isCompositeComponentWithType(component, ChoiceBar)); expect(choiceComponents.length).toEqual(3); const renderedTitles = choiceComponents.map((choice) => choice.props.title); expect(renderedTitles).toEqual(expectedTitles); }); it('routes to main on dismiss shallow', () => { const renderer = ReactTestUtils.createRenderer(); renderer.render( <VotingComponent {...props}/> ); const tree = renderer.getRenderOutput(); const buttonBar = tree.props.children[2]; const dismissButton = buttonBar.props.children; dismissButton.props.onClick(); expect(props.onDismissVote.calls.length).toBe(1); // problem: this works, but the path can be tricky, plus it is brittle, plus we are not triggering the event, // but directly triggering the passed property }); it('routes to main on dismiss', () => { const component = ReactTestUtils.renderIntoDocument( <VotingComponent {...props}/> ); const dismissButton = ReactTestUtils.findRenderedDOMComponentWithClass(component, 'Button'); ReactTestUtils.Simulate.click(dismissButton); expect(props.onDismissVote.calls.length).toBe(1); // problem: do we want to render all the choices as well? They play no role in this test }); });
app/components/details.component.js
azothForgotten/Newznab-Frontend
// Import React import React from 'react'; import {Card, CardActions, CardMedia, CardTitle, CardText} from 'material-ui/Card'; class Details extends React.Component { // Render render(){ return( <Card> <CardMedia overlay={<CardTitle title={this.props.title} subtitle={this.props.date} />}> <img src={this.props.artwork} /> </CardMedia> <CardText> {this.props.description} </CardText> <CardActions> {this.props.action} </CardActions> </Card> ) } } // Export export default Details
ajax/libs/babel-standalone/6.19.0/babel.min.js
emmy41124/cdnjs
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Babel=t():e.Babel=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var r=t.slice(1),n=e[t[0]];return function(e,t,i){n.apply(this,[e,t,i].concat(r))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,r){"use strict";function n(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}function i(e,t){return g(t)&&"string"==typeof t[0]?e.hasOwnProperty(t[0])?[e[t[0]]].concat(t.slice(1)):void 0:"string"==typeof t?e[t]:t}function a(e){var t=(e.presets||[]).map(function(e){var t=i(E,e);if(!t)throw new Error('Invalid preset specified in Babel options: "'+e+'"');return g(t)&&"object"===h(t[0])&&t[0].hasOwnProperty("buildPreset")&&(t[0]=d({},t[0],{buildPreset:t[0].buildPreset})),t}),r=(e.plugins||[]).map(function(e){var t=i(b,e);if(!t)throw new Error('Invalid plugin specified in Babel options: "'+e+'"');return t});return d({babelrc:!1},e,{presets:t,plugins:r})}function s(e,t){return v.transform(e,a(t))}function o(e,t,r){return v.transformFromAst(e,t,a(r))}function u(e,t){b.hasOwnProperty(e)&&console.warn('A plugin named "'+e+'" is already registered, it will be overridden'),b[e]=t}function l(e){Object.keys(e).forEach(function(t){return u(t,e[t])})}function c(e,t){E.hasOwnProperty(e)&&console.warn('A preset named "'+e+'" is already registered, it will be overridden'),E[e]=t}function f(e){Object.keys(e).forEach(function(t){return c(t,e[t])})}function p(){window.removeEventListener("DOMContentLoaded",x)}Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.availablePresets=t.availablePlugins=void 0;var d=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},h="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};t.transform=s,t.transformFromAst=o,t.registerPlugin=u,t.registerPlugins=l,t.registerPreset=c,t.registerPresets=f,t.disableScriptTags=p;var m=r(289),v=n(m),y=r(319),g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},b=t.availablePlugins={},E=t.availablePresets={};l({"check-es2015-constants":r(65),"external-helpers":r(320),"syntax-async-functions":r(66),"syntax-async-generators":r(192),"syntax-class-constructor-call":r(193),"syntax-class-properties":r(194),"syntax-decorators":r(125),"syntax-do-expressions":r(195),"syntax-exponentiation-operator":r(196),"syntax-export-extensions":r(197),"syntax-flow":r(67),"syntax-function-bind":r(198),"syntax-function-sent":r(322),"syntax-jsx":r(126),"syntax-object-rest-spread":r(199),"syntax-trailing-function-commas":r(127),"transform-async-functions":r(323),"transform-async-to-generator":r(128),"transform-async-to-module-method":r(325),"transform-class-constructor-call":r(200),"transform-class-properties":r(201),"transform-decorators":r(202),"transform-decorators-legacy":r(326).default,"transform-do-expressions":r(203),"transform-es2015-arrow-functions":r(68),"transform-es2015-block-scoped-functions":r(69),"transform-es2015-block-scoping":r(70),"transform-es2015-classes":r(71),"transform-es2015-computed-properties":r(72),"transform-es2015-destructuring":r(73),"transform-es2015-duplicate-keys":r(129),"transform-es2015-for-of":r(74),"transform-es2015-function-name":r(75),"transform-es2015-instanceof":r(329),"transform-es2015-literals":r(76),"transform-es2015-modules-amd":r(130),"transform-es2015-modules-commonjs":r(77),"transform-es2015-modules-systemjs":r(205),"transform-es2015-modules-umd":r(206),"transform-es2015-object-super":r(78),"transform-es2015-parameters":r(79),"transform-es2015-shorthand-properties":r(80),"transform-es2015-spread":r(81),"transform-es2015-sticky-regex":r(82),"transform-es2015-template-literals":r(83),"transform-es2015-typeof-symbol":r(84),"transform-es2015-unicode-regex":r(85),"transform-es3-member-expression-literals":r(333),"transform-es3-property-literals":r(334),"transform-es5-property-mutators":r(335),"transform-eval":r(336),"transform-exponentiation-operator":r(131),"transform-export-extensions":r(207),"transform-flow-comments":r(337),"transform-flow-strip-types":r(208),"transform-function-bind":r(209),"transform-jscript":r(338),"transform-object-assign":r(339),"transform-object-rest-spread":r(210),"transform-object-set-prototype-of-to-assign":r(340),"transform-proto-to-assign":r(341),"transform-react-constant-elements":r(342),"transform-react-display-name":r(211),"transform-react-inline-elements":r(343),"transform-react-jsx":r(212),"transform-react-jsx-compat":r(344),"transform-react-jsx-self":r(345),"transform-react-jsx-source":r(346),"transform-regenerator":r(86),"transform-runtime":r(352),"transform-strict-mode":r(215),"undeclared-variables-check":r(353)}),f({es2015:r(216),es2016:r(217),es2017:r(218),latest:r(354),react:r(355),"stage-0":r(356),"stage-1":r(219),"stage-2":r(220),"stage-3":r(221),"es2015-no-commonjs":{plugins:[r(83),r(76),r(75),r(68),r(69),r(71),r(78),r(80),r(72),r(74),r(82),r(85),r(65),r(81),r(79),r(73),r(70),r(84),[r(86),{async:!1,asyncGenerators:!1}]]},"es2015-loose":{plugins:[[r(83),{loose:!0}],r(76),r(75),r(68),r(69),[r(71),{loose:!0}],r(78),r(80),r(129),[r(72),{loose:!0}],[r(74),{loose:!0}],r(82),r(85),r(65),[r(81),{loose:!0}],r(79),[r(73),{loose:!0}],r(70),r(84),[r(77),{loose:!0}],[r(86),{async:!1,asyncGenerators:!1}]]}});var x=(t.version=v.version,function(){return(0,y.runScripts)(s)});"undefined"!=typeof window&&window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",x,!1)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=te["is"+e];t||(t=te["is"+e]=function(t,r){return te.is(e,t,r)}),te["assert"+e]=function(r,n){if(n=n||{},!t(r,n))throw new Error("Expected type "+(0,M.default)(e)+" with option "+(0,M.default)(n))}}function s(e,t,r){if(!t)return!1;var n=o(t.type,e);return!!n&&("undefined"==typeof r||te.shallowEqual(t,r))}function o(e,t){if(e===t)return!0;if(te.ALIAS_KEYS[t])return!1;var r=te.FLIPPED_ALIAS_KEYS[t];if(r){if(r[0]===e)return!0;for(var n=r,i=Array.isArray(n),a=0,n=i?n:(0,O.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;if(e===o)return!0}}return!1}function u(e,t,r){if(e){var n=te.NODE_FIELDS[e.type];if(n){var i=n[t];i&&i.validate&&(i.optional&&null==r||i.validate(e,t,r))}}}function l(e,t){for(var r=(0,R.default)(t),n=r,i=Array.isArray(n),a=0,n=i?n:(0,O.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;if(e[o]!==t[o])return!1}return!0}function c(e,t,r){return e.object=te.memberExpression(e.object,e.property,e.computed),e.property=t,e.computed=!!r,e}function f(e,t){return e.object=te.memberExpression(t,e.object),e}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";return e[t]=te.toBlock(e[t],e)}function d(e){var t={};for(var r in e)"_"!==r[0]&&(t[r]=e[r]);return t}function h(e){var t=d(e);return delete t.loc,t}function m(e){var t={};for(var r in e)if("_"!==r[0]){var n=e[r];n&&(n.type?n=te.cloneDeep(n):Array.isArray(n)&&(n=n.map(te.cloneDeep))),t[r]=n}return t}function v(e,t){var r=e.split(".");return function(e){if(!te.isMemberExpression(e))return!1;for(var n=[e],i=0;n.length;){var a=n.shift();if(t&&i===r.length)return!0;if(te.isIdentifier(a)){if(r[i]!==a.name)return!1}else{if(!te.isStringLiteral(a)){if(te.isMemberExpression(a)){if(a.computed&&!te.isStringLiteral(a.property))return!1;n.push(a.object),n.push(a.property);continue}return!1}if(r[i]!==a.value)return!1}if(++i>r.length)return!1}return!0}}function y(e){for(var t=te.COMMENT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,O.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;delete e[a]}return e}function g(e,t){return b(e,t),E(e,t),x(e,t),e}function b(e,t){A("trailingComments",e,t)}function E(e,t){A("leadingComments",e,t)}function x(e,t){A("innerComments",e,t)}function A(e,t,r){t&&r&&(t[e]=(0,$.default)((0,q.default)([].concat(t[e],r[e]))))}function _(e,t){if(!e||!t)return e;for(var r=te.INHERIT_KEYS.optional,n=Array.isArray(r),i=0,r=n?r:(0,O.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a;null==e[s]&&(e[s]=t[s])}for(var o in t)"_"===o[0]&&(e[o]=t[o]);for(var u=te.INHERIT_KEYS.force,l=Array.isArray(u),c=0,u=l?u:(0,O.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;e[p]=t[p]}return te.inheritsComments(e,t),e}function D(e){if(!C(e))throw new TypeError("Not a valid node "+(e&&e.type))}function C(e){return!(!e||!Q.VISITOR_KEYS[e.type])}function S(e,t,r){if(e){var n=te.VISITOR_KEYS[e.type];if(n){r=r||{},t(e,r);for(var i=n,a=Array.isArray(i),s=0,i=a?i:(0,O.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o,l=e[u];if(Array.isArray(l))for(var c=l,f=Array.isArray(c),p=0,c=f?c:(0,O.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;S(h,t,r)}else S(l,t,r)}}}}function w(e,t){t=t||{};for(var r=t.preserveComments?ae:se,n=r,i=Array.isArray(n),a=0,n=i?n:(0,O.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;null!=e[o]&&(e[o]=void 0)}for(var u in e)"_"===u[0]&&null!=e[u]&&(e[u]=void 0);for(var l=(0,P.default)(e),c=l,f=Array.isArray(c),p=0,c=f?c:(0,O.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;e[h]=null}}function F(e,t){return S(e,w,t),e}t.__esModule=!0,t.createTypeAnnotationBasedOnTypeof=t.removeTypeDuplicates=t.createUnionTypeAnnotation=t.valueToNode=t.toBlock=t.toExpression=t.toStatement=t.toBindingIdentifierName=t.toIdentifier=t.toKeyAlias=t.toSequenceExpression=t.toComputedKey=t.isNodesEquivalent=t.isImmutable=t.isScope=t.isSpecifierDefault=t.isVar=t.isBlockScoped=t.isLet=t.isValidIdentifier=t.isReferenced=t.isBinding=t.getOuterBindingIdentifiers=t.getBindingIdentifiers=t.TYPES=t.react=t.DEPRECATED_KEYS=t.BUILDER_KEYS=t.NODE_FIELDS=t.ALIAS_KEYS=t.VISITOR_KEYS=t.NOT_LOCAL_BINDING=t.BLOCK_SCOPED_SYMBOL=t.INHERIT_KEYS=t.UNARY_OPERATORS=t.STRING_UNARY_OPERATORS=t.NUMBER_UNARY_OPERATORS=t.BOOLEAN_UNARY_OPERATORS=t.BINARY_OPERATORS=t.NUMBER_BINARY_OPERATORS=t.BOOLEAN_BINARY_OPERATORS=t.COMPARISON_BINARY_OPERATORS=t.EQUALITY_BINARY_OPERATORS=t.BOOLEAN_NUMBER_BINARY_OPERATORS=t.UPDATE_OPERATORS=t.LOGICAL_OPERATORS=t.COMMENT_KEYS=t.FOR_INIT_KEYS=t.FLATTENABLE_KEYS=t.STATEMENT_OR_BLOCK_KEYS=void 0;var k=r(358),P=i(k),T=r(2),O=i(T),B=r(20),R=i(B),I=r(34),M=i(I),N=r(134);Object.defineProperty(t,"STATEMENT_OR_BLOCK_KEYS",{enumerable:!0,get:function(){return N.STATEMENT_OR_BLOCK_KEYS}}),Object.defineProperty(t,"FLATTENABLE_KEYS",{enumerable:!0,get:function(){return N.FLATTENABLE_KEYS}}),Object.defineProperty(t,"FOR_INIT_KEYS",{enumerable:!0,get:function(){return N.FOR_INIT_KEYS}}),Object.defineProperty(t,"COMMENT_KEYS",{enumerable:!0,get:function(){return N.COMMENT_KEYS}}),Object.defineProperty(t,"LOGICAL_OPERATORS",{enumerable:!0,get:function(){return N.LOGICAL_OPERATORS}}),Object.defineProperty(t,"UPDATE_OPERATORS",{enumerable:!0,get:function(){return N.UPDATE_OPERATORS}}),Object.defineProperty(t,"BOOLEAN_NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return N.BOOLEAN_NUMBER_BINARY_OPERATORS}}),Object.defineProperty(t,"EQUALITY_BINARY_OPERATORS",{enumerable:!0,get:function(){return N.EQUALITY_BINARY_OPERATORS}}),Object.defineProperty(t,"COMPARISON_BINARY_OPERATORS",{enumerable:!0,get:function(){return N.COMPARISON_BINARY_OPERATORS}}),Object.defineProperty(t,"BOOLEAN_BINARY_OPERATORS",{enumerable:!0,get:function(){return N.BOOLEAN_BINARY_OPERATORS}}),Object.defineProperty(t,"NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return N.NUMBER_BINARY_OPERATORS}}),Object.defineProperty(t,"BINARY_OPERATORS",{enumerable:!0,get:function(){return N.BINARY_OPERATORS}}),Object.defineProperty(t,"BOOLEAN_UNARY_OPERATORS",{enumerable:!0,get:function(){return N.BOOLEAN_UNARY_OPERATORS}}),Object.defineProperty(t,"NUMBER_UNARY_OPERATORS",{enumerable:!0,get:function(){return N.NUMBER_UNARY_OPERATORS}}),Object.defineProperty(t,"STRING_UNARY_OPERATORS",{enumerable:!0,get:function(){return N.STRING_UNARY_OPERATORS}}),Object.defineProperty(t,"UNARY_OPERATORS",{enumerable:!0,get:function(){return N.UNARY_OPERATORS}}),Object.defineProperty(t,"INHERIT_KEYS",{enumerable:!0,get:function(){return N.INHERIT_KEYS}}),Object.defineProperty(t,"BLOCK_SCOPED_SYMBOL",{enumerable:!0,get:function(){return N.BLOCK_SCOPED_SYMBOL}}),Object.defineProperty(t,"NOT_LOCAL_BINDING",{enumerable:!0,get:function(){return N.NOT_LOCAL_BINDING}}),t.is=s,t.isType=o,t.validate=u,t.shallowEqual=l,t.appendToMemberExpression=c,t.prependToMemberExpression=f,t.ensureBlock=p,t.clone=d,t.cloneWithoutLoc=h,t.cloneDeep=m,t.buildMatchMemberExpression=v,t.removeComments=y,t.inheritsComments=g,t.inheritTrailingComments=b,t.inheritLeadingComments=E,t.inheritInnerComments=x,t.inherits=_,t.assertNode=D,t.isNode=C,t.traverseFast=S,t.removeProperties=w,t.removePropertiesDeep=F;var L=r(225);Object.defineProperty(t,"getBindingIdentifiers",{enumerable:!0,get:function(){return L.getBindingIdentifiers}}),Object.defineProperty(t,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return L.getOuterBindingIdentifiers}});var j=r(393);Object.defineProperty(t,"isBinding",{enumerable:!0,get:function(){return j.isBinding}}),Object.defineProperty(t,"isReferenced",{enumerable:!0,get:function(){return j.isReferenced}}),Object.defineProperty(t,"isValidIdentifier",{enumerable:!0,get:function(){return j.isValidIdentifier}}),Object.defineProperty(t,"isLet",{enumerable:!0,get:function(){return j.isLet}}),Object.defineProperty(t,"isBlockScoped",{enumerable:!0,get:function(){return j.isBlockScoped}}),Object.defineProperty(t,"isVar",{enumerable:!0,get:function(){return j.isVar}}),Object.defineProperty(t,"isSpecifierDefault",{enumerable:!0,get:function(){return j.isSpecifierDefault}}),Object.defineProperty(t,"isScope",{enumerable:!0,get:function(){return j.isScope}}),Object.defineProperty(t,"isImmutable",{enumerable:!0,get:function(){return j.isImmutable}}),Object.defineProperty(t,"isNodesEquivalent",{enumerable:!0,get:function(){return j.isNodesEquivalent}});var U=r(383);Object.defineProperty(t,"toComputedKey",{enumerable:!0,get:function(){return U.toComputedKey}}),Object.defineProperty(t,"toSequenceExpression",{enumerable:!0,get:function(){return U.toSequenceExpression}}),Object.defineProperty(t,"toKeyAlias",{enumerable:!0,get:function(){return U.toKeyAlias}}),Object.defineProperty(t,"toIdentifier",{enumerable:!0,get:function(){return U.toIdentifier}}),Object.defineProperty(t,"toBindingIdentifierName",{enumerable:!0,get:function(){return U.toBindingIdentifierName}}),Object.defineProperty(t,"toStatement",{enumerable:!0,get:function(){return U.toStatement}}),Object.defineProperty(t,"toExpression",{enumerable:!0,get:function(){return U.toExpression}}),Object.defineProperty(t,"toBlock",{enumerable:!0,get:function(){return U.toBlock}}),Object.defineProperty(t,"valueToNode",{enumerable:!0,get:function(){return U.valueToNode}});var V=r(391);Object.defineProperty(t,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return V.createUnionTypeAnnotation}}),Object.defineProperty(t,"removeTypeDuplicates",{enumerable:!0,get:function(){return V.removeTypeDuplicates}}),Object.defineProperty(t,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return V.createTypeAnnotationBasedOnTypeof}});var G=r(621),W=i(G),Y=r(577),q=i(Y),K=r(110),H=i(K),J=r(111),X=i(J),z=r(603),$=i(z);r(388);var Q=r(28),Z=r(392),ee=n(Z),te=t;t.VISITOR_KEYS=Q.VISITOR_KEYS,t.ALIAS_KEYS=Q.ALIAS_KEYS,t.NODE_FIELDS=Q.NODE_FIELDS,t.BUILDER_KEYS=Q.BUILDER_KEYS,t.DEPRECATED_KEYS=Q.DEPRECATED_KEYS,t.react=ee;for(var re in te.VISITOR_KEYS)a(re);te.FLIPPED_ALIAS_KEYS={},(0,X.default)(te.ALIAS_KEYS,function(e,t){(0,X.default)(e,function(e){var r=te.FLIPPED_ALIAS_KEYS[e]=te.FLIPPED_ALIAS_KEYS[e]||[];r.push(t)})}),(0,X.default)(te.FLIPPED_ALIAS_KEYS,function(e,t){te[t.toUpperCase()+"_TYPES"]=e,a(t)});t.TYPES=(0,R.default)(te.VISITOR_KEYS).concat((0,R.default)(te.FLIPPED_ALIAS_KEYS)).concat((0,R.default)(te.DEPRECATED_KEYS));(0,X.default)(te.BUILDER_KEYS,function(e,t){function r(){if(arguments.length>e.length)throw new Error("t."+t+": Too many arguments passed. Received "+arguments.length+" but can receive no more than "+e.length);var r={};r.type=t;for(var n=0,i=e,a=Array.isArray(i),s=0,i=a?i:(0,O.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var l=o,c=te.NODE_FIELDS[t][l],f=arguments[n++];void 0===f&&(f=(0,H.default)(c.default)),r[l]=f}for(var p in r)u(r,p,r[p]);return r}te[t]=r,te[t[0].toLowerCase()+t.slice(1)]=r});var ne=function(e){function t(t){return function(){return console.trace("The node type "+e+" has been renamed to "+r),t.apply(this,arguments)}}var r=te.DEPRECATED_KEYS[e];te[e]=te[e[0].toLowerCase()+e.slice(1)]=t(te[r]),te["is"+e]=t(te["is"+r]),te["assert"+e]=t(te["assert"+r])};for(var ie in te.DEPRECATED_KEYS)ne(ie);(0,W.default)(te),(0,W.default)(te.VISITOR_KEYS);var ae=["tokens","start","end","loc","raw","rawValue"],se=te.COMMENT_KEYS.concat(["comments"]).concat(ae)},function(e,t,r){e.exports={default:r(401),__esModule:!0}},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){e=(0,l.default)(e);var r=e,n=r.program;return t.length&&(0,m.default)(e,A,null,t),n.body.length>1?n.body:n.body[0]}t.__esModule=!0;var s=r(9),o=i(s);t.default=function(e,t){var r=void 0;try{throw new Error}catch(e){e.stack&&(r=e.stack.split("\n").slice(1).join("\n"))}t=(0,f.default)({allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,preserveComments:!1},t);var n=function(){var i=void 0;try{i=y.parse(e,t),i=m.default.removeProperties(i,{preserveComments:t.preserveComments}),m.default.cheap(i,function(e){e[E]=!0})}catch(e){throw e.stack=e.stack+"from\n"+r,e}return n=function(){return i},i};return function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return a(n(),t)}};var u=r(575),l=i(u),c=r(173),f=i(c),p=r(272),d=i(p),h=r(8),m=i(h),v=r(135),y=n(v),g=r(1),b=n(g),E="_fromTemplate",x=(0,o.default)(),A={noScope:!0,enter:function(e,t){var r=e.node;if(r[x])return e.skip();b.isExpressionStatement(r)&&(r=r.expression);var n=void 0;if(b.isIdentifier(r)&&r[E])if((0,d.default)(t[0],r.name))n=t[0][r.name];else if("$"===r.name[0]){var i=+r.name.slice(1);t[i]&&(n=t[i])}null===n&&e.remove(),n&&(n[x]=!0,e.replaceInline(n))},exit:function(e){var t=e.node;t.loc||m.default.clearNode(t)}};e.exports=t.default},function(e,t){var r=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(361),a=n(i),s=r(9),o=n(s),u="function"==typeof o.default&&"symbol"==typeof a.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};t.default="function"==typeof o.default&&"symbol"===u(a.default)?function(e){return"undefined"==typeof e?"undefined":u(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":"undefined"==typeof e?"undefined":u(e)}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r,n,i){if(e){if(t||(t={}),!t.noScope&&!r&&"Program"!==e.type&&"File"!==e.type)throw new Error(y.get("traverseNeedsParent",e.type));m.explode(t),a.node(e,t,r,n,i)}}function s(e,t){e.node.type===t.type&&(t.has=!0,e.stop())}t.__esModule=!0,t.visitors=t.Hub=t.Scope=t.NodePath=void 0;var o=r(2),u=i(o),l=r(35);Object.defineProperty(t,"NodePath",{enumerable:!0,get:function(){return i(l).default}});var c=r(133);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i(c).default}});var f=r(222);Object.defineProperty(t,"Hub",{enumerable:!0,get:function(){return i(f).default}}),t.default=a;var p=r(365),d=i(p),h=r(382),m=n(h),v=r(19),y=n(v),g=r(112),b=i(g),E=r(1),x=n(E),A=r(88),_=n(A);t.visitors=m,a.visitors=m,a.verify=m.verify,a.explode=m.explode,a.NodePath=r(35),a.Scope=r(133),a.Hub=r(222),a.cheap=function(e,t){return x.traverseFast(e,t)},a.node=function(e,t,r,n,i,a){var s=x.VISITOR_KEYS[e.type];if(s)for(var o=new d.default(r,t,n,i),l=s,c=Array.isArray(l),f=0,l=c?l:(0,u.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var h=p;if((!a||!a[h])&&o.visit(e,h))return}},a.clearNode=function(e,t){x.removeProperties(e,t),_.path.delete(e)},a.removeProperties=function(e,t){return x.traverseFast(e,a.clearNode,t),e},a.hasType=function(e,t,r,n){if((0,b.default)(n,e.type))return!1;if(e.type===r)return!0;var i={has:!1,type:r};return a(e,{blacklist:n,enter:s},t,i),i.has},a.clearCache=function(){_.clear()},a.clearCache.clearPath=_.clearPath,a.clearCache.clearScope=_.clearScope,a.copyCache=function(e,t){_.path.has(e)&&_.path.set(t,_.path.get(e))}},function(e,t,r){e.exports={default:r(411),__esModule:!0}},function(e,t,r){var n=r(148)("wks"),i=r(96),a=r(14).Symbol,s="function"==typeof a,o=e.exports=function(e){return n[e]||(n[e]=s&&a[e]||(s?a:i)("Symbol."+e))};o.store=n},function(e,t){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=r},function(e,t){function r(e){return null!=e&&"object"==typeof e}e.exports=r},function(e,t,r){e.exports={default:r(406),__esModule:!0}},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){function n(e){return null==e?void 0===e?u:o:(e=Object(e),l&&l in e?a(e):s(e))}var i=r(44),a=r(532),s=r(558),o="[object Null]",u="[object Undefined]",l=i?i.toStringTag:void 0;e.exports=n},function(e,t,r){var n=r(261),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var s=a>=0?arguments[a]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,i="/"===s.charAt(0))}return t=r(n(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===s(e,-1);return e=r(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),a=n(r.split("/")),s=Math.min(i.length,a.length),o=s,u=0;u<s;u++)if(i[u]!==a[u]){o=u;break}for(var l=[],u=o;u<i.length;u++)l.push("..");return l=l.concat(a.slice(o)),l.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=a(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},t.basename=function(e,t){var r=a(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){return a(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(t,r(18))},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function a(e){if(f===clearTimeout)return clearTimeout(e);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function s(){m&&d&&(m=!1,d.length?h=d.concat(h):v=-1,h.length&&o())}function o(){if(!m){var e=i(s);m=!0;for(var t=h.length;t;){for(d=h,h=[];++v<t;)d&&d[v].run();v=-1,t=h.length}d=null,m=!1,a(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,f,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(e){c=r}try{f="function"==typeof clearTimeout?clearTimeout:n}catch(e){f=n}}();var d,h=[],m=!1,v=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new u(e,t)),1!==h.length||m||i(o)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=f[e];if(!i)throw new ReferenceError("Unknown message "+(0,u.default)(e));return r=s(r),i.replace(/\$(\d+)/g,function(e,t){return r[t-1]})}function s(e){return e.map(function(e){if(null!=e&&e.inspect)return e.inspect();try{return(0,u.default)(e)||e+""}catch(t){return c.inspect(e)}})}t.__esModule=!0,t.MESSAGES=void 0;var o=r(34),u=i(o);t.get=a,t.parseArgs=s;var l=r(117),c=n(l),f=t.MESSAGES={tailCallReassignmentDeopt:"Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence",classesIllegalBareSuper:"Illegal use of bare super",classesIllegalSuperCall:"Direct super call is illegal in non-constructor, use super.$1() instead",scopeDuplicateDeclaration:"Duplicate declaration $1",settersNoRest:"Setters aren't allowed to have a rest",noAssignmentsInForHead:"No assignments allowed in for-in/of head",expectedMemberExpressionOrIdentifier:"Expected type MemberExpression or Identifier",invalidParentForThisNode:"We don't know how to handle this node within the current parent - please open an issue",readOnly:"$1 is read-only",unknownForHead:"Unknown node type $1 in ForStatement",didYouMean:"Did you mean $1?",codeGeneratorDeopt:"Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",missingTemplatesDirectory:"no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues",unsupportedOutputType:"Unsupported output type $1",illegalMethodName:"Illegal method name $1",lostTrackNodePath:"We lost track of this node's position, likely because the AST was directly manipulated",modulesIllegalExportName:"Illegal export $1",modulesDuplicateDeclarations:"Duplicate module declarations with the same source but in different scopes",undeclaredVariable:"Reference to undeclared variable $1",undeclaredVariableType:"Referencing a type alias outside of a type annotation",undeclaredVariableSuggestion:"Reference to undeclared variable $1 - did you mean $2?",traverseNeedsParent:"You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a $1 node without passing scope and parentPath.",traverseVerifyRootFunction:"You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?",traverseVerifyVisitorProperty:"You passed `traverse()` a visitor object with the property $1 that has the invalid property $2",traverseVerifyNodeType:"You gave us a visitor for the node type $1 but it's not a valid type",pluginNotObject:"Plugin $2 specified in $1 was expected to return an object when invoked but returned $3",pluginNotFunction:"Plugin $2 specified in $1 was expected to return a function but returned $3",pluginUnknown:"Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4",pluginInvalidProperty:"Plugin $2 specified in $1 provided an invalid property of $3"}},function(e,t,r){e.exports={default:r(408),__esModule:!0}},function(e,t,r){var n=r(24);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){e.exports=!r(36)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(14),i=r(5),a=r(53),s=r(30),o="prototype",u=function(e,t,r){var l,c,f,p=e&u.F,d=e&u.G,h=e&u.S,m=e&u.P,v=e&u.B,y=e&u.W,g=d?i:i[t]||(i[t]={}),b=g[o],E=d?n:h?n[t]:(n[t]||{})[o];d&&(r=t);for(l in r)c=!p&&E&&void 0!==E[l],c&&l in g||(f=c?E[l]:r[l],g[l]=d&&"function"!=typeof E[l]?r[l]:v&&c?a(f,n):y&&E[l]==f?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t[o]=e[o],t}(f):m&&"function"==typeof f?a(Function.call,f):f,m&&((g.virtual||(g.virtual={}))[l]=f,e&u.R&&b&&!b[l]&&s(b,l,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(21),i=r(230),a=r(151),s=Object.defineProperty;t.f=r(22)?Object.defineProperty:function(e,t,r){if(n(e),t=a(t,!0),n(r),i)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){function n(e){return null!=e&&a(e.length)&&!i(e)}var i=r(115),a=r(174);e.exports=n},function(e,t,r){function n(e){return s(e)?i(e):a(e)}var i=r(245),a=r(494),s=r(26);e.exports=n},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return Array.isArray(e)?"array":null===e?"null":void 0===e?"undefined":"undefined"==typeof e?"undefined":(0,g.default)(e)}function s(e){function t(t,r,n){if(Array.isArray(n))for(var i=0;i<n.length;i++)e(t,r+"["+i+"]",n[i])}return t.each=e,t}function o(){function e(e,t,n){if(r.indexOf(n)<0)throw new TypeError("Property "+t+" expected value to be one of "+(0,v.default)(r)+" but got "+(0,v.default)(n))}for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.oneOf=r,e}function u(){function e(e,t,n){for(var i=!1,a=r,s=Array.isArray(a),o=0,a=s?a:(0,h.default)(a);;){var u;if(s){if(o>=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u;if(E.is(l,n)){i=!0;break}}if(!i)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,v.default)(r)+" but instead got "+(0,v.default)(n&&n.type))}for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.oneOfNodeTypes=r,e}function l(){function e(e,t,n){for(var i=!1,s=r,o=Array.isArray(s),u=0,s=o?s:(0,h.default)(s);;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l;if(a(n)===c||E.is(c,n)){i=!0;break}}if(!i)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,v.default)(r)+" but instead got "+(0,v.default)(n&&n.type))}for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.oneOfNodeOrValueTypes=r,e}function c(e){function t(t,r,n){var i=a(n)===e;if(!i)throw new TypeError("Property "+r+" expected type of "+e+" but got "+a(n))}return t.type=e,t}function f(){function e(){for(var e=r,t=Array.isArray(e),n=0,e=t?e:(0,h.default)(e);;){var i;if(t){if(n>=e.length)break;i=e[n++]}else{if(n=e.next(),n.done)break;i=n.value}var a=i;a.apply(void 0,arguments)}}for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.chainOf=r,e}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.inherits&&S[t.inherits]||{};t.fields=t.fields||r.fields||{},t.visitor=t.visitor||r.visitor||[],t.aliases=t.aliases||r.aliases||[],t.builder=t.builder||r.builder||t.visitor||[],t.deprecatedAlias&&(C[t.deprecatedAlias]=e);for(var n=t.visitor.concat(t.builder),i=Array.isArray(n),s=0,n=i?n:(0,h.default)(n);;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{if(s=n.next(),s.done)break;o=s.value}var u=o;t.fields[u]=t.fields[u]||{}}for(var l in t.fields){var f=t.fields[l];t.builder.indexOf(l)===-1&&(f.optional=!0),void 0===f.default?f.default=null:f.validate||(f.validate=c(a(f.default)))}x[e]=t.visitor,D[e]=t.builder,_[e]=t.fields,A[e]=t.aliases,S[e]=t}t.__esModule=!0,t.DEPRECATED_KEYS=t.BUILDER_KEYS=t.NODE_FIELDS=t.ALIAS_KEYS=t.VISITOR_KEYS=void 0;var d=r(2),h=i(d),m=r(34),v=i(m),y=r(7),g=i(y);t.assertEach=s,t.assertOneOf=o,t.assertNodeType=u,t.assertNodeOrValueType=l,t.assertValueType=c,t.chain=f,t.default=p;var b=r(1),E=n(b),x=t.VISITOR_KEYS={},A=t.ALIAS_KEYS={},_=t.NODE_FIELDS={},D=t.BUILDER_KEYS={},C=t.DEPRECATED_KEYS={},S={}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(25),i=r(93);e.exports=r(22)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){function n(e,t,r,n){var s=!r;r||(r={});for(var o=-1,u=t.length;++o<u;){var l=t[o],c=n?n(r[l],e[l],l,r,e):void 0;void 0===c&&(c=e[l]),s?a(r,l,c):i(r,l,c)}return r}var i=r(160),a=r(161);e.exports=n},function(e,t){"use strict";e.exports={filename:{type:"filename",description:"filename to use when reading from stdin - this will be used in source-maps, errors etc",default:"unknown",shorthand:"f"},filenameRelative:{hidden:!0,type:"string"},inputSourceMap:{hidden:!0},env:{hidden:!0,default:{}},mode:{description:"",hidden:!0},retainLines:{type:"boolean",default:!1,description:"retain line numbers - will result in really ugly code"},highlightCode:{description:"enable/disable ANSI syntax highlighting of code frames (on by default)",type:"boolean",default:!0},suppressDeprecationMessages:{type:"boolean",default:!1,hidden:!0},presets:{type:"list",description:"",default:[]},plugins:{type:"list",default:[],description:""},ignore:{type:"list",description:"list of glob paths to **not** compile",default:[]},only:{type:"list",description:"list of glob paths to **only** compile"},code:{hidden:!0,default:!0,type:"boolean"},metadata:{hidden:!0,default:!0,type:"boolean"},ast:{hidden:!0,default:!0,type:"boolean"},extends:{type:"string",hidden:!0},comments:{type:"boolean",default:!0,description:"write comments to generated output (true by default)"},shouldPrintComment:{hidden:!0,description:"optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"},wrapPluginVisitorMethod:{hidden:!0,description:"optional callback to wrap all visitor methods"},compact:{type:"booleanString",default:"auto",description:"do not include superfluous whitespace characters and line terminators [true|false|auto]"},minified:{type:"boolean",default:!1,description:"save as much bytes when printing [true|false]"},sourceMap:{alias:"sourceMaps",hidden:!0},sourceMaps:{type:"booleanString",description:"[true|false|inline]",default:!1,shorthand:"s"},sourceMapTarget:{type:"string",description:"set `file` on returned source map"},sourceFileName:{type:"string",description:"set `sources[0]` on returned source map"},sourceRoot:{type:"filename",description:"the root from which all sources are relative"},babelrc:{description:"Whether or not to look up .babelrc and .babelignore files",type:"boolean",default:!0},sourceType:{description:"",default:"module"},auxiliaryCommentBefore:{type:"string",description:"print a comment before any injected non-user code"},auxiliaryCommentAfter:{type:"string",description:"print a comment after any injected non-user code"},resolveModuleSource:{hidden:!0},getModuleId:{hidden:!0},moduleRoot:{type:"filename",description:"optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"},moduleIds:{type:"boolean",default:!1,shorthand:"M",description:"insert an explicit id for modules"},moduleId:{description:"specify a custom name for module ids",type:"string"},passPerPreset:{description:"Whether to spawn a traversal pass per a preset. By default all presets are merged.",type:"boolean",default:!1,hidden:!0},parserOpts:{description:"Options to pass into the parser, or to change parsers (parserOpts.parser)",default:!1},generatorOpts:{description:"Options to pass into the generator, or to change generators (generatorOpts.generator)",default:!1}}},function(e,t,r){(function(n){"use strict";function i(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}function a(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var s=r(364),o=a(s),u=r(34),l=a(u),c=r(87),f=a(c),p=r(2),d=a(p),h=r(7),m=a(h),v=r(3),y=a(v),g=r(179),b=i(g),E=r(64),x=a(E),A=r(19),_=i(A),D=r(50),C=r(118),S=a(C),w=r(576),F=a(w),k=r(110),P=a(k),T=r(290),O=a(T),B=r(32),R=a(B),I=r(52),M=a(I),N=r(49),L=a(N),j=r(17),U=a(j),V=function(){function e(t){(0,y.default)(this,e),this.resolvedConfigs=[],this.options=e.createBareOptions(),this.log=t}return e.memoisePluginContainer=function(t,r,n,i){for(var a=e.memoisedPlugins,s=Array.isArray(a),o=0,a=s?a:(0,d.default)(a);;){var u;if(s){if(o>=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u;if(l.container===t)return l.plugin}var c=void 0;if(c="function"==typeof t?t(b):t,"object"===("undefined"==typeof c?"undefined":(0,m.default)(c))){var f=new x.default(c,i);return e.memoisedPlugins.push({container:t,plugin:f}),f}throw new TypeError(_.get("pluginNotObject",r,n,"undefined"==typeof c?"undefined":(0,m.default)(c))+r+n)},e.createBareOptions=function(){var e={};for(var t in R.default){var r=R.default[t];e[t]=(0,P.default)(r.default)}return e},e.normalisePlugin=function(t,r,n,i){if(t=t.__esModule?t.default:t,!(t instanceof x.default)){if("function"!=typeof t&&"object"!==("undefined"==typeof t?"undefined":(0,m.default)(t)))throw new TypeError(_.get("pluginNotFunction",r,n,"undefined"==typeof t?"undefined":(0,m.default)(t)));t=e.memoisePluginContainer(t,r,n,i)}return t.init(r,n),t},e.normalisePlugins=function(t,n,i){return i.map(function(i,a){var s=void 0,o=void 0;if(!i)throw new TypeError("Falsy value found in plugins");Array.isArray(i)?(s=i[0],o=i[1]):s=i;var u="string"==typeof s?s:t+"$"+a;if("string"==typeof s){var l=(0,S.default)("babel-plugin-"+s,n)||(0,S.default)(s,n);if(!l)throw new ReferenceError(_.get("pluginUnknown",s,t,a,n));s=r(181)(l)}return s=e.normalisePlugin(s,t,a,u),[s,o]})},e.prototype.mergeOptions=function(t){var r=this,i=t.options,a=t.extending,s=t.alias,o=t.loc,u=t.dirname;if(s=s||"foreign",i){("object"!==("undefined"==typeof i?"undefined":(0,m.default)(i))||Array.isArray(i))&&this.log.error("Invalid options type for "+s,TypeError);var l=(0,F.default)(i,function(e){if(e instanceof x.default)return e});u=u||n.cwd(),o=o||s;for(var c in l){var p=R.default[c];if(!p&&this.log)if(M.default[c])this.log.error("Using removed Babel 5 option: "+s+"."+c+" - "+M.default[c].message,ReferenceError);else{var d="Unknown option: "+s+"."+c+". Check out http://babeljs.io/docs/usage/options/ for more information about options.",h="A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.";this.log.error(d+"\n\n"+h,ReferenceError)}}(0,D.normaliseOptions)(l),l.plugins&&(l.plugins=e.normalisePlugins(o,u,l.plugins)),l.presets&&(l.passPerPreset?l.presets=this.resolvePresets(l.presets,u,function(e,t){r.mergeOptions({options:e,extending:e,alias:t,loc:t,dirname:u})}):(this.mergePresets(l.presets,u),delete l.presets)),i===a?(0,f.default)(a,l):(0,O.default)(a||this.options,l)}},e.prototype.mergePresets=function(e,t){var r=this;this.resolvePresets(e,t,function(e,t){r.mergeOptions({options:e,alias:t,loc:t,dirname:U.default.dirname(t||"")})})},e.prototype.resolvePresets=function(e,t,n){return e.map(function(e){var i=void 0;if(Array.isArray(e)){if(e.length>2)throw new Error("Unexpected extra options "+(0,l.default)(e.slice(2))+" passed to preset.");var a=e;e=a[0],i=a[1]}var s=void 0;try{if("string"==typeof e){if(s=(0,S.default)("babel-preset-"+e,t)||(0,S.default)(e,t),!s){var u=e.match(/^(@[^\/]+)\/(.+)$/);if(u){var c=u[1],f=u[2];e=c+"/babel-preset-"+f,s=(0,S.default)(e,t)}}if(!s)throw new Error("Couldn't find preset "+(0,l.default)(e)+" relative to directory "+(0,l.default)(t));e=r(181)(s)}if("object"===("undefined"==typeof e?"undefined":(0,m.default)(e))&&e.__esModule)if(e.default)e=e.default;else{var p=e,d=(p.__esModule,(0,o.default)(p,["__esModule"]));e=d}if("object"===("undefined"==typeof e?"undefined":(0,m.default)(e))&&e.buildPreset&&(e=e.buildPreset),"function"!=typeof e&&void 0!==i)throw new Error("Options "+(0,l.default)(i)+" passed to "+(s||"a preset")+" which does not accept options.");if("function"==typeof e&&(e=e(b,i)),"object"!==("undefined"==typeof e?"undefined":(0,m.default)(e)))throw new Error("Unsupported preset format: "+e+".");n&&n(e,s)}catch(e){throw s&&(e.message+=" (While processing preset: "+(0,l.default)(s)+")"),e}return e})},e.prototype.normaliseOptions=function(){var e=this.options;for(var t in R.default){var r=R.default[t],n=e[t];!n&&r.optional||(r.alias?e[r.alias]=e[r.alias]||n:e[t]=n)}},e.prototype.init=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,L.default)(e,this.log),r=Array.isArray(t),n=0,t=r?t:(0,d.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;this.mergeOptions(a)}return this.normaliseOptions(e),this.options},e}();t.default=V,V.memoisedPlugins=[],e.exports=t.default}).call(t,r(18))},function(e,t,r){e.exports={default:r(402),__esModule:!0}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a),o=r(3),u=i(o),l=r(223),c=n(l),f=r(238),p=i(f),d=r(458),h=i(d),m=r(8),v=i(m),y=r(173),g=i(y),b=r(133),E=i(b),x=r(1),A=n(x),_=r(88),D=(0,p.default)("babel"),C=function(){function e(t,r){(0,u.default)(this,e),this.parent=r,this.hub=t,this.contexts=[],this.data={},this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.state=null,this.opts=null,this.skipKeys=null,this.parentPath=null,this.context=null,this.container=null,this.listKey=null,this.inList=!1,this.parentKey=null,this.key=null,this.node=null,this.scope=null,this.type=null,this.typeAnnotation=null}return e.get=function(t){var r=t.hub,n=t.parentPath,i=t.parent,a=t.container,s=t.listKey,o=t.key;!r&&n&&(r=n.hub),(0,h.default)(i,"To get a node path the parent needs to exist");var u=a[o],l=_.path.get(i)||[];_.path.has(i)||_.path.set(i,l);for(var c=void 0,f=0;f<l.length;f++){var p=l[f];if(p.node===u){c=p;break}}return c||(c=new e(r,i),l.push(c)),c.setup(n,a,s,o),c},e.prototype.getScope=function(e){var t=e;return this.isScope()&&(t=new E.default(this,e)),t},e.prototype.setData=function(e,t){return this.data[e]=t},e.prototype.getData=function(e,t){var r=this.data[e];return!r&&t&&(r=this.data[e]=t),r},e.prototype.buildCodeFrameError=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:SyntaxError;return this.hub.file.buildCodeFrameError(this.node,e,t)},e.prototype.traverse=function(e,t){(0,v.default)(this.node,e,this.scope,t,this)},e.prototype.mark=function(e,t){this.hub.file.metadata.marked.push({type:e,message:t,loc:this.node.loc})},e.prototype.set=function(e,t){A.validate(this.node,e,t),this.node[e]=t},e.prototype.getPathLocation=function(){var e=[],t=this;do{var r=t.key;t.inList&&(r=t.listKey+"["+r+"]"),e.unshift(r)}while(t=t.parentPath);return e.join(".")},e.prototype.debug=function(e){D.enabled&&D(this.getPathLocation()+" "+this.type+": "+e())},e}();t.default=C,(0,g.default)(C.prototype,r(366)),(0,g.default)(C.prototype,r(372)),(0,g.default)(C.prototype,r(380)),(0,g.default)(C.prototype,r(370)),(0,g.default)(C.prototype,r(369)),(0,g.default)(C.prototype,r(375)),(0,g.default)(C.prototype,r(368)),(0,g.default)(C.prototype,r(379)),(0,g.default)(C.prototype,r(378)),(0,g.default)(C.prototype,r(371)),(0,g.default)(C.prototype,r(367));for(var S=function(){if(F){if(k>=w.length)return"break";P=w[k++]}else{if(k=w.next(),k.done)return"break";P=k.value}var e=P,t="is"+e;C.prototype[t]=function(e){return A[t](this.node,e)},C.prototype["assert"+e]=function(r){if(!this[t](r))throw new TypeError("Expected node path of type "+e)}},w=A.TYPES,F=Array.isArray(w),k=0,w=F?w:(0,s.default)(w);;){var P,T=S();if("break"===T)break}var O=function(e){if("_"===e[0])return"continue";A.TYPES.indexOf(e)<0&&A.TYPES.push(e);var t=c[e];C.prototype["is"+e]=function(e){return t.checkPath(this,e)}};for(var B in c){O(B)}e.exports=t.default},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(141),i=r(89);e.exports=function(e){return n(i(e))}},function(e,t,r){function n(e,t){var r=a(e,t);return i(r)?r:void 0}var i=r(491),a=r(533);e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r,n){if(e.selfReference){if(!n.hasBinding(r.name)||n.hasGlobal(r.name)){if(!p.isFunction(t))return;var i=d;t.generator&&(i=h);var a=i({FUNCTION:t,FUNCTION_ID:r,FUNCTION_KEY:n.generateUidIdentifier(r.name)}).expression;a.callee._skipModulesRemap=!0;for(var s=a.callee.body.body[0].params,o=0,l=(0,u.default)(t);o<l;o++)s.push(n.generateUidIdentifier("x"));return a}n.rename(r.name)}t.id=r,n.getProgramParent().references[r.name]=!0}function s(e,t,r){var n={selfAssignment:!1,selfReference:!1,outerDeclar:r.getBindingIdentifier(t),references:[],name:t},i=r.getOwnBinding(t);return i?"param"===i.kind&&(n.selfReference=!0):(n.outerDeclar||r.hasGlobal(t))&&r.traverse(e,m,n),n}t.__esModule=!0,t.default=function(e){var t=e.node,r=e.parent,n=e.scope,i=e.id;if(!t.id){if(!p.isObjectProperty(r)&&!p.isObjectMethod(r,{kind:"method"})||r.computed&&!p.isLiteral(r.key)){if(p.isVariableDeclarator(r)){if(i=r.id,p.isIdentifier(i)){var o=n.parent.getBinding(i.name);if(o&&o.constant&&n.getBinding(i.name)===o)return t.id=i,void(t.id[p.NOT_LOCAL_BINDING]=!0)}}else if(p.isAssignmentExpression(r))i=r.left;else if(!i)return}else i=r.key;var u=void 0;if(i&&p.isLiteral(i))u=i.value;else{if(!i||!p.isIdentifier(i))return;u=i.name}u=p.toBindingIdentifierName(u),i=p.identifier(u),i[p.NOT_LOCAL_BINDING]=!0;var l=s(t,u,n);return a(l,t,i,n)||t}};var o=r(186),u=i(o),l=r(4),c=i(l),f=r(1),p=n(f),d=(0,c.default)("\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n"),h=(0,c.default)("\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n"),m={"ReferencedIdentifier|BindingIdentifier":function(e,t){if(e.node.name===t.name){var r=e.scope.getBindingIdentifier(t.name);r===t.outerDeclar&&(t.selfReference=!0,e.stop())}}};e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(359),a=n(i),s=r(13),o=n(s),u=r(7),l=n(u);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":(0,l.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.default?(0,a.default)(e,t):e.__proto__=t)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(7),a=n(i);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":(0,a.default)(t))&&"function"!=typeof t?e:t}},function(e,t,r){var n=r(236),i=r(140);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t,r){var n=r(16),i=n.Symbol;e.exports=i},function(e,t){function r(e,t){return e===t||e!==e&&t!==t}e.exports=r},function(e,t,r){function n(e){return s(e)?i(e,!0):a(e)}var i=r(245),a=r(495),s=r(26);e.exports=n},function(e,t,r){function n(e){var t=i(e),r=t%1;return t===t?r?t-r:t:0}var i=r(599);e.exports=n},function(e,t,r){(function(e){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.File=void 0;var a=r(7),s=i(a),o=r(2),u=i(o),l=r(13),c=i(l),f=r(87),p=i(f),d=r(3),h=i(d),m=r(42),v=i(m),y=r(41),g=i(y),b=r(191),E=i(b),x=r(121),A=n(x),_=r(400),D=i(_),C=r(33),S=i(C),w=r(296),F=i(w),k=r(8),P=i(k),T=r(287),O=i(T),B=r(182),R=i(B),I=r(178),M=i(I),N=r(271),L=i(N),j=r(120),U=i(j),V=r(119),G=i(V),W=r(135),Y=r(122),q=n(Y),K=r(17),H=i(K),J=r(1),X=n(J),z=r(118),$=i(z),Q=r(293),Z=i(Q),ee=r(294),te=i(ee),re=/^#!.*/,ne=[[Z.default],[te.default]],ie={enter:function(e,t){var r=e.node.loc;r&&(t.loc=r,e.stop())}},ae=function(t){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1];(0,h.default)(this,n);var i=(0,v.default)(this,t.call(this));return i.pipeline=r,i.log=new U.default(i,e.filename||"unknown"),i.opts=i.initOptions(e),i.parserOpts={sourceType:i.opts.sourceType,sourceFileName:i.opts.filename,plugins:[]},i.pluginVisitors=[],i.pluginPasses=[],i.buildPluginsForOptions(i.opts),i.opts.passPerPreset&&(i.perPresetOpts=[],i.opts.presets.forEach(function(e){var t=(0,p.default)((0,c.default)(i.opts),e);i.perPresetOpts.push(t),i.buildPluginsForOptions(t)})),i.metadata={usedHelpers:[],marked:[],modules:{imports:[],exports:{exported:[],specifiers:[]}}},i.dynamicImportTypes={},i.dynamicImportIds={},i.dynamicImports=[],i.declarations={},i.usedHelpers={},i.path=null,i.ast={},i.code="",i.shebang="",i.hub=new k.Hub(i),i}return(0,g.default)(n,t),n.prototype.getMetadata=function(){for(var e=!1,t=this.ast.program.body,r=Array.isArray(t),n=0,t=r?t:(0,u.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;if(X.isModuleDeclaration(a)){e=!0;break}}e&&this.path.traverse(A,this)},n.prototype.initOptions=function(e){e=new S.default(this.log,this.pipeline).init(e),e.inputSourceMap&&(e.sourceMaps=!0),e.moduleId&&(e.moduleIds=!0),e.basename=H.default.basename(e.filename,H.default.extname(e.filename)),e.ignore=q.arrayify(e.ignore,q.regexify),e.only&&(e.only=q.arrayify(e.only,q.regexify)),(0,L.default)(e,{moduleRoot:e.sourceRoot}),(0,L.default)(e,{sourceRoot:e.moduleRoot}),(0,L.default)(e,{filenameRelative:e.filename});var t=H.default.basename(e.filenameRelative);return(0,L.default)(e,{sourceFileName:t,sourceMapTarget:t}),e},n.prototype.buildPluginsForOptions=function(e){if(Array.isArray(e.plugins)){for(var t=e.plugins.concat(ne),r=[],n=[],i=t,a=Array.isArray(i),s=0,i=a?i:(0,u.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var l=o,c=l[0],f=l[1];r.push(c.visitor),n.push(new F.default(this,c,f)),c.manipulateOptions&&c.manipulateOptions(e,this.parserOpts,this)}this.pluginVisitors.push(r),this.pluginPasses.push(n)}},n.prototype.getModuleName=function(){var e=this.opts;if(!e.moduleIds)return null;if(null!=e.moduleId&&!e.getModuleId)return e.moduleId;var t=e.filenameRelative,r="";if(null!=e.moduleRoot&&(r=e.moduleRoot+"/"),!e.filenameRelative)return r+e.filename.replace(/^\//,"");if(null!=e.sourceRoot){var n=new RegExp("^"+e.sourceRoot+"/?");t=t.replace(n,"")}return t=t.replace(/\.(\w*?)$/,""),r+=t,r=r.replace(/\\/g,"/"),e.getModuleId?e.getModuleId(r)||r:r},n.prototype.resolveModuleSource=function e(t){var e=this.opts.resolveModuleSource;return e&&(t=e(t,this.opts.filename)),t},n.prototype.addImport=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=e+":"+t,i=this.dynamicImportIds[n];if(!i){e=this.resolveModuleSource(e),i=this.dynamicImportIds[n]=this.scope.generateUidIdentifier(r);var a=[];"*"===t?a.push(X.importNamespaceSpecifier(i)):"default"===t?a.push(X.importDefaultSpecifier(i)):a.push(X.importSpecifier(i,X.identifier(t)));var s=X.importDeclaration(a,X.stringLiteral(e));s._blockHoist=3,this.path.unshiftContainer("body",s)}return i},n.prototype.addHelper=function(e){var t=this.declarations[e];if(t)return t;this.usedHelpers[e]||(this.metadata.usedHelpers.push(e),this.usedHelpers[e]=!0);var r=this.get("helperGenerator"),n=this.get("helpersNamespace");if(r){var i=r(e);if(i)return i}else if(n)return X.memberExpression(n,X.identifier(e));var a=(0,E.default)(e),s=this.declarations[e]=this.scope.generateUidIdentifier(e);return X.isFunctionExpression(a)&&!a.id?(a.body._compact=!0,a._generated=!0,a.id=s,a.type="FunctionDeclaration",this.path.unshiftContainer("body",a)):(a._compact=!0,this.scope.push({id:s,init:a,unique:!0})),s},n.prototype.addTemplateObject=function(e,t,r){var n=r.elements.map(function(e){return e.value}),i=e+"_"+r.elements.length+"_"+n.join(","),a=this.declarations[i];if(a)return a;var s=this.declarations[i]=this.scope.generateUidIdentifier("templateObject"),o=this.addHelper(e),u=X.callExpression(o,[t,r]);return u._compact=!0,this.scope.push({id:s,init:u,_blockHoist:1.9}),s},n.prototype.buildCodeFrameError=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SyntaxError,n=e&&(e.loc||e._loc),i=new r(t);return n?i.loc=n.start:((0,P.default)(e,ie,this.scope,i),i.message+=" (This is an error on an internal node. Probably an internal error",i.loc&&(i.message+=". Location has been estimated."),i.message+=")"),i},n.prototype.mergeSourceMap=function(e){var t=this.opts.inputSourceMap;if(!t)return e;var r=function(){var r=new O.default.SourceMapConsumer(t),n=new O.default.SourceMapConsumer(e),i=new O.default.SourceMapGenerator({file:r.file,sourceRoot:r.sourceRoot}),a=n.sources[0];r.eachMapping(function(e){var t=n.generatedPositionFor({line:e.generatedLine,column:e.generatedColumn,source:a});null!=t.column&&i.addMapping({source:e.source,original:null==e.source?null:{line:e.originalLine,column:e.originalColumn},generated:t})});var s=i.toJSON();return t.mappings=s.mappings,{v:t}}();return"object"===("undefined"==typeof r?"undefined":(0,s.default)(r))?r.v:void 0},n.prototype.parse=function(t){var n=W.parse,i=this.opts.parserOpts;if(i&&(i=(0,p.default)({},this.parserOpts,i),i.parser)){if("string"==typeof i.parser){var a=H.default.dirname(this.opts.filename)||e.cwd(),s=(0,$.default)(i.parser,a);if(!s)throw new Error("Couldn't find parser "+i.parser+' with "parse" method relative to directory '+a);n=r(180)(s).parse}else n=i.parser;i.parser={parse:function(e){return(0,W.parse)(e,i)}}}this.log.debug("Parse start");var o=n(t,i||this.parserOpts);return this.log.debug("Parse stop"),o},n.prototype._addAst=function(e){this.path=k.NodePath.get({hub:this.hub,parentPath:null,parent:e,container:e,key:"program"}).setContext(),this.scope=this.path.scope,this.ast=e,this.getMetadata()},n.prototype.addAst=function(e){this.log.debug("Start set AST"),this._addAst(e),this.log.debug("End set AST")},n.prototype.transform=function(){for(var e=0;e<this.pluginPasses.length;e++){var t=this.pluginPasses[e];this.call("pre",t),this.log.debug("Start transform traverse");var r=P.default.visitors.merge(this.pluginVisitors[e],t,this.opts.wrapPluginVisitorMethod);(0,P.default)(this.ast,r,this.scope),this.log.debug("End transform traverse"),this.call("post",t)}return this.generate()},n.prototype.wrap=function(t,r){t+="";try{return this.shouldIgnore()?this.makeResult({code:t,ignored:!0}):r()}catch(r){if(r._babel)throw r;r._babel=!0;var n=r.message=this.opts.filename+": "+r.message,i=r.loc;if(i&&(r.codeFrame=(0,M.default)(t,i.line,i.column+1,this.opts),n+="\n"+r.codeFrame),e.browser&&(r.message=n),r.stack){var a=r.stack.replace(r.message,n);r.stack=a}throw r}},n.prototype.addCode=function(e){e=(e||"")+"",e=this.parseInputSourceMap(e),this.code=e},n.prototype.parseCode=function(){this.parseShebang();var e=this.parse(this.code);this.addAst(e)},n.prototype.shouldIgnore=function(){var e=this.opts;return q.shouldIgnore(e.filename,e.ignore,e.only)},n.prototype.call=function(e,t){for(var r=t,n=Array.isArray(r),i=0,r=n?r:(0,u.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a,o=s.plugin,l=o[e];l&&l.call(s,this)}},n.prototype.parseInputSourceMap=function(e){var t=this.opts;if(t.inputSourceMap!==!1){var r=D.default.fromSource(e);r&&(t.inputSourceMap=r.toObject(),e=D.default.removeComments(e))}return e},n.prototype.parseShebang=function(){var e=re.exec(this.code);e&&(this.shebang=e[0],this.code=this.code.replace(re,""))},n.prototype.makeResult=function(e){var t=e.code,r=e.map,n=e.ast,i=e.ignored,a={metadata:null,options:this.opts,ignored:!!i,code:null,ast:null,map:r||null};return this.opts.code&&(a.code=t),this.opts.ast&&(a.ast=n),this.opts.metadata&&(a.metadata=this.metadata),a},n.prototype.generate=function(){var t=this.opts,n=this.ast,i={ast:n};if(!t.code)return this.makeResult(i);var a=R.default;if(t.generatorOpts.generator&&(a=t.generatorOpts.generator,"string"==typeof a)){var s=H.default.dirname(this.opts.filename)||e.cwd(),o=(0,$.default)(a,s);if(!o)throw new Error("Couldn't find generator "+a+' with "print" method relative to directory '+s);a=r(180)(o).print}this.log.debug("Generation start");var u=a(n,t.generatorOpts?(0,p.default)(t,t.generatorOpts):t,this.code);return i.code=u.code,i.map=u.map,this.log.debug("Generation end"),this.shebang&&(i.code=this.shebang+"\n"+i.code),i.map&&(i.map=this.mergeSourceMap(i.map)),"inline"!==t.sourceMaps&&"both"!==t.sourceMaps||(i.code+="\n"+D.default.fromObject(i.map).toComment()),"inline"===t.sourceMaps&&(i.map=null),this.makeResult(i)},n}(G.default);t.default=ae,t.File=ae}).call(t,r(18))},function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=x[e];return null==t?x[e]=E.default.existsSync(e):t}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],r=e.filename,n=new S(t);return e.babelrc!==!1&&n.findConfigs(r),n.mergeConfig({options:e,alias:"base",dirname:r&&g.default.dirname(r)}),n.configs}t.__esModule=!0;var o=r(87),u=i(o),l=r(3),c=i(l);t.default=s;var f=r(118),p=i(f),d=r(465),h=i(d),m=r(607),v=i(m),y=r(17),g=i(y),b=r(116),E=i(b),x={},A={},_=".babelignore",D=".babelrc",C="package.json",S=function(){function e(t){(0,c.default)(this,e),this.resolvedConfigs=[],this.configs=[],this.log=t}return e.prototype.findConfigs=function(e){if(e){(0,v.default)(e)||(e=g.default.join(n.cwd(),e));for(var t=!1,r=!1;e!==(e=g.default.dirname(e));){if(!t){var i=g.default.join(e,D);a(i)&&(this.addConfig(i),t=!0);var s=g.default.join(e,C);!t&&a(s)&&(t=this.addConfig(s,"babel",JSON))}if(!r){var o=g.default.join(e,_);a(o)&&(this.addIgnoreConfig(o),r=!0)}if(r&&t)return}}},e.prototype.addIgnoreConfig=function(e){var t=E.default.readFileSync(e,"utf8"),r=t.split("\n");r=r.map(function(e){return e.replace(/#(.*?)$/,"").trim()}).filter(function(e){return!!e}),r.length&&this.mergeConfig({options:{ignore:r},alias:e,dirname:g.default.dirname(e)})},e.prototype.addConfig=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.default;if(this.resolvedConfigs.indexOf(e)>=0)return!1;this.resolvedConfigs.push(e);var n=E.default.readFileSync(e,"utf8"),i=void 0;try{i=A[n]=A[n]||r.parse(n),t&&(i=i[t])}catch(t){throw t.message=e+": Error while parsing JSON - "+t.message,t}return this.mergeConfig({options:i,alias:e,dirname:g.default.dirname(e)}),!!i},e.prototype.mergeConfig=function(e){var t=e.options,r=e.alias,i=e.loc,a=e.dirname;if(!t)return!1;if(t=(0,u.default)({},t),a=a||n.cwd(),i=i||r,t.extends){var s=(0,p.default)(t.extends,a);s?this.addConfig(s):this.log&&this.log.error("Couldn't resolve extends clause of "+t.extends+" in "+r),delete t.extends}this.configs.push({options:t,alias:r,loc:i,dirname:a});var o=void 0,l=n.env.BABEL_ENV||"production"||"development";t.env&&(o=t.env[l],delete t.env),this.mergeConfig({options:o,alias:r+".env."+l,dirname:a})},e}();e.exports=t.default}).call(t,r(18))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(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}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e){var r=e[t];if(null!=r){var n=l.default[t];if(n&&n.alias&&(n=l.default[n.alias]),n){var i=o[n.type];i&&(r=i(r)),e[t]=r}}}return e}t.__esModule=!0,t.config=void 0,t.normaliseOptions=a;var s=r(51),o=i(s),u=r(32),l=n(u);t.config=l.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return!!e}function s(e){return f.booleanify(e)}function o(e){ return f.list(e)}t.__esModule=!0,t.filename=void 0,t.boolean=a,t.booleanString=s,t.list=o;var u=r(283),l=i(u),c=r(122),f=n(c);t.filename=l.default},function(e,t){"use strict";e.exports={auxiliaryComment:{message:"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"},blacklist:{message:"Put the specific transforms you want in the `plugins` option"},breakConfig:{message:"This is not a necessary option in Babel 6"},experimental:{message:"Put the specific transforms you want in the `plugins` option"},externalHelpers:{message:"Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"},extra:{message:""},jsxPragma:{message:"use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"},loose:{message:"Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."},metadataUsedHelpers:{message:"Not required anymore as this is enabled by default"},modules:{message:"Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"},nonStandard:{message:"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"},optional:{message:"Put the specific transforms you want in the `plugins` option"},sourceMapName:{message:"Use the `sourceMapTarget` option"},stage:{message:"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"},whitelist:{message:"Put the specific transforms you want in the `plugins` option"}}},function(e,t,r){var n=r(415);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports={}},function(e,t,r){var n=r(96)("meta"),i=r(24),a=r(29),s=r(25).f,o=0,u=Object.isExtensible||function(){return!0},l=!r(36)(function(){return u(Object.preventExtensions({}))}),c=function(e){s(e,n,{value:{i:"O"+ ++o,w:{}}})},f=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,n)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[n].i},p=function(e,t){if(!a(e,n)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[n].w},d=function(e){return l&&h.NEED&&u(e)&&!a(e,n)&&c(e),e},h=e.exports={KEY:n,NEED:!1,fastKey:f,getWeak:p,onFreeze:d}},function(e,t,r){r(438);for(var n=r(14),i=r(30),a=r(54),s=r(10)("toStringTag"),o=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var l=o[u],c=n[l],f=c&&c.prototype;f&&!f[s]&&i(f,s,l),a[l]=a.Array}},function(e,t){function r(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}e.exports=r},function(e,t,r){function n(e){return"function"==typeof e?e:null==e?s:"object"==typeof e?o(e)?a(e[0],e[1]):i(e):u(e)}var i=r(496),a=r(497),s=r(59),o=r(6),u=r(594);e.exports=n},function(e,t){function r(e){return e}e.exports=r},function(e,t,r){function n(e){return"symbol"==typeof e||a(e)&&i(e)==s}var i=r(15),a=r(12),s="[object Symbol]";e.exports=n},function(e,t,r){function n(e){return null==e?"":i(e)}var i=r(164);e.exports=n},function(e,t){function r(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')}function n(e){var t=e.match(v);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var r=e,a=n(e);if(a){if(!a.path)return e;r=a.path}for(var s,o=t.isAbsolute(r),u=r.split(/\/+/),l=0,c=u.length-1;c>=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=o?"/":"."),a?(a.path=r,i(a)):r}function s(e,t){""===e&&(e="."),""===t&&(t=".");var r=n(t),s=n(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||t.match(y))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var o="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=o,i(s)):o}function o(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}function u(e){return e}function l(e){return f(e)?"$"+e:e}function c(e){return f(e)?e.slice(1):e}function f(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,t,r){var n=e.source-t.source;return 0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n||r?n:(n=e.generatedColumn-t.generatedColumn,0!==n?n:(n=e.generatedLine-t.generatedLine,0!==n?n:e.name-t.name))))}function d(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n?n:(n=e.generatedColumn-t.generatedColumn,0!==n||r?n:(n=e.source-t.source,0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n?n:e.name-t.name))))}function h(e,t){return e===t?0:e>t?1:-1}function m(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r?r:(r=e.generatedColumn-t.generatedColumn,0!==r?r:(r=h(e.source,t.source),0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r?r:h(e.name,t.name)))))}t.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,y=/^data:.+\,.+$/;t.urlParse=n,t.urlGenerate=i,t.normalize=a,t.join=s,t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(v)},t.relative=o;var g=function(){var e=Object.create(null);return!("__proto__"in e)}();t.toSetString=g?u:l,t.fromSetString=g?u:c,t.compareByOriginalPositions=p,t.compareByGeneratedPositionsDeflated=d,t.compareByGeneratedPositionsInflated=m},function(e,t,r){(function(t){"use strict";function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}function a(e){return Object.prototype.toString.call(e)}function s(e){return!i(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function o(e){if(E.isFunction(e)){if(_)return e.name;var t=e.toString(),r=t.match(C);return r&&r[1]}}function u(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function l(e){if(_||!E.isFunction(e))return E.inspect(e);var t=o(e),r=t?": "+t:"";return"[Function"+r+"]"}function c(e){return u(l(e.actual),128)+" "+e.operator+" "+u(l(e.expected),128)}function f(e,t,r,n,i){throw new D.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function p(e,t){e||f(e,!0,t,"==",D.ok)}function d(e,t,r,o){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(E.isDate(e)&&E.isDate(t))return e.getTime()===t.getTime();if(E.isRegExp(e)&&E.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(s(e)&&s(t)&&a(e)===a(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;o=o||{actual:[],expected:[]};var u=o.actual.indexOf(e);return u!==-1&&u===o.expected.indexOf(t)||(o.actual.push(e),o.expected.push(t),m(e,t,r,o))}return r?e===t:e==t}function h(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function m(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(E.isPrimitive(e)||E.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=h(e),a=h(t);if(i&&!a||!i&&a)return!1;if(i)return e=A.call(e),t=A.call(t),d(e,t,r);var s,o,u=S(e),l=S(t);if(u.length!==l.length)return!1;for(u.sort(),l.sort(),o=u.length-1;o>=0;o--)if(u[o]!==l[o])return!1;for(o=u.length-1;o>=0;o--)if(s=u[o],!d(e[s],t[s],r,n))return!1;return!0}function v(e,t,r){d(e,t,!0)&&f(e,t,r,"notDeepStrictEqual",v)}function y(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&t.call({},e)===!0}function g(e){var t;try{e()}catch(e){t=e}return t}function b(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=g(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&f(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!e&&E.isError(i),o=!e&&i&&!r;if((s&&a&&y(i,r)||o)&&f(i,r,"Got unwanted exception"+n),e&&i&&r&&!y(i,r)||!e&&i)throw i}var E=r(117),x=Object.prototype.hasOwnProperty,A=Array.prototype.slice,_=function(){return"foo"===function(){}.name}(),D=e.exports=p,C=/\s*function\s+([^\(\s]*)\s*/;D.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var t=e.stackStartFunction||f;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=o(t),a=n.indexOf("\n"+i);if(a>=0){var s=n.indexOf("\n",a+1);n=n.substring(s+1)}this.stack=n}}},E.inherits(D.AssertionError,Error),D.fail=f,D.ok=p,D.equal=function(e,t,r){e!=t&&f(e,t,r,"==",D.equal)},D.notEqual=function(e,t,r){e==t&&f(e,t,r,"!=",D.notEqual)},D.deepEqual=function(e,t,r){d(e,t,!1)||f(e,t,r,"deepEqual",D.deepEqual)},D.deepStrictEqual=function(e,t,r){d(e,t,!0)||f(e,t,r,"deepStrictEqual",D.deepStrictEqual)},D.notDeepEqual=function(e,t,r){d(e,t,!1)&&f(e,t,r,"notDeepEqual",D.notDeepEqual)},D.notDeepStrictEqual=v,D.strictEqual=function(e,t,r){e!==t&&f(e,t,r,"===",D.strictEqual)},D.notStrictEqual=function(e,t,r){e===t&&f(e,t,r,"!==",D.notStrictEqual)},D.throws=function(e,t,r){b(!0,e,t,r)},D.doesNotThrow=function(e,t,r){b(!1,e,t,r)},D.ifError=function(e){if(e)throw e};var S=Object.keys||function(e){var t=[];for(var r in e)x.call(e,r)&&t.push(r);return t}}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a),o=r(3),u=i(o),l=r(42),c=i(l),f=r(41),p=i(f),d=r(33),h=i(d),m=r(19),v=n(m),y=r(119),g=i(y),b=r(8),E=i(b),x=r(173),A=i(x),_=r(110),D=i(_),C=["enter","exit"],S=function(e){function t(r,n){(0,u.default)(this,t);var i=(0,c.default)(this,e.call(this));return i.initialized=!1,i.raw=(0,A.default)({},r),i.key=i.take("name")||n,i.manipulateOptions=i.take("manipulateOptions"),i.post=i.take("post"),i.pre=i.take("pre"),i.visitor=i.normaliseVisitor((0,D.default)(i.take("visitor"))||{}),i}return(0,p.default)(t,e),t.prototype.take=function(e){var t=this.raw[e];return delete this.raw[e],t},t.prototype.chain=function(e,t){if(!e[t])return this[t];if(!this[t])return e[t];var r=[e[t],this[t]];return function(){for(var e=void 0,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=r,o=Array.isArray(a),u=0,a=o?a:(0,s.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;if(c){var f=c.apply(this,n);null!=f&&(e=f)}}return e}},t.prototype.maybeInherit=function(e){var t=this.take("inherits");t&&(t=h.default.normalisePlugin(t,e,"inherits"),this.manipulateOptions=this.chain(t,"manipulateOptions"),this.post=this.chain(t,"post"),this.pre=this.chain(t,"pre"),this.visitor=E.default.visitors.merge([t.visitor,this.visitor]))},t.prototype.init=function(e,t){if(!this.initialized){this.initialized=!0,this.maybeInherit(e);for(var r in this.raw)throw new Error(v.get("pluginInvalidProperty",e,t,r))}},t.prototype.normaliseVisitor=function(e){for(var t=C,r=Array.isArray(t),n=0,t=r?t:(0,s.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;if(e[a])throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. Please target individual nodes.")}return E.default.explode(e),e},t}(g.default);t.default=S,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){var t=e.messages;return{visitor:{Scope:function(e){var r=e.scope;for(var n in r.bindings){var i=r.bindings[n];if("const"===i.kind||"module"===i.kind)for(var s=i.constantViolations,o=Array.isArray(s),u=0,s=o?s:(0,a.default)(s);;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l;throw c.buildCodeFrameError(t.get("readOnly",n))}}}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("asyncFunctions")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("flow")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{ArrowFunctionExpression:function(e,r){if(r.opts.spec){var n=e.node;if(n.shadow)return;n.shadow={this:!1},n.type="FunctionExpression";var i=t.thisExpression();i._forceShadow=e,e.ensureBlock(),e.get("body").unshiftContainer("body",t.expressionStatement(t.callExpression(r.addHelper("newArrowCheck"),[t.thisExpression(),i]))),e.replaceWith(t.callExpression(t.memberExpression(n,t.identifier("bind")),[t.thisExpression()]))}else e.arrowFunctionToShadowed()}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){function t(e,t){for(var n=t.get(e),i=n,s=Array.isArray(i),o=0,i=s?i:(0,a.default)(i);;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u,c=l.node;if(l.isFunctionDeclaration()){var f=r.variableDeclaration("let",[r.variableDeclarator(c.id,r.toExpression(c))]);f._blockHoist=2,c.id=null,l.replaceWith(f)}}}var r=e.types;return{visitor:{BlockStatement:function(e){var n=e.node,i=e.parent;r.isFunction(i,{body:n})||r.isExportDeclaration(i)||t("body",e)},SwitchCase:function(e){t("consequent",e)}}}},e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return E.isLoop(e.parent)||E.isCatchClause(e.parent)}function s(e){return!!E.isVariableDeclaration(e)&&(!!e[E.BLOCK_SCOPED_SYMBOL]||("let"===e.kind||"const"===e.kind))}function o(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t||(t=e.node),!E.isFor(r))for(var a=0;a<t.declarations.length;a++){var s=t.declarations[a];s.init=s.init||n.buildUndefinedNode()}if(t[E.BLOCK_SCOPED_SYMBOL]=!0,t.kind="var",i){var o=n.getFunctionParent(),u=e.getBindingIdentifiers();for(var l in u){var c=n.getOwnBinding(l);c&&(c.kind="var"),n.moveBindingTo(l,o)}}}function u(e){return E.isVariableDeclaration(e,{kind:"var"})&&!s(e)}function l(e){return E.isBreakStatement(e)?"break":E.isContinueStatement(e)?"continue":void 0}t.__esModule=!0;var c=r(9),f=i(c),p=r(13),d=i(p),h=r(3),m=i(h);t.default=function(){return{visitor:{VariableDeclaration:function(e,t){var r=e.node,n=e.parent,i=e.scope;if(s(r)&&(o(e,null,n,i,!0),r._tdzThis)){for(var a=[r],u=0;u<r.declarations.length;u++){var l=r.declarations[u];if(l.init){var c=E.assignmentExpression("=",l.id,l.init);c._ignoreBlockScopingTDZ=!0,a.push(E.expressionStatement(c))}l.init=t.addHelper("temporalUndefined")}r._blockHoist=2,e.isCompletionRecord()&&a.push(E.expressionStatement(i.buildUndefinedNode())),e.replaceWithMultiple(a)}},Loop:function(e,t){var r=e.node,n=e.parent,i=e.scope;E.ensureBlock(r);var a=new R(e,e.get("body"),n,i,t),s=a.run();s&&e.replaceWith(s)},CatchClause:function(e,t){var r=e.parent,n=e.scope,i=new R(null,e.get("body"),r,n,t);i.run()},"BlockStatement|SwitchStatement|Program":function(e,t){if(!a(e)){var r=new R(null,e,e.parent,e.scope,t);r.run()}}}}};var v=r(8),y=i(v),g=r(327),b=r(1),E=n(b),x=r(280),A=i(x),_=r(580),D=i(_),C=r(4),S=i(C),w=(0,S.default)('\n if (typeof RETURN === "object") return RETURN.v;\n'),F=y.default.visitors.merge([{Function:function(e,t){return e.traverse(k,t),e.skip()}},g.visitor]),k=y.default.visitors.merge([{ReferencedIdentifier:function(e,t){var r=t.letReferences[e.node.name];if(r){var n=e.scope.getBindingIdentifier(e.node.name);n&&n!==r||(t.closurify=!0)}}},g.visitor]),P={enter:function(e,t){var r=e.node,n=e.parent;if(e.isForStatement()){if(u(r.init,r)){var i=t.pushDeclar(r.init);1===i.length?r.init=i[0]:r.init=E.sequenceExpression(i)}}else if(e.isFor())u(r.left,r)&&(t.pushDeclar(r.left),r.left=r.left.declarations[0].id);else if(u(r,n))e.replaceWithMultiple(t.pushDeclar(r).map(function(e){return E.expressionStatement(e)}));else if(e.isFunction())return e.skip()}},T={LabeledStatement:function(e,t){var r=e.node;t.innerLabels.push(r.label.name)}},O={enter:function(e,t){if(e.isAssignmentExpression()||e.isUpdateExpression()){var r=e.getBindingIdentifiers();for(var n in r)t.outsideReferences[n]===e.scope.getBindingIdentifier(n)&&(t.reassignments[n]=!0)}}},B={Loop:function(e,t){var r=t.ignoreLabeless;t.ignoreLabeless=!0,e.traverse(B,t),t.ignoreLabeless=r,e.skip()},Function:function(e){e.skip()},SwitchCase:function(e,t){var r=t.inSwitchCase;t.inSwitchCase=!0,e.traverse(B,t),t.inSwitchCase=r,e.skip()},"BreakStatement|ContinueStatement|ReturnStatement":function(e,t){var r=e.node,n=e.parent,i=e.scope;if(!r[this.LOOP_IGNORE]){var a=void 0,s=l(r);if(s){if(r.label){if(t.innerLabels.indexOf(r.label.name)>=0)return;s=s+"|"+r.label.name}else{if(t.ignoreLabeless)return;if(t.inSwitchCase)return;if(E.isBreakStatement(r)&&E.isSwitchCase(n))return}t.hasBreakContinue=!0,t.map[s]=r,a=E.stringLiteral(s)}e.isReturnStatement()&&(t.hasReturn=!0,a=E.objectExpression([E.objectProperty(E.identifier("v"),r.argument||i.buildUndefinedNode())])),a&&(a=E.returnStatement(a),a[this.LOOP_IGNORE]=!0,e.skip(),e.replaceWith(E.inherits(a,r)))}}},R=function(){function e(t,r,n,i,a){(0,m.default)(this,e),this.parent=n,this.scope=i,this.file=a,this.blockPath=r,this.block=r.node,this.outsideLetReferences=(0,d.default)(null),this.hasLetReferences=!1,this.letReferences=(0,d.default)(null),this.body=[],t&&(this.loopParent=t.parent,this.loopLabel=E.isLabeledStatement(this.loopParent)&&this.loopParent.label,this.loopPath=t,this.loop=t.node)}return e.prototype.run=function(){var e=this.block;if(!e._letDone){e._letDone=!0;var t=this.getLetReferences();if(E.isFunction(this.parent)||E.isProgram(this.block))return void this.updateScopeInfo();if(this.hasLetReferences)return t?this.wrapClosure():this.remap(),this.updateScopeInfo(),this.loopLabel&&!E.isLabeledStatement(this.loopParent)?E.labeledStatement(this.loopLabel,this.loop):void 0}},e.prototype.updateScopeInfo=function(){var e=this.scope,t=e.getFunctionParent(),r=this.letReferences;for(var n in r){var i=r[n],a=e.getBinding(i.name);a&&("let"!==a.kind&&"const"!==a.kind||(a.kind="var",e.moveBindingTo(i.name,t)))}},e.prototype.remap=function(){var e=this.letReferences,t=this.scope;for(var r in e){var n=e[r];(t.parentHasBinding(r)||t.hasGlobal(r))&&(t.hasOwnBinding(r)&&t.rename(n.name),this.blockPath.scope.hasOwnBinding(r)&&this.blockPath.scope.rename(n.name))}},e.prototype.wrapClosure=function(){var e=this.block,t=this.outsideLetReferences;if(this.loop)for(var r in t){var n=t[r];(this.scope.hasGlobal(n.name)||this.scope.parentHasBinding(n.name))&&(delete t[n.name],delete this.letReferences[n.name],this.scope.rename(n.name),this.letReferences[n.name]=n,t[n.name]=n)}this.has=this.checkLoop(),this.hoistVarDeclarations();var i=(0,A.default)(t),a=(0,A.default)(t),s=this.blockPath.isSwitchStatement(),o=E.functionExpression(null,i,E.blockStatement(s?[e]:e.body));o.shadow=!0,this.addContinuations(o);var u=o;this.loop&&(u=this.scope.generateUidIdentifier("loop"),this.loopPath.insertBefore(E.variableDeclaration("var",[E.variableDeclarator(u,o)])));var l=E.callExpression(u,a),c=this.scope.generateUidIdentifier("ret"),f=y.default.hasType(o.body,this.scope,"YieldExpression",E.FUNCTION_TYPES);f&&(o.generator=!0,l=E.yieldExpression(l,!0));var p=y.default.hasType(o.body,this.scope,"AwaitExpression",E.FUNCTION_TYPES);p&&(o.async=!0,l=E.awaitExpression(l)),this.buildClosure(c,l),s?this.blockPath.replaceWithMultiple(this.body):e.body=this.body},e.prototype.buildClosure=function(e,t){var r=this.has;r.hasReturn||r.hasBreakContinue?this.buildHas(e,t):this.body.push(E.expressionStatement(t))},e.prototype.addContinuations=function(e){var t={reassignments:{},outsideReferences:this.outsideLetReferences};this.scope.traverse(e,O,t);for(var r=0;r<e.params.length;r++){var n=e.params[r];if(t.reassignments[n.name]){var i=this.scope.generateUidIdentifier(n.name);e.params[r]=i,this.scope.rename(n.name,i.name,e),e.body.body.push(E.expressionStatement(E.assignmentExpression("=",n,i)))}}},e.prototype.getLetReferences=function(){var e=this,t=this.block,r=[];if(this.loop){var n=this.loop.left||this.loop.init;s(n)&&(r.push(n),(0,D.default)(this.outsideLetReferences,E.getBindingIdentifiers(n)))}var i=function n(i,a){a=a||i.node,(E.isClassDeclaration(a)||E.isFunctionDeclaration(a)||s(a))&&(s(a)&&o(i,a,t,e.scope),r=r.concat(a.declarations||a)),E.isLabeledStatement(a)&&n(i.get("body"),a.body)};if(t.body)for(var a=0;a<t.body.length;a++){var u=this.blockPath.get("body")[a];i(u)}if(t.cases)for(var l=0;l<t.cases.length;l++)for(var c=t.cases[l].consequent,f=0;f<c.length;f++){var p=this.blockPath.get("cases")[l],d=c[f];i(p,d)}for(var h=0;h<r.length;h++){var m=r[h],v=E.getBindingIdentifiers(m);(0,D.default)(this.letReferences,v),this.hasLetReferences=!0}if(this.hasLetReferences){var y={letReferences:this.letReferences,closurify:!1,file:this.file};return this.blockPath.traverse(F,y),y.closurify}},e.prototype.checkLoop=function(){var e={hasBreakContinue:!1,ignoreLabeless:!1,inSwitchCase:!1,innerLabels:[],hasReturn:!1,isLoop:!!this.loop,map:{},LOOP_IGNORE:(0,f.default)()};return this.blockPath.traverse(T,e),this.blockPath.traverse(B,e),e},e.prototype.hoistVarDeclarations=function(){this.blockPath.traverse(P,this)},e.prototype.pushDeclar=function(e){var t=[],r=E.getBindingIdentifiers(e);for(var n in r)t.push(E.variableDeclarator(r[n]));this.body.push(E.variableDeclaration(e.kind,t));for(var i=[],a=0;a<e.declarations.length;a++){var s=e.declarations[a];if(s.init){var o=E.assignmentExpression("=",s.id,s.init);i.push(E.inherits(o,s))}}return i},e.prototype.buildHas=function(e,t){var r=this.body;r.push(E.variableDeclaration("var",[E.variableDeclarator(e,t)]));var n=void 0,i=this.has,a=[];if(i.hasReturn&&(n=w({RETURN:e})),i.hasBreakContinue){for(var s in i.map)a.push(E.switchCase(E.stringLiteral(s),[i.map[s]]));if(i.hasReturn&&a.push(E.switchCase(null,[n])),1===a.length){var o=a[0];r.push(E.ifStatement(E.binaryExpression("===",e,o.test),o.consequent[0]))}else{if(this.loop)for(var u=0;u<a.length;u++){var l=a[u].consequent[0];E.isBreakStatement(l)&&!l.label&&(l.label=this.loopLabel=this.loopLabel||this.scope.generateUidIdentifier("loop"))}r.push(E.switchStatement(e,a))}}else i.hasReturn&&r.push(n)},e}();e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(9),a=n(i);t.default=function(e){var t=e.types,r=(0,a.default)();return{visitor:{ExportDefaultDeclaration:function(e){if(e.get("declaration").isClassDeclaration()){var r=e.node,n=r.declaration.id||e.scope.generateUidIdentifier("class");r.declaration.id=n,e.replaceWith(r.declaration),e.insertAfter(t.exportDefaultDeclaration(n))}},ClassDeclaration:function(e){var r=e.node,n=r.id||e.scope.generateUidIdentifier("class");e.replaceWith(t.variableDeclaration("let",[t.variableDeclarator(n,t.toExpression(r))]))},ClassExpression:function(e,t){var n=e.node;if(!n[r]){var i=(0,f.default)(e);if(i&&i!==n)return e.replaceWith(i);n[r]=!0;var a=l.default;t.opts.loose&&(a=o.default),e.replaceWith(new a(e,t.file).run())}}}}};var s=r(328),o=n(s),u=r(204),l=n(u),c=r(40),f=n(c);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){function t(e){return o.isObjectProperty(e)?e.value:o.isObjectMethod(e)?o.functionExpression(null,e.params,e.body,e.generator,e.async):void 0}function r(e,r,i){"get"===r.kind&&"set"===r.kind?n(e,r,i):i.push(o.expressionStatement(o.assignmentExpression("=",o.memberExpression(e,r.key,r.computed||o.isLiteral(r.key)),t(r))))}function n(e,r){var n=(e.objId,e.body),i=e.getMutatorId,a=e.scope,s=!r.computed&&o.isIdentifier(r.key)?o.stringLiteral(r.key.name):r.key,u=a.maybeGenerateMemoised(s);u&&(n.push(o.expressionStatement(o.assignmentExpression("=",u,s))),s=u),n.push.apply(n,l({MUTATOR_MAP_REF:i(),KEY:s,VALUE:t(r),KIND:o.identifier(r.kind)}))}function i(e){for(var t=e.computedProps,i=Array.isArray(t),s=0,t=i?t:(0,a.default)(t);;){var o;if(i){if(s>=t.length)break;o=t[s++]}else{if(s=t.next(),s.done)break;o=s.value}var u=o;"get"===u.kind||"set"===u.kind?n(e,u):r(e.objId,u,e.body)}}function s(e){for(var i=e.objId,s=e.body,u=e.computedProps,l=e.state,c=u,f=Array.isArray(c),p=0,c=f?c:(0,a.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d,m=o.toComputedKey(h);if("get"===h.kind||"set"===h.kind)n(e,h);else if(o.isStringLiteral(m,{value:"__proto__"}))r(i,h,s);else{if(1===u.length)return o.callExpression(l.addHelper("defineProperty"),[e.initPropExpression,m,t(h)]);s.push(o.expressionStatement(o.callExpression(l.addHelper("defineProperty"),[i,m,t(h)])))}}}var o=e.types,u=e.template,l=u("\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n ");return{visitor:{ObjectExpression:{exit:function(e,t){for(var r=e.node,n=e.parent,u=e.scope,l=!1,c=r.properties,f=Array.isArray(c),p=0,c=f?c:(0,a.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;if(l=h.computed===!0)break}if(l){for(var m=[],v=[],y=!1,g=r.properties,b=Array.isArray(g),E=0,g=b?g:(0,a.default)(g);;){var x;if(b){if(E>=g.length)break;x=g[E++]}else{if(E=g.next(),E.done)break;x=E.value}var A=x;A.computed&&(y=!0),y?v.push(A):m.push(A)}var _=u.generateUidIdentifierBasedOnNode(n),D=o.objectExpression(m),C=[];C.push(o.variableDeclaration("var",[o.variableDeclarator(_,D)]));var S=s;t.opts.loose&&(S=i);var w=void 0,F=function(){return w||(w=u.generateUidIdentifier("mutatorMap"),C.push(o.variableDeclaration("var",[o.variableDeclarator(w,o.objectExpression([]))]))),w},k=S({scope:u,objId:_,body:C,computedProps:v,initPropExpression:D,getMutatorId:F,state:t});w&&C.push(o.expressionStatement(o.callExpression(t.addHelper("defineEnumerableProperties"),[_,w]))),k?e.replaceWith(k):(C.push(o.expressionStatement(_)),e.replaceWithMultiple(C))}}}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),a=n(i),s=r(2),o=n(s);t.default=function(e){function t(e){for(var t=e.declarations,r=Array.isArray(t),i=0,t=r?t:(0,o.default)(t);;){var a;if(r){if(i>=t.length)break;a=t[i++]}else{if(i=t.next(),i.done)break;a=i.value}var s=a;if(n.isPattern(s.id))return!0}return!1}function r(e){for(var t=e.elements,r=Array.isArray(t),i=0,t=r?t:(0,o.default)(t);;){var a;if(r){if(i>=t.length)break;a=t[i++]}else{if(i=t.next(),i.done)break;a=i.value}var s=a;if(n.isRestElement(s))return!0}return!1}var n=e.types,i={ReferencedIdentifier:function(e,t){t.bindings[e.node.name]&&(t.deopt=!0,e.stop())}},s=function(){function e(t){(0,a.default)(this,e),this.blockHoist=t.blockHoist,this.operator=t.operator,this.arrays={},this.nodes=t.nodes||[],this.scope=t.scope,this.file=t.file,this.kind=t.kind}return e.prototype.buildVariableAssignment=function(e,t){var r=this.operator;n.isMemberExpression(e)&&(r="=");var i=void 0;return i=r?n.expressionStatement(n.assignmentExpression(r,e,t)):n.variableDeclaration(this.kind,[n.variableDeclarator(e,t)]),i._blockHoist=this.blockHoist,i},e.prototype.buildVariableDeclaration=function(e,t){var r=n.variableDeclaration("var",[n.variableDeclarator(e,t)]);return r._blockHoist=this.blockHoist,r},e.prototype.push=function(e,t){n.isObjectPattern(e)?this.pushObjectPattern(e,t):n.isArrayPattern(e)?this.pushArrayPattern(e,t):n.isAssignmentPattern(e)?this.pushAssignmentPattern(e,t):this.nodes.push(this.buildVariableAssignment(e,t))},e.prototype.toArray=function(e,t){return this.file.opts.loose||n.isIdentifier(e)&&this.arrays[e.name]?e:this.scope.toArray(e,t)},e.prototype.pushAssignmentPattern=function(e,t){var r=this.scope.generateUidIdentifierBasedOnNode(t),i=n.variableDeclaration("var",[n.variableDeclarator(r,t)]);i._blockHoist=this.blockHoist,this.nodes.push(i);var a=n.conditionalExpression(n.binaryExpression("===",r,n.identifier("undefined")),e.right,r),s=e.left;if(n.isPattern(s)){var o=n.expressionStatement(n.assignmentExpression("=",r,a));o._blockHoist=this.blockHoist,this.nodes.push(o),this.push(s,r)}else this.nodes.push(this.buildVariableAssignment(s,a))},e.prototype.pushObjectRest=function(e,t,r,i){for(var a=[],s=0;s<e.properties.length;s++){var o=e.properties[s];if(s>=i)break;if(!n.isRestProperty(o)){var u=o.key;n.isIdentifier(u)&&!o.computed&&(u=n.stringLiteral(o.key.name)),a.push(u)}}a=n.arrayExpression(a);var l=n.callExpression(this.file.addHelper("objectWithoutProperties"),[t,a]);this.nodes.push(this.buildVariableAssignment(r.argument,l))},e.prototype.pushObjectProperty=function(e,t){n.isLiteral(e.key)&&(e.computed=!0);var r=e.value,i=n.memberExpression(t,e.key,e.computed);n.isPattern(r)?this.push(r,i):this.nodes.push(this.buildVariableAssignment(r,i))},e.prototype.pushObjectPattern=function(e,t){if(e.properties.length||this.nodes.push(n.expressionStatement(n.callExpression(this.file.addHelper("objectDestructuringEmpty"),[t]))),e.properties.length>1&&!this.scope.isStatic(t)){var r=this.scope.generateUidIdentifierBasedOnNode(t);this.nodes.push(this.buildVariableDeclaration(r,t)),t=r}for(var i=0;i<e.properties.length;i++){var a=e.properties[i];n.isRestProperty(a)?this.pushObjectRest(e,t,a,i):this.pushObjectProperty(a,t)}},e.prototype.canUnpackArrayPattern=function(e,t){if(!n.isArrayExpression(t))return!1;if(!(e.elements.length>t.elements.length)){if(e.elements.length<t.elements.length&&!r(e))return!1;for(var a=e.elements,s=Array.isArray(a),u=0,a=s?a:(0,o.default)(a);;){var l;if(s){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;if(!c)return!1;if(n.isMemberExpression(c))return!1}for(var f=t.elements,p=Array.isArray(f),d=0,f=p?f:(0,o.default)(f);;){var h;if(p){if(d>=f.length)break;h=f[d++]}else{if(d=f.next(),d.done)break;h=d.value}var m=h;if(n.isSpreadElement(m))return!1;if(n.isCallExpression(m))return!1;if(n.isMemberExpression(m))return!1}var v=n.getBindingIdentifiers(e),y={deopt:!1,bindings:v};return this.scope.traverse(t,i,y),!y.deopt}},e.prototype.pushUnpackedArrayPattern=function(e,t){for(var r=0;r<e.elements.length;r++){var i=e.elements[r];n.isRestElement(i)?this.push(i.argument,n.arrayExpression(t.elements.slice(r))):this.push(i,t.elements[r])}},e.prototype.pushArrayPattern=function(e,t){if(e.elements){ if(this.canUnpackArrayPattern(e,t))return this.pushUnpackedArrayPattern(e,t);var i=!r(e)&&e.elements.length,a=this.toArray(t,i);n.isIdentifier(a)?t=a:(t=this.scope.generateUidIdentifierBasedOnNode(t),this.arrays[t.name]=!0,this.nodes.push(this.buildVariableDeclaration(t,a)));for(var s=0;s<e.elements.length;s++){var o=e.elements[s];if(o){var u=void 0;n.isRestElement(o)?(u=this.toArray(t),s>0&&(u=n.callExpression(n.memberExpression(u,n.identifier("slice")),[n.numericLiteral(s)])),o=o.argument):u=n.memberExpression(t,n.numericLiteral(s),!0),this.push(o,u)}}}},e.prototype.init=function(e,t){if(!n.isArrayExpression(t)&&!n.isMemberExpression(t)){var r=this.scope.maybeGenerateMemoised(t,!0);r&&(this.nodes.push(this.buildVariableDeclaration(r,t)),t=r)}return this.push(e,t),this.nodes},e}();return{visitor:{ExportNamedDeclaration:function(e){var r=e.get("declaration");if(r.isVariableDeclaration()&&t(r.node)){var i=[];for(var a in e.getOuterBindingIdentifiers(e)){var s=n.identifier(a);i.push(n.exportSpecifier(s,s))}e.replaceWith(r.node),e.insertAfter(n.exportNamedDeclaration(null,i))}},ForXStatement:function(e,t){var r=e.node,i=e.scope,a=r.left;if(n.isPattern(a)){var o=i.generateUidIdentifier("ref");return r.left=n.variableDeclaration("var",[n.variableDeclarator(o)]),e.ensureBlock(),void r.body.body.unshift(n.variableDeclaration("var",[n.variableDeclarator(a,o)]))}if(n.isVariableDeclaration(a)){var u=a.declarations[0].id;if(n.isPattern(u)){var l=i.generateUidIdentifier("ref");r.left=n.variableDeclaration(a.kind,[n.variableDeclarator(l,null)]);var c=[],f=new s({kind:a.kind,file:t,scope:i,nodes:c});f.init(u,l),e.ensureBlock();var p=r.body;p.body=c.concat(p.body)}}},CatchClause:function(e,t){var r=e.node,i=e.scope,a=r.param;if(n.isPattern(a)){var o=i.generateUidIdentifier("ref");r.param=o;var u=[],l=new s({kind:"let",file:t,scope:i,nodes:u});l.init(a,o),r.body.body=u.concat(r.body.body)}},AssignmentExpression:function(e,t){var r=e.node,i=e.scope;if(n.isPattern(r.left)){var a=[],o=new s({operator:r.operator,file:t,scope:i,nodes:a}),u=void 0;!e.isCompletionRecord()&&e.parentPath.isExpressionStatement()||(u=i.generateUidIdentifierBasedOnNode(r.right,"ref"),a.push(n.variableDeclaration("var",[n.variableDeclarator(u,r.right)])),n.isArrayExpression(r.right)&&(o.arrays[u.name]=!0)),o.init(r.left,u||r.right),u&&a.push(n.expressionStatement(u)),e.replaceWithMultiple(a)}},VariableDeclaration:function(e,r){var i=e.node,a=e.scope,u=e.parent;if(!n.isForXStatement(u)&&u&&e.container&&t(i)){for(var l=[],c=void 0,f=0;f<i.declarations.length;f++){c=i.declarations[f];var p=c.init,d=c.id,h=new s({blockHoist:i._blockHoist,nodes:l,scope:a,kind:i.kind,file:r});n.isPattern(d)?(h.init(d,p),+f!==i.declarations.length-1&&n.inherits(l[l.length-1],c)):l.push(n.inherits(h.buildVariableAssignment(c.id,c.init),c))}for(var m=[],v=l,y=Array.isArray(v),g=0,v=y?v:(0,o.default)(v);;){var b;if(y){if(g>=v.length)break;b=v[g++]}else{if(g=v.next(),g.done)break;b=g.value}var E=b,x=m[m.length-1];if(x&&n.isVariableDeclaration(x)&&n.isVariableDeclaration(E)&&x.kind===E.kind){var A;(A=x.declarations).push.apply(A,E.declarations)}else m.push(E)}for(var _=m,D=Array.isArray(_),C=0,_=D?_:(0,o.default)(_);;){var S;if(D){if(C>=_.length)break;S=_[C++]}else{if(C=_.next(),C.done)break;S=C.value}var w=S;if(w.declarations)for(var F=w.declarations,k=Array.isArray(F),P=0,F=k?F:(0,o.default)(F);;){var T;if(k){if(P>=F.length)break;T=F[P++]}else{if(P=F.next(),P.done)break;T=P.value}var O=T,B=O.id.name;a.bindings[B]&&(a.bindings[B].kind=w.kind)}}1===m.length?e.replaceWith(m[0]):e.replaceWithMultiple(m)}}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){function t(e){var t=e.node,r=e.scope,n=[],i=t.right;if(!s.isIdentifier(i)||!r.hasBinding(i.name)){var a=r.generateUidIdentifier("arr");n.push(s.variableDeclaration("var",[s.variableDeclarator(a,i)])),i=a}var u=r.generateUidIdentifier("i"),l=o({BODY:t.body,KEY:u,ARR:i});s.inherits(l,t),s.ensureBlock(l);var c=s.memberExpression(i,u,!0),f=t.left;return s.isVariableDeclaration(f)?(f.declarations[0].init=c,l.body.body.unshift(f)):l.body.body.unshift(s.expressionStatement(s.assignmentExpression("=",f,c))),e.parentPath.isLabeledStatement()&&(l=s.labeledStatement(e.parentPath.node.label,l)),n.push(l),n}function r(e,t){var r=e.node,n=e.scope,a=r.left,o=void 0,l=void 0;if(s.isIdentifier(a)||s.isPattern(a)||s.isMemberExpression(a))l=a;else{if(!s.isVariableDeclaration(a))throw t.buildCodeFrameError(a,i.get("unknownForHead",a.type));l=n.generateUidIdentifier("ref"),o=s.variableDeclaration(a.kind,[s.variableDeclarator(a.declarations[0].id,l)])}var c=n.generateUidIdentifier("iterator"),f=n.generateUidIdentifier("isArray"),p=u({LOOP_OBJECT:c,IS_ARRAY:f,OBJECT:r.right,INDEX:n.generateUidIdentifier("i"),ID:l});return o||p.body.body.shift(),{declar:o,node:p,loop:p}}function n(e,t){var r=e.node,n=e.scope,a=e.parent,o=r.left,u=void 0,c=n.generateUidIdentifier("step"),f=s.memberExpression(c,s.identifier("value"));if(s.isIdentifier(o)||s.isPattern(o)||s.isMemberExpression(o))u=s.expressionStatement(s.assignmentExpression("=",o,f));else{if(!s.isVariableDeclaration(o))throw t.buildCodeFrameError(o,i.get("unknownForHead",o.type));u=s.variableDeclaration(o.kind,[s.variableDeclarator(o.declarations[0].id,f)])}var p=n.generateUidIdentifier("iterator"),d=l({ITERATOR_HAD_ERROR_KEY:n.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:n.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:n.generateUidIdentifier("iteratorError"),ITERATOR_KEY:p,STEP_KEY:c,OBJECT:r.right,BODY:null}),h=s.isLabeledStatement(a),m=d[3].block.body,v=m[0];return h&&(m[0]=s.labeledStatement(a.label,v)),{replaceParent:h,declar:u,loop:v,node:d}}var i=e.messages,a=e.template,s=e.types,o=a("\n for (var KEY = 0; KEY < ARR.length; KEY++) BODY;\n "),u=a("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n var ID;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n "),l=a("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n ");return{visitor:{ForOfStatement:function(e,i){if(e.get("right").isArrayExpression())return e.parentPath.isLabeledStatement()?e.parentPath.replaceWithMultiple(t(e)):e.replaceWithMultiple(t(e));var a=n;i.opts.loose&&(a=r);var o=e.node,u=a(e,i),l=u.declar,c=u.loop,f=c.body;e.ensureBlock(),l&&f.body.push(l),f.body=f.body.concat(o.body.body),s.inherits(c,o),s.inherits(c.body,o.body),u.replaceParent?(e.parentPath.replaceWithMultiple(u.node),e.remove()):e.replaceWithMultiple(u.node)}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(){return{visitor:{"ArrowFunctionExpression|FunctionExpression":{exit:function(e){if("value"!==e.key&&!e.parentPath.isObjectProperty()){var t=(0,a.default)(e);t&&e.replaceWith(t)}}},ObjectProperty:function(e){var t=e.get("value");if(t.isFunction()){var r=(0,a.default)(t);r&&t.replaceWith(r)}}}}};var i=r(40),a=n(i);e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{NumericLiteral:function(e){var t=e.node;t.extra&&/^0[ob]/i.test(t.extra.raw)&&(t.extra=void 0)},StringLiteral:function(e){var t=e.node;t.extra&&/\\[u]/gi.test(t.extra.raw)&&(t.extra=void 0)}}}},e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(20),s=i(a),o=r(13),u=i(o),l=r(2),c=i(l),f=r(9),p=i(f);t.default=function(){var e=(0,p.default)(),t={ReferencedIdentifier:function(e){var t=e.node.name,r=this.remaps[t];if(r&&this.scope.getBinding(t)===e.scope.getBinding(t)){if(e.parentPath.isCallExpression({callee:e.node}))e.replaceWith(y.sequenceExpression([y.numericLiteral(0),r]));else if(e.isJSXIdentifier()&&y.isMemberExpression(r)){var n=r.object,i=r.property;e.replaceWith(y.JSXMemberExpression(y.JSXIdentifier(n.name),y.JSXIdentifier(i.name)))}else e.replaceWith(r);this.requeueInParent(e)}},AssignmentExpression:function(t){var r=t.node;if(!r[e]){var n=t.get("left");if(n.isIdentifier()){var i=n.node.name,a=this.exports[i];if(a&&this.scope.getBinding(i)===t.scope.getBinding(i)){r[e]=!0;for(var s=a,o=Array.isArray(s),u=0,s=o?s:(0,c.default)(s);;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var f=l;r=A(f,r).expression}t.replaceWith(r),this.requeueInParent(t)}}}},UpdateExpression:function(e){var t=e.get("argument");if(t.isIdentifier()){var r=t.node.name,n=this.exports[r];if(n&&this.scope.getBinding(r)===e.scope.getBinding(r)){var i=y.assignmentExpression(e.node.operator[0]+"=",t.node,y.numericLiteral(1));if(e.parentPath.isExpressionStatement()&&!e.isCompletionRecord()||e.node.prefix)return e.replaceWith(i),void this.requeueInParent(e);var a=[];a.push(i);var s=void 0;s="--"===e.node.operator?"+":"-",a.push(y.binaryExpression(s,t.node,y.numericLiteral(1))),e.replaceWithMultiple(y.sequenceExpression(a))}}}};return{inherits:r(215),visitor:{ThisExpression:function(e,t){this.ranCommonJS||t.opts.allowTopLevelThis===!0||e.findParent(function(e){return!e.is("shadow")&&D.indexOf(e.type)>=0})||e.replaceWith(y.identifier("undefined"))},Program:{exit:function(e){function r(t,r){var n=C[t];if(n)return n;var i=e.scope.generateUidIdentifier((0,d.basename)(t,(0,d.extname)(t))),a=y.variableDeclaration("var",[y.variableDeclarator(i,g(y.stringLiteral(t)).expression)]);return p[t]&&(a.loc=p[t].loc),"number"==typeof r&&r>0&&(a._blockHoist=r),v.push(a),C[t]=i}function n(e,t,r){var n=e[t]||[];e[t]=n.concat(r)}this.ranCommonJS=!0;var i=!!this.opts.strict,a=e.scope;a.rename("module"),a.rename("exports"),a.rename("require");for(var o=!1,l=!1,f=e.get("body"),p=(0,u.default)(null),h=(0,u.default)(null),m=(0,u.default)(null),v=[],D=(0,u.default)(null),C=(0,u.default)(null),S=f,w=Array.isArray(S),F=0,S=w?S:(0,c.default)(S);;){var k;if(w){if(F>=S.length)break;k=S[F++]}else{if(F=S.next(),F.done)break;k=F.value}var P=k;if(P.isExportDeclaration()){o=!0;for(var T=[].concat(P.get("declaration"),P.get("specifiers")),O=T,B=Array.isArray(O),R=0,O=B?O:(0,c.default)(O);;){var I;if(B){if(R>=O.length)break;I=O[R++]}else{if(R=O.next(),R.done)break;I=R.value}var M=I,N=M.getBindingIdentifiers();if(N.__esModule)throw M.buildCodeFrameError('Illegal export "__esModule"')}}if(P.isImportDeclaration()){var L;l=!0;var j=P.node.source.value,U=p[j]||{specifiers:[],maxBlockHoist:0,loc:P.node.loc};(L=U.specifiers).push.apply(L,P.node.specifiers),"number"==typeof P.node._blockHoist&&(U.maxBlockHoist=Math.max(P.node._blockHoist,U.maxBlockHoist)),p[j]=U,P.remove()}else if(P.isExportDefaultDeclaration()){var V=P.get("declaration");if(V.isFunctionDeclaration()){var G=V.node.id,W=y.identifier("default");G?(n(h,G.name,W),v.push(A(W,G)),P.replaceWith(V.node)):(v.push(A(W,y.toExpression(V.node))),P.remove())}else if(V.isClassDeclaration()){var Y=V.node.id,q=y.identifier("default");Y?(n(h,Y.name,q),P.replaceWithMultiple([V.node,A(q,Y)])):(P.replaceWith(A(q,y.toExpression(V.node))),P.parentPath.requeue(P.get("expression.left")))}else P.replaceWith(A(y.identifier("default"),V.node)),P.parentPath.requeue(P.get("expression.left"))}else if(P.isExportNamedDeclaration()){var K=P.get("declaration");if(K.node){if(K.isFunctionDeclaration()){var H=K.node.id;n(h,H.name,H),v.push(A(H,H)),P.replaceWith(K.node)}else if(K.isClassDeclaration()){var J=K.node.id;n(h,J.name,J),P.replaceWithMultiple([K.node,A(J,J)]),m[J.name]=!0}else if(K.isVariableDeclaration()){for(var X=K.get("declarations"),z=X,$=Array.isArray(z),Q=0,z=$?z:(0,c.default)(z);;){var Z;if($){if(Q>=z.length)break;Z=z[Q++]}else{if(Q=z.next(),Q.done)break;Z=Q.value}var ee=Z,te=ee.get("id"),re=ee.get("init");re.node||re.replaceWith(y.identifier("undefined")),te.isIdentifier()&&(n(h,te.node.name,te.node),re.replaceWith(A(te.node,re.node).expression),m[te.node.name]=!0)}P.replaceWith(K.node)}continue}var ne=P.get("specifiers"),ie=[],ae=P.node.source;if(ae)for(var se=r(ae.value,P.node._blockHoist),oe=ne,ue=Array.isArray(oe),le=0,oe=ue?oe:(0,c.default)(oe);;){var ce;if(ue){if(le>=oe.length)break;ce=oe[le++]}else{if(le=oe.next(),le.done)break;ce=le.value}var fe=ce;fe.isExportNamespaceSpecifier()||fe.isExportDefaultSpecifier()||fe.isExportSpecifier()&&("default"===fe.node.local.name?v.push(E(y.stringLiteral(fe.node.exported.name),y.memberExpression(y.callExpression(this.addHelper("interopRequireDefault"),[se]),fe.node.local))):v.push(E(y.stringLiteral(fe.node.exported.name),y.memberExpression(se,fe.node.local))),m[fe.node.exported.name]=!0)}else for(var pe=ne,de=Array.isArray(pe),he=0,pe=de?pe:(0,c.default)(pe);;){var me;if(de){if(he>=pe.length)break;me=pe[he++]}else{if(he=pe.next(),he.done)break;me=he.value}var ve=me;ve.isExportSpecifier()&&(n(h,ve.node.local.name,ve.node.exported),m[ve.node.exported.name]=!0,ie.push(A(ve.node.exported,ve.node.local)))}P.replaceWithMultiple(ie)}else if(P.isExportAllDeclaration()){var ye=_({OBJECT:r(P.node.source.value,P.node._blockHoist)});ye.loc=P.node.loc,v.push(ye),P.remove()}}for(var ge in p){var be=p[ge],T=be.specifiers,Ee=be.maxBlockHoist;if(T.length){for(var xe=r(ge,Ee),Ae=void 0,_e=0;_e<T.length;_e++){var De=T[_e];if(y.isImportNamespaceSpecifier(De)){if(i)D[De.local.name]=xe;else{var Ce=y.variableDeclaration("var",[y.variableDeclarator(De.local,y.callExpression(this.addHelper("interopRequireWildcard"),[xe]))]);Ee>0&&(Ce._blockHoist=Ee),v.push(Ce)}Ae=De.local}else y.isImportDefaultSpecifier(De)&&(T[_e]=y.importSpecifier(De.local,y.identifier("default")))}for(var Se=T,we=Array.isArray(Se),Fe=0,Se=we?Se:(0,c.default)(Se);;){var ke;if(we){if(Fe>=Se.length)break;ke=Se[Fe++]}else{if(Fe=Se.next(),Fe.done)break;ke=Fe.value}var Pe=ke;if(y.isImportSpecifier(Pe)){var Te=xe;if("default"===Pe.imported.name)if(Ae)Te=Ae;else{Te=Ae=e.scope.generateUidIdentifier(xe.name);var Oe=y.variableDeclaration("var",[y.variableDeclarator(Te,y.callExpression(this.addHelper("interopRequireDefault"),[xe]))]);Ee>0&&(Oe._blockHoist=Ee),v.push(Oe)}D[Pe.local.name]=y.memberExpression(Te,y.cloneWithoutLoc(Pe.imported))}}}else{var Be=g(y.stringLiteral(ge));Be.loc=p[ge].loc,v.push(Be)}}if(l&&(0,s.default)(m).length){var Re=y.identifier("undefined");for(var Ie in m)Re=A(y.identifier(Ie),Re).expression;var Me=y.expressionStatement(Re);Me._blockHoist=3,v.unshift(Me)}if(o&&!i){var Ne=b;this.opts.loose&&(Ne=x);var Le=Ne();Le._blockHoist=3,v.unshift(Le)}e.unshiftContainer("body",v),e.traverse(t,{remaps:D,scope:a,exports:h,requeueInParent:function(t){return e.requeue(t)}})}}}}};var d=r(17),h=r(4),m=i(h),v=r(1),y=n(v),g=(0,m.default)("\n require($0);\n"),b=(0,m.default)('\n Object.defineProperty(exports, "__esModule", {\n value: true\n });\n'),E=(0,m.default)("\n Object.defineProperty(exports, $0, {\n enumerable: true,\n get: function () {\n return $1;\n }\n });\n"),x=(0,m.default)("\n exports.__esModule = true;\n"),A=(0,m.default)("\n exports.$0 = $1;\n"),_=(0,m.default)('\n Object.keys(OBJECT).forEach(function (key) {\n if (key === "default" || key === "__esModule") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return OBJECT[key];\n }\n });\n });\n'),D=["FunctionExpression","FunctionDeclaration","ClassProperty","ClassMethod","ObjectMethod"];e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i),s=r(9),o=n(s);t.default=function(e){function t(e,t,r,n,i){var a=new l.default({getObjectRef:n,methodNode:t,methodPath:e,isStatic:!0,scope:r,file:i});a.replace()}var r=e.types,n=(0,o.default)();return{visitor:{Super:function(e){var t=e.findParent(function(e){return e.isObjectExpression()});t&&(t.node[n]=!0)},ObjectExpression:{exit:function(e,i){if(e.node[n]){for(var s=void 0,o=function(){return s=s||e.scope.generateUidIdentifier("obj")},u=e.get("properties"),l=u,c=Array.isArray(l),f=0,l=c?l:(0,a.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;d.isObjectProperty()&&(d=d.get("value")),t(d,d.node,e.scope,o,i)}s&&(e.scope.push({id:s}),e.replaceWith(r.assignmentExpression("=",s,e.node)))}}}}}};var u=r(190),l=n(u);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a);t.default=function(){return{visitor:o.visitors.merge([{ArrowFunctionExpression:function(e){for(var t=e.get("params"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,s.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var o=a;if(o.isRestElement()||o.isAssignmentPattern()){e.arrowFunctionToShadowed();break}}}},l.visitor,d.visitor,f.visitor])}};var o=r(8),u=r(331),l=n(u),c=r(330),f=n(c),p=r(332),d=n(p);e.exports=t.default},function(e,t,r){"use strict";function n(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.__esModule=!0,t.default=function(){return{visitor:{ObjectMethod:function(e){var t=e.node;if("method"===t.kind){var r=a.functionExpression(null,t.params,t.body,t.generator,t.async);r.returnType=t.returnType,e.replaceWith(a.objectProperty(t.key,r,t.computed))}},ObjectProperty:function(e){var t=e.node;t.shorthand&&(t.shorthand=!1)}}}};var i=r(1),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){function t(e,t,r){return r.opts.loose&&!i.isIdentifier(e.argument,{name:"arguments"})?e.argument:t.toArray(e.argument,!0)}function r(e){for(var t=0;t<e.length;t++)if(i.isSpreadElement(e[t]))return!0;return!1}function n(e,r,n){function s(){u.length&&(o.push(i.arrayExpression(u)),u=[])}for(var o=[],u=[],l=e,c=Array.isArray(l),f=0,l=c?l:(0,a.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;i.isSpreadElement(d)?(s(),o.push(t(d,r,n))):u.push(d)}return s(),o}var i=e.types;return{visitor:{ArrayExpression:function(e,t){var a=e.node,s=e.scope,o=a.elements;if(r(o)){var u=n(o,s,t),l=u.shift();i.isArrayExpression(l)||(u.unshift(l),l=i.arrayExpression([])),e.replaceWith(i.callExpression(i.memberExpression(l,i.identifier("concat")),u))}},CallExpression:function(e,t){var a=e.node,s=e.scope,o=a.arguments;if(r(o)){var u=e.get("callee");if(!u.isSuper()){var l=i.identifier("undefined");a.arguments=[];var c=void 0;c=1===o.length&&"arguments"===o[0].argument.name?[o[0].argument]:n(o,s,t);var f=c.shift();c.length?a.arguments.push(i.callExpression(i.memberExpression(f,i.identifier("concat")),c)):a.arguments.push(f);var p=a.callee;if(u.isMemberExpression()){var d=s.maybeGenerateMemoised(p.object);d?(p.object=i.assignmentExpression("=",d,p.object),l=d):l=p.object,i.appendToMemberExpression(p,i.identifier("apply"))}else a.callee=i.memberExpression(a.callee,i.identifier("apply"));i.isSuper(l)&&(l=i.thisExpression()),a.arguments.unshift(l)}}},NewExpression:function(e,t){var a=e.node,s=e.scope,o=a.arguments;if(r(o)){var u=n(o,s,t),l=i.arrayExpression([i.nullLiteral()]);o=i.callExpression(i.memberExpression(l,i.identifier("concat")),u),e.replaceWith(i.newExpression(i.callExpression(i.memberExpression(i.memberExpression(i.memberExpression(i.identifier("Function"),i.identifier("prototype")),i.identifier("bind")),i.identifier("apply")),[a.callee,o]),[]))}}}}},e.exports=t.default},function(e,t,r){"use strict";function n(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.__esModule=!0,t.default=function(){return{visitor:{RegExpLiteral:function(e){var t=e.node;a.is(t,"y")&&e.replaceWith(o.newExpression(o.identifier("RegExp"),[o.stringLiteral(t.pattern),o.stringLiteral(t.flags)]))}}}};var i=r(189),a=n(i),s=r(1),o=n(s);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){function t(e){return n.isLiteral(e)&&"string"==typeof e.value}function r(e,t){return n.binaryExpression("+",e,t)}var n=e.types;return{visitor:{TaggedTemplateExpression:function(e,t){for(var r=e.node,i=r.quasi,s=[],o=[],u=[],l=i.quasis,c=Array.isArray(l),f=0,l=c?l:(0,a.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;o.push(n.stringLiteral(d.value.cooked)),u.push(n.stringLiteral(d.value.raw))}o=n.arrayExpression(o),u=n.arrayExpression(u);var h="taggedTemplateLiteral";t.opts.loose&&(h+="Loose");var m=t.file.addTemplateObject(h,o,u);s.push(m),s=s.concat(i.expressions),e.replaceWith(n.callExpression(r.tag,s))},TemplateLiteral:function(e,i){for(var s=[],o=e.get("expressions"),u=e.node.quasis,l=Array.isArray(u),c=0,u=l?u:(0,a.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;s.push(n.stringLiteral(p.value.cooked));var d=o.shift();d&&(!i.opts.spec||d.isBaseType("string")||d.isBaseType("number")?s.push(d.node):s.push(n.callExpression(n.identifier("String"),[d.node])))}if(s=s.filter(function(e){return!n.isLiteral(e,{value:""})}),t(s[0])||t(s[1])||s.unshift(n.stringLiteral("")),s.length>1){for(var h=r(s.shift(),s.shift()),m=s,v=Array.isArray(m),y=0,m=v?m:(0,a.default)(m);;){var g;if(v){if(y>=m.length)break;g=m[y++]}else{if(y=m.next(),y.done)break;g=y.value}var b=g;h=r(h,b)}e.replaceWith(h)}else e.replaceWith(s[0])}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(9),a=n(i);t.default=function(e){var t=e.types,r=(0,a.default)();return{visitor:{Scope:function(e){var t=e.scope;t.getBinding("Symbol")&&t.rename("Symbol")},UnaryExpression:function(e){var n=e.node,i=e.parent;if(!n[r]&&!e.find(function(e){return e.node&&!!e.node._generated})){if(e.parentPath.isBinaryExpression()&&t.EQUALITY_BINARY_OPERATORS.indexOf(i.operator)>=0){var a=e.getOpposite();if(a.isLiteral()&&"symbol"!==a.node.value&&"object"!==a.node.value)return}if("typeof"===n.operator){var s=t.callExpression(this.addHelper("typeof"),[n.argument]);if(e.get("argument").isIdentifier()){var o=t.stringLiteral("undefined"),u=t.unaryExpression("typeof",n.argument);u[r]=!0,e.replaceWith(t.conditionalExpression(t.binaryExpression("===",u,o),o,s))}else e.replaceWith(s)}}}}}},e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(){return{visitor:{RegExpLiteral:function(e){var t=e.node;u.is(t,"u")&&(t.pattern=(0,s.default)(t.pattern,t.flags),u.pullFlag(t,"u"))}}}};var a=r(609),s=i(a),o=r(189),u=n(o);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return r(350)},e.exports=t.default},function(e,t,r){e.exports={default:r(405),__esModule:!0}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){a(),s()}function a(){t.path=l=new u.default}function s(){t.scope=c=new u.default}t.__esModule=!0,t.scope=t.path=void 0;var o=r(362),u=n(o);t.clear=i,t.clearPath=a,t.clearScope=s;var l=t.path=new u.default,c=t.scope=new u.default},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(53),i=r(426),a=r(425),s=r(21),o=r(150),u=r(237),l={},c={},t=e.exports=function(e,t,r,f,p){var d,h,m,v,y=p?function(){return e}:u(e),g=n(r,f,t?2:1),b=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(a(y)){for(d=o(e.length);d>b;b++)if(v=t?g(s(h=e[b])[0],h[1]):g(e[b]),v===l||v===c)return v}else for(m=y.call(e);!(h=m.next()).done;)if(v=i(m,g,h.value,t),v===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t,r){var n=r(21),i=r(429),a=r(140),s=r(147)("IE_PROTO"),o=function(){},u="prototype",l=function(){var e,t=r(229)("iframe"),n=a.length,i="<",s=">";for(t.style.display="none",r(424).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(i+"script"+s+"document.F=Object"+i+"/script"+s),e.close(),l=e.F;n--;)delete l[u][a[n]];return l()};e.exports=Object.create||function(e,t){var r;return null!==e?(o[u]=n(e),r=new o,o[u]=null,r[s]=e):r=l(),void 0===t?r:i(r,t)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(25).f,i=r(29),a=r(10)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,a)&&n(e,a,{configurable:!0,value:t})}},function(e,t,r){var n=r(89);e.exports=function(e){return Object(n(e))}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t){},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var i=r(545),a=r(546),s=r(547),o=r(548),u=r(549);n.prototype.clear=i,n.prototype.delete=a,n.prototype.get=s,n.prototype.has=o,n.prototype.set=u,e.exports=n},function(e,t,r){function n(e){var t=this.__data__=new i(e);this.size=t.size}var i=r(98),a=r(564),s=r(565),o=r(566),u=r(567),l=r(568);n.prototype.clear=a,n.prototype.delete=s,n.prototype.get=o,n.prototype.has=u,n.prototype.set=l,e.exports=n},function(e,t,r){function n(e,t){for(var r=e.length;r--;)if(i(e[r][0],t))return r;return-1}var i=r(45);e.exports=n},function(e,t,r){function n(e,t,r){return t===t?s(e,t,r):i(e,a,r)}var i=r(163),a=r(490),s=r(569);e.exports=n},function(e,t,r){function n(e,t){return s(a(e,t,i),e+"")}var i=r(59),a=r(559),s=r(562);e.exports=n},function(e,t){function r(e){return function(t){return e(t)}}e.exports=r},function(e,t,r){function n(e){return i(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,o&&a(r[0],r[1],o)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var u=r[n];u&&e(t,u,n,s)}return t})}var i=r(102),a=r(170);e.exports=n},function(e,t,r){function n(e,t){var r=e.__data__;return i(t)?r["string"==typeof t?"string":"hash"]:r.map}var i=r(543);e.exports=n},function(e,t){function r(e){var t=e&&e.constructor,r="function"==typeof t&&t.prototype||n;return e===r}var n=Object.prototype;e.exports=r},function(e,t,r){var n=r(38),i=n(Object,"create");e.exports=i},function(e,t){function r(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}e.exports=r},function(e,t,r){function n(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}var i=r(60),a=1/0;e.exports=n},function(e,t,r){function n(e){return i(e,a)}var i=r(162),a=4;e.exports=n},function(e,t,r){e.exports=r(585)},function(e,t,r){function n(e,t,r,n){e=a(e)?e:u(e),r=r&&!n?o(r):0;var c=e.length;return r<0&&(r=l(c+r,0)),s(e)?r<=c&&e.indexOf(t,r)>-1:!!c&&i(e,t,r)>-1}var i=r(101),a=r(26),s=r(175),o=r(47),u=r(280),l=Math.max;e.exports=n},function(e,t,r){var n=r(487),i=r(12),a=Object.prototype,s=a.hasOwnProperty,o=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&s.call(e,"callee")&&!o.call(e,"callee")};e.exports=u},function(e,t,r){(function(e){var n=r(16),i=r(598),a="object"==typeof t&&t&&!t.nodeType&&t,s=a&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===a,u=o?n.Buffer:void 0,l=u?u.isBuffer:void 0,c=l||i;e.exports=c}).call(t,r(39)(e))},function(e,t,r){function n(e){if(!a(e))return!1;var t=i(e);return t==o||t==u||t==s||t==l}var i=r(15),a=r(11),s="[object AsyncFunction]",o="[object Function]",u="[object GeneratorFunction]",l="[object Proxy]";e.exports=n},97,function(e,t,r){(function(e,n){function i(e,r){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),u(n,e,n.depth)}function a(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function s(e,t){return e}function o(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function u(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return b(i)||(i=u(e,i,n)),i}var a=l(e,r);if(a)return a;var s=Object.keys(r),m=o(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),C(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(r);if(0===s.length){if(S(r)){var v=r.name?": "+r.name:"";return e.stylize("[Function"+v+"]","special")}if(A(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(D(r))return e.stylize(Date.prototype.toString.call(r),"date");if(C(r))return c(r)}var y="",g=!1,E=["{","}"];if(h(r)&&(g=!0,E=["[","]"]),S(r)){var x=r.name?": "+r.name:"";y=" [Function"+x+"]"}if(A(r)&&(y=" "+RegExp.prototype.toString.call(r)),D(r)&&(y=" "+Date.prototype.toUTCString.call(r)),C(r)&&(y=" "+c(r)),0===s.length&&(!g||0==r.length))return E[0]+y+E[1];if(n<0)return A(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var _;return _=g?f(e,r,n,m,s):s.map(function(t){return p(e,r,n,m,t,g)}),e.seen.pop(),d(_,y,E)}function l(e,t){if(x(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,i){for(var a=[],s=0,o=t.length;s<o;++s)T(t,String(s))?a.push(p(e,t,r,n,String(s),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(p(e,t,r,n,i,!0))}),a}function p(e,t,r,n,i,a){var s,o,l;if(l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},l.get?o=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(o=e.stylize("[Setter]","special")),T(n,i)||(s="["+i+"]"),o||(e.seen.indexOf(l.value)<0?(o=v(r)?u(e,l.value,null):u(e,l.value,r-1),o.indexOf("\n")>-1&&(o=a?o.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+o.split("\n").map(function(e){return" "+e}).join("\n"))):o=e.stylize("[Circular]","special")),x(s)){if(a&&i.match(/^\d+$/))return o;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+o}function d(e,t,r){var n=0,i=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]; }function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function y(e){return null==e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function E(e){return"symbol"==typeof e}function x(e){return void 0===e}function A(e){return _(e)&&"[object RegExp]"===F(e)}function _(e){return"object"==typeof e&&null!==e}function D(e){return _(e)&&"[object Date]"===F(e)}function C(e){return _(e)&&("[object Error]"===F(e)||e instanceof Error)}function S(e){return"function"==typeof e}function w(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function F(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}function P(){var e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var O=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(i(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,a=n.length,s=String(e).replace(O,function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),o=n[r];r<a;o=n[++r])s+=v(o)||!_(o)?" "+o:" "+i(o);return s},t.deprecate=function(r,i){function a(){if(!s){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),s=!0}return r.apply(this,arguments)}if(x(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(n.noDeprecation===!0)return r;var s=!1;return a};var B,R={};t.debuglog=function(e){if(x(B)&&(B=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(new RegExp("\\b"+e+"\\b","i").test(B)){var r=n.pid;R[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else R[e]=function(){};return R[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=y,t.isNumber=g,t.isString=b,t.isSymbol=E,t.isUndefined=x,t.isRegExp=A,t.isObject=_,t.isDate=D,t.isError=C,t.isFunction=S,t.isPrimitive=w,t.isBuffer=r(623);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",P(),t.format.apply(t,arguments))},t.inherits=r(622),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(t,function(){return this}(),r(18))},function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(7),s=i(a);t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();if("object"===("undefined"==typeof u.default?"undefined":(0,s.default)(u.default)))return null;var r=f[t];if(!r){r=new u.default;var i=c.default.join(t,".babelrc");r.id=i,r.filename=i,r.paths=u.default._nodeModulePaths(t),f[t]=r}try{return u.default._resolveFilename(e,r)}catch(e){return null}};var o=r(116),u=i(o),l=r(17),c=i(l),f={};e.exports=t.default}).call(t,r(18))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(132),a=n(i),s=r(3),o=n(s),u=r(42),l=n(u),c=r(41),f=n(c),p=function(e){function t(){(0,o.default)(this,t);var r=(0,l.default)(this,e.call(this));return r.dynamicData={},r}return(0,f.default)(t,e),t.prototype.setDynamic=function(e,t){this.dynamicData[e]=t},t.prototype.get=function(t){if(this.has(t))return e.prototype.get.call(this,t);if(Object.prototype.hasOwnProperty.call(this.dynamicData,t)){var r=this.dynamicData[t]();return this.set(t,r),r}},t}(a.default);t.default=p,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),a=n(i),s=r(238),o=n(s),u=(0,o.default)("babel:verbose"),l=(0,o.default)("babel"),c=[],f=function(){function e(t,r){(0,a.default)(this,e),this.filename=r,this.file=t}return e.prototype._buildMessage=function(e){var t="[BABEL] "+this.filename;return e&&(t+=": "+e),t},e.prototype.warn=function(e){console.warn(this._buildMessage(e))},e.prototype.error=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Error;throw new t(this._buildMessage(e))},e.prototype.deprecate=function(e){this.file.opts&&this.file.opts.suppressDeprecationMessages||(e=this._buildMessage(e),c.indexOf(e)>=0||(c.push(e),console.error(e)))},e.prototype.verbose=function(e){u.enabled&&u(this._buildMessage(e))},e.prototype.debug=function(e){l.enabled&&l(this._buildMessage(e))},e.prototype.deopt=function(e,t){this.debug(t)},e}();t.default=f,e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=e.node,n=r.source?r.source.value:null,i=t.metadata.modules.exports,a=e.get("declaration");if(a.isStatement()){var s=a.getBindingIdentifiers();for(var o in s)i.exported.push(o),i.specifiers.push({kind:"local",local:o,exported:e.isExportDefaultDeclaration()?"default":o})}if(e.isExportNamedDeclaration()&&r.specifiers)for(var l=r.specifiers,f=Array.isArray(l),p=0,l=f?l:(0,u.default)(l);;){var d;if(f){if(p>=l.length)break;d=l[p++]}else{if(p=l.next(),p.done)break;d=p.value}var h=d,m=h.exported.name;i.exported.push(m),c.isExportDefaultSpecifier(h)&&i.specifiers.push({kind:"external",local:m,exported:m,source:n}),c.isExportNamespaceSpecifier(h)&&i.specifiers.push({kind:"external-namespace",exported:m,source:n});var v=h.local;v&&(n&&i.specifiers.push({kind:"external",local:v.name,exported:m,source:n}),n||i.specifiers.push({kind:"local",local:v.name,exported:m}))}e.isExportAllDeclaration()&&i.specifiers.push({kind:"external-all",source:n})}function s(e){e.skip()}t.__esModule=!0,t.ImportDeclaration=t.ModuleDeclaration=void 0;var o=r(2),u=i(o);t.ExportDeclaration=a,t.Scope=s;var l=r(1),c=n(l);t.ModuleDeclaration={enter:function(e,t){var r=e.node;r.source&&(r.source.value=t.resolveModuleSource(r.source.value))}},t.ImportDeclaration={exit:function(e,t){var r=e.node,n=[],i=[];t.metadata.modules.imports.push({source:r.source.value,imported:i,specifiers:n});for(var a=e.get("specifiers"),s=Array.isArray(a),o=0,a=s?a:(0,u.default)(a);;){var l;if(s){if(o>=a.length)break;l=a[o++]}else{if(o=a.next(),o.done)break;l=o.value}var c=l,f=c.node.local.name;if(c.isImportDefaultSpecifier()&&(i.push("default"),n.push({kind:"named",imported:"default",local:f})),c.isImportSpecifier()){var p=c.node.imported.name;i.push(p),n.push({kind:"named",imported:p,local:f})}c.isImportNamespaceSpecifier()&&(i.push("*"),n.push({kind:"namespace",local:f}))}}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=t||i.EXTENSIONS,n=k.default.extname(e);return(0,_.default)(r,n)}function a(e){return e?Array.isArray(e)?e:"string"==typeof e?e.split(","):[e]:[]}function s(e){if(!e)return new RegExp(/.^/);if(Array.isArray(e)&&(e=new RegExp(e.map(m.default).join("|"),"i")),"string"==typeof e){e=(0,T.default)(e),((0,y.default)(e,"./")||(0,y.default)(e,"*/"))&&(e=e.slice(2)),(0,y.default)(e,"**/")&&(e=e.slice(3));var t=x.default.makeRe(e,{nocase:!0});return new RegExp(t.source.slice(1,-1),"i")}if((0,w.default)(e))return e;throw new TypeError("illegal type for regexify")}function o(e,t){return e?(0,b.default)(e)?o([e],t):(0,C.default)(e)?o(a(e),t):Array.isArray(e)?(t&&(e=e.map(t)),e):[e]:[]}function u(e){return"true"===e||1==e||!("false"===e||0==e||!e)&&e}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];if(e=e.replace(/\\/g,"/"),r){for(var n=r,i=Array.isArray(n),a=0,n=i?n:(0,p.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;if(c(o,e))return!1}return!0}if(t.length)for(var u=t,l=Array.isArray(u),f=0,u=l?u:(0,p.default)(u);;){var d;if(l){if(f>=u.length)break;d=u[f++]}else{if(f=u.next(),f.done)break;d=f.value}var h=d;if(c(h,e))return!0}return!1}function c(e,t){return"function"==typeof e?e(t):e.test(t)}t.__esModule=!0,t.inspect=t.inherits=void 0;var f=r(2),p=n(f),d=r(117);Object.defineProperty(t,"inherits",{enumerable:!0,get:function(){return d.inherits}}),Object.defineProperty(t,"inspect",{enumerable:!0,get:function(){return d.inspect}}),t.canCompile=i,t.list=a,t.regexify=s,t.arrayify=o,t.booleanify=u,t.shouldIgnore=l;var h=r(579),m=n(h),v=r(597),y=n(v),g=r(273),b=n(g),E=r(604),x=n(E),A=r(112),_=n(A),D=r(175),C=n(D),S=r(276),w=n(S),F=r(17),k=n(F),P=r(283),T=n(P);i.EXTENSIONS=[".js",".jsx",".es6",".es"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(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}function a(e){e.variance&&("plus"===e.variance?this.token("+"):"minus"===e.variance&&this.token("-")),this.word(e.name)}function s(e){this.token("..."),this.print(e.argument,e)}function o(e){var t=e.properties;this.token("{"),this.printInnerComments(e),t.length&&(this.space(),this.printList(t,e,{indent:!0,statement:!0}),this.space()),this.token("}")}function u(e){this.printJoin(e.decorators,e),this._method(e)}function l(e){if(this.printJoin(e.decorators,e),e.computed)this.token("["),this.print(e.key,e),this.token("]");else{if(y.isAssignmentPattern(e.value)&&y.isIdentifier(e.key)&&e.key.name===e.value.left.name)return void this.print(e.value,e);if(this.print(e.key,e),e.shorthand&&y.isIdentifier(e.key)&&y.isIdentifier(e.value)&&e.key.name===e.value.name)return}this.token(":"),this.space(),this.print(e.value,e)}function c(e){var t=e.elements,r=t.length;this.token("["),this.printInnerComments(e);for(var n=0;n<t.length;n++){var i=t[n];i?(n>0&&this.space(),this.print(i,e),n<r-1&&this.token(",")):this.token(",")}this.token("]")}function f(e){this.word("/"+e.pattern+"/"+e.flags)}function p(e){this.word(e.value?"true":"false")}function d(){this.word("null")}function h(e){var t=this.getPossibleRaw(e),r=e.value+"";null==t?this.number(r):this.format.minified?this.number(t.length<r.length?t:r):this.number(t)}function m(e,t){var r=this.getPossibleRaw(e);if(!this.format.minified&&null!=r)return void this.token(r);var n={quotes:y.isJSX(t)?"double":this.format.quotes,wrap:!0};this.format.jsonCompatibleStrings&&(n.json=!0);var i=(0,b.default)(e.value,n);return this.token(i)}t.__esModule=!0,t.ArrayPattern=t.ObjectPattern=t.RestProperty=t.SpreadProperty=t.SpreadElement=void 0,t.Identifier=a,t.RestElement=s,t.ObjectExpression=o,t.ObjectMethod=u,t.ObjectProperty=l,t.ArrayExpression=c,t.RegExpLiteral=f,t.BooleanLiteral=p,t.NullLiteral=d,t.NumericLiteral=h,t.StringLiteral=m;var v=r(1),y=i(v),g=r(461),b=n(g);t.SpreadElement=s,t.SpreadProperty=s,t.RestProperty=s,t.ObjectPattern=o,t.ArrayPattern=c},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=e.node,n=r.body;r.async=!1;var i=p.functionExpression(null,[],p.blockStatement(n.body),!0);i.shadow=!0,n.body=[p.returnStatement(p.callExpression(p.callExpression(t,[i]),[]))],r.generator=!1}function s(e,t){var r=e.node,n=e.isFunctionDeclaration(),i=r.id,a=m;e.isArrowFunctionExpression()?e.arrowFunctionToShadowed():!n&&i&&(a=v),r.async=!1,r.generator=!0,r.id=null,n&&(r.type="FunctionExpression");var s=p.callExpression(t,[r]),o=a({NAME:i,REF:e.scope.generateUidIdentifier("ref"),FUNCTION:s,PARAMS:r.params.map(function(){return e.scope.generateUidIdentifier("x")})}).expression;if(n){var l=p.variableDeclaration("let",[p.variableDeclarator(p.identifier(i.name),p.callExpression(o,[]))]);l._blockHoist=!0,e.replaceWith(l)}else{var c=o.body.body[1].argument;i||(0,u.default)({node:c,parent:e.parent,scope:e.scope}),!c||c.id||r.params.length?e.replaceWith(p.callExpression(o,[])):e.replaceWith(s)}}t.__esModule=!0,t.default=function(e,t,r){r||(r={wrapAsync:t},t=null),e.traverse(y,{file:t,wrapAwait:r.wrapAwait}),e.isClassMethod()||e.isObjectMethod()?a(e,r.wrapAsync):s(e,r.wrapAsync)};var o=r(40),u=i(o),l=r(4),c=i(l),f=r(1),p=n(f),d=r(317),h=i(d),m=(0,c.default)("\n (() => {\n var REF = FUNCTION;\n return function NAME(PARAMS) {\n return REF.apply(this, arguments);\n };\n })\n"),v=(0,c.default)("\n (() => {\n var REF = FUNCTION;\n function NAME(PARAMS) {\n return REF.apply(this, arguments);\n }\n return NAME;\n })\n"),y={Function:function(e){return e.isArrowFunctionExpression()&&!e.node.async?void e.arrowFunctionToShadowed():void e.skip()},AwaitExpression:function(e,t){var r=e.node,n=t.wrapAwait;r.type="YieldExpression",n&&(r.argument=p.callExpression(n,[r.argument]))},ForAwaitStatement:function(e,t){var r=t.file,n=t.wrapAwait,i=e.node,a=(0,h.default)(e,{getAsyncIterator:r.addHelper("asyncIterator"),wrapAwait:n}),s=a.declar,o=a.loop,u=o.body;e.ensureBlock(),s&&u.body.push(s),u.body=u.body.concat(i.body.body),p.inherits(o,i),p.inherits(o.body,i.body),a.replaceParent?(e.parentPath.replaceWithMultiple(a.node),e.remove()):e.replaceWithMultiple(a.node)}};e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("decorators")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("jsx")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("trailingFunctionCommas")}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(){return{inherits:r(66),visitor:{Function:function(e,t){e.node.async&&!e.node.generator&&(0,a.default)(e,t.file,{wrapAsync:t.addHelper("asyncToGenerator")})}}}};var i=r(124),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return f.isIdentifier(e)?e.name:e.value.toString()}t.__esModule=!0;var s=r(2),o=i(s),u=r(13),l=i(u);t.default=function(){return{visitor:{ObjectExpression:function(e){for(var t=e.node,r=t.properties.filter(function(e){return!f.isSpreadProperty(e)&&!e.computed}),n=(0,l.default)(null),i=(0,l.default)(null),s=(0,l.default)(null),u=r,c=Array.isArray(u),p=0,u=c?u:(0,o.default)(u);;){var d;if(c){if(p>=u.length)break;d=u[p++]}else{if(p=u.next(),p.done)break;d=p.value}var h=d,m=a(h.key),v=!1;switch(h.kind){case"get":(n[m]||i[m])&&(v=!0),i[m]=!0;break;case"set":(n[m]||s[m])&&(v=!0),s[m]=!0;break;default:(n[m]||i[m]||s[m])&&(v=!0),n[m]=!0}v&&(h.computed=!0,h.key=f.stringLiteral(m))}}}}};var c=r(1),f=n(c);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(13),a=n(i);t.default=function(e){function t(e){if(!e.isCallExpression())return!1;if(!e.get("callee").isIdentifier({name:"require"}))return!1;if(e.scope.getBinding("require"))return!1;var t=e.get("arguments");if(1!==t.length)return!1;var r=t[0];return!!r.isStringLiteral()}var n=e.types,i={ReferencedIdentifier:function(e){var t=e.node,r=e.scope;"exports"!==t.name||r.getBinding("exports")||(this.hasExports=!0),"module"!==t.name||r.getBinding("module")||(this.hasModule=!0)},CallExpression:function(e){t(e)&&(this.bareSources.push(e.node.arguments[0]),e.remove())},VariableDeclarator:function(e){var r=e.get("id");if(r.isIdentifier()){var n=e.get("init");if(t(n)){var i=n.node.arguments[0];this.sourceNames[i.value]=!0,this.sources.push([r.node,i]),e.remove()}}}};return{inherits:r(77),pre:function(){this.sources=[],this.sourceNames=(0,a.default)(null),this.bareSources=[],this.hasExports=!1,this.hasModule=!1},visitor:{Program:{exit:function(e){var t=this;if(!this.ran){this.ran=!0,e.traverse(i,this);var r=this.sources.map(function(e){return e[0]}),a=this.sources.map(function(e){return e[1]});a=a.concat(this.bareSources.filter(function(e){return!t.sourceNames[e.value]}));var s=this.getModuleName();s&&(s=n.stringLiteral(s)),this.hasExports&&(a.unshift(n.stringLiteral("exports")),r.unshift(n.identifier("exports"))),this.hasModule&&(a.unshift(n.stringLiteral("module")),r.unshift(n.identifier("module")));var o=e.node,c=l({PARAMS:r,BODY:o.body});c.expression.body.directives=o.directives,o.directives=[],o.body=[u({MODULE_NAME:s,SOURCES:a,FACTORY:c})]}}}}}};var s=r(4),o=n(s),u=(0,o.default)("\n define(MODULE_NAME, [SOURCES], FACTORY);\n"),l=(0,o.default)("\n (function (PARAMS) {\n BODY;\n })\n");e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){var t=e.types;return{inherits:r(196),visitor:(0,a.default)({operator:"**",build:function(e,r){return t.callExpression(t.memberExpression(t.identifier("Math"),t.identifier("pow")),[e,r])}})}};var i=r(313),a=n(i);e.exports=t.default},function(e,t,r){e.exports={default:r(403),__esModule:!0}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){for(var n=R.scope.get(e.node)||[],i=n,a=Array.isArray(i),s=0,i=a?i:(0,m.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o;if(u.parent===t&&u.path===e)return u}n.push(r),R.scope.has(e.node)||R.scope.set(e.node,n)}t.__esModule=!0;var s=r(20),o=i(s),u=r(13),l=i(u),c=r(132),f=i(c),p=r(3),d=i(p),h=r(2),m=i(h),v=r(112),y=i(v),g=r(278),b=i(g),E=r(381),x=i(E),A=r(8),_=i(A),D=r(271),C=i(D),S=r(19),w=n(S),F=r(224),k=i(F),P=r(455),T=i(P),O=r(1),B=n(O),R=r(88),I=0,M={For:function(e){for(var t=B.FOR_INIT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,m.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i,s=e.get(a);s.isVar()&&e.scope.getFunctionParent().registerBinding("var",s)}},Declaration:function(e){e.isBlockScoped()||e.isExportDeclaration()&&e.get("declaration").isDeclaration()||e.scope.getFunctionParent().registerDeclaration(e)},ReferencedIdentifier:function(e,t){t.references.push(e)},ForXStatement:function(e,t){var r=e.get("left");(r.isPattern()||r.isIdentifier())&&t.constantViolations.push(r)},ExportDeclaration:{exit:function(e){var t=e.node,r=e.scope,n=t.declaration;if(B.isClassDeclaration(n)||B.isFunctionDeclaration(n)){var i=n.id;if(!i)return;var a=r.getBinding(i.name);a&&a.reference(e)}else if(B.isVariableDeclaration(n))for(var s=n.declarations,o=Array.isArray(s),u=0,s=o?s:(0,m.default)(s);;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l,f=B.getBindingIdentifiers(c);for(var p in f){var d=r.getBinding(p);d&&d.reference(e)}}}},LabeledStatement:function(e){e.scope.getProgramParent().addGlobal(e.node),e.scope.getBlockParent().registerDeclaration(e)},AssignmentExpression:function(e,t){t.assignments.push(e)},UpdateExpression:function(e,t){t.constantViolations.push(e.get("argument"))},UnaryExpression:function(e,t){"delete"===e.node.operator&&t.constantViolations.push(e.get("argument"))},BlockScoped:function(e){var t=e.scope;t.path===e&&(t=t.parent),t.getBlockParent().registerDeclaration(e)},ClassDeclaration:function(e){var t=e.node.id;if(t){var r=t.name;e.scope.bindings[r]=e.scope.getBinding(r)}},Block:function(e){for(var t=e.get("body"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,m.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a;s.isFunctionDeclaration()&&e.scope.getBlockParent().registerDeclaration(s)}}},N=0,L=function(){function e(t,r){if((0,d.default)(this,e),r&&r.block===t.node)return r;var n=a(t,r,this);return n?n:(this.uid=N++,this.parent=r,this.hub=t.hub,this.parentBlock=t.parent,this.block=t.node,this.path=t,void(this.labels=new f.default))}return e.prototype.traverse=function(e,t,r){(0,_.default)(e,t,this,r,this.path)},e.prototype.generateDeclaredUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp",t=this.generateUidIdentifier(e);return this.push({id:t}),t},e.prototype.generateUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";return B.identifier(this.generateUid(e))},e.prototype.generateUid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";e=B.toIdentifier(e).replace(/^_+/,"").replace(/[0-9]+$/g,"");var t=void 0,r=0;do t=this._generateUid(e,r),r++;while(this.hasLabel(t)||this.hasBinding(t)||this.hasGlobal(t)||this.hasReference(t));var n=this.getProgramParent();return n.references[t]=!0,n.uids[t]=!0,t},e.prototype._generateUid=function(e,t){var r=e;return t>1&&(r+=t),"_"+r},e.prototype.generateUidIdentifierBasedOnNode=function(e,t){var r=e;B.isAssignmentExpression(e)?r=e.left:B.isVariableDeclarator(e)?r=e.id:(B.isObjectProperty(r)||B.isObjectMethod(r))&&(r=r.key);var n=[],i=function e(t){if(B.isModuleDeclaration(t))if(t.source)e(t.source);else if(t.specifiers&&t.specifiers.length)for(var r=t.specifiers,i=Array.isArray(r),a=0,r=i?r:(0,m.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;e(o)}else t.declaration&&e(t.declaration);else if(B.isModuleSpecifier(t))e(t.local);else if(B.isMemberExpression(t))e(t.object),e(t.property);else if(B.isIdentifier(t))n.push(t.name);else if(B.isLiteral(t))n.push(t.value);else if(B.isCallExpression(t))e(t.callee);else if(B.isObjectExpression(t)||B.isObjectPattern(t))for(var u=t.properties,l=Array.isArray(u),c=0,u=l?u:(0,m.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;e(p.key||p.argument)}};i(r);var a=n.join("$");return a=a.replace(/^_/,"")||t||"ref",this.generateUidIdentifier(a.slice(0,20))},e.prototype.isStatic=function(e){if(B.isThisExpression(e)||B.isSuper(e))return!0;if(B.isIdentifier(e)){var t=this.getBinding(e.name);return t?t.constant:this.hasBinding(e.name)}return!1},e.prototype.maybeGenerateMemoised=function(e,t){if(this.isStatic(e))return null;var r=this.generateUidIdentifierBasedOnNode(e);return t||this.push({id:r}),r},e.prototype.checkBlockScopedCollisions=function(e,t,r,n){if("param"!==t&&("hoisted"!==t||"let"!==e.kind)){var i=!1;if(i||(i="let"===t||"let"===e.kind||"const"===e.kind||"module"===e.kind),i||(i="param"===e.kind&&("let"===t||"const"===t)),i)throw this.hub.file.buildCodeFrameError(n,w.get("scopeDuplicateDeclaration",r),TypeError)}},e.prototype.rename=function(e,t,r){var n=this.getBinding(e);if(n)return t=t||this.generateUidIdentifier(e).name,new x.default(n,e,t).rename(r)},e.prototype._renameFromMap=function(e,t,r,n){e[t]&&(e[r]=n,e[t]=null)},e.prototype.dump=function(){var e=(0,b.default)("-",60);console.log(e);var t=this;do{console.log("#",t.block.type);for(var r in t.bindings){var n=t.bindings[r];console.log(" -",r,{constant:n.constant,references:n.references,violations:n.constantViolations.length,kind:n.kind})}}while(t=t.parent);console.log(e)},e.prototype.toArray=function(e,t){var r=this.hub.file;if(B.isIdentifier(e)){var n=this.getBinding(e.name);if(n&&n.constant&&n.path.isGenericType("Array"))return e}if(B.isArrayExpression(e))return e;if(B.isIdentifier(e,{name:"arguments"}))return B.callExpression(B.memberExpression(B.memberExpression(B.memberExpression(B.identifier("Array"),B.identifier("prototype")),B.identifier("slice")),B.identifier("call")),[e]);var i="toArray",a=[e];return t===!0?i="toConsumableArray":t&&(a.push(B.numericLiteral(t)),i="slicedToArray"),B.callExpression(r.addHelper(i),a)},e.prototype.hasLabel=function(e){return!!this.getLabel(e)},e.prototype.getLabel=function(e){return this.labels.get(e)},e.prototype.registerLabel=function(e){this.labels.set(e.node.label.name,e)},e.prototype.registerDeclaration=function(e){if(e.isLabeledStatement())this.registerLabel(e);else if(e.isFunctionDeclaration())this.registerBinding("hoisted",e.get("id"),e);else if(e.isVariableDeclaration())for(var t=e.get("declarations"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,m.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a;this.registerBinding(e.node.kind,s)}else if(e.isClassDeclaration())this.registerBinding("let",e);else if(e.isImportDeclaration())for(var o=e.get("specifiers"),u=o,l=Array.isArray(u),c=0,u=l?u:(0,m.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;this.registerBinding("module",p)}else if(e.isExportDeclaration()){var d=e.get("declaration");(d.isClassDeclaration()||d.isFunctionDeclaration()||d.isVariableDeclaration())&&this.registerDeclaration(d)}else this.registerBinding("unknown",e)},e.prototype.buildUndefinedNode=function(){return this.hasBinding("undefined")?B.unaryExpression("void",B.numericLiteral(0),!0):B.identifier("undefined")},e.prototype.registerConstantViolation=function(e){var t=e.getBindingIdentifiers();for(var r in t){var n=this.getBinding(r);n&&n.reassign(e)}},e.prototype.registerBinding=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!e)throw new ReferenceError("no `kind`");if(t.isVariableDeclaration())for(var n=t.get("declarations"),i=n,a=Array.isArray(i),s=0,i=a?i:(0,m.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o;this.registerBinding(e,u)}else{var l=this.getProgramParent(),c=t.getBindingIdentifiers(!0);for(var f in c)for(var p=c[f],d=Array.isArray(p),h=0,p=d?p:(0,m.default)(p);;){var v;if(d){if(h>=p.length)break;v=p[h++]}else{if(h=p.next(),h.done)break;v=h.value}var y=v,g=this.getOwnBinding(f);if(g){if(g.identifier===y)continue;this.checkBlockScopedCollisions(g,e,f,y)}g&&g.path.isFlow()&&(g=null),l.references[f]=!0,this.bindings[f]=new k.default({identifier:y,existing:g,scope:this,path:r,kind:e})}}},e.prototype.addGlobal=function(e){this.globals[e.name]=e},e.prototype.hasUid=function(e){var t=this;do if(t.uids[e])return!0;while(t=t.parent);return!1},e.prototype.hasGlobal=function(e){var t=this;do if(t.globals[e])return!0;while(t=t.parent);return!1},e.prototype.hasReference=function(e){var t=this;do if(t.references[e])return!0;while(t=t.parent);return!1},e.prototype.isPure=function(e,t){if(B.isIdentifier(e)){var r=this.getBinding(e.name);return!!r&&(!t||r.constant)}if(B.isClass(e))return!(e.superClass&&!this.isPure(e.superClass,t))&&this.isPure(e.body,t);if(B.isClassBody(e)){for(var n=e.body,i=Array.isArray(n),a=0,n=i?n:(0,m.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;if(!this.isPure(o,t))return!1}return!0}if(B.isBinary(e))return this.isPure(e.left,t)&&this.isPure(e.right,t);if(B.isArrayExpression(e)){for(var u=e.elements,l=Array.isArray(u),c=0,u=l?u:(0,m.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;if(!this.isPure(p,t))return!1}return!0}if(B.isObjectExpression(e)){for(var d=e.properties,h=Array.isArray(d),v=0,d=h?d:(0,m.default)(d);;){var y;if(h){if(v>=d.length)break;y=d[v++]}else{if(v=d.next(),v.done)break;y=v.value}var g=y;if(!this.isPure(g,t))return!1}return!0}return B.isClassMethod(e)?!(e.computed&&!this.isPure(e.key,t))&&("get"!==e.kind&&"set"!==e.kind):B.isClassProperty(e)||B.isObjectProperty(e)?!(e.computed&&!this.isPure(e.key,t))&&this.isPure(e.value,t):B.isUnaryExpression(e)?this.isPure(e.argument,t):B.isPureish(e)},e.prototype.setData=function(e,t){return this.data[e]=t},e.prototype.getData=function(e){var t=this;do{var r=t.data[e];if(null!=r)return r}while(t=t.parent)},e.prototype.removeData=function(e){var t=this;do{var r=t.data[e];null!=r&&(t.data[e]=null)}while(t=t.parent)},e.prototype.init=function(){this.references||this.crawl()},e.prototype.crawl=function(){I++,this._crawl(),I--},e.prototype._crawl=function(){var e=this.path;if(this.references=(0,l.default)(null),this.bindings=(0,l.default)(null),this.globals=(0,l.default)(null),this.uids=(0,l.default)(null),this.data=(0,l.default)(null),e.isLoop())for(var t=B.FOR_INIT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,m.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i,s=e.get(a);s.isBlockScoped()&&this.registerBinding(s.node.kind,s)}if(e.isFunctionExpression()&&e.has("id")&&(e.get("id").node[B.NOT_LOCAL_BINDING]||this.registerBinding("local",e.get("id"),e)),e.isClassExpression()&&e.has("id")&&(e.get("id").node[B.NOT_LOCAL_BINDING]||this.registerBinding("local",e)),e.isFunction())for(var o=e.get("params"),u=o,c=Array.isArray(u),f=0,u=c?u:(0,m.default)(u);;){var p;if(c){if(f>=u.length)break;p=u[f++]}else{if(f=u.next(),f.done)break;p=f.value}var d=p;this.registerBinding("param",d)}e.isCatchClause()&&this.registerBinding("let",e);var h=this.getProgramParent();if(!h.crawling){var v={references:[],constantViolations:[],assignments:[]};this.crawling=!0,e.traverse(M,v),this.crawling=!1;for(var y=v.assignments,g=Array.isArray(y),b=0,y=g?y:(0,m.default)(y);;){var E;if(g){if(b>=y.length)break;E=y[b++]}else{if(b=y.next(),b.done)break;E=b.value}var x=E,A=x.getBindingIdentifiers(),_=void 0;for(var D in A)x.scope.getBinding(D)||(_=_||x.scope.getProgramParent(),_.addGlobal(A[D]));x.scope.registerConstantViolation(x)}for(var C=v.references,S=Array.isArray(C),w=0,C=S?C:(0,m.default)(C);;){var F;if(S){if(w>=C.length)break;F=C[w++]}else{if(w=C.next(),w.done)break;F=w.value}var k=F,P=k.scope.getBinding(k.node.name);P?P.reference(k):k.scope.getProgramParent().addGlobal(k.node)}for(var T=v.constantViolations,O=Array.isArray(T),R=0,T=O?T:(0,m.default)(T);;){var I;if(O){if(R>=T.length)break;I=T[R++]}else{if(R=T.next(),R.done)break;I=R.value}var N=I;N.scope.registerConstantViolation(N)}}},e.prototype.push=function(e){var t=this.path;t.isBlockStatement()||t.isProgram()||(t=this.getBlockParent().path),t.isSwitchStatement()&&(t=this.getFunctionParent().path),(t.isLoop()||t.isCatchClause()||t.isFunction())&&(B.ensureBlock(t.node),t=t.get("body"));var r=e.unique,n=e.kind||"var",i=null==e._blockHoist?2:e._blockHoist,a="declaration:"+n+":"+i,s=!r&&t.getData(a);if(!s){var o=B.variableDeclaration(n,[]);o._generated=!0,o._blockHoist=i;var u=t.unshiftContainer("body",[o]);s=u[0],r||t.setData(a,s)}var l=B.variableDeclarator(e.id,e.init);s.node.declarations.push(l),this.registerBinding(n,s.get("declarations").pop())},e.prototype.getProgramParent=function(){var e=this;do if(e.path.isProgram())return e;while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getFunctionParent=function(){var e=this;do if(e.path.isFunctionParent())return e;while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getBlockParent=function(){var e=this;do if(e.path.isBlockParent())return e;while(e=e.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")},e.prototype.getAllBindings=function(){var e=(0,l.default)(null),t=this;do(0,C.default)(e,t.bindings),t=t.parent;while(t);return e},e.prototype.getAllBindingsOfKind=function(){for(var e=(0,l.default)(null),t=arguments,r=Array.isArray(t),n=0,t=r?t:(0,m.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break; i=n.value}var a=i,s=this;do{for(var o in s.bindings){var u=s.bindings[o];u.kind===a&&(e[o]=u)}s=s.parent}while(s)}return e},e.prototype.bindingIdentifierEquals=function(e,t){return this.getBindingIdentifier(e)===t},e.prototype.warnOnFlowBinding=function(e){return 0===I&&e&&e.path.isFlow()&&console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 6.8. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n "),e},e.prototype.getBinding=function(e){var t=this;do{var r=t.getOwnBinding(e);if(r)return this.warnOnFlowBinding(r)}while(t=t.parent)},e.prototype.getOwnBinding=function(e){return this.warnOnFlowBinding(this.bindings[e])},e.prototype.getBindingIdentifier=function(e){var t=this.getBinding(e);return t&&t.identifier},e.prototype.getOwnBindingIdentifier=function(e){var t=this.bindings[e];return t&&t.identifier},e.prototype.hasOwnBinding=function(e){return!!this.getOwnBinding(e)},e.prototype.hasBinding=function(t,r){return!!t&&(!!this.hasOwnBinding(t)||(!!this.parentHasBinding(t,r)||(!!this.hasUid(t)||(!(r||!(0,y.default)(e.globals,t))||!(r||!(0,y.default)(e.contextVariables,t))))))},e.prototype.parentHasBinding=function(e,t){return this.parent&&this.parent.hasBinding(e,t)},e.prototype.moveBindingTo=function(e,t){var r=this.getBinding(e);r&&(r.scope.removeOwnBinding(e),r.scope=t,t.bindings[e]=r)},e.prototype.removeOwnBinding=function(e){delete this.bindings[e]},e.prototype.removeBinding=function(e){var t=this.getBinding(e);t&&t.scope.removeOwnBinding(e);var r=this;do r.uids[e]&&(r.uids[e]=!1);while(r=r.parent)},e}();L.globals=(0,o.default)(T.default.builtin),L.contextVariables=["arguments","undefined","Infinity","NaN"],t.default=L,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.NOT_LOCAL_BINDING=t.BLOCK_SCOPED_SYMBOL=t.INHERIT_KEYS=t.UNARY_OPERATORS=t.STRING_UNARY_OPERATORS=t.NUMBER_UNARY_OPERATORS=t.BOOLEAN_UNARY_OPERATORS=t.BINARY_OPERATORS=t.NUMBER_BINARY_OPERATORS=t.BOOLEAN_BINARY_OPERATORS=t.COMPARISON_BINARY_OPERATORS=t.EQUALITY_BINARY_OPERATORS=t.BOOLEAN_NUMBER_BINARY_OPERATORS=t.UPDATE_OPERATORS=t.LOGICAL_OPERATORS=t.COMMENT_KEYS=t.FOR_INIT_KEYS=t.FLATTENABLE_KEYS=t.STATEMENT_OR_BLOCK_KEYS=void 0;var i=r(360),a=n(i),s=(t.STATEMENT_OR_BLOCK_KEYS=["consequent","body","alternate"],t.FLATTENABLE_KEYS=["body","expressions"],t.FOR_INIT_KEYS=["left","init"],t.COMMENT_KEYS=["leadingComments","trailingComments","innerComments"],t.LOGICAL_OPERATORS=["||","&&"],t.UPDATE_OPERATORS=["++","--"],t.BOOLEAN_NUMBER_BINARY_OPERATORS=[">","<",">=","<="]),o=t.EQUALITY_BINARY_OPERATORS=["==","===","!=","!=="],u=t.COMPARISON_BINARY_OPERATORS=[].concat(o,["in","instanceof"]),l=t.BOOLEAN_BINARY_OPERATORS=[].concat(u,s),c=t.NUMBER_BINARY_OPERATORS=["-","/","%","*","**","&","|",">>",">>>","<<","^"],f=(t.BINARY_OPERATORS=["+"].concat(c,l),t.BOOLEAN_UNARY_OPERATORS=["delete","!"]),p=t.NUMBER_UNARY_OPERATORS=["+","-","++","--","~"],d=t.STRING_UNARY_OPERATORS=["typeof"];t.UNARY_OPERATORS=["void"].concat(f,p,d),t.INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]},t.BLOCK_SCOPED_SYMBOL=(0,a.default)("var used to be block scoped"),t.NOT_LOCAL_BINDING=(0,a.default)("should not be considered a local binding")},function(e,t){"use strict";function r(e){return e=e.split(" "),function(t){return e.indexOf(t)>=0}}function n(e,t){for(var r=65536,n=0;n<t.length;n+=2){if(r+=t[n],r>e)return!1;if(r+=t[n+1],r>=e)return!0}}function i(e){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&k.test(String.fromCharCode(e)):n(e,T)))}function a(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&P.test(String.fromCharCode(e)):n(e,T)||n(e,O))))}function s(e){var t={};for(var r in B)t[r]=e&&r in e?e[r]:B[r];return t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){return new R(e,{beforeExpr:!0,binop:t})}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.keyword=e,L[e]=N["_"+e]=new R(e,t)}function c(e){return 10===e||13===e||8232===e||8233===e}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=1,n=0;;){U.lastIndex=n;var i=U.exec(e);if(!(i&&i.index<t))return new Y(r,t-n);++r,n=i.index+i[0].length}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t,r,n){return e.type=t,e.end=r,e.loc.end=n,this.processComment(e),e}function A(e){return e[e.length-1]}function _(e){return"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?_(e.object)+"."+_(e.property):void 0}function D(e,t){return new z(t,e).parse()}Object.defineProperty(t,"__esModule",{value:!0});var C={6:r("enum await"),strict:r("implements interface let package private protected public static yield"),strictBind:r("eval arguments")},S=r("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"),w="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",F="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",k=new RegExp("["+w+"]"),P=new RegExp("["+w+F+"]");w=F=null;var T=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],O=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],B={sourceType:"script",sourceFilename:void 0,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,plugins:[],strictMode:null},R=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop||null,this.updateContext=null},I={beforeExpr:!0},M={startsExpr:!0},N={num:new R("num",M),regexp:new R("regexp",M),string:new R("string",M),name:new R("name",M),eof:new R("eof"),bracketL:new R("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new R("]"),braceL:new R("{",{beforeExpr:!0,startsExpr:!0}),braceBarL:new R("{|",{beforeExpr:!0,startsExpr:!0}),braceR:new R("}"),braceBarR:new R("|}"),parenL:new R("(",{beforeExpr:!0,startsExpr:!0}),parenR:new R(")"),comma:new R(",",I),semi:new R(";",I),colon:new R(":",I),doubleColon:new R("::",I),dot:new R("."),question:new R("?",I),arrow:new R("=>",I),template:new R("template"),ellipsis:new R("...",I),backQuote:new R("`",M),dollarBraceL:new R("${",{beforeExpr:!0,startsExpr:!0}),at:new R("@"),eq:new R("=",{beforeExpr:!0,isAssign:!0}),assign:new R("_=",{beforeExpr:!0,isAssign:!0}),incDec:new R("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new R("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:u("||",1),logicalAND:u("&&",2),bitwiseOR:u("|",3),bitwiseXOR:u("^",4),bitwiseAND:u("&",5),equality:u("==/!=",6),relational:u("</>",7),bitShift:u("<</>>",8),plusMin:new R("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:u("%",10),star:u("*",10),slash:u("/",10),exponent:new R("**",{beforeExpr:!0,binop:11,rightAssociative:!0})},L={};l("break"),l("case",I),l("catch"),l("continue"),l("debugger"),l("default",I),l("do",{isLoop:!0,beforeExpr:!0}),l("else",I),l("finally"),l("for",{isLoop:!0}),l("function",M),l("if"),l("return",I),l("switch"),l("throw",I),l("try"),l("var"),l("let"),l("const"),l("while",{isLoop:!0}),l("with"),l("new",{beforeExpr:!0,startsExpr:!0}),l("this",M),l("super",M),l("class"),l("extends",I),l("export"),l("import"),l("yield",{beforeExpr:!0,startsExpr:!0}),l("null",M),l("true",M),l("false",M),l("in",{beforeExpr:!0,binop:7}),l("instanceof",{beforeExpr:!0,binop:7}),l("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),l("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),l("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0});var j=/\r\n?|\n|\u2028|\u2029/,U=new RegExp(j.source,"g"),V=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,G=function e(t,r,n,i){f(this,e),this.token=t,this.isExpr=!!r,this.preserveSpace=!!n,this.override=i},W={braceStatement:new G("{",(!1)),braceExpression:new G("{",(!0)),templateQuasi:new G("${",(!0)),parenStatement:new G("(",(!1)),parenExpression:new G("(",(!0)),template:new G("`",(!0),(!0),function(e){return e.readTmplToken()}),functionExpression:new G("function",(!0))};N.parenR.updateContext=N.braceR.updateContext=function(){if(1===this.state.context.length)return void(this.state.exprAllowed=!0);var e=this.state.context.pop();e===W.braceStatement&&this.curContext()===W.functionExpression?(this.state.context.pop(),this.state.exprAllowed=!1):e===W.templateQuasi?this.state.exprAllowed=!0:this.state.exprAllowed=!e.isExpr},N.name.updateContext=function(e){this.state.exprAllowed=!1,e!==N._let&&e!==N._const&&e!==N._var||j.test(this.input.slice(this.state.end))&&(this.state.exprAllowed=!0)},N.braceL.updateContext=function(e){this.state.context.push(this.braceIsBlock(e)?W.braceStatement:W.braceExpression),this.state.exprAllowed=!0},N.dollarBraceL.updateContext=function(){this.state.context.push(W.templateQuasi),this.state.exprAllowed=!0},N.parenL.updateContext=function(e){var t=e===N._if||e===N._for||e===N._with||e===N._while;this.state.context.push(t?W.parenStatement:W.parenExpression),this.state.exprAllowed=!0},N.incDec.updateContext=function(){},N._function.updateContext=function(){this.curContext()!==W.braceStatement&&this.state.context.push(W.functionExpression),this.state.exprAllowed=!1},N.backQuote.updateContext=function(){this.curContext()===W.template?this.state.context.pop():this.state.context.push(W.template),this.state.exprAllowed=!1};var Y=function e(t,r){p(this,e),this.line=t,this.column=r},q=function e(t,r){p(this,e),this.start=t,this.end=r},K=function(){function e(){h(this,e)}return e.prototype.init=function(e,t){return this.strict=e.strictMode!==!1&&"module"===e.sourceType,this.input=t,this.potentialArrowAt=-1,this.inMethod=this.inFunction=this.inGenerator=this.inAsync=this.inType=this.noAnonFunctionType=!1,this.labels=[],this.decorators=[],this.tokens=[],this.comments=[],this.trailingComments=[],this.leadingComments=[],this.commentStack=[],this.pos=this.lineStart=0,this.curLine=1,this.type=N.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=[W.braceStatement],this.exprAllowed=!0,this.containsEsc=this.containsOctal=!1,this.octalPosition=null,this.exportedIdentifiers=[],this},e.prototype.curPosition=function(){return new Y(this.curLine,this.pos-this.lineStart)},e.prototype.clone=function(t){var r=new e;for(var n in this){var i=this[n];t&&"context"!==n||!Array.isArray(i)||(i=i.slice()),r[n]=i}return r},e}(),H=function e(t){m(this,e),this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new q(t.startLoc,t.endLoc)},J=function(){function e(t,r){m(this,e),this.state=new K,this.state.init(t,r)}return e.prototype.next=function(){this.isLookahead||this.state.tokens.push(new H(this.state)),this.state.lastTokEnd=this.state.end,this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()},e.prototype.eat=function(e){return!!this.match(e)&&(this.next(),!0)},e.prototype.match=function(e){return this.state.type===e},e.prototype.isKeyword=function(e){return S(e)},e.prototype.lookahead=function(){var e=this.state;this.state=e.clone(!0),this.isLookahead=!0,this.next(),this.isLookahead=!1;var t=this.state.clone(!0);return this.state=e,t},e.prototype.setStrict=function(e){if(this.state.strict=e,this.match(N.num)||this.match(N.string)){for(this.state.pos=this.state.start;this.state.pos<this.state.lineStart;)this.state.lineStart=this.input.lastIndexOf("\n",this.state.lineStart-2)+1,--this.state.curLine;this.nextToken()}},e.prototype.curContext=function(){return this.state.context[this.state.context.length-1]},e.prototype.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.state.containsOctal=!1,this.state.octalPosition=null,this.state.start=this.state.pos,this.state.startLoc=this.state.curPosition(),this.state.pos>=this.input.length?this.finishToken(N.eof):e.override?e.override(this):this.readToken(this.fullCharCodeAtPos())},e.prototype.readToken=function(e){return i(e)||92===e?this.readWord():this.getTokenFromCode(e)},e.prototype.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.state.pos);if(e<=55295||e>=57344)return e;var t=this.input.charCodeAt(this.state.pos+1);return(e<<10)+t-56613888},e.prototype.pushComment=function(e,t,r,n,i,a){var s={type:e?"CommentBlock":"CommentLine",value:t,start:r,end:n,loc:new q(i,a)};this.isLookahead||(this.state.tokens.push(s),this.state.comments.push(s),this.addComment(s))},e.prototype.skipBlockComment=function(){var e=this.state.curPosition(),t=this.state.pos,r=this.input.indexOf("*/",this.state.pos+=2);r===-1&&this.raise(this.state.pos-2,"Unterminated comment"),this.state.pos=r+2,U.lastIndex=t;for(var n=void 0;(n=U.exec(this.input))&&n.index<this.state.pos;)++this.state.curLine,this.state.lineStart=n.index+n[0].length;this.pushComment(!0,this.input.slice(t+2,r),t,this.state.pos,e,this.state.curPosition())},e.prototype.skipLineComment=function(e){for(var t=this.state.pos,r=this.state.curPosition(),n=this.input.charCodeAt(this.state.pos+=e);this.state.pos<this.input.length&&10!==n&&13!==n&&8232!==n&&8233!==n;)++this.state.pos,n=this.input.charCodeAt(this.state.pos);this.pushComment(!1,this.input.slice(t+e,this.state.pos),t,this.state.pos,r,this.state.curPosition())},e.prototype.skipSpace=function(){e:for(;this.state.pos<this.input.length;){var e=this.input.charCodeAt(this.state.pos);switch(e){case 32:case 160:++this.state.pos;break;case 13:10===this.input.charCodeAt(this.state.pos+1)&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&V.test(String.fromCharCode(e))))break e;++this.state.pos}}},e.prototype.finishToken=function(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();var r=this.state.type;this.state.type=e,this.state.value=t,this.updateContext(r)},e.prototype.readToken_dot=function(){var e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.state.pos+2);return 46===e&&46===t?(this.state.pos+=3,this.finishToken(N.ellipsis)):(++this.state.pos,this.finishToken(N.dot))},e.prototype.readToken_slash=function(){if(this.state.exprAllowed)return++this.state.pos,this.readRegexp();var e=this.input.charCodeAt(this.state.pos+1);return 61===e?this.finishOp(N.assign,2):this.finishOp(N.slash,1)},e.prototype.readToken_mult_modulo=function(e){var t=42===e?N.star:N.modulo,r=1,n=this.input.charCodeAt(this.state.pos+1);return 42===n&&(r++,n=this.input.charCodeAt(this.state.pos+2),t=N.exponent),61===n&&(r++,t=N.assign),this.finishOp(t,r)},e.prototype.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?this.finishOp(124===e?N.logicalOR:N.logicalAND,2):61===t?this.finishOp(N.assign,2):124===e&&125===t&&this.hasPlugin("flow")?this.finishOp(N.braceBarR,2):this.finishOp(124===e?N.bitwiseOR:N.bitwiseAND,1)},e.prototype.readToken_caret=function(){var e=this.input.charCodeAt(this.state.pos+1);return 61===e?this.finishOp(N.assign,2):this.finishOp(N.bitwiseXOR,1)},e.prototype.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?45===t&&62===this.input.charCodeAt(this.state.pos+2)&&j.test(this.input.slice(this.state.lastTokEnd,this.state.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(N.incDec,2):61===t?this.finishOp(N.assign,2):this.finishOp(N.plusMin,1)},e.prototype.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.state.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.state.pos+2)?3:2,61===this.input.charCodeAt(this.state.pos+r)?this.finishOp(N.assign,r+1):this.finishOp(N.bitShift,r)):33===t&&60===e&&45===this.input.charCodeAt(this.state.pos+2)&&45===this.input.charCodeAt(this.state.pos+3)?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(r=2),this.finishOp(N.relational,r))},e.prototype.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.state.pos+1);return 61===t?this.finishOp(N.equality,61===this.input.charCodeAt(this.state.pos+2)?3:2):61===e&&62===t?(this.state.pos+=2,this.finishToken(N.arrow)):this.finishOp(61===e?N.eq:N.prefix,1)},e.prototype.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.state.pos,this.finishToken(N.parenL);case 41:return++this.state.pos,this.finishToken(N.parenR);case 59:return++this.state.pos,this.finishToken(N.semi);case 44:return++this.state.pos,this.finishToken(N.comma);case 91:return++this.state.pos,this.finishToken(N.bracketL);case 93:return++this.state.pos,this.finishToken(N.bracketR);case 123:return this.hasPlugin("flow")&&124===this.input.charCodeAt(this.state.pos+1)?this.finishOp(N.braceBarL,2):(++this.state.pos,this.finishToken(N.braceL));case 125:return++this.state.pos,this.finishToken(N.braceR);case 58:return this.hasPlugin("functionBind")&&58===this.input.charCodeAt(this.state.pos+1)?this.finishOp(N.doubleColon,2):(++this.state.pos,this.finishToken(N.colon));case 63:return++this.state.pos,this.finishToken(N.question);case 64:return++this.state.pos,this.finishToken(N.at);case 96:return++this.state.pos,this.finishToken(N.backQuote);case 48:var t=this.input.charCodeAt(this.state.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(N.prefix,1)}this.raise(this.state.pos,"Unexpected character '"+v(e)+"'")},e.prototype.finishOp=function(e,t){var r=this.input.slice(this.state.pos,this.state.pos+t);return this.state.pos+=t,this.finishToken(e,r)},e.prototype.readRegexp=function(){for(var e=void 0,t=void 0,r=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var n=this.input.charAt(this.state.pos);if(j.test(n)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.state.pos}var i=this.input.slice(r,this.state.pos);++this.state.pos;var a=this.readWord1();if(a){var s=/^[gmsiyu]*$/;s.test(a)||this.raise(r,"Invalid regular expression flag")}return this.finishToken(N.regexp,{pattern:i,flags:a})},e.prototype.readInt=function(e,t){for(var r=this.state.pos,n=0,i=0,a=null==t?1/0:t;i<a;++i){var s=this.input.charCodeAt(this.state.pos),o=void 0;if(o=s>=97?s-97+10:s>=65?s-65+10:s>=48&&s<=57?s-48:1/0,o>=e)break;++this.state.pos,n=n*e+o}return this.state.pos===r||null!=t&&this.state.pos-r!==t?null:n},e.prototype.readRadixNumber=function(e){this.state.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.state.start+2,"Expected number in radix "+e),i(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number"),this.finishToken(N.num,t)},e.prototype.readNumber=function(e){var t=this.state.pos,r=!1,n=48===this.input.charCodeAt(this.state.pos);e||null!==this.readInt(10)||this.raise(t,"Invalid number");var a=this.input.charCodeAt(this.state.pos);46===a&&(++this.state.pos,this.readInt(10),r=!0,a=this.input.charCodeAt(this.state.pos)),69!==a&&101!==a||(a=this.input.charCodeAt(++this.state.pos),43!==a&&45!==a||++this.state.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),r=!0),i(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number");var s=this.input.slice(t,this.state.pos),o=void 0;return r?o=parseFloat(s):n&&1!==s.length?/[89]/.test(s)||this.state.strict?this.raise(t,"Invalid number"):o=parseInt(s,8):o=parseInt(s,10),this.finishToken(N.num,o)},e.prototype.readCodePoint=function(){var e=this.input.charCodeAt(this.state.pos),t=void 0;if(123===e){var r=++this.state.pos;t=this.readHexChar(this.input.indexOf("}",this.state.pos)-this.state.pos),++this.state.pos,t>1114111&&this.raise(r,"Code point out of bounds")}else t=this.readHexChar(4);return t},e.prototype.readString=function(e){for(var t="",r=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var n=this.input.charCodeAt(this.state.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.state.pos),t+=this.readEscapedChar(!1),r=this.state.pos):(c(n)&&this.raise(this.state.start,"Unterminated string constant"),++this.state.pos)}return t+=this.input.slice(r,this.state.pos++),this.finishToken(N.string,t)},e.prototype.readTmplToken=function(){for(var e="",t=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated template");var r=this.input.charCodeAt(this.state.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.state.pos+1))return this.state.pos===this.state.start&&this.match(N.template)?36===r?(this.state.pos+=2,this.finishToken(N.dollarBraceL)):(++this.state.pos,this.finishToken(N.backQuote)):(e+=this.input.slice(t,this.state.pos),this.finishToken(N.template,e));if(92===r)e+=this.input.slice(t,this.state.pos),e+=this.readEscapedChar(!0),t=this.state.pos;else if(c(r)){switch(e+=this.input.slice(t,this.state.pos),++this.state.pos,r){case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}++this.state.curLine,this.state.lineStart=this.state.pos,t=this.state.pos}else++this.state.pos}},e.prototype.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.state.pos);switch(++this.state.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return v(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:return this.state.lineStart=this.state.pos,++this.state.curLine,"";default:if(t>=48&&t<=55){var r=this.input.substr(this.state.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(r,8);return n>255&&(r=r.slice(0,-1),n=parseInt(r,8)),n>0&&(this.state.containsOctal||(this.state.containsOctal=!0,this.state.octalPosition=this.state.pos-2),(this.state.strict||e)&&this.raise(this.state.pos-2,"Octal literal in strict mode")),this.state.pos+=r.length-1,String.fromCharCode(n)}return String.fromCharCode(t)}},e.prototype.readHexChar=function(e){var t=this.state.pos,r=this.readInt(16,e);return null===r&&this.raise(t,"Bad character escape sequence"),r},e.prototype.readWord1=function(){this.state.containsEsc=!1;for(var e="",t=!0,r=this.state.pos;this.state.pos<this.input.length;){var n=this.fullCharCodeAtPos();if(a(n))this.state.pos+=n<=65535?1:2;else{if(92!==n)break;this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);var s=this.state.pos;117!==this.input.charCodeAt(++this.state.pos)&&this.raise(this.state.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.state.pos;var o=this.readCodePoint();(t?i:a)(o,!0)||this.raise(s,"Invalid Unicode escape"),e+=v(o),r=this.state.pos}t=!1}return e+this.input.slice(r,this.state.pos)},e.prototype.readWord=function(){var e=this.readWord1(),t=N.name;return!this.state.containsEsc&&this.isKeyword(e)&&(t=L[e]),this.finishToken(t,e)},e.prototype.braceIsBlock=function(e){if(e===N.colon){var t=this.curContext();if(t===W.braceStatement||t===W.braceExpression)return!t.isExpr}return e===N._return?j.test(this.input.slice(this.state.lastTokEnd,this.state.start)):e===N._else||e===N.semi||e===N.eof||e===N.parenR||(e===N.braceL?this.curContext()===W.braceStatement:!this.state.exprAllowed)},e.prototype.updateContext=function(e){var t=void 0,r=this.state.type;r.keyword&&e===N.dot?this.state.exprAllowed=!1:(t=r.updateContext)?t.call(this,e):this.state.exprAllowed=r.beforeExpr},e}(),X={},z=function(e){function t(r,n){y(this,t),r=s(r);var i=g(this,e.call(this,r,n));return i.options=r,i.inModule="module"===i.options.sourceType,i.input=n,i.plugins=i.loadPlugins(i.options.plugins),i.filename=r.sourceFilename,0===i.state.pos&&"#"===i.input[0]&&"!"===i.input[1]&&i.skipLineComment(2),i}return b(t,e),t.prototype.isReservedWord=function(e){return"await"===e?this.inModule:C[6](e)},t.prototype.hasPlugin=function(e){return!(!this.plugins["*"]&&!this.plugins[e])},t.prototype.extend=function(e,t){this[e]=t(this[e])},t.prototype.loadPlugins=function(e){var t={};e.indexOf("flow")>=0&&(e=e.filter(function(e){return"flow"!==e}),e.push("flow"));for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a;if(!t[s]){t[s]=!0;var o=X[s];o&&o(this)}}return t},t.prototype.parse=function(){var e=this.startNode(),t=this.startNode();return this.nextToken(),this.parseTopLevel(e,t)},t}(J),$="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},Q=z.prototype;Q.addExtra=function(e,t,r){if(e){var n=e.extra=e.extra||{};n[t]=r}},Q.isRelational=function(e){return this.match(N.relational)&&this.state.value===e},Q.expectRelational=function(e){this.isRelational(e)?this.next():this.unexpected(null,N.relational)},Q.isContextual=function(e){return this.match(N.name)&&this.state.value===e},Q.eatContextual=function(e){return this.state.value===e&&this.eat(N.name)},Q.expectContextual=function(e,t){this.eatContextual(e)||this.unexpected(null,t)},Q.canInsertSemicolon=function(){return this.match(N.eof)||this.match(N.braceR)||j.test(this.input.slice(this.state.lastTokEnd,this.state.start))},Q.isLineTerminator=function(){return this.eat(N.semi)||this.canInsertSemicolon()},Q.semicolon=function(){this.isLineTerminator()||this.unexpected(null,N.semi)},Q.expect=function(e,t){return this.eat(e)||this.unexpected(t,e)},Q.unexpected=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unexpected token";t&&"object"===("undefined"==typeof t?"undefined":$(t))&&t.label&&(t="Unexpected token, expected "+t.label),this.raise(null!=e?e:this.state.start,t)};var Z=z.prototype;Z.parseTopLevel=function(e,t){return t.sourceType=this.options.sourceType,this.parseBlockBody(t,!0,!0,N.eof),e.program=this.finishNode(t,"Program"),e.comments=this.state.comments,e.tokens=this.state.tokens,this.finishNode(e,"File")};var ee={kind:"loop"},te={kind:"switch"};Z.stmtToDirective=function(e){var t=e.expression,r=this.startNodeAt(t.start,t.loc.start),n=this.startNodeAt(e.start,e.loc.start),i=this.input.slice(t.start,t.end),a=r.value=i.slice(1,-1);return this.addExtra(r,"raw",i),this.addExtra(r,"rawValue",a),n.value=this.finishNodeAt(r,"DirectiveLiteral",t.end,t.loc.end),this.finishNodeAt(n,"Directive",e.end,e.loc.end)},Z.parseStatement=function(e,t){this.match(N.at)&&this.parseDecorators(!0);var r=this.state.type,n=this.startNode();switch(r){case N._break:case N._continue:return this.parseBreakContinueStatement(n,r.keyword);case N._debugger:return this.parseDebuggerStatement(n);case N._do:return this.parseDoStatement(n);case N._for:return this.parseForStatement(n); case N._function:return e||this.unexpected(),this.parseFunctionStatement(n);case N._class:return e||this.unexpected(),this.takeDecorators(n),this.parseClass(n,!0);case N._if:return this.parseIfStatement(n);case N._return:return this.parseReturnStatement(n);case N._switch:return this.parseSwitchStatement(n);case N._throw:return this.parseThrowStatement(n);case N._try:return this.parseTryStatement(n);case N._let:case N._const:e||this.unexpected();case N._var:return this.parseVarStatement(n,r);case N._while:return this.parseWhileStatement(n);case N._with:return this.parseWithStatement(n);case N.braceL:return this.parseBlock();case N.semi:return this.parseEmptyStatement(n);case N._export:case N._import:if(this.hasPlugin("dynamicImport")&&this.lookahead().type===N.parenL)break;return this.options.allowImportExportEverywhere||(t||this.raise(this.state.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.state.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===N._import?this.parseImport(n):this.parseExport(n);case N.name:if("async"===this.state.value){var i=this.state.clone();if(this.next(),this.match(N._function)&&!this.canInsertSemicolon())return this.expect(N._function),this.parseFunction(n,!0,!1,!0);this.state=i}}var a=this.state.value,s=this.parseExpression();return r===N.name&&"Identifier"===s.type&&this.eat(N.colon)?this.parseLabeledStatement(n,a,s):this.parseExpressionStatement(n,s)},Z.takeDecorators=function(e){this.state.decorators.length&&(e.decorators=this.state.decorators,this.state.decorators=[])},Z.parseDecorators=function(e){for(;this.match(N.at);)this.state.decorators.push(this.parseDecorator());e&&this.match(N._export)||this.match(N._class)||this.raise(this.state.start,"Leading decorators must be attached to a class declaration")},Z.parseDecorator=function(){this.hasPlugin("decorators")||this.unexpected();var e=this.startNode();return this.next(),e.expression=this.parseMaybeAssign(),this.finishNode(e,"Decorator")},Z.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.isLineTerminator()?e.label=null:this.match(N.name)?(e.label=this.parseIdentifier(),this.semicolon()):this.unexpected();var n=void 0;for(n=0;n<this.state.labels.length;++n){var i=this.state.labels[n];if(null==e.label||i.name===e.label.name){if(null!=i.kind&&(r||"loop"===i.kind))break;if(e.label&&r)break}}return n===this.state.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")},Z.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},Z.parseDoStatement=function(e){return this.next(),this.state.labels.push(ee),e.body=this.parseStatement(!1),this.state.labels.pop(),this.expect(N._while),e.test=this.parseParenExpression(),this.eat(N.semi),this.finishNode(e,"DoWhileStatement")},Z.parseForStatement=function(e){this.next(),this.state.labels.push(ee);var t=!1;if(this.hasPlugin("asyncGenerators")&&this.state.inAsync&&this.isContextual("await")&&(t=!0,this.next()),this.expect(N.parenL),this.match(N.semi))return t&&this.unexpected(),this.parseFor(e,null);if(this.match(N._var)||this.match(N._let)||this.match(N._const)){var r=this.startNode(),n=this.state.type;return this.next(),this.parseVar(r,!0,n),this.finishNode(r,"VariableDeclaration"),!this.match(N._in)&&!this.isContextual("of")||1!==r.declarations.length||r.declarations[0].init?(t&&this.unexpected(),this.parseFor(e,r)):this.parseForIn(e,r,t)}var i={start:0},a=this.parseExpression(!0,i);if(this.match(N._in)||this.isContextual("of")){var s=this.isContextual("of")?"for-of statement":"for-in statement";return this.toAssignable(a,void 0,s),this.checkLVal(a,void 0,void 0,s),this.parseForIn(e,a,t)}return i.start&&this.unexpected(i.start),t&&this.unexpected(),this.parseFor(e,a)},Z.parseFunctionStatement=function(e){return this.next(),this.parseFunction(e,!0)},Z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!1),e.alternate=this.eat(N._else)?this.parseStatement(!1):null,this.finishNode(e,"IfStatement")},Z.parseReturnStatement=function(e){return this.state.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.state.start,"'return' outside of function"),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},Z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(N.braceL),this.state.labels.push(te);for(var t,r=void 0;!this.match(N.braceR);)if(this.match(N._case)||this.match(N._default)){var n=this.match(N._case);r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),n?r.test=this.parseExpression():(t&&this.raise(this.state.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(N.colon)}else r?r.consequent.push(this.parseStatement(!0)):this.unexpected();return r&&this.finishNode(r,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")},Z.parseThrowStatement=function(e){return this.next(),j.test(this.input.slice(this.state.lastTokEnd,this.state.start))&&this.raise(this.state.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var re=[];Z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(N._catch)){var t=this.startNode();this.next(),this.expect(N.parenL),t.param=this.parseBindingAtom(),this.checkLVal(t.param,!0,Object.create(null),"catch clause"),this.expect(N.parenR),t.body=this.parseBlock(),e.handler=this.finishNode(t,"CatchClause")}return e.guardedHandlers=re,e.finalizer=this.eat(N._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},Z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},Z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.state.labels.push(ee),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,"WhileStatement")},Z.parseWithStatement=function(e){return this.state.strict&&this.raise(this.state.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},Z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},Z.parseLabeledStatement=function(e,t,r){for(var n=this.state.labels,i=Array.isArray(n),a=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;o.name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var u=this.state.type.isLoop?"loop":this.match(N._switch)?"switch":null,l=this.state.labels.length-1;l>=0;l--){var c=this.state.labels[l];if(c.statementStart!==e.start)break;c.statementStart=this.state.start,c.kind=u}return this.state.labels.push({name:t,kind:u,statementStart:this.state.start}),e.body=this.parseStatement(!0),this.state.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},Z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},Z.parseBlock=function(e){var t=this.startNode();return this.expect(N.braceL),this.parseBlockBody(t,e,!1,N.braceR),this.finishNode(t,"BlockStatement")},Z.parseBlockBody=function(e,t,r,n){e.body=[],e.directives=[];for(var i=!1,a=void 0,s=void 0;!this.eat(n);){i||!this.state.containsOctal||s||(s=this.state.octalPosition);var o=this.parseStatement(!0,r);if(!t||i||"ExpressionStatement"!==o.type||"StringLiteral"!==o.expression.type||o.expression.extra.parenthesized)i=!0,e.body.push(o);else{var u=this.stmtToDirective(o);e.directives.push(u),void 0===a&&"use strict"===u.value.value&&(a=this.state.strict,this.setStrict(!0),s&&this.raise(s,"Octal literal in strict mode"))}}a===!1&&this.setStrict(!1)},Z.parseFor=function(e,t){return e.init=t,this.expect(N.semi),e.test=this.match(N.semi)?null:this.parseExpression(),this.expect(N.semi),e.update=this.match(N.parenR)?null:this.parseExpression(),this.expect(N.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,"ForStatement")},Z.parseForIn=function(e,t,r){var n=void 0;return r?(this.eatContextual("of"),n="ForAwaitStatement"):(n=this.match(N._in)?"ForInStatement":"ForOfStatement",this.next()),e.left=t,e.right=this.parseExpression(),this.expect(N.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,n)},Z.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r.keyword;;){var n=this.startNode();if(this.parseVarHead(n),this.eat(N.eq)?n.init=this.parseMaybeAssign(t):r!==N._const||this.match(N._in)||this.isContextual("of")?"Identifier"===n.id.type||t&&(this.match(N._in)||this.isContextual("of"))?n.init=null:this.raise(this.state.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(N.comma))break}return e},Z.parseVarHead=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0,void 0,"variable declaration")},Z.parseFunction=function(e,t,r,n,i){var a=this.state.inMethod;return this.state.inMethod=!1,this.initFunction(e,n),this.match(N.star)&&(e.async&&!this.hasPlugin("asyncGenerators")?this.unexpected():(e.generator=!0,this.next())),!t||i||this.match(N.name)||this.match(N._yield)||this.unexpected(),(this.match(N.name)||this.match(N._yield))&&(e.id=this.parseBindingIdentifier()),this.parseFunctionParams(e),this.parseFunctionBody(e,r),this.state.inMethod=a,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},Z.parseFunctionParams=function(e){this.expect(N.parenL),e.params=this.parseBindingList(N.parenR)},Z.parseClass=function(e,t,r){return this.next(),this.parseClassId(e,t,r),this.parseClassSuper(e),this.parseClassBody(e),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},Z.isClassProperty=function(){return this.match(N.eq)||this.isLineTerminator()},Z.isClassMutatorStarter=function(){return!1},Z.parseClassBody=function(e){var t=this.state.strict;this.state.strict=!0;var r=!1,n=!1,i=[],a=this.startNode();for(a.body=[],this.expect(N.braceL);!this.eat(N.braceR);)if(!this.eat(N.semi))if(this.match(N.at))i.push(this.parseDecorator());else{var s=this.startNode();i.length&&(s.decorators=i,i=[]);var o=!1,u=this.match(N.name)&&"static"===this.state.value,l=this.eat(N.star),c=!1,f=!1;if(this.parsePropertyName(s),s.static=u&&!this.match(N.parenL),s.static&&(l=this.eat(N.star),this.parsePropertyName(s)),!l){if(this.isClassProperty()){a.body.push(this.parseClassProperty(s));continue}"Identifier"===s.key.type&&!s.computed&&this.hasPlugin("classConstructorCall")&&"call"===s.key.name&&this.match(N.name)&&"constructor"===this.state.value&&(o=!0,this.parsePropertyName(s))}var p=!this.match(N.parenL)&&!s.computed&&"Identifier"===s.key.type&&"async"===s.key.name;if(p&&(this.hasPlugin("asyncGenerators")&&this.eat(N.star)&&(l=!0),f=!0,this.parsePropertyName(s)),s.kind="method",!s.computed){var d=s.key;f||l||this.isClassMutatorStarter()||"Identifier"!==d.type||this.match(N.parenL)||"get"!==d.name&&"set"!==d.name||(c=!0,s.kind=d.name,d=this.parsePropertyName(s));var h=!o&&!s.static&&("Identifier"===d.type&&"constructor"===d.name||"StringLiteral"===d.type&&"constructor"===d.value);h&&(n&&this.raise(d.start,"Duplicate constructor in the same class"),c&&this.raise(d.start,"Constructor can't have get/set modifier"),l&&this.raise(d.start,"Constructor can't be a generator"),f&&this.raise(d.start,"Constructor can't be an async function"),s.kind="constructor",n=!0);var m=s.static&&("Identifier"===d.type&&"prototype"===d.name||"StringLiteral"===d.type&&"prototype"===d.value);m&&this.raise(d.start,"Classes may not have static property named prototype")}if(o&&(r&&this.raise(s.start,"Duplicate constructor call in the same class"),s.kind="constructorCall",r=!0),"constructor"!==s.kind&&"constructorCall"!==s.kind||!s.decorators||this.raise(s.start,"You can't attach decorators to a class constructor"),this.parseClassMethod(a,s,l,f),c){var v="get"===s.kind?0:1;if(s.params.length!==v){var y=s.start;"get"===s.kind?this.raise(y,"getter should have no params"):this.raise(y,"setter should have exactly one param")}}}i.length&&this.raise(this.state.start,"You have trailing decorators with no method"),e.body=this.finishNode(a,"ClassBody"),this.state.strict=t},Z.parseClassProperty=function(e){return this.match(N.eq)?(this.hasPlugin("classProperties")||this.unexpected(),this.next(),e.value=this.parseMaybeAssign()):e.value=null,this.semicolon(),this.finishNode(e,"ClassProperty")},Z.parseClassMethod=function(e,t,r,n){this.parseMethod(t,r,n),e.body.push(this.finishNode(t,"ClassMethod"))},Z.parseClassId=function(e,t,r){this.match(N.name)?e.id=this.parseIdentifier():r||!t?e.id=null:this.unexpected()},Z.parseClassSuper=function(e){e.superClass=this.eat(N._extends)?this.parseExprSubscripts():null},Z.parseExport=function(e){if(this.next(),this.match(N.star)){var t=this.startNode();if(this.next(),!this.hasPlugin("exportExtensions")||!this.eatContextual("as"))return this.parseExportFrom(e,!0),this.finishNode(e,"ExportAllDeclaration");t.exported=this.parseIdentifier(),e.specifiers=[this.finishNode(t,"ExportNamespaceSpecifier")],this.parseExportSpecifiersMaybe(e),this.parseExportFrom(e,!0)}else if(this.hasPlugin("exportExtensions")&&this.isExportDefaultSpecifier()){var r=this.startNode();if(r.exported=this.parseIdentifier(!0),e.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],this.match(N.comma)&&this.lookahead().type===N.star){this.expect(N.comma);var n=this.startNode();this.expect(N.star),this.expectContextual("as"),n.exported=this.parseIdentifier(),e.specifiers.push(this.finishNode(n,"ExportNamespaceSpecifier"))}else this.parseExportSpecifiersMaybe(e);this.parseExportFrom(e,!0)}else{if(this.eat(N._default)){var i=this.startNode(),a=!1;return this.eat(N._function)?i=this.parseFunction(i,!0,!1,!1,!0):this.match(N._class)?i=this.parseClass(i,!0,!0):(a=!0,i=this.parseMaybeAssign()),e.declaration=i,a&&this.semicolon(),this.checkExport(e,!0,!0),this.finishNode(e,"ExportDefaultDeclaration")}this.state.type.keyword||this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.declaration=this.parseExportDeclaration(e)):(e.declaration=null,e.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(e))}return this.checkExport(e,!0),this.finishNode(e,"ExportNamedDeclaration")},Z.parseExportDeclaration=function(){return this.parseStatement(!0)},Z.isExportDefaultSpecifier=function(){if(this.match(N.name))return"type"!==this.state.value&&"async"!==this.state.value&&"interface"!==this.state.value;if(!this.match(N._default))return!1;var e=this.lookahead();return e.type===N.comma||e.type===N.name&&"from"===e.value},Z.parseExportSpecifiersMaybe=function(e){this.eat(N.comma)&&(e.specifiers=e.specifiers.concat(this.parseExportSpecifiers()))},Z.parseExportFrom=function(e,t){this.eatContextual("from")?(e.source=this.match(N.string)?this.parseExprAtom():this.unexpected(),this.checkExport(e)):t?this.unexpected():e.source=null,this.semicolon()},Z.shouldParseExportDeclaration=function(){return this.isContextual("async")},Z.checkExport=function(e,t,r){if(t)if(r)this.checkDuplicateExports(e,"default");else if(e.specifiers&&e.specifiers.length)for(var n=e.specifiers,i=Array.isArray(n),a=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;this.checkDuplicateExports(o,o.exported.name)}else if(e.declaration)if("FunctionDeclaration"===e.declaration.type||"ClassDeclaration"===e.declaration.type)this.checkDuplicateExports(e,e.declaration.id.name);else if("VariableDeclaration"===e.declaration.type)for(var u=e.declaration.declarations,l=Array.isArray(u),c=0,u=l?u:u[Symbol.iterator]();;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;this.checkDeclaration(p.id)}if(this.state.decorators.length){var d=e.declaration&&("ClassDeclaration"===e.declaration.type||"ClassExpression"===e.declaration.type);e.declaration&&d||this.raise(e.start,"You can only use decorators on an export when exporting a class"),this.takeDecorators(e.declaration)}},Z.checkDeclaration=function(e){if("ObjectPattern"===e.type)for(var t=e.properties,r=Array.isArray(t),n=0,t=r?t:t[Symbol.iterator]();;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;this.checkDeclaration(a)}else if("ArrayPattern"===e.type)for(var s=e.elements,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l;c&&this.checkDeclaration(c)}else"ObjectProperty"===e.type?this.checkDeclaration(e.value):"RestElement"===e.type||"RestProperty"===e.type?this.checkDeclaration(e.argument):"Identifier"===e.type&&this.checkDuplicateExports(e,e.name)},Z.checkDuplicateExports=function(e,t){this.state.exportedIdentifiers.indexOf(t)>-1&&this.raiseDuplicateExportError(e,t),this.state.exportedIdentifiers.push(t)},Z.raiseDuplicateExportError=function(e,t){this.raise(e.start,"default"===t?"Only one default export allowed per module.":"`"+t+"` has already been exported. Exported identifiers must be unique.")},Z.parseExportSpecifiers=function(){var e=[],t=!0,r=void 0;for(this.expect(N.braceL);!this.eat(N.braceR);){if(t)t=!1;else if(this.expect(N.comma),this.eat(N.braceR))break;var n=this.match(N._default);n&&!r&&(r=!0);var i=this.startNode();i.local=this.parseIdentifier(n),i.exported=this.eatContextual("as")?this.parseIdentifier(!0):i.local.__clone(),e.push(this.finishNode(i,"ExportSpecifier"))}return r&&!this.isContextual("from")&&this.unexpected(),e},Z.parseImport=function(e){return this.next(),this.match(N.string)?(e.specifiers=[],e.source=this.parseExprAtom()):(e.specifiers=[],this.parseImportSpecifiers(e),this.expectContextual("from"),e.source=this.match(N.string)?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},Z.parseImportSpecifiers=function(e){var t=!0;if(this.match(N.name)){var r=this.state.start,n=this.state.startLoc;if(e.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(),r,n)),!this.eat(N.comma))return}if(this.match(N.star)){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdentifier(),this.checkLVal(i.local,!0,void 0,"import namespace specifier"),void e.specifiers.push(this.finishNode(i,"ImportNamespaceSpecifier"))}for(this.expect(N.braceL);!this.eat(N.braceR);){if(t)t=!1;else if(this.expect(N.comma),this.eat(N.braceR))break;var a=this.startNode();a.imported=this.parseIdentifier(!0),a.local=this.eatContextual("as")?this.parseIdentifier():a.imported.__clone(),this.checkLVal(a.local,!0,void 0,"import specifier"),e.specifiers.push(this.finishNode(a,"ImportSpecifier"))}},Z.parseImportSpecifierDefault=function(e,t,r){var n=this.startNodeAt(t,r);return n.local=e,this.checkLVal(n.local,!0,void 0,"default import specifier"),this.finishNode(n,"ImportDefaultSpecifier")};var ne=z.prototype;ne.toAssignable=function(e,t,r){if(e)switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var n=e.properties,i=Array.isArray(n),a=0,n=i?n:n[Symbol.iterator]();;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;"ObjectMethod"===o.type?"get"===o.kind||"set"===o.kind?this.raise(o.key.start,"Object pattern can't contain getter or setter"):this.raise(o.key.start,"Object pattern can't contain methods"):this.toAssignable(o,t,"object destructuring pattern")}break;case"ObjectProperty":this.toAssignable(e.value,t,r);break;case"SpreadProperty":e.type="RestProperty";break;case"ArrayExpression":e.type="ArrayPattern",this.toAssignableList(e.elements,t,r);break;case"AssignmentExpression":"="===e.operator?(e.type="AssignmentPattern",delete e.operator):this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");break;case"MemberExpression":if(!t)break;default:var u="Invalid left-hand side"+(r?" in "+r:"expression");this.raise(e.start,u)}return e},ne.toAssignableList=function(e,t,r){var n=e.length;if(n){var i=e[n-1];if(i&&"RestElement"===i.type)--n;else if(i&&"SpreadElement"===i.type){i.type="RestElement";var a=i.argument;this.toAssignable(a,t,r),"Identifier"!==a.type&&"MemberExpression"!==a.type&&"ArrayPattern"!==a.type&&this.unexpected(a.start),--n}}for(var s=0;s<n;s++){var o=e[s];o&&this.toAssignable(o,t,r)}return e},ne.toReferencedList=function(e){return e},ne.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ne.parseRest=function(){var e=this.startNode();return this.next(),e.argument=this.parseBindingIdentifier(),this.finishNode(e,"RestElement")},ne.shouldAllowYieldIdentifier=function(){return this.match(N._yield)&&!this.state.strict&&!this.state.inGenerator},ne.parseBindingIdentifier=function(){return this.parseIdentifier(this.shouldAllowYieldIdentifier())},ne.parseBindingAtom=function(){switch(this.state.type){case N._yield:(this.state.strict||this.state.inGenerator)&&this.unexpected();case N.name:return this.parseIdentifier(!0);case N.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(N.bracketR,!0),this.finishNode(e,"ArrayPattern");case N.braceL:return this.parseObj(!0);default:this.unexpected()}},ne.parseBindingList=function(e,t){for(var r=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(N.comma),t&&this.match(N.comma))r.push(null);else{if(this.eat(e))break;if(this.match(N.ellipsis)){r.push(this.parseAssignableListItemTypes(this.parseRest())),this.expect(e);break}for(var i=[];this.match(N.at);)i.push(this.parseDecorator());var a=this.parseMaybeDefault();i.length&&(a.decorators=i),this.parseAssignableListItemTypes(a),r.push(this.parseMaybeDefault(a.start,a.loc.start,a))}return r},ne.parseAssignableListItemTypes=function(e){return e},ne.parseMaybeDefault=function(e,t,r){if(t=t||this.state.startLoc,e=e||this.state.start,r=r||this.parseBindingAtom(),!this.eat(N.eq))return r;var n=this.startNodeAt(e,t);return n.left=r,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},ne.checkLVal=function(e,t,r,n){switch(e.type){case"Identifier":if(this.checkReservedWord(e.name,e.start,!1,!0),r){var i="_"+e.name;r[i]?this.raise(e.start,"Argument name clash in strict mode"):r[i]=!0}break;case"MemberExpression":t&&this.raise(e.start,(t?"Binding":"Assigning to")+" member expression");break;case"ObjectPattern":for(var a=e.properties,s=Array.isArray(a),o=0,a=s?a:a[Symbol.iterator]();;){var u;if(s){if(o>=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u;"ObjectProperty"===l.type&&(l=l.value),this.checkLVal(l,t,r,"object destructuring pattern")}break;case"ArrayPattern":for(var c=e.elements,f=Array.isArray(c),p=0,c=f?c:c[Symbol.iterator]();;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;h&&this.checkLVal(h,t,r,"array destructuring pattern")}break;case"AssignmentPattern":this.checkLVal(e.left,t,r,"assignment pattern");break;case"RestProperty":this.checkLVal(e.argument,t,r,"rest property");break;case"RestElement":this.checkLVal(e.argument,t,r,"rest element");break;default:var m=(t?"Binding invalid":"Invalid")+" left-hand side"+(n?" in "+n:"expression");this.raise(e.start,m)}};var ie=z.prototype;ie.checkPropClash=function(e,t){if(!e.computed){var r=e.key,n=void 0;switch(r.type){case"Identifier":n=r.name;break;case"StringLiteral":case"NumericLiteral":n=String(r.value);break;default:return}"__proto__"!==n||e.kind||(t.proto&&this.raise(r.start,"Redefinition of __proto__ property"),t.proto=!0)}},ie.parseExpression=function(e,t){var r=this.state.start,n=this.state.startLoc,i=this.parseMaybeAssign(e,t);if(this.match(N.comma)){var a=this.startNodeAt(r,n);for(a.expressions=[i];this.eat(N.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.toReferencedList(a.expressions),this.finishNode(a,"SequenceExpression")}return i},ie.parseMaybeAssign=function(e,t,r,n){var i=this.state.start,a=this.state.startLoc;if(this.match(N._yield)&&this.state.inGenerator){var s=this.parseYield();return r&&(s=r.call(this,s,i,a)),s}var o=void 0;t?o=!1:(t={start:0},o=!0),(this.match(N.parenL)||this.match(N.name))&&(this.state.potentialArrowAt=this.state.start);var u=this.parseMaybeConditional(e,t,n);if(r&&(u=r.call(this,u,i,a)),this.state.type.isAssign){var l=this.startNodeAt(i,a);if(l.operator=this.state.value,l.left=this.match(N.eq)?this.toAssignable(u,void 0,"assignment expression"):u,t.start=0,this.checkLVal(u,void 0,void 0,"assignment expression"),u.extra&&u.extra.parenthesized){var c=void 0;"ObjectPattern"===u.type?c="`({a}) = 0` use `({a} = 0)`":"ArrayPattern"===u.type&&(c="`([a]) = 0` use `([a] = 0)`"),c&&this.raise(u.start,"You're trying to assign to a parenthesized expression, eg. instead of "+c)}return this.next(),l.right=this.parseMaybeAssign(e),this.finishNode(l,"AssignmentExpression")}return o&&t.start&&this.unexpected(t.start),u},ie.parseMaybeConditional=function(e,t,r){var n=this.state.start,i=this.state.startLoc,a=this.parseExprOps(e,t);return t&&t.start?a:this.parseConditional(a,e,n,i,r)},ie.parseConditional=function(e,t,r,n){if(this.eat(N.question)){var i=this.startNodeAt(r,n);return i.test=e,i.consequent=this.parseMaybeAssign(),this.expect(N.colon),i.alternate=this.parseMaybeAssign(t),this.finishNode(i,"ConditionalExpression")}return e},ie.parseExprOps=function(e,t){var r=this.state.start,n=this.state.startLoc,i=this.parseMaybeUnary(t);return t&&t.start?i:this.parseExprOp(i,r,n,-1,e)},ie.parseExprOp=function(e,t,r,n,i){var a=this.state.type.binop;if(!(null==a||i&&this.match(N._in))&&a>n){var s=this.startNodeAt(t,r);s.left=e,s.operator=this.state.value,"**"!==s.operator||"UnaryExpression"!==e.type||!e.extra||e.extra.parenthesizedArgument||e.extra.parenthesized||this.raise(e.argument.start,"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");var o=this.state.type;this.next();var u=this.state.start,l=this.state.startLoc;return s.right=this.parseExprOp(this.parseMaybeUnary(),u,l,o.rightAssociative?a-1:a,i),this.finishNode(s,o===N.logicalOR||o===N.logicalAND?"LogicalExpression":"BinaryExpression"),this.parseExprOp(s,t,r,n,i)}return e},ie.parseMaybeUnary=function(e){if(this.state.type.prefix){var t=this.startNode(),r=this.match(N.incDec);t.operator=this.state.value,t.prefix=!0,this.next();var n=this.state.type;return t.argument=this.parseMaybeUnary(),this.addExtra(t,"parenthesizedArgument",!(n!==N.parenL||t.argument.extra&&t.argument.extra.parenthesized)),e&&e.start&&this.unexpected(e.start),r?this.checkLVal(t.argument,void 0,void 0,"prefix operation"):this.state.strict&&"delete"===t.operator&&"Identifier"===t.argument.type&&this.raise(t.start,"Deleting local variable in strict mode"),this.finishNode(t,r?"UpdateExpression":"UnaryExpression")}var i=this.state.start,a=this.state.startLoc,s=this.parseExprSubscripts(e);if(e&&e.start)return s;for(;this.state.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(i,a);o.operator=this.state.value,o.prefix=!1,o.argument=s,this.checkLVal(s,void 0,void 0,"postfix operation"),this.next(),s=this.finishNode(o,"UpdateExpression")}return s},ie.parseExprSubscripts=function(e){var t=this.state.start,r=this.state.startLoc,n=this.state.potentialArrowAt,i=this.parseExprAtom(e);return"ArrowFunctionExpression"===i.type&&i.start===n?i:e&&e.start?i:this.parseSubscripts(i,t,r)},ie.parseSubscripts=function(e,t,r,n){for(;;){if(!n&&this.eat(N.doubleColon)){var i=this.startNodeAt(t,r);return i.object=e,i.callee=this.parseNoCallExpr(),this.parseSubscripts(this.finishNode(i,"BindExpression"),t,r,n)}if(this.eat(N.dot)){var a=this.startNodeAt(t,r);a.object=e,a.property=this.parseIdentifier(!0),a.computed=!1,e=this.finishNode(a,"MemberExpression")}else if(this.eat(N.bracketL)){var s=this.startNodeAt(t,r);s.object=e,s.property=this.parseExpression(),s.computed=!0,this.expect(N.bracketR),e=this.finishNode(s,"MemberExpression")}else if(!n&&this.match(N.parenL)){var o=this.state.potentialArrowAt===e.start&&"Identifier"===e.type&&"async"===e.name&&!this.canInsertSemicolon();this.next();var u=this.startNodeAt(t,r);if(u.callee=e,u.arguments=this.parseCallExpressionArguments(N.parenR,o),"Import"===u.callee.type&&1!==u.arguments.length&&this.raise(u.start,"import() requires exactly one argument"),e=this.finishNode(u,"CallExpression"),o&&this.shouldParseAsyncArrow())return this.parseAsyncArrowFromCallExpression(this.startNodeAt(t,r),u);this.toReferencedList(u.arguments)}else{if(!this.match(N.backQuote))return e;var l=this.startNodeAt(t,r);l.tag=e,l.quasi=this.parseTemplate(),e=this.finishNode(l,"TaggedTemplateExpression")}}},ie.parseCallExpressionArguments=function(e,t){for(var r=void 0,n=[],i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(N.comma),this.eat(e))break;this.match(N.parenL)&&!r&&(r=this.state.start),n.push(this.parseExprListItem(void 0,t?{start:0}:void 0))}return t&&r&&this.shouldParseAsyncArrow()&&this.unexpected(),n},ie.shouldParseAsyncArrow=function(){return this.match(N.arrow)},ie.parseAsyncArrowFromCallExpression=function(e,t){return this.expect(N.arrow),this.parseArrowExpression(e,t.arguments,!0)},ie.parseNoCallExpr=function(){var e=this.state.start,t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,t,!0)},ie.parseExprAtom=function(e){var t=void 0,r=this.state.potentialArrowAt===this.state.start;switch(this.state.type){case N._super:return this.state.inMethod||this.options.allowSuperOutsideMethod||this.raise(this.state.start,"'super' outside of function or class"),t=this.startNode(),this.next(),this.match(N.parenL)||this.match(N.bracketL)||this.match(N.dot)||this.unexpected(),this.match(N.parenL)&&"constructor"!==this.state.inMethod&&!this.options.allowSuperOutsideMethod&&this.raise(t.start,"super() outside of class constructor"),this.finishNode(t,"Super");case N._import:return this.hasPlugin("dynamicImport")||this.unexpected(),t=this.startNode(),this.next(),this.match(N.parenL)||this.unexpected(null,N.parenL),this.finishNode(t,"Import");case N._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case N._yield:this.state.inGenerator&&this.unexpected();case N.name:t=this.startNode();var n="await"===this.state.value&&this.state.inAsync,i=this.shouldAllowYieldIdentifier(),a=this.parseIdentifier(n||i);if("await"===a.name){if(this.state.inAsync||this.inModule)return this.parseAwait(t)}else{if("async"===a.name&&this.match(N._function)&&!this.canInsertSemicolon())return this.next(),this.parseFunction(t,!1,!1,!0);if(r&&"async"===a.name&&this.match(N.name)){var s=[this.parseIdentifier()];return this.expect(N.arrow),this.parseArrowExpression(t,s,!0)}}return r&&!this.canInsertSemicolon()&&this.eat(N.arrow)?this.parseArrowExpression(t,[a]):a;case N._do:if(this.hasPlugin("doExpressions")){var o=this.startNode();this.next();var u=this.state.inFunction,l=this.state.labels;return this.state.labels=[],this.state.inFunction=!1,o.body=this.parseBlock(!1,!0),this.state.inFunction=u,this.state.labels=l,this.finishNode(o,"DoExpression")}case N.regexp:var c=this.state.value;return t=this.parseLiteral(c.value,"RegExpLiteral"),t.pattern=c.pattern,t.flags=c.flags,t;case N.num:return this.parseLiteral(this.state.value,"NumericLiteral");case N.string:return this.parseLiteral(this.state.value,"StringLiteral");case N._null:return t=this.startNode(),this.next(),this.finishNode(t,"NullLiteral");case N._true:case N._false:return t=this.startNode(),t.value=this.match(N._true),this.next(), this.finishNode(t,"BooleanLiteral");case N.parenL:return this.parseParenAndDistinguishExpression(null,null,r);case N.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(N.bracketR,!0,e),this.toReferencedList(t.elements),this.finishNode(t,"ArrayExpression");case N.braceL:return this.parseObj(!1,e);case N._function:return this.parseFunctionExpression();case N.at:this.parseDecorators();case N._class:return t=this.startNode(),this.takeDecorators(t),this.parseClass(t,!1);case N._new:return this.parseNew();case N.backQuote:return this.parseTemplate();case N.doubleColon:t=this.startNode(),this.next(),t.object=null;var f=t.callee=this.parseNoCallExpr();if("MemberExpression"===f.type)return this.finishNode(t,"BindExpression");this.raise(f.start,"Binding should be performed on object property.");default:this.unexpected()}},ie.parseFunctionExpression=function(){var e=this.startNode(),t=this.parseIdentifier(!0);return this.state.inGenerator&&this.eat(N.dot)&&this.hasPlugin("functionSent")?this.parseMetaProperty(e,t,"sent"):this.parseFunction(e,!1)},ie.parseMetaProperty=function(e,t,r){return e.meta=t,e.property=this.parseIdentifier(!0),e.property.name!==r&&this.raise(e.property.start,"The only valid meta property for new is "+t.name+"."+r),this.finishNode(e,"MetaProperty")},ie.parseLiteral=function(e,t){var r=this.startNode();return this.addExtra(r,"rawValue",e),this.addExtra(r,"raw",this.input.slice(this.state.start,this.state.end)),r.value=e,this.next(),this.finishNode(r,t)},ie.parseParenExpression=function(){this.expect(N.parenL);var e=this.parseExpression();return this.expect(N.parenR),e},ie.parseParenAndDistinguishExpression=function(e,t,r){e=e||this.state.start,t=t||this.state.startLoc;var n=void 0;this.expect(N.parenL);for(var i=this.state.start,a=this.state.startLoc,s=[],o=!0,u={start:0},l=void 0,c=void 0,f={start:0};!this.match(N.parenR);){if(o)o=!1;else if(this.expect(N.comma,f.start||null),this.match(N.parenR)){c=this.state.start;break}if(this.match(N.ellipsis)){var p=this.state.start,d=this.state.startLoc;l=this.state.start,s.push(this.parseParenItem(this.parseRest(),d,p));break}s.push(this.parseMaybeAssign(!1,u,this.parseParenItem,f))}var h=this.state.start,m=this.state.startLoc;this.expect(N.parenR);var v=this.startNodeAt(e,t);if(r&&this.shouldParseArrow()&&(v=this.parseArrow(v))){for(var y=s,g=Array.isArray(y),b=0,y=g?y:y[Symbol.iterator]();;){var E;if(g){if(b>=y.length)break;E=y[b++]}else{if(b=y.next(),b.done)break;E=b.value}var x=E;x.extra&&x.extra.parenthesized&&this.unexpected(x.extra.parenStart)}return this.parseArrowExpression(v,s)}return s.length||this.unexpected(this.state.lastTokStart),c&&this.unexpected(c),l&&this.unexpected(l),u.start&&this.unexpected(u.start),f.start&&this.unexpected(f.start),s.length>1?(n=this.startNodeAt(i,a),n.expressions=s,this.toReferencedList(n.expressions),this.finishNodeAt(n,"SequenceExpression",h,m)):n=s[0],this.addExtra(n,"parenthesized",!0),this.addExtra(n,"parenStart",e),n},ie.shouldParseArrow=function(){return!this.canInsertSemicolon()},ie.parseArrow=function(e){if(this.eat(N.arrow))return e},ie.parseParenItem=function(e){return e},ie.parseNew=function(){var e=this.startNode(),t=this.parseIdentifier(!0);return this.eat(N.dot)?this.parseMetaProperty(e,t,"target"):(e.callee=this.parseNoCallExpr(),this.eat(N.parenL)?(e.arguments=this.parseExprList(N.parenR),this.toReferencedList(e.arguments)):e.arguments=[],this.finishNode(e,"NewExpression"))},ie.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.state.start,this.state.end).replace(/\r\n?/g,"\n"),cooked:this.state.value},this.next(),e.tail=this.match(N.backQuote),this.finishNode(e,"TemplateElement")},ie.parseTemplate=function(){var e=this.startNode();this.next(),e.expressions=[];var t=this.parseTemplateElement();for(e.quasis=[t];!t.tail;)this.expect(N.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(N.braceR),e.quasis.push(t=this.parseTemplateElement());return this.next(),this.finishNode(e,"TemplateLiteral")},ie.parseObj=function(e,t){var r=[],n=Object.create(null),i=!0,a=this.startNode();a.properties=[],this.next();for(var s=null;!this.eat(N.braceR);){if(i)i=!1;else if(this.expect(N.comma),this.eat(N.braceR))break;for(;this.match(N.at);)r.push(this.parseDecorator());var o=this.startNode(),u=!1,l=!1,c=void 0,f=void 0;if(r.length&&(o.decorators=r,r=[]),this.hasPlugin("objectRestSpread")&&this.match(N.ellipsis)){if(o=this.parseSpread(),o.type=e?"RestProperty":"SpreadProperty",a.properties.push(o),!e)continue;var p=this.state.start;if(null===s){if(this.eat(N.braceR))break;if(this.match(N.comma)&&this.lookahead().type===N.braceR)continue;s=p;continue}this.unexpected(s,"Cannot have multiple rest elements when destructuring")}if(o.method=!1,o.shorthand=!1,(e||t)&&(c=this.state.start,f=this.state.startLoc),e||(u=this.eat(N.star)),!e&&this.isContextual("async")){u&&this.unexpected();var d=this.parseIdentifier();this.match(N.colon)||this.match(N.parenL)||this.match(N.braceR)||this.match(N.eq)||this.match(N.comma)?o.key=d:(l=!0,this.hasPlugin("asyncGenerators")&&(u=this.eat(N.star)),this.parsePropertyName(o))}else this.parsePropertyName(o);this.parseObjPropValue(o,c,f,u,l,e,t),this.checkPropClash(o,n),o.shorthand&&this.addExtra(o,"shorthand",!0),a.properties.push(o)}return null!==s&&this.unexpected(s,"The rest element has to be the last element when destructuring"),r.length&&this.raise(this.state.start,"You have trailing decorators with no property"),this.finishNode(a,e?"ObjectPattern":"ObjectExpression")},ie.parseObjPropValue=function(e,t,r,n,i,a,s){if(i||n||this.match(N.parenL))return a&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,n,i),this.finishNode(e,"ObjectMethod");if(this.eat(N.colon))return e.value=a?this.parseMaybeDefault(this.state.start,this.state.startLoc):this.parseMaybeAssign(!1,s),this.finishNode(e,"ObjectProperty");if(!(a||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.match(N.comma)||this.match(N.braceR))){(n||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),this.parseMethod(e,!1);var o="get"===e.kind?0:1;if(e.params.length!==o){var u=e.start;"get"===e.kind?this.raise(u,"getter should have no params"):this.raise(u,"setter should have exactly one param")}return this.finishNode(e,"ObjectMethod")}return e.computed||"Identifier"!==e.key.type?void this.unexpected():(a?(this.checkReservedWord(e.key.name,e.key.start,!0,!0),e.value=this.parseMaybeDefault(t,r,e.key.__clone())):this.match(N.eq)&&s?(s.start||(s.start=this.state.start),e.value=this.parseMaybeDefault(t,r,e.key.__clone())):e.value=e.key.__clone(),e.shorthand=!0,this.finishNode(e,"ObjectProperty"))},ie.parsePropertyName=function(e){return this.eat(N.bracketL)?(e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(N.bracketR),e.key):(e.computed=!1,e.key=this.match(N.num)||this.match(N.string)?this.parseExprAtom():this.parseIdentifier(!0))},ie.initFunction=function(e,t){e.id=null,e.generator=!1,e.expression=!1,e.async=!!t},ie.parseMethod=function(e,t,r){var n=this.state.inMethod;return this.state.inMethod=e.kind||!0,this.initFunction(e,r),this.expect(N.parenL),e.params=this.parseBindingList(N.parenR),e.generator=t,this.parseFunctionBody(e),this.state.inMethod=n,e},ie.parseArrowExpression=function(e,t,r){return this.initFunction(e,r),e.params=this.toAssignableList(t,!0,"arrow function parameters"),this.parseFunctionBody(e,!0),this.finishNode(e,"ArrowFunctionExpression")},ie.parseFunctionBody=function(e,t){var r=t&&!this.match(N.braceL),n=this.state.inAsync;if(this.state.inAsync=e.async,r)e.body=this.parseMaybeAssign(),e.expression=!0;else{var i=this.state.inFunction,a=this.state.inGenerator,s=this.state.labels;this.state.inFunction=!0,this.state.inGenerator=e.generator,this.state.labels=[],e.body=this.parseBlock(!0),e.expression=!1,this.state.inFunction=i,this.state.inGenerator=a,this.state.labels=s}this.state.inAsync=n;var o=this.state.strict,u=!1;if(t&&(o=!0),!r&&e.body.directives.length)for(var l=e.body.directives,c=Array.isArray(l),f=0,l=c?l:l[Symbol.iterator]();;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;if("use strict"===d.value.value){u=!0,o=!0;break}}if(u&&e.id&&"Identifier"===e.id.type&&"yield"===e.id.name&&this.raise(e.id.start,"Binding yield in strict mode"),o){var h=Object.create(null),m=this.state.strict;u&&(this.state.strict=!0),e.id&&this.checkLVal(e.id,!0,void 0,"function name");for(var v=e.params,y=Array.isArray(v),g=0,v=y?v:v[Symbol.iterator]();;){var b;if(y){if(g>=v.length)break;b=v[g++]}else{if(g=v.next(),g.done)break;b=g.value}var E=b;u&&"Identifier"!==E.type&&this.raise(E.start,"Non-simple parameter in strict mode"),this.checkLVal(E,!0,h,"function parameter list")}this.state.strict=m}},ie.parseExprList=function(e,t,r){for(var n=[],i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(N.comma),this.eat(e))break;n.push(this.parseExprListItem(t,r))}return n},ie.parseExprListItem=function(e,t){var r=void 0;return r=e&&this.match(N.comma)?null:this.match(N.ellipsis)?this.parseSpread(t):this.parseMaybeAssign(!1,t,this.parseParenItem)},ie.parseIdentifier=function(e){var t=this.startNode();return this.match(N.name)?(e||this.checkReservedWord(this.state.value,this.state.start,!1,!1),t.name=this.state.value):e&&this.state.type.keyword?t.name=this.state.type.keyword:this.unexpected(),!e&&"await"===t.name&&this.state.inAsync&&this.raise(t.start,"invalid use of await inside of an async function"),t.loc.identifierName=t.name,this.next(),this.finishNode(t,"Identifier")},ie.checkReservedWord=function(e,t,r,n){(this.isReservedWord(e)||r&&this.isKeyword(e))&&this.raise(t,e+" is a reserved word"),this.state.strict&&(C.strict(e)||n&&C.strictBind(e))&&this.raise(t,e+" is a reserved word in strict mode")},ie.parseAwait=function(e){return this.state.inAsync||this.unexpected(),this.match(N.star)&&this.raise(e.start,"await* has been removed from the async functions proposal. Use Promise.all() instead."),e.argument=this.parseMaybeUnary(),this.finishNode(e,"AwaitExpression")},ie.parseYield=function(){var e=this.startNode();return this.next(),this.match(N.semi)||this.canInsertSemicolon()||!this.match(N.star)&&!this.state.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(N.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")};var ae=z.prototype,se=["leadingComments","trailingComments","innerComments"],oe=function(){function e(t,r,n){E(this,e),this.type="",this.start=t,this.end=0,this.loc=new q(r),n&&(this.loc.filename=n)}return e.prototype.__clone=function(){var t=new e;for(var r in this)se.indexOf(r)<0&&(t[r]=this[r]);return t},e}();ae.startNode=function(){return new oe(this.state.start,this.state.startLoc,this.filename)},ae.startNodeAt=function(e,t){return new oe(e,t,this.filename)},ae.finishNode=function(e,t){return x.call(this,e,t,this.state.lastTokEnd,this.state.lastTokEndLoc)},ae.finishNodeAt=function(e,t,r,n){return x.call(this,e,t,r,n)};var ue=z.prototype;ue.raise=function(e,t){var r=d(this.input,e);t+=" ("+r.line+":"+r.column+")";var n=new SyntaxError(t);throw n.pos=e,n.loc=r,n};var le=z.prototype;le.addComment=function(e){this.filename&&(e.loc.filename=this.filename),this.state.trailingComments.push(e),this.state.leadingComments.push(e)},le.processComment=function(e){if(!("Program"===e.type&&e.body.length>0)){var t=this.state.commentStack,r=void 0,n=void 0,i=void 0,a=void 0;if(this.state.trailingComments.length>0)this.state.trailingComments[0].start>=e.end?(n=this.state.trailingComments,this.state.trailingComments=[]):this.state.trailingComments.length=0;else{var s=A(t);t.length>0&&s.trailingComments&&s.trailingComments[0].start>=e.end&&(n=s.trailingComments,s.trailingComments=null)}for(;t.length>0&&A(t).start>=e.start;)r=t.pop();if(r){if(r.leadingComments)if(r!==e&&A(r.leadingComments).end<=e.start)e.leadingComments=r.leadingComments,r.leadingComments=null;else for(i=r.leadingComments.length-2;i>=0;--i)if(r.leadingComments[i].end<=e.start){e.leadingComments=r.leadingComments.splice(0,i+1);break}}else if(this.state.leadingComments.length>0)if(A(this.state.leadingComments).end<=e.start){if(this.state.commentPreviousNode)for(a=0;a<this.state.leadingComments.length;a++)this.state.leadingComments[a].end<this.state.commentPreviousNode.end&&(this.state.leadingComments.splice(a,1),a--);this.state.leadingComments.length>0&&(e.leadingComments=this.state.leadingComments,this.state.leadingComments=[])}else{for(i=0;i<this.state.leadingComments.length&&!(this.state.leadingComments[i].end>e.start);i++);e.leadingComments=this.state.leadingComments.slice(0,i),0===e.leadingComments.length&&(e.leadingComments=null),n=this.state.leadingComments.slice(i),0===n.length&&(n=null)}this.state.commentPreviousNode=e,n&&(n.length&&n[0].start>=e.start&&A(n).end<=e.end?e.innerComments=n:e.trailingComments=n),t.push(e)}};var ce=z.prototype;ce.flowParseTypeInitialiser=function(e,t){var r=this.state.inType;this.state.inType=!0,this.expect(e||N.colon),t&&(this.match(N.bitwiseAND)||this.match(N.bitwiseOR))&&this.next();var n=this.flowParseType();return this.state.inType=r,n},ce.flowParseDeclareClass=function(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")},ce.flowParseDeclareFunction=function(e){this.next();var t=e.id=this.parseIdentifier(),r=this.startNode(),n=this.startNode();this.isRelational("<")?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(N.parenL);var i=this.flowParseFunctionTypeParams();return r.params=i.params,r.rest=i.rest,this.expect(N.parenR),r.returnType=this.flowParseTypeInitialiser(),n.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.finishNode(t,t.type),this.semicolon(),this.finishNode(e,"DeclareFunction")},ce.flowParseDeclare=function(e){return this.match(N._class)?this.flowParseDeclareClass(e):this.match(N._function)?this.flowParseDeclareFunction(e):this.match(N._var)?this.flowParseDeclareVariable(e):this.isContextual("module")?this.lookahead().type===N.dot?this.flowParseDeclareModuleExports(e):this.flowParseDeclareModule(e):this.isContextual("type")?this.flowParseDeclareTypeAlias(e):this.isContextual("interface")?this.flowParseDeclareInterface(e):void this.unexpected()},ce.flowParseDeclareVariable=function(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.semicolon(),this.finishNode(e,"DeclareVariable")},ce.flowParseDeclareModule=function(e){this.next(),this.match(N.string)?e.id=this.parseExprAtom():e.id=this.parseIdentifier();var t=e.body=this.startNode(),r=t.body=[];for(this.expect(N.braceL);!this.match(N.braceR);){var n=this.startNode();this.expectContextual("declare","Unexpected token. Only declares are allowed inside declare module"),r.push(this.flowParseDeclare(n))}return this.expect(N.braceR),this.finishNode(t,"BlockStatement"),this.finishNode(e,"DeclareModule")},ce.flowParseDeclareModuleExports=function(e){return this.expectContextual("module"),this.expect(N.dot),this.expectContextual("exports"),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")},ce.flowParseDeclareTypeAlias=function(e){return this.next(),this.flowParseTypeAlias(e),this.finishNode(e,"DeclareTypeAlias")},ce.flowParseDeclareInterface=function(e){return this.next(),this.flowParseInterfaceish(e),this.finishNode(e,"DeclareInterface")},ce.flowParseInterfaceish=function(e,t){if(e.id=this.parseIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],e.mixins=[],this.eat(N._extends))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(N.comma));if(this.isContextual("mixins")){this.next();do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(N.comma))}e.body=this.flowParseObjectType(t)},ce.flowParseInterfaceExtends=function(){var e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")},ce.flowParseInterface=function(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")},ce.flowParseTypeAlias=function(e){return e.id=this.parseIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(N.eq,!0),this.semicolon(),this.finishNode(e,"TypeAlias")},ce.flowParseTypeParameter=function(){var e=this.startNode(),t=this.flowParseVariance(),r=this.flowParseTypeAnnotatableIdentifier();return e.name=r.name,e.variance=t,e.bound=r.typeAnnotation,this.match(N.eq)&&(this.eat(N.eq),e.default=this.flowParseType()),this.finishNode(e,"TypeParameter")},ce.flowParseTypeParameterDeclaration=function(){var e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.isRelational("<")||this.match(N.jsxTagStart)?this.next():this.unexpected();do t.params.push(this.flowParseTypeParameter()),this.isRelational(">")||this.expect(N.comma);while(!this.isRelational(">"));return this.expectRelational(">"),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")},ce.flowParseTypeParameterInstantiation=function(){var e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expectRelational("<");!this.isRelational(">");)e.params.push(this.flowParseType()),this.isRelational(">")||this.expect(N.comma);return this.expectRelational(">"),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")},ce.flowParseObjectPropertyKey=function(){return this.match(N.num)||this.match(N.string)?this.parseExprAtom():this.parseIdentifier(!0)},ce.flowParseObjectTypeIndexer=function(e,t,r){return e.static=t,this.expect(N.bracketL),this.lookahead().type===N.colon?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(N.bracketR),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeIndexer")},ce.flowParseObjectTypeMethodish=function(e){for(e.params=[],e.rest=null,e.typeParameters=null,this.isRelational("<")&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(N.parenL);this.match(N.name);)e.params.push(this.flowParseFunctionTypeParam()),this.match(N.parenR)||this.expect(N.comma);return this.eat(N.ellipsis)&&(e.rest=this.flowParseFunctionTypeParam()),this.expect(N.parenR),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")},ce.flowParseObjectTypeMethod=function(e,t,r,n){var i=this.startNodeAt(e,t);return i.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e,t)),i.static=r,i.key=n,i.optional=!1,this.flowObjectTypeSemicolon(),this.finishNode(i,"ObjectTypeProperty")},ce.flowParseObjectTypeCallProperty=function(e,t){var r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeCallProperty")},ce.flowParseObjectType=function(e,t){var r=this.state.inType;this.state.inType=!0;var n=this.startNode(),i=void 0,a=void 0,s=!1;n.callProperties=[],n.properties=[],n.indexers=[];var o=void 0,u=void 0;for(t&&this.match(N.braceBarL)?(this.expect(N.braceBarL),o=N.braceBarR,u=!0):(this.expect(N.braceL),o=N.braceR,u=!1),n.exact=u;!this.match(o);){var l=!1,c=this.state.start,f=this.state.startLoc;i=this.startNode(),e&&this.isContextual("static")&&this.lookahead().type!==N.colon&&(this.next(),s=!0);var p=this.state.start,d=this.flowParseVariance();this.match(N.bracketL)?n.indexers.push(this.flowParseObjectTypeIndexer(i,s,d)):this.match(N.parenL)||this.isRelational("<")?(d&&this.unexpected(p),n.callProperties.push(this.flowParseObjectTypeCallProperty(i,e))):(a=this.flowParseObjectPropertyKey(),this.isRelational("<")||this.match(N.parenL)?(d&&this.unexpected(p),n.properties.push(this.flowParseObjectTypeMethod(c,f,s,a))):(this.eat(N.question)&&(l=!0),i.key=a,i.value=this.flowParseTypeInitialiser(),i.optional=l,i.static=s,i.variance=d,this.flowObjectTypeSemicolon(),n.properties.push(this.finishNode(i,"ObjectTypeProperty")))),s=!1}this.expect(o);var h=this.finishNode(n,"ObjectTypeAnnotation");return this.state.inType=r,h},ce.flowObjectTypeSemicolon=function(){this.eat(N.semi)||this.eat(N.comma)||this.match(N.braceR)||this.match(N.braceBarR)||this.unexpected()},ce.flowParseQualifiedTypeIdentifier=function(e,t,r){e=e||this.state.start,t=t||this.state.startLoc;for(var n=r||this.parseIdentifier();this.eat(N.dot);){var i=this.startNodeAt(e,t);i.qualification=n,i.id=this.parseIdentifier(),n=this.finishNode(i,"QualifiedTypeIdentifier")}return n},ce.flowParseGenericType=function(e,t,r){var n=this.startNodeAt(e,t);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t,r),this.isRelational("<")&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,"GenericTypeAnnotation")},ce.flowParseTypeofType=function(){var e=this.startNode();return this.expect(N._typeof),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")},ce.flowParseTupleType=function(){var e=this.startNode();for(e.types=[],this.expect(N.bracketL);this.state.pos<this.input.length&&!this.match(N.bracketR)&&(e.types.push(this.flowParseType()),!this.match(N.bracketR));)this.expect(N.comma);return this.expect(N.bracketR),this.finishNode(e,"TupleTypeAnnotation")},ce.flowParseFunctionTypeParam=function(){var e=null,t=!1,r=null,n=this.startNode(),i=this.lookahead();return i.type===N.colon||i.type===N.question?(e=this.parseIdentifier(),this.eat(N.question)&&(t=!0),r=this.flowParseTypeInitialiser()):r=this.flowParseType(),n.name=e,n.optional=t,n.typeAnnotation=r,this.finishNode(n,"FunctionTypeParam")},ce.reinterpretTypeAsFunctionTypeParam=function(e){var t=this.startNodeAt(e.start,e.loc);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,"FunctionTypeParam")},ce.flowParseFunctionTypeParams=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={params:e,rest:null};this.match(N.name);)t.params.push(this.flowParseFunctionTypeParam()),this.match(N.parenR)||this.expect(N.comma);return this.eat(N.ellipsis)&&(t.rest=this.flowParseFunctionTypeParam()),t},ce.flowIdentToTypeAnnotation=function(e,t,r,n){switch(n.name){case"any":return this.finishNode(r,"AnyTypeAnnotation");case"void":return this.finishNode(r,"VoidTypeAnnotation");case"bool":case"boolean":return this.finishNode(r,"BooleanTypeAnnotation");case"mixed":return this.finishNode(r,"MixedTypeAnnotation");case"empty":return this.finishNode(r,"EmptyTypeAnnotation");case"number":return this.finishNode(r,"NumberTypeAnnotation");case"string":return this.finishNode(r,"StringTypeAnnotation");default:return this.flowParseGenericType(e,t,n)}},ce.flowParsePrimaryType=function(){var e=this.state.start,t=this.state.startLoc,r=this.startNode(),n=void 0,i=void 0,a=!1,s=this.state.noAnonFunctionType;switch(this.state.type){case N.name:return this.flowIdentToTypeAnnotation(e,t,r,this.parseIdentifier());case N.braceL:return this.flowParseObjectType(!1,!1);case N.braceBarL:return this.flowParseObjectType(!1,!0);case N.bracketL:return this.flowParseTupleType();case N.relational:if("<"===this.state.value)return r.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(N.parenL),n=this.flowParseFunctionTypeParams(),r.params=n.params,r.rest=n.rest,this.expect(N.parenR),this.expect(N.arrow),r.returnType=this.flowParseType(),this.finishNode(r,"FunctionTypeAnnotation");break;case N.parenL:if(this.next(),!this.match(N.parenR)&&!this.match(N.ellipsis))if(this.match(N.name)){var o=this.lookahead().type;a=o!==N.question&&o!==N.colon}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,i=this.flowParseType(),this.state.noAnonFunctionType=s,this.state.noAnonFunctionType||!(this.match(N.comma)||this.match(N.parenR)&&this.lookahead().type===N.arrow))return this.expect(N.parenR),i;this.eat(N.comma)}return n=i?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):this.flowParseFunctionTypeParams(),r.params=n.params,r.rest=n.rest,this.expect(N.parenR),this.expect(N.arrow),r.returnType=this.flowParseType(),r.typeParameters=null,this.finishNode(r,"FunctionTypeAnnotation");case N.string:return r.value=this.state.value,this.addExtra(r,"rawValue",r.value),this.addExtra(r,"raw",this.input.slice(this.state.start,this.state.end)),this.next(),this.finishNode(r,"StringLiteralTypeAnnotation");case N._true:case N._false:return r.value=this.match(N._true),this.next(),this.finishNode(r,"BooleanLiteralTypeAnnotation");case N.plusMin:if("-"===this.state.value)return this.next(),this.match(N.num)||this.unexpected(),r.value=-this.state.value,this.addExtra(r,"rawValue",r.value),this.addExtra(r,"raw",this.input.slice(this.state.start,this.state.end)),this.next(),this.finishNode(r,"NumericLiteralTypeAnnotation");case N.num:return r.value=this.state.value,this.addExtra(r,"rawValue",r.value),this.addExtra(r,"raw",this.input.slice(this.state.start,this.state.end)),this.next(),this.finishNode(r,"NumericLiteralTypeAnnotation");case N._null:return r.value=this.match(N._null),this.next(),this.finishNode(r,"NullLiteralTypeAnnotation");case N._this:return r.value=this.match(N._this),this.next(),this.finishNode(r,"ThisTypeAnnotation");case N.star:return this.next(),this.finishNode(r,"ExistentialTypeParam");default:if("typeof"===this.state.type.keyword)return this.flowParseTypeofType()}this.unexpected()},ce.flowParsePostfixType=function(){for(var e=this.state.start,t=this.state.startLoc,r=this.flowParsePrimaryType();!this.canInsertSemicolon()&&this.match(N.bracketL);){var n=this.startNodeAt(e,t);n.elementType=r,this.expect(N.bracketL),this.expect(N.bracketR),r=this.finishNode(n,"ArrayTypeAnnotation")}return r},ce.flowParsePrefixType=function(){var e=this.startNode();return this.eat(N.question)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()},ce.flowParseAnonFunctionWithoutParens=function(){var e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(N.arrow)){var t=this.startNodeAt(e.start,e.loc);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e},ce.flowParseIntersectionType=function(){var e=this.startNode(),t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(N.bitwiseAND);)e.types.push(this.flowParseAnonFunctionWithoutParens());return 1===e.types.length?t:this.finishNode(e,"IntersectionTypeAnnotation")},ce.flowParseUnionType=function(){var e=this.startNode(),t=this.flowParseIntersectionType();for(e.types=[t];this.eat(N.bitwiseOR);)e.types.push(this.flowParseIntersectionType());return 1===e.types.length?t:this.finishNode(e,"UnionTypeAnnotation")},ce.flowParseType=function(){var e=this.state.inType;this.state.inType=!0;var t=this.flowParseUnionType();return this.state.inType=e,t},ce.flowParseTypeAnnotation=function(){var e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")},ce.flowParseTypeAnnotatableIdentifier=function(){var e=this.parseIdentifier();return this.match(N.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,e.type)),e},ce.typeCastToParameter=function(e){return e.expression.typeAnnotation=e.typeAnnotation,this.finishNodeAt(e.expression,e.expression.type,e.typeAnnotation.end,e.typeAnnotation.loc.end)},ce.flowParseVariance=function(){var e=null;return this.match(N.plusMin)&&("+"===this.state.value?e="plus":"-"===this.state.value&&(e="minus"),this.next()),e};var fe=function(e){e.extend("parseFunctionBody",function(e){return function(t,r){return this.match(N.colon)&&!r&&(t.returnType=this.flowParseTypeAnnotation()),e.call(this,t,r)}}),e.extend("parseStatement",function(e){return function(t,r){if(this.state.strict&&this.match(N.name)&&"interface"===this.state.value){var n=this.startNode();return this.next(),this.flowParseInterface(n)}return e.call(this,t,r)}}),e.extend("parseExpressionStatement",function(e){return function(t,r){if("Identifier"===r.type)if("declare"===r.name){if(this.match(N._class)||this.match(N.name)||this.match(N._function)||this.match(N._var))return this.flowParseDeclare(t)}else if(this.match(N.name)){if("interface"===r.name)return this.flowParseInterface(t);if("type"===r.name)return this.flowParseTypeAlias(t)}return e.call(this,t,r)}}),e.extend("shouldParseExportDeclaration",function(e){return function(){return this.isContextual("type")||this.isContextual("interface")||e.call(this)}}),e.extend("parseConditional",function(e){return function(t,r,n,i,a){if(a&&this.match(N.question)){var s=this.state.clone();try{return e.call(this,t,r,n,i)}catch(e){if(e instanceof SyntaxError)return this.state=s,a.start=e.pos||this.state.start,t;throw e}}return e.call(this,t,r,n,i)}}),e.extend("parseParenItem",function(e){return function(t,r,n){if(t=e.call(this,t,r,n),this.eat(N.question)&&(t.optional=!0),this.match(N.colon)){var i=this.startNodeAt(r,n);return i.expression=t,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return t}}),e.extend("parseExport",function(e){return function(t){return t=e.call(this,t),"ExportNamedDeclaration"===t.type&&(t.exportKind=t.exportKind||"value"),t}}),e.extend("parseExportDeclaration",function(e){return function(t){if(this.isContextual("type")){t.exportKind="type";var r=this.startNode();return this.next(),this.match(N.braceL)?(t.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(t),null):this.flowParseTypeAlias(r)}if(this.isContextual("interface")){t.exportKind="type";var n=this.startNode();return this.next(),this.flowParseInterface(n)}return e.call(this,t)}}),e.extend("parseClassId",function(e){return function(t){e.apply(this,arguments),this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration())}}),e.extend("isKeyword",function(e){return function(t){return(!this.state.inType||"void"!==t)&&e.call(this,t)}}),e.extend("parsePropertyName",function(e){return function(t){var r=this.state.inType;this.state.inType=!0;var n=e.call(this,t);return this.state.inType=r,n}}),e.extend("readToken",function(e){return function(t){return!this.state.inType||62!==t&&60!==t?e.call(this,t):this.finishOp(N.relational,1)}}),e.extend("jsx_readToken",function(e){return function(){if(!this.state.inType)return e.call(this)}}),e.extend("toAssignable",function(e){return function(t,r,n){return"TypeCastExpression"===t.type?e.call(this,this.typeCastToParameter(t),r,n):e.call(this,t,r,n)}}),e.extend("toAssignableList",function(e){return function(t,r,n){for(var i=0;i<t.length;i++){var a=t[i];a&&"TypeCastExpression"===a.type&&(t[i]=this.typeCastToParameter(a))}return e.call(this,t,r,n)}}),e.extend("toReferencedList",function(){return function(e){for(var t=0;t<e.length;t++){var r=e[t];r&&r._exprListItem&&"TypeCastExpression"===r.type&&this.raise(r.start,"Unexpected type cast")}return e}}),e.extend("parseExprListItem",function(e){return function(t,r){var n=this.startNode(),i=e.call(this,t,r);return this.match(N.colon)?(n._exprListItem=!0,n.expression=i,n.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(n,"TypeCastExpression")):i}}),e.extend("checkLVal",function(e){return function(t){if("TypeCastExpression"!==t.type)return e.apply(this,arguments)}}),e.extend("parseClassProperty",function(e){return function(t){return delete t.variancePos,this.match(N.colon)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),e.call(this,t)}}),e.extend("isClassProperty",function(e){return function(){return this.match(N.colon)||e.call(this)}}),e.extend("parseClassMethod",function(){return function(e,t,r,n){t.variance&&this.unexpected(t.variancePos), delete t.variance,delete t.variancePos,this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),this.parseMethod(t,r,n),e.body.push(this.finishNode(t,"ClassMethod"))}}),e.extend("parseClassSuper",function(e){return function(t,r){if(e.call(this,t,r),t.superClass&&this.isRelational("<")&&(t.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual("implements")){this.next();var n=t.implements=[];do{var i=this.startNode();i.id=this.parseIdentifier(),this.isRelational("<")?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,n.push(this.finishNode(i,"ClassImplements"))}while(this.eat(N.comma))}}}),e.extend("parsePropertyName",function(e){return function(t){var r=this.state.start,n=this.flowParseVariance(),i=e.call(this,t);return t.variance=n,t.variancePos=r,i}}),e.extend("parseObjPropValue",function(e){return function(t){t.variance&&this.unexpected(t.variancePos),delete t.variance,delete t.variancePos;var r=void 0;this.isRelational("<")&&(r=this.flowParseTypeParameterDeclaration(),this.match(N.parenL)||this.unexpected()),e.apply(this,arguments),r&&((t.value||t).typeParameters=r)}}),e.extend("parseAssignableListItemTypes",function(){return function(e){return this.eat(N.question)&&(e.optional=!0),this.match(N.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.finishNode(e,e.type),e}}),e.extend("parseMaybeDefault",function(e){return function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=e.apply(this,r);return"AssignmentPattern"===i.type&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(i.typeAnnotation.start,"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`"),i}}),e.extend("parseImportSpecifiers",function(e){return function(t){t.importKind="value";var r=null;if(this.match(N._typeof)?r="typeof":this.isContextual("type")&&(r="type"),r){var n=this.lookahead();(n.type===N.name&&"from"!==n.value||n.type===N.braceL||n.type===N.star)&&(this.next(),t.importKind=r)}e.call(this,t)}}),e.extend("parseFunctionParams",function(e){return function(t){this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),e.call(this,t)}}),e.extend("parseVarHead",function(e){return function(t){e.call(this,t),this.match(N.colon)&&(t.id.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(t.id,t.id.type))}}),e.extend("parseAsyncArrowFromCallExpression",function(e){return function(t,r){if(this.match(N.colon)){var n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,t.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=n}return e.call(this,t,r)}}),e.extend("shouldParseAsyncArrow",function(e){return function(){return this.match(N.colon)||e.call(this)}}),e.extend("parseMaybeAssign",function(e){return function(){for(var t=null,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];if(N.jsxTagStart&&this.match(N.jsxTagStart)){var a=this.state.clone();try{return e.apply(this,n)}catch(e){if(!(e instanceof SyntaxError))throw e;this.state=a,t=e}}if(this.state.context.push(W.parenExpression),null!=t||this.isRelational("<")){var s=void 0,o=void 0;try{o=this.flowParseTypeParameterDeclaration(),s=e.apply(this,n),s.typeParameters=o,s.start=o.start,s.loc.start=o.loc.start}catch(e){throw t||e}if("ArrowFunctionExpression"===s.type)return s;if(null!=t)throw t;this.raise(o.start,"Expected an arrow function after this type parameter declaration")}return this.state.context.pop(),e.apply(this,n)}}),e.extend("parseArrow",function(e){return function(t){if(this.match(N.colon)){var r=this.state.clone();try{var n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;var i=this.flowParseTypeAnnotation();this.state.noAnonFunctionType=n,this.canInsertSemicolon()&&this.unexpected(),this.match(N.arrow)||this.unexpected(),t.returnType=i}catch(e){if(!(e instanceof SyntaxError))throw e;this.state=r}}return e.call(this,t)}}),e.extend("shouldParseArrow",function(e){return function(){return this.match(N.colon)||e.call(this)}}),e.extend("isClassMutatorStarter",function(e){return function(){return!!this.isRelational("<")||e.call(this)}})},pe={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},de=/^[\da-fA-F]+$/,he=/^\d+$/;W.j_oTag=new G("<tag",(!1)),W.j_cTag=new G("</tag",(!1)),W.j_expr=new G("<tag>...</tag>",(!0),(!0)),N.jsxName=new R("jsxName"),N.jsxText=new R("jsxText",{beforeExpr:!0}),N.jsxTagStart=new R("jsxTagStart",{startsExpr:!0}),N.jsxTagEnd=new R("jsxTagEnd"),N.jsxTagStart.updateContext=function(){this.state.context.push(W.j_expr),this.state.context.push(W.j_oTag),this.state.exprAllowed=!1},N.jsxTagEnd.updateContext=function(e){var t=this.state.context.pop();t===W.j_oTag&&e===N.slash||t===W.j_cTag?(this.state.context.pop(),this.state.exprAllowed=this.curContext()===W.j_expr):this.state.exprAllowed=!0};var me=z.prototype;me.jsxReadToken=function(){for(var e="",t=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated JSX contents");var r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:return this.state.pos===this.state.start?60===r&&this.state.exprAllowed?(++this.state.pos,this.finishToken(N.jsxTagStart)):this.getTokenFromCode(r):(e+=this.input.slice(t,this.state.pos),this.finishToken(N.jsxText,e));case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;default:c(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}},me.jsxReadNewLine=function(e){var t=this.input.charCodeAt(this.state.pos),r=void 0;return++this.state.pos,13===t&&10===this.input.charCodeAt(this.state.pos)?(++this.state.pos,r=e?"\n":"\r\n"):r=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,r},me.jsxReadString=function(e){for(var t="",r=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var n=this.input.charCodeAt(this.state.pos);if(n===e)break;38===n?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):c(n)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}return t+=this.input.slice(r,this.state.pos++),this.finishToken(N.string,t)},me.jsxReadEntity=function(){for(var e="",t=0,r=void 0,n=this.input[this.state.pos],i=++this.state.pos;this.state.pos<this.input.length&&t++<10;){if(n=this.input[this.state.pos++],";"===n){"#"===e[0]?"x"===e[1]?(e=e.substr(2),de.test(e)&&(r=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),he.test(e)&&(r=String.fromCharCode(parseInt(e,10)))):r=pe[e];break}e+=n}return r?r:(this.state.pos=i,"&")},me.jsxReadWord=function(){var e=void 0,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(a(e)||45===e);return this.finishToken(N.jsxName,this.input.slice(t,this.state.pos))},me.jsxParseIdentifier=function(){var e=this.startNode();return this.match(N.jsxName)?e.name=this.state.value:this.state.type.keyword?e.name=this.state.type.keyword:this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")},me.jsxParseNamespacedName=function(){var e=this.state.start,t=this.state.startLoc,r=this.jsxParseIdentifier();if(!this.eat(N.colon))return r;var n=this.startNodeAt(e,t);return n.namespace=r,n.name=this.jsxParseIdentifier(),this.finishNode(n,"JSXNamespacedName")},me.jsxParseElementName=function(){for(var e=this.state.start,t=this.state.startLoc,r=this.jsxParseNamespacedName();this.eat(N.dot);){var n=this.startNodeAt(e,t);n.object=r,n.property=this.jsxParseIdentifier(),r=this.finishNode(n,"JSXMemberExpression")}return r},me.jsxParseAttributeValue=function(){var e=void 0;switch(this.state.type){case N.braceL:if(e=this.jsxParseExpressionContainer(),"JSXEmptyExpression"!==e.expression.type)return e;this.raise(e.start,"JSX attributes must only be assigned a non-empty expression");case N.jsxTagStart:case N.string:return e=this.parseExprAtom(),e.extra=null,e;default:this.raise(this.state.start,"JSX value should be either an expression or a quoted JSX text")}},me.jsxParseEmptyExpression=function(){var e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.start,this.startLoc)},me.jsxParseSpreadChild=function(){var e=this.startNode();return this.expect(N.braceL),this.expect(N.ellipsis),e.expression=this.parseExpression(),this.expect(N.braceR),this.finishNode(e,"JSXSpreadChild")},me.jsxParseExpressionContainer=function(){var e=this.startNode();return this.next(),this.match(N.braceR)?e.expression=this.jsxParseEmptyExpression():e.expression=this.parseExpression(),this.expect(N.braceR),this.finishNode(e,"JSXExpressionContainer")},me.jsxParseAttribute=function(){var e=this.startNode();return this.eat(N.braceL)?(this.expect(N.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(N.braceR),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(N.eq)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))},me.jsxParseOpeningElementAt=function(e,t){var r=this.startNodeAt(e,t);for(r.attributes=[],r.name=this.jsxParseElementName();!this.match(N.slash)&&!this.match(N.jsxTagEnd);)r.attributes.push(this.jsxParseAttribute());return r.selfClosing=this.eat(N.slash),this.expect(N.jsxTagEnd),this.finishNode(r,"JSXOpeningElement")},me.jsxParseClosingElementAt=function(e,t){var r=this.startNodeAt(e,t);return r.name=this.jsxParseElementName(),this.expect(N.jsxTagEnd),this.finishNode(r,"JSXClosingElement")},me.jsxParseElementAt=function(e,t){var r=this.startNodeAt(e,t),n=[],i=this.jsxParseOpeningElementAt(e,t),a=null;if(!i.selfClosing){e:for(;;)switch(this.state.type){case N.jsxTagStart:if(e=this.state.start,t=this.state.startLoc,this.next(),this.eat(N.slash)){a=this.jsxParseClosingElementAt(e,t);break e}n.push(this.jsxParseElementAt(e,t));break;case N.jsxText:n.push(this.parseExprAtom());break;case N.braceL:this.lookahead().type===N.ellipsis?n.push(this.jsxParseSpreadChild()):n.push(this.jsxParseExpressionContainer());break;default:this.unexpected()}_(a.name)!==_(i.name)&&this.raise(a.start,"Expected corresponding JSX closing tag for <"+_(i.name)+">")}return r.openingElement=i,r.closingElement=a,r.children=n,this.match(N.relational)&&"<"===this.state.value&&this.raise(this.state.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(r,"JSXElement")},me.jsxParseElement=function(){var e=this.state.start,t=this.state.startLoc;return this.next(),this.jsxParseElementAt(e,t)};var ve=function(e){e.extend("parseExprAtom",function(e){return function(t){if(this.match(N.jsxText)){var r=this.parseLiteral(this.state.value,"JSXText");return r.extra=null,r}return this.match(N.jsxTagStart)?this.jsxParseElement():e.call(this,t)}}),e.extend("readToken",function(e){return function(t){var r=this.curContext();if(r===W.j_expr)return this.jsxReadToken();if(r===W.j_oTag||r===W.j_cTag){if(i(t))return this.jsxReadWord();if(62===t)return++this.state.pos,this.finishToken(N.jsxTagEnd);if((34===t||39===t)&&r===W.j_oTag)return this.jsxReadString(t)}return 60===t&&this.state.exprAllowed?(++this.state.pos,this.finishToken(N.jsxTagStart)):e.call(this,t)}}),e.extend("updateContext",function(e){return function(t){if(this.match(N.braceL)){var r=this.curContext();r===W.j_oTag?this.state.context.push(W.braceExpression):r===W.j_expr?this.state.context.push(W.templateQuasi):e.call(this,t),this.state.exprAllowed=!0}else{if(!this.match(N.slash)||t!==N.jsxTagStart)return e.call(this,t);this.state.context.length-=2,this.state.context.push(W.j_cTag),this.state.exprAllowed=!1}}})};X.flow=fe,X.jsx=ve,t.parse=D,t.tokTypes=N},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){var n=r(53),i=r(141),a=r(95),s=r(150),o=r(420);e.exports=function(e,t){var r=1==e,u=2==e,l=3==e,c=4==e,f=6==e,p=5==e||f,d=t||o;return function(t,o,h){for(var m,v,y=a(t),g=i(y),b=n(o,h,3),E=s(g.length),x=0,A=r?d(t,E):u?d(t,0):void 0;E>x;x++)if((p||x in g)&&(m=g[x],v=b(m,x,y),e))if(r)A[x]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:A.push(m)}else if(c)return!1;return f?-1:l||c?c:A}}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){"use strict";var n=r(14),i=r(23),a=r(55),s=r(36),o=r(30),u=r(145),l=r(90),c=r(136),f=r(24),p=r(94),d=r(25).f,h=r(137)(0),m=r(22);e.exports=function(e,t,r,v,y,g){var b=n[e],E=b,x=y?"set":"add",A=E&&E.prototype,_={};return m&&"function"==typeof E&&(g||A.forEach&&!s(function(){(new E).entries().next()}))?(E=t(function(t,r){c(t,E,e,"_c"),t._c=new b,void 0!=r&&l(r,y,t[x],t)}),h("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in A&&(!g||"clear"!=e)&&o(E.prototype,e,function(r,n){if(c(this,E,e),!t&&g&&!f(r))return"get"==e&&void 0;var i=this._c[e](0===r?0:r,n);return t?this:i})}),"size"in A&&d(E.prototype,"size",{get:function(){return this._c.size}})):(E=v.getConstructor(t,e,y,x),u(E.prototype,r),a.NEED=!0),p(E,e),_[e]=E,i(i.G+i.W+i.F,_),g||v.setStrong(E,e,y),E}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(138);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){"use strict";var n=r(143),i=r(23),a=r(146),s=r(30),o=r(29),u=r(54),l=r(427),c=r(94),f=r(431),p=r(10)("iterator"),d=!([].keys&&"next"in[].keys()),h="@@iterator",m="keys",v="values",y=function(){return this};e.exports=function(e,t,r,g,b,E,x){l(r,t,g);var A,_,D,C=function(e){if(!d&&e in k)return k[e];switch(e){case m:return function(){return new r(this,e)};case v:return function(){return new r(this,e)}}return function(){return new r(this,e)}},S=t+" Iterator",w=b==v,F=!1,k=e.prototype,P=k[p]||k[h]||b&&k[b],T=P||C(b),O=b?w?C("entries"):T:void 0,B="Array"==t?k.entries||P:P;if(B&&(D=f(B.call(new e)),D!==Object.prototype&&(c(D,S,!0),n||o(D,p)||s(D,p,y))),w&&P&&P.name!==v&&(F=!0,T=function(){return P.call(this)}),n&&!x||!d&&!F&&k[p]||s(k,p,T),u[t]=T,u[S]=y,b)if(A={values:w?T:C(v),keys:E?T:C(m),entries:O},x)for(_ in A)_ in k||a(k,_,A[_]);else i(i.P+i.F*(d||F),t,A);return A}},function(e,t){e.exports=!0},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(30);e.exports=function(e,t,r){for(var i in t)r&&e[i]?e[i]=t[i]:n(e,i,t[i]);return e}},function(e,t,r){e.exports=r(30)},function(e,t,r){var n=r(148)("keys"),i=r(96);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(14),i="__core-js_shared__",a=n[i]||(n[i]={});e.exports=function(e){return a[e]||(a[e]={})}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(149),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){var n=r(24);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){var n=r(14),i=r(5),a=r(143),s=r(153),o=r(25).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||o(t,e,{value:s.f(e)})}},function(e,t,r){t.f=r(10)},function(e,t,r){"use strict";var n=r(435)(!0);r(142)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t,r){"use strict";var n=r(14),i=r(29),a=r(22),s=r(23),o=r(146),u=r(55).KEY,l=r(36),c=r(148),f=r(94),p=r(96),d=r(10),h=r(153),m=r(152),v=r(428),y=r(423),g=r(231),b=r(21),E=r(37),x=r(151),A=r(93),_=r(91),D=r(430),C=r(234),S=r(25),w=r(43),F=C.f,k=S.f,P=D.f,T=n.Symbol,O=n.JSON,B=O&&O.stringify,R="prototype",I=d("_hidden"),M=d("toPrimitive"),N={}.propertyIsEnumerable,L=c("symbol-registry"),j=c("symbols"),U=c("op-symbols"),V=Object[R],G="function"==typeof T,W=n.QObject,Y=!W||!W[R]||!W[R].findChild,q=a&&l(function(){return 7!=_(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=F(V,t);n&&delete V[t],k(e,t,r),n&&e!==V&&k(V,t,n)}:k,K=function(e){var t=j[e]=_(T[R]);return t._k=e,t},H=G&&"symbol"==typeof T.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof T},J=function(e,t,r){return e===V&&J(U,t,r),b(e),t=x(t,!0),b(r),i(j,t)?(r.enumerable?(i(e,I)&&e[I][t]&&(e[I][t]=!1),r=_(r,{enumerable:A(0,!1)})):(i(e,I)||k(e,I,A(1,{})),e[I][t]=!0),q(e,t,r)):k(e,t,r)},X=function(e,t){b(e);for(var r,n=y(t=E(t)),i=0,a=n.length;a>i;)J(e,r=n[i++],t[r]);return e},z=function(e,t){return void 0===t?_(e):X(_(e),t)},$=function(e){var t=N.call(this,e=x(e,!0));return!(this===V&&i(j,e)&&!i(U,e))&&(!(t||!i(this,e)||!i(j,e)||i(this,I)&&this[I][e])||t)},Q=function(e,t){if(e=E(e),t=x(t,!0),e!==V||!i(j,t)||i(U,t)){var r=F(e,t);return!r||!i(j,t)||i(e,I)&&e[I][t]||(r.enumerable=!0),r}},Z=function(e){for(var t,r=P(E(e)),n=[],a=0;r.length>a;)i(j,t=r[a++])||t==I||t==u||n.push(t);return n},ee=function(e){for(var t,r=e===V,n=P(r?U:E(e)),a=[],s=0;n.length>s;)!i(j,t=n[s++])||r&&!i(V,t)||a.push(j[t]);return a};G||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(r){this===V&&t.call(U,r),i(this,I)&&i(this[I],e)&&(this[I][e]=!1),q(this,e,A(1,r))};return a&&Y&&q(V,e,{configurable:!0,set:t}),K(e)},o(T[R],"toString",function(){return this._k}),C.f=Q,S.f=J,r(235).f=D.f=Z,r(92).f=$,r(144).f=ee,a&&!r(143)&&o(V,"propertyIsEnumerable",$,!0),h.f=function(e){return K(d(e))}),s(s.G+s.W+s.F*!G,{Symbol:T});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;te.length>re;)d(te[re++]);for(var te=w(d.store),re=0;te.length>re;)m(te[re++]);s(s.S+s.F*!G,"Symbol",{for:function(e){return i(L,e+="")?L[e]:L[e]=T(e)},keyFor:function(e){if(H(e))return v(L,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),s(s.S+s.F*!G,"Object",{create:z,defineProperty:J,defineProperties:X,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:ee}),O&&s(s.S+s.F*(!G||l(function(){var e=T();return"[null]"!=B([e])||"{}"!=B({a:e})||"{}"!=B(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!H(e)){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);return t=n[1],"function"==typeof t&&(r=t),!r&&g(t)||(t=function(e,t){if(r&&(t=r.call(this,e,t)),!H(t))return t}),n[1]=t,B.apply(O,n)}}}),T[R][M]||r(30)(T[R],M,T[R].valueOf),f(T,"Symbol"),f(Math,"Math",!0),f(n.JSON,"JSON",!0)},function(e,t,r){!function(){"use strict";t.ast=r(453),t.code=r(239),t.keyword=r(454)}()},function(e,t,r){var n=r(38),i=r(16),a=n(i,"Map");e.exports=a},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var i=r(550),a=r(551),s=r(552),o=r(553),u=r(554);n.prototype.clear=i,n.prototype.delete=a,n.prototype.get=s,n.prototype.has=o,n.prototype.set=u,e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}e.exports=r},function(e,t,r){function n(e,t,r){var n=e[t];o.call(e,t)&&a(n,r)&&(void 0!==r||t in e)||i(e,t,r)}var i=r(161),a=r(45),s=Object.prototype,o=s.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t,r){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var i=r(259);e.exports=n},function(e,t,r){function n(e,t,r,w,F,k){var P,B=t&_,R=t&D,M=t&C;if(r&&(P=F?r(e,w,F,k):r(e)),void 0!==P)return P;if(!x(e))return e;var N=b(e);if(N){if(P=v(e),!B)return c(e,P)}else{var L=m(e),j=L==T||L==O;if(E(e))return l(e,B);if(L==I||L==S||j&&!F){if(P=R||j?{}:g(e),!B)return R?p(e,u(P,e)):f(e,o(P,e))}else{if(!Q[L])return F?e:{};P=y(e,L,n,B)}}k||(k=new i);var U=k.get(e);if(U)return U;k.set(e,P);var V=M?R?h:d:R?keysIn:A,G=N?void 0:V(e);return a(G||e,function(i,a){G&&(a=i,i=e[a]),s(P,a,n(i,t,r,a,e,k))}),P}var i=r(99),a=r(244),s=r(160),o=r(478),u=r(479),l=r(256),c=r(166),f=r(521),p=r(522),d=r(529),h=r(530),m=r(263),v=r(540),y=r(541),g=r(265),b=r(6),E=r(114),x=r(11),A=r(27),_=1,D=2,C=4,S="[object Arguments]",w="[object Array]",F="[object Boolean]",k="[object Date]",P="[object Error]",T="[object Function]",O="[object GeneratorFunction]",B="[object Map]",R="[object Number]",I="[object Object]",M="[object RegExp]",N="[object Set]",L="[object String]",j="[object Symbol]",U="[object WeakMap]",V="[object ArrayBuffer]",G="[object DataView]",W="[object Float32Array]",Y="[object Float64Array]",q="[object Int8Array]",K="[object Int16Array]",H="[object Int32Array]",J="[object Uint8Array]",X="[object Uint8ClampedArray]",z="[object Uint16Array]",$="[object Uint32Array]",Q={};Q[S]=Q[w]=Q[V]=Q[G]=Q[F]=Q[k]=Q[W]=Q[Y]=Q[q]=Q[K]=Q[H]=Q[B]=Q[R]=Q[I]=Q[M]=Q[N]=Q[L]=Q[j]=Q[J]=Q[X]=Q[z]=Q[$]=!0,Q[P]=Q[T]=Q[U]=!1,e.exports=n},function(e,t){function r(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}e.exports=r},function(e,t,r){function n(e){if("string"==typeof e)return e;if(s(e))return a(e,n)+"";if(o(e))return c?c.call(e):"";var t=e+"";return"0"==t&&1/e==-u?"-0":t}var i=r(44),a=r(57),s=r(6),o=r(60),u=1/0,l=i?i.prototype:void 0,c=l?l.toString:void 0;e.exports=n},function(e,t,r){function n(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}var i=r(242);e.exports=n},function(e,t){function r(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}e.exports=r},function(e,t,r){var n=r(172),i=n(Object.getPrototypeOf,Object);e.exports=i},function(e,t,r){var n=r(172),i=r(279),a=Object.getOwnPropertySymbols,s=a?n(a,Object):i;e.exports=s},function(e,t){function r(e,t){return t=null==t?n:t,!!t&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&e<t}var n=9007199254740991,i=/^(?:0|[1-9]\d*)$/;e.exports=r},function(e,t,r){function n(e,t,r){if(!o(r))return!1;var n=typeof t;return!!("number"==n?a(r)&&s(t,r.length):"string"==n&&t in r)&&i(r[t],e)}var i=r(45),a=r(26),s=r(169),o=r(11);e.exports=n},function(e,t,r){function n(e,t){if(i(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!a(e))||(o.test(e)||!s.test(e)||null!=t&&e in Object(t))}var i=r(6),a=r(60),s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=n},function(e,t){function r(e,t){return function(r){return e(t(r))}}e.exports=r},function(e,t,r){var n=r(160),i=r(31),a=r(104),s=r(26),o=r(106),u=r(27),l=Object.prototype,c=l.hasOwnProperty,f=a(function(e,t){if(o(t)||s(t))return void i(t,u(t),e);for(var r in t)c.call(t,r)&&n(e,r,t[r])});e.exports=f},function(e,t){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=r},function(e,t,r){function n(e){return"string"==typeof e||!a(e)&&s(e)&&i(e)==o}var i=r(15),a=r(6),s=r(12),o="[object String]";e.exports=n},function(e,t,r){var n=r(493),i=r(103),a=r(269),s=a&&a.isTypedArray,o=s?i(s):n;e.exports=o},function(e,t){"use strict";e.exports=function(){return/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.slice(-2),r=t[0],n=t[1],i=o.default.matchToToken(e);if("name"===i.type){if(l.default.keyword.isReservedWordES6(i.value))return"keyword";if(h.test(i.value)&&("<"===n[r-1]||"</"==n.substr(r-2,2)))return"jsx_tag";if(i.value[0]!==i.value[0].toLowerCase())return"capitalized"}return"punctuator"===i.type&&m.test(i.value)?"bracket":i.type}function a(e){return e.replace(o.default,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=i(t),a=p[n];return a?t[0].split(d).map(function(e){return a(e)}).join("\n"):t[0]})}t.__esModule=!0,t.default=function(e,t,r){var n=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];r=Math.max(r,0);var i=n.highlightCode&&f.default.supportsColor,s=function(e,t){return i?e(t):t};i&&(e=a(e));var o=n.linesAbove||2,u=n.linesBelow||3,l=e.split(d),c=Math.max(t-(o+1),0),h=Math.min(l.length,t+u);t||r||(c=0,h=l.length);var m=String(h).length,v=l.slice(c,h).map(function(e,n){var i=c+1+n,a=(" "+i).slice(-m),o=" "+a+" | ";if(i===t){var u="";if(r){var l=e.slice(0,r-1).replace(/[^\t]/g," ");u=["\n ",s(p.gutter,o.replace(/\d/g," ")),l,s(p.marker,"^")].join("")}return[s(p.marker,">"),s(p.gutter,o),e,u].join("")}return" "+s(p.gutter,o)+e}).join("\n");return i?f.default.reset(v):v};var s=r(460),o=n(s),u=r(156),l=n(u),c=r(398),f=n(c),p={keyword:f.default.cyan,capitalized:f.default.yellow,jsx_tag:f.default.yellow,punctuator:f.default.yellow,number:f.default.magenta,string:f.default.green,regex:f.default.magenta,comment:f.default.grey,invalid:f.default.white.bgRed.bold,gutter:f.default.grey,marker:f.default.red.bold},d=/\r\n|[\n\r\u2028\u2029]/,h=/^[a-z][\w-]*$/i,m=/^[()\[\]{}]$/;e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){throw new Error("The ("+e+") Babel 5 plugin is being run with Babel 6.")}function s(e,t,r){(0,h.default)(t)&&(r=t,t={}),t.filename=e,v.default.readFile(e,function(e,n){var i=void 0;if(!e)try{i=P(n,t)}catch(t){e=t}e?r(e):r(null,i)})}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.filename=e,P(v.default.readFileSync(e,"utf8"),t)}t.__esModule=!0,t.transformFromAst=t.transform=t.analyse=t.Pipeline=t.OptionManager=t.traverse=t.types=t.messages=t.util=t.version=t.template=t.buildExternalHelpers=t.options=t.File=void 0;var u=r(48);Object.defineProperty(t,"File",{enumerable:!0,get:function(){return i(u).default}});var l=r(32);Object.defineProperty(t,"options",{enumerable:!0,get:function(){return i(l).default}});var c=r(292);Object.defineProperty(t,"buildExternalHelpers",{enumerable:!0,get:function(){return i(c).default}});var f=r(4);Object.defineProperty(t,"template",{enumerable:!0,get:function(){return i(f).default}});var p=r(462);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return p.version}}),t.Plugin=a,t.transformFile=s,t.transformFileSync=o;var d=r(115),h=i(d),m=r(116),v=i(m),y=r(122),g=n(y),b=r(19),E=n(b),x=r(1),A=n(x),_=r(8),D=i(_),C=r(33),S=i(C),w=r(295),F=i(w);t.util=g,t.messages=E,t.types=A,t.traverse=D.default,t.OptionManager=S.default,t.Pipeline=F.default;var k=new F.default,P=(t.analyse=k.analyse.bind(k),t.transform=k.transform.bind(k));t.transformFromAst=k.transformFromAst.bind(k)},function(e,t,r){function n(e){return r(i(e))}function i(e){return a[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var a={"./index":48,"./index.js":48,"./logger":120,"./logger.js":120,"./metadata":121,"./metadata.js":121,"./options/build-config-chain":49,"./options/build-config-chain.js":49,"./options/config":32,"./options/config.js":32,"./options/index":50,"./options/index.js":50,"./options/option-manager":33,"./options/option-manager.js":33,"./options/parsers":51,"./options/parsers.js":51,"./options/removed":52,"./options/removed.js":52};n.keys=function(){return Object.keys(a)},n.resolve=i,e.exports=n,n.id=180},function(e,t,r){function n(e){return r(i(e))}function i(e){return a[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var a={"./build-config-chain":49,"./build-config-chain.js":49,"./config":32,"./config.js":32,"./index":50,"./index.js":50,"./option-manager":33,"./option-manager.js":33,"./parsers":51,"./parsers.js":51,"./removed":52,"./removed.js":52};n.keys=function(){return Object.keys(a)},n.resolve=i,e.exports=n,n.id=181},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){var n=" ";if(e&&"string"==typeof e){var i=(0,h.default)(e).indent;i&&" "!==i&&(n=i)}var a={auxiliaryCommentBefore:t.auxiliaryCommentBefore,auxiliaryCommentAfter:t.auxiliaryCommentAfter,shouldPrintComment:t.shouldPrintComment,retainLines:t.retainLines,retainFunctionParens:t.retainFunctionParens,comments:null==t.comments||t.comments,compact:t.compact,minified:t.minified,concise:t.concise,quotes:t.quotes||s(e,r),jsonCompatibleStrings:t.jsonCompatibleStrings,indent:{adjustMultilineComment:!0,style:n,base:0},flowCommaSeparator:t.flowCommaSeparator};return a.minified?(a.compact=!0,a.shouldPrintComment=a.shouldPrintComment||function(){return a.comments}):a.shouldPrintComment=a.shouldPrintComment||function(e){return a.comments||e.indexOf("@license")>=0||e.indexOf("@preserve")>=0},"auto"===a.compact&&(a.compact=e.length>1e5,a.compact&&console.error("[BABEL] "+g.get("codeGeneratorDeopt",t.filename,"100KB"))),a.compact&&(a.indent.adjustMultilineComment=!1),a}function s(e,t){var r="double";if(!e)return r;for(var n={single:0,double:0},i=0,a=0;a<t.length;a++){var s=t[a];if("string"===s.type.label){var o=e.slice(s.start,s.end);if("'"===o[0]?n.single++:n.double++,i++,i>=3)break}}return n.single>n.double?"single":"double"}t.__esModule=!0,t.CodeGenerator=void 0;var o=r(3),u=i(o),l=r(42),c=i(l),f=r(41),p=i(f);t.default=function(e,t,r){var n=new x(e,t,r);return n.generate()};var d=r(451),h=i(d),m=r(310),v=i(m),y=r(19),g=n(y),b=r(309),E=i(b),x=function(e){ function t(r,n,i){(0,u.default)(this,t),n=n||{};var s=r.tokens||[],o=a(i,n,s),l=n.sourceMaps?new v.default(n,i):null,f=(0,c.default)(this,e.call(this,o,l,s));return f.ast=r,f}return(0,p.default)(t,e),t.prototype.generate=function(){return e.prototype.generate.call(this,this.ast)},t}(E.default);t.CodeGenerator=function(){function e(t,r,n){(0,u.default)(this,e),this._generator=new x(t,r,n)}return e.prototype.generate=function(){return this._generator.generate()},e}()},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){function t(e,t){var n=r[e];r[e]=n?function(e,r,i){var a=n(e,r,i);return null==a?t(e,r,i):a}:t}for(var r={},n=(0,m.default)(e),i=Array.isArray(n),a=0,n=i?n:(0,d.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s,u=x.FLIPPED_ALIAS_KEYS[o];if(u)for(var l=u,c=Array.isArray(l),f=0,l=c?l:(0,d.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var h=p;t(h,e[o])}else t(o,e[o])}return r}function s(e,t,r,n){var i=e[t.type];return i?i(t,r,n):null}function o(e){return!!x.isCallExpression(e)||!!x.isMemberExpression(e)&&(o(e.object)||!e.computed&&o(e.property))}function u(e,t,r){if(!e)return 0;x.isExpressionStatement(e)&&(e=e.expression);var n=s(_,e,t);if(!n){var i=s(D,e,t);if(i)for(var a=0;a<i.length&&!(n=u(i[a],e,r));a++);}return n&&n[r]||0}function l(e,t){return u(e,t,"before")}function c(e,t){return u(e,t,"after")}function f(e,t,r){return!!t&&(!(!x.isNewExpression(t)||t.callee!==e||!o(e))||s(A,e,t,r))}t.__esModule=!0;var p=r(2),d=i(p),h=r(20),m=i(h);t.needsWhitespace=u,t.needsWhitespaceBefore=l,t.needsWhitespaceAfter=c,t.needsParens=f;var v=r(308),y=i(v),g=r(307),b=n(g),E=r(1),x=n(E),A=a(b),_=a(y.default.nodes),D=a(y.default.list)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){function t(e,r){if(u.isJSXIdentifier(e)){if("this"===e.name&&u.isReferenced(e,r))return u.thisExpression();if(!s.default.keyword.isIdentifierNameES6(e.name))return u.stringLiteral(e.name);e.type="Identifier"}else if(u.isJSXMemberExpression(e))return u.memberExpression(t(e.object,e),t(e.property,e));return e}function r(e){return u.isJSXExpressionContainer(e)?e.expression:e}function n(e){var t=r(e.value||u.booleanLiteral(!0));return u.isStringLiteral(t)&&!u.isJSXExpressionContainer(e.value)&&(t.value=t.value.replace(/\n\s+/g," ")),u.isValidIdentifier(e.name.name)?e.name.type="Identifier":e.name=u.stringLiteral(e.name.name),u.inherits(u.objectProperty(e.name,t),e)}function i(r,n){r.parent.children=u.react.buildChildren(r.parent);var i=t(r.node.name,r.node),s=[],o=void 0;u.isIdentifier(i)?o=i.name:u.isLiteral(i)&&(o=i.value);var l={tagExpr:i,tagName:o,args:s};e.pre&&e.pre(l,n);var c=r.node.attributes;return c=c.length?a(c,n):u.nullLiteral(),s.push(c),e.post&&e.post(l,n),l.call||u.callExpression(l.callee,s)}function a(e,t){function r(){i.length&&(a.push(u.objectExpression(i)),i=[])}var i=[],a=[],s=t.opts.useBuiltIns||!1;if("boolean"!=typeof s)throw new Error("transform-react-jsx currently only accepts a boolean option for useBuiltIns (defaults to false)");for(;e.length;){var o=e.shift();u.isJSXSpreadAttribute(o)?(r(),a.push(o.argument)):i.push(n(o))}if(r(),1===a.length)e=a[0];else{u.isObjectExpression(a[0])||a.unshift(u.objectExpression([]));var l=s?u.memberExpression(u.identifier("Object"),u.identifier("assign")):t.addHelper("extends");e=u.callExpression(l,a)}return e}var o={};return o.JSXNamespacedName=function(e){throw e.buildCodeFrameError("Namespace tags are not supported. ReactJSX is not XML.")},o.JSXElement={exit:function(e,t){var r=i(e.get("openingElement"),t);r.arguments=r.arguments.concat(e.node.children),r.arguments.length>=3&&(r._prettyCall=!0),e.replaceWith(u.inherits(r,e.node))}},o};var a=r(156),s=i(a),o=r(1),u=n(o);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return!g.isClassMethod(e)&&!g.isObjectMethod(e)||"get"!==e.kind&&"set"!==e.kind?"value":e.kind}function s(e,t,r,n,i){var s=g.toKeyAlias(t),o={};if((0,v.default)(e,s)&&(o=e[s]),e[s]=o,o._inherits=o._inherits||[],o._inherits.push(t),o._key=t.key,t.computed&&(o._computed=!0),t.decorators){var u=o.decorators=o.decorators||g.arrayExpression([]);u.elements=u.elements.concat(t.decorators.map(function(e){return e.expression}).reverse())}if(o.value||o.initializer)throw n.buildCodeFrameError(t,"Key conflict with sibling node");var l=void 0,c=void 0;(g.isObjectProperty(t)||g.isObjectMethod(t)||g.isClassMethod(t))&&(l=g.toComputedKey(t,t.key)),g.isObjectProperty(t)||g.isClassProperty(t)?c=t.value:(g.isObjectMethod(t)||g.isClassMethod(t))&&(c=g.functionExpression(null,t.params,t.body,t.generator,t.async),c.returnType=t.returnType);var f=a(t);return r&&"value"===f||(r=f),i&&g.isStringLiteral(l)&&("value"===r||"initializer"===r)&&g.isFunctionExpression(c)&&(c=(0,p.default)({id:l,node:c,scope:i})),c&&(g.inheritsComments(c,t),o[r]=c),o}function o(e){for(var t in e)if(e[t]._computed)return!0;return!1}function u(e){for(var t=g.arrayExpression([]),r=0;r<e.properties.length;r++){var n=e.properties[r],i=n.value;i.properties.unshift(g.objectProperty(g.identifier("key"),g.toComputedKey(n))),t.elements.push(i)}return t}function l(e){var t=g.objectExpression([]);return(0,h.default)(e,function(e){var r=g.objectExpression([]),n=g.objectProperty(e._key,r,e._computed);(0,h.default)(e,function(e,t){if("_"!==t[0]){var n=e;(g.isClassMethod(e)||g.isClassProperty(e))&&(e=e.value);var i=g.objectProperty(g.identifier(t),e);g.inheritsComments(i,n),g.removeComments(n),r.properties.push(i)}}),t.properties.push(n)}),t}function c(e){return(0,h.default)(e,function(e){e.value&&(e.writable=g.booleanLiteral(!0)),e.configurable=g.booleanLiteral(!0),e.enumerable=g.booleanLiteral(!0)}),l(e)}t.__esModule=!0,t.push=s,t.hasComputed=o,t.toComputedObjectFromClass=u,t.toClassObject=l,t.toDefineObject=c;var f=r(40),p=i(f),d=r(111),h=i(d),m=r(272),v=i(m),y=r(1),g=n(y)},function(e,t,r){"use strict";function n(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.__esModule=!0,t.default=function(e){for(var t=e.params,r=0;r<t.length;r++){var n=t[r];if(a.isAssignmentPattern(n)||a.isRestElement(n))return r}return t.length};var i=r(1),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a);t.default=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"var";e.traverse(l,{kind:r,emit:t})};var o=r(1),u=n(o),l={Scope:function(e,t){"let"===t.kind&&e.skip()},Function:function(e){e.skip()},VariableDeclaration:function(e,t){if(!t.kind||e.node.kind===t.kind){for(var r=[],n=e.get("declarations"),i=void 0,a=n,o=Array.isArray(a),l=0,a=o?a:(0,s.default)(a);;){var c;if(o){if(l>=a.length)break;c=a[l++]}else{if(l=a.next(),l.done)break;c=l.value}var f=c;i=f.node.id,f.node.init&&r.push(u.expressionStatement(u.assignmentExpression("=",f.node.id,f.node.init)));for(var p in f.getBindingIdentifiers())t.emit(u.identifier(p),p)}e.parentPath.isFor({left:e.node})?e.replaceWith(i):e.replaceWithMultiple(r)}}};e.exports=t.default},function(e,t,r){"use strict";function n(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.__esModule=!0,t.default=function(e,t,r){return 1===r.length&&a.isSpreadElement(r[0])&&a.isIdentifier(r[0].argument,{name:"arguments"})?a.callExpression(a.memberExpression(e,a.identifier("apply")),[t,r[0].argument]):a.callExpression(a.memberExpression(e,a.identifier("call")),[t].concat(r))};var i=r(1),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return c.isRegExpLiteral(e)&&e.flags.indexOf(t)>=0}function s(e,t){var r=e.flags.split("");e.flags.indexOf(t)<0||((0,u.default)(r,t),e.flags=r.join(""))}t.__esModule=!0,t.is=a,t.pullFlag=s;var o=r(277),u=i(o),l=r(1),c=n(l)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return!!y.isSuper(e)&&(!y.isMemberExpression(t,{computed:!1})&&!y.isCallExpression(t,{callee:e}))}function s(e){return y.isMemberExpression(e)&&y.isSuper(e.object)}function o(e,t){var r=t?e:y.memberExpression(e,y.identifier("prototype"));return y.logicalExpression("||",y.memberExpression(r,y.identifier("__proto__")),y.callExpression(y.memberExpression(y.identifier("Object"),y.identifier("getPrototypeOf")),[r]))}t.__esModule=!0;var u=r(3),l=i(u),c=r(9),f=i(c),p=r(188),d=i(p),h=r(19),m=n(h),v=r(1),y=n(v),g=(0,f.default)(),b={Function:function(e){e.inShadow("this")||e.skip()},ReturnStatement:function(e,t){e.inShadow("this")||t.returns.push(e)},ThisExpression:function(e,t){e.node[g]||t.thises.push(e)},enter:function(e,t){var r=t.specHandle;t.isLoose&&(r=t.looseHandle);var n=e.isCallExpression()&&e.get("callee").isSuper(),i=r.call(t,e);i&&(t.hasSuper=!0),n&&t.bareSupers.push(e),i===!0&&e.requeue(),i!==!0&&i&&(Array.isArray(i)?e.replaceWithMultiple(i):e.replaceWith(i))}},E=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,l.default)(this,e),this.forceSuperMemoisation=t.forceSuperMemoisation,this.methodPath=t.methodPath,this.methodNode=t.methodNode,this.superRef=t.superRef,this.isStatic=t.isStatic,this.hasSuper=!1,this.inClass=r,this.isLoose=t.isLoose,this.scope=this.methodPath.scope,this.file=t.file,this.opts=t,this.bareSupers=[],this.returns=[],this.thises=[]}return e.prototype.getObjectRef=function(){return this.opts.objectRef||this.opts.getObjectRef()},e.prototype.setSuperProperty=function(e,t,r){return y.callExpression(this.file.addHelper("set"),[o(this.getObjectRef(),this.isStatic),r?e:y.stringLiteral(e.name),t,y.thisExpression()])},e.prototype.getSuperProperty=function(e,t){return y.callExpression(this.file.addHelper("get"),[o(this.getObjectRef(),this.isStatic),t?e:y.stringLiteral(e.name),y.thisExpression()])},e.prototype.replace=function(){this.methodPath.traverse(b,this)},e.prototype.getLooseSuperProperty=function(e,t){var r=this.methodNode,n=this.superRef||y.identifier("Function");return t.property===e?void 0:y.isCallExpression(t,{callee:e})?void 0:y.isMemberExpression(t)&&!r.static?y.memberExpression(n,y.identifier("prototype")):n},e.prototype.looseHandle=function(e){var t=e.node;if(e.isSuper())return this.getLooseSuperProperty(t,e.parent);if(e.isCallExpression()){var r=t.callee;if(!y.isMemberExpression(r))return;if(!y.isSuper(r.object))return;return y.appendToMemberExpression(r,y.identifier("call")),t.arguments.unshift(y.thisExpression()),!0}},e.prototype.specHandleAssignmentExpression=function(e,t,r){return"="===r.operator?this.setSuperProperty(r.left.property,r.right,r.left.computed):(e=e||t.scope.generateUidIdentifier("ref"),[y.variableDeclaration("var",[y.variableDeclarator(e,r.left)]),y.expressionStatement(y.assignmentExpression("=",r.left,y.binaryExpression(r.operator[0],e,r.right)))])},e.prototype.specHandle=function(e){var t=void 0,r=void 0,n=void 0,i=e.parent,o=e.node;if(a(o,i))throw e.buildCodeFrameError(m.get("classesIllegalBareSuper"));if(y.isCallExpression(o)){var u=o.callee;if(y.isSuper(u))return;s(u)&&(t=u.property,r=u.computed,n=o.arguments)}else if(y.isMemberExpression(o)&&y.isSuper(o.object))t=o.property,r=o.computed;else{if(y.isUpdateExpression(o)&&s(o.argument)){var l=y.binaryExpression(o.operator[0],o.argument,y.numericLiteral(1));if(o.prefix)return this.specHandleAssignmentExpression(null,e,l);var c=e.scope.generateUidIdentifier("ref");return this.specHandleAssignmentExpression(c,e,l).concat(y.expressionStatement(c))}if(y.isAssignmentExpression(o)&&s(o.left))return this.specHandleAssignmentExpression(null,e,o)}if(t){var f=this.getSuperProperty(t,r);return n?this.optimiseCall(f,n):f}},e.prototype.optimiseCall=function(e,t){var r=y.thisExpression();return r[g]=!0,(0,d.default)(e,r,t)},e}();t.default=E,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=u.default[e];if(!t)throw new ReferenceError("Unknown helper "+e);return t().expression}t.__esModule=!0,t.list=void 0;var a=r(20),s=n(a);t.get=i;var o=r(318),u=n(o);t.list=(0,s.default)(u.default).map(function(e){return"_"===e[0]?e.slice(1):e}).filter(function(e){return"__esModule"!==e});t.default=i},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("asyncGenerators")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("classConstructorCall")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("classProperties")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("doExpressions")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("exponentiationOperator")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("exportExtensions")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("functionBind")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("objectRestSpread")}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i),s=r(9),o=n(s);t.default=function(e){function t(e){for(var t=e.get("body.body"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,a.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var o=s;if("constructorCall"===o.node.kind)return o}return null}function n(e,t){var r=t,n=r.node,a=n.id||t.scope.generateUidIdentifier("class");t.parentPath.isExportDefaultDeclaration()&&(t=t.parentPath,t.insertAfter(i.exportDefaultDeclaration(a))),t.replaceWithMultiple(c({CLASS_REF:t.scope.generateUidIdentifier(a.name),CALL_REF:t.scope.generateUidIdentifier(a.name+"Call"),CALL:i.functionExpression(null,e.node.params,e.node.body),CLASS:i.toExpression(n),WRAPPER_REF:a})),e.remove()}var i=e.types,s=(0,o.default)();return{inherits:r(193),visitor:{Class:function(e){if(!e.node[s]){e.node[s]=!0;var r=t(e);r&&n(r,e)}}}}};var u=r(4),l=n(u),c=(0,l.default)("\n let CLASS_REF = CLASS;\n var CALL_REF = CALL;\n var WRAPPER_REF = function (...args) {\n if (this instanceof WRAPPER_REF) {\n return Reflect.construct(CLASS_REF, args);\n } else {\n return CALL_REF.apply(this, args);\n }\n };\n WRAPPER_REF.__proto__ = CLASS_REF;\n WRAPPER_REF;\n");e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){var t=e.types,n={Super:function(e){e.parentPath.isCallExpression({callee:e.node})&&this.push(e.parentPath)}},i={ReferencedIdentifier:function(e){this.scope.hasOwnBinding(e.node.name)&&(this.collision=!0,e.skip())}},s=(0,l.default)("\n Object.defineProperty(REF, KEY, {\n // configurable is false by default\n enumerable: true,\n writable: true,\n value: VALUE\n });\n "),u=function(e,r){var n=r.key,i=r.value,a=r.computed;return s({REF:e,KEY:t.isIdentifier(n)&&!a?t.stringLiteral(n.name):n,VALUE:i?i:t.identifier("undefined")})},c=function(e,r){var n=r.key,i=r.value,a=r.computed;return t.expressionStatement(t.assignmentExpression("=",t.memberExpression(e,n,a||t.isLiteral(n)),i))};return{inherits:r(194),visitor:{Class:function(e,r){for(var s=r.opts.spec?u:c,l=!!e.node.superClass,f=void 0,p=[],d=e.get("body"),h=d.get("body"),m=Array.isArray(h),v=0,h=m?h:(0,a.default)(h);;){var y;if(m){if(v>=h.length)break;y=h[v++]}else{if(v=h.next(),v.done)break;y=v.value}var g=y;g.isClassProperty()?p.push(g):g.isClassMethod({kind:"constructor"})&&(f=g)}if(p.length){var b=[],E=void 0;e.isClassExpression()||!e.node.id?((0,o.default)(e),E=e.scope.generateUidIdentifier("class")):E=e.node.id;for(var x=[],A=p,_=Array.isArray(A),D=0,A=_?A:(0,a.default)(A);;){var C;if(_){if(D>=A.length)break;C=A[D++]}else{if(D=A.next(),D.done)break;C=D.value}var S=C,w=S.node;if(!(w.decorators&&w.decorators.length>0)&&(r.opts.spec||w.value)){var F=w.static;if(F)b.push(s(E,w));else{if(!w.value)continue;x.push(s(t.thisExpression(),w))}}}if(x.length){if(!f){var k=t.classMethod("constructor",t.identifier("constructor"),[],t.blockStatement([]));l&&(k.params=[t.restElement(t.identifier("args"))],k.body.body.push(t.returnStatement(t.callExpression(t.super(),[t.spreadElement(t.identifier("args"))]))));var P=d.unshiftContainer("body",k);f=P[0]}for(var T={collision:!1,scope:f.scope},O=p,B=Array.isArray(O),R=0,O=B?O:(0,a.default)(O);;){var I;if(B){if(R>=O.length)break;I=O[R++]}else{if(R=O.next(),R.done)break;I=R.value}var M=I;if(M.traverse(i,T),T.collision)break}if(T.collision){var N=e.scope.generateUidIdentifier("initialiseProps");b.push(t.variableDeclaration("var",[t.variableDeclarator(N,t.functionExpression(null,[],t.blockStatement(x)))])),x=[t.expressionStatement(t.callExpression(t.memberExpression(N,t.identifier("call")),[t.thisExpression()]))]}if(l){var L=[];f.traverse(n,L);for(var j=L,U=Array.isArray(j),V=0,j=U?j:(0,a.default)(j);;){var G;if(U){if(V>=j.length)break;G=j[V++]}else{if(V=j.next(),V.done)break;G=V.value}var W=G;W.insertAfter(x)}}else f.get("body").unshiftContainer("body",x)}for(var Y=p,q=Array.isArray(Y),K=0,Y=q?Y:(0,a.default)(Y);;){var H;if(q){if(K>=Y.length)break;H=Y[K++]}else{if(K=Y.next(),K.done)break;H=K.value}var J=H;J.remove()}b.length&&(e.isClassExpression()?(e.scope.push({id:E}),e.replaceWith(t.assignmentExpression("=",E,e.node))):(e.node.id||(e.node.id=E),e.parentPath.isExportDeclaration()&&(e=e.parentPath)),e.insertAfter(b))}},ArrowFunctionExpression:function(e){var t=e.get("body");if(t.isClassExpression()){var r=t.get("body"),n=r.get("body");n.some(function(e){return e.isClassProperty()})&&e.ensureBlock()}}}}};var s=r(40),o=n(s),u=r(4),l=n(u);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(13),a=n(i),s=r(2),o=n(s);t.default=function(e){function t(e){return e.reverse().map(function(e){return e.expression})}function n(e,r,n){var i=[],s=e.node.decorators;if(s){e.node.decorators=null,s=t(s);for(var l=s,c=Array.isArray(l),f=0,l=c?l:(0,o.default)(l);;){var d;if(c){if(f>=l.length)break;d=l[f++]}else{if(f=l.next(),f.done)break;d=f.value}var h=d;i.push(p({CLASS_REF:r,DECORATOR:h}))}}for(var m=(0,a.default)(null),v=e.get("body.body"),y=Array.isArray(v),g=0,v=y?v:(0,o.default)(v);;){var b;if(y){if(g>=v.length)break;b=v[g++]}else{if(g=v.next(),g.done)break;b=g.value}var E=b,x=E.node.decorators;if(x){var A=u.toKeyAlias(E.node);m[A]=m[A]||[],m[A].push(E.node),E.remove()}}for(var _ in m)var D=m[_];return i}function i(e){if(e.isClass()){if(e.node.decorators)return!0;for(var t=e.node.body.body,r=Array.isArray(t),n=0,t=r?t:(0,o.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;if(a.decorators)return!0}}else if(e.isObjectExpression())for(var s=e.node.properties,u=Array.isArray(s),l=0,s=u?s:(0,o.default)(s);;){var c;if(u){if(l>=s.length)break;c=s[l++]}else{if(l=s.next(),l.done)break;c=l.value}var f=c;if(f.decorators)return!0}return!1}function s(e){throw e.buildCodeFrameError('Decorators are not officially supported yet in 6.x pending a proposal update.\nHowever, if you need to use them you can install the legacy decorators transform with:\n\nnpm install babel-plugin-transform-decorators-legacy --save-dev\n\nand add the following line to your .babelrc file:\n\n{\n "plugins": ["transform-decorators-legacy"]\n}\n\nThe repo url is: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.\n ')}var u=e.types;return{inherits:r(125),visitor:{ClassExpression:function(e){if(i(e)){s(e),(0,f.default)(e);var t=e.scope.generateDeclaredUidIdentifier("ref"),r=[];r.push(u.assignmentExpression("=",t,e.node)),r=r.concat(n(e,t,this)),r.push(t),e.replaceWith(u.sequenceExpression(r))}},ClassDeclaration:function(e){if(i(e)){s(e),(0,f.default)(e);var t=e.node.id,r=[];r=r.concat(n(e,t,this).map(function(e){return u.expressionStatement(e)})),r.push(u.expressionStatement(t)),e.insertAfter(r)}},ObjectExpression:function(e){i(e)&&s(e)}}}};var u=r(4),l=n(u),c=r(316),f=n(c),p=(0,l.default)("\n CLASS_REF = DECORATOR(CLASS_REF) || CLASS_REF;\n");e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{inherits:r(195),visitor:{DoExpression:function(e){var t=e.node.body.body;t.length?e.replaceWithMultiple(t):e.replaceWith(e.scope.buildUndefinedNode())}}}},e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a),o=r(3),u=i(o),l=r(8),c=r(190),f=i(c),p=r(188),d=i(p),h=r(185),m=n(h),v=r(4),y=i(v),g=r(1),b=n(g),E=(0,y.default)("\n (function () {\n super(...arguments);\n })\n"),x={"FunctionExpression|FunctionDeclaration":function(e){e.is("shadow")||e.skip()},Method:function(e){e.skip()}},A=l.visitors.merge([x,{Super:function(e){if(this.isDerived&&!this.hasBareSuper&&!e.parentPath.isCallExpression({callee:e.node}))throw e.buildCodeFrameError("'super.*' is not allowed before super()")},CallExpression:{exit:function(e){if(e.get("callee").isSuper()&&(this.hasBareSuper=!0,!this.isDerived))throw e.buildCodeFrameError("super() is only allowed in a derived constructor")}},ThisExpression:function(e){if(this.isDerived&&!this.hasBareSuper&&!e.inShadow("this"))throw e.buildCodeFrameError("'this' is not allowed before super()")}}]),_=l.visitors.merge([x,{ThisExpression:function(e){this.superThises.push(e)}}]),D=function(){function e(t,r){(0,u.default)(this,e),this.parent=t.parent,this.scope=t.scope,this.node=t.node,this.path=t,this.file=r,this.clearDescriptors(),this.instancePropBody=[],this.instancePropRefs={},this.staticPropBody=[],this.body=[],this.bareSuperAfter=[],this.bareSupers=[],this.pushedConstructor=!1,this.pushedInherits=!1,this.isLoose=!1,this.superThises=[],this.classId=this.node.id,this.classRef=this.node.id?b.identifier(this.node.id.name):this.scope.generateUidIdentifier("class"),this.superName=this.node.superClass||b.identifier("Function"),this.isDerived=!!this.node.superClass}return e.prototype.run=function(){var e=this,t=this.superName,r=this.file,n=this.body,i=this.constructorBody=b.blockStatement([]);this.constructor=this.buildConstructor();var a=[],s=[];if(this.isDerived&&(s.push(t),t=this.scope.generateUidIdentifierBasedOnNode(t),a.push(t),this.superName=t),this.buildBody(),i.body.unshift(b.expressionStatement(b.callExpression(r.addHelper("classCallCheck"),[b.thisExpression(),this.classRef]))),n=n.concat(this.staticPropBody.map(function(t){return t(e.classRef)})),this.classId&&1===n.length)return b.toExpression(n[0]);n.push(b.returnStatement(this.classRef));var o=b.functionExpression(null,a,b.blockStatement(n));return o.shadow=!0,b.callExpression(o,s)},e.prototype.buildConstructor=function(){var e=b.functionDeclaration(this.classRef,[],this.constructorBody);return b.inherits(e,this.node),e},e.prototype.pushToMap=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",n=arguments[3],i=void 0;e.static?(this.hasStaticDescriptors=!0,i=this.staticMutatorMap):(this.hasInstanceDescriptors=!0,i=this.instanceMutatorMap);var a=m.push(i,e,r,this.file,n);return t&&(a.enumerable=b.booleanLiteral(!0)),a},e.prototype.constructorMeMaybe=function(){for(var e=!1,t=this.path.get("body.body"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,s.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var o=a;if(e=o.equals("kind","constructor"))break}if(!e){var u=void 0,l=void 0;if(this.isDerived){var c=E().expression;u=c.params,l=c.body}else u=[],l=b.blockStatement([]);this.path.get("body").unshiftContainer("body",b.classMethod("constructor",b.identifier("constructor"),u,l))}},e.prototype.buildBody=function(){if(this.constructorMeMaybe(),this.pushBody(),this.verifyConstructor(),this.userConstructor){var e=this.constructorBody;e.body=e.body.concat(this.userConstructor.body.body),b.inherits(this.constructor,this.userConstructor),b.inherits(e,this.userConstructor.body)}this.pushDescriptors()},e.prototype.pushBody=function(){for(var e=this.path.get("body.body"),t=e,r=Array.isArray(t),n=0,t=r?t:(0,s.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i,o=a.node;if(a.isClassProperty())throw a.buildCodeFrameError("Missing class properties transform.");if(o.decorators)throw a.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one.");if(b.isClassMethod(o)){var u="constructor"===o.kind;if(u&&(a.traverse(A,this),!this.hasBareSuper&&this.isDerived))throw a.buildCodeFrameError("missing super() call in constructor");var l=new f.default({forceSuperMemoisation:u,methodPath:a,methodNode:o,objectRef:this.classRef,superRef:this.superName,isStatic:o.static,isLoose:this.isLoose,scope:this.scope,file:this.file},(!0));l.replace(),u?this.pushConstructor(l,o,a):this.pushMethod(o,a)}}},e.prototype.clearDescriptors=function(){this.hasInstanceDescriptors=!1,this.hasStaticDescriptors=!1,this.instanceMutatorMap={},this.staticMutatorMap={}},e.prototype.pushDescriptors=function(){this.pushInherits();var e=this.body,t=void 0,r=void 0;if(this.hasInstanceDescriptors&&(t=m.toClassObject(this.instanceMutatorMap)),this.hasStaticDescriptors&&(r=m.toClassObject(this.staticMutatorMap)),t||r){t&&(t=m.toComputedObjectFromClass(t)),r&&(r=m.toComputedObjectFromClass(r));var n=b.nullLiteral(),i=[this.classRef,n,n,n,n];t&&(i[1]=t),r&&(i[2]=r),this.instanceInitializersId&&(i[3]=this.instanceInitializersId,e.unshift(this.buildObjectAssignment(this.instanceInitializersId))),this.staticInitializersId&&(i[4]=this.staticInitializersId,e.unshift(this.buildObjectAssignment(this.staticInitializersId)));for(var a=0,s=0;s<i.length;s++)i[s]!==n&&(a=s);i=i.slice(0,a+1),e.push(b.expressionStatement(b.callExpression(this.file.addHelper("createClass"),i)))}this.clearDescriptors()},e.prototype.buildObjectAssignment=function(e){return b.variableDeclaration("var",[b.variableDeclarator(e,b.objectExpression([]))])},e.prototype.wrapSuperCall=function(e,t,r,n){var i=e.node;this.isLoose?(i.arguments.unshift(b.thisExpression()),2===i.arguments.length&&b.isSpreadElement(i.arguments[1])&&b.isIdentifier(i.arguments[1].argument,{name:"arguments"})?(i.arguments[1]=i.arguments[1].argument,i.callee=b.memberExpression(t,b.identifier("apply"))):i.callee=b.memberExpression(t,b.identifier("call"))):i=(0,d.default)(b.logicalExpression("||",b.memberExpression(this.classRef,b.identifier("__proto__")),b.callExpression(b.memberExpression(b.identifier("Object"),b.identifier("getPrototypeOf")),[this.classRef])),b.thisExpression(),i.arguments);var a=b.callExpression(this.file.addHelper("possibleConstructorReturn"),[b.thisExpression(),i]),s=this.bareSuperAfter.map(function(e){return e(r)});e.parentPath.isExpressionStatement()&&e.parentPath.container===n.node.body&&n.node.body.length-1===e.parentPath.key?((this.superThises.length||s.length)&&(e.scope.push({id:r}),a=b.assignmentExpression("=",r,a)),s.length&&(a=b.toSequenceExpression([a].concat(s,[r]))),e.parentPath.replaceWith(b.returnStatement(a))):e.replaceWithMultiple([b.variableDeclaration("var",[b.variableDeclarator(r,a)])].concat(s,[b.expressionStatement(r)]))},e.prototype.verifyConstructor=function(){var e=this;if(this.isDerived){var t=this.userConstructorPath,r=t.get("body");t.traverse(_,this);for(var n=!!this.bareSupers.length,i=this.superName||b.identifier("Function"),a=t.scope.generateUidIdentifier("this"),o=this.bareSupers,u=Array.isArray(o),l=0,o=u?o:(0,s.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var f=c;this.wrapSuperCall(f,i,a,r),n&&f.find(function(e){return e===t||(e.isLoop()||e.isConditional()?(n=!1,!0):void 0)})}for(var p=this.superThises,d=Array.isArray(p),h=0,p=d?p:(0,s.default)(p);;){var m;if(d){if(h>=p.length)break;m=p[h++]}else{if(h=p.next(),h.done)break;m=h.value}var v=m;v.replaceWith(a)}var y=function(t){return b.callExpression(e.file.addHelper("possibleConstructorReturn"),[a].concat(t||[]))},g=r.get("body");g.length&&!g.pop().isReturnStatement()&&r.pushContainer("body",b.returnStatement(n?a:y()));for(var E=this.superReturns,x=Array.isArray(E),A=0,E=x?E:(0,s.default)(E);;){var D;if(x){if(A>=E.length)break;D=E[A++]}else{if(A=E.next(),A.done)break;D=A.value}var C=D;if(C.node.argument){var S=C.scope.generateDeclaredUidIdentifier("ret");C.get("argument").replaceWithMultiple([b.assignmentExpression("=",S,C.node.argument),y(S)])}else C.get("argument").replaceWith(y())}}},e.prototype.pushMethod=function(e,t){var r=t?t.scope:this.scope;"method"===e.kind&&this._processMethod(e,r)||this.pushToMap(e,!1,null,r)},e.prototype._processMethod=function(){return!1},e.prototype.pushConstructor=function(e,t,r){this.bareSupers=e.bareSupers,this.superReturns=e.returns,r.scope.hasOwnBinding(this.classRef.name)&&r.scope.rename(this.classRef.name);var n=this.constructor;this.userConstructorPath=r,this.userConstructor=t,this.hasConstructor=!0,b.inheritsComments(n,t),n._ignoreUserWhitespace=!0,n.params=t.params,b.inherits(n.body,t.body),n.body.directives=t.body.directives,this._pushConstructor()},e.prototype._pushConstructor=function(){this.pushedConstructor||(this.pushedConstructor=!0,(this.hasInstanceDescriptors||this.hasStaticDescriptors)&&this.pushDescriptors(),this.body.push(this.constructor),this.pushInherits())},e.prototype.pushInherits=function(){this.isDerived&&!this.pushedInherits&&(this.pushedInherits=!0,this.body.unshift(b.expressionStatement(b.callExpression(this.file.addHelper("inherits"),[this.classRef,this.superName]))))},e}();t.default=D,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(13),a=n(i),s=r(2),o=n(s),u=r(9),l=n(u);t.default=function(e){var t=e.types,r=(0,l.default)(),n={"AssignmentExpression|UpdateExpression":function(e){if(!e.node[r]){e.node[r]=!0;var n=e.get(e.isAssignmentExpression()?"left":"argument");if(n.isIdentifier()){var i=n.node.name;if(this.scope.getBinding(i)===e.scope.getBinding(i)){var a=this.exports[i];if(a){var s=e.node,u=e.isUpdateExpression()&&!s.prefix;u&&("++"===s.operator?s=t.binaryExpression("+",s.argument,t.numericLiteral(1)):"--"===s.operator?s=t.binaryExpression("-",s.argument,t.numericLiteral(1)):u=!1); for(var l=a,c=Array.isArray(l),f=0,l=c?l:(0,o.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;s=this.buildCall(d,s).expression}u&&(s=t.sequenceExpression([s,e.node])),e.replaceWith(s)}}}}}};return{visitor:{CallExpression:function(e,r){if(e.node.callee.type===v){var n=r.contextIdent;e.replaceWith(t.callExpression(t.memberExpression(n,t.identifier("import")),e.node.arguments))}},ReferencedIdentifier:function(e,r){"__moduleName"!=e.node.name||e.scope.hasBinding("__moduleName")||e.replaceWith(t.memberExpression(r.contextIdent,t.identifier("id")))},Program:{enter:function(e,t){t.contextIdent=e.scope.generateUidIdentifier("context")},exit:function(e,r){function i(e,t){p[e]=p[e]||[],p[e].push(t)}function s(e,t,r){var n=void 0;d.forEach(function(t){t.key===e&&(n=t)}),n||d.push(n={key:e,imports:[],exports:[]}),n[t]=n[t].concat(r)}function u(e,r){return t.expressionStatement(t.callExpression(l,[t.stringLiteral(e),r]))}for(var l=e.scope.generateUidIdentifier("export"),c=r.contextIdent,p=(0,a.default)(null),d=[],v=[],y=[],g=[],b=[],E=[],x=e.get("body"),A=!0,_=x,D=Array.isArray(_),C=0,_=D?_:(0,o.default)(_);;){var S;if(D){if(C>=_.length)break;S=_[C++]}else{if(C=_.next(),C.done)break;S=C.value}var w=S;if(w.isExportDeclaration()&&(w=w.get("declaration")),w.isVariableDeclaration()&&"var"!==w.node.kind){A=!1;break}}for(var F=x,k=Array.isArray(F),P=0,F=k?F:(0,o.default)(F);;){var T;if(k){if(P>=F.length)break;T=F[P++]}else{if(P=F.next(),P.done)break;T=P.value}var O=T;if(A&&O.isFunctionDeclaration())v.push(O.node),E.push(O);else if(O.isImportDeclaration()){var B=O.node.source.value;s(B,"imports",O.node.specifiers);for(var R in O.getBindingIdentifiers())O.scope.removeBinding(R),b.push(t.identifier(R));O.remove()}else if(O.isExportAllDeclaration())s(O.node.source.value,"exports",O.node),O.remove();else if(O.isExportDefaultDeclaration()){var I=O.get("declaration");if(I.isClassDeclaration()||I.isFunctionDeclaration()){var M=I.node.id,N=[];M?(N.push(I.node),N.push(u("default",M)),i(M.name,"default")):N.push(u("default",t.toExpression(I.node))),!A||I.isClassDeclaration()?O.replaceWithMultiple(N):(v=v.concat(N),E.push(O))}else O.replaceWith(u("default",I.node))}else if(O.isExportNamedDeclaration()){var L=O.get("declaration");if(L.node){O.replaceWith(L);var j=[],U=void 0;if(O.isFunction()){var V=L.node,G=V.id.name;if(A)i(G,G),v.push(V),v.push(u(G,V.id)),E.push(O);else{var W;W={},W[G]=V.id,U=W}}else U=L.getBindingIdentifiers();for(var Y in U)i(Y,Y),j.push(u(Y,t.identifier(Y)));O.insertAfter(j)}else{var q=O.node.specifiers;if(q&&q.length)if(O.node.source)s(O.node.source.value,"exports",q),O.remove();else{for(var K=[],H=q,J=Array.isArray(H),X=0,H=J?H:(0,o.default)(H);;){var z;if(J){if(X>=H.length)break;z=H[X++]}else{if(X=H.next(),X.done)break;z=X.value}var $=z;K.push(u($.exported.name,$.local)),i($.local.name,$.exported.name)}O.replaceWithMultiple(K)}}}}d.forEach(function(r){for(var n=[],i=e.scope.generateUidIdentifier(r.key),a=r.imports,s=Array.isArray(a),u=0,a=s?a:(0,o.default)(a);;){var c;if(s){if(u>=a.length)break;c=a[u++]}else{if(u=a.next(),u.done)break;c=u.value}var f=c;t.isImportNamespaceSpecifier(f)?n.push(t.expressionStatement(t.assignmentExpression("=",f.local,i))):t.isImportDefaultSpecifier(f)&&(f=t.importSpecifier(f.local,t.identifier("default"))),t.isImportSpecifier(f)&&n.push(t.expressionStatement(t.assignmentExpression("=",f.local,t.memberExpression(i,f.imported))))}if(r.exports.length){var p=e.scope.generateUidIdentifier("exportObj");n.push(t.variableDeclaration("var",[t.variableDeclarator(p,t.objectExpression([]))]));for(var d=r.exports,h=Array.isArray(d),v=0,d=h?d:(0,o.default)(d);;){var b;if(h){if(v>=d.length)break;b=d[v++]}else{if(v=d.next(),v.done)break;b=v.value}var E=b;t.isExportAllDeclaration(E)?n.push(m({KEY:e.scope.generateUidIdentifier("key"),EXPORT_OBJ:p,TARGET:i})):t.isExportSpecifier(E)&&n.push(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(p,E.exported),t.memberExpression(i,E.local))))}n.push(t.expressionStatement(t.callExpression(l,[p])))}g.push(t.stringLiteral(r.key)),y.push(t.functionExpression(null,[i],t.blockStatement(n)))});var Q=this.getModuleName();Q&&(Q=t.stringLiteral(Q)),A&&(0,f.default)(e,function(e){return b.push(e)}),b.length&&v.unshift(t.variableDeclaration("var",b.map(function(e){return t.variableDeclarator(e)}))),e.traverse(n,{exports:p,buildCall:u,scope:e.scope});for(var Z=E,ee=Array.isArray(Z),te=0,Z=ee?Z:(0,o.default)(Z);;){var re;if(ee){if(te>=Z.length)break;re=Z[te++]}else{if(te=Z.next(),te.done)break;re=te.value}var ne=re;ne.remove()}e.node.body=[h({SYSTEM_REGISTER:t.memberExpression(t.identifier(r.opts.systemGlobal||"System"),t.identifier("register")),BEFORE_BODY:v,MODULE_NAME:Q,SETTERS:y,SOURCES:g,BODY:e.node.body,EXPORT_IDENTIFIER:l,CONTEXT_IDENTIFIER:c})]}}}}};var c=r(187),f=n(c),p=r(4),d=n(p),h=(0,d.default)('\n SYSTEM_REGISTER(MODULE_NAME, [SOURCES], function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n "use strict";\n BEFORE_BODY;\n return {\n setters: [SETTERS],\n execute: function () {\n BODY;\n }\n };\n });\n'),m=(0,d.default)('\n for (var KEY in TARGET) {\n if (KEY !== "default" && KEY !== "__esModule") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n'),v="Import";e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){function t(e){if(e.isExpressionStatement()){var t=e.get("expression");if(!t.isCallExpression())return!1;if(!t.get("callee").isIdentifier({name:"define"}))return!1;var r=t.get("arguments");return!(3===r.length&&!r.shift().isStringLiteral())&&(2===r.length&&(!!r.shift().isArrayExpression()&&!!r.shift().isFunctionExpression()))}}var n=e.types;return{inherits:r(130),visitor:{Program:{exit:function(e,r){var a=e.get("body").pop();if(t(a)){var s=a.node.expression,c=s.arguments,f=3===c.length?c.shift():null,p=s.arguments[0],d=s.arguments[1],h=r.opts.globals||{},m=p.elements.map(function(e){return"module"===e.value||"exports"===e.value?n.identifier(e.value):n.callExpression(n.identifier("require"),[e])}),v=p.elements.map(function(e){if("module"===e.value)return n.identifier("mod");if("exports"===e.value)return n.memberExpression(n.identifier("mod"),n.identifier("exports"));var t=void 0;if(r.opts.exactGlobals){var a=h[e.value];t=a?a.split(".").reduce(function(e,t){return n.memberExpression(e,n.identifier(t))},n.identifier("global")):n.memberExpression(n.identifier("global"),n.identifier(n.toIdentifier(e.value)))}else{var s=(0,i.basename)(e.value,(0,i.extname)(e.value)),o=h[s]||s;t=n.memberExpression(n.identifier("global"),n.identifier(n.toIdentifier(o)))}return t}),y=f?f.value:this.file.opts.basename,g=n.memberExpression(n.identifier("global"),n.identifier(n.toIdentifier(y))),b=null;if(r.opts.exactGlobals){var E=h[y];if(E){b=[];var x=E.split(".");g=x.slice(1).reduce(function(e,t){return b.push(o({GLOBAL_REFERENCE:e})),n.memberExpression(e,n.identifier(t))},n.memberExpression(n.identifier("global"),n.identifier(x[0])))}}var A=u({BROWSER_ARGUMENTS:v,PREREQUISITE_ASSIGNMENTS:b,GLOBAL_TO_ASSIGN:g});a.replaceWith(l({MODULE_NAME:f,AMD_ARGUMENTS:p,COMMON_ARGUMENTS:m,GLOBAL_EXPORT:A,FUNC:d}))}}}}}};var i=r(17),a=r(4),s=n(a),o=(0,s.default)("\n GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}\n"),u=(0,s.default)("\n var mod = { exports: {} };\n factory(BROWSER_ARGUMENTS);\n PREREQUISITE_ASSIGNMENTS\n GLOBAL_TO_ASSIGN = mod.exports;\n"),l=(0,s.default)('\n (function (global, factory) {\n if (typeof define === "function" && define.amd) {\n define(MODULE_NAME, AMD_ARGUMENTS, factory);\n } else if (typeof exports !== "undefined") {\n factory(COMMON_ARGUMENTS);\n } else {\n GLOBAL_EXPORT\n }\n })(this, FUNC);\n');e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e,r,i){var a=e.specifiers[0];if(n.isExportNamespaceSpecifier(a)||n.isExportDefaultSpecifier(a)){var s=e.specifiers.shift(),o=i.generateUidIdentifier(s.exported.name),u=void 0;u=n.isExportNamespaceSpecifier(s)?n.importNamespaceSpecifier(o):n.importDefaultSpecifier(o),r.push(n.importDeclaration([u],e.source)),r.push(n.exportNamedDeclaration(null,[n.exportSpecifier(o,s.exported)])),t(e,r,i)}}var n=e.types;return{inherits:r(197),visitor:{ExportNamedDeclaration:function(e){var r=e.node,n=e.scope,i=[];t(r,i,n),i.length&&(r.specifiers.length>=1&&i.push(r),e.replaceWithMultiple(i))}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){var t=e.types,n="@flow";return{inherits:r(67),visitor:{Program:function(e,t){for(var r=t.file.ast.comments,i=r,s=Array.isArray(i),o=0,i=s?i:(0,a.default)(i);;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u;l.value.indexOf(n)>=0&&(l.value=l.value.replace(n,""),l.value.replace(/\*/g,"").trim()||(l.ignore=!0))}},Flow:function(e){e.remove()},ClassProperty:function(e){e.node.variance=null,e.node.typeAnnotation=null,e.node.value||e.remove()},Class:function(e){e.node.implements=null,e.get("body.body").forEach(function(e){e.isClassProperty()&&(e.node.typeAnnotation=null,e.node.value||e.remove())})},Function:function(e){for(var t=e.node,r=0;r<t.params.length;r++){var n=t.params[r];n.optional=!1}},TypeCastExpression:function(e){var r=e.node;do r=r.expression;while(t.isTypeCastExpression(r));e.replaceWith(r)}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e){var t=e.path.getData("functionBind");return t?t:(t=e.generateDeclaredUidIdentifier("context"),e.path.setData("functionBind",t))}function n(e,t){var r=e.object||e.callee.object;return t.isStatic(r)&&r}function i(e,r){var i=n(e,r);if(i)return i;var s=t(r);return e.object?e.callee=a.sequenceExpression([a.assignmentExpression("=",s,e.object),e.callee]):e.callee.object=a.assignmentExpression("=",s,e.callee.object),s}var a=e.types;return{inherits:r(198),visitor:{CallExpression:function(e){var t=e.node,r=e.scope,n=t.callee;if(a.isBindExpression(n)){var s=i(n,r);t.callee=a.memberExpression(n.callee,a.identifier("call")),t.arguments.unshift(s)}},BindExpression:function(e){var t=e.node,r=e.scope,n=i(t,r);e.replaceWith(a.callExpression(a.memberExpression(t.callee,a.identifier("bind")),[n]))}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){function t(e){for(var t=e.properties,r=Array.isArray(t),n=0,t=r?t:(0,a.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(u.isRestProperty(s))return!0}return!1}function n(e){for(var r=e.declarations,n=Array.isArray(r),i=0,r=n?r:(0,a.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var o=s;if(u.isObjectPattern(o.id))return t(o.id)}return!1}function i(e){for(var t=e.properties,r=Array.isArray(t),n=0,t=r?t:(0,a.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(u.isSpreadProperty(s))return!0}return!1}function s(e,t,r){for(var n=t.pop(),i=[],s=t,o=Array.isArray(s),l=0,s=o?s:(0,a.default)(s);;){var c;if(o){if(l>=s.length)break;c=s[l++]}else{if(l=s.next(),l.done)break;c=l.value}var f=c,p=f.key;u.isIdentifier(p)&&!f.computed&&(p=u.stringLiteral(f.key.name)),i.push(p)}return[n.argument,u.callExpression(e.addHelper("objectWithoutProperties"),[r,u.arrayExpression(i)])]}function o(e,r,n){if(e.isObjectPattern()&&t(e.node)){var i=e.parentPath,a=i.scope.generateUidIdentifier("ref"),s=u.variableDeclaration("let",[u.variableDeclarator(e.node,a)]);s._blockHoist=r?n-r:1,i.ensureBlock(),i.get("body").unshiftContainer("body",s),e.replaceWith(a)}}var u=e.types;return{inherits:r(199),visitor:{Function:function(e){for(var t=e.get("params"),r=0;r<t.length;r++)o(t[r],r,t.length)},VariableDeclarator:function(e,t){if(e.get("id").isObjectPattern()){var r=e.parentPath.node.kind,n=[];e.traverse({RestProperty:function(e){var r=this.originalPath.node.init;e.findParent(function(e){if(e.isObjectProperty())r=u.memberExpression(r,u.identifier(e.node.key.name));else if(e.isVariableDeclarator())return!0});var i=s(t,e.parentPath.node.properties,r),a=i[0],o=i[1];n.push(u.variableDeclarator(a,o)),0===e.parentPath.node.properties.length&&e.findParent(function(e){return e.isObjectProperty()||e.isVariableDeclaration()}).remove()}},{originalPath:e}),n.length>0&&e.parentPath.getSibling(e.parentPath.key+1).insertBefore(u.variableDeclaration(r,n))}},ExportNamedDeclaration:function(e){var t=e.get("declaration");if(t.isVariableDeclaration()&&n(t.node)){var r=[];for(var i in e.getOuterBindingIdentifiers(e)){var a=u.identifier(i);r.push(u.exportSpecifier(a,a))}e.replaceWith(t.node),e.insertAfter(u.exportNamedDeclaration(null,r))}},CatchClause:function(e){o(e.get("param"))},AssignmentExpression:function(e,r){var n=e.get("left");if(n.isObjectPattern()&&t(n.node)){var i=[],a=void 0;(e.isCompletionRecord()||e.parentPath.isExpressionStatement())&&(a=e.scope.generateUidIdentifierBasedOnNode(e.node.right,"ref"),i.push(u.variableDeclaration("var",[u.variableDeclarator(a,e.node.right)])));var o=s(r,e.node.left.properties,a),l=o[0],c=o[1],f=u.clone(e.node);f.right=a,i.push(u.expressionStatement(f)),i.push(u.assignmentExpression("=",l,c)),a&&i.push(u.expressionStatement(a)),e.replaceWithMultiple(i)}},ForXStatement:function(e){var r=e.node,n=e.scope,i=r.left;if(u.isObjectPattern(i)&&t(i)){var a=n.generateUidIdentifier("ref");return r.left=u.variableDeclaration("var",[u.variableDeclarator(a)]),e.ensureBlock(),void r.body.body.unshift(u.variableDeclaration("var",[u.variableDeclarator(i,a)]))}if(u.isVariableDeclaration(i)){var s=i.declarations[0].id;if(u.isObjectPattern(s)){var o=n.generateUidIdentifier("ref");r.left=u.variableDeclaration(i.kind,[u.variableDeclarator(o,null)]),e.ensureBlock(),r.body.body.unshift(u.variableDeclaration(r.left.kind,[u.variableDeclarator(s,o)]))}}},ObjectExpression:function(e,t){function r(){o.length&&(s.push(u.objectExpression(o)),o=[])}if(i(e.node)){var n=t.opts.useBuiltIns||!1;if("boolean"!=typeof n)throw new Error("transform-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)");for(var s=[],o=[],l=e.node.properties,c=Array.isArray(l),f=0,l=c?l:(0,a.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;u.isSpreadProperty(d)?(r(),s.push(d.argument)):o.push(d)}r(),u.isObjectExpression(s[0])||s.unshift(u.objectExpression([]));var h=n?u.memberExpression(u.identifier("Object"),u.identifier("assign")):t.addHelper("extends");e.replaceWith(u.callExpression(h,s))}}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){function t(e,t){for(var r=t.arguments[0].properties,i=!0,a=0;a<r.length;a++){var s=r[a],o=n.toComputedKey(s);if(n.isLiteral(o,{value:"displayName"})){i=!1;break}}i&&r.unshift(n.objectProperty(n.identifier("displayName"),n.stringLiteral(e)))}function r(e){if(!e||!n.isCallExpression(e))return!1;if(!i(e.callee))return!1;var t=e.arguments;if(1!==t.length)return!1;var r=t[0];return!!n.isObjectExpression(r)}var n=e.types,i=n.buildMatchMemberExpression("React.createClass");return{visitor:{ExportDefaultDeclaration:function(e,n){var i=e.node;if(r(i.declaration)){var s=n.file.opts.basename;"index"===s&&(s=a.default.basename(a.default.dirname(n.file.opts.filename))),t(s,i.declaration)}},CallExpression:function(e){var i=e.node;if(r(i)){var a=void 0;e.find(function(e){if(e.isAssignmentExpression())a=e.node.left;else if(e.isObjectProperty())a=e.node.key;else if(e.isVariableDeclarator())a=e.node.id;else if(e.isStatement())return!0;if(a)return!0}),a&&(n.isMemberExpression(a)&&(a=a.property),n.isIdentifier(a)&&t(a.name,i))}}}}};var i=r(17),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){var t=e.types,n=/\*?\s*@jsx\s+([^\s]+)/,i=r(184)({pre:function(e){var r=e.tagName,n=e.args;t.react.isCompatTag(r)?n.push(t.stringLiteral(r)):n.push(e.tagExpr)},post:function(e,t){e.callee=t.get("jsxIdentifier")()}});return i.Program=function(e,r){for(var i=r.file,s=r.opts.pragma||"React.createElement",o=i.ast.comments,u=Array.isArray(o),l=0,o=u?o:(0,a.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var f=c,p=n.exec(f.value);if(p){if(s=p[1],"React.DOM"===s)throw i.buildCodeFrameError(f,"The @jsx React.DOM pragma has been deprecated as of React 0.12");break}}r.set("jsxIdentifier",function(){return s.split(".").map(function(e){return t.identifier(e)}).reduce(function(e,r){return t.memberExpression(e,r)})})},{inherits:r(126),visitor:i}},e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){h.default.ok(this instanceof a),v.assertIdentifier(e),this.nextTempId=0,this.contextId=e,this.listing=[],this.marked=[!0],this.finalLoc=s(),this.tryEntries=[],this.leapManager=new g.LeapManager(this)}function s(){return v.numericLiteral(-1)}function o(e){return new Error("all declarations should have been transformed into assignments before the Exploder began its work: "+(0,p.default)(e))}function u(e){var t=e.type;return"normal"===t?!_.call(e,"target"):"break"===t||"continue"===t?!_.call(e,"value")&&v.isLiteral(e.target):("return"===t||"throw"===t)&&(_.call(e,"value")&&!_.call(e,"target"))}var l=r(7),c=i(l),f=r(34),p=i(f),d=r(63),h=i(d),m=r(1),v=n(m),y=r(348),g=n(y),b=r(349),E=n(b),x=r(214),A=n(x),_=Object.prototype.hasOwnProperty,D=a.prototype;t.Emitter=a,D.mark=function(e){v.assertLiteral(e);var t=this.listing.length;return e.value===-1?e.value=t:h.default.strictEqual(e.value,t),this.marked[t]=!0,e},D.emit=function(e){v.isExpression(e)&&(e=v.expressionStatement(e)),v.assertStatement(e),this.listing.push(e)},D.emitAssign=function(e,t){return this.emit(this.assign(e,t)),e},D.assign=function(e,t){return v.expressionStatement(v.assignmentExpression("=",e,t))},D.contextProperty=function(e,t){return v.memberExpression(this.contextId,t?v.stringLiteral(e):v.identifier(e),!!t)},D.stop=function(e){e&&this.setReturnValue(e),this.jump(this.finalLoc)},D.setReturnValue=function(e){v.assertExpression(e.value),this.emitAssign(this.contextProperty("rval"),this.explodeExpression(e))},D.clearPendingException=function(e,t){v.assertLiteral(e);var r=v.callExpression(this.contextProperty("catch",!0),[e]);t?this.emitAssign(t,r):this.emit(r)},D.jump=function(e){this.emitAssign(this.contextProperty("next"),e),this.emit(v.breakStatement())},D.jumpIf=function(e,t){v.assertExpression(e),v.assertLiteral(t),this.emit(v.ifStatement(e,v.blockStatement([this.assign(this.contextProperty("next"),t),v.breakStatement()])))},D.jumpIfNot=function(e,t){v.assertExpression(e),v.assertLiteral(t);var r=void 0;r=v.isUnaryExpression(e)&&"!"===e.operator?e.argument:v.unaryExpression("!",e),this.emit(v.ifStatement(r,v.blockStatement([this.assign(this.contextProperty("next"),t),v.breakStatement()])))},D.makeTempVar=function(){return this.contextProperty("t"+this.nextTempId++)},D.getContextFunction=function(e){return v.functionExpression(e||null,[this.contextId],v.blockStatement([this.getDispatchLoop()]),!1,!1)},D.getDispatchLoop=function(){var e=this,t=[],r=void 0,n=!1;return e.listing.forEach(function(i,a){e.marked.hasOwnProperty(a)&&(t.push(v.switchCase(v.numericLiteral(a),r=[])),n=!1),n||(r.push(i),v.isCompletionStatement(i)&&(n=!0))}),this.finalLoc.value=this.listing.length,t.push(v.switchCase(this.finalLoc,[]),v.switchCase(v.stringLiteral("end"),[v.returnStatement(v.callExpression(this.contextProperty("stop"),[]))])),v.whileStatement(v.numericLiteral(1),v.switchStatement(v.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),t))},D.getTryLocsList=function(){if(0===this.tryEntries.length)return null;var e=0;return v.arrayExpression(this.tryEntries.map(function(t){var r=t.firstLoc.value;h.default.ok(r>=e,"try entries out of order"),e=r;var n=t.catchEntry,i=t.finallyEntry,a=[t.firstLoc,n?n.firstLoc:null];return i&&(a[2]=i.firstLoc,a[3]=i.afterLoc),v.arrayExpression(a)}))},D.explode=function(e,t){var r=e.node,n=this;if(v.assertNode(r),v.isDeclaration(r))throw o(r);if(v.isStatement(r))return n.explodeStatement(e);if(v.isExpression(r))return n.explodeExpression(e,t);switch(r.type){case"Program":return e.get("body").map(n.explodeStatement,n);case"VariableDeclarator":throw o(r);case"Property":case"SwitchCase":case"CatchClause":throw new Error(r.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+(0,p.default)(r.type))}},D.explodeStatement=function(e,t){var r=e.node,n=this,i=void 0,a=void 0,o=void 0;if(v.assertStatement(r),t?v.assertIdentifier(t):t=null,v.isBlockStatement(r))return void e.get("body").forEach(function(e){n.explodeStatement(e)});if(!E.containsLeap(r))return void n.emit(r);var u=function(){switch(r.type){case"ExpressionStatement":n.explodeExpression(e.get("expression"),!0);break;case"LabeledStatement":a=s(),n.leapManager.withEntry(new g.LabeledEntry(a,r.label),function(){n.explodeStatement(e.get("body"),r.label)}),n.mark(a);break;case"WhileStatement":i=s(),a=s(),n.mark(i),n.jumpIfNot(n.explodeExpression(e.get("test")),a),n.leapManager.withEntry(new g.LoopEntry(a,i,t),function(){n.explodeStatement(e.get("body"))}),n.jump(i),n.mark(a);break;case"DoWhileStatement":var u=s(),l=s();a=s(),n.mark(u),n.leapManager.withEntry(new g.LoopEntry(a,l,t),function(){n.explode(e.get("body"))}),n.mark(l),n.jumpIf(n.explodeExpression(e.get("test")),u),n.mark(a);break;case"ForStatement":o=s();var c=s();a=s(),r.init&&n.explode(e.get("init"),!0),n.mark(o),r.test&&n.jumpIfNot(n.explodeExpression(e.get("test")),a),n.leapManager.withEntry(new g.LoopEntry(a,c,t),function(){n.explodeStatement(e.get("body"))}),n.mark(c),r.update&&n.explode(e.get("update"),!0),n.jump(o),n.mark(a);break;case"TypeCastExpression":return{v:n.explodeExpression(e.get("expression"))};case"ForInStatement":o=s(),a=s();var f=n.makeTempVar();n.emitAssign(f,v.callExpression(A.runtimeProperty("keys"),[n.explodeExpression(e.get("right"))])),n.mark(o);var d=n.makeTempVar();n.jumpIf(v.memberExpression(v.assignmentExpression("=",d,v.callExpression(f,[])),v.identifier("done"),!1),a),n.emitAssign(r.left,v.memberExpression(d,v.identifier("value"),!1)),n.leapManager.withEntry(new g.LoopEntry(a,o,t),function(){n.explodeStatement(e.get("body"))}),n.jump(o),n.mark(a);break;case"BreakStatement":n.emitAbruptCompletion({type:"break",target:n.leapManager.getBreakLoc(r.label)});break;case"ContinueStatement":n.emitAbruptCompletion({type:"continue",target:n.leapManager.getContinueLoc(r.label)});break;case"SwitchStatement":var m=n.emitAssign(n.makeTempVar(),n.explodeExpression(e.get("discriminant")));a=s();for(var y=s(),b=y,E=[],x=r.cases||[],_=x.length-1;_>=0;--_){var D=x[_];v.assertSwitchCase(D),D.test?b=v.conditionalExpression(v.binaryExpression("===",m,D.test),E[_]=s(),b):E[_]=y}var S=e.get("discriminant");S.replaceWith(b),n.jump(n.explodeExpression(S)),n.leapManager.withEntry(new g.SwitchEntry(a),function(){e.get("cases").forEach(function(e){var t=e.key;n.mark(E[t]),e.get("consequent").forEach(function(e){n.explodeStatement(e)})})}),n.mark(a),y.value===-1&&(n.mark(y),h.default.strictEqual(a.value,y.value));break;case"IfStatement":var w=r.alternate&&s();a=s(),n.jumpIfNot(n.explodeExpression(e.get("test")),w||a),n.explodeStatement(e.get("consequent")),w&&(n.jump(a),n.mark(w),n.explodeStatement(e.get("alternate"))),n.mark(a);break;case"ReturnStatement":n.emitAbruptCompletion({type:"return",value:n.explodeExpression(e.get("argument"))});break;case"WithStatement":throw new Error("WithStatement not supported in generator functions.");case"TryStatement":a=s();var F=r.handler,k=F&&s(),P=k&&new g.CatchEntry(k,F.param),T=r.finalizer&&s(),O=T&&new g.FinallyEntry(T,a),B=new g.TryEntry(n.getUnmarkedCurrentLoc(),P,O);n.tryEntries.push(B),n.updateContextPrevLoc(B.firstLoc),n.leapManager.withEntry(B,function(){n.explodeStatement(e.get("block")),k&&!function(){T?n.jump(T):n.jump(a),n.updateContextPrevLoc(n.mark(k));var t=e.get("handler.body"),r=n.makeTempVar();n.clearPendingException(B.firstLoc,r),t.traverse(C,{safeParam:r,catchParamName:F.param.name}),n.leapManager.withEntry(P,function(){n.explodeStatement(t)})}(),T&&(n.updateContextPrevLoc(n.mark(T)),n.leapManager.withEntry(O,function(){n.explodeStatement(e.get("finalizer"))}),n.emit(v.returnStatement(v.callExpression(n.contextProperty("finish"),[O.firstLoc]))))}),n.mark(a);break;case"ThrowStatement":n.emit(v.throwStatement(n.explodeExpression(e.get("argument"))));break;default:throw new Error("unknown Statement of type "+(0,p.default)(r.type))}}();return"object"===("undefined"==typeof u?"undefined":(0,c.default)(u))?u.v:void 0};var C={Identifier:function(e,t){e.node.name===t.catchParamName&&A.isReference(e)&&e.replaceWith(t.safeParam)},Scope:function(e,t){e.scope.hasOwnBinding(t.catchParamName)&&e.skip()}};D.emitAbruptCompletion=function(e){u(e)||h.default.ok(!1,"invalid completion record: "+(0,p.default)(e)),h.default.notStrictEqual(e.type,"normal","normal completions are not abrupt");var t=[v.stringLiteral(e.type)];"break"===e.type||"continue"===e.type?(v.assertLiteral(e.target),t[1]=e.target):"return"!==e.type&&"throw"!==e.type||e.value&&(v.assertExpression(e.value),t[1]=e.value),this.emit(v.returnStatement(v.callExpression(this.contextProperty("abrupt"),t)))},D.getUnmarkedCurrentLoc=function(){return v.numericLiteral(this.listing.length)},D.updateContextPrevLoc=function(e){e?(v.assertLiteral(e),e.value===-1?e.value=this.listing.length:h.default.strictEqual(e.value,this.listing.length)):e=this.getUnmarkedCurrentLoc(),this.emitAssign(this.contextProperty("prev"),e)},D.explodeExpression=function(e,t){function r(e){return v.assertExpression(e),t?void a.emit(e):e}function n(e,t,r){h.default.ok(!r||!e,"Ignoring the result of a child expression but forcing it to be assigned to a temporary variable?");var n=a.explodeExpression(t,r);return r||(e||l&&!v.isLiteral(n))&&(n=a.emitAssign(e||a.makeTempVar(),n)),n}var i=e.node;if(!i)return i;v.assertExpression(i);var a=this,o=void 0,u=void 0;if(!E.containsLeap(i))return r(i);var l=E.containsLeap.onlyChildren(i),f=function(){switch(i.type){case"MemberExpression":return{v:r(v.memberExpression(a.explodeExpression(e.get("object")),i.computed?n(null,e.get("property")):i.property,i.computed))};case"CallExpression":var l=e.get("callee"),c=e.get("arguments"),f=void 0,d=[],m=!1;if(c.forEach(function(e){m=m||E.containsLeap(e.node)}),v.isMemberExpression(l.node))if(m){var y=n(a.makeTempVar(),l.get("object")),g=l.node.computed?n(null,l.get("property")):l.node.property;d.unshift(y),f=v.memberExpression(v.memberExpression(y,g,l.node.computed),v.identifier("call"),!1)}else f=a.explodeExpression(l);else f=a.explodeExpression(l),v.isMemberExpression(f)&&(f=v.sequenceExpression([v.numericLiteral(0),f]));return c.forEach(function(e){d.push(n(null,e))}),{v:r(v.callExpression(f,d))};case"NewExpression":return{v:r(v.newExpression(n(null,e.get("callee")),e.get("arguments").map(function(e){return n(null,e)})))};case"ObjectExpression":return{v:r(v.objectExpression(e.get("properties").map(function(e){return e.isObjectProperty()?v.objectProperty(e.node.key,n(null,e.get("value")),e.node.computed):e.node})))};case"ArrayExpression":return{v:r(v.arrayExpression(e.get("elements").map(function(e){return n(null,e)})))};case"SequenceExpression":var b=i.expressions.length-1;return e.get("expressions").forEach(function(e){e.key===b?o=a.explodeExpression(e,t):a.explodeExpression(e,!0)}),{v:o};case"LogicalExpression":u=s(),t||(o=a.makeTempVar());var x=n(o,e.get("left"));return"&&"===i.operator?a.jumpIfNot(x,u):(h.default.strictEqual(i.operator,"||"),a.jumpIf(x,u)),n(o,e.get("right"),t),a.mark(u),{v:o};case"ConditionalExpression":var A=s();u=s();var _=a.explodeExpression(e.get("test"));return a.jumpIfNot(_,A),t||(o=a.makeTempVar()),n(o,e.get("consequent"),t),a.jump(u),a.mark(A),n(o,e.get("alternate"),t),a.mark(u),{v:o};case"UnaryExpression":return{v:r(v.unaryExpression(i.operator,a.explodeExpression(e.get("argument")),!!i.prefix))};case"BinaryExpression":return{v:r(v.binaryExpression(i.operator,n(null,e.get("left")),n(null,e.get("right"))))};case"AssignmentExpression":return{v:r(v.assignmentExpression(i.operator,a.explodeExpression(e.get("left")),a.explodeExpression(e.get("right"))))};case"UpdateExpression":return{v:r(v.updateExpression(i.operator,a.explodeExpression(e.get("argument")),i.prefix))};case"YieldExpression":u=s();var D=i.argument&&a.explodeExpression(e.get("argument"));if(D&&i.delegate){var C=a.makeTempVar();return a.emit(v.returnStatement(v.callExpression(a.contextProperty("delegateYield"),[D,v.stringLiteral(C.property.name),u]))),a.mark(u),{v:C}}return a.emitAssign(a.contextProperty("next"),u),a.emit(v.returnStatement(D||null)),a.mark(u),{v:a.contextProperty("sent")};default:throw new Error("unknown Expression of type "+(0,p.default)(i.type))}}();return"object"===("undefined"==typeof f?"undefined":(0,c.default)(f))?f.v:void 0}},function(e,t,r){"use strict";function n(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}function i(e){return o.memberExpression(o.identifier("regeneratorRuntime"),o.identifier(e),!1)}function a(e){return e.isReferenced()||e.parentPath.isAssignmentExpression({left:e.node})}t.__esModule=!0,t.runtimeProperty=i,t.isReference=a;var s=r(1),o=n(s)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a);t.default=function(){return{visitor:{Program:function(e,t){if(t.opts.strict!==!1&&t.opts.strictMode!==!1){for(var r=e.node,n=r.directives,i=Array.isArray(n),a=0,n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var l=o;if("use strict"===l.value.value)return}e.unshiftContainer("directives",u.directive(u.directiveLiteral("use strict")))}}}}};var o=r(1),u=n(o);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=["commonjs","amd","umd","systemjs"],n=!1,i="commonjs",a=!1;if(void 0!==t&&(void 0!==t.loose&&(n=t.loose),void 0!==t.modules&&(i=t.modules),void 0!==t.spec&&(a=t.spec)),"boolean"!=typeof n)throw new Error("Preset es2015 'loose' option must be a boolean.");if("boolean"!=typeof a)throw new Error("Preset es2015 'spec' option must be a boolean.");if(i!==!1&&r.indexOf(i)===-1)throw new Error("Preset es2015 'modules' option must be 'false' to indicate no modules\nor a module type which be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'");var o={loose:n};return{plugins:[[s.default,{loose:n,spec:a}],u.default,c.default,[p.default,{spec:a}],h.default,[v.default,o],g.default,E.default,A.default,[D.default,o],[S.default,o],F.default,P.default,O.default,[R.default,o],M.default,[L.default,o],U.default,G.default,"commonjs"===i&&[Y.default,o],"systemjs"===i&&[K.default,o],"amd"===i&&[J.default,o],"umd"===i&&[z.default,o],[Q.default,{async:!1,asyncGenerators:!1}]].filter(Boolean)}}t.__esModule=!0;var a=r(83),s=n(a),o=r(76),u=n(o),l=r(75),c=n(l),f=r(68),p=n(f),d=r(69),h=n(d),m=r(71),v=n(m),y=r(78),g=n(y),b=r(80),E=n(b),x=r(129),A=n(x),_=r(72),D=n(_),C=r(74),S=n(C),w=r(82),F=n(w),k=r(85),P=n(k),T=r(65),O=n(T),B=r(81),R=n(B),I=r(79),M=n(I),N=r(73),L=n(N),j=r(70),U=n(j),V=r(84),G=n(V),W=r(77),Y=n(W),q=r(205),K=n(q),H=r(130),J=n(H),X=r(206),z=n(X),$=r(86),Q=n($),Z=i({}); t.default=Z,Object.defineProperty(Z,"buildPreset",{configurable:!0,writable:!0,enumerable:!1,value:i}),e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(131),a=n(i);t.default={plugins:[a.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(127),a=n(i),s=r(128),o=n(s);t.default={plugins:[a.default,o.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(220),a=n(i),s=r(200),o=n(s),u=r(207),l=n(u);t.default={presets:[a.default],plugins:[o.default,l.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(221),a=n(i),s=r(201),o=n(s),u=r(202),l=n(u),c=r(321),f=n(c);t.default={presets:[a.default],plugins:[f.default,o.default,l.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(127),a=n(i),s=r(128),o=n(s),u=r(131),l=n(u),c=r(210),f=n(c),p=r(324),d=n(p);t.default={plugins:[a.default,o.default,l.default,d.default,f.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),a=n(i),s=function e(t,r){(0,a.default)(this,e),this.file=t,this.options=r};t.default=s,e.exports=t.default},function(e,t,r){"use strict";function n(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.__esModule=!0,t.Flow=t.Pure=t.Generated=t.User=t.Var=t.BlockScoped=t.Referenced=t.Scope=t.Expression=t.Statement=t.BindingIdentifier=t.ReferencedMemberExpression=t.ReferencedIdentifier=void 0;var i=r(1),a=n(i);t.ReferencedIdentifier={types:["Identifier","JSXIdentifier"],checkPath:function(e,t){var r=e.node,n=e.parent;if(!a.isIdentifier(r,t)&&!a.isJSXMemberExpression(n,t)){if(!a.isJSXIdentifier(r,t))return!1;if(i.react.isCompatTag(r.name))return!1}return a.isReferenced(r,n)}},t.ReferencedMemberExpression={types:["MemberExpression"],checkPath:function(e){var t=e.node,r=e.parent;return a.isMemberExpression(t)&&a.isReferenced(t,r)}},t.BindingIdentifier={types:["Identifier"],checkPath:function(e){var t=e.node,r=e.parent;return a.isIdentifier(t)&&a.isBinding(t,r)}},t.Statement={types:["Statement"],checkPath:function(e){var t=e.node,r=e.parent;if(a.isStatement(t)){if(a.isVariableDeclaration(t)){if(a.isForXStatement(r,{left:t}))return!1;if(a.isForStatement(r,{init:t}))return!1}return!0}return!1}},t.Expression={types:["Expression"],checkPath:function(e){return e.isIdentifier()?e.isReferencedIdentifier():a.isExpression(e.node)}},t.Scope={types:["Scopable"],checkPath:function(e){return a.isScope(e.node,e.parent)}},t.Referenced={checkPath:function(e){return a.isReferenced(e.node,e.parent)}},t.BlockScoped={checkPath:function(e){return a.isBlockScoped(e.node)}},t.Var={types:["VariableDeclaration"],checkPath:function(e){return a.isVar(e.node)}},t.User={checkPath:function(e){return e.node&&!!e.node.loc}},t.Generated={checkPath:function(e){return!e.isUser()}},t.Pure={checkPath:function(e,t){return e.scope.isPure(e.node,t)}},t.Flow={types:["Flow","ImportDeclaration","ExportDeclaration"],checkPath:function(e){var t=e.node;return!!a.isFlow(t)||(a.isImportDeclaration(t)?"type"===t.importKind||"typeof"===t.importKind:!!a.isExportDeclaration(t)&&"type"===t.exportKind)}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),a=n(i),s=function(){function e(t){var r=t.existing,n=t.identifier,i=t.scope,s=t.path,o=t.kind;(0,a.default)(this,e),this.identifier=n,this.scope=i,this.path=s,this.kind=o,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.clearValue(),r&&(this.constantViolations=[].concat(r.path,r.constantViolations,this.constantViolations))}return e.prototype.deoptValue=function(){this.clearValue(),this.hasDeoptedValue=!0},e.prototype.setValue=function(e){this.hasDeoptedValue||(this.hasValue=!0,this.value=e)},e.prototype.clearValue=function(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null},e.prototype.reassign=function(e){this.constant=!1,this.constantViolations.indexOf(e)===-1&&this.constantViolations.push(e)},e.prototype.reference=function(e){this.referencePaths.indexOf(e)===-1&&(this.referenced=!0,this.references++,this.referencePaths.push(e))},e.prototype.dereference=function(){this.references--,this.referenced=!!this.references},e}();t.default=s,e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){for(var n=[].concat(e),i=(0,u.default)(null);n.length;){var a=n.shift();if(a){var s=c.getBindingIdentifiers.keys[a.type];if(c.isIdentifier(a))if(t){var o=i[a.name]=i[a.name]||[];o.push(a)}else i[a.name]=a;else if(c.isExportDeclaration(a))c.isDeclaration(e.declaration)&&n.push(e.declaration);else{if(r){if(c.isFunctionDeclaration(a)){n.push(a.id);continue}if(c.isFunctionExpression(a))continue}if(s)for(var l=0;l<s.length;l++){var f=s[l];a[f]&&(n=n.concat(a[f]))}}}}return i}function s(e,t){return a(e,t,!0)}t.__esModule=!0;var o=r(13),u=i(o);t.getBindingIdentifiers=a,t.getOuterBindingIdentifiers=s;var l=r(1),c=n(l);a.keys={DeclareClass:["id"],DeclareFunction:["id"],DeclareModule:["id"],DeclareVariable:["id"],InterfaceDeclaration:["id"],TypeAlias:["id"],CatchClause:["param"],LabeledStatement:["label"],UnaryExpression:["argument"],AssignmentExpression:["left"],ImportSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportDefaultSpecifier:["local"],ImportDeclaration:["specifiers"],ExportSpecifier:["exported"],ExportNamespaceSpecifier:["exported"],ExportDefaultSpecifier:["exported"],FunctionDeclaration:["id","params"],FunctionExpression:["id","params"],ClassDeclaration:["id"],ClassExpression:["id"],RestElement:["argument"],UpdateExpression:["argument"],RestProperty:["argument"],ObjectProperty:["value"],AssignmentPattern:["left"],ArrayPattern:["elements"],ObjectPattern:["properties"],VariableDeclaration:["declarations"],VariableDeclarator:["id"]}},function(e,t,r){(function(e,n){"use strict";function i(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function a(){return e.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,r){if(a()<r)throw new RangeError("Invalid typed array length");return e.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=e.prototype):(null===t&&(t=new e(r)),t.length=r),t}function e(t,r,n){if(!(e.TYPED_ARRAY_SUPPORT||this instanceof e))return new e(t,r,n);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return o(this,t,r,n)}function o(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?d(e,t,r,n):"string"==typeof t?f(e,t,r):h(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t,r,n){return u(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}function c(t,r){if(u(r),t=s(t,r<0?0:0|m(r)),!e.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)t[n]=0;return t}function f(t,r,n){if("string"==typeof n&&""!==n||(n="utf8"),!e.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|y(r,n);t=s(t,i);var a=t.write(r,n);return a!==i&&(t=t.slice(0,a)),t}function p(e,t){var r=t.length<0?0:0|m(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(t,r,n,i){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return r=void 0===n&&void 0===i?new Uint8Array(r):void 0===i?new Uint8Array(r,n):new Uint8Array(r,n,i),e.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=e.prototype):t=p(t,r),t}function h(t,r){if(e.isBuffer(r)){var n=0|m(r.length);return t=s(t,n),0===t.length?t:(r.copy(t,0,0,n),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||z(r.length)?s(t,0):p(t,r);if("Buffer"===r.type&&Z(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function v(t){return+t!=t&&(t=0),e.alloc(+t)}function y(t,r){if(e.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(t).length;default:if(i)return q(t).length;r=(""+r).toLowerCase(),i=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return F(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function E(t,r,n,i,a){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof r&&(r=e.from(r,i)),e.isBuffer(r))return 0===r.length?-1:x(t,r,n,i,a);if("number"==typeof r)return r=255&r,e.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,r,n):Uint8Array.prototype.lastIndexOf.call(t,r,n):x(t,[r],n,i,a);throw new TypeError("val must be string, number or Buffer")}function x(e,t,r,n,i){function a(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,o=e.length,u=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,r/=2}var l;if(i){var c=-1;for(l=r;l<o;l++)if(a(e,l)===a(t,c===-1?0:l-c)){if(c===-1&&(c=l),l-c+1===u)return c*s}else c!==-1&&(l-=l-c),c=-1}else for(r+u>o&&(r=o-u),l=r;l>=0;l--){for(var f=!0,p=0;p<u;p++)if(a(e,l+p)!==a(t,p)){f=!1;break}if(f)return l}return-1}function A(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[r+s]=o}return s}function _(e,t,r,n){return X(q(t,e.length-r),e,r,n)}function D(e,t,r,n){return X(K(t),e,r,n)}function C(e,t,r,n){return D(e,t,r,n)}function S(e,t,r,n){return X(J(t),e,r,n)}function w(e,t,r,n){return X(H(t,e.length-r),e,r,n)}function F(e,t,r){return 0===t&&r===e.length?$.fromByteArray(e):$.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a=e[i],s=null,o=a>239?4:a>223?3:a>191?2:1;if(i+o<=r){var u,l,c,f;switch(o){case 1:a<128&&(s=a);break;case 2:u=e[i+1],128===(192&u)&&(f=(31&a)<<6|63&u,f>127&&(s=f));break;case 3:u=e[i+1],l=e[i+2],128===(192&u)&&128===(192&l)&&(f=(15&a)<<12|(63&u)<<6|63&l,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(f=(15&a)<<18|(63&u)<<12|(63&l)<<6|63&c,f>65535&&f<1114112&&(s=f))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return P(n)}function P(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ee));return r}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function O(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=Y(e[a]);return i}function R(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function I(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,r,n,i,a,s){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||r<s)throw new RangeError('"value" argument is out of bounds');if(n+i>t.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function L(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function j(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,i){return i||j(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function V(e,t,r,n,i){return i||j(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function G(e){if(e=W(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function W(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e){return e<16?"0"+e.toString(16):e.toString(16)}function q(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function K(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function H(e,t){for(var r,n,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function J(e){return $.toByteArray(G(e))}function X(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function z(e){return e!==e}var $=r(395),Q=r(457),Z=r(397);t.Buffer=e,t.SlowBuffer=v,t.INSPECT_MAX_BYTES=50,e.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:i(),t.kMaxLength=a(),e.poolSize=8192,e._augment=function(t){return t.__proto__=e.prototype,t},e.from=function(e,t,r){return o(null,e,t,r)},e.TYPED_ARRAY_SUPPORT&&(e.prototype.__proto__=Uint8Array.prototype,e.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&e[Symbol.species]===e&&Object.defineProperty(e,Symbol.species,{value:null,configurable:!0})),e.alloc=function(e,t,r){return l(null,e,t,r)},e.allocUnsafe=function(e){return c(null,e)},e.allocUnsafeSlow=function(e){return c(null,e)},e.isBuffer=function(e){return!(null==e||!e._isBuffer)},e.compare=function(t,r){if(!e.isBuffer(t)||!e.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,a=0,s=Math.min(n,i);a<s;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0},e.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},e.concat=function(t,r){if(!Z(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return e.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=e.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){var s=t[n];if(!e.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,a),a+=s.length}return i},e.byteLength=y,e.prototype._isBuffer=!0,e.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)b(this,t,t+1);return this},e.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},e.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},e.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):g.apply(this,arguments)},e.prototype.equals=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===e.compare(this,t)},e.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},e.prototype.compare=function(t,r,n,i,a){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var s=a-i,o=n-r,u=Math.min(s,o),l=this.slice(i,a),c=t.slice(r,n),f=0;f<u;++f)if(l[f]!==c[f]){s=l[f],o=c[f];break}return s<o?-1:o<s?1:0},e.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},e.prototype.indexOf=function(e,t,r){return E(this,e,t,r,!0)},e.prototype.lastIndexOf=function(e,t,r){return E(this,e,t,r,!1)},e.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return A(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return D(this,e,t,r);case"latin1":case"binary":return C(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;e.prototype.slice=function(t,r){var n=this.length;t=~~t,r=void 0===r?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i;if(e.TYPED_ARRAY_SUPPORT)i=this.subarray(t,r),i.__proto__=e.prototype;else{var a=r-t;i=new e(a,(void 0));for(var s=0;s<a;++s)i[s]=this[s+t]}return i},e.prototype.readUIntLE=function(e,t,r){e=0|e,t=0|t,r||I(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},e.prototype.readUIntBE=function(e,t,r){e=0|e,t=0|t,r||I(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},e.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},e.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},e.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},e.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},e.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},e.prototype.readIntLE=function(e,t,r){e=0|e,t=0|t,r||I(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},e.prototype.readIntBE=function(e,t,r){e=0|e,t=0|t,r||I(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},e.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},e.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},e.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},e.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),Q.read(this,e,!0,23,4)},e.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),Q.read(this,e,!1,23,4)},e.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),Q.read(this,e,!0,52,8)},e.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),Q.read(this,e,!1,52,8)},e.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=0|t,r=0|r,!n){var i=Math.pow(2,8*r)-1;M(this,e,t,r,i,0)}var a=1,s=0;for(this[t]=255&e;++s<r&&(a*=256);)this[t+s]=e/a&255;return t+r},e.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t=0|t,r=0|r,!n){var i=Math.pow(2,8*r)-1;M(this,e,t,r,i,0)}var a=r-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+r},e.prototype.writeUInt8=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,1,255,0),e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},e.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,2,65535,0),e.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},e.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,2,65535,0),e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},e.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,4,4294967295,0),e.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):L(this,t,r,!0),r+4},e.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,4,4294967295,0),e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):L(this,t,r,!1),r+4},e.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=0|t,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<r&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+r},e.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=0|t,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+r},e.prototype.writeInt8=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,1,127,-128),e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},e.prototype.writeInt16LE=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,2,32767,-32768),e.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},e.prototype.writeInt16BE=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,2,32767,-32768),e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},e.prototype.writeInt32LE=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,4,2147483647,-2147483648),e.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):L(this,t,r,!0),r+4},e.prototype.writeInt32BE=function(t,r,n){return t=+t,r=0|r,n||M(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):L(this,t,r,!1),r+4},e.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},e.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},e.prototype.writeDoubleLE=function(e,t,r){return V(this,e,t,!0,r)},e.prototype.writeDoubleBE=function(e,t,r){return V(this,e,t,!1,r)},e.prototype.copy=function(t,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var a,s=i-n;if(this===t&&n<r&&r<i)for(a=s-1;a>=0;--a)t[a+r]=this[a+n];else if(s<1e3||!e.TYPED_ARRAY_SUPPORT)for(a=0;a<s;++a)t[a+r]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),r);return s},e.prototype.fill=function(t,r,n,i){if("string"==typeof t){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===t.length){var a=t.charCodeAt(0);a<256&&(t=a)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!e.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t=255&t);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var s;if("number"==typeof t)for(s=r;s<n;++s)this[s]=t;else{var o=e.isBuffer(t)?t:q(new e(t,i).toString()),u=o.length;for(s=0;s<n-r;++s)this[s+r]=o[s%u]}return this};var te=/[^+\/0-9A-Za-z-_]/g}).call(t,r(226).Buffer,function(){return this}())},function(e,t,r){var n=r(138),i=r(10)("toStringTag"),a="Arguments"==n(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,r,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=s(t=Object(e),i))?r:a?n(t):"Object"==(o=n(t))&&"function"==typeof t.callee?"Arguments":o}},function(e,t,r){"use strict";var n=r(145),i=r(55).getWeak,a=r(21),s=r(24),o=r(136),u=r(90),l=r(137),c=r(29),f=l(5),p=l(6),d=0,h=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},v=function(e,t){return f(e.a,function(e){return e[0]===t})};m.prototype={get:function(e){var t=v(this,e);if(t)return t[1]},has:function(e){return!!v(this,e)},set:function(e,t){var r=v(this,e);r?r[1]=t:this.a.push([e,t])},delete:function(e){var t=p(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,r,a){var l=e(function(e,n){o(e,l,t,"_i"),e._i=d++,e._l=void 0,void 0!=n&&u(n,r,e[a],e)});return n(l.prototype,{delete:function(e){if(!s(e))return!1;var t=i(e);return t===!0?h(this).delete(e):t&&c(t,this._i)&&delete t[this._i]},has:function(e){if(!s(e))return!1;var t=i(e);return t===!0?h(this).has(e):t&&c(t,this._i)}}),l},def:function(e,t,r){var n=i(a(t),!0);return n===!0?h(e).set(t,r):n[e._i]=r,e},ufstore:h}},function(e,t,r){var n=r(24),i=r(14).document,a=n(i)&&n(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,r){e.exports=!r(22)&&!r(36)(function(){return 7!=Object.defineProperty(r(229)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(138);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){"use strict";var n=r(43),i=r(144),a=r(92),s=r(95),o=r(141),u=Object.assign;e.exports=!u||r(36)(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=u({},e)[r]||Object.keys(u({},t)).join("")!=n})?function(e,t){for(var r=s(e),u=arguments.length,l=1,c=i.f,f=a.f;u>l;)for(var p,d=o(arguments[l++]),h=c?n(d).concat(c(d)):n(d),m=h.length,v=0;m>v;)f.call(d,p=h[v++])&&(r[p]=d[p]);return r}:u},function(e,t,r){var n=r(92),i=r(93),a=r(37),s=r(151),o=r(29),u=r(230),l=Object.getOwnPropertyDescriptor;t.f=r(22)?l:function(e,t){if(e=a(e),t=s(t,!0),u)try{return l(e,t)}catch(e){}if(o(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t,r){var n=r(236),i=r(140).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},function(e,t,r){var n=r(29),i=r(37),a=r(418)(!1),s=r(147)("IE_PROTO");e.exports=function(e,t){var r,o=i(e),u=0,l=[];for(r in o)r!=s&&n(o,r)&&l.push(r);for(;t.length>u;)n(o,r=t[u++])&&(~a(l,r)||l.push(r));return l}},function(e,t,r){var n=r(227),i=r(10)("iterator"),a=r(54);e.exports=r(5).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||a[n(e)]}},function(e,t,r){(function(n){function i(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function a(){var e=arguments,r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0,a=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))}),e.splice(a,0,n),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function u(){var e;try{e=t.storage.debug}catch(e){}return"env"in("undefined"==typeof n?{}:n)&&(e=n.env.DEBUG),e}function l(){try{return window.localStorage}catch(e){}}t=e.exports=r(450),t.log=s,t.formatArgs=a,t.save=o,t.load=u,t.useColors=i,t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:l(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(u())}).call(t,r(18))},function(e,t){!function(){"use strict";function t(e){return 48<=e&&e<=57}function r(e){return 48<=e&&e<=57||97<=e&&e<=102||65<=e&&e<=70}function n(e){return e>=48&&e<=55}function i(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&d.indexOf(e)>=0}function a(e){return 10===e||13===e||8232===e||8233===e}function s(e){if(e<=65535)return String.fromCharCode(e);var t=String.fromCharCode(Math.floor((e-65536)/1024)+55296),r=String.fromCharCode((e-65536)%1024+56320);return t+r}function o(e){return e<128?h[e]:p.NonAsciiIdentifierStart.test(s(e))}function u(e){return e<128?m[e]:p.NonAsciiIdentifierPart.test(s(e))}function l(e){return e<128?h[e]:f.NonAsciiIdentifierStart.test(s(e))}function c(e){return e<128?m[e]:f.NonAsciiIdentifierPart.test(s(e))}var f,p,d,h,m,v;for(p={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\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-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\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-\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\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\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-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\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]/, NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\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-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},f={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\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-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\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-\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\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\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\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\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-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},d=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],h=new Array(128),v=0;v<128;++v)h[v]=v>=97&&v<=122||v>=65&&v<=90||36===v||95===v;for(m=new Array(128),v=0;v<128;++v)m[v]=v>=97&&v<=122||v>=65&&v<=90||v>=48&&v<=57||36===v||95===v;e.exports={isDecimalDigit:t,isHexDigit:r,isOctalDigit:n,isWhiteSpace:i,isLineTerminator:a,isIdentifierStartES5:o,isIdentifierPartES5:u,isIdentifierStartES6:l,isIdentifierPartES6:c}}()},function(e,t,r){var n=r(38),i=r(16),a=n(i,"Set");e.exports=a},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new i;++t<r;)this.add(e[t])}var i=r(158),a=r(560),s=r(561);n.prototype.add=n.prototype.push=a,n.prototype.has=s,e.exports=n},function(e,t,r){var n=r(16),i=n.Uint8Array;e.exports=i},function(e,t){function r(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}e.exports=r},function(e,t){function r(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}e.exports=r},function(e,t,r){function n(e,t){var r=s(e),n=!r&&a(e),c=!r&&!n&&o(e),p=!r&&!n&&!c&&l(e),d=r||n||c||p,h=d?i(e.length,String):[],m=h.length;for(var v in e)!t&&!f.call(e,v)||d&&("length"==v||c&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||u(v,m))||h.push(v);return h}var i=r(508),a=r(113),s=r(6),o=r(114),u=r(169),l=r(176),c=Object.prototype,f=c.hasOwnProperty;e.exports=n},function(e,t){function r(e,t,r,n){var i=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}e.exports=r},function(e,t,r){function n(e,t,r){(void 0===r||a(e[t],r))&&(void 0!==r||t in e)||i(e,t,r)}var i=r(161),a=r(45);e.exports=n},function(e,t,r){var n=r(483),i=r(524),a=i(n);e.exports=a},function(e,t,r){var n=r(525),i=n();e.exports=i},function(e,t,r){function n(e,t){t=i(t,e);for(var r=0,n=t.length;null!=e&&r<n;)e=e[a(t[r++])];return r&&r==n?e:void 0}var i=r(255),a=r(109);e.exports=n},function(e,t,r){function n(e,t,r){var n=t(e);return a(e)?n:i(n,r(e))}var i=r(159),a=r(6);e.exports=n},function(e,t,r){function n(e,t,r,o,u){return e===t||(null==e||null==t||!a(e)&&!s(t)?e!==e&&t!==t:i(e,t,r,o,n,u))}var i=r(488),a=r(11),s=r(12);e.exports=n},function(e,t,r){function n(e,t){var r=-1,n=a(e)?Array(e.length):[];return i(e,function(e,i,a){n[++r]=t(e,i,a)}),n}var i=r(248),a=r(26);e.exports=n},function(e,t){function r(e,t){return e.has(t)}e.exports=r},function(e,t,r){function n(e,t){return i(e)?e:a(e,t)?[e]:s(o(e))}var i=r(6),a=r(171),s=r(571),o=r(61);e.exports=n},function(e,t,r){(function(e){function n(e,t){if(t)return e.slice();var r=e.length,n=l?l(r):new e.constructor(r);return e.copy(n),n}var i=r(16),a="object"==typeof t&&t&&!t.nodeType&&t,s=a&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===a,u=o?i.Buffer:void 0,l=u?u.allocUnsafe:void 0;e.exports=n}).call(t,r(39)(e))},function(e,t,r){function n(e,t){var r=t?i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var i=r(165);e.exports=n},function(e,t,r){function n(e){return function(t,r,n){var o=Object(t);if(!a(t)){var u=i(r,3);t=s(t),r=function(e){return u(o[e],e,o)}}var l=e(t,r,n);return l>-1?o[u?t[l]:l]:void 0}}var i=r(58),a=r(26),s=r(27);e.exports=n},function(e,t,r){var n=r(38),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,r){function n(e,t,r,n,l,c){var f=r&o,p=e.length,d=t.length;if(p!=d&&!(f&&d>p))return!1;var h=c.get(e);if(h&&c.get(t))return h==t;var m=-1,v=!0,y=r&u?new i:void 0;for(c.set(e,t),c.set(t,e);++m<p;){var g=e[m],b=t[m];if(n)var E=f?n(b,g,m,t,e,c):n(g,b,m,e,t,c);if(void 0!==E){if(E)continue;v=!1;break}if(y){if(!a(t,function(e,t){if(!s(y,t)&&(g===e||l(g,e,r,n,c)))return y.push(t)})){v=!1;break}}else if(g!==b&&!l(g,b,r,n,c)){v=!1;break}}return c.delete(e),c.delete(t),v}var i=r(241),a=r(475),s=r(254),o=1,u=2;e.exports=n},function(e,t){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(t,function(){return this}())},function(e,t,r){var n=r(159),i=r(167),a=r(168),s=r(279),o=Object.getOwnPropertySymbols,u=o?function(e){for(var t=[];e;)n(t,a(e)),e=i(e);return t}:s;e.exports=u},function(e,t,r){var n=r(467),i=r(157),a=r(469),s=r(240),o=r(470),u=r(15),l=r(270),c="[object Map]",f="[object Object]",p="[object Promise]",d="[object Set]",h="[object WeakMap]",m="[object DataView]",v=l(n),y=l(i),g=l(a),b=l(s),E=l(o),x=u;(n&&x(new n(new ArrayBuffer(1)))!=m||i&&x(new i)!=c||a&&x(a.resolve())!=p||s&&x(new s)!=d||o&&x(new o)!=h)&&(x=function(e){var t=u(e),r=t==f?e.constructor:void 0,n=r?l(r):"";if(n)switch(n){case v:return m;case y:return c;case g:return p;case b:return d;case E:return h}return t}),e.exports=x},function(e,t,r){function n(e,t,r){t=i(t,e);for(var n=-1,c=t.length,f=!1;++n<c;){var p=l(t[n]);if(!(f=null!=e&&r(e,p)))break;e=e[p]}return f||++n!=c?f:(c=null==e?0:e.length,!!c&&u(c)&&o(p,c)&&(s(e)||a(e)))}var i=r(255),a=r(113),s=r(6),o=r(169),u=r(174),l=r(109);e.exports=n},function(e,t,r){function n(e){return"function"!=typeof e.constructor||s(e)?{}:i(a(e))}var i=r(481),a=r(167),s=r(106);e.exports=n},function(e,t,r){function n(e){return e===e&&!i(e)}var i=r(11);e.exports=n},function(e,t){function r(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}e.exports=r},function(e,t){function r(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}e.exports=r},function(e,t,r){(function(e){var n=r(261),i="object"==typeof t&&t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===i,o=s&&n.process,u=function(){try{return o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=u}).call(t,r(39)(e))},function(e,t){function r(e){if(null!=e){try{return i.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,i=n.toString;e.exports=r},function(e,t,r){var n=r(243),i=r(477),a=r(574),s=r(102),o=s(function(e){return e.push(void 0,i),n(a,void 0,e)});e.exports=o},function(e,t,r){function n(e,t){return null!=e&&a(e,t,i)}var i=r(484),a=r(264);e.exports=n},function(e,t,r){function n(e){return e===!0||e===!1||a(e)&&i(e)==s}var i=r(15),a=r(12),s="[object Boolean]";e.exports=n},function(e,t,r){function n(e){return"number"==typeof e||a(e)&&i(e)==s}var i=r(15),a=r(12),s="[object Number]";e.exports=n},function(e,t,r){function n(e){if(!s(e)||i(e)!=o)return!1;var t=a(e);if(null===t)return!0;var r=f.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==p}var i=r(15),a=r(167),s=r(12),o="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,f=l.hasOwnProperty,p=c.call(Object);e.exports=n},function(e,t,r){var n=r(492),i=r(103),a=r(269),s=a&&a.isRegExp,o=s?i(s):n;e.exports=o},function(e,t,r){var n=r(102),i=r(595),a=n(i);e.exports=a},function(e,t,r){function n(e,t,r){return t=(r?a(e,t,r):void 0===t)?1:s(t),i(o(e),t)}var i=r(504),a=r(170),s=r(47),o=r(61);e.exports=n},function(e,t){function r(){return[]}e.exports=r},function(e,t,r){function n(e){return null==e?[]:i(e,a(e))}var i=r(510),a=r(27);e.exports=n},function(e,t){"use strict";function r(e,t,r){if(c)try{c.call(l,e,t,{value:r})}catch(n){e[t]=r}else e[t]=r}function n(e){return e&&(r(e,"call",e.call),r(e,"apply",e.apply)),e}function i(e){return f?f.call(l,e):(m.prototype=e||null,new m)}function a(){do var e=s(h.call(d.call(v(),36),2));while(p.call(y,e));return y[e]=e}function s(e){var t={};return t[e]=!0,Object.keys(t)[0]}function o(e){return i(null)}function u(e){function t(t){function n(r,n){if(r===u)return n?i=null:i||(i=e(t))}var i;r(t,s,n)}function n(e){return p.call(e,s)||t(e),e[s](u)}var s=a(),u=i(null);return e=e||o,n.forget=function(e){p.call(e,s)&&e[s](u,!0)},n}var l=Object,c=Object.defineProperty,f=Object.create;n(c),n(f);var p=n(Object.prototype.hasOwnProperty),d=n(Number.prototype.toString),h=n(String.prototype.slice),m=function(){},v=Math.random,y=i(null);r(t,"makeUniqueKey",a);var g=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function(e){for(var t=g(e),r=0,n=0,i=t.length;r<i;++r)p.call(y,t[r])||(r>n&&(t[n]=t[r]),++n);return t.length=n,t},r(t,"makeAccessor",u)},function(e,t,r){var n;(function(e,i){!function(a){var s="object"==typeof t&&t,o=("object"==typeof e&&e&&e.exports==s&&e,"object"==typeof i&&i);o.global!==o&&o.window!==o||(a=o);var u={rangeOrder:"A range’s `stop` value must be greater than or equal to the `start` value.",codePointRange:"Invalid code point value. Code points range from U+000000 to U+10FFFF."},l=55296,c=56319,f=56320,p=57343,d=/\\x00([^0123456789]|$)/g,h={},m=h.hasOwnProperty,v=function(e,t){var r;for(r in t)m.call(t,r)&&(e[r]=t[r]);return e},y=function(e,t){for(var r=-1,n=e.length;++r<n;)t(e[r],r)},g=h.toString,b=function(e){return"[object Array]"==g.call(e)},E=function(e){return"number"==typeof e||"[object Number]"==g.call(e)},x="0000",A=function(e,t){var r=String(e);return r.length<t?(x+r).slice(-t):r},_=function(e){return Number(e).toString(16).toUpperCase()},D=[].slice,C=function(e){for(var t,r=-1,n=e.length,i=n-1,a=[],s=!0,o=0;++r<n;)if(t=e[r],s)a.push(t),o=t,s=!1;else if(t==o+1){if(r!=i){o=t;continue}s=!0,a.push(t+1)}else a.push(o+1,t),o=t;return s||a.push(t+1),a},S=function(e,t){for(var r,n,i=0,a=e.length;i<a;){if(r=e[i],n=e[i+1],t>=r&&t<n)return t==r?n==r+1?(e.splice(i,2),e):(e[i]=t+1,e):t==n-1?(e[i+1]=t,e):(e.splice(i,2,r,t,t+1,n),e);i+=2}return e},w=function(e,t,r){if(r<t)throw Error(u.rangeOrder);for(var n,i,a=0;a<e.length;){if(n=e[a],i=e[a+1]-1,n>r)return e;if(t<=n&&r>=i)e.splice(a,2);else{if(t>=n&&r<i)return t==n?(e[a]=r+1,e[a+1]=i+1,e):(e.splice(a,2,n,t,r+1,i+1),e);if(t>=n&&t<=i)e[a+1]=t;else if(r>=n&&r<=i)return e[a]=r+1,e;a+=2}}return e},F=function(e,t){var r,n,i=0,a=null,s=e.length;if(t<0||t>1114111)throw RangeError(u.codePointRange);for(;i<s;){if(r=e[i],n=e[i+1],t>=r&&t<n)return e;if(t==r-1)return e[i]=t,e;if(r>t)return e.splice(null!=a?a+2:0,0,t,t+1),e;if(t==n)return t+1==e[i+2]?(e.splice(i,4,r,e[i+3]),e):(e[i+1]=t+1,e);a=i,i+=2}return e.push(t,t+1),e},k=function(e,t){for(var r,n,i=0,a=e.slice(),s=t.length;i<s;)r=t[i],n=t[i+1]-1,a=r==n?F(a,r):T(a,r,n),i+=2;return a},P=function(e,t){for(var r,n,i=0,a=e.slice(),s=t.length;i<s;)r=t[i],n=t[i+1]-1,a=r==n?S(a,r):w(a,r,n),i+=2;return a},T=function(e,t,r){if(r<t)throw Error(u.rangeOrder);if(t<0||t>1114111||r<0||r>1114111)throw RangeError(u.codePointRange);for(var n,i,a=0,s=!1,o=e.length;a<o;){if(n=e[a],i=e[a+1],s){if(n==r+1)return e.splice(a-1,2),e;if(n>r)return e;n>=t&&n<=r&&(i>t&&i-1<=r?(e.splice(a,2),a-=2):(e.splice(a-1,2),a-=2))}else{if(n==r+1)return e[a]=t,e;if(n>r)return e.splice(a,0,t,r+1),e;if(t>=n&&t<i&&r+1<=i)return e;t>=n&&t<i||i==t?(e[a+1]=r+1,s=!0):t<=n&&r+1>=i&&(e[a]=t,e[a+1]=r+1,s=!0)}a+=2}return s||e.push(t,r+1),e},O=function(e,t){var r=0,n=e.length,i=e[r],a=e[n-1];if(n>=2&&(t<i||t>a))return!1;for(;r<n;){if(i=e[r],a=e[r+1],t>=i&&t<a)return!0;r+=2}return!1},B=function(e,t){for(var r,n=0,i=t.length,a=[];n<i;)r=t[n],O(e,r)&&a.push(r),++n;return C(a)},R=function(e){return!e.length},I=function(e){return 2==e.length&&e[0]+1==e[1]},M=function(e){for(var t,r,n=0,i=[],a=e.length;n<a;){for(t=e[n],r=e[n+1];t<r;)i.push(t),++t;n+=2}return i},N=Math.floor,L=function(e){return parseInt(N((e-65536)/1024)+l,10)},j=function(e){return parseInt((e-65536)%1024+f,10)},U=String.fromCharCode,V=function(e){var t;return t=9==e?"\\t":10==e?"\\n":12==e?"\\f":13==e?"\\r":92==e?"\\\\":36==e||e>=40&&e<=43||45==e||46==e||63==e||e>=91&&e<=94||e>=123&&e<=125?"\\"+U(e):e>=32&&e<=126?U(e):e<=255?"\\x"+A(_(e),2):"\\u"+A(_(e),4)},G=function(e){return e<=65535?V(e):"\\u{"+e.toString(16).toUpperCase()+"}"},W=function(e){var t,r=e.length,n=e.charCodeAt(0);return n>=l&&n<=c&&r>1?(t=e.charCodeAt(1),1024*(n-l)+t-f+65536):n},Y=function(e){var t,r,n="",i=0,a=e.length;if(I(e))return V(e[0]);for(;i<a;)t=e[i],r=e[i+1]-1,n+=t==r?V(t):t+1==r?V(t)+V(r):V(t)+"-"+V(r),i+=2;return"["+n+"]"},q=function(e){var t,r,n="",i=0,a=e.length;if(I(e))return G(e[0]);for(;i<a;)t=e[i],r=e[i+1]-1,n+=t==r?G(t):t+1==r?G(t)+G(r):G(t)+"-"+G(r),i+=2;return"["+n+"]"},K=function(e){for(var t,r,n=[],i=[],a=[],s=[],o=0,u=e.length;o<u;)t=e[o],r=e[o+1]-1,t<l?(r<l&&a.push(t,r+1),r>=l&&r<=c&&(a.push(t,l),n.push(l,r+1)),r>=f&&r<=p&&(a.push(t,l),n.push(l,c+1),i.push(f,r+1)),r>p&&(a.push(t,l),n.push(l,c+1),i.push(f,p+1),r<=65535?a.push(p+1,r+1):(a.push(p+1,65536),s.push(65536,r+1)))):t>=l&&t<=c?(r>=l&&r<=c&&n.push(t,r+1),r>=f&&r<=p&&(n.push(t,c+1),i.push(f,r+1)),r>p&&(n.push(t,c+1),i.push(f,p+1),r<=65535?a.push(p+1,r+1):(a.push(p+1,65536),s.push(65536,r+1)))):t>=f&&t<=p?(r>=f&&r<=p&&i.push(t,r+1),r>p&&(i.push(t,p+1),r<=65535?a.push(p+1,r+1):(a.push(p+1,65536),s.push(65536,r+1)))):t>p&&t<=65535?r<=65535?a.push(t,r+1):(a.push(t,65536),s.push(65536,r+1)):s.push(t,r+1),o+=2;return{loneHighSurrogates:n, loneLowSurrogates:i,bmp:a,astral:s}},H=function(e){for(var t,r,n,i,a,s,o=[],u=[],l=!1,c=-1,f=e.length;++c<f;)if(t=e[c],r=e[c+1]){for(n=t[0],i=t[1],a=r[0],s=r[1],u=i;a&&n[0]==a[0]&&n[1]==a[1];)u=I(s)?F(u,s[0]):T(u,s[0],s[1]-1),++c,t=e[c],n=t[0],i=t[1],r=e[c+1],a=r&&r[0],s=r&&r[1],l=!0;o.push([n,l?u:i]),l=!1}else o.push(t);return J(o)},J=function(e){if(1==e.length)return e;for(var t=-1,r=-1;++t<e.length;){var n=e[t],i=n[1],a=i[0],s=i[1];for(r=t;++r<e.length;){var o=e[r],u=o[1],l=u[0],c=u[1];a==l&&s==c&&(I(o[0])?n[0]=F(n[0],o[0][0]):n[0]=T(n[0],o[0][0],o[0][1]-1),e.splice(r,1),--r)}}return e},X=function(e){if(!e.length)return[];for(var t,r,n,i,a,s,o=0,u=[],l=e.length;o<l;){t=e[o],r=e[o+1]-1,n=L(t),i=j(t),a=L(r),s=j(r);var c=i==f,d=s==p,h=!1;n==a||c&&d?(u.push([[n,a+1],[i,s+1]]),h=!0):u.push([[n,n+1],[i,p+1]]),!h&&n+1<a&&(d?(u.push([[n+1,a+1],[f,s+1]]),h=!0):u.push([[n+1,a],[f,p+1]])),h||u.push([[a,a+1],[f,s+1]]),o+=2}return H(u)},z=function(e){var t=[];return y(e,function(e){var r=e[0],n=e[1];t.push(Y(r)+Y(n))}),t.join("|")},$=function(e,t,r){if(r)return q(e);var n=[],i=K(e),a=i.loneHighSurrogates,s=i.loneLowSurrogates,o=i.bmp,u=i.astral,l=!R(a),c=!R(s),f=X(u);return t&&(o=k(o,a),l=!1,o=k(o,s),c=!1),R(o)||n.push(Y(o)),f.length&&n.push(z(f)),l&&n.push(Y(a)+"(?![\\uDC00-\\uDFFF])"),c&&n.push("(?:[^\\uD800-\\uDBFF]|^)"+Y(s)),n.join("|")},Q=function(e){return arguments.length>1&&(e=D.call(arguments)),this instanceof Q?(this.data=[],e?this.add(e):this):(new Q).add(e)};Q.version="1.3.2";var Z=Q.prototype;v(Z,{add:function(e){var t=this;return null==e?t:e instanceof Q?(t.data=k(t.data,e.data),t):(arguments.length>1&&(e=D.call(arguments)),b(e)?(y(e,function(e){t.add(e)}),t):(t.data=F(t.data,E(e)?e:W(e)),t))},remove:function(e){var t=this;return null==e?t:e instanceof Q?(t.data=P(t.data,e.data),t):(arguments.length>1&&(e=D.call(arguments)),b(e)?(y(e,function(e){t.remove(e)}),t):(t.data=S(t.data,E(e)?e:W(e)),t))},addRange:function(e,t){var r=this;return r.data=T(r.data,E(e)?e:W(e),E(t)?t:W(t)),r},removeRange:function(e,t){var r=this,n=E(e)?e:W(e),i=E(t)?t:W(t);return r.data=w(r.data,n,i),r},intersection:function(e){var t=this,r=e instanceof Q?M(e.data):e;return t.data=B(t.data,r),t},contains:function(e){return O(this.data,E(e)?e:W(e))},clone:function(){var e=new Q;return e.data=this.data.slice(0),e},toString:function(e){var t=$(this.data,!!e&&e.bmpOnly,!!e&&e.hasUnicodeFlag);return t?t.replace(d,"\\0$1"):"[]"},toRegExp:function(e){var t=this.toString(e&&e.indexOf("u")!=-1?{hasUnicodeFlag:!0}:null);return RegExp(t,e||"")},valueOf:function(){return M(this.data)}}),Z.toArray=Z.valueOf,n=function(){return Q}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)}).call(t,r(39)(e),function(){return this}())},function(e,t){"use strict";e.exports=function(e){var t=/^\\\\\?\\/.test(e),r=/[^\x00-\x80]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}},function(e,t,r){function n(){this._array=[],this._set=Object.create(null)}var i=r(62),a=Object.prototype.hasOwnProperty;n.fromArray=function(e,t){for(var r=new n,i=0,a=e.length;i<a;i++)r.add(e[i],t);return r},n.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},n.prototype.add=function(e,t){var r=i.toSetString(e),n=a.call(this._set,r),s=this._array.length;n&&!t||this._array.push(e),n||(this._set[r]=s)},n.prototype.has=function(e){var t=i.toSetString(e);return a.call(this._set,t)},n.prototype.indexOf=function(e){var t=i.toSetString(e);if(a.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},n.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},n.prototype.toArray=function(){return this._array.slice()},t.ArraySet=n},function(e,t,r){function n(e){return e<0?(-e<<1)+1:(e<<1)+0}function i(e){var t=1===(1&e),r=e>>1;return t?-r:r}var a=r(613),s=5,o=1<<s,u=o-1,l=o;t.encode=function(e){var t,r="",i=n(e);do t=i&u,i>>>=s,i>0&&(t|=l),r+=a.encode(t);while(i>0);return r},t.decode=function(e,t,r){var n,o,c=e.length,f=0,p=0;do{if(t>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(o=a.decode(e.charCodeAt(t++)),o===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(o&l),o&=u,f+=o<<p,p+=s}while(n);r.value=i(f),r.rest=t}},function(e,t,r){function n(e){e||(e={}),this._file=a.getArg(e,"file",null),this._sourceRoot=a.getArg(e,"sourceRoot",null),this._skipValidation=a.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new o,this._sourcesContents=null}var i=r(285),a=r(62),s=r(284).ArraySet,o=r(615).MappingList;n.prototype._version=3,n.fromSourceMap=function(e){var t=e.sourceRoot,r=new n({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=a.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)}),e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)}),r},n.prototype.addMapping=function(e){var t=a.getArg(e,"generated"),r=a.getArg(e,"original",null),n=a.getArg(e,"source",null),i=a.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,i),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:i})},n.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=a.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[a.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var i=this._sourceRoot;null!=i&&(n=a.relative(i,n));var o=new s,u=new s;this._mappings.unsortedForEach(function(t){if(t.source===n&&null!=t.originalLine){var s=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=s.source&&(t.source=s.source,null!=r&&(t.source=a.join(r,t.source)),null!=i&&(t.source=a.relative(i,t.source)),t.originalLine=s.line,t.originalColumn=s.column,null!=s.name&&(t.name=s.name))}var l=t.source;null==l||o.has(l)||o.add(l);var c=t.name;null==c||u.has(c)||u.add(c)},this),this._sources=o,this._names=u,e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=a.join(r,t)),null!=i&&(t=a.relative(i,t)),this.setSourceContent(t,n))},this)},n.prototype._validateMapping=function(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},n.prototype._serializeMappings=function(){for(var e,t,r,n,s=0,o=1,u=0,l=0,c=0,f=0,p="",d=this._mappings.toArray(),h=0,m=d.length;h<m;h++){if(t=d[h],e="",t.generatedLine!==o)for(s=0;t.generatedLine!==o;)e+=";",o++;else if(h>0){if(!a.compareByGeneratedPositionsInflated(t,d[h-1]))continue;e+=","}e+=i.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=i.encode(n-f),f=n,e+=i.encode(t.originalLine-1-l),l=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=i.encode(r-c),c=r)),p+=e}return p},n.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=a.relative(t,e));var r=a.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},n.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=n},function(e,t,r){t.SourceMapGenerator=r(286).SourceMapGenerator,t.SourceMapConsumer=r(617).SourceMapConsumer,t.SourceNode=r(618).SourceNode},function(e,t,r){(function(e){"use strict";function t(){var e={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};return e.colors.grey=e.colors.gray,Object.keys(e).forEach(function(t){var r=e[t];Object.keys(r).forEach(function(t){var n=r[t];e[t]=r[t]={open:"["+n[0]+"m",close:"["+n[1]+"m"}}),Object.defineProperty(e,t,{value:r,enumerable:!1})}),e}Object.defineProperty(e,"exports",{enumerable:!0,get:t})}).call(t,r(39)(e))},function(e,t,r){e.exports=r(179)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e,t){if(e&&t)return(0,o.default)(e,t,function(e,t){if(t&&Array.isArray(e)){for(var r=t.slice(0),n=e,i=Array.isArray(n),s=0,n=i?n:(0,a.default)(n);;){var o;if(i){if(s>=n.length)break;o=n[s++]}else{if(s=n.next(),s.done)break;o=s.value}var u=o;r.indexOf(u)<0&&r.push(u)}return r}})};var s=r(592),o=n(s);e.exports=t.default},function(e,t,r){"use strict";function n(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.__esModule=!0,t.default=function(e,t,r){if(e){if("Program"===e.type)return a.file(e,t||[],r||[]);if("File"===e.type)return e}throw new Error("Not a valid ast?")};var i=r(1),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(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}function a(e,t){var r=[],n=E.functionExpression(null,[E.identifier("global")],E.blockStatement(r)),i=E.program([E.expressionStatement(E.callExpression(n,[c.get("selfGlobal")]))]);return r.push(E.variableDeclaration("var",[E.variableDeclarator(e,E.assignmentExpression("=",E.memberExpression(E.identifier("global"),e),E.objectExpression([])))])),t(r),i}function s(e,t){var r=[];return r.push(E.variableDeclaration("var",[E.variableDeclarator(e,E.identifier("global"))])),t(r),E.program([x({FACTORY_PARAMETERS:E.identifier("global"),BROWSER_ARGUMENTS:E.assignmentExpression("=",E.memberExpression(E.identifier("root"),e),E.objectExpression([])),COMMON_ARGUMENTS:E.identifier("exports"),AMD_ARGUMENTS:E.arrayExpression([E.stringLiteral("exports")]),FACTORY_BODY:r,UMD_ROOT:E.identifier("this")})])}function o(e,t){var r=[];return r.push(E.variableDeclaration("var",[E.variableDeclarator(e,E.objectExpression([]))])),t(r),r.push(E.expressionStatement(e)),E.program(r)}function u(e,t,r){(0,g.default)(c.list,function(n){if(!(r&&r.indexOf(n)<0)){var i=E.identifier(n);e.push(E.expressionStatement(E.assignmentExpression("=",E.memberExpression(t,i),c.get(n))))}})}t.__esModule=!0,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global",r=E.identifier("babelHelpers"),n=function(t){return u(t,r,e)},i=void 0,l={global:a,umd:s,var:o}[t];if(!l)throw new Error(h.get("unsupportedOutputType",t));return i=l(r,n),(0,p.default)(i).code};var l=r(191),c=i(l),f=r(182),p=n(f),d=r(19),h=i(d),m=r(4),v=n(m),y=r(111),g=n(y),b=r(1),E=i(b),x=(0,v.default)('\n (function (root, factory) {\n if (typeof define === "function" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === "object") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n');e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(64),a=n(i),s=r(596),o=n(s);t.default=new a.default({name:"internal.blockHoist",visitor:{Block:{exit:function(e){for(var t=e.node,r=!1,n=0;n<t.body.length;n++){var i=t.body[n];if(i&&null!=i._blockHoist){r=!0;break}}r&&(t.body=(0,o.default)(t.body,function(e){var t=e&&e._blockHoist;return null==t&&(t=1),t===!0&&(t=2),-1*t}))}}}}),e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return!!e.is("_forceShadow")||t}function s(e,t){var r=e.inShadow(t);if(a(e,r)){var n=e.node._shadowedFunctionLiteral,i=void 0,s=!1,o=e.find(function(t){if(t.parentPath&&t.parentPath.isClassProperty()&&"value"===t.key)return!0;if(e===t)return!1;if((t.isProgram()||t.isFunction())&&(i=i||t),t.isProgram())return s=!0,!0;if(t.isFunction()&&!t.isArrowFunctionExpression()){if(n){if(t===n||t.node===n.node)return!0}else if(!t.is("shadow"))return!0;return s=!0,!1}return!1});if(n&&o.isProgram()&&!n.isProgram()&&(o=e.findParent(function(e){return e.isProgram()||e.isFunction()})),o!==i&&s){var u=o.getData(t);if(u)return e.replaceWith(u);var l=e.scope.generateUidIdentifier(t);o.setData(t,l);var c=o.findParent(function(e){return e.isClass()}),f=!!(c&&c.node&&c.node.superClass);if("this"===t&&o.isMethod({kind:"constructor"})&&f)o.scope.push({id:l}),o.traverse(h,{id:l});else{var d="this"===t?p.thisExpression():p.identifier(t);n&&(d._shadowedFunctionLiteral=n),o.scope.push({id:l,init:d})}return e.replaceWith(l)}}}t.__esModule=!0;var o=r(9),u=i(o),l=r(64),c=i(l),f=r(1),p=n(f),d=(0,u.default)("super this bound"),h={CallExpression:function(e){if(e.get("callee").isSuper()){var t=e.node;t[d]||(t[d]=!0,e.replaceWith(p.assignmentExpression("=",this.id,t)))}}};t.default=new c.default({name:"internal.shadowFunctions",visitor:{ThisExpression:function(e){s(e,"this")},ReferencedIdentifier:function(e){"arguments"===e.node.name&&s(e,"arguments")}}}),e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),a=n(i),s=r(291),o=n(s),u=r(64),l=n(u),c=r(48),f=n(c),p=function(){function e(){(0,a.default)(this,e)}return e.prototype.lint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.code=!1,t.mode="lint",this.transform(e,t)},e.prototype.pretransform=function(e,t){var r=new f.default(t,this);return r.wrap(e,function(){return r.addCode(e),r.parseCode(e),r})},e.prototype.transform=function(e,t){var r=new f.default(t,this);return r.wrap(e,function(){return r.addCode(e),r.parseCode(e),r.transform()})},e.prototype.analyse=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];return t.code=!1,r&&(t.plugins=t.plugins||[],t.plugins.push(new l.default({visitor:r}))),this.transform(e,t).metadata},e.prototype.transformFromAst=function(e,t,r){e=(0,o.default)(e);var n=new f.default(r,this);return n.wrap(t,function(){return n.addCode(t),n.addAst(e),n.transform()})},e}();t.default=p,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),a=n(i),s=r(42),o=n(s),u=r(41),l=n(u),c=r(119),f=n(c),p=r(48),d=(n(p),function(e){function t(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,a.default)(this,t);var s=(0,o.default)(this,e.call(this));return s.plugin=n,s.key=n.key,s.file=r,s.opts=i,s}return(0,l.default)(t,e),t.prototype.addHelper=function(){var e;return(e=this.file).addHelper.apply(e,arguments)},t.prototype.addImport=function(){var e;return(e=this.file).addImport.apply(e,arguments)},t.prototype.getModuleName=function(){var e;return(e=this.file).getModuleName.apply(e,arguments)},t.prototype.buildCodeFrameError=function(){var e;return(e=this.file).buildCodeFrameError.apply(e,arguments)},t}(f.default));t.default=d,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),a=n(i),s=r(602),o=n(s),u=/^[ \t]+$/,l=function(){function e(t){(0,a.default)(this,e),this._map=null,this._buf=[],this._last="",this._queue=[],this._position={line:1,column:0},this._sourcePosition={identifierName:null,line:null,column:null,filename:null},this._map=t}return e.prototype.get=function(){return this._flush(),{code:(0,o.default)(this._buf.join("")),map:this._map?this._map.get():null}},e.prototype.append=function(e){this._flush();var t=this._sourcePosition,r=t.line,n=t.column,i=t.filename,a=t.identifierName;this._append(e,r,n,a,i)},e.prototype.queue=function(e){if("\n"===e)for(;this._queue.length>0&&u.test(this._queue[0][0]);)this._queue.shift();var t=this._sourcePosition,r=t.line,n=t.column,i=t.filename,a=t.identifierName;this._queue.unshift([e,r,n,a,i])},e.prototype._flush=function(){for(var e=void 0;e=this._queue.pop();)this._append.apply(this,e)},e.prototype._append=function(e,t,r,n,i){this._map&&"\n"!==e[0]&&this._map.mark(this._position.line,this._position.column,t,r,n,i),this._buf.push(e),this._last=e[e.length-1];for(var a=0;a<e.length;a++)"\n"===e[a]?(this._position.line++,this._position.column=0):this._position.column++},e.prototype.removeTrailingNewline=function(){this._queue.length>0&&"\n"===this._queue[0][0]&&this._queue.shift()},e.prototype.removeLastSemicolon=function(){this._queue.length>0&&";"===this._queue[0][0]&&this._queue.shift()},e.prototype.endsWith=function(e){if(1===e.length){var t=void 0;if(this._queue.length>0){var r=this._queue[0][0];t=r[r.length-1]}else t=this._last;return t===e}var n=this._last+this._queue.reduce(function(e,t){return t[0]+e},"");return e.length<=n.length&&n.slice(-e.length)===e},e.prototype.hasContent=function(){return this._queue.length>0||!!this._last},e.prototype.source=function(e,t){if(!e||t){var r=t?t[e]:null;this._sourcePosition.identifierName=t&&t.identifierName||null,this._sourcePosition.line=r?r.line:null,this._sourcePosition.column=r?r.column:null,this._sourcePosition.filename=t&&t.filename||null}},e.prototype.withSource=function(e,t,r){if(!this._map)return r();var n=this._sourcePosition.line,i=this._sourcePosition.column,a=this._sourcePosition.filename,s=this._sourcePosition.identifierName;this.source(e,t),r(),this._sourcePosition.line=n,this._sourcePosition.column=i,this._sourcePosition.filename=a,this._sourcePosition.identifierName=s},e.prototype.getCurrentColumn=function(){var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=e.lastIndexOf("\n");return t===-1?this._position.column+e.length:e.length-1-t},e.prototype.getCurrentLine=function(){for(var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=0,r=0;r<e.length;r++)"\n"===e[r]&&t++;return this._position.line+t},e}();t.default=l,e.exports=t.default},function(e,t,r){"use strict";function n(e){this.print(e.program,e)}function i(e){this.printInnerComments(e,!1),this.printSequence(e.directives,e),e.directives&&e.directives.length&&this.newline(),this.printSequence(e.body,e)}function a(e){this.token("{"),this.printInnerComments(e),e.body.length?(this.newline(),this.printSequence(e.directives,e,{indent:!0}),e.directives&&e.directives.length&&this.newline(),this.printSequence(e.body,e,{indent:!0}),this.removeTrailingNewline(),this.source("end",e.loc),this.endsWith("\n")||this.newline(),this.rightBrace()):(this.source("end",e.loc),this.token("}"))}function s(){}function o(e){this.print(e.value,e),this.semicolon()}t.__esModule=!0,t.File=n,t.Program=i,t.BlockStatement=a,t.Noop=s,t.Directive=o;var u=r(123);Object.defineProperty(t,"DirectiveLiteral",{enumerable:!0,get:function(){return u.StringLiteral}})},function(e,t){"use strict";function r(e){this.printJoin(e.decorators,e),this.word("class"),e.id&&(this.space(),this.print(e.id,e)),this.print(e.typeParameters,e),e.superClass&&(this.space(),this.word("extends"),this.space(),this.print(e.superClass,e),this.print(e.superTypeParameters,e)),e.implements&&(this.space(),this.word("implements"),this.space(),this.printList(e.implements,e)),this.space(),this.print(e.body,e)}function n(e){this.token("{"),this.printInnerComments(e),0===e.body.length?this.token("}"):(this.newline(),this.indent(),this.printSequence(e.body,e),this.dedent(),this.endsWith("\n")||this.newline(),this.rightBrace())}function i(e){this.printJoin(e.decorators,e),e.static&&(this.word("static"),this.space()),e.computed?(this.token("["),this.print(e.key,e),this.token("]")):(this._variance(e),this.print(e.key,e)),this.print(e.typeAnnotation,e),e.value&&(this.space(),this.token("="),this.space(),this.print(e.value,e)),this.semicolon()}function a(e){this.printJoin(e.decorators,e),e.static&&(this.word("static"),this.space()),"constructorCall"===e.kind&&(this.word("call"),this.space()),this._method(e)}t.__esModule=!0,t.ClassDeclaration=r,t.ClassBody=n,t.ClassProperty=i,t.ClassMethod=a,t.ClassExpression=r},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){"void"===e.operator||"delete"===e.operator||"typeof"===e.operator?(this.word(e.operator),this.space()):this.token(e.operator),this.print(e.argument,e)}function s(e){this.word("do"),this.space(),this.print(e.body,e)}function o(e){this.token("("),this.print(e.expression,e),this.token(")")}function u(e){e.prefix?(this.token(e.operator),this.print(e.argument,e)):(this.print(e.argument,e),this.token(e.operator))}function l(e){this.print(e.test,e),this.space(),this.token("?"),this.space(),this.print(e.consequent,e),this.space(),this.token(":"),this.space(),this.print(e.alternate,e)}function c(e,t){this.word("new"),this.space(),this.print(e.callee,e),(0!==e.arguments.length||!this.format.minified||F.isCallExpression(t,{callee:e})||F.isMemberExpression(t)||F.isNewExpression(t))&&(this.token("("),this.printList(e.arguments,e),this.token(")"))}function f(e){this.printList(e.expressions,e)}function p(){this.word("this")}function d(){this.word("super")}function h(e){this.token("@"),this.print(e.expression,e),this.newline()}function m(){this.token(","),this.newline(),this.endsWith("\n")||this.space()}function v(e){this.print(e.callee,e),this.token("(");var t=e._prettyCall,r=void 0;t&&(r=m,this.newline(),this.indent()),this.printList(e.arguments,e,{separator:r}),t&&(this.newline(),this.dedent()),this.token(")")}function y(e){return function(t){if(this.word(e),t.delegate&&this.token("*"),t.argument){this.space();var r=this.startTerminatorless();this.print(t.argument,t),this.endTerminatorless(r)}}}function g(){this.semicolon(!0)}function b(e){this.print(e.expression,e),this.semicolon()}function E(e){this.print(e.left,e),this.space(),this.token("="),this.space(),this.print(e.right,e)}function x(e,t){var r=this.inForStatementInitCounter&&"in"===e.operator&&!P.needsParens(e,t);r&&this.token("("),this.print(e.left,e),this.space(),"in"===e.operator||"instanceof"===e.operator?this.word(e.operator):this.token(e.operator),this.space(),this.print(e.right,e),r&&this.token(")")}function A(e){this.print(e.object,e),this.token("::"),this.print(e.callee,e)}function _(e){if(this.print(e.object,e),!e.computed&&F.isMemberExpression(e.property))throw new TypeError("Got a MemberExpression for MemberExpression property");var t=e.computed;F.isLiteral(e.property)&&(0,S.default)(e.property.value)&&(t=!0),t?(this.token("["),this.print(e.property,e),this.token("]")):(this.token("."),this.print(e.property,e))}function D(e){this.print(e.meta,e),this.token("."),this.print(e.property,e)}t.__esModule=!0,t.LogicalExpression=t.BinaryExpression=t.AwaitExpression=t.YieldExpression=void 0,t.UnaryExpression=a,t.DoExpression=s,t.ParenthesizedExpression=o,t.UpdateExpression=u,t.ConditionalExpression=l,t.NewExpression=c,t.SequenceExpression=f,t.ThisExpression=p,t.Super=d,t.Decorator=h,t.CallExpression=v,t.EmptyStatement=g,t.ExpressionStatement=b,t.AssignmentPattern=E,t.AssignmentExpression=x,t.BindExpression=A,t.MemberExpression=_,t.MetaProperty=D;var C=r(274),S=i(C),w=r(1),F=n(w),k=r(183),P=n(k);t.YieldExpression=y("yield"),t.AwaitExpression=y("await");t.BinaryExpression=x,t.LogicalExpression=x},function(e,t,r){"use strict";function n(){this.word("any")}function i(e){this.print(e.elementType,e),this.token("["),this.token("]")}function a(){this.word("boolean")}function s(e){this.word(e.value?"true":"false")}function o(){this.word("null")}function u(e){this.word("declare"),this.space(),this.word("class"),this.space(),this._interfaceish(e)}function l(e){this.word("declare"),this.space(),this.word("function"),this.space(),this.print(e.id,e),this.print(e.id.typeAnnotation.typeAnnotation,e),this.semicolon()}function c(e){this.word("declare"),this.space(),this.InterfaceDeclaration(e)}function f(e){this.word("declare"),this.space(),this.word("module"),this.space(),this.print(e.id,e),this.space(),this.print(e.body,e)}function p(e){this.word("declare"),this.space(),this.word("module"),this.token("."),this.word("exports"),this.print(e.typeAnnotation,e)}function d(e){this.word("declare"),this.space(),this.TypeAlias(e)}function h(e){this.word("declare"),this.space(),this.word("var"),this.space(),this.print(e.id,e),this.print(e.id.typeAnnotation,e),this.semicolon()}function m(){this.token("*")}function v(e,t){this.print(e.typeParameters,e),this.token("("),this.printList(e.params,e),e.rest&&(e.params.length&&(this.token(","),this.space()),this.token("..."),this.print(e.rest,e)),this.token(")"),"ObjectTypeCallProperty"===t.type||"DeclareFunction"===t.type?this.token(":"):(this.space(),this.token("=>")),this.space(),this.print(e.returnType,e)}function y(e){this.print(e.name,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.typeAnnotation,e)}function g(e){this.print(e.id,e),this.print(e.typeParameters,e)}function b(e){this.print(e.id,e),this.print(e.typeParameters,e),e.extends.length&&(this.space(),this.word("extends"),this.space(),this.printList(e.extends,e)),e.mixins&&e.mixins.length&&(this.space(),this.word("mixins"),this.space(),this.printList(e.mixins,e)),this.space(),this.print(e.body,e)}function E(e){"plus"===e.variance?this.token("+"):"minus"===e.variance&&this.token("-")}function x(e){this.word("interface"),this.space(),this._interfaceish(e)}function A(){this.space(),this.token("&"),this.space()}function _(e){this.printJoin(e.types,e,{separator:A})}function D(){this.word("mixed")}function C(){this.word("empty")}function S(e){this.token("?"),this.print(e.typeAnnotation,e)}function w(){this.word("number")}function F(){this.word("string")}function k(){this.word("this")}function P(e){this.token("["),this.printList(e.types,e),this.token("]")}function T(e){this.word("typeof"),this.space(),this.print(e.argument,e)}function O(e){this.word("type"),this.space(),this.print(e.id,e),this.print(e.typeParameters,e),this.space(),this.token("="),this.space(),this.print(e.right,e),this.semicolon()}function B(e){this.token(":"),this.space(),e.optional&&this.token("?"),this.print(e.typeAnnotation,e)}function R(e){this._variance(e),this.word(e.name),e.bound&&this.print(e.bound,e),e.default&&(this.space(),this.token("="),this.space(),this.print(e.default,e))}function I(e){this.token("<"),this.printList(e.params,e,{}),this.token(">")}function M(e){var t=this;e.exact?this.token("{|"):this.token("{");var r=e.properties.concat(e.callProperties,e.indexers);r.length&&(this.space(),this.printJoin(r,e,{indent:!0,statement:!0,iterator:function(){1!==r.length&&(t.format.flowCommaSeparator?t.token(","):t.semicolon(),t.space())}}),this.space()),e.exact?this.token("|}"):this.token("}")}function N(e){e.static&&(this.word("static"),this.space()),this.print(e.value,e)}function L(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.token("["),this.print(e.id,e),this.token(":"),this.space(),this.print(e.key,e),this.token("]"),this.token(":"),this.space(),this.print(e.value,e)}function j(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.print(e.key,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.value,e)}function U(e){this.print(e.qualification,e),this.token("."),this.print(e.id,e)}function V(){this.space(),this.token("|"),this.space()}function G(e){this.printJoin(e.types,e,{separator:V})}function W(e){this.token("("),this.print(e.expression,e),this.print(e.typeAnnotation,e),this.token(")")}function Y(){this.word("void")}t.__esModule=!0,t.AnyTypeAnnotation=n,t.ArrayTypeAnnotation=i,t.BooleanTypeAnnotation=a,t.BooleanLiteralTypeAnnotation=s,t.NullLiteralTypeAnnotation=o,t.DeclareClass=u,t.DeclareFunction=l,t.DeclareInterface=c,t.DeclareModule=f,t.DeclareModuleExports=p,t.DeclareTypeAlias=d,t.DeclareVariable=h,t.ExistentialTypeParam=m,t.FunctionTypeAnnotation=v,t.FunctionTypeParam=y,t.InterfaceExtends=g,t._interfaceish=b,t._variance=E,t.InterfaceDeclaration=x,t.IntersectionTypeAnnotation=_,t.MixedTypeAnnotation=D,t.EmptyTypeAnnotation=C,t.NullableTypeAnnotation=S;var q=r(123);Object.defineProperty(t,"NumericLiteralTypeAnnotation",{enumerable:!0,get:function(){return q.NumericLiteral}}),Object.defineProperty(t,"StringLiteralTypeAnnotation",{enumerable:!0,get:function(){return q.StringLiteral}}),t.NumberTypeAnnotation=w,t.StringTypeAnnotation=F,t.ThisTypeAnnotation=k,t.TupleTypeAnnotation=P,t.TypeofTypeAnnotation=T,t.TypeAlias=O,t.TypeAnnotation=B,t.TypeParameter=R,t.TypeParameterInstantiation=I,t.ObjectTypeAnnotation=M,t.ObjectTypeCallProperty=N,t.ObjectTypeIndexer=L,t.ObjectTypeProperty=j,t.QualifiedTypeIdentifier=U,t.UnionTypeAnnotation=G,t.TypeCastExpression=W,t.VoidTypeAnnotation=Y,t.ClassImplements=g,t.GenericTypeAnnotation=g,t.TypeParameterDeclaration=I},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){this.print(e.name,e),e.value&&(this.token("="),this.print(e.value,e))}function a(e){this.word(e.name)}function s(e){this.print(e.namespace,e),this.token(":"),this.print(e.name,e)}function o(e){this.print(e.object,e),this.token("."),this.print(e.property,e)}function u(e){this.token("{"),this.token("..."),this.print(e.argument,e),this.token("}")}function l(e){this.token("{"),this.print(e.expression,e),this.token("}")}function c(e){this.token(e.value)}function f(e){var t=e.openingElement;if(this.print(t,e),!t.selfClosing){this.indent();for(var r=e.children,n=Array.isArray(r),i=0,r=n?r:(0,y.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a;this.print(s,e)}this.dedent(),this.print(e.closingElement,e)}}function p(){this.space()}function d(e){this.token("<"),this.print(e.name,e),e.attributes.length>0&&(this.space(),this.printJoin(e.attributes,e,{separator:p})),e.selfClosing?(this.space(),this.token("/>")):this.token(">")}function h(e){this.token("</"),this.print(e.name,e),this.token(">")}function m(){}t.__esModule=!0;var v=r(2),y=n(v);t.JSXAttribute=i,t.JSXIdentifier=a,t.JSXNamespacedName=s,t.JSXMemberExpression=o,t.JSXSpreadAttribute=u,t.JSXExpressionContainer=l,t.JSXText=c,t.JSXElement=f,t.JSXOpeningElement=d,t.JSXClosingElement=h,t.JSXEmptyExpression=m},function(e,t,r){"use strict";function n(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}function i(e){var t=this;this.print(e.typeParameters,e),this.token("("),this.printList(e.params,e,{ iterator:function(e){e.optional&&t.token("?"),t.print(e.typeAnnotation,e)}}),this.token(")"),e.returnType&&this.print(e.returnType,e)}function a(e){var t=e.kind,r=e.key;"method"!==t&&"init"!==t||e.generator&&this.token("*"),"get"!==t&&"set"!==t||(this.word(t),this.space()),e.async&&(this.word("async"),this.space()),e.computed?(this.token("["),this.print(r,e),this.token("]")):this.print(r,e),this._params(e),this.space(),this.print(e.body,e)}function s(e){e.async&&(this.word("async"),this.space()),this.word("function"),e.generator&&this.token("*"),e.id?(this.space(),this.print(e.id,e)):this.space(),this._params(e),this.space(),this.print(e.body,e)}function o(e){e.async&&(this.word("async"),this.space());var t=e.params[0];1===e.params.length&&c.isIdentifier(t)&&!u(e,t)?this.print(t,e):this._params(e),this.space(),this.token("=>"),this.space(),this.print(e.body,e)}function u(e,t){return e.typeParameters||e.returnType||t.typeAnnotation||t.optional||t.trailingComments}t.__esModule=!0,t.FunctionDeclaration=void 0,t._params=i,t._method=a,t.FunctionExpression=s,t.ArrowFunctionExpression=o;var l=r(1),c=n(l);t.FunctionDeclaration=s},function(e,t,r){"use strict";function n(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}function i(e){this.print(e.imported,e),e.local&&e.local.name!==e.imported.name&&(this.space(),this.word("as"),this.space(),this.print(e.local,e))}function a(e){this.print(e.local,e)}function s(e){this.print(e.exported,e)}function o(e){this.print(e.local,e),e.exported&&e.local.name!==e.exported.name&&(this.space(),this.word("as"),this.space(),this.print(e.exported,e))}function u(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.exported,e)}function l(e){this.word("export"),this.space(),this.token("*"),e.exported&&(this.space(),this.word("as"),this.space(),this.print(e.exported,e)),this.space(),this.word("from"),this.space(),this.print(e.source,e),this.semicolon()}function c(){this.word("export"),this.space(),p.apply(this,arguments)}function f(){this.word("export"),this.space(),this.word("default"),this.space(),p.apply(this,arguments)}function p(e){if(e.declaration){var t=e.declaration;this.print(t,e),v.isStatement(t)||this.semicolon()}else{"type"===e.exportKind&&(this.word("type"),this.space());for(var r=e.specifiers.slice(0),n=!1;;){var i=r[0];if(!v.isExportDefaultSpecifier(i)&&!v.isExportNamespaceSpecifier(i))break;n=!0,this.print(r.shift(),e),r.length&&(this.token(","),this.space())}(r.length||!r.length&&!n)&&(this.token("{"),r.length&&(this.space(),this.printList(r,e),this.space()),this.token("}")),e.source&&(this.space(),this.word("from"),this.space(),this.print(e.source,e)),this.semicolon()}}function d(e){this.word("import"),this.space(),"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space());var t=e.specifiers.slice(0);if(t&&t.length){for(;;){var r=t[0];if(!v.isImportDefaultSpecifier(r)&&!v.isImportNamespaceSpecifier(r))break;this.print(t.shift(),e),t.length&&(this.token(","),this.space())}t.length&&(this.token("{"),this.space(),this.printList(t,e),this.space(),this.token("}")),this.space(),this.word("from"),this.space()}this.print(e.source,e),this.semicolon()}function h(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.local,e)}t.__esModule=!0,t.ImportSpecifier=i,t.ImportDefaultSpecifier=a,t.ExportDefaultSpecifier=s,t.ExportSpecifier=o,t.ExportNamespaceSpecifier=u,t.ExportAllDeclaration=l,t.ExportNamedDeclaration=c,t.ExportDefaultDeclaration=f,t.ImportDeclaration=d,t.ImportNamespaceSpecifier=h;var m=r(1),v=n(m)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){this.word("with"),this.space(),this.token("("),this.print(e.object,e),this.token(")"),this.printBlock(e)}function s(e){this.word("if"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.space();var t=e.alternate&&C.isIfStatement(o(e.consequent));t&&(this.token("{"),this.newline(),this.indent()),this.printAndIndentOnComments(e.consequent,e),t&&(this.dedent(),this.newline(),this.token("}")),e.alternate&&(this.endsWith("}")&&this.space(),this.word("else"),this.space(),this.printAndIndentOnComments(e.alternate,e))}function o(e){return C.isStatement(e.body)?o(e.body):e}function u(e){this.word("for"),this.space(),this.token("("),this.inForStatementInitCounter++,this.print(e.init,e),this.inForStatementInitCounter--,this.token(";"),e.test&&(this.space(),this.print(e.test,e)),this.token(";"),e.update&&(this.space(),this.print(e.update,e)),this.token(")"),this.printBlock(e)}function l(e){this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.printBlock(e)}function c(e){this.word("do"),this.space(),this.print(e.body,e),this.space(),this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.semicolon()}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";return function(r){this.word(e);var n=r[t];if(n){this.space();var i=this.startTerminatorless();this.print(n,r),this.endTerminatorless(i)}this.semicolon()}}function p(e){this.print(e.label,e),this.token(":"),this.space(),this.print(e.body,e)}function d(e){this.word("try"),this.space(),this.print(e.block,e),this.space(),e.handlers?this.print(e.handlers[0],e):this.print(e.handler,e),e.finalizer&&(this.space(),this.word("finally"),this.space(),this.print(e.finalizer,e))}function h(e){this.word("catch"),this.space(),this.token("("),this.print(e.param,e),this.token(")"),this.space(),this.print(e.body,e)}function m(e){this.word("switch"),this.space(),this.token("("),this.print(e.discriminant,e),this.token(")"),this.space(),this.token("{"),this.printSequence(e.cases,e,{indent:!0,addNewlines:function(t,r){if(!t&&e.cases[e.cases.length-1]===r)return-1}}),this.token("}")}function v(e){e.test?(this.word("case"),this.space(),this.print(e.test,e),this.token(":")):(this.word("default"),this.token(":")),e.consequent.length&&(this.newline(),this.printSequence(e.consequent,e,{indent:!0}))}function y(){this.word("debugger"),this.semicolon()}function g(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<4;e++)this.space(!0)}function b(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<6;e++)this.space(!0)}function E(e,t){this.word(e.kind),this.space();var r=!1;if(!C.isFor(t))for(var n=e.declarations,i=Array.isArray(n),a=0,n=i?n:(0,_.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;o.init&&(r=!0)}var u=void 0;r&&(u="const"===e.kind?b:g),this.printList(e.declarations,e,{separator:u}),(!C.isFor(t)||t.left!==e&&t.init!==e)&&this.semicolon()}function x(e){this.print(e.id,e),this.print(e.id.typeAnnotation,e),e.init&&(this.space(),this.token("="),this.space(),this.print(e.init,e))}t.__esModule=!0,t.ThrowStatement=t.BreakStatement=t.ReturnStatement=t.ContinueStatement=t.ForAwaitStatement=t.ForOfStatement=t.ForInStatement=void 0;var A=r(2),_=i(A);t.WithStatement=a,t.IfStatement=s,t.ForStatement=u,t.WhileStatement=l,t.DoWhileStatement=c,t.LabeledStatement=p,t.TryStatement=d,t.CatchClause=h,t.SwitchStatement=m,t.SwitchCase=v,t.DebuggerStatement=y,t.VariableDeclaration=E,t.VariableDeclarator=x;var D=r(1),C=n(D),S=function(e){return function(t){this.word("for"),this.space(),"await"===e&&(this.word("await"),this.space(),e="of"),this.token("("),this.print(t.left,t),this.space(),this.word(e),this.space(),this.print(t.right,t),this.token(")"),this.printBlock(t)}};t.ForInStatement=S("in"),t.ForOfStatement=S("of"),t.ForAwaitStatement=S("await"),t.ContinueStatement=f("continue"),t.ReturnStatement=f("return","argument"),t.BreakStatement=f("break"),t.ThrowStatement=f("throw","argument")},function(e,t){"use strict";function r(e){this.print(e.tag,e),this.print(e.quasi,e)}function n(e,t){var r=t.quasis[0]===e,n=t.quasis[t.quasis.length-1]===e,i=(r?"`":"}")+e.value.raw+(n?"`":"${");r||this.space(),this.token(i),n||this.space()}function i(e){for(var t=e.quasis,r=0;r<t.length;r++)this.print(t[r],e),r+1<t.length&&this.print(e.expressions[r],e)}t.__esModule=!0,t.TaggedTemplateExpression=r,t.TemplateElement=n,t.TemplateLiteral=i},function(e,t,r){"use strict";function n(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}function i(e,t){return b.isArrayTypeAnnotation(t)}function a(e,t){return!(!b.isMemberExpression(t)||t.object!==e)}function s(e,t,r){return y(r,{considerArrow:!0})}function o(e,t){if((b.isCallExpression(t)||b.isNewExpression(t))&&t.callee===e)return!0;if(b.isUnaryLike(t))return!0;if(b.isMemberExpression(t)&&t.object===e)return!0;if(b.isBinary(t)){var r=t.operator,n=E[r],i=e.operator,a=E[i];if(n>a)return!0;if(n===a&&t.right===e&&!b.isLogicalExpression(t))return!0}return!1}function u(e,t){if("in"===e.operator){if(b.isVariableDeclarator(t))return!0;if(b.isFor(t))return!0}return!1}function l(e,t){return!b.isForStatement(t)&&((!b.isExpressionStatement(t)||t.expression!==e)&&(!b.isReturnStatement(t)&&(!b.isThrowStatement(t)&&((!b.isSwitchStatement(t)||t.discriminant!==e)&&((!b.isWhileStatement(t)||t.test!==e)&&((!b.isIfStatement(t)||t.test!==e)&&(!b.isForInStatement(t)||t.right!==e)))))))}function c(e,t){return b.isBinary(t)||b.isUnaryLike(t)||b.isCallExpression(t)||b.isMemberExpression(t)||b.isNewExpression(t)||b.isConditionalExpression(t)&&e===t.test}function f(e,t,r){return y(r,{considerDefaultExports:!0})}function p(e,t){return!!b.isMemberExpression(t,{object:e})||!(!b.isCallExpression(t,{callee:e})&&!b.isNewExpression(t,{callee:e}))}function d(e,t,r){return y(r,{considerDefaultExports:!0})}function h(e,t){return!!b.isExportDeclaration(t)||(!(!b.isBinaryExpression(t)&&!b.isLogicalExpression(t))||(!!b.isUnaryExpression(t)||p(e,t)))}function m(e,t){return!!b.isUnaryLike(t)||(!!b.isBinary(t)||(!!b.isConditionalExpression(t,{test:e})||p(e,t)))}function v(e){return!!b.isObjectPattern(e.left)||m.apply(void 0,arguments)}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.considerArrow,n=void 0!==r&&r,i=t.considerDefaultExports,a=void 0!==i&&i,s=e.length-1,o=e[s];s--;for(var u=e[s];s>0;){if(b.isExpressionStatement(u,{expression:o}))return!0;if(a&&b.isExportDefaultDeclaration(u,{declaration:o}))return!0;if(n&&b.isArrowFunctionExpression(u,{body:o}))return!0;if(!(b.isCallExpression(u,{callee:o})||b.isSequenceExpression(u)&&u.expressions[0]===o||b.isMemberExpression(u,{object:o})||b.isConditional(u,{test:o})||b.isBinary(u,{left:o})||b.isAssignmentExpression(u,{left:o})))return!1;o=u,s--,u=e[s]}return!1}t.__esModule=!0,t.AwaitExpression=t.FunctionTypeAnnotation=void 0,t.NullableTypeAnnotation=i,t.UpdateExpression=a,t.ObjectExpression=s,t.Binary=o,t.BinaryExpression=u,t.SequenceExpression=l,t.YieldExpression=c,t.ClassExpression=f,t.UnaryLike=p,t.FunctionExpression=d,t.ArrowFunctionExpression=h,t.ConditionalExpression=m,t.AssignmentExpression=v;var g=r(1),b=n(g),E={"||":0,"&&":1,"|":2,"^":3,"&":4,"==":5,"===":5,"!=":5,"!==":5,"<":6,">":6,"<=":6,">=":6,in:6,instanceof:6,">>":7,"<<":7,">>>":7,"+":8,"-":8,"*":9,"/":9,"%":9,"**":10};t.FunctionTypeAnnotation=i,t.AwaitExpression=c},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m.isMemberExpression(e)?(a(e.object,t),e.computed&&a(e.property,t)):m.isBinary(e)||m.isAssignmentExpression(e)?(a(e.left,t),a(e.right,t)):m.isCallExpression(e)?(t.hasCall=!0,a(e.callee,t)):m.isFunction(e)?t.hasFunction=!0:m.isIdentifier(e)&&(t.hasHelper=t.hasHelper||s(e.callee)),t}function s(e){return m.isMemberExpression(e)?s(e.object)||s(e.property):m.isIdentifier(e)?"require"===e.name||"_"===e.name[0]:m.isCallExpression(e)?s(e.callee):!(!m.isBinary(e)&&!m.isAssignmentExpression(e))&&(m.isIdentifier(e.left)&&s(e.left)||s(e.right))}function o(e){return m.isLiteral(e)||m.isObjectExpression(e)||m.isArrayExpression(e)||m.isIdentifier(e)||m.isMemberExpression(e)}var u=r(273),l=i(u),c=r(111),f=i(c),p=r(590),d=i(p),h=r(1),m=n(h);t.nodes={AssignmentExpression:function(e){var t=a(e.right);if(t.hasCall&&t.hasHelper||t.hasFunction)return{before:t.hasFunction,after:!0}},SwitchCase:function(e,t){return{before:e.consequent.length||t.cases[0]===e}},LogicalExpression:function(e){if(m.isFunction(e.left)||m.isFunction(e.right))return{after:!0}},Literal:function(e){if("use strict"===e.value)return{after:!0}},CallExpression:function(e){if(m.isFunction(e.callee)||s(e))return{before:!0,after:!0}},VariableDeclaration:function(e){for(var t=0;t<e.declarations.length;t++){var r=e.declarations[t],n=s(r.id)&&!o(r.init);if(!n){var i=a(r.init);n=s(r.init)&&i.hasCall||i.hasFunction}if(n)return{before:!0,after:!0}}},IfStatement:function(e){if(m.isBlockStatement(e.consequent))return{before:!0,after:!0}}},t.nodes.ObjectProperty=t.nodes.ObjectTypeProperty=t.nodes.ObjectMethod=t.nodes.SpreadProperty=function(e,t){if(t.properties[0]===e)return{before:!0}},t.list={VariableDeclaration:function(e){return(0,d.default)(e.declarations,"init")},ArrayExpression:function(e){return e.elements},ObjectExpression:function(e){return e.properties}},(0,f.default)({Function:!0,Class:!0,Loop:!0,LabeledStatement:!0,SwitchStatement:!0,TryStatement:!0},function(e,r){(0,l.default)(e)&&(e={after:e,before:e}),(0,f.default)([r].concat(m.FLIPPED_ALIAS_KEYS[r]||[]),function(r){t.nodes[r]=function(){return e}})})},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(){this.token(","),this.space()}t.__esModule=!0;var s=r(87),o=i(s),u=r(2),l=i(u),c=r(34),f=i(c),p=r(363),d=i(p),h=r(3),m=i(h),v=r(581),y=i(v),g=r(583),b=i(g),E=r(589),x=i(E),A=r(278),_=i(A),D=r(297),C=i(D),S=r(183),w=n(S),F=r(311),k=i(F),P=r(1),T=n(P),O=/e/i,B=/\.0+$/,R=/^0[box]/,I=function(){function e(t,r,n){(0,m.default)(this,e),this.inForStatementInitCounter=0,this._printStack=[],this._indent=0,this._insideAux=!1,this._printedCommentStarts={},this._parenPushNewlineState=null,this._printAuxAfterOnNextUserNode=!1,this._printedComments=new d.default,this._endsWithInteger=!1,this._endsWithWord=!1,this.format=t||{},this._buf=new C.default(r),this._whitespace=n.length>0?new k.default(n):null}return e.prototype.generate=function(e){return this.print(e),this._maybeAddAuxComment(),this._buf.get()},e.prototype.indent=function(){this.format.compact||this.format.concise||this._indent++},e.prototype.dedent=function(){this.format.compact||this.format.concise||this._indent--},e.prototype.semicolon=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._maybeAddAuxComment(),this._append(";",!e)},e.prototype.rightBrace=function(){this.format.minified&&this._buf.removeLastSemicolon(),this.token("}")},e.prototype.space=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.format.compact||(this._buf.hasContent()&&!this.endsWith(" ")&&!this.endsWith("\n")||e)&&this._space()},e.prototype.word=function(e){this._endsWithWord&&this._space(),this._maybeAddAuxComment(),this._append(e),this._endsWithWord=!0},e.prototype.number=function(e){this.word(e),this._endsWithInteger=(0,x.default)(+e)&&!R.test(e)&&!O.test(e)&&!B.test(e)&&"."!==e[e.length-1]},e.prototype.token=function(e){("--"===e&&this.endsWith("!")||"+"===e[0]&&this.endsWith("+")||"-"===e[0]&&this.endsWith("-")||"."===e[0]&&this._endsWithInteger)&&this._space(),this._maybeAddAuxComment(),this._append(e)},e.prototype.newline=function(e){if(!this.format.retainLines&&!this.format.compact){if(this.format.concise)return void this.space();if(!(this.endsWith("\n\n")||("number"!=typeof e&&(e=1),e=Math.min(2,e),(this.endsWith("{\n")||this.endsWith(":\n"))&&e--,e<=0)))for(var t=0;t<e;t++)this._newline()}},e.prototype.endsWith=function(e){return this._buf.endsWith(e)},e.prototype.removeTrailingNewline=function(){this._buf.removeTrailingNewline()},e.prototype.source=function(e,t){this._catchUp(e,t),this._buf.source(e,t)},e.prototype.withSource=function(e,t,r){this._catchUp(e,t),this._buf.withSource(e,t,r)},e.prototype._space=function(){this._append(" ",!0)},e.prototype._newline=function(){this._append("\n",!0)},e.prototype._append=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._maybeAddParen(e),this._maybeIndent(e),t?this._buf.queue(e):this._buf.append(e),this._endsWithWord=!1,this._endsWithInteger=!1},e.prototype._maybeIndent=function(e){this._indent&&this.endsWith("\n")&&"\n"!==e[0]&&this._buf.queue(this._getIndent())},e.prototype._maybeAddParen=function(e){var t=this._parenPushNewlineState;if(t){this._parenPushNewlineState=null;var r=void 0;for(r=0;r<e.length&&" "===e[r];r++);if(r!==e.length){var n=e[r];"\n"!==n&&"/"!==n||(this.token("("),this.indent(),t.printed=!0)}}},e.prototype._catchUp=function(e,t){if(this.format.retainLines){var r=t?t[e]:null;if(r&&null!==r.line)for(var n=r.line-this._buf.getCurrentLine(),i=0;i<n;i++)this._newline()}},e.prototype._getIndent=function(){return(0,_.default)(this.format.indent.style,this._indent)},e.prototype.startTerminatorless=function(){return this._parenPushNewlineState={printed:!1}},e.prototype.endTerminatorless=function(e){e.printed&&(this.dedent(),this.newline(),this.token(")"))},e.prototype.print=function(e,t){var r=this;if(e){var n=this.format.concise;e._compact&&(this.format.concise=!0);var i=this[e.type];if(!i)throw new ReferenceError("unknown node of type "+(0,f.default)(e.type)+" with constructor "+(0,f.default)(e&&e.constructor.name));this._printStack.push(e);var a=this._insideAux;this._insideAux=!e.loc,this._maybeAddAuxComment(this._insideAux&&!a);var s=w.needsParens(e,t,this._printStack);this.format.retainFunctionParens&&"FunctionExpression"===e.type&&e.extra&&e.extra.parenthesized&&(s=!0),s&&this.token("("),this._printLeadingComments(e,t);var o=T.isProgram(e)||T.isFile(e)?null:e.loc;this.withSource("start",o,function(){r[e.type](e,t)}),this._printTrailingComments(e,t),s&&this.token(")"),this._printStack.pop(),this.format.concise=n,this._insideAux=a}},e.prototype._maybeAddAuxComment=function(e){e&&this._printAuxBeforeComment(),this._insideAux||this._printAuxAfterComment()},e.prototype._printAuxBeforeComment=function(){if(!this._printAuxAfterOnNextUserNode){this._printAuxAfterOnNextUserNode=!0;var e=this.format.auxiliaryCommentBefore;e&&this._printComment({type:"CommentBlock",value:e})}},e.prototype._printAuxAfterComment=function(){if(this._printAuxAfterOnNextUserNode){this._printAuxAfterOnNextUserNode=!1;var e=this.format.auxiliaryCommentAfter;e&&this._printComment({type:"CommentBlock",value:e})}},e.prototype.getPossibleRaw=function(e){var t=e.extra;if(t&&null!=t.raw&&null!=t.rawValue&&e.value===t.rawValue)return t.raw},e.prototype.printJoin=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&e.length){r.indent&&this.indent();for(var n={addNewlines:r.addNewlines},i=0;i<e.length;i++){var a=e[i];a&&(r.statement&&this._printNewline(!0,a,t,n),this.print(a,t),r.iterator&&r.iterator(a,i),r.separator&&i<e.length-1&&r.separator.call(this),r.statement&&this._printNewline(!1,a,t,n))}r.indent&&this.dedent()}},e.prototype.printAndIndentOnComments=function(e,t){var r=!!e.leadingComments;r&&this.indent(),this.print(e,t),r&&this.dedent()},e.prototype.printBlock=function(e){var t=e.body;T.isEmptyStatement(t)||this.space(),this.print(t,e)},e.prototype._printTrailingComments=function(e,t){this._printComments(this._getComments(!1,e,t))},e.prototype._printLeadingComments=function(e,t){this._printComments(this._getComments(!0,e,t))},e.prototype.printInnerComments=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.innerComments&&(t&&this.indent(),this._printComments(e.innerComments),t&&this.dedent())},e.prototype.printSequence=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.statement=!0,this.printJoin(e,t,r)},e.prototype.printList=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==r.separator&&(r.separator=a),this.printJoin(e,t,r)},e.prototype._printNewline=function(e,t,r,n){var i=this;if(!this.format.retainLines&&!this.format.compact){if(this.format.concise)return void this.space();var a=0;if(null!=t.start&&!t._ignoreUserWhitespace&&this._whitespace)if(e){var s=t.leadingComments,o=s&&(0,y.default)(s,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});a=this._whitespace.getNewlinesBefore(o||t)}else{var u=t.trailingComments,l=u&&(0,b.default)(u,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});a=this._whitespace.getNewlinesAfter(l||t)}else{e||a++,n.addNewlines&&(a+=n.addNewlines(e,t)||0);var c=w.needsWhitespaceAfter;e&&(c=w.needsWhitespaceBefore),c(t,r)&&a++,this._buf.hasContent()||(a=0)}this.newline(a)}},e.prototype._getComments=function(e,t){return t&&(e?t.leadingComments:t.trailingComments)||[]},e.prototype._printComment=function(e){var t=this;if(this.format.shouldPrintComment(e.value)&&!e.ignore&&!this._printedComments.has(e)){if(this._printedComments.add(e),null!=e.start){if(this._printedCommentStarts[e.start])return;this._printedCommentStarts[e.start]=!0}this.newline(this._whitespace?this._whitespace.getNewlinesBefore(e):0),this.endsWith("[")||this.endsWith("{")||this.space();var r="CommentLine"===e.type?"//"+e.value+"\n":"/*"+e.value+"*/";if("CommentBlock"===e.type&&this.format.indent.adjustMultilineComment){var n=e.loc&&e.loc.start.column;if(n){var i=new RegExp("\\n\\s{1,"+n+"}","g");r=r.replace(i,"\n")}var a=Math.max(this._getIndent().length,this._buf.getCurrentColumn());r=r.replace(/\n(?!$)/g,"\n"+(0,_.default)(" ",a))}this.withSource("start",e.loc,function(){t._append(r)}),this.newline((this._whitespace?this._whitespace.getNewlinesAfter(e):0)+("CommentLine"===e.type?-1:0))}},e.prototype._printComments=function(e){if(e&&e.length)for(var t=e,r=Array.isArray(t),n=0,t=r?t:(0,l.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;this._printComment(a)}},e}();t.default=I;for(var M=[r(306),r(300),r(305),r(299),r(303),r(304),r(123),r(301),r(298),r(302)],N=0;N<M.length;N++){var L=M[N];(0,o.default)(I.prototype,L)}e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(20),a=n(i),s=r(7),o=n(s),u=r(3),l=n(u),c=r(287),f=n(c),p=function(){function e(t,r){var n=this;(0,l.default)(this,e),this._opts=t,this._map=new f.default.SourceMapGenerator({file:t.sourceMapTarget,sourceRoot:t.sourceRoot}),"string"==typeof r?this._map.setSourceContent(t.sourceFileName,r):"object"===("undefined"==typeof r?"undefined":(0,o.default)(r))&&(0,a.default)(r).forEach(function(e){n._map.setSourceContent(e,r[e])})}return e.prototype.get=function(){return this._map.toJSON()},e.prototype.mark=function(e,t,r,n,i,a){this._lastGenLine!==e&&null===r||this._lastGenLine===e&&this._lastSourceLine===r&&this._lastSourceColumn===n||(this._lastGenLine=e,this._lastSourceLine=r,this._lastSourceColumn=n,this._map.addMapping({name:i,generated:{line:e,column:t},source:null==r?null:a||this._opts.sourceFileName,original:null==r?null:{line:r,column:n}}))},e}();t.default=p,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),a=n(i),s=function(){function e(t){(0,a.default)(this,e),this.tokens=t,this.used={}}return e.prototype.getNewlinesBefore=function(e){var t=void 0,r=void 0,n=this.tokens,i=this._findToken(function(t){return t.start-e.start},0,n.length);if(i>=0){for(;i&&e.start===n[i-1].start;)--i;t=n[i-1],r=n[i]}return this._getNewlinesBetween(t,r)},e.prototype.getNewlinesAfter=function(e){var t=void 0,r=void 0,n=this.tokens,i=this._findToken(function(t){return t.end-e.end},0,n.length);if(i>=0){for(;i&&e.end===n[i-1].end;)--i;t=n[i],r=n[i+1],","===r.type.label&&(r=n[i+2])}return r&&"eof"===r.type.label?1:this._getNewlinesBetween(t,r)},e.prototype._getNewlinesBetween=function(e,t){if(!t||!t.loc)return 0;for(var r=e?e.loc.end.line:1,n=t.loc.start.line,i=0,a=r;a<n;a++)"undefined"==typeof this.used[a]&&(this.used[a]=!0,i++);return i},e.prototype._findToken=function(e,t,r){if(t>=r)return-1;var n=t+r>>>1,i=e(this.tokens[n]);return i<0?this._findToken(e,n+1,r):i>0?this._findToken(e,t,n):0===i?n:-1},e}();t.default=s,e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){for(var t=e,r=Array.isArray(t),n=0,t=r?t:(0,o.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i,s=a.node,u=s.expression;if(l.isMemberExpression(u)){var c=a.scope.maybeGenerateMemoised(u.object),f=void 0,p=[];c?(f=c,p.push(l.assignmentExpression("=",c,u.object))):f=u.object,p.push(l.callExpression(l.memberExpression(l.memberExpression(f,u.property,u.computed),l.identifier("bind")),[f])),1===p.length?s.expression=p[0]:s.expression=l.sequenceExpression(p)}}}t.__esModule=!0;var s=r(2),o=i(s);t.default=a;var u=r(1),l=n(u);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){function t(t){return t&&t.operator===e.operator+"="}function r(e,t){return u.assignmentExpression("=",e,t)}var n={};return n.ExpressionStatement=function(n,i){if(!n.isCompletionRecord()){var a=n.node.expression;if(t(a)){var o=[],l=(0,s.default)(a.left,o,i,n.scope,!0);o.push(u.expressionStatement(r(l.ref,e.build(l.uid,a.right)))),n.replaceWithMultiple(o)}}},n.AssignmentExpression=function(n,i){var a=n.node,o=n.scope;if(t(a)){var u=[],l=(0,s.default)(a.left,u,i,o);u.push(r(l.ref,e.build(l.uid,a.right))),n.replaceWithMultiple(u)}},n.BinaryExpression=function(t){var r=t.node;r.operator===e.operator&&t.replaceWith(e.build(r.left,r.right))},n};var a=r(315),s=i(a),o=r(1),u=n(o);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.scope,r=e.node,n=u.functionExpression(null,[],r.body,r.generator,r.async),i=n,a=[];(0,s.default)(e,function(e){return t.push({id:e})});var o={foundThis:!1,foundArguments:!1};e.traverse(l,o),o.foundArguments&&(i=u.memberExpression(n,u.identifier("apply")),a=[],o.foundThis&&a.push(u.thisExpression()),o.foundArguments&&(o.foundThis||a.push(u.nullLiteral()),a.push(u.identifier("arguments"))));var c=u.callExpression(i,a);return r.generator&&(c=u.yieldExpression(c,!0)),u.returnStatement(c)};var a=r(187),s=i(a),o=r(1),u=n(o),l={enter:function(e,t){e.isThisExpression()&&(t.foundThis=!0),e.isReferencedIdentifier({name:"arguments"})&&(t.foundArguments=!0)},Function:function(e){e.skip()}};e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e,t,r,n){var i=void 0;if(o.isSuper(e))return e;if(o.isIdentifier(e)){if(n.hasBinding(e.name))return e;i=e}else{if(!o.isMemberExpression(e))throw new Error("We can't explode this node type "+e.type);if(i=e.object,o.isSuper(i)||o.isIdentifier(i)&&n.hasBinding(i.name))return i}var a=n.generateUidIdentifierBasedOnNode(i);return t.push(o.variableDeclaration("var",[o.variableDeclarator(a,i)])),a}function a(e,t,r,n){var i=e.property,a=o.toComputedKey(e,i);if(o.isLiteral(a)&&o.isPureish(a))return a;var s=n.generateUidIdentifierBasedOnNode(i);return t.push(o.variableDeclaration("var",[o.variableDeclarator(s,i)])),s}t.__esModule=!0,t.default=function(e,t,r,n,s){var u=void 0;u=o.isIdentifier(e)&&s?e:i(e,t,r,n);var l=void 0,c=void 0;if(o.isIdentifier(e))l=e,c=u;else{var f=a(e,t,r,n),p=e.computed||o.isLiteral(f);c=l=o.memberExpression(u,f,p)}return{uid:c,ref:l}};var s=r(1),o=n(s);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a);t.default=function(e){function t(t){if(t.node&&!t.isPure()){var r=e.scope.generateDeclaredUidIdentifier();n.push(c.assignmentExpression("=",r,t.node)),t.replaceWith(r)}}function r(e){if(Array.isArray(e)&&e.length){e=e.reverse(),(0,u.default)(e);for(var r=e,n=Array.isArray(r),i=0,r=n?r:(0,s.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var o=a;t(o)}}}e.assertClass();var n=[];t(e.get("superClass")),r(e.get("decorators"),!0);for(var i=e.get("body.body"),a=i,o=Array.isArray(a),l=0,a=o?a:(0,s.default)(a);;){var f;if(o){if(l>=a.length)break;f=a[l++]}else{if(l=a.next(),l.done)break;f=l.value}var p=f;p.is("computed")&&t(p.get("key")),p.has("decorators")&&r(e.get("decorators"))}n&&e.insertBefore(n.map(function(e){return c.expressionStatement(e)}))};var o=r(312),u=i(o),l=r(1),c=n(l);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(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.__esModule=!0,t.default=function(e,t){var r=e.node,n=e.scope,i=e.parent,a=n.generateUidIdentifier("step"),o=n.generateUidIdentifier("value"),u=r.left,l=void 0;s.isIdentifier(u)||s.isPattern(u)||s.isMemberExpression(u)?l=s.expressionStatement(s.assignmentExpression("=",u,o)):s.isVariableDeclaration(u)&&(l=s.variableDeclaration(u.kind,[s.variableDeclarator(u.declarations[0].id,o)]));var d=f();(0,c.default)(d,p,null,{ITERATOR_HAD_ERROR_KEY:n.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:n.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:n.generateUidIdentifier("iteratorError"),ITERATOR_KEY:n.generateUidIdentifier("iterator"),GET_ITERATOR:t.getAsyncIterator,OBJECT:r.right,STEP_VALUE:o,STEP_KEY:a,AWAIT:t.wrapAwait}),d=d.body.body;var h=s.isLabeledStatement(i),m=d[3].block.body,v=m[0];return h&&(m[0]=s.labeledStatement(i.label,v)),{replaceParent:h,node:d,declar:l,loop:v}};var a=r(1),s=i(a),o=r(4),u=n(o),l=r(8),c=n(l),f=(0,u.default)("\n function* wrapper() {\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (\n var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE;\n (\n STEP_KEY = yield AWAIT(ITERATOR_KEY.next()),\n ITERATOR_COMPLETION = STEP_KEY.done,\n STEP_VALUE = yield AWAIT(STEP_KEY.value),\n !ITERATOR_COMPLETION\n );\n ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n yield AWAIT(ITERATOR_KEY.return());\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n }\n"),p={ noScope:!0,Identifier:function(e,t){e.node.name in t&&e.replaceInline(t[e.node.name])},CallExpression:function(e,t){var r=e.node.callee;s.isIdentifier(r)&&"AWAIT"===r.name&&!t.AWAIT&&e.replaceWith(e.node.arguments[0])}};e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(4),a=n(i),s={};t.default=s,s.typeof=(0,a.default)('\n (typeof Symbol === "function" && typeof Symbol.iterator === "symbol")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? "symbol"\n : typeof obj;\n };\n'),s.jsx=(0,a.default)('\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we\'re going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : \'\' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n'),s.asyncIterator=(0,a.default)('\n (function (iterable) {\n if (typeof Symbol === "function") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError("Object is not async iterable");\n })\n'),s.asyncGenerator=(0,a.default)('\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume("next", arg); },\n function (arg) { resume("throw", arg); });\n } else {\n settle(result.done ? "return" : "normal", result.value);\n }\n } catch (err) {\n settle("throw", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case "return":\n front.resolve({ value: value, done: true });\n break;\n case "throw":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide "return" method if generator return is not supported\n if (typeof gen.return !== "function") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === "function" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n'),s.asyncGeneratorDelegate=(0,a.default)('\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === "function" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump("next", value);\n };\n\n if (typeof inner.throw === "function") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump("throw", value);\n };\n }\n\n if (typeof inner.return === "function") {\n iter.return = function (value) {\n return pump("return", value);\n };\n }\n\n return iter;\n })\n'),s.asyncToGenerator=(0,a.default)('\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step("next", value);\n }, function (err) {\n step("throw", err);\n });\n }\n }\n\n return step("next");\n });\n };\n })\n'),s.classCallCheck=(0,a.default)('\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n });\n'),s.createClass=(0,a.default)('\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n'),s.defineEnumerableProperties=(0,a.default)('\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if ("value" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n'),s.defaults=(0,a.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n"),s.defineProperty=(0,a.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n"),s.extends=(0,a.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n"),s.get=(0,a.default)('\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n'),s.inherits=(0,a.default)('\n (function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n'),s.instanceof=(0,a.default)('\n (function (left, right) {\n if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n'),s.interopRequireDefault=(0,a.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n"),s.interopRequireWildcard=(0,a.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n"),s.newArrowCheck=(0,a.default)('\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError("Cannot instantiate an arrow function");\n }\n });\n'),s.objectDestructuringEmpty=(0,a.default)('\n (function (obj) {\n if (obj == null) throw new TypeError("Cannot destructure undefined");\n });\n'),s.objectWithoutProperties=(0,a.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n"),s.possibleConstructorReturn=(0,a.default)('\n (function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n return call && (typeof call === "object" || typeof call === "function") ? call : self;\n });\n'),s.selfGlobal=(0,a.default)('\n typeof global === "undefined" ? self : global\n'),s.set=(0,a.default)('\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if ("value" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n'),s.slicedToArray=(0,a.default)('\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i["return"]) _i["return"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n };\n })();\n'),s.slicedToArrayLoose=(0,a.default)('\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n });\n'),s.taggedTemplateLiteral=(0,a.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n"),s.taggedTemplateLiteralLoose=(0,a.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n"),s.temporalRef=(0,a.default)('\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + " is not defined - temporal dead zone");\n } else {\n return val;\n }\n })\n'),s.temporalUndefined=(0,a.default)("\n ({})\n"),s.toArray=(0,a.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n"),s.toConsumableArray=(0,a.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n"),e.exports=t.default},function(e,t){"use strict";function r(e,t){var r=void 0;return null!=t.url?r=t.url:(r="Inline Babel script",p++,p>1&&(r+=" ("+p+")")),e(t.content,l({filename:r},n(t))).code}function n(e){return{presets:e.presets||["react","es2015"],plugins:e.plugins||["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],sourceMaps:"inline"}}function i(e,t){var n=document.createElement("script");n.text=r(e,t),f.appendChild(n)}function a(e,t,r){var n=new XMLHttpRequest;return n.open("GET",e,!0),"overrideMimeType"in n&&n.overrideMimeType("text/plain"),n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)throw r(),new Error("Could not load "+e);t(n.responseText)}},n.send(null)}function s(e,t){var r=e.getAttribute(t);return""===r?[]:r?r.split(",").map(function(e){return e.trim()}):null}function o(e,t){function r(){var t,r;for(r=0;r<o;r++)if(t=n[r],t.loaded&&!t.executed)t.executed=!0,i(e,t);else if(!t.loaded&&!t.error&&!t.async)break}var n=[],o=t.length;t.forEach(function(e,t){var i={async:e.hasAttribute("async"),error:!1,executed:!1,plugins:s(e,"data-plugins"),presets:s(e,"data-presets")};e.src?(n[t]=l({},i,{content:null,loaded:!1,url:e.src}),a(e.src,function(e){n[t].loaded=!0,n[t].content=e,r()},function(){n[t].error=!0,r()})):n[t]=l({},i,{content:e.innerHTML,loaded:!0,url:null})}),r()}function u(e){f=document.getElementsByTagName("head")[0];for(var t=document.getElementsByTagName("script"),r=[],n=0;n<t.length;n++){var i=t.item(n),a=i.type.split(";")[0];c.indexOf(a)!==-1&&r.push(i)}0!==r.length&&(console.warn("You are using the in-browser Babel transformer. Be sure to precompile your scripts for production - https://babeljs.io/docs/setup/"),o(e,r))}Object.defineProperty(t,"__esModule",{value:!0});var l=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.runScripts=u;var c=["text/jsx","text/babel"],f=void 0,p=0},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{pre:function(e){e.set("helpersNamespace",t.identifier("babelHelpers"))}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("dynamicImport")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("functionSent")}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{inherits:r(66)}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){var t=e.types,n={Function:function(e){e.skip()},YieldExpression:function(e,r){var n=e.node;if(n.delegate){var i=r.addHelper("asyncGeneratorDelegate");n.argument=t.callExpression(i,[t.callExpression(r.addHelper("asyncIterator"),[n.argument]),t.memberExpression(r.addHelper("asyncGenerator"),t.identifier("await"))])}}};return{inherits:r(192),visitor:{Function:function(e,r){e.node.async&&e.node.generator&&(e.traverse(n,r),(0,a.default)(e,r.file,{wrapAsync:t.memberExpression(r.addHelper("asyncGenerator"),t.identifier("wrap")),wrapAwait:t.memberExpression(r.addHelper("asyncGenerator"),t.identifier("await"))}))}}}};var i=r(124),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(){return{inherits:r(66),visitor:{Function:function(e,t){e.node.async&&!e.node.generator&&(0,a.default)(e,t.file,{wrapAsync:t.addImport(t.opts.module,t.opts.method)})}}}};var i=r(124),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(e,t){if(!t.applyDecoratedDescriptor){t.applyDecoratedDescriptor=e.scope.generateUidIdentifier("applyDecoratedDescriptor");var r=p({NAME:t.applyDecoratedDescriptor});e.scope.getProgramParent().path.unshiftContainer("body",r)}return t.applyDecoratedDescriptor}function n(e,t){if(!t.initializerDefineProp){t.initializerDefineProp=e.scope.generateUidIdentifier("initDefineProp");var r=f({NAME:t.initializerDefineProp});e.scope.getProgramParent().path.unshiftContainer("body",r)}return t.initializerDefineProp}function i(e,t){if(!t.initializerWarningHelper){t.initializerWarningHelper=e.scope.generateUidIdentifier("initializerWarningHelper");var r=c({NAME:t.initializerWarningHelper});e.scope.getProgramParent().path.unshiftContainer("body",r)}return t.initializerWarningHelper}function a(e){var t=(e.isClass()?[e].concat(e.get("body.body")):e.get("properties")).reduce(function(e,t){return e.concat(t.node.decorators||[])},[]),r=t.filter(function(e){return!y.isIdentifier(e.expression)});if(0!==r.length)return y.sequenceExpression(r.map(function(t){var r=t.expression,n=t.expression=e.scope.generateDeclaredUidIdentifier("dec");return y.assignmentExpression("=",n,r)}).concat([e.node]))}function d(e,t){var r=e.node.decorators||[];if(e.node.decorators=null,0!==r.length){var n=e.scope.generateDeclaredUidIdentifier("class");return r.map(function(e){return e.expression}).reverse().reduce(function(e,t){return s({CLASS_REF:n,DECORATOR:t,INNER:e}).expression},e.node)}}function h(e,t){var r=e.node.body.body.some(function(e){return(e.decorators||[]).length>0});if(r)return v(e,t,e.node.body.body)}function m(e,t){var r=e.node.properties.some(function(e){return(e.decorators||[]).length>0});if(r)return v(e,t,e.node.properties)}function v(e,r,n){var a=(e.scope.generateDeclaredUidIdentifier("desc"),e.scope.generateDeclaredUidIdentifier("value"),e.scope.generateDeclaredUidIdentifier(e.isClass()?"class":"obj")),s=n.reduce(function(n,s){var c=s.decorators||[];if(s.decorators=null,0===c.length)return n;if(s.computed)throw e.buildCodeFrameError("Computed method/property decorators are not yet supported.");var f=y.isLiteral(s.key)?s.key:y.stringLiteral(s.key.name),p=e.isClass()&&!s.static?o({CLASS_REF:a}).expression:a;if(y.isClassProperty(s,{static:!1})){var d=e.scope.generateDeclaredUidIdentifier("descriptor"),h=s.value?y.functionExpression(null,[],y.blockStatement([y.returnStatement(s.value)])):y.nullLiteral();s.value=y.callExpression(i(e,r),[d,y.thisExpression()]),n=n.concat([y.assignmentExpression("=",d,y.callExpression(t(e,r),[p,f,y.arrayExpression(c.map(function(e){return e.expression})),y.objectExpression([y.objectProperty(y.identifier("enumerable"),y.booleanLiteral(!0)),y.objectProperty(y.identifier("initializer"),h)])]))])}else n=n.concat(y.callExpression(t(e,r),[p,f,y.arrayExpression(c.map(function(e){return e.expression})),y.isObjectProperty(s)||y.isClassProperty(s,{static:!0})?l({TEMP:e.scope.generateDeclaredUidIdentifier("init"),TARGET:p,PROPERTY:f}).expression:u({TARGET:p,PROPERTY:f}).expression,p]));return n},[]);return y.sequenceExpression([y.assignmentExpression("=",a,e.node),y.sequenceExpression(s),a])}var y=e.types;return{inherits:r(125),visitor:{ExportDefaultDeclaration:function(e){if(e.get("declaration").isClassDeclaration()){var t=e.node,r=t.declaration.id||e.scope.generateUidIdentifier("default");t.declaration.id=r,e.replaceWith(t.declaration),e.insertAfter(y.exportNamedDeclaration(null,[y.exportSpecifier(r,y.identifier("default"))]))}},ClassDeclaration:function(e){var t=e.node,r=t.id||e.scope.generateUidIdentifier("class");e.replaceWith(y.variableDeclaration("let",[y.variableDeclarator(r,y.toExpression(t))]))},ClassExpression:function(e,t){var r=a(e)||d(e,t)||h(e,t);r&&e.replaceWith(r)},ObjectExpression:function(e,t){var r=a(e)||m(e,t);r&&e.replaceWith(r)},AssignmentExpression:function(e,t){t.initializerWarningHelper&&e.get("left").isMemberExpression()&&e.get("left.property").isIdentifier()&&e.get("right").isCallExpression()&&e.get("right.callee").isIdentifier({name:t.initializerWarningHelper.name})&&e.replaceWith(y.callExpression(n(e,t),[e.get("left.object").node,y.stringLiteral(e.get("left.property").node.name),e.get("right.arguments")[0].node,e.get("right.arguments")[1].node]))}}}};var i=r(4),a=n(i),s=(0,a.default)("\n DECORATOR(CLASS_REF = INNER) || CLASS_REF;\n"),o=(0,a.default)("\n CLASS_REF.prototype;\n"),u=(0,a.default)("\n Object.getOwnPropertyDescriptor(TARGET, PROPERTY);\n"),l=(0,a.default)("\n (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {\n enumerable: true,\n configurable: true,\n writable: true,\n initializer: function(){\n return TEMP;\n }\n })\n"),c=(0,a.default)("\n function NAME(descriptor, context){\n throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');\n }\n"),f=(0,a.default)("\n function NAME(target, property, descriptor, context){\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0,\n });\n }\n"),p=(0,a.default)("\n function NAME(target, property, decorators, descriptor, context){\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function(key){\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer){\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function(desc, decorator){\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0){\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0){\n // This is a hack to avoid this being processed by 'transform-runtime'.\n // See issue #9.\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n }\n")},function(e,t,r){"use strict";function n(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}function i(e,t){var r=t._guessExecutionStatusRelativeTo(e);return"before"===r?"inside":"after"===r?"outside":"maybe"}function a(e,t){return u.callExpression(t.addHelper("temporalRef"),[e,u.stringLiteral(e.name),t.addHelper("temporalUndefined")])}function s(e,t,r){var n=r.letReferences[e.name];return!!n&&t.getBindingIdentifier(e.name)===n}t.__esModule=!0,t.visitor=void 0;var o=r(1),u=n(o);t.visitor={ReferencedIdentifier:function(e,t){if(this.file.opts.tdz){var r=e.node,n=e.parent,o=e.scope;if(!e.parentPath.isFor({left:r})&&s(r,o,t)){var l=o.getBinding(r.name).path,c=i(e,l);if("inside"!==c)if("maybe"===c){var f=a(r,t.file);if(l.parent._tdzThis=!0,e.skip(),e.parentPath.isUpdateExpression()){if(n._ignoreBlockScopingTDZ)return;e.parentPath.replaceWith(u.sequenceExpression([f,n]))}else e.replaceWith(f)}else"outside"===c&&e.replaceWith(u.throwStatement(u.inherits(u.newExpression(u.identifier("ReferenceError"),[u.stringLiteral(r.name+" is not defined - temporal dead zone")]),r)))}}},AssignmentExpression:{exit:function(e,t){if(this.file.opts.tdz){var r=e.node;if(!r._ignoreBlockScopingTDZ){var n=[],i=e.getBindingIdentifiers();for(var o in i){var l=i[o];s(l,e.scope,t)&&n.push(a(l,t.file))}n.length&&(r._ignoreBlockScopingTDZ=!0,n.push(r),e.replaceWithMultiple(n.map(u.expressionStatement)))}}}}}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(3),s=i(a),o=r(42),u=i(o),l=r(41),c=i(l),f=r(40),p=i(f),d=r(204),h=i(d),m=r(1),v=n(m),y=function(e){function t(){(0,s.default)(this,t);var r=(0,u.default)(this,e.apply(this,arguments));return r.isLoose=!0,r}return(0,c.default)(t,e),t.prototype._processMethod=function(e,t){if(!e.decorators){var r=this.classRef;e.static||(r=v.memberExpression(r,v.identifier("prototype")));var n=v.memberExpression(r,e.key,e.computed||v.isLiteral(e.key)),i=v.functionExpression(null,e.params,e.body,e.generator,e.async);i.returnType=e.returnType;var a=v.toComputedKey(e,e.key);v.isStringLiteral(a)&&(i=(0,p.default)({node:i,id:a,scope:t}));var s=v.expressionStatement(v.assignmentExpression("=",n,i));return v.inheritsComments(s,e),this.body.push(s),!0}},t}(h.default);t.default=y,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{BinaryExpression:function(e){var r=e.node;"instanceof"===r.operator&&e.replaceWith(t.callExpression(this.addHelper("instanceof"),[r.left,r.right]))}}}},e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){for(var t=e.params,r=Array.isArray(t),n=0,t=r?t:(0,u.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;if(!v.isIdentifier(a))return!0}return!1}function s(e,t){if(!e.hasOwnBinding(t.name))return!0;var r=e.getOwnBinding(t.name),n=r.kind;return"param"===n||"local"===n}t.__esModule=!0,t.visitor=void 0;var o=r(2),u=i(o),l=r(186),c=i(l),f=r(314),p=i(f),d=r(4),h=i(d),m=r(1),v=n(m),y=(0,h.default)("\n let VARIABLE_NAME =\n ARGUMENTS.length > ARGUMENT_KEY && ARGUMENTS[ARGUMENT_KEY] !== undefined ?\n ARGUMENTS[ARGUMENT_KEY]\n :\n DEFAULT_VALUE;\n"),g=(0,h.default)("\n let $0 = $1[$2];\n"),b={ReferencedIdentifier:function(e,t){var r=e.scope,n=e.node;"eval"!==n.name&&s(r,n)||(t.iife=!0,e.stop())},Scope:function(e){e.skip()}};t.visitor={Function:function(e){function t(e,t,n){var i=y({VARIABLE_NAME:e,DEFAULT_VALUE:t,ARGUMENT_KEY:v.numericLiteral(n),ARGUMENTS:u});i._blockHoist=r.params.length-n,o.push(i)}var r=e.node,n=e.scope;if(a(r)){e.ensureBlock();var i={iife:!1,scope:n},o=[],u=v.identifier("arguments");u._shadowedFunctionLiteral=e;for(var l=(0,c.default)(r),f=e.get("params"),d=0;d<f.length;d++){var h=f[d];if(h.isAssignmentPattern()){var m=h.get("left"),E=h.get("right");if(d>=l||m.isPattern()){var x=n.generateUidIdentifier("x");x._isDefaultPlaceholder=!0,r.params[d]=x}else r.params[d]=m.node;i.iife||(E.isIdentifier()&&!s(n,E.node)?i.iife=!0:E.traverse(b,i)),t(m.node,E.node,d)}else i.iife||h.isIdentifier()||h.traverse(b,i)}for(var A=l+1;A<r.params.length;A++){var _=r.params[A];if(!_._isDefaultPlaceholder){var D=g(_,u,v.numericLiteral(A));D._blockHoist=r.params.length-A,o.push(D)}}r.params=r.params.slice(0,l),i.iife?(o.push((0,p.default)(e,n)),e.set("body",v.blockStatement(o))):e.get("body").unshiftContainer("body",o)}}}},function(e,t,r){"use strict";function n(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.__esModule=!0,t.visitor=void 0;var i=r(1),a=n(i);t.visitor={Function:function(e){for(var t=e.get("params"),r=a.isRestElement(t[t.length-1])?1:0,n=t.length-r,i=0;i<n;i++){var s=t[i];if(s.isArrayPattern()||s.isObjectPattern()){var o=e.scope.generateUidIdentifier("ref"),u=a.variableDeclaration("let",[a.variableDeclarator(s.node,o)]);u._blockHoist=n-i,e.ensureBlock(),e.get("body").unshiftContainer("body",u),s.replaceWith(o)}}}}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{ default:e}}function a(e){return d.isRestElement(e.params[e.params.length-1])}function s(e,t,r){var n=void 0;n=d.isNumericLiteral(e.parent.property)?d.numericLiteral(e.parent.property.value+r):0===r?e.parent.property:d.binaryExpression("+",e.parent.property,d.numericLiteral(r));var i=e.scope;if(i.isPure(n))e.parentPath.replaceWith(m({ARGUMENTS:t,INDEX:n}));else{var a=i.generateUidIdentifierBasedOnNode(n);i.push({id:a,kind:"var"}),e.parentPath.replaceWith(v({ARGUMENTS:t,INDEX:n,REF:a}))}}function o(e,t,r){r?e.parentPath.replaceWith(y({ARGUMENTS:t,OFFSET:d.numericLiteral(r)})):e.replaceWith(t)}t.__esModule=!0,t.visitor=void 0;var u=r(2),l=i(u),c=r(4),f=i(c),p=r(1),d=n(p),h=(0,f.default)("\n for (var LEN = ARGUMENTS.length,\n ARRAY = Array(ARRAY_LEN),\n KEY = START;\n KEY < LEN;\n KEY++) {\n ARRAY[ARRAY_KEY] = ARGUMENTS[KEY];\n }\n"),m=(0,f.default)("\n ARGUMENTS.length <= INDEX ? undefined : ARGUMENTS[INDEX]\n"),v=(0,f.default)("\n REF = INDEX, ARGUMENTS.length <= REF ? undefined : ARGUMENTS[REF]\n"),y=(0,f.default)("\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n"),g={Scope:function(e,t){e.scope.bindingIdentifierEquals(t.name,t.outerBinding)||e.skip()},Flow:function(e){e.isTypeCastExpression()||e.skip()},"Function|ClassProperty":function(e,t){var r=t.noOptimise;t.noOptimise=!0,e.traverse(g,t),t.noOptimise=r,e.skip()},ReferencedIdentifier:function(e,t){var r=e.node;if("arguments"===r.name&&(t.deopted=!0),r.name===t.name)if(t.noOptimise)t.deopted=!0;else{var n=e.parentPath;if(n.isMemberExpression({object:r})){var i=n.parentPath,a=!t.deopted&&!(i.isAssignmentExpression()&&n.node===i.node.left||i.isLVal()||i.isForXStatement()||i.isUpdateExpression()||i.isUnaryExpression({operator:"delete"})||(i.isCallExpression()||i.isNewExpression())&&n.node===i.node.callee);if(a)if(n.node.computed){if(n.get("property").isBaseType("number"))return void t.candidates.push({cause:"indexGetter",path:e})}else if("length"===n.node.property.name)return void t.candidates.push({cause:"lengthGetter",path:e})}if(0===t.offset&&n.isSpreadElement()){var s=n.parentPath;if(s.isCallExpression()&&1===s.node.arguments.length)return void t.candidates.push({cause:"argSpread",path:e})}t.references.push(e)}},BindingIdentifier:function(e,t){var r=e.node;r.name===t.name&&(t.deopted=!0)}};t.visitor={Function:function(e){var t=e.node,r=e.scope;if(a(t)){var n=t.params.pop().argument,i=d.identifier("arguments");i._shadowedFunctionLiteral=e;var u={references:[],offset:t.params.length,argumentsNode:i,outerBinding:r.getBindingIdentifier(n.name),candidates:[],name:n.name,deopted:!1};if(e.traverse(g,u),u.deopted||u.references.length){u.references=u.references.concat(u.candidates.map(function(e){var t=e.path;return t})),u.deopted=u.deopted||!!t.shadow;var c=d.numericLiteral(t.params.length),f=r.generateUidIdentifier("key"),p=r.generateUidIdentifier("len"),m=f,v=p;t.params.length&&(m=d.binaryExpression("-",f,c),v=d.conditionalExpression(d.binaryExpression(">",p,c),d.binaryExpression("-",p,c),d.numericLiteral(0)));var y=h({ARGUMENTS:i,ARRAY_KEY:m,ARRAY_LEN:v,START:c,ARRAY:n,KEY:f,LEN:p});if(u.deopted)y._blockHoist=t.params.length+1,t.body.body.unshift(y);else{y._blockHoist=1;var b=e.getEarliestCommonAncestorFrom(u.references).getStatementParent();b.findParent(function(e){return e.isLoop()?void(b=e):e.isFunction()}),b.insertBefore(y)}}else for(var E=u.candidates,x=Array.isArray(E),A=0,E=x?E:(0,l.default)(E);;){var _;if(x){if(A>=E.length)break;_=E[A++]}else{if(A=E.next(),A.done)break;_=A.value}var D=_,C=D.path,S=D.cause;switch(S){case"indexGetter":s(C,i,u.offset);break;case"lengthGetter":o(C,i,u.offset);break;default:C.replaceWith(i)}}}}}},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{MemberExpression:{exit:function(e){var r=e.node,n=r.property;r.computed||!t.isIdentifier(n)||t.isValidIdentifier(n.name)||(r.property=t.stringLiteral(n.name),r.computed=!0)}}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{ObjectProperty:{exit:function(e){var r=e.node,n=r.key;r.computed||!t.isIdentifier(n)||t.isValidIdentifier(n.name)||(r.key=t.stringLiteral(n.name))}}}}},e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a);t.default=function(e){var t=e.types;return{visitor:{ObjectExpression:function(e,r){for(var n=e.node,i=!1,a=n.properties,o=Array.isArray(a),l=0,a=o?a:(0,s.default)(a);;){var c;if(o){if(l>=a.length)break;c=a[l++]}else{if(l=a.next(),l.done)break;c=l.value}var f=c;if("get"===f.kind||"set"===f.kind){i=!0;break}}if(i){var p={};n.properties=n.properties.filter(function(e){return!!(e.computed||"get"!==e.kind&&"set"!==e.kind)||(u.push(p,e,null,r),!1)}),e.replaceWith(t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("defineProperties")),[n,u.toDefineObject(p)]))}}}}};var o=r(185),u=n(o);e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.parse,r=e.traverse;return{visitor:{CallExpression:function(e){if(e.get("callee").isIdentifier({name:"eval"})&&1===e.node.arguments.length){var n=e.get("arguments")[0].evaluate();if(!n.confident)return;var i=n.value;if("string"!=typeof i)return;var a=t(i);return r.removeProperties(a),a.program}}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e,t){e.addComment("trailing",n(e,t)),e.replaceWith(i.noop())}function n(e,t){var r=e.getSource().replace(/\*-\//g,"*-ESCAPED/").replace(/\*\//g,"*-/");return t&&t.optional&&(r="?"+r),":"!==r[0]&&(r=":: "+r),r}var i=e.types;return{inherits:r(67),visitor:{TypeCastExpression:function(e){var t=e.node;e.get("expression").addComment("trailing",n(e.get("typeAnnotation"))),e.replaceWith(i.parenthesizedExpression(t.expression))},Identifier:function(e){var t=e.node;t.optional&&!t.typeAnnotation&&e.addComment("trailing",":: ?")},Function:{exit:function(e){var t=e.node;t.params.forEach(function(e){return e.optional=!1})}},ClassProperty:function(e){var r=e.node,n=e.parent;r.value||t(e,n)},"ExportNamedDeclaration|Flow":function(e){var r=e.node,n=e.parent;i.isExportNamedDeclaration(r)&&!i.isFlow(r.declaration)||t(e,n)},ImportDeclaration:function(e){var r=e.node,n=e.parent;i.isImportDeclaration(r)&&"type"!==r.importKind&&"typeof"!==r.importKind||t(e,n)}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{FunctionExpression:{exit:function(e){var r=e.node;r.id&&(r._ignoreUserWhitespace=!0,e.replaceWith(t.callExpression(t.functionExpression(null,[],t.blockStatement([t.toStatement(r),t.returnStatement(r.id)])),[])))}}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{CallExpression:function(e,t){e.get("callee").matchesPattern("Object.assign")&&(e.node.callee=t.addHelper("extends"))}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{CallExpression:function(e,t){e.get("callee").matchesPattern("Object.setPrototypeOf")&&(e.node.callee=t.addHelper("defaults"))}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){function t(e){return i.isLiteral(i.toComputedKey(e,e.key),{value:"__proto__"})}function r(e){var t=e.left;return i.isMemberExpression(t)&&i.isLiteral(i.toComputedKey(t,t.property),{value:"__proto__"})}function n(e,t,r){return i.expressionStatement(i.callExpression(r.addHelper("defaults"),[t,e.right]))}var i=e.types;return{visitor:{AssignmentExpression:function(e,t){if(r(e.node)){var a=[],s=e.node.left.object,o=e.scope.maybeGenerateMemoised(s);o&&a.push(i.expressionStatement(i.assignmentExpression("=",o,s))),a.push(n(e.node,o||s,t)),o&&a.push(o),e.replaceWithMultiple(a)}},ExpressionStatement:function(e,t){var a=e.node.expression;i.isAssignmentExpression(a,{operator:"="})&&r(a)&&e.replaceWith(n(a,a.left.object,t))},ObjectExpression:function(e,r){for(var n=void 0,s=e.node,u=s.properties,l=Array.isArray(u),c=0,u=l?u:(0,a.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;t(p)&&(n=p.value,(0,o.default)(s.properties,p))}if(n){var d=[i.objectExpression([]),n];s.properties.length&&d.push(s),e.replaceWith(i.callExpression(r.addHelper("extends"),d))}}}}};var s=r(277),o=n(s);e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){var e={enter:function(e,t){var r=function(){t.isImmutable=!1,e.stop()};return e.isJSXClosingElement()?void e.skip():e.isJSXIdentifier({name:"ref"})&&e.parentPath.isJSXAttribute({name:e.node})?r():void(e.isJSXIdentifier()||e.isIdentifier()||e.isJSXMemberExpression()||e.isImmutable()||r())}};return{visitor:{JSXElement:function(t){if(!t.node._hoisted){var r={isImmutable:!0};t.traverse(e,r),r.isImmutable?t.hoist():t.node._hoisted=!0}}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),a=n(i);t.default=function(e){function t(e){for(var t=0;t<e.length;t++){var n=e[t];if(i.isJSXSpreadAttribute(n))return!0;if(r(n,"ref"))return!0}return!1}function r(e,t){return i.isJSXAttribute(e)&&i.isJSXIdentifier(e.name,{name:t})}function n(e){var t=e.value;return t?(i.isJSXExpressionContainer(t)&&(t=t.expression),t):i.identifier("true")}var i=e.types;return{visitor:{JSXElement:function(e,s){function o(e,t,r){e.push(i.objectProperty(t,r))}var u=e.node,l=u.openingElement;if(!t(l.attributes)){var c=i.objectExpression([]),f=null,p=l.name;i.isJSXIdentifier(p)&&i.react.isCompatTag(p.name)&&(p=i.stringLiteral(p.name));for(var d=l.attributes,h=Array.isArray(d),m=0,d=h?d:(0,a.default)(d);;){var v;if(h){if(m>=d.length)break;v=d[m++]}else{if(m=d.next(),m.done)break;v=m.value}var y=v;if(r(y,"key"))f=n(y);else{var g=y.name.name,b=i.isValidIdentifier(g)?i.identifier(g):i.stringLiteral(g);o(c.properties,b,n(y))}}var E=[p,c];if(f||u.children.length){var x=i.react.buildChildren(u);E.push.apply(E,[f||i.unaryExpression("void",i.numericLiteral(0),!0)].concat(x))}var A=i.callExpression(s.addHelper("jsx"),E);e.replaceWith(A)}}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{manipulateOptions:function(e,t){t.plugins.push("jsx")},visitor:r(184)({pre:function(e){e.callee=e.tagExpr},post:function(e){t.react.isCompatTag(e.tagName)&&(e.call=t.callExpression(t.memberExpression(t.memberExpression(t.identifier("React"),t.identifier("DOM")),e.tagExpr,t.isLiteral(e.tagExpr)),e.args))}})}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types,n={JSXOpeningElement:function(e){var n=e.node,i=t.jSXIdentifier(r),a=t.thisExpression();n.attributes.push(t.jSXAttribute(i,t.jSXExpressionContainer(a)))}};return{visitor:n}};var r="__self";e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){function t(e,t){var r=null!=t?i.numericLiteral(t):i.nullLiteral(),n=i.objectProperty(i.identifier("fileName"),e),a=i.objectProperty(i.identifier("lineNumber"),r);return i.objectExpression([n,a])}var i=e.types,a={JSXOpeningElement:function(e,a){var s=i.jSXIdentifier(r),o=e.container.openingElement.loc;if(o){for(var u=e.container.openingElement.attributes,l=0;l<u.length;l++){var c=u[l].name;if(c&&c.name===r)return}if(!a.fileNameIdentifier){var f="unknown"!==a.file.log.filename?a.file.log.filename:null,p=e.scope.generateUidIdentifier(n);e.hub.file.scope.push({id:p,init:i.stringLiteral(f)}),a.fileNameIdentifier=p}var d=t(a.fileNameIdentifier,o.start.line);u.push(i.jSXAttribute(s,i.jSXExpressionContainer(d)))}}};return{visitor:a}};var r="__source",n="_jsxFileName";e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}var a=r(20),s=i(a),o=r(1),u=n(o),l=Object.prototype.hasOwnProperty;t.hoist=function(e){function t(e,t){u.assertVariableDeclaration(e);var n=[];return e.declarations.forEach(function(e){r[e.id.name]=u.identifier(e.id.name),e.init?n.push(u.assignmentExpression("=",e.id,e.init)):t&&n.push(e.id)}),0===n.length?null:1===n.length?n[0]:u.sequenceExpression(n)}u.assertFunction(e.node);var r={};e.get("body").traverse({VariableDeclaration:{exit:function(e){var r=t(e.node,!1);null===r?e.remove():e.replaceWith(u.expressionStatement(r)),e.skip()}},ForStatement:function(e){var r=e.node.init;u.isVariableDeclaration(r)&&e.get("init").replaceWith(t(r,!1))},ForXStatement:function(e){var r=e.get("left");r.isVariableDeclaration()&&r.replaceWith(t(r.node,!0))},FunctionDeclaration:function(e){var t=e.node;r[t.id.name]=t.id;var n=u.expressionStatement(u.assignmentExpression("=",t.id,u.functionExpression(t.id,t.params,t.body,t.generator,t.expression)));e.parentPath.isBlockStatement()?(e.parentPath.unshiftContainer("body",n),e.remove()):e.replaceWith(n),e.skip()},FunctionExpression:function(e){e.skip()}});var n={};e.get("params").forEach(function(e){var t=e.node;u.isIdentifier(t)&&(n[t.name]=t)});var i=[];return(0,s.default)(r).forEach(function(e){l.call(n,e)||i.push(u.variableDeclarator(r[e],null))}),0===i.length?null:u.variableDeclaration("var",i)}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(){m.default.ok(this instanceof a)}function s(e){a.call(this),y.assertLiteral(e),this.returnLoc=e}function o(e,t,r){a.call(this),y.assertLiteral(e),y.assertLiteral(t),r?y.assertIdentifier(r):r=null,this.breakLoc=e,this.continueLoc=t,this.label=r}function u(e){a.call(this),y.assertLiteral(e),this.breakLoc=e}function l(e,t,r){a.call(this),y.assertLiteral(e),t?m.default.ok(t instanceof c):t=null,r?m.default.ok(r instanceof f):r=null,m.default.ok(t||r),this.firstLoc=e,this.catchEntry=t,this.finallyEntry=r}function c(e,t){a.call(this),y.assertLiteral(e),y.assertIdentifier(t),this.firstLoc=e,this.paramId=t}function f(e,t){a.call(this),y.assertLiteral(e),y.assertLiteral(t),this.firstLoc=e,this.afterLoc=t}function p(e,t){a.call(this),y.assertLiteral(e),y.assertIdentifier(t),this.breakLoc=e,this.label=t}function d(e){m.default.ok(this instanceof d);var t=r(213).Emitter;m.default.ok(e instanceof t),this.emitter=e,this.entryStack=[new s(e.finalLoc)]}var h=r(63),m=i(h),v=r(1),y=n(v),g=r(117);(0,g.inherits)(s,a),t.FunctionEntry=s,(0,g.inherits)(o,a),t.LoopEntry=o,(0,g.inherits)(u,a),t.SwitchEntry=u,(0,g.inherits)(l,a),t.TryEntry=l,(0,g.inherits)(c,a),t.CatchEntry=c,(0,g.inherits)(f,a),t.FinallyEntry=f,(0,g.inherits)(p,a),t.LabeledEntry=p;var b=d.prototype;t.LeapManager=d,b.withEntry=function(e,t){m.default.ok(e instanceof a),this.entryStack.push(e);try{t.call(this.emitter)}finally{var r=this.entryStack.pop();m.default.strictEqual(r,e)}},b._findLeapLocation=function(e,t){for(var r=this.entryStack.length-1;r>=0;--r){var n=this.entryStack[r],i=n[e];if(i)if(t){if(n.label&&n.label.name===t.name)return i}else if(!(n instanceof p))return i}return null},b.getBreakLoc=function(e){return this._findLeapLocation("breakLoc",e)},b.getContinueLoc=function(e){return this._findLeapLocation("continueLoc",e)}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){function r(e){function t(e){return r||(Array.isArray(e)?e.some(t):l.isNode(e)&&(o.default.strictEqual(r,!1),r=n(e))),r}l.assertNode(e);var r=!1,i=l.VISITOR_KEYS[e.type];if(i)for(var a=0;a<i.length;a++){var s=i[a],u=e[s];t(u)}return r}function n(n){l.assertNode(n);var i=c(n);return f.call(i,e)?i[e]:f.call(p,n.type)?i[e]=!1:f.call(t,n.type)?i[e]=!0:i[e]=r(n)}return n.onlyChildren=r,n}var s=r(63),o=i(s),u=r(1),l=n(u),c=r(281).makeAccessor(),f=Object.prototype.hasOwnProperty,p={FunctionExpression:!0},d={CallExpression:!0,ForInStatement:!0,UnaryExpression:!0,BinaryExpression:!0,AssignmentExpression:!0,UpdateExpression:!0,NewExpression:!0},h={YieldExpression:!0,BreakStatement:!0,ContinueStatement:!0,ReturnStatement:!0,ThrowStatement:!0};for(var m in h)f.call(h,m)&&(d[m]=h[m]);t.hasSideEffects=a("hasSideEffects",d),t.containsLeap=a("containsLeap",h)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.node;if(f.assertFunction(t),t.id||(t.id=e.scope.parent.generateUidIdentifier("callee")),t.generator&&f.isFunctionDeclaration(t)){var r=e.findParent(function(e){return e.isProgram()||e.isBlockStatement()});if(!r)return t.id;var n=s(r),i=n.declarations[0].id,a=n.declarations[0].init.callee.object;f.assertArrayExpression(a);var o=a.elements.length;return a.elements.push(t.id),f.memberExpression(i,f.numericLiteral(o),!0)}return t.id}function s(e){var t=e.node;l.default.ok(Array.isArray(t.body));var r=v(t);return r.decl?r.decl:(r.decl=f.variableDeclaration("var",[f.variableDeclarator(e.scope.generateUidIdentifier("marked"),f.callExpression(f.memberExpression(f.arrayExpression([]),f.identifier("map"),!1),[m.runtimeProperty("mark")]))]),e.unshiftContainer("body",r.decl),r.decl)}function o(e,t){var r={didRenameArguments:!1,argsId:t};return e.traverse(y,r),r.didRenameArguments}var u=r(63),l=i(u),c=r(1),f=n(c),p=r(347),d=r(213),h=r(214),m=n(h),v=r(281).makeAccessor();t.visitor={Function:{exit:function(e,t){var r=e.node;if(r.generator){if(r.async){if(t.opts.asyncGenerators===!1)return}else if(t.opts.generators===!1)return}else{if(!r.async)return;if(t.opts.async===!1)return}var n=e.scope.generateUidIdentifier("context"),i=e.scope.generateUidIdentifier("args");e.ensureBlock();var s=e.get("body");r.async&&s.traverse(b),s.traverse(g,{context:n});var u=[],l=[];s.get("body").forEach(function(e){var t=e.node;t&&null!=t._blockHoist?u.push(t):l.push(t)}),u.length>0&&(s.node.body=l);var c=a(e);f.assertIdentifier(r.id);var h=f.identifier(r.id.name+"$"),v=(0,p.hoist)(e),y=o(e,i);y&&(v=v||f.variableDeclaration("var",[]),v.declarations.push(f.variableDeclarator(i,f.identifier("arguments"))));var E=new d.Emitter(n);E.explode(e.get("body")),v&&v.declarations.length>0&&u.push(v);var x=[E.getContextFunction(h),r.generator?c:f.nullLiteral(),f.thisExpression()],A=E.getTryLocsList();A&&x.push(A);var _=f.callExpression(m.runtimeProperty(r.async?"async":"wrap"),x);u.push(f.returnStatement(_)),r.body=f.blockStatement(u);var D=r.generator;D&&(r.generator=!1),r.async&&(r.async=!1),D&&f.isExpression(r)&&e.replaceWith(f.callExpression(m.runtimeProperty("mark"),[r])),e.requeue()}}};var y={"FunctionExpression|FunctionDeclaration":function(e){e.skip()},Identifier:function(e,t){"arguments"===e.node.name&&m.isReference(e)&&(e.replaceWith(t.argsId),t.didRenameArguments=!0)}},g={MetaProperty:function(e){var t=e.node;"function"===t.meta.name&&"sent"===t.property.name&&e.replaceWith(f.memberExpression(this.context,f.identifier("_sent")))}},b={Function:function(e){e.skip()},AwaitExpression:function(e){var t=e.node.argument;e.replaceWith(f.yieldExpression(f.callExpression(m.runtimeProperty("awrap"),[t]),!1))}}},function(e,t){"use strict";e.exports={builtins:{Symbol:"symbol",Promise:"promise",Map:"map",WeakMap:"weak-map",Set:"set",WeakSet:"weak-set",Observable:"observable",setImmediate:"set-immediate",clearImmediate:"clear-immediate",asap:"asap"},methods:{Array:{concat:"array/concat",copyWithin:"array/copy-within",entries:"array/entries",every:"array/every",fill:"array/fill",filter:"array/filter",findIndex:"array/find-index",find:"array/find",forEach:"array/for-each",from:"array/from",includes:"array/includes",indexOf:"array/index-of",join:"array/join",keys:"array/keys",lastIndexOf:"array/last-index-of",map:"array/map",of:"array/of",pop:"array/pop",push:"array/push",reduceRight:"array/reduce-right",reduce:"array/reduce",reverse:"array/reverse",shift:"array/shift",slice:"array/slice",some:"array/some",sort:"array/sort",splice:"array/splice",unshift:"array/unshift",values:"array/values"},JSON:{stringify:"json/stringify"},Object:{assign:"object/assign",create:"object/create",defineProperties:"object/define-properties",defineProperty:"object/define-property",entries:"object/entries",freeze:"object/freeze",getOwnPropertyDescriptor:"object/get-own-property-descriptor",getOwnPropertyDescriptors:"object/get-own-property-descriptors",getOwnPropertyNames:"object/get-own-property-names",getOwnPropertySymbols:"object/get-own-property-symbols",getPrototypeOf:"object/get-prototype-of",isExtensible:"object/is-extensible",isFrozen:"object/is-frozen",isSealed:"object/is-sealed",is:"object/is",keys:"object/keys",preventExtensions:"object/prevent-extensions",seal:"object/seal",setPrototypeOf:"object/set-prototype-of",values:"object/values"},RegExp:{escape:"regexp/escape"},Math:{acosh:"math/acosh",asinh:"math/asinh",atanh:"math/atanh",cbrt:"math/cbrt",clz32:"math/clz32",cosh:"math/cosh",expm1:"math/expm1",fround:"math/fround",hypot:"math/hypot",imul:"math/imul",log10:"math/log10",log1p:"math/log1p",log2:"math/log2",sign:"math/sign",sinh:"math/sinh",tanh:"math/tanh",trunc:"math/trunc",iaddh:"math/iaddh",isubh:"math/isubh",imulh:"math/imulh",umulh:"math/umulh"},Symbol:{asyncIterator:"symbol/async-iterator",for:"symbol/for",hasInstance:"symbol/has-instance",isConcatSpreadable:"symbol/is-concat-spreadable",iterator:"symbol/iterator",keyFor:"symbol/key-for",match:"symbol/match",observable:"symbol/observable",replace:"symbol/replace",search:"symbol/search",species:"symbol/species",split:"symbol/split",toPrimitive:"symbol/to-primitive",toStringTag:"symbol/to-string-tag",unscopables:"symbol/unscopables"},String:{at:"string/at",codePointAt:"string/code-point-at",endsWith:"string/ends-with",fromCodePoint:"string/from-code-point",includes:"string/includes",matchAll:"string/match-all",padLeft:"string/pad-left",padRight:"string/pad-right",padStart:"string/pad-start",padEnd:"string/pad-end",raw:"string/raw",repeat:"string/repeat",startsWith:"string/starts-with",trim:"string/trim",trimLeft:"string/trim-left",trimRight:"string/trim-right",trimStart:"string/trim-start",trimEnd:"string/trim-end"},Number:{EPSILON:"number/epsilon",isFinite:"number/is-finite",isInteger:"number/is-integer",isNaN:"number/is-nan",isSafeInteger:"number/is-safe-integer",MAX_SAFE_INTEGER:"number/max-safe-integer",MIN_SAFE_INTEGER:"number/min-safe-integer",parseFloat:"number/parse-float",parseInt:"number/parse-int"},Reflect:{apply:"reflect/apply",construct:"reflect/construct",defineProperty:"reflect/define-property",deleteProperty:"reflect/delete-property",enumerate:"reflect/enumerate",getOwnPropertyDescriptor:"reflect/get-own-property-descriptor",getPrototypeOf:"reflect/get-prototype-of",get:"reflect/get",has:"reflect/has",isExtensible:"reflect/is-extensible",ownKeys:"reflect/own-keys",preventExtensions:"reflect/prevent-extensions",setPrototypeOf:"reflect/set-prototype-of",set:"reflect/set",defineMetadata:"reflect/define-metadata",deleteMetadata:"reflect/delete-metadata",getMetadata:"reflect/get-metadata",getMetadataKeys:"reflect/get-metadata-keys",getOwnMetadata:"reflect/get-own-metadata",getOwnMetadataKeys:"reflect/get-own-metadata-keys",hasMetadata:"reflect/has-metadata",hasOwnMetadata:"reflect/has-own-metadata",metadata:"reflect/metadata"},System:{global:"system/global"},Error:{isError:"error/is-error"},Date:{},Function:{}}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.definitions=void 0,t.default=function(e){function t(e){return e.moduleName||"babel-runtime"}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var n=e.types,i=["interopRequireWildcard","interopRequireDefault"];return{pre:function(e){var r=t(this.opts);this.opts.helpers!==!1&&e.set("helperGenerator",function(t){if(i.indexOf(t)<0)return e.addImport(r+"/helpers/"+t,"default",t)}),this.setDynamic("regeneratorIdentifier",function(){return e.addImport(r+"/regenerator","default","regeneratorRuntime")})},visitor:{ReferencedIdentifier:function(e,i){var s=e.node,o=e.parent,u=e.scope;if("regeneratorRuntime"===s.name&&i.opts.regenerator!==!1)return void e.replaceWith(i.get("regeneratorIdentifier"));if(i.opts.polyfill!==!1&&!n.isMemberExpression(o)&&r(a.default.builtins,s.name)&&!u.getBindingIdentifier(s.name)){var l=t(i.opts);e.replaceWith(i.addImport(l+"/core-js/"+a.default.builtins[s.name],"default",s.name))}},CallExpression:function(e,r){if(r.opts.polyfill!==!1&&!e.node.arguments.length){var i=e.node.callee;if(n.isMemberExpression(i)&&i.computed&&e.get("callee.property").matchesPattern("Symbol.iterator")){var a=t(r.opts);e.replaceWith(n.callExpression(r.addImport(a+"/core-js/get-iterator","default","getIterator"),[i.object]))}}},BinaryExpression:function(e,r){if(r.opts.polyfill!==!1&&"in"===e.node.operator&&e.get("left").matchesPattern("Symbol.iterator")){var i=t(r.opts);e.replaceWith(n.callExpression(r.addImport(i+"/core-js/is-iterable","default","isIterable"),[e.node.right]))}},MemberExpression:{enter:function(e,i){if(i.opts.polyfill!==!1&&e.isReferenced()){var s=e.node,o=s.object,u=s.property;if(n.isReferenced(o,s)&&!s.computed&&r(a.default.methods,o.name)){var l=a.default.methods[o.name];if(r(l,u.name)&&!e.scope.getBindingIdentifier(o.name)){if("Object"===o.name&&"defineProperty"===u.name&&e.parentPath.isCallExpression()){var c=e.parentPath.node;if(3===c.arguments.length&&n.isLiteral(c.arguments[1]))return}var f=t(i.opts);e.replaceWith(i.addImport(f+"/core-js/"+l[u.name],"default",o.name+"$"+u.name))}}}},exit:function(e,i){if(i.opts.polyfill!==!1&&e.isReferenced()){var s=e.node,o=s.object;if(r(a.default.builtins,o.name)&&!e.scope.getBindingIdentifier(o.name)){var u=t(i.opts);e.replaceWith(n.memberExpression(i.addImport(u+"/core-js/"+a.default.builtins[o.name],"default",o.name),s.property,s.computed))}}}}}}};var i=r(351),a=n(i);t.definitions=a.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){var t=e.messages;return{visitor:{ReferencedIdentifier:function(e){var r=e.node,n=e.scope,i=n.getBinding(r.name);if(i&&"type"===i.kind&&!e.parentPath.isFlow())throw e.buildCodeFrameError(t.get("undeclaredVariableType",r.name),ReferenceError);if(!n.hasBinding(r.name)){var s=n.getAllBindings(),o=void 0,u=-1;for(var l in s){var c=(0,a.default)(r.name,l);c<=0||c>3||c<=u||(o=l,u=c)}var f=void 0;throw f=o?t.get("undeclaredVariableSuggestion",r.name,o):t.get("undeclaredVariable",r.name),e.buildCodeFrameError(f,ReferenceError)}}}}};var i=r(466),a=n(i);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return{presets:[t.es2015!==!1&&[a.default.buildPreset,t.es2015],t.es2016!==!1&&o.default,t.es2017!==!1&&l.default].filter(Boolean)}};var i=r(216),a=n(i),s=r(217),o=n(s),u=r(218),l=n(u);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(212),a=n(i),s=r(208),o=n(s),u=r(67),l=n(u),c=r(126),f=n(c),p=r(211),d=n(p);t.default={plugins:[a.default,o.default,l.default,f.default,d.default],env:{development:{plugins:[]}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(219),a=n(i),s=r(203),o=n(s),u=r(209),l=n(u);t.default={presets:[a.default],plugins:[o.default,l.default]},e.exports=t.default},function(e,t,r){e.exports={default:r(404),__esModule:!0}},function(e,t,r){e.exports={default:r(407),__esModule:!0}},function(e,t,r){e.exports={default:r(409),__esModule:!0}},function(e,t,r){e.exports={default:r(410),__esModule:!0}},function(e,t,r){e.exports={default:r(412),__esModule:!0}},function(e,t,r){e.exports={default:r(413),__esModule:!0}},function(e,t,r){e.exports={default:r(414),__esModule:!0}},function(e,t){"use strict";t.__esModule=!0,t.default=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}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(2),s=i(a),o=r(3),u=i(o),l=r(35),c=i(l),f=r(1),p=n(f),d=!1,h=function(){function e(t,r,n,i){(0,u.default)(this,e),this.queue=null,this.parentPath=i,this.scope=t,this.state=n,this.opts=r}return e.prototype.shouldVisit=function(e){var t=this.opts;if(t.enter||t.exit)return!0;if(t[e.type])return!0;var r=p.VISITOR_KEYS[e.type];if(!r||!r.length)return!1;for(var n=r,i=Array.isArray(n),a=0,n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var u=o;if(e[u])return!0}return!1},e.prototype.create=function(e,t,r,n){return c.default.get({parentPath:this.parentPath,parent:e,container:t,key:r,listKey:n})},e.prototype.maybeQueue=function(e,t){if(this.trap)throw new Error("Infinite cycle detected");this.queue&&(t?this.queue.push(e):this.priorityQueue.push(e))},e.prototype.visitMultiple=function(e,t,r){if(0===e.length)return!1;for(var n=[],i=0;i<e.length;i++){var a=e[i];a&&this.shouldVisit(a)&&n.push(this.create(t,e,i,r))}return this.visitQueue(n)},e.prototype.visitSingle=function(e,t){return!!this.shouldVisit(e[t])&&this.visitQueue([this.create(e,e,t)])},e.prototype.visitQueue=function(e){this.queue=e,this.priorityQueue=[];for(var t=[],r=!1,n=e,i=Array.isArray(n),a=0,n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var u=o;if(u.resync(),0!==u.contexts.length&&u.contexts[u.contexts.length-1]===this||u.pushContext(this),null!==u.key&&(d&&e.length>=1e4&&(this.trap=!0),!(t.indexOf(u.node)>=0))){if(t.push(u.node),u.visit()){r=!0;break}if(this.priorityQueue.length&&(r=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=e,r))break}}for(var l=e,c=Array.isArray(l),f=0,l=c?l:(0,s.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var h=p;h.popContext()}return this.queue=null,r},e.prototype.visit=function(e,t){var r=e[t];return!!r&&(Array.isArray(r)?this.visitMultiple(r,e,t):this.visitSingle(e,t))},e}();t.default=h,e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){for(var t=this;t=t.parentPath;)if(e(t))return t;return null}function s(e){var t=this;do if(e(t))return t;while(t=t.parentPath);return null}function o(){return this.findParent(function(e){return e.isFunction()||e.isProgram()})}function u(){var e=this;do if(Array.isArray(e.container))return e;while(e=e.parentPath)}function l(e){return this.getDeepestCommonAncestorFrom(e,function(e,t,r){for(var n=void 0,i=b.VISITOR_KEYS[e.type],a=r,s=Array.isArray(a),o=0,a=s?a:(0,y.default)(a);;){var u;if(s){if(o>=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u,c=l[t+1];if(n)if(c.listKey&&n.listKey===c.listKey&&c.key<n.key)n=c;else{var f=i.indexOf(n.parentKey),p=i.indexOf(c.parentKey);f>p&&(n=c)}else n=c}return n})}function c(e,t){var r=this;if(!e.length)return this;if(1===e.length)return e[0]; var n=1/0,i=void 0,a=void 0,s=e.map(function(e){var t=[];do t.unshift(e);while((e=e.parentPath)&&e!==r);return t.length<n&&(n=t.length),t}),o=s[0];e:for(var u=0;u<n;u++){for(var l=o[u],c=s,f=Array.isArray(c),p=0,c=f?c:(0,y.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;if(h[u]!==l)break e}i=u,a=l}if(a)return t?t(a,i,s):a;throw new Error("Couldn't find intersection")}function f(){var e=this,t=[];do t.push(e);while(e=e.parentPath);return t}function p(e){return e.isDescendant(this)}function d(e){return!!this.findParent(function(t){return t===e})}function h(){for(var e=this;e;){for(var t=arguments,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;if(e.node.type===a)return!0}e=e.parentPath}return!1}function m(e){var t=this.isFunction()?this:this.findParent(function(e){return e.isFunction()});if(t){if(t.isFunctionExpression()||t.isFunctionDeclaration()){var r=t.node.shadow;if(r&&(!e||r[e]!==!1))return t}else if(t.isArrowFunctionExpression())return t;return null}}t.__esModule=!0;var v=r(2),y=i(v);t.findParent=a,t.find=s,t.getFunctionParent=o,t.getStatementParent=u,t.getEarliestCommonAncestorFrom=l,t.getDeepestCommonAncestorFrom=c,t.getAncestry=f,t.isAncestor=p,t.isDescendant=d,t.inType=h,t.inShadow=m;var g=r(1),b=n(g),E=r(35);i(E)},function(e,t){"use strict";function r(){var e=this.node;if(e){var t=e.trailingComments,r=e.leadingComments;if(t||r){var n=this.getSibling(this.key-1),i=this.getSibling(this.key+1);n.node||(n=i),i.node||(i=n),n.addComments("trailing",r),i.addComments("leading",t)}}}function n(e,t,r){this.addComments(e,[{type:r?"CommentLine":"CommentBlock",value:t}])}function i(e,t){if(t){var r=this.node;if(r){var n=e+"Comments";r[n]?r[n]=r[n].concat(t):r[n]=t}}}t.__esModule=!0,t.shareCommentsWithSiblings=r,t.addComment=n,t.addComments=i},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=this.opts;return this.debug(function(){return e}),!(!this.node||!this._call(t[e]))||!!this.node&&this._call(t[this.node.type]&&t[this.node.type][e])}function a(e){if(!e)return!1;for(var t=e,r=Array.isArray(t),n=0,t=r?t:(0,C.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;if(a){var s=this.node;if(!s)return!0;var o=a.call(this.state,this,this.state);if(o)throw new Error("Unexpected return value from visitor method "+a);if(this.node!==s)return!0;if(this.shouldStop||this.shouldSkip||this.removed)return!0}}return!1}function s(){var e=this.opts.blacklist;return e&&e.indexOf(this.node.type)>-1}function o(){return!!this.node&&(!this.isBlacklisted()&&((!this.opts.shouldSkip||!this.opts.shouldSkip(this))&&(this.call("enter")||this.shouldSkip?(this.debug(function(){return"Skip..."}),this.shouldStop):(this.debug(function(){return"Recursing into..."}),w.default.node(this.node,this.opts,this.scope,this.state,this,this.skipKeys),this.call("exit"),this.shouldStop))))}function u(){this.shouldSkip=!0}function l(e){this.skipKeys[e]=!0}function c(){this.shouldStop=!0,this.shouldSkip=!0}function f(){if(!this.opts||!this.opts.noScope){var e=this.context&&this.context.scope;if(!e)for(var t=this.parentPath;t&&!e;){if(t.opts&&t.opts.noScope)return;e=t.scope,t=t.parentPath}this.scope=this.getScope(e),this.scope&&this.scope.init()}}function p(e){return this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.skipKeys={},e&&(this.context=e,this.state=e.state,this.opts=e.opts),this.setScope(),this}function d(){this.removed||(this._resyncParent(),this._resyncList(),this._resyncKey())}function h(){this.parentPath&&(this.parent=this.parentPath.node)}function m(){if(this.container&&this.node!==this.container[this.key]){if(Array.isArray(this.container)){for(var e=0;e<this.container.length;e++)if(this.container[e]===this.node)return this.setKey(e)}else for(var t in this.container)if(this.container[t]===this.node)return this.setKey(t);this.key=null}}function v(){if(this.parent&&this.inList){var e=this.parent[this.listKey];this.container!==e&&(this.container=e||null)}}function y(){null!=this.key&&this.container&&this.container[this.key]===this.node||this._markRemoved()}function g(){this.contexts.pop(),this.setContext(this.contexts[this.contexts.length-1])}function b(e){this.contexts.push(e),this.setContext(e)}function E(e,t,r,n){this.inList=!!r,this.listKey=r,this.parentKey=r||n,this.container=t,this.parentPath=e||this.parentPath,this.setKey(n)}function x(e){this.key=e,this.node=this.container[this.key],this.type=this.node&&this.node.type}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;if(!e.removed)for(var t=this.contexts,r=t,n=Array.isArray(r),i=0,r=n?r:(0,C.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a;s.maybeQueue(e)}}function _(){for(var e=this,t=this.contexts;!t.length;)e=e.parentPath,t=e.contexts;return t}t.__esModule=!0;var D=r(2),C=n(D);t.call=i,t._call=a,t.isBlacklisted=s,t.visit=o,t.skip=u,t.skipKey=l,t.stop=c,t.setScope=f,t.setContext=p,t.resync=d,t._resyncParent=h,t._resyncKey=m,t._resyncList=v,t._resyncRemoved=y,t.popContext=g,t.pushContext=b,t.setup=E,t.setKey=x,t.requeue=A,t._getQueueContexts=_;var S=r(8),w=n(S)},function(e,t,r){"use strict";function n(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}function i(){var e=this.node,t=void 0;if(this.isMemberExpression())t=e.property;else{if(!this.isProperty()&&!this.isMethod())throw new ReferenceError("todo");t=e.key}return e.computed||u.isIdentifier(t)&&(t=u.stringLiteral(t.name)),t}function a(){return u.ensureBlock(this.node)}function s(){if(this.isArrowFunctionExpression()){this.ensureBlock();var e=this.node;e.expression=!1,e.type="FunctionExpression",e.shadow=e.shadow||!0}}t.__esModule=!0,t.toComputedKey=i,t.ensureBlock=a,t.arrowFunctionToShadowed=s;var o=r(1),u=n(o)},function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){var e=this.evaluate();if(e.confident)return!!e.value}function a(){function t(e){i&&(a=e,i=!1)}function r(e){var r=e.node;if(s.has(r)){var a=s.get(r);return a.resolved?a.value:void t(e)}var o={resolved:!1};s.set(r,o);var u=n(e);return i&&(o.resolved=!0,o.value=u),u}function n(n){if(i){var a=n.node;if(n.isSequenceExpression()){var s=n.get("expressions");return r(s[s.length-1])}if(n.isStringLiteral()||n.isNumericLiteral()||n.isBooleanLiteral())return a.value;if(n.isNullLiteral())return null;if(n.isTemplateLiteral()){for(var u="",c=0,f=n.get("expressions"),h=a.quasis,m=Array.isArray(h),v=0,h=m?h:(0,l.default)(h);;){var y;if(m){if(v>=h.length)break;y=h[v++]}else{if(v=h.next(),v.done)break;y=v.value}var g=y;if(!i)break;u+=g.value.cooked;var b=f[c++];b&&(u+=String(r(b)))}if(!i)return;return u}if(n.isConditionalExpression()){var E=r(n.get("test"));if(!i)return;return r(E?n.get("consequent"):n.get("alternate"))}if(n.isExpressionWrapper())return r(n.get("expression"));if(n.isMemberExpression()&&!n.parentPath.isCallExpression({callee:a})){var x=n.get("property"),A=n.get("object");if(A.isLiteral()&&x.isIdentifier()){var _=A.node.value,D="undefined"==typeof _?"undefined":(0,o.default)(_);if("number"===D||"string"===D)return _[x.node.name]}}if(n.isReferencedIdentifier()){var C=n.scope.getBinding(a.name);if(C&&C.constantViolations.length>0)return t(C.path);if(C&&C.hasValue)return C.value;if("undefined"===a.name)return;if("Infinity"===a.name)return 1/0;if("NaN"===a.name)return NaN;var S=n.resolve();return S===n?t(n):r(S)}if(n.isUnaryExpression({prefix:!0})){if("void"===a.operator)return;var w=n.get("argument");if("typeof"===a.operator&&(w.isFunction()||w.isClass()))return"function";var F=r(w);if(!i)return;switch(a.operator){case"!":return!F;case"+":return+F;case"-":return-F;case"~":return~F;case"typeof":return"undefined"==typeof F?"undefined":(0,o.default)(F)}}if(n.isArrayExpression()){for(var k=[],P=n.get("elements"),T=P,O=Array.isArray(T),B=0,T=O?T:(0,l.default)(T);;){var R;if(O){if(B>=T.length)break;R=T[B++]}else{if(B=T.next(),B.done)break;R=B.value}var I=R;if(I=I.evaluate(),!I.confident)return t(I);k.push(I.value)}return k}if(n.isObjectExpression()){for(var M={},N=n.get("properties"),L=N,j=Array.isArray(L),U=0,L=j?L:(0,l.default)(L);;){var V;if(j){if(U>=L.length)break;V=L[U++]}else{if(U=L.next(),U.done)break;V=U.value}var G=V;if(G.isObjectMethod()||G.isSpreadProperty())return t(G);var W=G.get("key"),Y=W;if(G.node.computed){if(Y=Y.evaluate(),!Y.confident)return t(W);Y=Y.value}else Y=Y.isIdentifier()?Y.node.name:Y.node.value;var q=G.get("value"),K=q.evaluate();if(!K.confident)return t(q);K=K.value,M[Y]=K}return M}if(n.isLogicalExpression()){var H=i,J=r(n.get("left")),X=i;i=H;var z=r(n.get("right")),$=i;switch(i=X&&$,a.operator){case"||":if(J&&X)return i=!0,J;if(!i)return;return J||z;case"&&":if((!J&&X||!z&&$)&&(i=!0),!i)return;return J&&z}}if(n.isBinaryExpression()){var Q=r(n.get("left"));if(!i)return;var Z=r(n.get("right"));if(!i)return;switch(a.operator){case"-":return Q-Z;case"+":return Q+Z;case"/":return Q/Z;case"*":return Q*Z;case"%":return Q%Z;case"**":return Math.pow(Q,Z);case"<":return Q<Z;case">":return Q>Z;case"<=":return Q<=Z;case">=":return Q>=Z;case"==":return Q==Z;case"!=":return Q!=Z;case"===":return Q===Z;case"!==":return Q!==Z;case"|":return Q|Z;case"&":return Q&Z;case"^":return Q^Z;case"<<":return Q<<Z;case">>":return Q>>Z;case">>>":return Q>>>Z}}if(n.isCallExpression()){var ee=n.get("callee"),te=void 0,re=void 0;if(ee.isIdentifier()&&!n.scope.getBinding(ee.node.name,!0)&&p.indexOf(ee.node.name)>=0&&(re=e[a.callee.name]),ee.isMemberExpression()){var ne=ee.get("object"),ie=ee.get("property");if(ne.isIdentifier()&&ie.isIdentifier()&&p.indexOf(ne.node.name)>=0&&d.indexOf(ie.node.name)<0&&(te=e[ne.node.name],re=te[ie.node.name]),ne.isLiteral()&&ie.isIdentifier()){var ae=(0,o.default)(ne.node.value);"string"!==ae&&"number"!==ae||(te=ne.node.value,re=te[ie.node.name])}}if(re){var se=n.get("arguments").map(r);if(!i)return;return re.apply(te,se)}}t(n)}}var i=!0,a=void 0,s=new f.default,u=r(this);return i||(u=void 0),{confident:i,deopt:a,value:u}}t.__esModule=!0;var s=r(7),o=n(s),u=r(2),l=n(u),c=r(132),f=n(c);t.evaluateTruthy=i,t.evaluate=a;var p=["String","Number","Math"],d=["random"]}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(){var e=this;do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement())break;e=e.parentPath}while(e);if(e&&(e.isProgram()||e.isFile()))throw new Error("File/Program node, we can't possibly find a statement parent to this");return e}function s(){return"left"===this.key?this.getSibling("right"):"right"===this.key?this.getSibling("left"):void 0}function o(){var e=[],t=function(t){t&&(e=e.concat(t.getCompletionRecords()))};if(this.isIfStatement())t(this.get("consequent")),t(this.get("alternate"));else if(this.isDoExpression()||this.isFor()||this.isWhile())t(this.get("body"));else if(this.isProgram()||this.isBlockStatement())t(this.get("body").pop());else{if(this.isFunction())return this.get("body").getCompletionRecords();this.isTryStatement()?(t(this.get("block")),t(this.get("handler")),t(this.get("finalizer"))):e.push(this)}return e}function u(e){return y.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:e})}function l(e,t){t===!0&&(t=this.context);var r=e.split(".");return 1===r.length?this._getKey(e,t):this._getPattern(r,t)}function c(e,t){var r=this,n=this.node,i=n[e];return Array.isArray(i)?i.map(function(a,s){return y.default.get({listKey:e,parentPath:r,parent:n,container:i,key:s}).setContext(t)}):y.default.get({parentPath:this,parent:n,container:n,key:e}).setContext(t)}function f(e,t){for(var r=this,n=e,i=Array.isArray(n),a=0,n=i?n:(0,m.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;r="."===o?r.parentPath:Array.isArray(r)?r[o]:r.get(o,t)}return r}function p(e){return b.getBindingIdentifiers(this.node,e)}function d(e){return b.getOuterBindingIdentifiers(this.node,e)}t.__esModule=!0;var h=r(2),m=i(h);t.getStatementParent=a,t.getOpposite=s,t.getCompletionRecords=o,t.getSibling=u,t.get=l,t._getKey=c,t._getPattern=f,t.getBindingIdentifiers=p,t.getOuterBindingIdentifiers=d;var v=r(35),y=i(v),g=r(1),b=n(g)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(){if(this.typeAnnotation)return this.typeAnnotation;var e=this._getTypeAnnotation()||y.anyTypeAnnotation();return y.isTypeAnnotation(e)&&(e=e.typeAnnotation),this.typeAnnotation=e}function s(){var e=this.node;{if(e){if(e.typeAnnotation)return e.typeAnnotation;var t=m[e.type];return t?t.call(this,e):(t=m[this.parentPath.type],t&&t.validParent?this.parentPath.getTypeAnnotation():void 0)}if("init"===this.key&&this.parentPath.isVariableDeclarator()){var r=this.parentPath.parentPath,n=r.parentPath;return"left"===r.key&&n.isForInStatement()?y.stringTypeAnnotation():"left"===r.key&&n.isForOfStatement()?y.anyTypeAnnotation():y.voidTypeAnnotation()}}}function o(e,t){return u(e,this.getTypeAnnotation(),t)}function u(e,t,r){if("string"===e)return y.isStringTypeAnnotation(t);if("number"===e)return y.isNumberTypeAnnotation(t);if("boolean"===e)return y.isBooleanTypeAnnotation(t);if("any"===e)return y.isAnyTypeAnnotation(t);if("mixed"===e)return y.isMixedTypeAnnotation(t);if("empty"===e)return y.isEmptyTypeAnnotation(t);if("void"===e)return y.isVoidTypeAnnotation(t);if(r)return!1;throw new Error("Unknown base type "+e)}function l(e){var t=this.getTypeAnnotation();if(y.isAnyTypeAnnotation(t))return!0;if(y.isUnionTypeAnnotation(t)){for(var r=t.types,n=Array.isArray(r),i=0,r=n?r:(0,d.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a;if(y.isAnyTypeAnnotation(s)||u(e,s,!0))return!0}return!1}return u(e,t,!0)}function c(e){var t=this.getTypeAnnotation();if(e=e.getTypeAnnotation(),!y.isAnyTypeAnnotation(t)&&y.isFlowBaseAnnotation(t))return e.type===t.type}function f(e){var t=this.getTypeAnnotation();return y.isGenericTypeAnnotation(t)&&y.isIdentifier(t.id,{name:e})}t.__esModule=!0;var p=r(2),d=i(p);t.getTypeAnnotation=a,t._getTypeAnnotation=s,t.isBaseType=o,t.couldBeBaseType=l,t.baseTypeStrictlyMatches=c,t.isGenericType=f;var h=r(374),m=n(h),v=r(1),y=n(v)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=e.scope.getBinding(t),n=[];e.typeAnnotation=d.unionTypeAnnotation(n);var i=[],a=s(r,e,i),o=l(e,t);if(o&&!function(){var e=s(r,o.ifStatement);a=a.filter(function(t){return e.indexOf(t)<0}),n.push(o.typeAnnotation)}(),a.length){a=a.concat(i);for(var u=a,c=Array.isArray(u),p=0,u=c?u:(0,f.default)(u);;){var h;if(c){if(p>=u.length)break;h=u[p++]}else{if(p=u.next(),p.done)break;h=p.value}var m=h;n.push(m.getTypeAnnotation())}}if(n.length)return d.createUnionTypeAnnotation(n)}function s(e,t,r){var n=e.constantViolations.slice();return n.unshift(e.path),n.filter(function(e){e=e.resolve();var n=e._guessExecutionStatusRelativeTo(t);return r&&"function"===n&&r.push(e),"before"===n})}function o(e,t){var r=t.node.operator,n=t.get("right").resolve(),i=t.get("left").resolve(),a=void 0;if(i.isIdentifier({name:e})?a=n:n.isIdentifier({name:e})&&(a=i),a)return"==="===r?a.getTypeAnnotation():d.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(r)>=0?d.numberTypeAnnotation():void 0;if("==="===r){var s=void 0,o=void 0;if(i.isUnaryExpression({operator:"typeof"})?(s=i,o=n):n.isUnaryExpression({operator:"typeof"})&&(s=n,o=i),(o||s)&&(o=o.resolve(),o.isLiteral())){var u=o.node.value;if("string"==typeof u&&s.get("argument").isIdentifier({name:e}))return d.createTypeAnnotationBasedOnTypeof(o.node.value)}}}function u(e){for(var t=void 0;t=e.parentPath;){if(t.isIfStatement()||t.isConditionalExpression())return"test"===e.key?void 0:t;e=t}}function l(e,t){var r=u(e);if(r){var n=r.get("test"),i=[n],a=[];do{var s=i.shift().resolve();if(s.isLogicalExpression()&&(i.push(s.get("left")),i.push(s.get("right"))),s.isBinaryExpression()){var c=o(t,s);c&&a.push(c)}}while(i.length);return a.length?{typeAnnotation:d.createUnionTypeAnnotation(a),ifStatement:r}:l(r,t)}}t.__esModule=!0;var c=r(2),f=i(c);t.default=function(e){if(this.isReferenced()){var t=this.scope.getBinding(e.name);return t?t.identifier.typeAnnotation?t.identifier.typeAnnotation:a(this,e.name):"undefined"===e.name?d.voidTypeAnnotation():"NaN"===e.name||"Infinity"===e.name?d.numberTypeAnnotation():void("arguments"===e.name)}};var p=r(1),d=n(p);e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(){var e=this.get("id");return e.isIdentifier()?this.get("init").getTypeAnnotation():void 0}function s(e){return e.typeAnnotation}function o(e){if(this.get("callee").isIdentifier())return P.genericTypeAnnotation(e.callee)}function u(){return P.stringTypeAnnotation()}function l(e){var t=e.operator;return"void"===t?P.voidTypeAnnotation():P.NUMBER_UNARY_OPERATORS.indexOf(t)>=0?P.numberTypeAnnotation():P.STRING_UNARY_OPERATORS.indexOf(t)>=0?P.stringTypeAnnotation():P.BOOLEAN_UNARY_OPERATORS.indexOf(t)>=0?P.booleanTypeAnnotation():void 0}function c(e){var t=e.operator;if(P.NUMBER_BINARY_OPERATORS.indexOf(t)>=0)return P.numberTypeAnnotation();if(P.BOOLEAN_BINARY_OPERATORS.indexOf(t)>=0)return P.booleanTypeAnnotation();if("+"===t){var r=this.get("right"),n=this.get("left");return n.isBaseType("number")&&r.isBaseType("number")?P.numberTypeAnnotation():n.isBaseType("string")||r.isBaseType("string")?P.stringTypeAnnotation():P.unionTypeAnnotation([P.stringTypeAnnotation(),P.numberTypeAnnotation()])}}function f(){return P.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(),this.get("right").getTypeAnnotation()])}function p(){return P.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(),this.get("alternate").getTypeAnnotation()])}function d(){return this.get("expressions").pop().getTypeAnnotation()}function h(){return this.get("right").getTypeAnnotation()}function m(e){var t=e.operator;if("++"===t||"--"===t)return P.numberTypeAnnotation()}function v(){return P.stringTypeAnnotation()}function y(){return P.numberTypeAnnotation()}function g(){return P.booleanTypeAnnotation()}function b(){return P.nullLiteralTypeAnnotation()}function E(){return P.genericTypeAnnotation(P.identifier("RegExp"))}function x(){return P.genericTypeAnnotation(P.identifier("Object"))}function A(){return P.genericTypeAnnotation(P.identifier("Array"))}function _(){return A()}function D(){return P.genericTypeAnnotation(P.identifier("Function"))}function C(){return w(this.get("callee"))}function S(){return w(this.get("tag"))}function w(e){if(e=e.resolve(),e.isFunction()){if(e.is("async"))return e.is("generator")?P.genericTypeAnnotation(P.identifier("AsyncIterator")):P.genericTypeAnnotation(P.identifier("Promise"));if(e.node.returnType)return e.node.returnType}}t.__esModule=!0,t.ClassDeclaration=t.ClassExpression=t.FunctionDeclaration=t.ArrowFunctionExpression=t.FunctionExpression=t.Identifier=void 0;var F=r(373);Object.defineProperty(t,"Identifier",{enumerable:!0,get:function(){return i(F).default}}),t.VariableDeclarator=a,t.TypeCastExpression=s,t.NewExpression=o,t.TemplateLiteral=u,t.UnaryExpression=l,t.BinaryExpression=c,t.LogicalExpression=f,t.ConditionalExpression=p,t.SequenceExpression=d,t.AssignmentExpression=h,t.UpdateExpression=m,t.StringLiteral=v,t.NumericLiteral=y,t.BooleanLiteral=g,t.NullLiteral=b,t.RegExpLiteral=E,t.ObjectExpression=x,t.ArrayExpression=A,t.RestElement=_,t.CallExpression=C,t.TaggedTemplateExpression=S;var k=r(1),P=n(k);s.validParent=!0,_.validParent=!0,t.FunctionExpression=D,t.ArrowFunctionExpression=D,t.FunctionDeclaration=D,t.ClassExpression=D,t.ClassDeclaration=D},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){function r(e){var t=n[a];return"*"===t||e===t}if(!this.isMemberExpression())return!1;for(var n=e.split("."),i=[this.node],a=0;i.length;){var s=i.shift();if(t&&a===n.length)return!0;if(k.isIdentifier(s)){if(!r(s.name))return!1}else if(k.isLiteral(s)){if(!r(s.value))return!1}else{if(k.isMemberExpression(s)){if(s.computed&&!k.isLiteral(s.property))return!1;i.unshift(s.property),i.unshift(s.object);continue}if(!k.isThisExpression(s))return!1;if(!r("this"))return!1}if(++a>n.length)return!1}return a===n.length}function s(e){var t=this.node&&this.node[e];return t&&Array.isArray(t)?!!t.length:!!t}function o(){return this.scope.isStatic(this.node)}function u(e){return!this.has(e)}function l(e,t){return this.node[e]===t}function c(e){return k.isType(this.type,e)}function f(){return("init"===this.key||"left"===this.key)&&this.parentPath.isFor()}function p(e){return!("body"!==this.key||!this.parentPath.isArrowFunctionExpression())&&(this.isExpression()?k.isBlockStatement(e):!!this.isBlockStatement()&&k.isExpression(e))}function d(e){var t=this,r=!0;do{var n=t.container;if(t.isFunction()&&!r)return!!e;if(r=!1,Array.isArray(n)&&t.key!==n.length-1)return!1}while((t=t.parentPath)&&!t.isProgram());return!0}function h(){return!this.parentPath.isLabeledStatement()&&!k.isBlockStatement(this.container)&&(0,w.default)(k.STATEMENT_OR_BLOCK_KEYS,this.key)}function m(e,t){if(!this.isReferencedIdentifier())return!1;var r=this.scope.getBinding(this.node.name);if(!r||"module"!==r.kind)return!1;var n=r.path,i=n.parentPath;return!!i.isImportDeclaration()&&(i.node.source.value===e&&(!t||(!(!n.isImportDefaultSpecifier()||"default"!==t)||(!(!n.isImportNamespaceSpecifier()||"*"!==t)||!(!n.isImportSpecifier()||n.node.imported.name!==t)))))}function v(){var e=this.node;return e.end?this.hub.file.code.slice(e.start,e.end):""}function y(e){return"after"!==this._guessExecutionStatusRelativeTo(e)}function g(e){var t=e.scope.getFunctionParent(),r=this.scope.getFunctionParent();if(t.node!==r.node){var n=this._guessExecutionStatusRelativeToDifferentFunctions(t);if(n)return n;e=t.path}var i=e.getAncestry();if(i.indexOf(this)>=0)return"after";var a=this.getAncestry(),s=void 0,o=void 0,u=void 0;for(u=0;u<a.length;u++){var l=a[u];if(o=i.indexOf(l),o>=0){s=l;break}}if(!s)return"before";var c=i[o-1],f=a[u-1];if(!c||!f)return"before";if(c.listKey&&c.container===f.container)return c.key>f.key?"before":"after";var p=k.VISITOR_KEYS[c.type].indexOf(c.key),d=k.VISITOR_KEYS[f.type].indexOf(f.key);return p>d?"before":"after"}function b(e){var t=e.path;if(t.isFunctionDeclaration()){var r=t.scope.getBinding(t.node.id.name);if(!r.references)return"before";for(var n=r.referencePaths,i=n,a=Array.isArray(i),s=0,i=a?i:(0,C.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o;if("callee"!==u.key||!u.parentPath.isCallExpression())return}for(var l=void 0,c=n,f=Array.isArray(c),p=0,c=f?c:(0,C.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d,m=!!h.find(function(e){return e.node===t.node});if(!m){var v=this._guessExecutionStatusRelativeTo(h);if(l){if(l!==v)return}else l=v}}return l}}function E(e,t){return this._resolve(e,t)||this}function x(e,t){var r=this;if(!(t&&t.indexOf(this)>=0))if(t=t||[],t.push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(e,t)}else if(this.isReferencedIdentifier()){var n=this.scope.getBinding(this.node.name);if(!n)return;if(!n.constant)return;if("module"===n.kind)return;if(n.path!==this){var i=function(){var i=n.path.resolve(e,t);return r.find(function(e){return e.node===i.node})?{v:void 0}:{v:i}}();if("object"===("undefined"==typeof i?"undefined":(0,_.default)(i)))return i.v}}else{if(this.isTypeCastExpression())return this.get("expression").resolve(e,t);if(e&&this.isMemberExpression()){var a=this.toComputedKey();if(!k.isLiteral(a))return;var s=a.value,o=this.get("object").resolve(e,t);if(o.isObjectExpression())for(var u=o.get("properties"),l=u,c=Array.isArray(l),f=0,l=c?l:(0,C.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;if(d.isProperty()){var h=d.get("key"),m=d.isnt("computed")&&h.isIdentifier({name:s});if(m=m||h.isLiteral({value:s}))return d.get("value").resolve(e,t)}}else if(o.isArrayExpression()&&!isNaN(+s)){var v=o.get("elements"),y=v[s];if(y)return y.resolve(e,t)}}}}t.__esModule=!0,t.is=void 0;var A=r(7),_=i(A),D=r(2),C=i(D);t.matchesPattern=a,t.has=s,t.isStatic=o,t.isnt=u,t.equals=l,t.isNodeType=c,t.canHaveVariableDeclarationOrExpression=f,t.canSwapBetweenExpressionAndStatement=p,t.isCompletionRecord=d,t.isStatementOrBlock=h,t.referencesImport=m,t.getSource=v,t.willIMaybeExecuteBefore=y,t._guessExecutionStatusRelativeTo=g,t._guessExecutionStatusRelativeToDifferentFunctions=b,t.resolve=E,t._resolve=x;var S=r(112),w=i(S),F=r(1),k=n(F);t.is=s},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(3),s=i(a),o=r(2),u=i(o),l=r(1),c=n(l),f={ReferencedIdentifier:function(e,t){if(!e.isJSXIdentifier()||!l.react.isCompatTag(e.node.name)){var r=e.scope.getBinding(e.node.name);if(r&&r===t.scope.getBinding(e.node.name))if(r.constant)t.bindings[e.node.name]=r;else for(var n=r.constantViolations,i=Array.isArray(n),a=0,n=i?n:(0,u.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;t.breakOnScopePaths=t.breakOnScopePaths.concat(o.getAncestry())}}}},p=function(){function e(t,r){(0,s.default)(this,e),this.breakOnScopePaths=[],this.bindings={},this.scopes=[],this.scope=r,this.path=t}return e.prototype.isCompatibleScope=function(e){for(var t in this.bindings){var r=this.bindings[t];if(!e.bindingIdentifierEquals(t,r.identifier))return!1}return!0},e.prototype.getCompatibleScopes=function(){var e=this.path.scope;do{if(!this.isCompatibleScope(e))break;if(this.scopes.push(e),this.breakOnScopePaths.indexOf(e.path)>=0)break}while(e=e.parent)},e.prototype.getAttachmentPath=function(){var e=this._getAttachmentPath();if(e){var t=e.scope;if(t.path===e&&(t=e.scope.parent),t.path.isProgram()||t.path.isFunction())for(var r in this.bindings)if(t.hasOwnBinding(r)){var n=this.bindings[r];if("param"!==n.kind&&n.path.getStatementParent().key>e.key)return}return e}},e.prototype._getAttachmentPath=function(){var e=this.scopes,t=e.pop();if(t){if(t.path.isFunction()){if(this.hasOwnParamBindings(t)){if(this.scope===t)return;return t.path.get("body").get("body")[0]}return this.getNextScopeStatementParent()}return t.path.isProgram()?this.getNextScopeStatementParent():void 0}},e.prototype.getNextScopeStatementParent=function(){var e=this.scopes.pop();if(e)return e.path.getStatementParent()},e.prototype.hasOwnParamBindings=function(e){for(var t in this.bindings)if(e.hasOwnBinding(t)){var r=this.bindings[t];if("param"===r.kind)return!0}return!1},e.prototype.run=function(){var e=this.path.node;if(!e._hoisted){e._hoisted=!0,this.path.traverse(f,this),this.getCompatibleScopes();var t=this.getAttachmentPath();if(t&&t.getFunctionParent()!==this.path.getFunctionParent()){var r=t.scope.generateUidIdentifier("ref");t.insertBefore([c.variableDeclaration("var",[c.variableDeclarator(r,this.path.node)])]);var n=this.path.parentPath;n.isJSXElement()&&this.path.container===n.node.children&&(r=c.JSXExpressionContainer(r)),this.path.replaceWith(r)}}},e}();t.default=p,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;t.hooks=[function(e,t){if("body"===e.key&&t.isArrowFunctionExpression())return e.replaceWith(e.scope.buildUndefinedNode()),!0},function(e,t){var r=!1;if(r=r||"test"===e.key&&(t.isWhile()||t.isSwitchCase()),r=r||"declaration"===e.key&&t.isExportDeclaration(),r=r||"body"===e.key&&t.isLabeledStatement(),r=r||"declarations"===e.listKey&&t.isVariableDeclaration()&&1===t.node.declarations.length,r=r||"expression"===e.key&&t.isExpressionStatement())return t.remove(),!0},function(e,t){if(t.isSequenceExpression()&&1===t.node.expressions.length)return t.replaceWith(t.node.expressions[0]),!0},function(e,t){if(t.isBinary())return"left"===e.key?t.replaceWith(t.node.right):t.replaceWith(t.node.left),!0},function(e,t){if(t.isIfStatement()&&("consequent"===e.key||"alternate"===e.key)||t.isLoop()&&"body"===e.key)return e.replaceWith({type:"BlockStatement",body:[]}),!0}]},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertBefore(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key)this.node&&e.push(this.node),this.replaceExpressionWithStatements(e);else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertBefore(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.push(this.node),this._replaceWith(S.blockStatement(e))}return[this]}function s(e,t){this.updateSiblingKeys(e,t.length);for(var r=[],n=0;n<t.length;n++){var i=e+n,a=t[n];if(this.container.splice(i,0,a),this.context){var s=this.context.create(this.parent,this.container,i,this.listKey);this.context.queue&&s.pushContext(this.context),r.push(s)}else r.push(D.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:i}))}for(var o=this._getQueueContexts(),u=r,l=Array.isArray(u),c=0,u=l?u:(0,b.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;p.setScope(),p.debug(function(){return"Inserted."});for(var d=o,h=Array.isArray(d),m=0,d=h?d:(0,b.default)(d);;){var v;if(h){if(m>=d.length)break;v=d[m++]}else{if(m=d.next(),m.done)break;v=m.value}var y=v;y.maybeQueue(p,!0)}}return r}function o(e){return this._containerInsert(this.key,e)}function u(e){return this._containerInsert(this.key+1,e)}function l(e){var t=e[e.length-1],r=S.isIdentifier(t)||S.isExpressionStatement(t)&&S.isIdentifier(t.expression);r&&!this.isCompletionRecord()&&e.pop()}function c(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertAfter(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key){if(this.node){var t=this.scope.generateDeclaredUidIdentifier();e.unshift(S.expressionStatement(S.assignmentExpression("=",t,this.node))),e.push(S.expressionStatement(t))}this.replaceExpressionWithStatements(e)}else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertAfter(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?"); this.node&&e.unshift(this.node),this._replaceWith(S.blockStatement(e))}return[this]}function f(e,t){if(this.parent)for(var r=E.path.get(this.parent),n=0;n<r.length;n++){var i=r[n];i.key>=e&&(i.key+=t)}}function p(e){if(!e)return[];e.constructor!==Array&&(e=[e]);for(var t=0;t<e.length;t++){var r=e[t],n=void 0;if(r?"object"!==("undefined"==typeof r?"undefined":(0,y.default)(r))?n="contains a non-object node":r.type?r instanceof D.default&&(n="has a NodePath when it expected a raw object"):n="without a type":n="has falsy node",n){var i=Array.isArray(r)?"array":"undefined"==typeof r?"undefined":(0,y.default)(r);throw new Error("Node list "+n+" with the index of "+t+" and type of "+i)}}return e}function d(e,t){this._assertUnremoved(),t=this._verifyNodeList(t);var r=D.default.get({parentPath:this,parent:this.node,container:this.node[e],listKey:e,key:0});return r.insertBefore(t)}function h(e,t){this._assertUnremoved(),t=this._verifyNodeList(t);var r=this.node[e],n=D.default.get({parentPath:this,parent:this.node,container:r,listKey:e,key:r.length});return n.replaceWithMultiple(t)}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.scope,t=new A.default(this,e);return t.run()}t.__esModule=!0;var v=r(7),y=i(v),g=r(2),b=i(g);t.insertBefore=a,t._containerInsert=s,t._containerInsertBefore=o,t._containerInsertAfter=u,t._maybePopFromStatements=l,t.insertAfter=c,t.updateSiblingKeys=f,t._verifyNodeList=p,t.unshiftContainer=d,t.pushContainer=h,t.hoist=m;var E=r(88),x=r(376),A=i(x),_=r(35),D=i(_),C=r(1),S=n(C)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){return this._assertUnremoved(),this.resync(),this._callRemovalHooks()?void this._markRemoved():(this.shareCommentsWithSiblings(),this._remove(),void this._markRemoved())}function a(){for(var e=f.hooks,t=Array.isArray(e),r=0,e=t?e:(0,c.default)(e);;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{if(r=e.next(),r.done)break;n=r.value}var i=n;if(i(this,this.parentPath))return!0}}function s(){Array.isArray(this.container)?(this.container.splice(this.key,1),this.updateSiblingKeys(this.key,-1)):this._replaceWith(null)}function o(){this.shouldSkip=!0,this.removed=!0,this.node=null}function u(){if(this.removed)throw this.buildCodeFrameError("NodePath has been removed so is read-only.")}t.__esModule=!0;var l=r(2),c=n(l);t.remove=i,t._callRemovalHooks=a,t._remove=s,t._markRemoved=o,t._assertUnremoved=u;var f=r(377)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){this.resync(),e=this._verifyNodeList(e),x.inheritLeadingComments(e[0],this.node),x.inheritTrailingComments(e[e.length-1],this.node),this.node=this.container[this.key]=null,this.insertAfter(e),this.node?this.requeue():this.remove()}function s(e){this.resync();try{e="("+e+")",e=(0,b.parse)(e)}catch(r){var t=r.loc;throw t&&(r.message+=" - make sure this is an expression.",r.message+="\n"+(0,h.default)(e,t.line,t.column+1)),r}return e=e.program.body[0].expression,v.default.removeProperties(e),this.replaceWith(e)}function o(e){if(this.resync(),this.removed)throw new Error("You can't replace this node, we've already removed it");if(e instanceof g.default&&(e=e.node),!e)throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");if(this.node!==e){if(this.isProgram()&&!x.isProgram(e))throw new Error("You can only replace a Program root node with another Program node");if(Array.isArray(e))throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");if("string"==typeof e)throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");if(this.isNodeType("Statement")&&x.isExpression(e)&&(this.canHaveVariableDeclarationOrExpression()||this.canSwapBetweenExpressionAndStatement(e)||(e=x.expressionStatement(e))),this.isNodeType("Expression")&&x.isStatement(e)&&!this.canHaveVariableDeclarationOrExpression()&&!this.canSwapBetweenExpressionAndStatement(e))return this.replaceExpressionWithStatements([e]);var t=this.node;t&&(x.inheritsComments(e,t),x.removeComments(t)),this._replaceWith(e),this.type=e.type,this.setScope(),this.requeue()}}function u(e){if(!this.container)throw new ReferenceError("Container is falsy");this.inList?x.validate(this.parent,this.key,[e]):x.validate(this.parent,this.key,e),this.debug(function(){return"Replace with "+(e&&e.type)}),this.node=this.container[this.key]=e}function l(e){this.resync();var t=x.toSequenceExpression(e,this.scope);if(x.isSequenceExpression(t)){var r=t.expressions;r.length>=2&&this.parentPath.isExpressionStatement()&&this._maybePopFromStatements(r),1===r.length?this.replaceWith(r[0]):this.replaceWith(t)}else{if(!t){var n=x.functionExpression(null,[],x.blockStatement(e));n.shadow=!0,this.replaceWith(x.callExpression(n,[])),this.traverse(A);for(var i=this.get("callee").getCompletionRecords(),a=i,s=Array.isArray(a),o=0,a=s?a:(0,p.default)(a);;){var u;if(s){if(o>=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u;if(l.isExpressionStatement()){var c=l.findParent(function(e){return e.isLoop()});if(c){var f=this.get("callee"),d=f.scope.generateDeclaredUidIdentifier("ret");f.get("body").pushContainer("body",x.returnStatement(d)),l.get("expression").replaceWith(x.assignmentExpression("=",d,l.node.expression))}else l.replaceWith(x.returnStatement(l.node.expression))}}return this.node}this.replaceWith(t)}}function c(e){return this.resync(),Array.isArray(e)?Array.isArray(this.container)?(e=this._verifyNodeList(e),this._containerInsertAfter(e),this.remove()):this.replaceWithMultiple(e):this.replaceWith(e)}t.__esModule=!0;var f=r(2),p=i(f);t.replaceWithMultiple=a,t.replaceWithSourceString=s,t.replaceWith=o,t._replaceWith=u,t.replaceExpressionWithStatements=l,t.replaceInline=c;var d=r(178),h=i(d),m=r(8),v=i(m),y=r(35),g=i(y),b=r(135),E=r(1),x=n(E),A={Function:function(e){e.skip()},VariableDeclaration:function(e){if("var"===e.node.kind){var t=e.getBindingIdentifiers();for(var r in t)e.scope.push({id:t[r]});for(var n=[],i=e.node.declarations,a=Array.isArray(i),s=0,i=a?i:(0,p.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o;u.init&&n.push(x.expressionStatement(x.assignmentExpression("=",u.id,u.init)))}e.replaceWithMultiple(n)}}}},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(3),s=i(a),o=r(224),u=(i(o),r(1)),l=n(u),c={ReferencedIdentifier:function(e,t){var r=e.node;r.name===t.oldName&&(r.name=t.newName)},Scope:function(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||e.skip()},"AssignmentExpression|Declaration":function(e,t){var r=e.getOuterBindingIdentifiers();for(var n in r)n===t.oldName&&(r[n].name=t.newName)}},f=function(){function e(t,r,n){(0,s.default)(this,e),this.newName=n,this.oldName=r,this.binding=t}return e.prototype.maybeConvertFromExportDeclaration=function(e){var t=e.parentPath.isExportDeclaration()&&e.parentPath;if(t){var r=t.isExportDefaultDeclaration();r&&(e.isFunctionDeclaration()||e.isClassDeclaration())&&!e.node.id&&(e.node.id=e.scope.generateUidIdentifier("default"));var n=e.getOuterBindingIdentifiers(),i=[];for(var a in n){var s=a===this.oldName?this.newName:a,o=r?"default":a;i.push(l.exportSpecifier(l.identifier(s),l.identifier(o)))}if(i.length){var u=l.exportNamedDeclaration(null,i);e.isFunctionDeclaration()&&(u._blockHoist=3),t.insertAfter(u),t.replaceWith(e.node)}}},e.prototype.maybeConvertFromClassFunctionDeclaration=function(e){},e.prototype.maybeConvertFromClassFunctionExpression=function(e){},e.prototype.rename=function(e){var t=this.binding,r=this.oldName,n=this.newName,i=t.scope,a=t.path,s=a.find(function(e){return e.isDeclaration()||e.isFunctionExpression()});s&&this.maybeConvertFromExportDeclaration(s),i.traverse(e||i.block,c,this),e||(i.removeOwnBinding(r),i.bindings[n]=t,this.binding.identifier.name=n),"hoisted"===t.type,s&&(this.maybeConvertFromClassFunctionDeclaration(s),this.maybeConvertFromClassFunctionExpression(s))},e}();t.default=f,e.exports=t.default},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e._exploded)return e;e._exploded=!0;for(var t in e)if(!d(t)){var r=t.split("|");if(1!==r.length){var n=e[t];delete e[t];for(var i=r,a=Array.isArray(i),o=0,i=a?i:(0,E.default)(i);;){var u;if(a){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u;e[l]=n}}}s(e),delete e.__esModule,c(e),f(e);for(var m=(0,g.default)(e),v=Array.isArray(m),y=0,m=v?m:(0,E.default)(m);;){var b;if(v){if(y>=m.length)break;b=m[y++]}else{if(y=m.next(),y.done)break;b=y.value}var x=b;if(!d(x)){var _=A[x];if(_){var D=e[x];for(var C in D)D[C]=p(_,D[C]);if(delete e[x],_.types)for(var w=_.types,k=Array.isArray(w),P=0,w=k?w:(0,E.default)(w);;){var T;if(k){if(P>=w.length)break;T=w[P++]}else{if(P=w.next(),P.done)break;T=P.value}var O=T;e[O]?h(e[O],D):e[O]=D}else h(e,D)}}}for(var B in e)if(!d(B)){var R=e[B],I=S.FLIPPED_ALIAS_KEYS[B],M=S.DEPRECATED_KEYS[B];if(M&&(console.trace("Visitor defined for "+B+" but it has been renamed to "+M),I=[M]),I){delete e[B];for(var N=I,L=Array.isArray(N),j=0,N=L?N:(0,E.default)(N);;){var U;if(L){if(j>=N.length)break;U=N[j++]}else{if(j=N.next(),j.done)break;U=j.value}var V=U,G=e[V];G?h(G,R):e[V]=(0,F.default)(R)}}}for(var W in e)d(W)||f(e[W]);return e}function s(e){if(!e._verified){if("function"==typeof e)throw new Error(D.get("traverseVerifyRootFunction"));for(var t in e)if("enter"!==t&&"exit"!==t||o(t,e[t]),!d(t)){if(S.TYPES.indexOf(t)<0)throw new Error(D.get("traverseVerifyNodeType",t));var r=e[t];if("object"===("undefined"==typeof r?"undefined":(0,v.default)(r)))for(var n in r){if("enter"!==n&&"exit"!==n)throw new Error(D.get("traverseVerifyVisitorProperty",t,n));o(t+"."+n,r[n])}}e._verified=!0}}function o(e,t){for(var r=[].concat(t),n=r,i=Array.isArray(n),a=0,n=i?n:(0,E.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;if("function"!=typeof o)throw new TypeError("Non-function found defined in "+e+" with type "+("undefined"==typeof o?"undefined":(0,v.default)(o)))}}function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2],n={},i=0;i<e.length;i++){var s=e[i],o=t[i];a(s);for(var u in s){var c=s[u];(o||r)&&(c=l(c,o,r));var f=n[u]=n[u]||{};h(f,c)}}return n}function l(e,t,r){var n={},i=function(i){var a=e[i];return Array.isArray(a)?(a=a.map(function(e){var n=e;return t&&(n=function(r){return e.call(t,r,t)}),r&&(n=r(t.key,i,n)),n}),void(n[i]=a)):"continue"};for(var a in e){i(a)}return n}function c(e){for(var t in e)if(!d(t)){var r=e[t];"function"==typeof r&&(e[t]={enter:r})}}function f(e){e.enter&&!Array.isArray(e.enter)&&(e.enter=[e.enter]),e.exit&&!Array.isArray(e.exit)&&(e.exit=[e.exit])}function p(e,t){var r=function(r){if(e.checkPath(r))return t.apply(this,arguments)};return r.toString=function(){return t.toString()},r}function d(e){return"_"===e[0]||("enter"===e||"exit"===e||"shouldSkip"===e||("blacklist"===e||"noScope"===e||"skipKeys"===e))}function h(e,t){for(var r in t)e[r]=[].concat(e[r]||[],t[r])}t.__esModule=!0;var m=r(7),v=i(m),y=r(20),g=i(y),b=r(2),E=i(b);t.explode=a,t.verify=s,t.merge=u;var x=r(223),A=n(x),_=r(19),D=n(_),C=r(1),S=n(C),w=r(110),F=i(w)},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.key||e.property;return e.computed||k.isIdentifier(t)&&(t=k.stringLiteral(t.name)),t}function s(e,t){function r(e){for(var a=!1,s=[],o=e,u=Array.isArray(o),l=0,o=u?o:(0,b.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var f=c;if(k.isExpression(f))s.push(f);else if(k.isExpressionStatement(f))s.push(f.expression);else{if(k.isVariableDeclaration(f)){if("var"!==f.kind)return i=!0;for(var p=f.declarations,d=Array.isArray(p),h=0,p=d?p:(0,b.default)(p);;){var m;if(d){if(h>=p.length)break;m=p[h++]}else{if(h=p.next(),h.done)break;m=h.value}var v=m,y=k.getBindingIdentifiers(v);for(var g in y)n.push({kind:f.kind,id:y[g]});v.init&&s.push(k.assignmentExpression("=",v.id,v.init))}a=!0;continue}if(k.isIfStatement(f)){var E=f.consequent?r([f.consequent]):t.buildUndefinedNode(),x=f.alternate?r([f.alternate]):t.buildUndefinedNode();if(!E||!x)return i=!0;s.push(k.conditionalExpression(f.test,E,x))}else{if(!k.isBlockStatement(f)){if(k.isEmptyStatement(f)){a=!0;continue}return i=!0}s.push(r(f.body))}}a=!1}return(a||0===s.length)&&s.push(t.buildUndefinedNode()),1===s.length?s[0]:k.sequenceExpression(s)}if(e&&e.length){var n=[],i=!1,a=r(e);if(!i){for(var s=0;s<n.length;s++)t.push(n[s]);return a}}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.key,r=void 0;return"method"===e.kind?o.increment()+"":(r=k.isIdentifier(t)?t.name:k.isStringLiteral(t)?(0,y.default)(t.value):(0,y.default)(k.removePropertiesDeep(k.cloneDeep(t))),e.computed&&(r="["+r+"]"),e.static&&(r="static:"+r),r)}function u(e){return e+="",e=e.replace(/[^a-zA-Z0-9$_]/g,"-"),e=e.replace(/^[-0-9]+/,""),e=e.replace(/[-\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""}),k.isValidIdentifier(e)||(e="_"+e),e||"_"}function l(e){return e=u(e),"eval"!==e&&"arguments"!==e||(e="_"+e),e}function c(e,t){if(k.isStatement(e))return e;var r=!1,n=void 0;if(k.isClass(e))r=!0,n="ClassDeclaration";else if(k.isFunction(e))r=!0,n="FunctionDeclaration";else if(k.isAssignmentExpression(e))return k.expressionStatement(e);if(r&&!e.id&&(n=!1),!n){if(t)return!1;throw new Error("cannot turn "+e.type+" to a statement")}return e.type=n,e}function f(e){if(k.isExpressionStatement(e)&&(e=e.expression),k.isExpression(e))return e;if(k.isClass(e)?e.type="ClassExpression":k.isFunction(e)&&(e.type="FunctionExpression"),!k.isExpression(e))throw new Error("cannot turn "+e.type+" to an expression");return e}function p(e,t){return k.isBlockStatement(e)?e:(k.isEmptyStatement(e)&&(e=[]),Array.isArray(e)||(k.isStatement(e)||(e=k.isFunction(t)?k.returnStatement(e):k.expressionStatement(e)),e=[e]),k.blockStatement(e))}function d(e){if(void 0===e)return k.identifier("undefined");if(e===!0||e===!1)return k.booleanLiteral(e);if(null===e)return k.nullLiteral();if((0,w.default)(e))return k.stringLiteral(e);if((0,_.default)(e))return k.numericLiteral(e);if((0,C.default)(e)){var t=e.source,r=e.toString().match(/\/([a-z]+|)$/)[1];return k.regExpLiteral(t,r)}if(Array.isArray(e))return k.arrayExpression(e.map(k.valueToNode));if((0,x.default)(e)){var n=[];for(var i in e){var a=void 0;a=k.isValidIdentifier(i)?k.identifier(i):k.stringLiteral(i),n.push(k.objectProperty(a,k.valueToNode(e[i])))}return k.objectExpression(n)}throw new Error("don't know how to turn this value into a node")}t.__esModule=!0;var h=r(357),m=i(h),v=r(34),y=i(v),g=r(2),b=i(g);t.toComputedKey=a,t.toSequenceExpression=s,t.toKeyAlias=o,t.toIdentifier=u,t.toBindingIdentifierName=l,t.toStatement=c,t.toExpression=f,t.toBlock=p,t.valueToNode=d;var E=r(275),x=i(E),A=r(274),_=i(A),D=r(276),C=i(D),S=r(175),w=i(S),F=r(1),k=n(F);o.uid=0,o.increment=function(){return o.uid>=m.default?o.uid=0:o.uid++}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(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}var a=r(1),s=i(a),o=r(134),u=r(28),l=n(u);(0,l.default)("ArrayExpression",{fields:{elements:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeOrValueType)("null","Expression","SpreadElement"))),default:[]}},visitor:["elements"],aliases:["Expression"]}),(0,l.default)("AssignmentExpression",{fields:{operator:{validate:(0,u.assertValueType)("string")},left:{validate:(0,u.assertNodeType)("LVal")},right:{validate:(0,u.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]}),(0,l.default)("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:u.assertOneOf.apply(void 0,o.BINARY_OPERATORS)},left:{validate:(0,u.assertNodeType)("Expression")},right:{validate:(0,u.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]}),(0,l.default)("Directive",{visitor:["value"],fields:{value:{validate:(0,u.assertNodeType)("DirectiveLiteral")}}}),(0,l.default)("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("string")}}}),(0,l.default)("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Directive"))),default:[]},body:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","Statement"]}),(0,l.default)("BreakStatement",{visitor:["label"],fields:{label:{validate:(0,u.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,l.default)("CallExpression",{visitor:["callee","arguments"],fields:{callee:{validate:(0,u.assertNodeType)("Expression")},arguments:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Expression","SpreadElement")))}},aliases:["Expression"]}),(0,l.default)("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0,u.assertNodeType)("Identifier")},body:{validate:(0,u.assertNodeType)("BlockStatement")}},aliases:["Scopable"]}),(0,l.default)("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},consequent:{validate:(0,u.assertNodeType)("Expression")},alternate:{validate:(0,u.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]}),(0,l.default)("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0,u.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,l.default)("DebuggerStatement",{aliases:["Statement"]}),(0,l.default)("DoWhileStatement",{visitor:["test","body"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]}),(0,l.default)("EmptyStatement",{aliases:["Statement"]}),(0,l.default)("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0,u.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]}),(0,l.default)("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0,u.assertNodeType)("Program")}}}),(0,l.default)("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,u.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")}}}),(0,l.default)("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0,u.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0,u.assertNodeType)("Expression"),optional:!0},update:{validate:(0,u.assertNodeType)("Expression"),optional:!0},body:{validate:(0,u.assertNodeType)("Statement")}}}),(0,l.default)("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","params","body","returnType","typeParameters"],fields:{id:{validate:(0,u.assertNodeType)("Identifier")},params:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("LVal")))},body:{validate:(0,u.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,u.assertValueType)("boolean")},async:{default:!1,validate:(0,u.assertValueType)("boolean")}},aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"]}),(0,l.default)("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{id:{validate:(0,u.assertNodeType)("Identifier"),optional:!0},params:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("LVal")))},body:{validate:(0,u.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,u.assertValueType)("boolean")},async:{default:!1,validate:(0,u.assertValueType)("boolean")}}}),(0,l.default)("Identifier",{builder:["name"],visitor:["typeAnnotation"],aliases:["Expression","LVal"],fields:{name:{validate:function(e,t,r){!s.isValidIdentifier(r)}},decorators:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Decorator")))}}}),(0,l.default)("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},consequent:{validate:(0,u.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0,u.assertNodeType)("Statement")}}}),(0,l.default)("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0,u.assertNodeType)("Identifier")},body:{validate:(0,u.assertNodeType)("Statement")}}}),(0,l.default)("StringLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,l.default)("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0,u.assertValueType)("number")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,l.default)("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]}),(0,l.default)("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,l.default)("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Literal"],fields:{pattern:{validate:(0,u.assertValueType)("string")},flags:{validate:(0,u.assertValueType)("string"),default:""}}}),(0,l.default)("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:u.assertOneOf.apply(void 0,o.LOGICAL_OPERATORS)},left:{validate:(0,u.assertNodeType)("Expression")},right:{validate:(0,u.assertNodeType)("Expression")}}}),(0,l.default)("MemberExpression",{builder:["object","property","computed"],visitor:["object","property"],aliases:["Expression","LVal"],fields:{object:{validate:(0,u.assertNodeType)("Expression")},property:{validate:function(e,t,r){var n=e.computed?"Expression":"Identifier";(0,u.assertNodeType)(n)(e,t,r)}},computed:{default:!1}}}),(0,l.default)("NewExpression",{visitor:["callee","arguments"],aliases:["Expression"],fields:{callee:{validate:(0,u.assertNodeType)("Expression")},arguments:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Expression","SpreadElement")))}}}),(0,l.default)("Program",{visitor:["directives","body"],builder:["body","directives"],fields:{directives:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Directive"))),default:[]},body:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","FunctionParent"]}),(0,l.default)("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("ObjectMethod","ObjectProperty","SpreadProperty")))}}}),(0,l.default)("ObjectMethod",{builder:["kind","key","params","body","computed"],fields:{kind:{validate:(0,u.chain)((0,u.assertValueType)("string"),(0,u.assertOneOf)("method","get","set")),default:"method"},computed:{validate:(0,u.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];u.assertNodeType.apply(void 0,n)(e,t,r)}},decorators:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Decorator")))},body:{validate:(0,u.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,u.assertValueType)("boolean")},async:{default:!1,validate:(0,u.assertValueType)("boolean")}},visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]}),(0,l.default)("ObjectProperty",{builder:["key","value","computed","shorthand","decorators"],fields:{computed:{validate:(0,u.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];u.assertNodeType.apply(void 0,n)(e,t,r)}},value:{validate:(0,u.assertNodeType)("Expression")},shorthand:{validate:(0,u.assertValueType)("boolean"),default:!1},decorators:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Decorator"))),optional:!0}},visitor:["key","value","decorators"],aliases:["UserWhitespacable","Property","ObjectMember"]}),(0,l.default)("RestElement",{visitor:["argument","typeAnnotation"],aliases:["LVal"],fields:{argument:{validate:(0,u.assertNodeType)("LVal")},decorators:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Decorator")))}}}),(0,l.default)("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,u.assertNodeType)("Expression"),optional:!0}}}),(0,l.default)("SequenceExpression",{visitor:["expressions"],fields:{expressions:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Expression")))}},aliases:["Expression"]}),(0,l.default)("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0,u.assertNodeType)("Expression"),optional:!0},consequent:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Statement")))}}}),(0,l.default)("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0,u.assertNodeType)("Expression")},cases:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("SwitchCase")))}}}),(0,l.default)("ThisExpression",{aliases:["Expression"]}),(0,l.default)("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,u.assertNodeType)("Expression")}}}),(0,l.default)("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{body:{validate:(0,u.assertNodeType)("BlockStatement")},handler:{optional:!0,handler:(0,u.assertNodeType)("BlockStatement")},finalizer:{optional:!0,validate:(0,u.assertNodeType)("BlockStatement")}}}),(0,l.default)("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0,u.assertNodeType)("Expression")},operator:{validate:u.assertOneOf.apply(void 0,o.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]}),(0,l.default)("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:(0,u.assertNodeType)("Expression")},operator:{validate:u.assertOneOf.apply(void 0,o.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]}),(0,l.default)("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{kind:{validate:(0,u.chain)((0,u.assertValueType)("string"),(0,u.assertOneOf)("var","let","const"))},declarations:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("VariableDeclarator")))}}}),(0,l.default)("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:(0,u.assertNodeType)("LVal")},init:{optional:!0,validate:(0,u.assertNodeType)("Expression")}}}),(0,l.default)("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("BlockStatement","Statement")}}}),(0,l.default)("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{object:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("BlockStatement","Statement")}}})},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i=r(28),a=n(i);(0,a.default)("AssignmentPattern",{visitor:["left","right"],aliases:["Pattern","LVal"],fields:{left:{validate:(0,i.assertNodeType)("Identifier")},right:{validate:(0,i.assertNodeType)("Expression")},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("ArrayPattern",{visitor:["elements","typeAnnotation"],aliases:["Pattern","LVal"],fields:{elements:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Expression")))},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["params","body","returnType","typeParameters"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{params:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("LVal")))},body:{validate:(0,i.assertNodeType)("BlockStatement","Expression")},async:{validate:(0,i.assertValueType)("boolean"),default:!1}}}),(0,a.default)("ClassBody",{visitor:["body"],fields:{body:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("ClassMethod","ClassProperty")))}}}),(0,a.default)("ClassDeclaration",{builder:["id","superClass","body","decorators"],visitor:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],aliases:["Scopable","Class","Statement","Declaration","Pureish"],fields:{id:{validate:(0,i.assertNodeType)("Identifier")},body:{validate:(0,i.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,i.assertNodeType)("Expression")},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("ClassExpression",{inherits:"ClassDeclaration",aliases:["Scopable","Class","Expression","Pureish"],fields:{id:{optional:!0,validate:(0,i.assertNodeType)("Identifier")},body:{validate:(0,i.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,i.assertNodeType)("Expression")},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("ExportAllDeclaration",{visitor:["source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{source:{validate:(0,i.assertNodeType)("StringLiteral")}}}),(0,a.default)("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"], fields:{declaration:{validate:(0,i.assertNodeType)("FunctionDeclaration","ClassDeclaration","Expression")}}}),(0,a.default)("ExportNamedDeclaration",{visitor:["declaration","specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,i.assertNodeType)("Declaration"),optional:!0},specifiers:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("ExportSpecifier")))},source:{validate:(0,i.assertNodeType)("StringLiteral"),optional:!0}}}),(0,a.default)("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,i.assertNodeType)("Identifier")},exported:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("ForOfStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,i.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,i.assertNodeType)("Expression")},body:{validate:(0,i.assertNodeType)("Statement")}}}),(0,a.default)("ImportDeclaration",{visitor:["specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration"],fields:{specifiers:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier")))},source:{validate:(0,i.assertNodeType)("StringLiteral")}}}),(0,a.default)("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("ImportSpecifier",{visitor:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,i.assertNodeType)("Identifier")},imported:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:(0,i.assertValueType)("string")},property:{validate:(0,i.assertValueType)("string")}}}),(0,a.default)("ClassMethod",{aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static"],visitor:["key","params","body","decorators","returnType","typeParameters"],fields:{kind:{validate:(0,i.chain)((0,i.assertValueType)("string"),(0,i.assertOneOf)("get","set","method","constructor")),default:"method"},computed:{default:!1,validate:(0,i.assertValueType)("boolean")},static:{default:!1,validate:(0,i.assertValueType)("boolean")},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];i.assertNodeType.apply(void 0,n)(e,t,r)}},params:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("LVal")))},body:{validate:(0,i.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,i.assertValueType)("boolean")},async:{default:!1,validate:(0,i.assertValueType)("boolean")}}}),(0,a.default)("ObjectPattern",{visitor:["properties","typeAnnotation"],aliases:["Pattern","LVal"],fields:{properties:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("RestProperty","Property")))},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("Super",{aliases:["Expression"]}),(0,a.default)("TaggedTemplateExpression",{visitor:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0,i.assertNodeType)("Expression")},quasi:{validate:(0,i.assertNodeType)("TemplateLiteral")}}}),(0,a.default)("TemplateElement",{builder:["value","tail"],fields:{value:{},tail:{validate:(0,i.assertValueType)("boolean"),default:!1}}}),(0,a.default)("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("TemplateElement")))},expressions:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Expression")))}}}),(0,a.default)("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:(0,i.assertValueType)("boolean"),default:!1},argument:{optional:!0,validate:(0,i.assertNodeType)("Expression")}}})},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i=r(28),a=n(i);(0,a.default)("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("ForAwaitStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,i.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,i.assertNodeType)("Expression")},body:{validate:(0,i.assertNodeType)("Statement")}}}),(0,a.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:{}}),(0,a.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("DoExpression",{visitor:["body"],aliases:["Expression"],fields:{body:{validate:(0,i.assertNodeType)("BlockStatement")}}}),(0,a.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("RestProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,i.assertNodeType)("LVal")}}}),(0,a.default)("SpreadProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,i.assertNodeType)("Expression")}}})},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i=r(28),a=n(i);(0,a.default)("AnyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["Flow"],fields:{}}),(0,a.default)("BooleanTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("BooleanLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,a.default)("NullLiteralTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("ClassImplements",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,a.default)("ClassProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed"],aliases:["Property"],fields:{computed:{validate:(0,i.assertValueType)("boolean"),default:!1}}}),(0,a.default)("DeclareClass",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareFunction",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareInterface",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareModule",{visitor:["id","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareVariable",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("ExistentialTypeParam",{aliases:["Flow"]}),(0,a.default)("FunctionTypeAnnotation",{visitor:["typeParameters","params","rest","returnType"],aliases:["Flow"],fields:{}}),(0,a.default)("FunctionTypeParam",{visitor:["name","typeAnnotation"],aliases:["Flow"],fields:{}}),(0,a.default)("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,a.default)("InterfaceExtends",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,a.default)("InterfaceDeclaration",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("IntersectionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,a.default)("MixedTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,a.default)("EmptyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,a.default)("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,a.default)("NumericLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,a.default)("NumberTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("StringLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,a.default)("StringTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("ThisTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("TupleTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeofTypeAnnotation",{visitor:["argument"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("TypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["Flow","ExpressionWrapper","Expression"],fields:{}}),(0,a.default)("TypeParameter",{visitor:["bound"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeParameterDeclaration",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeParameterInstantiation",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,a.default)("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties"],aliases:["Flow"],fields:{}}),(0,a.default)("ObjectTypeCallProperty",{visitor:["value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,a.default)("ObjectTypeIndexer",{visitor:["id","key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,a.default)("ObjectTypeProperty",{visitor:["key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,a.default)("QualifiedTypeIdentifier",{visitor:["id","qualification"],aliases:["Flow"],fields:{}}),(0,a.default)("UnionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,a.default)("VoidTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}})},function(e,t,r){"use strict";r(28),r(384),r(385),r(387),r(389),r(390),r(386)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i=r(28),a=n(i);(0,a.default)("JSXAttribute",{visitor:["name","value"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,i.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0,i.assertNodeType)("JSXElement","StringLiteral","JSXExpressionContainer")}}}),(0,a.default)("JSXClosingElement",{visitor:["name"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,i.assertNodeType)("JSXIdentifier","JSXMemberExpression")}}}),(0,a.default)("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["JSX","Immutable","Expression"],fields:{openingElement:{validate:(0,i.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0,i.assertNodeType)("JSXClosingElement")},children:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("JSXText","JSXExpressionContainer","JSXElement")))}}}),(0,a.default)("JSXEmptyExpression",{aliases:["JSX","Expression"]}),(0,a.default)("JSXExpressionContainer",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("JSXIdentifier",{builder:["name"],aliases:["JSX","Expression"],fields:{name:{validate:(0,i.assertValueType)("string")}}}),(0,a.default)("JSXMemberExpression",{visitor:["object","property"],aliases:["JSX","Expression"],fields:{object:{validate:(0,i.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0,i.assertNodeType)("JSXIdentifier")}}}),(0,a.default)("JSXNamespacedName",{visitor:["namespace","name"],aliases:["JSX"],fields:{namespace:{validate:(0,i.assertNodeType)("JSXIdentifier")},name:{validate:(0,i.assertNodeType)("JSXIdentifier")}}}),(0,a.default)("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","attributes"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,i.assertNodeType)("JSXIdentifier","JSXMemberExpression")},selfClosing:{default:!1,validate:(0,i.assertValueType)("boolean")},attributes:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("JSXAttribute","JSXSpreadAttribute")))}}}),(0,a.default)("JSXSpreadAttribute",{visitor:["argument"],aliases:["JSX"],fields:{argument:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("JSXText",{aliases:["JSX","Immutable"],builder:["value"],fields:{value:{validate:(0,i.assertValueType)("string")}}})},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i=r(28),a=n(i);(0,a.default)("Noop",{visitor:[]}),(0,a.default)("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0,i.assertNodeType)("Expression")}}})},function(e,t,r){"use strict";function n(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}function i(e){var t=a(e);return 1===t.length?t[0]:u.unionTypeAnnotation(t)}function a(e){for(var t={},r={},n=[],i=[],s=0;s<e.length;s++){var o=e[s];if(o&&!(i.indexOf(o)>=0)){if(u.isAnyTypeAnnotation(o))return[o];if(u.isFlowBaseAnnotation(o))r[o.type]=o;else if(u.isUnionTypeAnnotation(o))n.indexOf(o.types)<0&&(e=e.concat(o.types),n.push(o.types));else if(u.isGenericTypeAnnotation(o)){var l=o.id.name;if(t[l]){var c=t[l];c.typeParameters?o.typeParameters&&(c.typeParameters.params=a(c.typeParameters.params.concat(o.typeParameters.params))):c=o.typeParameters}else t[l]=o}else i.push(o)}}for(var f in r)i.push(r[f]);for(var p in t)i.push(t[p]);return i}function s(e){if("string"===e)return u.stringTypeAnnotation();if("number"===e)return u.numberTypeAnnotation();if("undefined"===e)return u.voidTypeAnnotation();if("boolean"===e)return u.booleanTypeAnnotation();if("function"===e)return u.genericTypeAnnotation(u.identifier("Function"));if("object"===e)return u.genericTypeAnnotation(u.identifier("Object"));if("symbol"===e)return u.genericTypeAnnotation(u.identifier("Symbol"));throw new Error("Invalid typeof value")}t.__esModule=!0,t.createUnionTypeAnnotation=i,t.removeTypeDuplicates=a,t.createTypeAnnotationBasedOnTypeof=s;var o=r(1),u=n(o)},function(e,t,r){"use strict";function n(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}function i(e){return!!e&&/^[a-z]|\-/.test(e)}function a(e,t){for(var r=e.value.split(/\r\n|\n|\r/),n=0,i=0;i<r.length;i++)r[i].match(/[^ \t]/)&&(n=i);for(var a="",s=0;s<r.length;s++){var o=r[s],l=0===s,c=s===r.length-1,f=s===n,p=o.replace(/\t/g," ");l||(p=p.replace(/^[ ]+/,"")),c||(p=p.replace(/[ ]+$/,"")),p&&(f||(p+=" "),a+=p)}a&&t.push(u.stringLiteral(a))}function s(e){for(var t=[],r=0;r<e.children.length;r++){var n=e.children[r];u.isJSXText(n)?a(n,t):(u.isJSXExpressionContainer(n)&&(n=n.expression),u.isJSXEmptyExpression(n)||t.push(n))}return t}t.__esModule=!0,t.isReactComponent=void 0,t.isCompatTag=i,t.buildChildren=s;var o=r(1),u=n(o);t.isReactComponent=u.buildMatchMemberExpression("React.Component")},function(e,t,r){"use strict";function n(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}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=x.getBindingIdentifiers.keys[t.type];if(r)for(var n=0;n<r.length;n++){var i=r[n],a=t[i];if(Array.isArray(a)){if(a.indexOf(e)>=0)return!0}else if(a===e)return!0}return!1}function s(e,t){switch(t.type){case"BindExpression":return t.object===e||t.callee===e;case"MemberExpression":case"JSXMemberExpression":return!(t.property!==e||!t.computed)||t.object===e;case"MetaProperty":return!1;case"ObjectProperty":if(t.key===e)return t.computed;case"VariableDeclarator":return t.id!==e;case"ArrowFunctionExpression":case"FunctionDeclaration":case"FunctionExpression":for(var r=t.params,n=Array.isArray(r),i=0,r=n?r:(0,E.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var s=a;if(s===e)return!1}return t.id!==e;case"ExportSpecifier":return!t.source&&t.local===e;case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":return!1;case"JSXAttribute":return t.name!==e;case"ClassProperty":return t.key===e?t.computed:t.value===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return!1;case"ClassDeclaration":case"ClassExpression":return t.id!==e;case"ClassMethod":case"ObjectMethod":return t.key===e&&t.computed;case"LabeledStatement":return!1;case"CatchClause":return t.param!==e;case"RestElement":return!1;case"AssignmentExpression":return t.right===e;case"AssignmentPattern":return t.right===e;case"ObjectPattern":case"ArrayPattern":return!1}return!0}function o(e){return"string"==typeof e&&!_.default.keyword.isReservedWordES6(e,!0)&&_.default.keyword.isIdentifierNameES6(e)}function u(e){return C.isVariableDeclaration(e)&&("var"!==e.kind||e[S.BLOCK_SCOPED_SYMBOL])}function l(e){return C.isFunctionDeclaration(e)||C.isClassDeclaration(e)||C.isLet(e)}function c(e){return C.isVariableDeclaration(e,{kind:"var"})&&!e[S.BLOCK_SCOPED_SYMBOL]}function f(e){return C.isImportDefaultSpecifier(e)||C.isIdentifier(e.imported||e.exported,{name:"default"})}function p(e,t){return(!C.isBlockStatement(e)||!C.isFunction(t,{body:e}))&&C.isScopable(e)}function d(e){return!!C.isType(e.type,"Immutable")||!!C.isIdentifier(e)&&"undefined"===e.name}function h(e,t){if("object"!==("undefined"==typeof e?"undefined":(0,g.default)(e))||"object"!==("undefined"==typeof e?"undefined":(0,g.default)(e))||null==e||null==t)return e===t;if(e.type!==t.type)return!1;for(var r=(0,v.default)(C.NODE_FIELDS[e.type]||e.type),n=r,i=Array.isArray(n),a=0,n=i?n:(0,E.default)(n);;){var s;if(i){if(a>=n.length)break;s=n[a++]}else{if(a=n.next(),a.done)break;s=a.value}var o=s;if((0,g.default)(e[o])!==(0,g.default)(t[o]))return!1;if(Array.isArray(e[o])){if(!Array.isArray(t[o]))return!1;if(e[o].length!==t[o].length)return!1;for(var u=0;u<e[o].length;u++)if(!h(e[o][u],t[o][u]))return!1}else if(!h(e[o],t[o]))return!1}return!0}t.__esModule=!0;var m=r(20),v=i(m),y=r(7),g=i(y),b=r(2),E=i(b);t.isBinding=a,t.isReferenced=s,t.isValidIdentifier=o,t.isLet=u,t.isBlockScoped=l,t.isVar=c,t.isSpecifierDefault=f,t.isScope=p,t.isImmutable=d,t.isNodesEquivalent=h;var x=r(225),A=r(156),_=i(A),D=r(1),C=n(D),S=r(134)},function(e,t){function r(e,t,r){e instanceof RegExp&&(e=n(e,r)),t instanceof RegExp&&(t=n(t,r));var a=i(e,t,r);return a&&{start:a[0],end:a[1],pre:r.slice(0,a[0]),body:r.slice(a[0]+e.length,a[1]),post:r.slice(a[1]+t.length)}}function n(e,t){var r=t.match(e);return r?r[0]:null}function i(e,t,r){var n,i,a,s,o,u=r.indexOf(e),l=r.indexOf(t,u+1),c=u;if(u>=0&&l>0){for(n=[],a=r.length;c>=0&&!o;)c==u?(n.push(c),u=r.indexOf(e,c+1)):1==n.length?o=[n.pop(),l]:(i=n.pop(),i<a&&(a=i,s=l),l=r.indexOf(t,c+1)),c=u<l&&u>=0?u:l;n.length&&(o=[a,s])}return o}e.exports=r,r.range=i},function(e,t){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function n(e){return 3*e.length/4-r(e)}function i(e){var t,n,i,a,s,o,u=e.length;s=r(e),o=new c(3*u/4-s),i=s>0?u-4:u;var f=0;for(t=0,n=0;t<i;t+=4,n+=3)a=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],o[f++]=a>>16&255,o[f++]=a>>8&255,o[f++]=255&a;return 2===s?(a=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,o[f++]=255&a):1===s&&(a=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,o[f++]=a>>8&255,o[f++]=255&a),o}function a(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16)+(e[s+1]<<8)+e[s+2],i.push(a(n));return i.join("")}function o(e){for(var t,r=e.length,n=r%3,i="",a=[],o=16383,l=0,c=r-n;l<c;l+=o)a.push(s(e,l,l+o>c?c:l+o));return 1===n?(t=e[r-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),a.push(i),a.join("")}t.byteLength=n,t.toByteArray=i,t.fromByteArray=o;for(var u=[],l=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=f.length;p<d;++p)u[p]=f[p],l[f.charCodeAt(p)]=p;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,t,r){function n(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function i(e){return e.split("\\\\").join(m).split("\\{").join(v).split("\\}").join(y).split("\\,").join(g).split("\\.").join(b)}function a(e){return e.split(m).join("\\").split(v).join("{").split(y).join("}").split(g).join(",").split(b).join(".")}function s(e){if(!e)return[""];var t=[],r=h("{","}",e);if(!r)return e.split(",");var n=r.pre,i=r.body,a=r.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var u=s(a);return a.length&&(o[o.length-1]+=u.shift(),o.push.apply(o,u)),t.push.apply(t,o),t}function o(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),p(i(e),!0).map(a)):[]}function u(e){return"{"+e+"}"}function l(e){return/^-?0\d/.test(e)}function c(e,t){return e<=t}function f(e,t){return e>=t}function p(e,t){var r=[],i=h("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),m=a||o,v=/^(.*,)+(.+)?$/.test(i.body);if(!m&&!v)return i.post.match(/,.*\}/)?(e=i.pre+"{"+i.body+y+i.post,p(e)):[e];var g;if(m)g=i.body.split(/\.\./);else if(g=s(i.body),1===g.length&&(g=p(g[0],!1).map(u),1===g.length)){var b=i.post.length?p(i.post,!1):[""];return b.map(function(e){return i.pre+g[0]+e})}var E,x=i.pre,b=i.post.length?p(i.post,!1):[""];if(m){var A=n(g[0]),_=n(g[1]),D=Math.max(g[0].length,g[1].length),C=3==g.length?Math.abs(n(g[2])):1,S=c,w=_<A;w&&(C*=-1,S=f);var F=g.some(l);E=[];for(var k=A;S(k,_);k+=C){var P;if(o)P=String.fromCharCode(k),"\\"===P&&(P="");else if(P=String(k),F){var T=D-P.length;if(T>0){var O=new Array(T+1).join("0");P=k<0?"-"+O+P.slice(1):O+P}}E.push(P)}}else E=d(g,function(e){return p(e,!1)});for(var B=0;B<E.length;B++)for(var R=0;R<b.length;R++){var I=x+E[B]+b[R];(!t||m||I)&&r.push(I)}return r}var d=r(399),h=r(394);e.exports=o;var m="\0SLASH"+Math.random()+"\0",v="\0OPEN"+Math.random()+"\0",y="\0CLOSE"+Math.random()+"\0",g="\0COMMA"+Math.random()+"\0",b="\0PERIOD"+Math.random()+"\0"},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(t){"use strict";function n(e){this.enabled=e&&void 0!==e.enabled?e.enabled:f}function i(e){var t=function(){return a.apply(t,arguments)};return t._styles=e,t.enabled=this.enabled,t.__proto__=m,t}function a(){var e=arguments,t=e.length,r=0!==t&&String(arguments[0]);if(t>1)for(var n=1;n<t;n++)r+=" "+e[n];if(!this.enabled||!r)return r;var i=this._styles,a=i.length,s=u.dim.open;for(!d||i.indexOf("gray")===-1&&i.indexOf("grey")===-1||(u.dim.open="");a--;){var o=u[i[a]];r=o.open+r.replace(o.closeRe,o.open)+o.close}return u.dim.open=s,r}function s(){var e={};return Object.keys(h).forEach(function(t){e[t]={get:function(){return i.call(this,[t])}}}),e}var o=r(452),u=r(288),l=r(619),c=r(456),f=r(620),p=Object.defineProperties,d="win32"===t.platform&&!/^xterm/i.test(t.env.TERM);d&&(u.blue.open="");var h=function(){var e={};return Object.keys(u).forEach(function(t){u[t].closeRe=new RegExp(o(u[t].close),"g"),e[t]={get:function(){return i.call(this,this._styles.concat(t))}}}),e}(),m=p(function(){},h);p(n.prototype,s()),e.exports=new n,e.exports.styles=u,e.exports.hasColor=c,e.exports.stripColor=l,e.exports.supportsColor=f}).call(t,r(18))},function(e,t){e.exports=function(e,t){for(var n=[],i=0;i<e.length;i++){var a=t(e[i],i);r(a)?n.push.apply(n,a):n.push(a)}return n};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){(function(e){"use strict";function n(t){return new e(t,"base64").toString()}function i(e){return e.split(",").pop()}function a(e,t){var r=f.exec(e);f.lastIndex=0;var n=r[1]||r[2],i=l.resolve(t,n);try{return u.readFileSync(i,"utf8")}catch(e){throw new Error("An error occurred while trying to read the map file at "+i+"\n"+e)}}function s(e,t){t=t||{},t.isFileComment&&(e=a(e,t.commentFileDir)),t.hasComment&&(e=i(e)),t.isEncoded&&(e=n(e)),(t.isJSON||t.isEncoded)&&(e=JSON.parse(e)),this.sourcemap=e}function o(e){for(var r,n=e.split("\n"),i=n.length-1;i>0;i--)if(r=n[i],~r.indexOf("sourceMappingURL=data:"))return t.fromComment(r)}var u=r(116),l=r(17),c=/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+;)?base64,(.*)$/gm,f=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/gm;s.prototype.toJSON=function(e){return JSON.stringify(this.sourcemap,null,e)},s.prototype.toBase64=function(){var t=this.toJSON();return new e(t).toString("base64")},s.prototype.toComment=function(e){var t=this.toBase64(),r="sourceMappingURL=data:application/json;base64,"+t;return e&&e.multiline?"/*# "+r+" */":"//# "+r},s.prototype.toObject=function(){return JSON.parse(this.toJSON())},s.prototype.addProperty=function(e,t){if(this.sourcemap.hasOwnProperty(e))throw new Error("property %s already exists on the sourcemap, use set property instead");return this.setProperty(e,t)},s.prototype.setProperty=function(e,t){return this.sourcemap[e]=t,this},s.prototype.getProperty=function(e){return this.sourcemap[e]},t.fromObject=function(e){return new s(e)},t.fromJSON=function(e){return new s(e,{isJSON:!0})},t.fromBase64=function(e){return new s(e,{isEncoded:!0})},t.fromComment=function(e){return e=e.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),new s(e,{isEncoded:!0,hasComment:!0})},t.fromMapFileComment=function(e,t){return new s(e,{commentFileDir:t,isFileComment:!0,isJSON:!0})},t.fromSource=function(e,r){if(r){var n=o(e);return n?n:null}var i=e.match(c);return c.lastIndex=0,i?t.fromComment(i.pop()):null},t.fromMapFileSource=function(e,r){var n=e.match(f);return f.lastIndex=0,n?t.fromMapFileComment(n.pop(),r):null},t.removeComments=function(e){return c.lastIndex=0,e.replace(c,"")},t.removeMapFileComments=function(e){return f.lastIndex=0,e.replace(f,"")},t.generateMapFileComment=function(e,t){var r="sourceMappingURL="+e;return t&&t.multiline?"/*# "+r+" */":"//# "+r},Object.defineProperty(t,"commentRegex",{get:function(){return c.lastIndex=0,c}}),Object.defineProperty(t,"mapFileCommentRegex",{get:function(){return f.lastIndex=0,f}})}).call(t,r(226).Buffer)},function(e,t,r){r(56),r(154),e.exports=r(437)},function(e,t,r){var n=r(5),i=n.JSON||(n.JSON={stringify:JSON.stringify});e.exports=function(e){return i.stringify.apply(i,arguments)}},function(e,t,r){r(97),r(154),r(56),r(439),r(447),e.exports=r(5).Map},function(e,t,r){r(440),e.exports=9007199254740991},function(e,t,r){r(441),e.exports=r(5).Object.assign},function(e,t,r){r(442);var n=r(5).Object;e.exports=function(e,t){return n.create(e,t)}},function(e,t,r){r(155),e.exports=r(5).Object.getOwnPropertySymbols},function(e,t,r){r(443),e.exports=r(5).Object.keys},function(e,t,r){r(444),e.exports=r(5).Object.setPrototypeOf},function(e,t,r){r(155),e.exports=r(5).Symbol.for},function(e,t,r){r(155),r(97),r(448),r(449),e.exports=r(5).Symbol},function(e,t,r){r(154),r(56),e.exports=r(153).f("iterator")},function(e,t,r){r(97),r(56),r(445),e.exports=r(5).WeakMap},function(e,t,r){r(97),r(56),r(446),e.exports=r(5).WeakSet},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(){}},function(e,t,r){var n=r(90);e.exports=function(e,t){var r=[];return n(e,!1,r.push,r,t),r}},function(e,t,r){var n=r(37),i=r(150),a=r(436);e.exports=function(e){return function(t,r,s){var o,u=n(t),l=i(u.length),c=a(s,l);if(e&&r!=r){for(;l>c;)if(o=u[c++],o!=o)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}}},function(e,t,r){var n=r(24),i=r(231),a=r(10)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),n(t)&&(t=t[a],null===t&&(t=void 0))),void 0===t?Array:t}},function(e,t,r){var n=r(419);e.exports=function(e,t){return new(n(e))(t)}},function(e,t,r){"use strict";var n=r(25).f,i=r(91),a=r(145),s=r(53),o=r(136),u=r(89),l=r(90),c=r(142),f=r(232),p=r(434),d=r(22),h=r(55).fastKey,m=d?"_s":"size",v=function(e,t){var r,n=h(t);if("F"!==n)return e._i[n];for(r=e._f;r;r=r.n)if(r.k==t)return r};e.exports={getConstructor:function(e,t,r,c){var f=e(function(e,n){o(e,f,t,"_i"),e._i=i(null),e._f=void 0,e._l=void 0,e[m]=0,void 0!=n&&l(n,r,e[c],e)});return a(f.prototype,{clear:function(){for(var e=this,t=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var t=this,r=v(t,e);if(r){var n=r.n,i=r.p;delete t._i[r.i],r.r=!0,i&&(i.n=n),n&&(n.p=i),t._f==r&&(t._f=n),t._l==r&&(t._l=i),t[m]--}return!!r},forEach:function(e){o(this,f,"forEach");for(var t,r=s(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!v(this,e)}}),d&&n(f.prototype,"size",{get:function(){return u(this[m])}}),f},def:function(e,t,r){var n,i,a=v(e,t);return a?a.v=r:(e._l=a={i:i=h(t,!0),k:t,v:r,p:n=e._l,n:void 0,r:!1},e._f||(e._f=a),n&&(n.n=a),e[m]++,"F"!==i&&(e._i[i]=a)),e},getEntry:v,setStrong:function(e,t,r){c(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?f(0,r.k):"values"==t?f(0,r.v):f(0,[r.k,r.v]):(e._t=void 0,f(1))},r?"entries":"values",!r,!0),p(t)}}},function(e,t,r){var n=r(227),i=r(417);e.exports=function(e){return function(){if(n(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,r){var n=r(43),i=r(144),a=r(92);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var s,o=r(e),u=a.f,l=0;o.length>l;)u.call(e,s=o[l++])&&t.push(s);return t}},function(e,t,r){e.exports=r(14).document&&document.documentElement},function(e,t,r){var n=r(54),i=r(10)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||a[i]===e)}},function(e,t,r){var n=r(21);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var a=e.return;throw void 0!==a&&n(a.call(e)),t}}},function(e,t,r){"use strict";var n=r(91),i=r(93),a=r(94),s={};r(30)(s,r(10)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(s,{next:i(1,r)}),a(e,t+" Iterator")}},function(e,t,r){var n=r(43),i=r(37);e.exports=function(e,t){for(var r,a=i(e),s=n(a),o=s.length,u=0;o>u;)if(a[r=s[u++]]===t)return r}},function(e,t,r){var n=r(25),i=r(21),a=r(43);e.exports=r(22)?Object.defineProperties:function(e,t){i(e);for(var r,s=a(t),o=s.length,u=0;o>u;)n.f(e,r=s[u++],t[r]);return e}},function(e,t,r){var n=r(37),i=r(235).f,a={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function(e){ try{return i(e)}catch(e){return s.slice()}};e.exports.f=function(e){return s&&"[object Window]"==a.call(e)?o(e):i(n(e))}},function(e,t,r){var n=r(29),i=r(95),a=r(147)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,r){var n=r(23),i=r(5),a=r(36);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],s={};s[e]=t(r),n(n.S+n.F*a(function(){r(1)}),"Object",s)}},function(e,t,r){var n=r(24),i=r(21),a=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=r(53)(Function.call,r(234).f(Object.prototype,"__proto__").set,2),n(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return a(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:a}},function(e,t,r){"use strict";var n=r(14),i=r(5),a=r(25),s=r(22),o=r(10)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:n[e];s&&t&&!t[o]&&a.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,r){var n=r(149),i=r(89);e.exports=function(e){return function(t,r){var a,s,o=String(i(t)),u=n(r),l=o.length;return u<0||u>=l?e?"":void 0:(a=o.charCodeAt(u),a<55296||a>56319||u+1===l||(s=o.charCodeAt(u+1))<56320||s>57343?e?o.charAt(u):a:e?o.slice(u,u+2):(a-55296<<10)+(s-56320)+65536)}}},function(e,t,r){var n=r(149),i=Math.max,a=Math.min;e.exports=function(e,t){return e=n(e),e<0?i(e+t,0):a(e,t)}},function(e,t,r){var n=r(21),i=r(237);e.exports=r(5).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t,r){"use strict";var n=r(416),i=r(232),a=r(54),s=r(37);e.exports=r(142)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,r):"values"==t?i(0,e[r]):i(0,[r,e[r]])},"values"),a.Arguments=a.Array,n("keys"),n("values"),n("entries")},function(e,t,r){"use strict";var n=r(421);e.exports=r(139)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=n.getEntry(this,e);return t&&t.v},set:function(e,t){return n.def(this,0===e?0:e,t)}},n,!0)},function(e,t,r){var n=r(23);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,r){var n=r(23);n(n.S+n.F,"Object",{assign:r(233)})},function(e,t,r){var n=r(23);n(n.S,"Object",{create:r(91)})},function(e,t,r){var n=r(95),i=r(43);r(432)("keys",function(){return function(e){return i(n(e))}})},function(e,t,r){var n=r(23);n(n.S,"Object",{setPrototypeOf:r(433).set})},function(e,t,r){"use strict";var n,i=r(137)(0),a=r(146),s=r(55),o=r(233),u=r(228),l=r(24),c=s.getWeak,f=Object.isExtensible,p=u.ufstore,d={},h=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},m={get:function(e){if(l(e)){var t=c(e);return t===!0?p(this).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(this,e,t)}},v=e.exports=r(139)("WeakMap",h,m,u,!0,!0);7!=(new v).set((Object.freeze||Object)(d),7).get(d)&&(n=u.getConstructor(h),o(n.prototype,m),s.NEED=!0,i(["delete","has","get","set"],function(e){var t=v.prototype,r=t[e];a(t,e,function(t,i){if(l(t)&&!f(t)){this._f||(this._f=new n);var a=this._f[e](t,i);return"set"==e?this:a}return r.call(this,t,i)})}))},function(e,t,r){"use strict";var n=r(228);r(139)("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(this,e,!0)}},n,!1,!0)},function(e,t,r){var n=r(23);n(n.P+n.R,"Map",{toJSON:r(422)("Map")})},function(e,t,r){r(152)("asyncIterator")},function(e,t,r){r(152)("observable")},function(e,t,r){function n(){return t.colors[c++%t.colors.length]}function i(e){function r(){}function i(){var e=i,r=+new Date,a=r-(l||r);e.diff=a,e.prev=l,e.curr=r,l=r,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=n());for(var s=new Array(arguments.length),o=0;o<s.length;o++)s[o]=arguments[o];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var u=0;s[0]=s[0].replace(/%([a-z%])/g,function(r,n){if("%%"===r)return r;u++;var i=t.formatters[n];if("function"==typeof i){var a=s[u];r=i.call(e,a),s.splice(u,1),u--}return r}),s=t.formatArgs.apply(e,s);var c=i.log||t.log||console.log.bind(console);c.apply(e,s)}r.enabled=!1,i.enabled=!0;var a=t.enabled(e)?i:r;return a.namespace=e,a}function a(e){t.save(e);for(var r=(e||"").split(/[\s,]+/),n=r.length,i=0;i<n;i++)r[i]&&(e=r[i].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function s(){t.enable("")}function o(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=i.debug=i,t.coerce=u,t.disable=s,t.enable=a,t.enabled=o,t.humanize=r(605),t.names=[],t.skips=[],t.formatters={};var l,c=0},function(e,t,r){"use strict";function n(e){var t=0,r=0,n=0;for(var i in e){var a=e[i],s=a[0],o=a[1];(s>r||s===r&&o>n)&&(r=s,n=o,t=Number(i))}return t}var i=r(612),a=/^(?:( )+|\t+)/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");var t,r,s=0,o=0,u=0,l={};e.split(/\n/g).forEach(function(e){if(e){var n,i=e.match(a);i?(n=i[0].length,i[1]?o++:s++):n=0;var c=n-u;u=n,c?(r=c>0,t=l[r?c:-c],t?t[0]++:t=l[c]=[1,0]):t&&(t[1]+=Number(r))}});var c,f,p=n(l);return p?o>=s?(c="space",f=i(" ",p)):(c="tab",f=i("\t",p)):(c=null,f=""),{amount:p,type:c,indent:f}}},function(e,t){"use strict";var r=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(r,"\\$&")}},function(e,t){!function(){"use strict";function t(e){if(null==e)return!1;switch(e.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1}function r(e){if(null==e)return!1;switch(e.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function n(e){if(null==e)return!1;switch(e.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function i(e){return n(e)||null!=e&&"FunctionDeclaration"===e.type}function a(e){switch(e.type){case"IfStatement":return null!=e.alternate?e.alternate:e.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return e.body}return null}function s(e){var t;if("IfStatement"!==e.type)return!1;if(null==e.alternate)return!1;t=e.consequent;do{if("IfStatement"===t.type&&null==t.alternate)return!0;t=a(t)}while(t);return!1}e.exports={isExpression:t,isStatement:n,isIterationStatement:r,isSourceElement:i,isProblematicIfStatement:s,trailingStatement:a}}()},function(e,t,r){!function(){"use strict";function t(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function n(e,t){return!(!t&&"yield"===e)&&i(e,t)}function i(e,r){if(r&&t(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function a(e,t){return"null"===e||"true"===e||"false"===e||n(e,t)}function s(e,t){return"null"===e||"true"===e||"false"===e||i(e,t)}function o(e){return"eval"===e||"arguments"===e}function u(e){var t,r,n;if(0===e.length)return!1;if(n=e.charCodeAt(0),!d.isIdentifierStartES5(n))return!1;for(t=1,r=e.length;t<r;++t)if(n=e.charCodeAt(t),!d.isIdentifierPartES5(n))return!1;return!0}function l(e,t){return 1024*(e-55296)+(t-56320)+65536}function c(e){var t,r,n,i,a;if(0===e.length)return!1;for(a=d.isIdentifierStartES6,t=0,r=e.length;t<r;++t){if(n=e.charCodeAt(t),55296<=n&&n<=56319){if(++t,t>=r)return!1;if(i=e.charCodeAt(t),!(56320<=i&&i<=57343))return!1;n=l(n,i)}if(!a(n))return!1;a=d.isIdentifierPartES6}return!0}function f(e,t){return u(e)&&!a(e,t)}function p(e,t){return c(e)&&!s(e,t)}var d=r(239);e.exports={isKeywordES5:n,isKeywordES6:i,isReservedWordES5:a,isReservedWordES6:s,isRestrictedWord:o,isIdentifierNameES5:u,isIdentifierNameES6:c,isIdentifierES5:f,isIdentifierES6:p}}()},function(e,t,r){e.exports=r(463)},function(e,t,r){"use strict";var n=r(177),i=new RegExp(n().source);e.exports=i.test.bind(i)},function(e,t){t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,u=(1<<o)-1,l=u>>1,c=-7,f=r?i-1:0,p=r?-1:1,d=e[t+f];for(f+=p,a=d&(1<<-c)-1,d>>=-c,c+=o;c>0;a=256*a+e[t+f],f+=p,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=n;c>0;s=256*s+e[t+f],f+=p,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,n),a-=l}return(d?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,u,l=8*a-i-1,c=(1<<l)-1,f=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+f>=1?p/u:p*Math.pow(2,1-f),t*u>=2&&(s++,u/=2),s+f>=c?(o=0,s=c):s+f>=1?(o=(t*u-1)*Math.pow(2,i),s+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&o,d+=h,o/=256,i-=8);for(s=s<<i|o,l+=i;l>0;e[r+d]=255&s,d+=h,s/=256,l-=8);e[r+d-h]|=128*m}},function(e,t,r){"use strict";var n=function(e,t,r,n,i,a,s,o){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,i,a,s,o],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=n},function(e,t,r){"use strict";var n=r(606);e.exports=Number.isFinite||function(e){return!("number"!=typeof e||n(e)||e===1/0||e===-(1/0))}},function(e,t){e.exports=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]{1,6}\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,e.exports.matchToToken=function(e){var t={type:"invalid",value:e[0]};return e[1]?(t.type="string",t.closed=!(!e[3]&&!e[4])):e[5]?t.type="comment":e[6]?(t.type="comment",t.closed=!!e[7]):e[8]?t.type="regex":e[9]?t.type="number":e[10]?t.type="name":e[11]?t.type="punctuator":e[12]&&(t.type="whitespace"),t}},function(e,t,r){var n;(function(e,i){!function(a){var s="object"==typeof t&&t,o=("object"==typeof e&&e&&e.exports==s&&e,"object"==typeof i&&i);o.global!==o&&o.window!==o||(a=o);var u={},l=u.hasOwnProperty,c=function(e,t){var r;for(r in e)l.call(e,r)&&t(r,e[r])},f=function(e,t){return t?(c(t,function(t,r){e[t]=r}),e):e},p=function(e,t){for(var r=e.length,n=-1;++n<r;)t(e[n])},d=u.toString,h=function(e){return"[object Array]"==d.call(e)},m=function(e){return"[object Object]"==d.call(e)},v=function(e){return"string"==typeof e||"[object String]"==d.call(e)},y=function(e){return"number"==typeof e||"[object Number]"==d.call(e)},g=function(e){return"function"==typeof e||"[object Function]"==d.call(e)},b=function(e){return"[object Map]"==d.call(e)},E=function(e){return"[object Set]"==d.call(e)},x={'"':'\\"',"'":"\\'","\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},A=/["'\\\b\f\n\r\t]/,_=/[0-9]/,D=/[ !#-&\(-\[\]-~]/,C=function(e,t){var r={escapeEverything:!1,escapeEtago:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",__indent__:"",__inline1__:!1,__inline2__:!1},n=t&&t.json;n&&(r.quotes="double",r.wrap=!0),t=f(r,t),"single"!=t.quotes&&"double"!=t.quotes&&(t.quotes="single");var i,a="double"==t.quotes?'"':"'",s=t.compact,o=t.indent,u=t.lowercaseHex,l="",d=t.__inline1__,S=t.__inline2__,w=s?"":"\n",F=!0,k="binary"==t.numbers,P="octal"==t.numbers,T="decimal"==t.numbers,O="hexadecimal"==t.numbers;if(n&&e&&g(e.toJSON)&&(e=e.toJSON()),!v(e)){if(b(e))return 0==e.size?"new Map()":(s||(t.__inline1__=!0),"new Map("+C(Array.from(e),t)+")");if(E(e))return 0==e.size?"new Set()":"new Set("+C(Array.from(e),t)+")";if(h(e))return i=[],t.wrap=!0,d?(t.__inline1__=!1,t.__inline2__=!0):(l=t.__indent__,o+=l,t.__indent__=o),p(e,function(e){F=!1,S&&(t.__inline2__=!1),i.push((s||S?"":o)+C(e,t))}),F?"[]":S?"["+i.join(", ")+"]":"["+w+i.join(","+w)+w+(s?"":l)+"]";if(!y(e))return m(e)?(i=[],t.wrap=!0,l=t.__indent__,o+=l,t.__indent__=o,c(e,function(e,r){F=!1,i.push((s?"":o)+C(e,t)+":"+(s?"":" ")+C(r,t))}),F?"{}":"{"+w+i.join(","+w)+w+(s?"":l)+"}"):n?JSON.stringify(e)||"null":String(e);if(n)return JSON.stringify(e);if(T)return String(e);if(O){var B=e.toString(16);return u||(B=B.toUpperCase()),"0x"+B}if(k)return"0b"+e.toString(2);if(P)return"0o"+e.toString(8)}var R,I,M,N=e,L=-1,j=N.length;for(i="";++L<j;){var U=N.charAt(L);if(t.es6&&(R=N.charCodeAt(L),R>=55296&&R<=56319&&j>L+1&&(I=N.charCodeAt(L+1),I>=56320&&I<=57343))){M=1024*(R-55296)+I-56320+65536;var V=M.toString(16);u||(V=V.toUpperCase()),i+="\\u{"+V+"}",L++}else{if(!t.escapeEverything){if(D.test(U)){i+=U;continue}if('"'==U){i+=a==U?'\\"':U;continue}if("'"==U){i+=a==U?"\\'":U;continue}}if("\0"!=U||n||_.test(N.charAt(L+1)))if(A.test(U))i+=x[U];else{var G=U.charCodeAt(0),V=G.toString(16);u||(V=V.toUpperCase());var W=V.length>2||n,Y="\\"+(W?"u":"x")+("0000"+V).slice(W?-4:-2);i+=Y}else i+="\\0"}}return t.wrap&&(i=a+i+a),t.escapeEtago?i.replace(/<\/(script|style)/gi,"<\\/$1"):i};C.version="1.3.0",n=function(){return C}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)}).call(t,r(39)(e),function(){return this}())},function(e,t){e.exports={_args:[[{name:"babel-core",raw:"babel-core@6.18.2",rawSpec:"6.18.2",scope:null,spec:"6.18.2",type:"version"},"C:\\src\\babel-standalone"]],_from:"babel-core@6.18.2",_id:"babel-core@6.18.2",_inCache:!0,_installable:!0,_location:"/babel-core",_nodeVersion:"6.8.1",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/babel-core-6.18.2.tgz_1478035855416_0.08754534856416285"},_npmUser:{email:"hi@henryzoo.com",name:"hzoo"},_npmVersion:"3.10.9",_phantomChildren:{},_requested:{name:"babel-core",raw:"babel-core@6.18.2",rawSpec:"6.18.2",scope:null,spec:"6.18.2",type:"version"},_requiredBy:["#DEV:/","/babel-jest","/babel-register","/jest-runtime"],_resolved:"https://registry.npmjs.org/babel-core/-/babel-core-6.18.2.tgz",_shasum:"d8bb14dd6986fa4f3566a26ceda3964fa0e04e5b",_shrinkwrap:null,_spec:"babel-core@6.18.2",_where:"C:\\src\\babel-standalone",author:{email:"sebmck@gmail.com",name:"Sebastian McKenzie"},dependencies:{"babel-code-frame":"^6.16.0","babel-generator":"^6.18.0","babel-helpers":"^6.16.0","babel-messages":"^6.8.0","babel-register":"^6.18.0","babel-runtime":"^6.9.1","babel-template":"^6.16.0","babel-traverse":"^6.18.0","babel-types":"^6.18.0",babylon:"^6.11.0","convert-source-map":"^1.1.0",debug:"^2.1.1",json5:"^0.5.0",lodash:"^4.2.0",minimatch:"^3.0.2","path-is-absolute":"^1.0.0",private:"^0.1.6",slash:"^1.0.0","source-map":"^0.5.0"},description:"Babel compiler core.",devDependencies:{"babel-helper-fixtures":"^6.18.2","babel-helper-transform-fixture-test-runner":"^6.18.2","babel-polyfill":"^6.16.0"},directories:{},dist:{shasum:"d8bb14dd6986fa4f3566a26ceda3964fa0e04e5b",tarball:"https://registry.npmjs.org/babel-core/-/babel-core-6.18.2.tgz"},homepage:"https://babeljs.io/",keywords:["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var"],license:"MIT",maintainers:[{email:"amjad.masad@gmail.com",name:"amasad"},{email:"hi@henryzoo.com",name:"hzoo"},{email:"npm-public@jessemccarthy.net",name:"jmm"},{email:"loganfsmyth@gmail.com",name:"loganfsmyth"},{email:"sebmck@gmail.com",name:"sebmck"},{email:"me@thejameskyle.com",name:"thejameskyle"}],name:"babel-core",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"https://github.com/babel/babel/tree/master/packages/babel-core"},scripts:{bench:"make bench",test:"make test"},version:"6.18.2"}},function(e,t){e.exports={builtin:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},es5:{Array:!1,Boolean:!1,constructor:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,propertyIsEnumerable:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1},es6:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},browser:{addEventListener:!1,alert:!1,AnalyserNode:!1,Animation:!1,AnimationEffectReadOnly:!1,AnimationEffectTiming:!1,AnimationEffectTimingReadOnly:!1,AnimationEvent:!1,AnimationPlaybackEvent:!1,AnimationTimeline:!1,applicationCache:!1,ApplicationCache:!1,ApplicationCacheErrorEvent:!1,atob:!1,Attr:!1,Audio:!1,AudioBuffer:!1,AudioBufferSourceNode:!1,AudioContext:!1,AudioDestinationNode:!1,AudioListener:!1,AudioNode:!1,AudioParam:!1,AudioProcessingEvent:!1,AutocompleteErrorEvent:!1,BarProp:!1,BatteryManager:!1,BeforeUnloadEvent:!1,BiquadFilterNode:!1,Blob:!1,blur:!1,btoa:!1,Cache:!1,caches:!1,CacheStorage:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,CDATASection:!1,ChannelMergerNode:!1,ChannelSplitterNode:!1,CharacterData:!1,clearInterval:!1,clearTimeout:!1,clientInformation:!1,ClientRect:!1,ClientRectList:!1,ClipboardEvent:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,ConvolverNode:!1,Credential:!1,CredentialsContainer:!1,crypto:!1,Crypto:!1,CryptoKey:!1,CSS:!1,CSSAnimation:!1,CSSFontFaceRule:!1,CSSImportRule:!1,CSSKeyframeRule:!1,CSSKeyframesRule:!1,CSSMediaRule:!1,CSSPageRule:!1,CSSRule:!1,CSSRuleList:!1,CSSStyleDeclaration:!1,CSSStyleRule:!1,CSSStyleSheet:!1,CSSSupportsRule:!1,CSSTransition:!1,CSSUnknownRule:!1,CSSViewportRule:!1,CustomEvent:!1,DataTransfer:!1,DataTransferItem:!1,DataTransferItemList:!1,Debug:!1,defaultStatus:!1,defaultstatus:!1,DelayNode:!1,DeviceMotionEvent:!1,DeviceOrientationEvent:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DocumentTimeline:!1,DocumentType:!1,DOMError:!1,DOMException:!1,DOMImplementation:!1,DOMParser:!1,DOMSettableTokenList:!1,DOMStringList:!1,DOMStringMap:!1,DOMTokenList:!1,DragEvent:!1,DynamicsCompressorNode:!1,Element:!1,ElementTimeControl:!1,ErrorEvent:!1,event:!1,Event:!1,EventSource:!1,EventTarget:!1,external:!1,FederatedCredential:!1,fetch:!1,File:!1,FileError:!1,FileList:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FontFace:!1,FormData:!1,frameElement:!1,frames:!1,GainNode:!1,Gamepad:!1,GamepadButton:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,Headers:!1,history:!1,History:!1,HTMLAllCollection:!1,HTMLAnchorElement:!1,HTMLAppletElement:!1,HTMLAreaElement:!1,HTMLAudioElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLContentElement:!1,HTMLDataListElement:!1,HTMLDetailsElement:!1,HTMLDialogElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLDocument:!1,HTMLElement:!1,HTMLEmbedElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormControlsCollection:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLKeygenElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMarqueeElement:!1,HTMLMediaElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLMeterElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLOptionsCollection:!1,HTMLOutputElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPictureElement:!1,HTMLPreElement:!1,HTMLProgressElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLShadowElement:!1,HTMLSourceElement:!1,HTMLSpanElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLTrackElement:!1,HTMLUListElement:!1,HTMLUnknownElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBEnvironment:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,Image:!1,ImageBitmap:!1,ImageData:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,InputMethodContext:!1,IntersectionObserver:!1,IntersectionObserverEntry:!1,Intl:!1,KeyboardEvent:!1,KeyframeEffect:!1,KeyframeEffectReadOnly:!1,length:!1,localStorage:!1,location:!1,Location:!1,locationbar:!1,matchMedia:!1,MediaElementAudioSourceNode:!1,MediaEncryptedEvent:!1,MediaError:!1,MediaKeyError:!1,MediaKeyEvent:!1,MediaKeyMessageEvent:!1,MediaKeys:!1,MediaKeySession:!1,MediaKeyStatusMap:!1,MediaKeySystemAccess:!1,MediaList:!1,MediaQueryList:!1,MediaQueryListEvent:!1,MediaSource:!1,MediaStream:!1,MediaStreamAudioDestinationNode:!1,MediaStreamAudioSourceNode:!1,MediaStreamEvent:!1,MediaStreamTrack:!1,menubar:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MIDIAccess:!1,MIDIConnectionEvent:!1,MIDIInput:!1,MIDIInputMap:!1,MIDIMessageEvent:!1,MIDIOutput:!1,MIDIOutputMap:!1,MIDIPort:!1,MimeType:!1,MimeTypeArray:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationEvent:!1,MutationObserver:!1,MutationRecord:!1,name:!1,NamedNodeMap:!1,navigator:!1,Navigator:!1,Node:!1,NodeFilter:!1,NodeIterator:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,OfflineAudioContext:!1,offscreenBuffering:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,opera:!1,Option:!1,OscillatorNode:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,parent:!1,PasswordCredential:!1,Path2D:!1,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,PeriodicWave:!1,Permissions:!1,PermissionStatus:!1,personalbar:!1,Plugin:!1,PluginArray:!1,PopStateEvent:!1,postMessage:!1,print:!1,ProcessingInstruction:!1,ProgressEvent:!1,PromiseRejectionEvent:!1,prompt:!1,PushManager:!1,PushSubscription:!1,RadioNodeList:!1,Range:!1,ReadableByteStream:!1,ReadableStream:!1,removeEventListener:!1,Request:!1,requestAnimationFrame:!1,requestIdleCallback:!1,resizeBy:!1,resizeTo:!1,Response:!1,RTCIceCandidate:!1,RTCSessionDescription:!1,RTCPeerConnection:!1,screen:!1,Screen:!1,screenLeft:!1,ScreenOrientation:!1,screenTop:!1,screenX:!1,screenY:!1,ScriptProcessorNode:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,SecurityPolicyViolationEvent:!1,Selection:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerRegistration:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,ShadowRoot:!1,SharedKeyframeList:!1,SharedWorker:!1,showModalDialog:!1,SiteBoundCredential:!1,speechSynthesis:!1,SpeechSynthesisEvent:!1,SpeechSynthesisUtterance:!1,status:!1,statusbar:!1,stop:!1,Storage:!1,StorageEvent:!1,styleMedia:!1,StyleSheet:!1,StyleSheetList:!1,SubtleCrypto:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCSSRule:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDiscardElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGEvent:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEDropShadowElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGeometryElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGGraphicsElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGLocatable:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformable:!1,SVGTransformList:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGURIReference:!1,SVGUseElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGVKernElement:!1,SVGZoomAndPan:!1,SVGZoomEvent:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TextEvent:!1,TextMetrics:!1,TextTrack:!1,TextTrackCue:!1,TextTrackCueList:!1,TextTrackList:!1,TimeEvent:!1,TimeRanges:!1,toolbar:!1,top:!1,Touch:!1,TouchEvent:!1,TouchList:!1,TrackEvent:!1,TransitionEvent:!1,TreeWalker:!1,UIEvent:!1,URL:!1,URLSearchParams:!1,ValidityState:!1,VTTCue:!1,WaveShaperNode:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLDocument:!1,XMLHttpRequest:!1,XMLHttpRequestEventTarget:!1,XMLHttpRequestProgressEvent:!1,XMLHttpRequestUpload:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1,XSLTProcessor:!1},worker:{applicationCache:!1,atob:!1,Blob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,clearInterval:!1,clearTimeout:!1,close:!0,console:!1,fetch:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!0,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onlanguagechange:!0,onmessage:!0,onoffline:!0,ononline:!0,onrejectionhandled:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,Request:!1,Response:!1,self:!0,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1,WebSocket:!1,Worker:!1,XMLHttpRequest:!1},node:{__dirname:!1,__filename:!1,arguments:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!0,GLOBAL:!1,global:!1,Intl:!1,module:!1, process:!1,require:!1,root:!1,setImmediate:!1,setInterval:!1,setTimeout:!1},commonjs:{exports:!0,module:!1,require:!1,global:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,mocha:!1,run:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},jest:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,check:!1,describe:!1,expect:!1,gen:!1,it:!1,fit:!1,jest:!1,pit:!1,require:!1,test:!1,xdescribe:!1,xit:!1,xtest:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notOk:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,throws:!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},nashorn:{__DIR__:!1,__FILE__:!1,__LINE__:!1,com:!1,edu:!1,exit:!1,Java:!1,java:!1,javafx:!1,JavaImporter:!1,javax:!1,JSAdapter:!1,load:!1,loadWithNewGlobal:!1,org:!1,Packages:!1,print:!1,quit:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{Y:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ls:!1,ln:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,set:!1,target:!1,tempdir:!1,test:!1,touch:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{$:!1,_:!1,Accounts:!1,AccountsClient:!1,AccountsServer:!1,AccountsCommon:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPServer:!1,DDPRateLimiter:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,ServiceConfiguration:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,ISODate:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,NumberInt:!1,NumberLong:!1,ObjectId:!1,PlanCache:!1,print:!1,printjson:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1},applescript:{$:!1,Application:!1,Automation:!1,console:!1,delay:!1,Library:!1,ObjC:!1,ObjectSpecifier:!1,Path:!1,Progress:!1,Ref:!1},serviceworker:{caches:!1,Cache:!1,CacheStorage:!1,Client:!1,clients:!1,Clients:!1,ExtendableEvent:!1,ExtendableMessageEvent:!1,FetchEvent:!1,importScripts:!1,registration:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerGlobalScope:!1,ServiceWorkerMessageEvent:!1,ServiceWorkerRegistration:!1,skipWaiting:!1,WindowClient:!1},atomtest:{advanceClock:!1,fakeClearInterval:!1,fakeClearTimeout:!1,fakeSetInterval:!1,fakeSetTimeout:!1,resetTimeouts:!1,waitsForPromise:!1},embertest:{andThen:!1,click:!1,currentPath:!1,currentRouteName:!1,currentURL:!1,fillIn:!1,find:!1,findWithAssert:!1,keyEvent:!1,pauseTest:!1,triggerEvent:!1,visit:!1},protractor:{$:!1,$$:!1,browser:!1,By:!1,by:!1,DartObject:!1,element:!1,protractor:!1},"shared-node-browser":{clearInterval:!1,clearTimeout:!1,console:!1,setInterval:!1,setTimeout:!1},webextensions:{browser:!1,chrome:!1,opr:!1},greasemonkey:{GM_addStyle:!1,GM_deleteValue:!1,GM_getResourceText:!1,GM_getResourceURL:!1,GM_getValue:!1,GM_info:!1,GM_listValues:!1,GM_log:!1,GM_openInTab:!1,GM_registerMenuCommand:!1,GM_setClipboard:!1,GM_setValue:!1,GM_xmlhttpRequest:!1,unsafeWindow:!1}}},function(e,t){e.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,68736:68800,68737:68801,68738:68802,68739:68803,68740:68804,68741:68805,68742:68806,68743:68807,68744:68808,68745:68809,68746:68810,68747:68811,68748:68812,68749:68813,68750:68814,68751:68815,68752:68816,68753:68817,68754:68818,68755:68819,68756:68820,68757:68821,68758:68822,68759:68823,68760:68824,68761:68825,68762:68826,68763:68827,68764:68828,68765:68829,68766:68830,68767:68831,68768:68832,68769:68833,68770:68834,68771:68835,68772:68836,68773:68837,68774:68838,68775:68839,68776:68840,68777:68841,68778:68842,68779:68843,68780:68844,68781:68845,68782:68846,68783:68847,68784:68848,68785:68849,68786:68850,68800:68736,68801:68737,68802:68738,68803:68739,68804:68740,68805:68741,68806:68742,68807:68743,68808:68744,68809:68745,68810:68746,68811:68747,68812:68748,68813:68749,68814:68750,68815:68751,68816:68752,68817:68753,68818:68754,68819:68755,68820:68756,68821:68757,68822:68758,68823:68759,68824:68760,68825:68761,68826:68762,68827:68763,68828:68764,68829:68765,68830:68766,68831:68767,68832:68768,68833:68769,68834:68770,68835:68771,68836:68772,68837:68773,68838:68774,68839:68775,68840:68776,68841:68777,68842:68778,68843:68779,68844:68780,68845:68781,68846:68782,68847:68783,68848:68784,68849:68785,68850:68786,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}},function(e,t,r){var n=t;n.parse=function(){"use strict";var e,t,r,n,i,a,s={"'":"'",'"':'"',"\\":"\\","/":"/","\n":"",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},o=[" ","\t","\r","\n","\v","\f"," ","\ufeff"],u=function(e){return""===e?"EOF":"'"+e+"'"},l=function(n){var a=new SyntaxError;throw a.message=n+" at line "+t+" column "+r+" of the JSON5 data. Still to read: "+JSON.stringify(i.substring(e-1,e+19)),a.at=e,a.lineNumber=t,a.columnNumber=r,a},c=function(a){return a&&a!==n&&l("Expected "+u(a)+" instead of "+u(n)),n=i.charAt(e),e++,r++,("\n"===n||"\r"===n&&"\n"!==f())&&(t++,r=0),n},f=function(){return i.charAt(e)},p=function(){var e=n;for("_"!==n&&"$"!==n&&(n<"a"||n>"z")&&(n<"A"||n>"Z")&&l("Bad identifier as unquoted key");c()&&("_"===n||"$"===n||n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9");)e+=n;return e},d=function(){var e,t="",r="",i=10;if("-"!==n&&"+"!==n||(t=n,c(n)),"I"===n)return e=b(),("number"!=typeof e||isNaN(e))&&l("Unexpected word for number"),"-"===t?-e:e;if("N"===n)return e=b(),isNaN(e)||l("expected word to be NaN"),e;switch("0"===n&&(r+=n,c(),"x"===n||"X"===n?(r+=n,c(),i=16):n>="0"&&n<="9"&&l("Octal literal")),i){case 10:for(;n>="0"&&n<="9";)r+=n,c();if("."===n)for(r+=".";c()&&n>="0"&&n<="9";)r+=n;if("e"===n||"E"===n)for(r+=n,c(),"-"!==n&&"+"!==n||(r+=n,c());n>="0"&&n<="9";)r+=n,c();break;case 16:for(;n>="0"&&n<="9"||n>="A"&&n<="F"||n>="a"&&n<="f";)r+=n,c()}return e="-"===t?-r:+r,isFinite(e)?e:void l("Bad number")},h=function(){var e,t,r,i,a="";if('"'===n||"'"===n)for(r=n;c();){if(n===r)return c(),a;if("\\"===n)if(c(),"u"===n){for(i=0,t=0;t<4&&(e=parseInt(c(),16),isFinite(e));t+=1)i=16*i+e;a+=String.fromCharCode(i)}else if("\r"===n)"\n"===f()&&c();else{if("string"!=typeof s[n])break;a+=s[n]}else{if("\n"===n)break;a+=n}}l("Bad string")},m=function(){"/"!==n&&l("Not an inline comment");do if(c(),"\n"===n||"\r"===n)return void c();while(n)},v=function(){"*"!==n&&l("Not a block comment");do for(c();"*"===n;)if(c("*"),"/"===n)return void c("/");while(n);l("Unterminated block comment")},y=function(){"/"!==n&&l("Not a comment"),c("/"),"/"===n?m():"*"===n?v():l("Unrecognized comment")},g=function(){for(;n;)if("/"===n)y();else{if(!(o.indexOf(n)>=0))return;c()}},b=function(){switch(n){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null;case"I":return c("I"),c("n"),c("f"),c("i"),c("n"),c("i"),c("t"),c("y"),1/0;case"N":return c("N"),c("a"),c("N"),NaN}l("Unexpected "+u(n))},E=function(){var e=[];if("["===n)for(c("["),g();n;){if("]"===n)return c("]"),e;if(","===n?l("Missing array element"):e.push(a()),g(),","!==n)return c("]"),e;c(","),g()}l("Bad array")},x=function(){var e,t={};if("{"===n)for(c("{"),g();n;){if("}"===n)return c("}"),t;if(e='"'===n||"'"===n?h():p(),g(),c(":"),t[e]=a(),g(),","!==n)return c("}"),t;c(","),g()}l("Bad object")};return a=function(){switch(g(),n){case"{":return x();case"[":return E();case'"':case"'":return h();case"-":case"+":case".":return d();default:return n>="0"&&n<="9"?d():b()}},function(s,o){var u;return i=String(s),e=0,t=1,r=1,n=" ",u=a(),g(),n&&l("Syntax error"),"function"==typeof o?function e(t,r){var n,i,a=t[r];if(a&&"object"==typeof a)for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(i=e(a,n),void 0!==i?a[n]=i:delete a[n]);return o.call(t,r,a)}({"":u},""):u}}(),n.stringify=function(e,t,r){function i(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"_"===e||"$"===e}function a(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e||"$"===e}function s(e){if("string"!=typeof e)return!1;if(!a(e[0]))return!1;for(var t=1,r=e.length;t<r;){if(!i(e[t]))return!1;t++}return!0}function o(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function u(e){return"[object Date]"===Object.prototype.toString.call(e)}function l(e){for(var t=0;t<m.length;t++)if(m[t]===e)throw new TypeError("Converting circular structure to JSON")}function c(e,t,r){if(!e)return"";e.length>10&&(e=e.substring(0,10));for(var n=r?"":"\n",i=0;i<t;i++)n+=e;return n}function f(e){return v.lastIndex=0,v.test(e)?'"'+e.replace(v,function(e){var t=y[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function p(e,t,r){var n,i,a=d(e,t,r);switch(a&&!u(a)&&(a=a.valueOf()),typeof a){case"boolean":return a.toString();case"number":return isNaN(a)||!isFinite(a)?"null":a.toString();case"string":return f(a.toString());case"object":if(null===a)return"null";if(o(a)){l(a),n="[",m.push(a);for(var v=0;v<a.length;v++)i=p(a,v,!1),n+=c(h,m.length),n+=null===i||"undefined"==typeof i?"null":i,v<a.length-1?n+=",":h&&(n+="\n");m.pop(),n+=c(h,m.length,!0)+"]"}else{l(a),n="{";var y=!1;m.push(a);for(var g in a)if(a.hasOwnProperty(g)){var b=p(a,g,!1);r=!1,"undefined"!=typeof b&&null!==b&&(n+=c(h,m.length),y=!0,t=s(g)?g:f(g),n+=t+":"+(h?" ":"")+b+",")}m.pop(),n=y?n.substring(0,n.length-1)+c(h,m.length)+"}":"{}"}return n;default:return}}if(t&&"function"!=typeof t&&!o(t))throw new Error("Replacer must be a function or an array");var d=function(e,r,n){var i=e[r];return i&&i.toJSON&&"function"==typeof i.toJSON&&(i=i.toJSON()),"function"==typeof t?t.call(e,r,i):t?n||o(e)||t.indexOf(r)>=0?i:void 0:i};n.isWord=s;var h,m=[];r&&("string"==typeof r?h=r:"number"==typeof r&&r>=0&&(h=c(" ",r,!0)));var v=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,y={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},g={"":e};return void 0===e?d(g,"",!0):p(g,"",!0)}},function(e,t){"use strict";var r=[],n=[];e.exports=function(e,t){if(e===t)return 0;var i=e.length,a=t.length;if(0===i)return a;if(0===a)return i;for(var s,o,u,l,c=0,f=0;c<i;)n[c]=e.charCodeAt(c),r[c]=++c;for(;f<a;)for(s=t.charCodeAt(f),u=f++,o=f,c=0;c<i;c++)l=s===n[c]?u:u+1,u=r[c],o=r[c]=u>o?l>o?o+1:l:l>u?u+1:l;return o}},function(e,t,r){var n=r(38),i=r(16),a=n(i,"DataView");e.exports=a},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var i=r(535),a=r(536),s=r(537),o=r(538),u=r(539);n.prototype.clear=i,n.prototype.delete=a,n.prototype.get=s,n.prototype.has=o,n.prototype.set=u,e.exports=n},function(e,t,r){var n=r(38),i=r(16),a=n(i,"Promise");e.exports=a},function(e,t,r){var n=r(38),i=r(16),a=n(i,"WeakMap");e.exports=a},function(e,t){function r(e,t){return e.set(t[0],t[1]),e}e.exports=r},function(e,t){function r(e,t){return e.add(t),e}e.exports=r},function(e,t,r){function n(e,t){var r=null==e?0:e.length;return!!r&&i(e,t,0)>-1}var i=r(101);e.exports=n},function(e,t){function r(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}e.exports=r},function(e,t){function r(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}e.exports=r},function(e,t){function r(e){return e.split("")}e.exports=r},function(e,t,r){function n(e,t,r,n){return void 0===e||i(e,a[r])&&!s.call(n,r)?t:e}var i=r(45),a=Object.prototype,s=a.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t){return e&&i(t,a(t),e)}var i=r(31),a=r(27);e.exports=n},function(e,t,r){function n(e,t){return e&&i(t,a(t),e)}var i=r(31),a=r(46);e.exports=n},function(e,t){function r(e,t,r){return e===e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}e.exports=r},function(e,t,r){var n=r(11),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},function(e,t,r){function n(e,t,r,s,o){var u=-1,l=e.length;for(r||(r=a),o||(o=[]);++u<l;){var c=e[u];t>0&&r(c)?t>1?n(c,t-1,r,s,o):i(o,c):s||(o[o.length]=c)}return o}var i=r(159),a=r(542);e.exports=n},function(e,t,r){function n(e,t){return e&&i(e,t,a)}var i=r(249),a=r(27);e.exports=n},function(e,t){function r(e,t){return null!=e&&i.call(e,t)}var n=Object.prototype,i=n.hasOwnProperty;e.exports=r},function(e,t){function r(e,t){return null!=e&&t in Object(e)}e.exports=r},function(e,t){function r(e,t,r,n){for(var i=r-1,a=e.length;++i<a;)if(n(e[i],t))return i;return-1}e.exports=r},function(e,t,r){function n(e){return a(e)&&i(e)==s}var i=r(15),a=r(12),s="[object Arguments]";e.exports=n},function(e,t,r){function n(e,t,r,n,v,g){var b=l(e),E=l(t),x=h,A=h;b||(x=u(e),x=x==d?m:x),E||(A=u(t),A=A==d?m:A);var _=x==m,D=A==m,C=x==A;if(C&&c(e)){if(!c(t))return!1;b=!0,_=!1}if(C&&!_)return g||(g=new i),b||f(e)?a(e,t,r,n,v,g):s(e,t,x,r,n,v,g);if(!(r&p)){var S=_&&y.call(e,"__wrapped__"),w=D&&y.call(t,"__wrapped__");if(S||w){var F=S?e.value():e,k=w?t.value():t;return g||(g=new i),v(F,k,r,n,g)}}return!!C&&(g||(g=new i),o(e,t,r,n,v,g))}var i=r(99),a=r(260),s=r(527),o=r(528),u=r(263),l=r(6),c=r(114),f=r(176),p=1,d="[object Arguments]",h="[object Array]",m="[object Object]",v=Object.prototype,y=v.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t,r,n){var u=r.length,l=u,c=!n;if(null==e)return!l;for(e=Object(e);u--;){var f=r[u];if(c&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++u<l;){f=r[u];var p=f[0],d=e[p],h=f[1];if(c&&f[2]){if(void 0===d&&!(p in e))return!1}else{var m=new i;if(n)var v=n(d,h,p,e,t,m);if(!(void 0===v?a(h,d,s|o,n,m):v))return!1}}return!0}var i=r(99),a=r(252),s=1,o=2;e.exports=n},function(e,t){function r(e){return e!==e}e.exports=r},function(e,t,r){function n(e){if(!s(e)||a(e))return!1;var t=i(e)?h:l;return t.test(o(e))}var i=r(115),a=r(544),s=r(11),o=r(270),u=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,c=Function.prototype,f=Object.prototype,p=c.toString,d=f.hasOwnProperty,h=RegExp("^"+p.call(d).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=n},function(e,t,r){function n(e){return a(e)&&i(e)==s}var i=r(15),a=r(12),s="[object RegExp]";e.exports=n},function(e,t,r){function n(e){return s(e)&&a(e.length)&&!!T[i(e)]}var i=r(15),a=r(174),s=r(12),o="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",f="[object Error]",p="[object Function]",d="[object Map]",h="[object Number]",m="[object Object]",v="[object RegExp]",y="[object Set]",g="[object String]",b="[object WeakMap]",E="[object ArrayBuffer]",x="[object DataView]",A="[object Float32Array]",_="[object Float64Array]",D="[object Int8Array]",C="[object Int16Array]",S="[object Int32Array]",w="[object Uint8Array]",F="[object Uint8ClampedArray]",k="[object Uint16Array]",P="[object Uint32Array]",T={};T[A]=T[_]=T[D]=T[C]=T[S]=T[w]=T[F]=T[k]=T[P]=!0,T[o]=T[u]=T[E]=T[l]=T[x]=T[c]=T[f]=T[p]=T[d]=T[h]=T[m]=T[v]=T[y]=T[g]=T[b]=!1,e.exports=n},function(e,t,r){function n(e){if(!i(e))return a(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}var i=r(106),a=r(556),s=Object.prototype,o=s.hasOwnProperty;e.exports=n},function(e,t,r){function n(e){if(!i(e))return s(e);var t=a(e),r=[];for(var n in e)("constructor"!=n||!t&&u.call(e,n))&&r.push(n);return r}var i=r(11),a=r(106),s=r(557),o=Object.prototype,u=o.hasOwnProperty;e.exports=n},function(e,t,r){function n(e){var t=a(e);return 1==t.length&&t[0][2]?s(t[0][0],t[0][1]):function(r){return r===e||i(r,e,t)}}var i=r(489),a=r(531),s=r(268);e.exports=n},function(e,t,r){function n(e,t){return o(e)&&u(t)?l(c(e),t):function(r){var n=a(r,e);return void 0===n&&n===t?s(r,e):i(t,n,f|p)}}var i=r(252),a=r(586),s=r(587),o=r(171),u=r(266),l=r(268),c=r(109),f=1,p=2;e.exports=n},function(e,t,r){function n(e,t,r,c,f){e!==t&&s(t,function(s,l){if(u(s))f||(f=new i),o(e,t,l,r,n,c,f);else{var p=c?c(e[l],s,l+"",e,t,f):void 0;void 0===p&&(p=s),a(e,l,p)}},l)}var i=r(99),a=r(247),s=r(249),o=r(499),u=r(11),l=r(46);e.exports=n},function(e,t,r){function n(e,t,r,n,g,b,E){var x=e[r],A=t[r],_=E.get(A);if(_)return void i(e,r,_);var D=b?b(x,A,r+"",e,t,E):void 0,C=void 0===D;if(C){var S=c(A),w=!S&&p(A),F=!S&&!w&&v(A);D=A,S||w||F?c(x)?D=x:f(x)?D=o(x):w?(C=!1,D=a(A,!0)):F?(C=!1,D=s(A,!0)):D=[]:m(A)||l(A)?(D=x,l(x)?D=y(x):(!h(x)||n&&d(x))&&(D=u(A))):C=!1}C&&(E.set(A,D),g(D,A,n,b,E),E.delete(A)),i(e,r,D)}var i=r(247),a=r(256),s=r(257),o=r(166),u=r(265),l=r(113),c=r(6),f=r(588),p=r(114),d=r(115),h=r(11),m=r(275),v=r(176),y=r(601);e.exports=n},function(e,t,r){function n(e,t,r){var n=-1;t=i(t.length?t:[c],u(a));var f=s(e,function(e,r,a){var s=i(t,function(t){return t(e)});return{criteria:s,index:++n,value:e}});return o(f,function(e,t){return l(e,t,r)})}var i=r(57),a=r(58),s=r(253),o=r(507),u=r(103),l=r(520),c=r(59);e.exports=n},function(e,t){function r(e){return function(t){return null==t?void 0:t[e]}}e.exports=r},function(e,t,r){function n(e){return function(t){return i(t,e)}}var i=r(250);e.exports=n},function(e,t,r){function n(e,t,r,n){var l=n?s:a,f=-1,p=t.length,d=e;for(e===t&&(t=u(t)),r&&(d=i(e,o(r)));++f<p;)for(var h=0,m=t[f],v=r?r(m):m;(h=l(d,v,h,n))>-1;)d!==e&&c.call(d,h,1),c.call(e,h,1);return e}var i=r(57),a=r(101),s=r(486),o=r(103),u=r(166),l=Array.prototype,c=l.splice;e.exports=n},function(e,t){function r(e,t){var r="";if(!e||t<1||t>n)return r;do t%2&&(r+=e),t=i(t/2),t&&(e+=e);while(t);return r}var n=9007199254740991,i=Math.floor;e.exports=r},function(e,t,r){var n=r(578),i=r(259),a=r(59),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:a;e.exports=s},function(e,t){function r(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}e.exports=r},function(e,t){function r(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}e.exports=r},function(e,t){function r(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}e.exports=r},function(e,t,r){function n(e,t,r){var n=-1,f=a,p=e.length,d=!0,h=[],m=h;if(r)d=!1,f=s;else if(p>=c){var v=t?null:u(e);if(v)return l(v);d=!1,f=o,m=new i}else m=t?[]:h;e:for(;++n<p;){var y=e[n],g=t?t(y):y;if(y=r||0!==y?y:0,d&&g===g){for(var b=m.length;b--;)if(m[b]===g)continue e;t&&m.push(g),h.push(y)}else f(m,g,r)||(m!==h&&m.push(g),h.push(y))}return h}var i=r(241),a=r(473),s=r(474),o=r(254),u=r(526),l=r(108),c=200;e.exports=n},function(e,t,r){function n(e,t){return i(t,function(t){return e[t]})}var i=r(57);e.exports=n},function(e,t,r){function n(e){return"function"==typeof e?e:i}var i=r(59);e.exports=n},function(e,t,r){function n(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:i(e,t,r)}var i=r(506);e.exports=n},function(e,t,r){function n(e,t){for(var r=e.length;r--&&i(t,e[r],0)>-1;);return r}var i=r(101);e.exports=n},function(e,t,r){function n(e,t){var r=t?i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var i=r(165);e.exports=n},function(e,t,r){function n(e,t,r){var n=t?r(s(e),o):s(e);return a(n,i,new e.constructor)}var i=r(471),a=r(246),s=r(267),o=1;e.exports=n},function(e,t){function r(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}var n=/\w*$/;e.exports=r},function(e,t,r){function n(e,t,r){var n=t?r(s(e),o):s(e);return a(n,i,new e.constructor)}var i=r(472),a=r(246),s=r(108),o=1;e.exports=n},function(e,t,r){function n(e){return s?Object(s.call(e)):{}}var i=r(44),a=i?i.prototype:void 0,s=a?a.valueOf:void 0;e.exports=n},function(e,t,r){function n(e,t){if(e!==t){var r=void 0!==e,n=null===e,a=e===e,s=i(e),o=void 0!==t,u=null===t,l=t===t,c=i(t);if(!u&&!c&&!s&&e>t||s&&o&&l&&!u&&!c||n&&o&&l||!r&&l||!a)return 1;if(!n&&!s&&!c&&e<t||c&&r&&a&&!n&&!s||u&&r&&a||!o&&a||!l)return-1}return 0}var i=r(60);e.exports=n},function(e,t,r){function n(e,t,r){for(var n=-1,a=e.criteria,s=t.criteria,o=a.length,u=r.length;++n<o;){var l=i(a[n],s[n]);if(l){if(n>=u)return l;var c=r[n];return l*("desc"==c?-1:1)}}return e.index-t.index}var i=r(519);e.exports=n},function(e,t,r){function n(e,t){return i(e,a(e),t)}var i=r(31),a=r(168);e.exports=n},function(e,t,r){function n(e,t){return i(e,a(e),t)}var i=r(31),a=r(262);e.exports=n},function(e,t,r){var n=r(16),i=n["__core-js_shared__"];e.exports=i},function(e,t,r){function n(e,t){return function(r,n){if(null==r)return r;if(!i(r))return e(r,n);for(var a=r.length,s=t?a:-1,o=Object(r);(t?s--:++s<a)&&n(o[s],s,o)!==!1;);return r}}var i=r(26);e.exports=n},function(e,t){function r(e){return function(t,r,n){for(var i=-1,a=Object(t),s=n(t),o=s.length;o--;){var u=s[e?o:++i];if(r(a[u],u,a)===!1)break}return t}}e.exports=r},function(e,t,r){var n=r(240),i=r(593),a=r(108),s=1/0,o=n&&1/a(new n([,-0]))[1]==s?function(e){return new n(e)}:i;e.exports=o},function(e,t,r){function n(e,t,r,n,i,_,C){switch(r){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!_(new a(e),new a(t)));case p:case d:case v:return s(+e,+t);case h:return e.name==t.name&&e.message==t.message;case y:case b:return e==t+"";case m:var S=u;case g:var w=n&c;if(S||(S=l),e.size!=t.size&&!w)return!1;var F=C.get(e);if(F)return F==t;n|=f,C.set(e,t);var k=o(S(e),S(t),n,i,_,C);return C.delete(e),k;case E:if(D)return D.call(e)==D.call(t)}return!1}var i=r(44),a=r(242),s=r(45),o=r(260),u=r(267),l=r(108),c=1,f=2,p="[object Boolean]",d="[object Date]",h="[object Error]",m="[object Map]",v="[object Number]",y="[object RegExp]",g="[object Set]",b="[object String]",E="[object Symbol]",x="[object ArrayBuffer]",A="[object DataView]",_=i?i.prototype:void 0,D=_?_.valueOf:void 0;e.exports=n},function(e,t,r){function n(e,t,r,n,s,u){var l=r&a,c=i(e),f=c.length,p=i(t),d=p.length;if(f!=d&&!l)return!1;for(var h=f;h--;){var m=c[h];if(!(l?m in t:o.call(t,m)))return!1}var v=u.get(e);if(v&&u.get(t))return v==t;var y=!0;u.set(e,t),u.set(t,e);for(var g=l;++h<f;){m=c[h];var b=e[m],E=t[m];if(n)var x=l?n(E,b,m,t,e,u):n(b,E,m,e,t,u);if(!(void 0===x?b===E||s(b,E,r,n,u):x)){y=!1;break}g||(g="constructor"==m)}if(y&&!g){var A=e.constructor,_=t.constructor;A!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof A&&A instanceof A&&"function"==typeof _&&_ instanceof _)&&(y=!1)}return u.delete(e),u.delete(t),y}var i=r(27),a=1,s=Object.prototype,o=s.hasOwnProperty;e.exports=n},function(e,t,r){function n(e){return i(e,s,a)}var i=r(251),a=r(168),s=r(27);e.exports=n},function(e,t,r){function n(e){return i(e,s,a)}var i=r(251),a=r(262),s=r(46);e.exports=n},function(e,t,r){function n(e){for(var t=a(e),r=t.length;r--;){var n=t[r],s=e[n];t[r]=[n,s,i(s)]}return t}var i=r(266),a=r(27);e.exports=n},function(e,t,r){function n(e){var t=s.call(e,u),r=e[u];try{e[u]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[u]=r:delete e[u]),i}var i=r(44),a=Object.prototype,s=a.hasOwnProperty,o=a.toString,u=i?i.toStringTag:void 0;e.exports=n},function(e,t){function r(e,t){return null==e?void 0:e[t]}e.exports=r},function(e,t){function r(e){return c.test(e)}var n="\\ud800-\\udfff",i="\\u0300-\\u036f",a="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=i+a+s,u="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+n+o+u+"]");e.exports=r},function(e,t,r){function n(){this.__data__=i?i(null):{},this.size=0}var i=r(107);e.exports=n},function(e,t){function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}e.exports=r},function(e,t,r){function n(e){var t=this.__data__;if(i){var r=t[e];return r===a?void 0:r}return o.call(t,e)?t[e]:void 0}var i=r(107),a="__lodash_hash_undefined__",s=Object.prototype,o=s.hasOwnProperty;e.exports=n},function(e,t,r){function n(e){var t=this.__data__;return i?void 0!==t[e]:s.call(t,e)}var i=r(107),a=Object.prototype,s=a.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=i&&void 0===t?a:t,this}var i=r(107),a="__lodash_hash_undefined__";e.exports=n},function(e,t){function r(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&i.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var n=Object.prototype,i=n.hasOwnProperty;e.exports=r},function(e,t,r){function n(e,t,r,n){var P=e.constructor;switch(t){case b:return i(e);case f:case p:return new P((+e));case E:return a(e,n);case x:case A:case _:case D:case C:case S:case w:case F:case k:return c(e,n);case d:return s(e,n,r);case h:case y:return new P(e);case m:return o(e);case v:return u(e,n,r);case g:return l(e)}}var i=r(165),a=r(514),s=r(515),o=r(516),u=r(517),l=r(518),c=r(257),f="[object Boolean]",p="[object Date]",d="[object Map]",h="[object Number]",m="[object RegExp]",v="[object Set]",y="[object String]",g="[object Symbol]",b="[object ArrayBuffer]",E="[object DataView]",x="[object Float32Array]",A="[object Float64Array]",_="[object Int8Array]",D="[object Int16Array]",C="[object Int32Array]",S="[object Uint8Array]",w="[object Uint8ClampedArray]",F="[object Uint16Array]",k="[object Uint32Array]";e.exports=n},function(e,t,r){function n(e){return s(e)||a(e)||!!(o&&e&&e[o])}var i=r(44),a=r(113),s=r(6),o=i?i.isConcatSpreadable:void 0;e.exports=n},function(e,t){function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.exports=r},function(e,t,r){function n(e){return!!a&&a in e}var i=r(523),a=function(){var e=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=n},function(e,t){function r(){this.__data__=[],this.size=0}e.exports=r},function(e,t,r){function n(e){var t=this.__data__,r=i(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():s.call(t,r,1),--this.size,!0}var i=r(100),a=Array.prototype,s=a.splice;e.exports=n},function(e,t,r){function n(e){var t=this.__data__,r=i(t,e);return r<0?void 0:t[r][1]}var i=r(100);e.exports=n},function(e,t,r){function n(e){return i(this.__data__,e)>-1}var i=r(100);e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__,n=i(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var i=r(100);e.exports=n},function(e,t,r){function n(){this.size=0,this.__data__={hash:new i,map:new(s||a),string:new i}}var i=r(468),a=r(98),s=r(157);e.exports=n},function(e,t,r){function n(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}var i=r(105);e.exports=n},function(e,t,r){function n(e){return i(this,e).get(e)}var i=r(105);e.exports=n},function(e,t,r){function n(e){return i(this,e).has(e)}var i=r(105);e.exports=n},function(e,t,r){function n(e,t){var r=i(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var i=r(105);e.exports=n},function(e,t,r){function n(e){var t=i(e,function(e){return r.size===a&&r.clear(),e}),r=t.cache;return t}var i=r(591),a=500;e.exports=n},function(e,t,r){var n=r(172),i=n(Object.keys,Object);e.exports=i},function(e,t){function r(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}e.exports=r},function(e,t){function r(e){return i.call(e)}var n=Object.prototype,i=n.toString;e.exports=r},function(e,t,r){function n(e,t,r){return t=a(void 0===t?e.length-1:t,0),function(){for(var n=arguments,s=-1,o=a(n.length-t,0),u=Array(o);++s<o;)u[s]=n[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=n[s];return l[t]=r(u),i(e,this,l)}}var i=r(243),a=Math.max;e.exports=n},function(e,t){function r(e){return this.__data__.set(e,n),this}var n="__lodash_hash_undefined__";e.exports=r},function(e,t){function r(e){return this.__data__.has(e)}e.exports=r},function(e,t,r){var n=r(505),i=r(563),a=i(n);e.exports=a},function(e,t){function r(e){var t=0,r=0;return function(){var s=a(),o=i-(s-r);if(r=s,o>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,i=16,a=Date.now;e.exports=r},function(e,t,r){function n(){this.__data__=new i,this.size=0}var i=r(98);e.exports=n},function(e,t){function r(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}e.exports=r},function(e,t){function r(e){return this.__data__.get(e)}e.exports=r},function(e,t){function r(e){return this.__data__.has(e)}e.exports=r},function(e,t,r){function n(e,t){var r=this.__data__;if(r instanceof i){var n=r.__data__;if(!a||n.length<o-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new s(n)}return r.set(e,t),this.size=r.size,this}var i=r(98),a=r(157),s=r(158),o=200;e.exports=n},function(e,t){function r(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}e.exports=r},function(e,t,r){function n(e){return a(e)?s(e):i(e)}var i=r(476),a=r(534),s=r(572);e.exports=n},function(e,t,r){var n=r(555),i=/^\./,a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,o=n(function(e){ var t=[];return i.test(e)&&t.push(""),e.replace(a,function(e,r,n,i){t.push(n?i.replace(s,"$1"):r||e)}),t});e.exports=o},function(e,t){function r(e){return e.match(A)||[]}var n="\\ud800-\\udfff",i="\\u0300-\\u036f",a="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=i+a+s,u="\\ufe0e\\ufe0f",l="["+n+"]",c="["+o+"]",f="\\ud83c[\\udffb-\\udfff]",p="(?:"+c+"|"+f+")",d="[^"+n+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",y=p+"?",g="["+u+"]?",b="(?:"+v+"(?:"+[d,h,m].join("|")+")"+g+y+")*",E=g+y+b,x="(?:"+[d+c+"?",c,h,m,l].join("|")+")",A=RegExp(f+"(?="+f+")|"+x+E,"g");e.exports=r},function(e,t,r){var n=r(31),i=r(104),a=r(46),s=i(function(e,t){n(t,a(t),e)});e.exports=s},function(e,t,r){var n=r(31),i=r(104),a=r(46),s=i(function(e,t,r,i){n(t,a(t),e,i)});e.exports=s},function(e,t,r){function n(e){return i(e,a|s)}var i=r(162),a=1,s=4;e.exports=n},function(e,t,r){function n(e,t){return t="function"==typeof t?t:void 0,i(e,a|s,t)}var i=r(162),a=1,s=4;e.exports=n},function(e,t){function r(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var a=e[t];a&&(i[n++]=a)}return i}e.exports=r},function(e,t){function r(e){return function(){return e}}e.exports=r},function(e,t,r){function n(e){return e=i(e),e&&s.test(e)?e.replace(a,"\\$&"):e}var i=r(61),a=/[\\^$.*+?()[\]{}|]/g,s=RegExp(a.source);e.exports=n},function(e,t,r){e.exports=r(573)},function(e,t,r){var n=r(258),i=r(582),a=n(i);e.exports=a},function(e,t,r){function n(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var u=null==r?0:s(r);return u<0&&(u=o(n+u,0)),i(e,a(t,3),u)}var i=r(163),a=r(58),s=r(47),o=Math.max;e.exports=n},function(e,t,r){var n=r(258),i=r(584),a=n(i);e.exports=a},function(e,t,r){function n(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var l=n-1;return void 0!==r&&(l=s(r),l=r<0?o(n+l,0):u(l,n-1)),i(e,a(t,3),l,!0)}var i=r(163),a=r(58),s=r(47),o=Math.max,u=Math.min;e.exports=n},function(e,t,r){function n(e,t){var r=o(e)?i:a;return r(e,s(t))}var i=r(244),a=r(248),s=r(511),o=r(6);e.exports=n},function(e,t,r){function n(e,t,r){var n=null==e?void 0:i(e,t);return void 0===n?r:n}var i=r(250);e.exports=n},function(e,t,r){function n(e,t){return null!=e&&a(e,t,i)}var i=r(485),a=r(264);e.exports=n},function(e,t,r){function n(e){return a(e)&&i(e)}var i=r(26),a=r(12);e.exports=n},function(e,t,r){function n(e){return"number"==typeof e&&e==i(e)}var i=r(47);e.exports=n},function(e,t,r){function n(e,t){var r=o(e)?i:s;return r(e,a(t,3))}var i=r(57),a=r(58),s=r(253),o=r(6);e.exports=n},function(e,t,r){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(a);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=e.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(n.Cache||i),r}var i=r(158),a="Expected a function";n.Cache=i,e.exports=n},function(e,t,r){var n=r(498),i=r(104),a=i(function(e,t,r,i){n(e,t,r,i)});e.exports=a},function(e,t){function r(){}e.exports=r},function(e,t,r){function n(e){return s(e)?i(o(e)):a(e)}var i=r(501),a=r(502),s=r(171),o=r(109);e.exports=n},function(e,t,r){function n(e,t){return e&&e.length&&t&&t.length?i(e,t):e}var i=r(503);e.exports=n},function(e,t,r){var n=r(482),i=r(500),a=r(102),s=r(170),o=a(function(e,t){if(null==e)return[];var r=t.length;return r>1&&s(e,t[0],t[1])?t=[]:r>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),i(e,n(t,1),[])});e.exports=o},function(e,t,r){function n(e,t,r){return e=o(e),r=i(s(r),0,e.length),t=a(t),e.slice(r,r+t.length)==t}var i=r(480),a=r(164),s=r(47),o=r(61);e.exports=n},function(e,t){function r(){return!1}e.exports=r},function(e,t,r){function n(e){if(!e)return 0===e?e:0;if(e=i(e),e===a||e===-a){var t=e<0?-1:1;return t*s}return e===e?e:0}var i=r(600),a=1/0,s=1.7976931348623157e308;e.exports=n},function(e,t,r){function n(e){if("number"==typeof e)return e;if(a(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var r=l.test(e);return r||c.test(e)?f(e.slice(2),r?2:8):u.test(e)?s:+e}var i=r(11),a=r(60),s=NaN,o=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;e.exports=n},function(e,t,r){function n(e){return i(e,a(e))}var i=r(31),a=r(46);e.exports=n},function(e,t,r){function n(e,t,r){if(e=u(e),e&&(r||void 0===t))return e.replace(l,"");if(!e||!(t=i(t)))return e;var n=o(e),c=s(n,o(t))+1;return a(n,0,c).join("")}var i=r(164),a=r(512),s=r(513),o=r(570),u=r(61),l=/\s+$/;e.exports=n},function(e,t,r){function n(e){return e&&e.length?i(e):[]}var i=r(509);e.exports=n},function(e,t,r){function n(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function i(e,t){return t=t||{},function(r,n,i){return s(r,e,t)}}function a(e,t){e=e||{},t=t||{};var r={};return Object.keys(t).forEach(function(e){r[e]=t[e]}),Object.keys(e).forEach(function(t){r[t]=e[t]}),r}function s(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new o(t,r).match(e))}function o(e,t){if(!(this instanceof o))return new o(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==v.sep&&(e=e.split(v.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function u(){if(!this._made){var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error),this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(C)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return e.indexOf(!1)===-1}),this.debug(this.pattern,r),this.set=r}}function l(){var e=this.pattern,t=!1,r=this.options,n=0;if(!r.nonegate){for(var i=0,a=e.length;i<a&&"!"===e.charAt(i);i++)t=!t,n++;n&&(this.pattern=e.substr(n)),this.negate=t}}function c(e,t){if(t||(t=this instanceof o?this.options:{}),e="undefined"==typeof e?this.pattern:e,"undefined"==typeof e)throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:g(e)}function f(e,t){function r(){if(i){switch(i){case"*":s+=x,o=!0;break;case"?":s+=E,o=!0;break;default:s+="\\"+i}v.debug("clearStateChar %j %j",i,s),i=!1}}if(e.length>65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return y;if(""===e)return"";for(var i,a,s="",o=!!n.nocase,u=!1,l=[],c=[],f=!1,p=-1,d=-1,m="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",v=this,g=0,A=e.length;g<A&&(a=e.charAt(g));g++)if(this.debug("%s\t%s %s %j",e,g,s,a),u&&D[a])s+="\\"+a,u=!1;else switch(a){case"/":return!1;case"\\":r(),u=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,g,s,a),f){this.debug(" in class"),"!"===a&&g===d+1&&(a="^"),s+=a;continue}v.debug("call clearStateChar %j",i),r(),i=a,n.noext&&r();continue;case"(":if(f){s+="(";continue}if(!i){s+="\\(";continue}l.push({type:i,start:g-1,reStart:s.length,open:b[i].open,close:b[i].close}),s+="!"===i?"(?:(?!(?:":"(?:",this.debug("plType %j %j",i,s),i=!1;continue;case")":if(f||!l.length){s+="\\)";continue}r(),o=!0;var _=l.pop();s+=_.close,"!"===_.type&&c.push(_),_.reEnd=s.length;continue;case"|":if(f||!l.length||u){s+="\\|",u=!1;continue}r(),s+="|";continue;case"[":if(r(),f){s+="\\"+a;continue}f=!0,d=g,p=s.length,s+=a;continue;case"]":if(g===d+1||!f){s+="\\"+a,u=!1;continue}if(f){var C=e.substring(d+1,g);try{RegExp("["+C+"]")}catch(e){var w=this.parse(C,S);s=s.substr(0,p)+"\\["+w[0]+"\\]",o=o||w[1],f=!1;continue}}o=!0,f=!1,s+=a;continue;default:r(),u?u=!1:!D[a]||"^"===a&&f||(s+="\\"),s+=a}for(f&&(C=e.substr(d+1),w=this.parse(C,S),s=s.substr(0,p)+"\\["+w[0],o=o||w[1]),_=l.pop();_;_=l.pop()){var F=s.slice(_.reStart+_.open.length);this.debug("setting tail",s,_),F=F.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(e,t,r){return r||(r="\\"),t+t+r+"|"}),this.debug("tail=%j\n %s",F,F,_,s);var k="*"===_.type?x:"?"===_.type?E:"\\"+_.type;o=!0,s=s.slice(0,_.reStart)+k+"\\("+F}r(),u&&(s+="\\\\");var P=!1;switch(s.charAt(0)){case".":case"[":case"(":P=!0}for(var T=c.length-1;T>-1;T--){var O=c[T],B=s.slice(0,O.reStart),R=s.slice(O.reStart,O.reEnd-8),I=s.slice(O.reEnd-8,O.reEnd),M=s.slice(O.reEnd);I+=M;var N=B.split("(").length-1,L=M;for(g=0;g<N;g++)L=L.replace(/\)[+*?]?/,"");M=L;var j="";""===M&&t!==S&&(j="$");var U=B+R+M+j+I;s=U}if(""!==s&&o&&(s="(?=.)"+s),P&&(s=m+s),t===S)return[s,o];if(!o)return h(e);var V=n.nocase?"i":"";try{var G=new RegExp("^"+s+"$",V)}catch(e){return new RegExp("$.")}return G._glob=e,G._src=s,G}function p(){if(this.regexp||this.regexp===!1)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,r=t.noglobstar?x:t.dot?A:_,n=t.nocase?"i":"",i=e.map(function(e){return e.map(function(e){return e===y?r:"string"==typeof e?m(e):e._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,n)}catch(e){this.regexp=!1}return this.regexp}function d(e,t){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var r=this.options;"/"!==v.sep&&(e=e.split(v.sep).join("/")),e=e.split(C),this.debug(this.pattern,"split",e);var n=this.set;this.debug(this.pattern,"set",n);var i,a;for(a=e.length-1;a>=0&&!(i=e[a]);a--);for(a=0;a<n.length;a++){var s=n[a],o=e;r.matchBase&&1===s.length&&(o=[i]);var u=this.matchOne(o,s,t);if(u)return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}function h(e){return e.replace(/\\(.)/g,"$1")}function m(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}e.exports=s,s.Minimatch=o;var v={sep:"/"};try{v=r(17)}catch(e){}var y=s.GLOBSTAR=o.GLOBSTAR={},g=r(396),b={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},E="[^/]",x=E+"*?",A="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",_="(?:(?!(?:\\/|^)\\.).)*?",D=n("().*{}+?[]^$\\!"),C=/\/+/;s.filter=i,s.defaults=function(e){if(!e||!Object.keys(e).length)return s;var t=s,r=function(r,n,i){return t.minimatch(r,n,a(e,i))};return r.Minimatch=function(r,n){return new t.Minimatch(r,a(e,n))},r},o.defaults=function(e){return e&&Object.keys(e).length?s.defaults(e).Minimatch:o},o.prototype.debug=function(){},o.prototype.make=u,o.prototype.parseNegate=l,s.braceExpand=function(e,t){return c(e,t)},o.prototype.braceExpand=c,o.prototype.parse=f;var S={};s.makeRe=function(e,t){return new o(e,t||{}).makeRe()},o.prototype.makeRe=p,s.match=function(e,t,r){r=r||{};var n=new o(t,r);return e=e.filter(function(e){return n.match(e)}),n.options.nonull&&!e.length&&e.push(t),e},o.prototype.match=d,o.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,a=0,s=e.length,o=t.length;i<s&&a<o;i++,a++){this.debug("matchOne loop");var u=t[a],l=e[i];if(this.debug(t,u,l),u===!1)return!1;if(u===y){this.debug("GLOBSTAR",[t,u,l]);var c=i,f=a+1;if(f===o){for(this.debug("** at the end");i<s;i++)if("."===e[i]||".."===e[i]||!n.dot&&"."===e[i].charAt(0))return!1;return!0}for(;c<s;){var p=e[c];if(this.debug("\nglobstar while",e,c,t,f,p),this.matchOne(e.slice(c),t.slice(f),r))return this.debug("globstar found match!",c,s,p),!0;if("."===p||".."===p||!n.dot&&"."===p.charAt(0)){this.debug("dot detected!",e,c,t,f);break}this.debug("globstar swallow a segment, and continue"),c++}return!(!r||(this.debug("\n>>> no match, partial?",e,c,t,f),c!==s))}var d;if("string"==typeof u?(d=n.nocase?l.toLowerCase()===u.toLowerCase():l===u,this.debug("string match",u,l,d)):(d=l.match(u),this.debug("pattern match",u,l,d)),!d)return!1}if(i===s&&a===o)return!0;if(i===s)return r;if(a===o){var h=i===s-1&&""===e[i];return h}throw new Error("wtf?")}},function(e,t){function r(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*c;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*u;case"minutes":case"minute":case"mins":case"min":case"m":return r*o;case"seconds":case"second":case"secs":case"sec":case"s":return r*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function n(e){return e>=l?Math.round(e/l)+"d":e>=u?Math.round(e/u)+"h":e>=o?Math.round(e/o)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function i(e){return a(e,l,"day")||a(e,u,"hour")||a(e,o,"minute")||a(e,s,"second")||e+" ms"}function a(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var s=1e3,o=60*s,u=60*o,l=24*u,c=365.25*l;e.exports=function(e,t){t=t||{};var a=typeof e;if("string"===a&&e.length>0)return r(e);if("number"===a&&isNaN(e)===!1)return t.long?i(e):n(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t){"use strict";e.exports=Number.isNaN||function(e){return e!==e}},function(e,t,r){(function(t){"use strict";function r(e){return"/"===e.charAt(0)}function n(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,r=t.exec(e),n=r[1]||"",i=Boolean(n&&":"!==n.charAt(1));return Boolean(r[2]||i)}e.exports="win32"===t.platform?n:r,e.exports.posix=r,e.exports.win32=n}).call(t,r(18))},function(e,t,r){var n=r(282);t.REGULAR={d:n().addRange(48,57),D:n().addRange(0,47).addRange(58,65535),s:n(32,160,5760,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:n().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:n(95).addRange(48,57).addRange(65,90).addRange(97,122),W:n(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)},t.UNICODE={d:n().addRange(48,57),D:n().addRange(0,47).addRange(58,1114111),s:n(32,160,5760,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:n().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:n(95).addRange(48,57).addRange(65,90).addRange(97,122),W:n(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)},t.UNICODE_IGNORE_CASE={d:n().addRange(48,57),D:n().addRange(0,47).addRange(58,1114111),s:n(32,160,5760,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:n().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:n(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:n(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},function(e,t,r){function n(e){return _?A?m.UNICODE_IGNORE_CASE[e]:m.UNICODE[e]:m.REGULAR[e]}function i(e,t){return y.call(e,t)}function a(e,t){for(var r in t)e[r]=t[r]}function s(e,t){if(t){var r=p(t,"");switch(r.type){case"characterClass":case"group":case"value":break;default:r=o(r,t)}a(e,r)}}function o(e,t){return{type:"group",behavior:"ignore",body:[e],raw:"(?:"+t+")"}}function u(e){return!!i(h,e)&&h[e]}function l(e){var t=d();e.body.forEach(function(e){switch(e.type){case"value":if(t.add(e.codePoint),A&&_){var r=u(e.codePoint);r&&t.add(r)}break;case"characterClassRange":var i=e.min.codePoint,a=e.max.codePoint;t.addRange(i,a),A&&_&&t.iuAddRange(i,a);break;case"characterClassEscape":t.add(n(e.value));break;default:throw Error("Unknown term type: "+e.type)}});return e.negative&&(t=(_?g:b).clone().remove(t)),s(e,t.toString()),e}function c(e){switch(e.type){case"dot":s(e,(_?E:x).toString());break;case"characterClass":e=l(e);break;case"characterClassEscape":s(e,n(e.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":e.body=e.body.map(c);break;case"value":var t=e.codePoint,r=d(t);if(A&&_){var i=u(t);i&&r.add(i)}s(e,r.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+e.type)}return e}var f=r(610).generate,p=r(611).parse,d=r(282),h=r(464),m=r(608),v={},y=v.hasOwnProperty,g=d().addRange(0,1114111),b=d().addRange(0,65535),E=g.clone().remove(10,13,8232,8233),x=E.clone().intersection(b);d.prototype.iuAddRange=function(e,t){var r=this;do{var n=u(e);n&&r.add(n)}while(++e<=t);return r};var A=!1,_=!1;e.exports=function(e,t){var r=p(e,t);return A=!!t&&t.indexOf("i")>-1,_=!!t&&t.indexOf("u")>-1,a(r,c(r)),f(r)}},function(e,t,r){var n;(function(e,i){(function(){"use strict";function a(){var e,t,r=16384,n=[],i=-1,a=arguments.length;if(!a)return"";for(var s="";++i<a;){var o=Number(arguments[i]);if(!isFinite(o)||o<0||o>1114111||F(o)!=o)throw RangeError("Invalid code point: "+o);o<=65535?n.push(o):(o-=65536,e=(o>>10)+55296,t=o%1024+56320,n.push(e,t)),(i+1==a||n.length>r)&&(s+=w.apply(null,n),n.length=0)}return s}function s(e,t){if(t.indexOf("|")==-1){if(e==t)return;throw Error("Invalid node type: "+e)}if(t=s.hasOwnProperty(t)?s[t]:s[t]=RegExp("^(?:"+t+")$"),!t.test(e))throw Error("Invalid node type: "+e)}function o(e){var t=e.type;if(o.hasOwnProperty(t)&&"function"==typeof o[t])return o[t](e);throw Error("Invalid node type: "+t)}function u(e){s(e.type,"alternative");var t=e.body,r=t?t.length:0;if(1==r)return E(t[0]);for(var n=-1,i="";++n<r;)i+=E(t[n]);return i}function l(e){switch(s(e.type,"anchor"),e.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function c(e){return s(e.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value"),o(e)}function f(e){s(e.type,"characterClass");var t=e.body,r=t?t.length:0,n=-1,i="[";for(e.negative&&(i+="^");++n<r;)i+=h(t[n]);return i+="]"}function p(e){return s(e.type,"characterClassEscape"),"\\"+e.value}function d(e){s(e.type,"characterClassRange");var t=e.min,r=e.max;if("characterClassRange"==t.type||"characterClassRange"==r.type)throw Error("Invalid character class range");return h(t)+"-"+h(r)}function h(e){return s(e.type,"anchor|characterClassEscape|characterClassRange|dot|value"),o(e)}function m(e){s(e.type,"disjunction");var t=e.body,r=t?t.length:0;if(0==r)throw Error("No body");if(1==r)return o(t[0]);for(var n=-1,i="";++n<r;)0!=n&&(i+="|"),i+=o(t[n]);return i}function v(e){return s(e.type,"dot"),"."}function y(e){s(e.type,"group");var t="(";switch(e.behavior){case"normal":break;case"ignore":t+="?:";break;case"lookahead":t+="?=";break;case"negativeLookahead":t+="?!";break;default:throw Error("Invalid behaviour: "+e.behaviour)}var r=e.body,n=r?r.length:0;if(1==n)t+=o(r[0]);else for(var i=-1;++i<n;)t+=o(r[i]);return t+=")"}function g(e){s(e.type,"quantifier");var t="",r=e.min,n=e.max;switch(n){case void 0:case null:switch(r){case 0:t="*";break;case 1:t="+";break;default:t="{"+r+",}"}break;default:t=r==n?"{"+r+"}":0==r&&1==n?"?":"{"+r+","+n+"}"}return e.greedy||(t+="?"),c(e.body[0])+t}function b(e){return s(e.type,"reference"),"\\"+e.matchIndex}function E(e){return s(e.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value"),o(e)}function x(e){s(e.type,"value");var t=e.kind,r=e.codePoint;switch(t){case"controlLetter":return"\\c"+a(r+64);case"hexadecimalEscape":return"\\x"+("00"+r.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+a(r);case"null":return"\\"+r;case"octal":return"\\"+r.toString(8);case"singleEscape":switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+r)}case"symbol":return a(r);case"unicodeEscape":return"\\u"+("0000"+r.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+r.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+t)}}var A={function:!0,object:!0},_=A[typeof window]&&window||this,D=A[typeof t]&&t,C=A[typeof e]&&e&&!e.nodeType&&e,S=D&&C&&"object"==typeof i&&i;!S||S.global!==S&&S.window!==S&&S.self!==S||(_=S);var w=String.fromCharCode,F=Math.floor;o.alternative=u,o.anchor=l,o.characterClass=f,o.characterClassEscape=p,o.characterClassRange=d,o.disjunction=m,o.dot=v,o.group=y,o.quantifier=g,o.reference=b,o.value=x,n=function(){return{generate:o}}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}).call(this)}).call(t,r(39)(e),function(){return this}())},function(e,t){!function(){function t(e,t){function r(t){return t.raw=e.substring(t.range[0],t.range[1]),t}function n(e,t){return e.range[0]=t,r(e)}function i(e,t){return r({type:"anchor",kind:e,range:[$-t,$]})}function a(e,t,n,i){return r({type:"value",kind:e,codePoint:t,range:[n,i]})}function s(e,t,r,n){return n=n||0,a(e,t,$-(r.length+n),$)}function o(e){var t=e[0],r=t.charCodeAt(0);if(z){var n;if(1===t.length&&r>=55296&&r<=56319&&(n=x().charCodeAt(0),n>=56320&&n<=57343))return $++,a("symbol",1024*(r-55296)+n-56320+65536,$-2,$)}return a("symbol",r,$-1,$)}function u(e,t,n){return r({type:"disjunction",body:e,range:[t,n]})}function l(){return r({type:"dot",range:[$-1,$]})}function c(e){return r({type:"characterClassEscape",value:e,range:[$-2,$]})}function f(e){return r({type:"reference",matchIndex:parseInt(e,10),range:[$-1-e.length,$]})}function p(e,t,n,i){return r({type:"group",behavior:e,body:t,range:[n,i]})}function d(e,t,n,i){return null==i&&(n=$-1,i=$),r({type:"quantifier",min:e,max:t,greedy:!0,body:null,range:[n,i]})}function h(e,t,n){return r({type:"alternative",body:e,range:[t,n]})}function m(e,t,n,i){return r({type:"characterClass",body:e,negative:t,range:[n,i]})}function v(e,t,n,i){return e.codePoint>t.codePoint&&K("invalid range in character class",e.raw+"-"+t.raw,n,i),r({type:"characterClassRange",min:e,max:t,range:[n,i]})}function y(e){return"alternative"===e.type?e.body:[e]}function g(t){t=t||1;var r=e.substring($,$+t);return $+=t||1,r}function b(e){E(e)||K("character",e)}function E(t){if(e.indexOf(t,$)===$)return g(t.length)}function x(){return e[$]}function A(t){return e.indexOf(t,$)===$}function _(t){return e[$+1]===t}function D(t){var r=e.substring($),n=r.match(t);return n&&(n.range=[],n.range[0]=$,g(n[0].length),n.range[1]=$),n}function C(){var e=[],t=$;for(e.push(S());E("|");)e.push(S());return 1===e.length?e[0]:u(e,t,$)}function S(){for(var e,t=[],r=$;e=w();)t.push(e);return 1===t.length?t[0]:h(t,r,$)}function w(){if($>=e.length||A("|")||A(")"))return null;var t=k();if(t)return t;var r=T();r||K("Expected atom");var i=P()||!1;return i?(i.body=y(r),n(i,r.range[0]),i):r}function F(e,t,r,n){var i=null,a=$;if(E(e))i=t;else{if(!E(r))return!1;i=n}var s=C();s||K("Expected disjunction"),b(")");var o=p(i,y(s),a,$);return"normal"==i&&X&&J++,o}function k(){return E("^")?i("start",1):E("$")?i("end",1):E("\\b")?i("boundary",2):E("\\B")?i("not-boundary",2):F("(?=","lookahead","(?!","negativeLookahead")}function P(){var e,t,r,n,i=$;return E("*")?t=d(0):E("+")?t=d(1):E("?")?t=d(0,1):(e=D(/^\{([0-9]+)\}/))?(r=parseInt(e[1],10),t=d(r,r,e.range[0],e.range[1])):(e=D(/^\{([0-9]+),\}/))?(r=parseInt(e[1],10),t=d(r,void 0,e.range[0],e.range[1])):(e=D(/^\{([0-9]+),([0-9]+)\}/))&&(r=parseInt(e[1],10),n=parseInt(e[2],10),r>n&&K("numbers out of order in {} quantifier","",i,$),t=d(r,n,e.range[0],e.range[1])),t&&E("?")&&(t.greedy=!1,t.range[1]+=1),t}function T(){var e;return(e=D(/^[^^$\\.*+?(){[|]/))?o(e):E(".")?l():E("\\")?(e=R(),e||K("atomEscape"),e):(e=j())?e:F("(?:","ignore","(","normal")}function O(e){if(z){var t,n;if("unicodeEscape"==e.kind&&(t=e.codePoint)>=55296&&t<=56319&&A("\\")&&_("u")){var i=$;$++;var a=B();"unicodeEscape"==a.kind&&(n=a.codePoint)>=56320&&n<=57343?(e.range[1]=a.range[1],e.codePoint=1024*(t-55296)+n-56320+65536,e.type="value",e.kind="unicodeCodePointEscape",r(e)):$=i}}return e}function B(){return R(!0)}function R(e){var t,r=$;if(t=I())return t;if(e){if(E("b"))return s("singleEscape",8,"\\b");E("B")&&K("\\B not possible inside of CharacterClass","",r)}return t=M()}function I(){var e,t;if(e=D(/^(?!0)\d+/)){t=e[0];var r=parseInt(e[0],10);return r<=J?f(e[0]):(H.push(r),g(-e[0].length),(e=D(/^[0-7]{1,3}/))?s("octal",parseInt(e[0],8),e[0],1):(e=o(D(/^[89]/)),n(e,e.range[0]-1)))}return(e=D(/^[0-7]{1,3}/))?(t=e[0],/^0{1,3}$/.test(t)?s("null",0,"0",t.length+1):s("octal",parseInt(t,8),t,1)):!!(e=D(/^[dDsSwW]/))&&c(e[0])}function M(){var e;if(e=D(/^[fnrtv]/)){var t=0;switch(e[0]){case"t":t=9;break;case"n":t=10;break;case"v":t=11;break;case"f":t=12;break;case"r":t=13}return s("singleEscape",t,"\\"+e[0])}return(e=D(/^c([a-zA-Z])/))?s("controlLetter",e[1].charCodeAt(0)%32,e[1],2):(e=D(/^x([0-9a-fA-F]{2})/))?s("hexadecimalEscape",parseInt(e[1],16),e[1],2):(e=D(/^u([0-9a-fA-F]{4})/))?O(s("unicodeEscape",parseInt(e[1],16),e[1],2)):z&&(e=D(/^u\{([0-9a-fA-F]+)\}/))?s("unicodeCodePointEscape",parseInt(e[1],16),e[1],4):L()}function N(e){var t=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&t.test(String.fromCharCode(e))}function L(){var e,t="‌",r="‍";return N(x())?E(t)?s("identifier",8204,t):E(r)?s("identifier",8205,r):null:(e=g(),s("identifier",e.charCodeAt(0),e,1))}function j(){var e,t=$;return(e=D(/^\[\^/))?(e=U(),b("]"),m(e,!0,t,$)):E("[")?(e=U(),b("]"),m(e,!1,t,$)):null}function U(){var e;return A("]")?[]:(e=G(),e||K("nonEmptyClassRanges"),e)}function V(e){var t,r,n;if(A("-")&&!_("]")){b("-"),n=Y(),n||K("classAtom"),r=$;var i=U();return i||K("classRanges"),t=e.range[0],"empty"===i.type?[v(e,n,t,r)]:[v(e,n,t,r)].concat(i)}return n=W(),n||K("nonEmptyClassRangesNoDash"),[e].concat(n)}function G(){var e=Y();return e||K("classAtom"),A("]")?[e]:V(e)}function W(){var e=Y();return e||K("classAtom"),A("]")?e:V(e)}function Y(){return E("-")?o("-"):q()}function q(){var e;return(e=D(/^[^\\\]-]/))?o(e[0]):E("\\")?(e=B(),e||K("classEscape"),O(e)):void 0}function K(t,r,n,i){n=null==n?$:n,i=null==i?n:i;var a=Math.max(0,n-10),s=Math.min(i+10,e.length),o=" "+e.substring(a,s),u=" "+new Array(n-a+1).join(" ")+"^";throw SyntaxError(t+" at position "+n+(r?": "+r:"")+"\n"+o+"\n"+u)}var H=[],J=0,X=!0,z=(t||"").indexOf("u")!==-1,$=0;e=String(e),""===e&&(e="(?:)");var Q=C();Q.range[1]!==e.length&&K("Could not parse entire input - got stuck","",Q.range[1]);for(var Z=0;Z<H.length;Z++)if(H[Z]<=J)return $=0,X=!1,C();return Q}var r={parse:t};"undefined"!=typeof e&&e.exports?e.exports=r:window.regjsparser=r}()},function(e,t,r){"use strict";var n=r(459);e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected `input` to be a string");if(t<0||!n(t))throw new TypeError("Expected `count` to be a positive finite number");var r="";do 1&t&&(r+=e),e+=e;while(t>>=1);return r}},function(e,t){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){var t=65,r=90,n=97,i=122,a=48,s=57,o=43,u=47,l=26,c=52;return t<=e&&e<=r?e-t:n<=e&&e<=i?e-n+l:a<=e&&e<=s?e-a+c:e==o?62:e==u?63:-1}},function(e,t){function r(e,n,i,a,s,o){var u=Math.floor((n-e)/2)+e,l=s(i,a[u],!0);return 0===l?u:l>0?n-u>1?r(u,n,i,a,s,o):o==t.LEAST_UPPER_BOUND?n<a.length?n:-1:u:u-e>1?r(e,u,i,a,s,o):o==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,i,a){if(0===n.length)return-1;var s=r(-1,n.length,e,n,i,a||t.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===i(n[s],n[s-1],!0);)--s;return s}},function(e,t,r){function n(e,t){var r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,s=t.generatedColumn;return n>r||n==r&&s>=i||a.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var a=r(62);i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(a.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=i},function(e,t){function r(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function n(e,t){return Math.round(e+Math.random()*(t-e))}function i(e,t,a,s){if(a<s){var o=n(a,s),u=a-1;r(e,o,s);for(var l=e[s],c=a;c<s;c++)t(e[c],l)<=0&&(u+=1,r(e,u,c));r(e,u+1,c);var f=u+1;i(e,t,a,f-1),i(e,t,f+1,s)}}t.quickSort=function(e,t){i(e,t,0,e.length-1)}},function(e,t,r){function n(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new s(t):new i(t)}function i(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=o.getArg(t,"version"),n=o.getArg(t,"sources"),i=o.getArg(t,"names",[]),a=o.getArg(t,"sourceRoot",null),s=o.getArg(t,"sourcesContent",null),u=o.getArg(t,"mappings"),c=o.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);n=n.map(String).map(o.normalize).map(function(e){return a&&o.isAbsolute(a)&&o.isAbsolute(e)?o.relative(a,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(n,!0),this.sourceRoot=a,this.sourcesContent=s,this._mappings=u,this.file=c}function a(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=o.getArg(t,"version"),i=o.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new l,this._names=new l;var a={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=o.getArg(e,"offset"),r=o.getArg(t,"line"),i=o.getArg(t,"column");if(r<a.line||r===a.line&&i<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=t,{generatedOffset:{generatedLine:r+1,generatedColumn:i+1},consumer:new n(o.getArg(e,"map"))}})}var o=r(62),u=r(614),l=r(284).ArraySet,c=r(285),f=r(616).quickSort;n.fromSourceMap=function(e){return i.fromSourceMap(e)},n.prototype._version=3,n.prototype.__generatedMappings=null,Object.defineProperty(n.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),n.prototype.__originalMappings=null,Object.defineProperty(n.prototype,"_originalMappings",{get:function(){ return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),n.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},n.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},n.GENERATED_ORDER=1,n.ORIGINAL_ORDER=2,n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.prototype.eachMapping=function(e,t,r){var i,a=t||null,s=r||n.GENERATED_ORDER;switch(s){case n.GENERATED_ORDER:i=this._generatedMappings;break;case n.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;i.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=u&&(t=o.join(u,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,a)},n.prototype.allGeneratedPositionsFor=function(e){var t=o.getArg(e,"line"),r={source:o.getArg(e,"source"),originalLine:t,originalColumn:o.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=o.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var n=[],i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(i>=0){var a=this._originalMappings[i];if(void 0===e.column)for(var s=a.originalLine;a&&a.originalLine===s;)n.push({line:o.getArg(a,"generatedLine",null),column:o.getArg(a,"generatedColumn",null),lastColumn:o.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i];else for(var l=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==l;)n.push({line:o.getArg(a,"generatedLine",null),column:o.getArg(a,"generatedColumn",null),lastColumn:o.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i]}return n},t.SourceMapConsumer=n,i.prototype=Object.create(n.prototype),i.prototype.consumer=n,i.fromSourceMap=function(e){var t=Object.create(i.prototype),r=t._names=l.fromArray(e._names.toArray(),!0),n=t._sources=l.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var s=e._mappings.toArray().slice(),u=t.__generatedMappings=[],c=t.__originalMappings=[],p=0,d=s.length;p<d;p++){var h=s[p],m=new a;m.generatedLine=h.generatedLine,m.generatedColumn=h.generatedColumn,h.source&&(m.source=n.indexOf(h.source),m.originalLine=h.originalLine,m.originalColumn=h.originalColumn,h.name&&(m.name=r.indexOf(h.name)),c.push(m)),u.push(m)}return f(t.__originalMappings,o.compareByOriginalPositions),t},i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?o.join(this.sourceRoot,e):e},this)}}),i.prototype._parseMappings=function(e,t){for(var r,n,i,s,u,l=1,p=0,d=0,h=0,m=0,v=0,y=e.length,g=0,b={},E={},x=[],A=[];g<y;)if(";"===e.charAt(g))l++,g++,p=0;else if(","===e.charAt(g))g++;else{for(r=new a,r.generatedLine=l,s=g;s<y&&!this._charIsMappingSeparator(e,s);s++);if(n=e.slice(g,s),i=b[n])g+=n.length;else{for(i=[];g<s;)c.decode(e,g,E),u=E.value,g=E.rest,i.push(u);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");b[n]=i}r.generatedColumn=p+i[0],p=r.generatedColumn,i.length>1&&(r.source=m+i[1],m+=i[1],r.originalLine=d+i[2],d=r.originalLine,r.originalLine+=1,r.originalColumn=h+i[3],h=r.originalColumn,i.length>4&&(r.name=v+i[4],v+=i[4])),A.push(r),"number"==typeof r.originalLine&&x.push(r)}f(A,o.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,f(x,o.compareByOriginalPositions),this.__originalMappings=x},i.prototype._findMapping=function(e,t,r,n,i,a){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return u.search(e,t,i,a)},i.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},i.prototype.originalPositionFor=function(e){var t={generatedLine:o.getArg(e,"line"),generatedColumn:o.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",o.compareByGeneratedPositionsDeflated,o.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(r>=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var a=o.getArg(i,"source",null);null!==a&&(a=this._sources.at(a),null!=this.sourceRoot&&(a=o.join(this.sourceRoot,a)));var s=o.getArg(i,"name",null);return null!==s&&(s=this._names.at(s)),{source:a,line:o.getArg(i,"originalLine",null),column:o.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=o.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=o.urlParse(this.sourceRoot))){var n=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(n))return this.sourcesContent[this._sources.indexOf(n)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=o.getArg(e,"source");if(null!=this.sourceRoot&&(t=o.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var r={source:t,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(i>=0){var a=this._originalMappings[i];if(a.source===r.source)return{line:o.getArg(a,"generatedLine",null),column:o.getArg(a,"generatedColumn",null),lastColumn:o.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=i,s.prototype=Object.create(n.prototype),s.prototype.constructor=n,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),s.prototype.originalPositionFor=function(e){var t={generatedLine:o.getArg(e,"line"),generatedColumn:o.getArg(e,"column")},r=u.search(t,this._sections,function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r?r:e.generatedColumn-t.generatedOffset.generatedColumn}),n=this._sections[r];return n?n.consumer.originalPositionFor({line:t.generatedLine-(n.generatedOffset.generatedLine-1),column:t.generatedColumn-(n.generatedOffset.generatedLine===t.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},s.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r],i=n.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},s.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(r.consumer.sources.indexOf(o.getArg(e,"source"))!==-1){var n=r.consumer.generatedPositionFor(e);if(n){var i={line:n.line+(r.generatedOffset.generatedLine-1),column:n.column+(r.generatedOffset.generatedLine===n.line?r.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}},s.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var n=this._sections[r],i=n.consumer._generatedMappings,a=0;a<i.length;a++){var s=i[a],u=n.consumer._sources.at(s.source);null!==n.consumer.sourceRoot&&(u=o.join(n.consumer.sourceRoot,u)),this._sources.add(u),u=this._sources.indexOf(u);var l=n.consumer._names.at(s.name);this._names.add(l),l=this._names.indexOf(l);var c={source:u,generatedLine:s.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:l};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}f(this.__generatedMappings,o.compareByGeneratedPositionsDeflated),f(this.__originalMappings,o.compareByOriginalPositions)},t.IndexedSourceMapConsumer=s},function(e,t,r){function n(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[u]=!0,null!=n&&this.add(n)}var i=r(286).SourceMapGenerator,a=r(62),s=/(\r?\n)/,o=10,u="$$$isSourceNode$$$";n.fromStringWithSourceMap=function(e,t,r){function i(e,t){if(null===e||void 0===e.source)o.add(t);else{var i=r?a.join(r,e.source):e.source;o.add(new n(e.originalLine,e.originalColumn,i,t,e.name))}}var o=new n,u=e.split(s),l=function(){var e=u.shift(),t=u.shift()||"";return e+t},c=1,f=0,p=null;return t.eachMapping(function(e){if(null!==p){if(!(c<e.generatedLine)){var t=u[0],r=t.substr(0,e.generatedColumn-f);return u[0]=t.substr(e.generatedColumn-f),f=e.generatedColumn,i(p,r),void(p=e)}i(p,l()),c++,f=0}for(;c<e.generatedLine;)o.add(l()),c++;if(f<e.generatedColumn){var t=u[0];o.add(t.substr(0,e.generatedColumn)),u[0]=t.substr(e.generatedColumn),f=e.generatedColumn}p=e},this),u.length>0&&(p&&i(p,l()),o.add(u.join(""))),t.sources.forEach(function(e){var n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=a.join(r,e)),o.setSourceContent(e,n))}),o},n.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},n.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},n.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r<n;r++)t=this.children[r],t[u]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},n.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[u]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},n.prototype.setSourceContent=function(e,t){this.sourceContents[a.toSetString(e)]=t},n.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][u]&&this.children[t].walkSourceContents(e);for(var n=Object.keys(this.sourceContents),t=0,r=n.length;t<r;t++)e(a.fromSetString(n[t]),this.sourceContents[n[t]])},n.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},n.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new i(e),n=!1,a=null,s=null,u=null,l=null;return this.walk(function(e,i){t.code+=e,null!==i.source&&null!==i.line&&null!==i.column?(a===i.source&&s===i.line&&u===i.column&&l===i.name||r.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name}),a=i.source,s=i.line,u=i.column,l=i.name,n=!0):n&&(r.addMapping({generated:{line:t.line,column:t.column}}),a=null,n=!1);for(var c=0,f=e.length;c<f;c++)e.charCodeAt(c)===o?(t.line++,t.column=0,c+1===f?(a=null,n=!1):n&&r.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})):t.column++}),this.walkSourceContents(function(e,t){r.setSourceContent(e,t)}),{code:t.code,map:r}},t.SourceNode=n},function(e,t,r){"use strict";var n=r(177)();e.exports=function(e){return"string"==typeof e?e.replace(n,""):e}},function(e,t,r){(function(t){"use strict";var r=t.argv,n=r.indexOf("--"),i=function(e){e="--"+e;var t=r.indexOf(e);return t!==-1&&(n===-1||t<n)};e.exports=function(){return"FORCE_COLOR"in t.env||!(i("no-color")||i("no-colors")||i("color=false"))&&(!!(i("color")||i("colors")||i("color=true")||i("color=always"))||!(t.stdout&&!t.stdout.isTTY)&&("win32"===t.platform||("COLORTERM"in t.env||"dumb"!==t.env.TERM&&!!/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(t.env.TERM))))}()}).call(t,r(18))},function(e,t){"use strict";e.exports=function e(t){function r(){}r.prototype=t,new r}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}}]))});
test/containers/CounterPage.spec.js
tempestaddepvc/proyecto-electron
import { expect } from 'chai'; import React from 'react'; import { renderIntoDocument, scryRenderedDOMComponentsWithTag, findRenderedDOMComponentWithClass, Simulate } from 'react-addons-test-utils'; import { Provider } from 'react-redux'; import CounterPage from '../../app/containers/CounterPage'; import configureStore from '../../app/store/configureStore'; function setup(initialState) { const store = configureStore(initialState); const app = renderIntoDocument( <Provider store={store}> <CounterPage /> </Provider> ); return { app, buttons: scryRenderedDOMComponentsWithTag(app, 'button').map(button => button), p: findRenderedDOMComponentWithClass(app, 'counter') }; } describe('containers', () => { describe('App', () => { it('should display initial count', () => { const { p } = setup(); expect(p.textContent).to.match(/^0$/); }); it('should display updated count after increment button click', () => { const { buttons, p } = setup(); Simulate.click(buttons[0]); expect(p.textContent).to.match(/^1$/); }); it('should display updated count after descrement button click', () => { const { buttons, p } = setup(); Simulate.click(buttons[1]); expect(p.textContent).to.match(/^-1$/); }); it('shouldnt change if even and if odd button clicked', () => { const { buttons, p } = setup(); Simulate.click(buttons[2]); expect(p.textContent).to.match(/^0$/); }); it('should change if odd and if odd button clicked', () => { const { buttons, p } = setup({ counter: 1 }); Simulate.click(buttons[2]); expect(p.textContent).to.match(/^2$/); }); }); });
modules/IndexLink.js
CivBase/react-router
import React from 'react' import Link from './Link' const IndexLink = React.createClass({ render() { return <Link {...this.props} onlyActiveOnIndex={true} /> } }) export default IndexLink
app/components/Profile.js
vandosant/react-notetaker
import React from 'react'; import UserProfile from './GitHub/UserProfile'; import Repos from './GitHub/Repos'; import Notes from './Notes/Notes'; import Firebase from 'firebase'; import helpers from '../utils/helpers' import Rebase from 're-base'; var base = Rebase.createClass('https://react-notetaker12786.firebaseio.com'); class Profile extends React.Component { constructor(props) { super(props); this.state = { notes: [], bio: {}, repos: [] } } init() { this.ref = base.bindToState(this.context.router.getCurrentParams().username, { context: this, state: 'notes', asArray: true }); helpers.getUserData(this.context.router.getCurrentParams().username) .then((userData) => { this.setState({ bio: userData.bio, repos: userData.repos }) }); } componentDidMount() { this.init(); } componentWillUnmount() { base.removeBinding(this.ref); } componentWillReceiveProps() { base.removeBinding(this.ref); this.init(); } handleAddNote(newNote) { base.post(this.context.router.getCurrentParams().username, { data: this.state.notes.concat([newNote]) }) } render() { var username = this.context.router.getCurrentParams().username; return ( <div className="row"> <div className="col-md-4"> <UserProfile bio={this.state.bio}/> </div> <div className="col-md-4"> <Repos username={username} repos={this.state.repos}/> </div> <div className="col-md-4"> <Notes username={username} notes={this.state.notes} addNote={this.handleAddNote.bind(this)}/> </div> </div> ) } } Profile.contextTypes = { router: React.PropTypes.func.isRequired }; export default Profile;
ajax/libs/foundation/4.0.9/js/vendor/jquery.js
wackyapples/cdnjs
/*! * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-2-4 */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<9 // For `typeof node.method` instead of `node.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) document = window.document, location = window.location, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.9.1", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, // The number of elements contained in the matched element set size: function() { return this.length; }, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( list && ( !fired || stack ) ) { if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function() { var support, all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Support tests won't run in some limited or non-browser environments all = div.getElementsByTagName("*"); a = div.getElementsByTagName("a")[ 0 ]; if ( !all || !a || !all.length ) { return {}; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; support = { // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) getSetAttribute: div.className !== "t", // IE strips leading whitespace when .innerHTML is used leadingWhitespace: div.firstChild.nodeType === 3, // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText instead) style: /top/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: a.getAttribute("href") === "/a", // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 opacity: /^0.5/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) checkOn: !!input.value, // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) optSelected: opt.selected, // Tests for enctype support on a form (#6743) enctype: !!document.createElement("form").enctype, // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode boxModel: document.compatMode === "CSS1Compat", // Will be defined later deleteExpando: true, noCloneEvent: true, inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableMarginRight: true, boxSizingReliable: true, pixelPosition: false }; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; support.boxSizing = ( div.offsetWidth === 4 ); support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })(); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { cache[ id ] = {}; // Avoids exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify if ( !isNode ) { cache[ id ].toJSON = jQuery.noop; } } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( getByName ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var i, l, thisCache, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } for ( i = 0, l = name.length; i < l; i++ ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) } else if ( jQuery.support.deleteExpando || cache != cache.window ) { delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "applet": true }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, elem = this[0], i = 0, data = null; // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( !name.indexOf( "data-" ) ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return jQuery.access( this, function( value ) { if ( value === undefined ) { // Try to fetch any internally stored data first return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; } this.each(function() { jQuery.data( this, key, value ); }); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } hooks.cur = fn; if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val, self = jQuery(this); if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, self.val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // attributes.value is undefined in Blackberry 4.7 but // uses .value. See #6932 var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var values = jQuery.makeArray( value ); jQuery(elem).find("option").each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, notxml, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); // All attributes are lowercase // Grab necessary hook if one is defined if ( notxml ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { // In IE9+, Flash objects don't have .getAttribute (#12945) // Support: IE9+ if ( typeof elem.getAttribute !== core_strundefined ) { ret = elem.getAttribute( name ); } // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( rboolean.test( name ) ) { // Set corresponding property to false for boolean attributes // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 if ( !getSetAttribute && ruseDefault.test( name ) ) { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } else { elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { return ( elem[ name ] = value ); } } else { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { return elem[ name ]; } } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ var attributeNode = elem.getAttributeNode("tabindex"); return attributeNode && attributeNode.specified ? parseInt( attributeNode.value, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } } } }); // Hook for boolean attributes boolHook = { get: function( elem, name ) { var // Use .prop to determine if this attribute is understood as boolean prop = jQuery.prop( elem, name ), // Fetch it accordingly attr = typeof prop === "boolean" && elem.getAttribute( name ), detail = typeof prop === "boolean" ? getSetInput && getSetAttribute ? attr != null : // oldIE fabricates an empty string for missing boolean attributes // and conflates checked/selected into attroperties ruseDefault.test( name ) ? elem[ jQuery.camelCase( "default-" + name ) ] : !!attr : // fetch an attribute node for properties not recognized as boolean elem.getAttributeNode( name ); return detail && detail.value !== false ? name.toLowerCase() : undefined; }, set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; // fix oldIE value attroperty if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return jQuery.nodeName( elem, "input" ) ? // Ignore the value *property* by using defaultValue elem.defaultValue : ret && ret.specified ? ret.value : undefined; }, set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? ret.value : undefined; }, set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { get: nodeHook.get, set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }); }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { get: function( elem ) { var ret = elem.getAttribute( name, 2 ); return ret == null ? undefined : ret; } }); }); // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }); } // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter if ( !jQuery.support.checkOn ) { jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { get: function( elem ) { // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; } }; }); } jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }); }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); event.isTrigger = true; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { for ( ; cur != this; cur = cur.parentNode || this ) { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } } }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== document.activeElement && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === document.activeElement && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); /*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ (function( window, undefined ) { var i, cachedruns, Expr, getText, isXML, compile, hasDuplicate, outermostContext, // Local document vars setDocument, document, docElem, documentIsXML, rbuggyQSA, rbuggyMatches, matches, contains, sortOrder, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, support = {}, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Array methods arr = [], pop = arr.pop, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors operators = "([*^$|!~]?=)", attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rsibling = /[\x20\t\r\n\f]*[+~]/, rnative = /^[^{]+\{\s*\[native code/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, funescape = function( _, escaped ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint return high !== high ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Use a stripped-down slice if we can't use a native one try { slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType; } catch ( e ) { slice = function( i ) { var elem, results = []; while ( (elem = this[i++]) ) { results.push( elem ); } return results; }; } /** * For feature detection * @param {Function} fn The function to test for native support */ function isNative( fn ) { return rnative.test( fn + "" ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var cache, keys = []; return (cache = function( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); }); } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return fn( div ); } catch (e) { return false; } finally { // release memory in IE div = null; } } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( !documentIsXML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); return results; } } // QSA path if ( support.qsa && !rbuggyQSA.test(selector) ) { old = true; nid = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, slice.call( newContext.querySelectorAll( newSelector ), 0 ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsXML = isXML( doc ); // Check if getElementsByTagName("*") returns only elements support.tagNameNoComments = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if attributes should be retrieved by attribute nodes support.attributes = assert(function( div ) { div.innerHTML = "<select></select>"; var type = typeof div.lastChild.getAttribute("multiple"); // IE8 returns a string for some attributes even when not present return type !== "boolean" && type !== "string"; }); // Check if getElementsByClassName can be trusted support.getByClassName = assert(function( div ) { // Opera can't find a second classname (in 9.6) div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { return false; } // Safari 3.2 caches class attributes and doesn't catch changes div.lastChild.className = "e"; return div.getElementsByClassName("e").length === 2; }); // Check if getElementById returns elements by name // Check if getElementsByName privileges form controls or returns elements by ID support.getByName = assert(function( div ) { // Inject content div.id = expando + 0; div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; docElem.insertBefore( div, docElem.firstChild ); // Test var pass = doc.getElementsByName && // buggy browsers will return fewer than the correct 2 doc.getElementsByName( expando ).length === 2 + // buggy browsers will return more than the correct 0 doc.getElementsByName( expando + 0 ).length; support.getIdNotName = !doc.getElementById( expando ); // Cleanup docElem.removeChild( div ); return pass; }); // IE6/7 return modified attributes Expr.attrHandle = assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && div.firstChild.getAttribute("href") === "#"; }) ? {} : { "href": function( elem ) { return elem.getAttribute( "href", 2 ); }, "type": function( elem ) { return elem.getAttribute("type"); } }; // ID find and filter if ( support.getIdNotName ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); return m ? m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? [m] : undefined : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.tagNameNoComments ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Name Expr.find["NAME"] = support.getByName && function( tag, context ) { if ( typeof context.getElementsByName !== strundefined ) { return context.getElementsByName( name ); } }; // Class Expr.find["CLASS"] = support.getByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { return context.getElementsByClassName( className ); } }; // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21), // no need to also add to buggyMatches since matches checks buggyQSA // A support test would require too much code (would include document ready) rbuggyQSA = [ ":focus" ]; if ( (support.qsa = isNative(doc.querySelectorAll)) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explictly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // IE8 - Some boolean attributes are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Opera 10-12/IE8 - ^= $= *= and empty values // Should not select anything div.innerHTML = "<input type='hidden' i=''/>"; if ( div.querySelectorAll("[i^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || docElem.mozMatchesSelector || docElem.webkitMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { var compare; if ( a === b ) { hasDuplicate = true; return 0; } if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { if ( a === doc || contains( preferredDoc, a ) ) { return -1; } if ( b === doc || contains( preferredDoc, b ) ) { return 1; } return 0; } return compare & 4 ? -1 : 1; } return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; // Always assume the presence of duplicates if sort doesn't // pass them to our comparison function (as in Google Chrome). hasDuplicate = false; [0, 0].sort( sortOrder ); support.detectDuplicates = hasDuplicate; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); // rbuggyQSA always contains :focus, so no need for an existence check if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { var val; // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } if ( !documentIsXML ) { name = name.toLowerCase(); } if ( (val = Expr.attrHandle[ name ]) ) { return val( elem ); } if ( documentIsXML || support.attributes ) { return elem.getAttribute( name ); } return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? name : val && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; // Document sorting and removing duplicates Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], i = 1, j = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; results.sort( sortOrder ); if ( hasDuplicate ) { for ( ; (elem = results[i]); i++ ) { if ( elem === results[ i - 1 ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; function siblingCheck( a, b ) { var cur = b && a, diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } // Returns a function to use in pseudos for input types function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } // Returns a function to use in pseudos for buttons function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } // Returns a function to use in pseudos for positionals function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[4] ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeName ) { if ( nodeName === "*" ) { return function() { return true; }; } nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); return function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifider if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsXML ? elem.getAttribute("xml:lang") || elem.getAttribute("lang") : elem.lang) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push( { value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) } ); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push( { value: matched, type: type, matches: match } ); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && !documentIsXML && Expr.relative[ tokens[1].type ] ) { context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, slice.call( seed, 0 ) ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, documentIsXML, results, rsibling.test( selector ) ); return results; } // Deprecated Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Easy API for creating new setFilters function setFilters() {} Expr.filters = setFilters.prototype = Expr.pseudos; Expr.setFilters = new setFilters(); // Initialize with the default document setDocument(); // Override sizzle attribute retrieval Sizzle.attr = jQuery.attr; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); var runtil = /Until$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, isSimple = /^.[^:#\[\.,]*$/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret, self, len = this.length; if ( typeof selector !== "string" ) { self = this; return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } ret = []; for ( i = 0; i < len; i++ ) { jQuery.find( selector, this[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true) ); }, is: function( selector ) { return !!selector && ( typeof selector === "string" ? // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". rneedsContext.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { cur = this[i]; while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; } cur = cur.parentNode; } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); jQuery.fn.andSelf = jQuery.fn.addBack; function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( !runtil.test( name ) ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; if ( this.length > 1 && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : jQuery.find.matches(expr, elems); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, keep ) { // Can't pass null or undefined to indexOf in Firefox 4 // Set to 0 to skip string check qualifier = qualifier || 0; if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem ) { return ( elem === qualifier ) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); }, append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { return this.domManip( arguments, false, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, false, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function( value ) { var isFunc = jQuery.isFunction( value ); // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( !isFunc && typeof value !== "string" ) { value = jQuery( value ).not( this ).detach(); } return this.domManip( [ value ], true, function( elem ) { var next = this.nextSibling, parent = this.parentNode; if ( parent ) { jQuery( this ).remove(); parent.insertBefore( elem, next ); } }); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, table ? self.html() : undefined ); } self.domManip( args, table, callback ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( table && jQuery.nodeName( this[i], "table" ) ? findOrAppend( this[i], "tbody" ) : this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery.ajax({ url: node.src, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); function findOrAppend( elem, tag ) { return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { var attr = elem.getAttributeNode("type"); elem.type = ( attr && attr.specified ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { var bool = typeof state === "boolean"; return this.each(function() { if ( bool ? state : isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Exclude the following css properties to add px cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.hover = function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }; var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": window.String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 ) { isSuccess = true; statusText = "nocontent"; // if not modified } else if ( status === 304 ) { isSuccess = true; statusText = "notmodified"; // If we have data, let's convert it } else { isSuccess = ajaxConvert( s, response ); statusText = isSuccess.state; success = isSuccess.data; error = isSuccess.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); } }); /* Handles responses to an ajax request: * - sets all responseXXX fields accordingly * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields; // Fill responseXXX fields for ( type in responseFields ) { if ( type in responses ) { jqXHR[ responseFields[type] ] = responses[ type ]; } } // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } // Chain conversions given the request and the original response function ajaxConvert( s, response ) { var conv2, current, conv, tmp, converters = {}, i = 0, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(), prev = dataTypes[ 0 ]; // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } // Convert to each sequential dataType, tolerating list modification for ( ; (current = dataTypes[++i]); ) { // There's only work to do if current dataType is non-auto if ( current !== "*" ) { // Convert response if prev dataType is non-auto and differs from current if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split(" "); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.splice( i--, 0, current ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s["throws"] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } // Update prev for next iteration prev = current; } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var end, unit, tween = this.createTween( prop, value ), parts = rfxnum.exec( value ), target = tween.cur(), start = +target || 0, scale = 1, maxIterations = 20; if ( parts ) { end = +parts[2]; unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); // We need to compute starting value if ( unit !== "px" && start ) { // Iteratively approximate from a nonzero starting point // Prefer the current property, because this process will be trivial if it uses the same units // Fallback to end or a simple constant start = jQuery.css( tween.elem, prop, true ) || end || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } tween.unit = unit; tween.start = start; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTweens( animation, props ) { jQuery.each( props, function( prop, value ) { var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( collection[ index ].call( animation, prop, value ) ) { // we're done with this property return; } } }); } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } createTweens( animation, props ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var value, name, index, easing, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /*jshint validthis:true */ var prop, index, length, value, dataShow, toggle, tween, hooks, oldfire, anim = this, style = elem.style, orig = {}, handled = [], hidden = elem.nodeType && isHidden( elem ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( index in props ) { value = props[ index ]; if ( rfxtypes.exec( value ) ) { delete props[ index ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } handled.push( index ); } } length = handled.length; if ( length ) { dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( index = 0 ; index < length ; index++ ) { prop = handled[ index ]; tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Remove in 2.0 - this supports IE8's panic based approach // to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); doAnimation.finish = function() { anim.stop( true ); }; // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.cur && hooks.cur.finish ) { hooks.cur.finish.call( this ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.documentElement; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || document.documentElement; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // })(); // Expose jQuery to the global object window.jQuery = window.$ = jQuery; // Expose jQuery as an AMD module, but only for AMD loaders that // understand the issues with loading multiple versions of jQuery // in a page that all might call define(). The loader will indicate // they have special allowances for multiple jQuery versions by // specifying define.amd.jQuery = true. Register as a named module, // since jQuery can be concatenated with other files that may use define, // but not use a proper concatenation script that understands anonymous // AMD modules. A named AMD is safest and most robust way to register. // Lowercase jquery is used because AMD module names are derived from // file names, and jQuery is normally delivered in a lowercase file name. // Do this after creating the global so that if an AMD module wants to call // noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } })( window );
src/dropdown.js
backstage-ui/backstage-dropdown
/* * Copyright (c) 2016, Globo.com (https://github.com/globocom) * * License: MIT */ import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import Option from './option'; export default class Dropdown extends Component { constructor(props) { super(props); this.state = { dropdown: false, }; this.onClick = ::this.onClick; this.onSelectItem = ::this.onSelectItem; this.handleDocumentClick = ::this.handleDocumentClick; } componentWillUpdate(nextProps, nextState) { if (this.state.dropdown !== nextState.dropdown) { if (nextState.dropdown) { this.handleOpenDropdown(); } else { this.handleCloseDropdown(); } } } componentWillUnmount() { this.unbindDocumentClick(); } onClick() { const dropdown = this.state.dropdown; this.setState({ dropdown: !dropdown }); } onSelectItem(selectedItem) { this.setState({ ...this.state, dropdown: false, }); this.props.onSelectOption(selectedItem); } handleOpenDropdown() { this.props.onOpen(); this.bindDocumentClick(); } handleCloseDropdown() { this.props.onClose(); this.unbindDocumentClick(); } bindDocumentClick() { document.addEventListener('click', this.handleDocumentClick, false); document.addEventListener('touchend', this.handleDocumentClick, false); } unbindDocumentClick() { document.removeEventListener('click', this.handleDocumentClick, false); document.removeEventListener('touchend', this.handleDocumentClick, false); } handleDocumentClick(event) { if (!ReactDOM.findDOMNode(this).contains(event.target)) { this.props.onClose(); this.setState({ ...this.state, dropdown: false, }); } } renderOptions() { const options = this.props.options.map(option => ( <Option key={option.value} label={option.label} onSelect={() => this.onSelectItem(option)} selected={this.props.selectedOption === option.value} /> )); return options; } render() { const dropdownClassNames = classNames({ 'bs-ui-dropdown': true, 'bs-ui-dropdown--small': this.props.small, 'bs-ui-dropdown--disabled': this.props.disabled, }, this.props.className); const optionsOpen = this.props.openUp ? 'bs-ui-dropdown__options--open-up' : 'bs-ui-dropdown__options--open'; const optionsClassNames = classNames({ 'bs-ui-options': true, 'bs-ui-dropdown__options': true, 'bs-ui-dropdown__options--small': this.props.small, [optionsOpen]: this.state.dropdown, }); const selectedItem = this.props.options.find( option => option.value === this.props.selectedOption, ); return ( <div className={dropdownClassNames} onClick={() => this.props.disabled || this.state.dropdown || this.onClick()} > <div className="bs-ui-dropdown__item"> { selectedItem.label } </div> <div className={optionsClassNames}> <div className="bs-ui-options__list"> { this.renderOptions() } </div> </div> </div> ); } } Dropdown.propTypes = { options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string, value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), })).isRequired, selectedOption: PropTypes.string.isRequired, className: PropTypes.string, disabled: PropTypes.bool, small: PropTypes.bool, openUp: PropTypes.bool, onOpen: PropTypes.func, onClose: PropTypes.func, onSelectOption: PropTypes.func, }; Dropdown.defaultProps = { className: '', disabled: false, small: false, openUp: false, onOpen: () => {}, onClose: () => {}, onSelectOption: () => {}, };
src/templates/blog-post.js
innocentiv/vinnocenti
import React from 'react'; import Helmet from 'react-helmet'; import Link from '../components/Link'; import Tags from '../components/Tags'; import '../css/blog-post.css'; export default function Template({ data, pathContext }) { const { markdownRemark: post } = data; const { next, prev } = pathContext; return ( <div className="blog-post-container"> <Helmet title={`Gatsby Blog - ${post.frontmatter.title}`} /> <div className="blog-post"> <h1 className="title">{post.frontmatter.title}</h1> <h2 className="date">{post.frontmatter.date}</h2> <div className="blog-post-content" dangerouslySetInnerHTML={{ __html: post.html }} /> <Tags list={post.frontmatter.tags || []} /> <div className="navigation"> {prev && ( <Link className="link prev" to={prev.frontmatter.path}> {prev.frontmatter.title} </Link> )} {next && ( <Link className="link next" to={next.frontmatter.path}> {next.frontmatter.title} </Link> )} </div> </div> </div> ); } export const pageQuery = graphql` query BlogPostByPath($path: String!) { markdownRemark(frontmatter: { path: { eq: $path } }) { html frontmatter { date(formatString: "MMMM DD, YYYY") path tags title } } } `;
packages/material-ui-icons/src/AdbOutlined.js
kybarg/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M5 16c0 3.87 3.13 7 7 7s7-3.13 7-7v-4H5v4zM16.12 4.37l2.1-2.1-.82-.83-2.3 2.31C14.16 3.28 13.12 3 12 3s-2.16.28-3.09.75L6.6 1.44l-.82.83 2.1 2.1C6.14 5.64 5 7.68 5 10v1h14v-1c0-2.32-1.14-4.36-2.88-5.63zM9 9c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm6 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z" /> , 'AdbOutlined');
src/components/tag/raw/name.js
Lokiedu/libertysoil-site
/* This file is a part of libertysoil.org website Copyright (C) 2016 Loki Education (Social Enterprise) This program 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, either version 3 of the License, or (at your option) any later version. This program 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 PropTypes from 'prop-types'; import React from 'react'; import { truncate } from 'grapheme-utils'; import omit from 'lodash/omit'; const RawTagName = ({ collapsed, truncated, name, ...props }) => { if (!name || collapsed) { return false; } let n = name; if (truncated) { n = truncate(n, { length: 16 }); } if (n) { return ( <div {...omit(props, ['children'])}> {n} </div> ); } return false; }; RawTagName.propTypes = { collapsed: PropTypes.bool, name: PropTypes.string, truncated: PropTypes.bool }; PropTypes.defaultProps = { collapsed: false, name: '', truncated: false }; export default RawTagName;
src/components/memberCard/index.js
marg51/uto
import React from 'react' import {connect} from 'react-redux' import { Link } from 'react-router' import Label from '../label' import If from '../../utils/if' import Icon from '../../utils/icon' function MemberCard({member, dispatch}) { return ( <span> <If test={member.avatarHash}> <img className="member-avatar" height="30" width="30" src={`https://trello-avatars.s3.amazonaws.com/${member.avatarHash}/30.png`} srcSet={`https://trello-avatars.s3.amazonaws.com/${member.avatarHash}/30.png 1x, https://trello-avatars.s3.amazonaws.com/${member.avatarHash}/50.png 2x`} alt={`${member.fullName} (${member.username})`} title={`${member.fullName} (${member.username})`} style={{borderRadius: "5px"}}/> </If> <If test={!member.avatarHash}> <span title={`${member.fullName} (${member.username})`} style={{display: "inline-block", height: "30px", width: "30px", background: "#DDD", borderRadius: "3px", textAlign: "center", lineHeight: "30px"}}> {member.initials} </span> </If> </span> ) } export default connect( (state, props) => ({member: state.entities.member.items[props.memberId]}))(MemberCard)
components/InventoryItem/InventoryItem.js
southern-ground/stack-shellybrown.com
/** * Created by fst on 8/16/16. */ import React from 'react'; import styles from './styles.css'; import store from '../../core/store'; import {TOGGLE_ITEM} from '../../core/action-types'; class InventoryItem extends React.Component { constructor(props) { super(props); this.toggleSelected = this.toggleSelected.bind(this); this.tileClicked = this.tileClicked.bind(this); } tileClicked(e){ e.stopPropagation(); store.dispatch({type: TOGGLE_ITEM, sku: this.props.sku}); } toggleSelected(e) { store.dispatch({type: TOGGLE_ITEM, sku: e.target.value}); } render() { return ( <div className={styles.inventoryItem} onClick={this.tileClicked}> <div className={styles.inventoryItemDetails}> <img className={styles.inventoryImage} src={"/img/product/" + this.props.image} /> <div className={styles.details}> <input type="checkBox" id={this.props.sku} onChange={this.toggleSelected} value={this.props.sku} checked={this.props.selected} ref="checkBox" /> <label htmlFor={this.props.sku}></label> <p className={this.props.selected ? "" : styles.deselected}> {this.props.name} </p> </div> <hr className={styles.separator} /> </div> </div> ); } } export default InventoryItem;
screens/initialScreen.js
yeso126/Mapapp
import React, { Component } from 'react'; import { StyleSheet, View, Button, } from 'react-native'; import Logo from '../components/logo'; import { NavigationActions } from 'react-navigation'; const goToHighScores = new NavigationActions.navigate({ routeName: 'HighScores', params: {}, action: NavigationActions.navigate({ routeName: 'HighScores'}), }); const goToHard = new NavigationActions.navigate({ routeName: 'Hard', params: {}, action: NavigationActions.navigate({ routeName: 'Hard'}), }); export default class InitialScreen extends Component { static navigationOptions = { title: 'Tap Circles Saga', headerTintColor: '#e78e18', }; goToHard = () =>{ this.props.navigation.dispatch(goToHard); } goToHighScores = () =>{ this.props.navigation.dispatch(goToHighScores); } render() { return ( <View style={styles.container}> <Logo style={styles.logo}/> <View style={styles.buttonContainer}> <Button title="Start Game" onPress={this.goToHard} /> <Button title="HighScores" onPress={this.goToHighScores} /> </View> </View> ); } } const styles = StyleSheet.create({ container: { flex:1, justifyContent: 'space-around', alignItems: 'center', backgroundColor: '#002637', }, buttonContainer: { alignSelf: 'stretch', flexDirection: 'row', justifyContent: 'space-around', }, logo:{ alignSelf: 'center', }, }); InitialScreen.propTypes = { navigation: React.PropTypes.object, };
examples/huge-apps/routes/Course/components/Course.js
iest/react-router
import React from 'react'; import Dashboard from './Dashboard'; import Nav from './Nav'; var styles = {}; styles.sidebar = { float: 'left', width: 200, padding: 20, borderRight: '1px solid #aaa', marginRight: 20 }; class Course extends React.Component { render () { let { children, params } = this.props; let course = COURSES[params.courseId]; return ( <div> <h2>{course.name}</h2> <Nav course={course} /> {children && children.sidebar && children.main ? ( <div> <div className="Sidebar" style={styles.sidebar}> {children.sidebar} </div> <div className="Main" style={{padding: 20}}> {children.main} </div> </div> ) : ( <Dashboard /> )} </div> ); } } export default Course;
src/__tests__/Navbar.js
YutHelloWorld/vortex-react
import React from 'react'; import ReactDOM from 'react-dom'; import renderer from 'react-test-renderer'; import { HashRouter } from 'react-router-dom'; import Navbar from '../components/Navbar'; it('(Layout) Navbar', () => { const component = renderer.create( <HashRouter> <Navbar signOut={() => {}} /> </HashRouter> ); let tree = component.toJSON(); expect(tree).toMatchSnapshot(); // manually trigger the callback tree.children[2].children[0].children[0].props.onMouseOver(); // re-rendering tree = component.toJSON(); expect(tree).toMatchSnapshot(); // manually trigger the callback tree.children[1].props.onClick(); // re-rendering tree = component.toJSON(); expect(tree).toMatchSnapshot(); });
src/routes.js
riccardone/MySelfLog.Ui
import React from 'react'; import { Route, Router } from 'react-router-dom'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import Home from './Home/Home'; import Diary from './Diary/Diary'; import MyDiary from './Diary/MyDiary'; import Repository from './Diary/Repository'; import History from './History/History'; import Callback from './Callback/Callback'; import Auth from './Auth/Auth'; import history from './history'; const auth = new Auth(); const handleAuthentication = (nextState, replace) => { if (/access_token|id_token|error/.test(nextState.location.hash)) { auth.handleAuthentication(); } }; let store = createStore(function (event) { console.log("ciao"); }); export const makeMainRoutes = () => { return ( <Provider store={store}> <Router history={history} component={Home}> <div> <Route exact path="/" render={(props) => <Home auth={auth} {...props} />} /> <Route exact path="/home" render={(props) => <Home auth={auth} {...props} />} /> <Route exact path="/diary/:diaryname" render={(props) => <MyDiary {...props} />} /> <Route exact path="/diary" render={(props) => <Diary auth={auth} {...props} />} /> <Route path="/callback" render={(props) => { handleAuthentication(props); return <Callback {...props} />; }} /> <Route path="/history" render={(props) => <History auth={auth} {...props} />} /> </div> </Router> </Provider> ); };
src/DropdownMenu.js
JimiHFord/react-bootstrap
import React from 'react'; import keycode from 'keycode'; import classNames from 'classnames'; import RootCloseWrapper from 'react-overlays/lib/RootCloseWrapper'; import ValidComponentChildren from './utils/ValidComponentChildren'; import createChainedFunction from './utils/createChainedFunction'; class DropdownMenu extends React.Component { constructor(props) { super(props); this.focusNext = this.focusNext.bind(this); this.focusPrevious = this.focusPrevious.bind(this); this.getFocusableMenuItems = this.getFocusableMenuItems.bind(this); this.getItemsAndActiveIndex = this.getItemsAndActiveIndex.bind(this); this.handleKeyDown = this.handleKeyDown.bind(this); } handleKeyDown(event) { switch (event.keyCode) { case keycode.codes.down: this.focusNext(); event.preventDefault(); break; case keycode.codes.up: this.focusPrevious(); event.preventDefault(); break; case keycode.codes.esc: case keycode.codes.tab: this.props.onClose(event); break; default: } } focusNext() { let { items, activeItemIndex } = this.getItemsAndActiveIndex(); if (items.length === 0) { return; } if (activeItemIndex === items.length - 1) { items[0].focus(); return; } items[activeItemIndex + 1].focus(); } focusPrevious() { let { items, activeItemIndex } = this.getItemsAndActiveIndex(); if (activeItemIndex === 0) { items[items.length - 1].focus(); return; } items[activeItemIndex - 1].focus(); } getItemsAndActiveIndex() { let items = this.getFocusableMenuItems(); let activeElement = document.activeElement; let activeItemIndex = items.indexOf(activeElement); return {items, activeItemIndex}; } getFocusableMenuItems() { let menuNode = React.findDOMNode(this); if (menuNode === undefined) { return []; } return [].slice.call(menuNode.querySelectorAll('[tabIndex="-1"]'), 0); } render() { const items = ValidComponentChildren.map(this.props.children, child => { let { children, onKeyDown, onSelect } = child.props || {}; return React.cloneElement(child, { onKeyDown: createChainedFunction(onKeyDown, this.handleKeyDown), onSelect: createChainedFunction(onSelect, this.props.onSelect) }, children); }); const classes = { 'dropdown-menu': true, 'dropdown-menu-right': this.props.pullRight }; let list = ( <ul className={classNames(this.props.className, classes)} role="menu" aria-labelledby={this.props.labelledBy} > {items} </ul> ); if (this.props.open) { list = ( <RootCloseWrapper noWrap onRootClose={this.props.onClose}> {list} </RootCloseWrapper> ); } return list; } } DropdownMenu.defaultProps = { bsRole: 'menu', pullRight: false }; DropdownMenu.propTypes = { open: React.PropTypes.bool, pullRight: React.PropTypes.bool, onClose: React.PropTypes.func, labelledBy: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.number ]), onSelect: React.PropTypes.func }; export default DropdownMenu;
src/svg-icons/image/camera-roll.js
skarnecki/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageCameraRoll = (props) => ( <SvgIcon {...props}> <path d="M14 5c0-1.1-.9-2-2-2h-1V2c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v1H4c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2h8V5h-8zm-2 13h-2v-2h2v2zm0-9h-2V7h2v2zm4 9h-2v-2h2v2zm0-9h-2V7h2v2zm4 9h-2v-2h2v2zm0-9h-2V7h2v2z"/> </SvgIcon> ); ImageCameraRoll = pure(ImageCameraRoll); ImageCameraRoll.displayName = 'ImageCameraRoll'; export default ImageCameraRoll;
src/components/Types/Boolean.js
jcgertig/react-struct-editor
import React from 'react' import BasicType from './BasicType' import { isBoolean, isUndefined } from 'lodash' class BooleanType extends BasicType { constructor() { super() this.type = 'Boolean' this.updateValue = () => { this.props.onChange(!this.state.value) } } render() { return ( <div style={{ marginTop: '25px' }}> <label style={{ marginBottom: 10 }} className={this.props.displayProps.labelClass}> {this.props.struct.label} </label> <input type="checkbox" onChange={this.updateValue} className={this.props.displayProps.inputClass} style={{ width: '100%', boxSizing: 'border-box' }} checked={isUndefined(this.state.value) ? false : this.state.value} /> </div> ) } } BooleanType.checkStruct = function (value) { return isBoolean(value) } export default BooleanType
ajax/libs/bla/1.7.0/bla.js
iwdmb/cdnjs
/** * @module vow * @author Filatov Dmitry <dfilatov@yandex-team.ru> * @version 0.4.9 * @license * Dual licensed under the MIT and GPL licenses: * * http://www.opensource.org/licenses/mit-license.php * * http://www.gnu.org/licenses/gpl.html */ (function(global) { var undef, nextTick = (function() { var fns = [], enqueueFn = function(fn) { return fns.push(fn) === 1; }, callFns = function() { var fnsToCall = fns, i = 0, len = fns.length; fns = []; while(i < len) { fnsToCall[i++](); } }; if(typeof setImmediate === 'function') { // ie10, nodejs >= 0.10 return function(fn) { enqueueFn(fn) && setImmediate(callFns); }; } if(typeof process === 'object' && process.nextTick) { // nodejs < 0.10 return function(fn) { enqueueFn(fn) && process.nextTick(callFns); }; } if(global.postMessage) { // modern browsers var isPostMessageAsync = true; if(global.attachEvent) { var checkAsync = function() { isPostMessageAsync = false; }; global.attachEvent('onmessage', checkAsync); global.postMessage('__checkAsync', '*'); global.detachEvent('onmessage', checkAsync); } if(isPostMessageAsync) { var msg = '__promise' + +new Date, onMessage = function(e) { if(e.data === msg) { e.stopPropagation && e.stopPropagation(); callFns(); } }; global.addEventListener? global.addEventListener('message', onMessage, true) : global.attachEvent('onmessage', onMessage); return function(fn) { enqueueFn(fn) && global.postMessage(msg, '*'); }; } } var doc = global.document; if('onreadystatechange' in doc.createElement('script')) { // ie6-ie8 var createScript = function() { var script = doc.createElement('script'); script.onreadystatechange = function() { script.parentNode.removeChild(script); script = script.onreadystatechange = null; callFns(); }; (doc.documentElement || doc.body).appendChild(script); }; return function(fn) { enqueueFn(fn) && createScript(); }; } return function(fn) { // old browsers enqueueFn(fn) && setTimeout(callFns, 0); }; })(), throwException = function(e) { nextTick(function() { throw e; }); }, isFunction = function(obj) { return typeof obj === 'function'; }, isObject = function(obj) { return obj !== null && typeof obj === 'object'; }, toStr = Object.prototype.toString, isArray = Array.isArray || function(obj) { return toStr.call(obj) === '[object Array]'; }, getArrayKeys = function(arr) { var res = [], i = 0, len = arr.length; while(i < len) { res.push(i++); } return res; }, getObjectKeys = Object.keys || function(obj) { var res = []; for(var i in obj) { obj.hasOwnProperty(i) && res.push(i); } return res; }, defineCustomErrorType = function(name) { var res = function(message) { this.name = name; this.message = message; }; res.prototype = new Error(); return res; }, wrapOnFulfilled = function(onFulfilled, idx) { return function(val) { onFulfilled.call(this, val, idx); }; }; /** * @class Deferred * @exports vow:Deferred * @description * The `Deferred` class is used to encapsulate newly-created promise object along with functions that resolve, reject or notify it. */ /** * @constructor * @description * You can use `vow.defer()` instead of using this constructor. * * `new vow.Deferred()` gives the same result as `vow.defer()`. */ var Deferred = function() { this._promise = new Promise(); }; Deferred.prototype = /** @lends Deferred.prototype */{ /** * Returns corresponding promise. * * @returns {vow:Promise} */ promise : function() { return this._promise; }, /** * Resolves corresponding promise with given `value`. * * @param {*} value * * @example * ```js * var defer = vow.defer(), * promise = defer.promise(); * * promise.then(function(value) { * // value is "'success'" here * }); * * defer.resolve('success'); * ``` */ resolve : function(value) { this._promise.isResolved() || this._promise._resolve(value); }, /** * Rejects corresponding promise with given `reason`. * * @param {*} reason * * @example * ```js * var defer = vow.defer(), * promise = defer.promise(); * * promise.fail(function(reason) { * // reason is "'something is wrong'" here * }); * * defer.reject('something is wrong'); * ``` */ reject : function(reason) { if(this._promise.isResolved()) { return; } if(vow.isPromise(reason)) { reason = reason.then(function(val) { var defer = vow.defer(); defer.reject(val); return defer.promise(); }); this._promise._resolve(reason); } else { this._promise._reject(reason); } }, /** * Notifies corresponding promise with given `value`. * * @param {*} value * * @example * ```js * var defer = vow.defer(), * promise = defer.promise(); * * promise.progress(function(value) { * // value is "'20%'", "'40%'" here * }); * * defer.notify('20%'); * defer.notify('40%'); * ``` */ notify : function(value) { this._promise.isResolved() || this._promise._notify(value); } }; var PROMISE_STATUS = { PENDING : 0, RESOLVED : 1, FULFILLED : 2, REJECTED : 3 }; /** * @class Promise * @exports vow:Promise * @description * The `Promise` class is used when you want to give to the caller something to subscribe to, * but not the ability to resolve or reject the deferred. */ /** * @constructor * @param {Function} resolver See https://github.com/domenic/promises-unwrapping/blob/master/README.md#the-promise-constructor for details. * @description * You should use this constructor directly only if you are going to use `vow` as DOM Promises implementation. * In other case you should use `vow.defer()` and `defer.promise()` methods. * @example * ```js * function fetchJSON(url) { * return new vow.Promise(function(resolve, reject, notify) { * var xhr = new XMLHttpRequest(); * xhr.open('GET', url); * xhr.responseType = 'json'; * xhr.send(); * xhr.onload = function() { * if(xhr.response) { * resolve(xhr.response); * } * else { * reject(new TypeError()); * } * }; * }); * } * ``` */ var Promise = function(resolver) { this._value = undef; this._status = PROMISE_STATUS.PENDING; this._fulfilledCallbacks = []; this._rejectedCallbacks = []; this._progressCallbacks = []; if(resolver) { // NOTE: see https://github.com/domenic/promises-unwrapping/blob/master/README.md var _this = this, resolverFnLen = resolver.length; resolver( function(val) { _this.isResolved() || _this._resolve(val); }, resolverFnLen > 1? function(reason) { _this.isResolved() || _this._reject(reason); } : undef, resolverFnLen > 2? function(val) { _this.isResolved() || _this._notify(val); } : undef); } }; Promise.prototype = /** @lends Promise.prototype */ { /** * Returns value of fulfilled promise or reason in case of rejection. * * @returns {*} */ valueOf : function() { return this._value; }, /** * Returns `true` if promise is resolved. * * @returns {Boolean} */ isResolved : function() { return this._status !== PROMISE_STATUS.PENDING; }, /** * Returns `true` if promise is fulfilled. * * @returns {Boolean} */ isFulfilled : function() { return this._status === PROMISE_STATUS.FULFILLED; }, /** * Returns `true` if promise is rejected. * * @returns {Boolean} */ isRejected : function() { return this._status === PROMISE_STATUS.REJECTED; }, /** * Adds reactions to promise. * * @param {Function} [onFulfilled] Callback that will to be invoked with the value after promise has been fulfilled * @param {Function} [onRejected] Callback that will to be invoked with the reason after promise has been rejected * @param {Function} [onProgress] Callback that will to be invoked with the value after promise has been notified * @param {Object} [ctx] Context of callbacks execution * @returns {vow:Promise} A new promise, see https://github.com/promises-aplus/promises-spec for details */ then : function(onFulfilled, onRejected, onProgress, ctx) { var defer = new Deferred(); this._addCallbacks(defer, onFulfilled, onRejected, onProgress, ctx); return defer.promise(); }, /** * Adds rejection reaction only. It is shortcut for `promise.then(undefined, onRejected)`. * * @param {Function} onRejected Callback to be called with the value after promise has been rejected * @param {Object} [ctx] Context of callback execution * @returns {vow:Promise} */ 'catch' : function(onRejected, ctx) { return this.then(undef, onRejected, ctx); }, /** * Adds rejection reaction only. It is shortcut for `promise.then(null, onRejected)`. It's alias for `catch`. * * @param {Function} onRejected Callback to be called with the value after promise has been rejected * @param {Object} [ctx] Context of callback execution * @returns {vow:Promise} */ fail : function(onRejected, ctx) { return this.then(undef, onRejected, ctx); }, /** * Adds resolving reaction (to fulfillment and rejection both). * * @param {Function} onResolved Callback that to be called with the value after promise has been resolved * @param {Object} [ctx] Context of callback execution * @returns {vow:Promise} */ always : function(onResolved, ctx) { var _this = this, cb = function() { return onResolved.call(this, _this); }; return this.then(cb, cb, ctx); }, /** * Adds progress reaction. * * @param {Function} onProgress Callback to be called with the value when promise has been notified * @param {Object} [ctx] Context of callback execution * @returns {vow:Promise} */ progress : function(onProgress, ctx) { return this.then(undef, undef, onProgress, ctx); }, /** * Like `promise.then`, but "spreads" the array into a variadic value handler. * It is useful with `vow.all` and `vow.allResolved` methods. * * @param {Function} [onFulfilled] Callback that will to be invoked with the value after promise has been fulfilled * @param {Function} [onRejected] Callback that will to be invoked with the reason after promise has been rejected * @param {Object} [ctx] Context of callbacks execution * @returns {vow:Promise} * * @example * ```js * var defer1 = vow.defer(), * defer2 = vow.defer(); * * vow.all([defer1.promise(), defer2.promise()]).spread(function(arg1, arg2) { * // arg1 is "1", arg2 is "'two'" here * }); * * defer1.resolve(1); * defer2.resolve('two'); * ``` */ spread : function(onFulfilled, onRejected, ctx) { return this.then( function(val) { return onFulfilled.apply(this, val); }, onRejected, ctx); }, /** * Like `then`, but terminates a chain of promises. * If the promise has been rejected, throws it as an exception in a future turn of the event loop. * * @param {Function} [onFulfilled] Callback that will to be invoked with the value after promise has been fulfilled * @param {Function} [onRejected] Callback that will to be invoked with the reason after promise has been rejected * @param {Function} [onProgress] Callback that will to be invoked with the value after promise has been notified * @param {Object} [ctx] Context of callbacks execution * * @example * ```js * var defer = vow.defer(); * defer.reject(Error('Internal error')); * defer.promise().done(); // exception to be thrown * ``` */ done : function(onFulfilled, onRejected, onProgress, ctx) { this .then(onFulfilled, onRejected, onProgress, ctx) .fail(throwException); }, /** * Returns a new promise that will be fulfilled in `delay` milliseconds if the promise is fulfilled, * or immediately rejected if promise is rejected. * * @param {Number} delay * @returns {vow:Promise} */ delay : function(delay) { var timer, promise = this.then(function(val) { var defer = new Deferred(); timer = setTimeout( function() { defer.resolve(val); }, delay); return defer.promise(); }); promise.always(function() { clearTimeout(timer); }); return promise; }, /** * Returns a new promise that will be rejected in `timeout` milliseconds * if the promise is not resolved beforehand. * * @param {Number} timeout * @returns {vow:Promise} * * @example * ```js * var defer = vow.defer(), * promiseWithTimeout1 = defer.promise().timeout(50), * promiseWithTimeout2 = defer.promise().timeout(200); * * setTimeout( * function() { * defer.resolve('ok'); * }, * 100); * * promiseWithTimeout1.fail(function(reason) { * // promiseWithTimeout to be rejected in 50ms * }); * * promiseWithTimeout2.then(function(value) { * // promiseWithTimeout to be fulfilled with "'ok'" value * }); * ``` */ timeout : function(timeout) { var defer = new Deferred(), timer = setTimeout( function() { defer.reject(new vow.TimedOutError('timed out')); }, timeout); this.then( function(val) { defer.resolve(val); }, function(reason) { defer.reject(reason); }); defer.promise().always(function() { clearTimeout(timer); }); return defer.promise(); }, _vow : true, _resolve : function(val) { if(this._status > PROMISE_STATUS.RESOLVED) { return; } if(val === this) { this._reject(TypeError('Can\'t resolve promise with itself')); return; } this._status = PROMISE_STATUS.RESOLVED; if(val && !!val._vow) { // shortpath for vow.Promise val.isFulfilled()? this._fulfill(val.valueOf()) : val.isRejected()? this._reject(val.valueOf()) : val.then( this._fulfill, this._reject, this._notify, this); return; } if(isObject(val) || isFunction(val)) { var then; try { then = val.then; } catch(e) { this._reject(e); return; } if(isFunction(then)) { var _this = this, isResolved = false; try { then.call( val, function(val) { if(isResolved) { return; } isResolved = true; _this._resolve(val); }, function(err) { if(isResolved) { return; } isResolved = true; _this._reject(err); }, function(val) { _this._notify(val); }); } catch(e) { isResolved || this._reject(e); } return; } } this._fulfill(val); }, _fulfill : function(val) { if(this._status > PROMISE_STATUS.RESOLVED) { return; } this._status = PROMISE_STATUS.FULFILLED; this._value = val; this._callCallbacks(this._fulfilledCallbacks, val); this._fulfilledCallbacks = this._rejectedCallbacks = this._progressCallbacks = undef; }, _reject : function(reason) { if(this._status > PROMISE_STATUS.RESOLVED) { return; } this._status = PROMISE_STATUS.REJECTED; this._value = reason; this._callCallbacks(this._rejectedCallbacks, reason); this._fulfilledCallbacks = this._rejectedCallbacks = this._progressCallbacks = undef; }, _notify : function(val) { this._callCallbacks(this._progressCallbacks, val); }, _addCallbacks : function(defer, onFulfilled, onRejected, onProgress, ctx) { if(onRejected && !isFunction(onRejected)) { ctx = onRejected; onRejected = undef; } else if(onProgress && !isFunction(onProgress)) { ctx = onProgress; onProgress = undef; } var cb; if(!this.isRejected()) { cb = { defer : defer, fn : isFunction(onFulfilled)? onFulfilled : undef, ctx : ctx }; this.isFulfilled()? this._callCallbacks([cb], this._value) : this._fulfilledCallbacks.push(cb); } if(!this.isFulfilled()) { cb = { defer : defer, fn : onRejected, ctx : ctx }; this.isRejected()? this._callCallbacks([cb], this._value) : this._rejectedCallbacks.push(cb); } if(this._status <= PROMISE_STATUS.RESOLVED) { this._progressCallbacks.push({ defer : defer, fn : onProgress, ctx : ctx }); } }, _callCallbacks : function(callbacks, arg) { var len = callbacks.length; if(!len) { return; } var isResolved = this.isResolved(), isFulfilled = this.isFulfilled(); nextTick(function() { var i = 0, cb, defer, fn; while(i < len) { cb = callbacks[i++]; defer = cb.defer; fn = cb.fn; if(fn) { var ctx = cb.ctx, res; try { res = ctx? fn.call(ctx, arg) : fn(arg); } catch(e) { defer.reject(e); continue; } isResolved? defer.resolve(res) : defer.notify(res); } else { isResolved? isFulfilled? defer.resolve(arg) : defer.reject(arg) : defer.notify(arg); } } }); } }; /** @lends Promise */ var staticMethods = { /** * Coerces given `value` to a promise, or returns the `value` if it's already a promise. * * @param {*} value * @returns {vow:Promise} */ cast : function(value) { return vow.cast(value); }, /** * Returns a promise to be fulfilled only after all the items in `iterable` are fulfilled, * or to be rejected when any of the `iterable` is rejected. * * @param {Array|Object} iterable * @returns {vow:Promise} */ all : function(iterable) { return vow.all(iterable); }, /** * Returns a promise to be fulfilled only when any of the items in `iterable` are fulfilled, * or to be rejected when the first item is rejected. * * @param {Array} iterable * @returns {vow:Promise} */ race : function(iterable) { return vow.anyResolved(iterable); }, /** * Returns a promise that has already been resolved with the given `value`. * If `value` is a promise, returned promise will be adopted with the state of given promise. * * @param {*} value * @returns {vow:Promise} */ resolve : function(value) { return vow.resolve(value); }, /** * Returns a promise that has already been rejected with the given `reason`. * * @param {*} reason * @returns {vow:Promise} */ reject : function(reason) { return vow.reject(reason); } }; for(var prop in staticMethods) { staticMethods.hasOwnProperty(prop) && (Promise[prop] = staticMethods[prop]); } var vow = /** @exports vow */ { Deferred : Deferred, Promise : Promise, /** * Creates a new deferred. This method is a factory method for `vow:Deferred` class. * It's equivalent to `new vow.Deferred()`. * * @returns {vow:Deferred} */ defer : function() { return new Deferred(); }, /** * Static equivalent to `promise.then`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @param {Function} [onFulfilled] Callback that will to be invoked with the value after promise has been fulfilled * @param {Function} [onRejected] Callback that will to be invoked with the reason after promise has been rejected * @param {Function} [onProgress] Callback that will to be invoked with the value after promise has been notified * @param {Object} [ctx] Context of callbacks execution * @returns {vow:Promise} */ when : function(value, onFulfilled, onRejected, onProgress, ctx) { return vow.cast(value).then(onFulfilled, onRejected, onProgress, ctx); }, /** * Static equivalent to `promise.fail`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @param {Function} onRejected Callback that will to be invoked with the reason after promise has been rejected * @param {Object} [ctx] Context of callback execution * @returns {vow:Promise} */ fail : function(value, onRejected, ctx) { return vow.when(value, undef, onRejected, ctx); }, /** * Static equivalent to `promise.always`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @param {Function} onResolved Callback that will to be invoked with the reason after promise has been resolved * @param {Object} [ctx] Context of callback execution * @returns {vow:Promise} */ always : function(value, onResolved, ctx) { return vow.when(value).always(onResolved, ctx); }, /** * Static equivalent to `promise.progress`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @param {Function} onProgress Callback that will to be invoked with the reason after promise has been notified * @param {Object} [ctx] Context of callback execution * @returns {vow:Promise} */ progress : function(value, onProgress, ctx) { return vow.when(value).progress(onProgress, ctx); }, /** * Static equivalent to `promise.spread`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @param {Function} [onFulfilled] Callback that will to be invoked with the value after promise has been fulfilled * @param {Function} [onRejected] Callback that will to be invoked with the reason after promise has been rejected * @param {Object} [ctx] Context of callbacks execution * @returns {vow:Promise} */ spread : function(value, onFulfilled, onRejected, ctx) { return vow.when(value).spread(onFulfilled, onRejected, ctx); }, /** * Static equivalent to `promise.done`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @param {Function} [onFulfilled] Callback that will to be invoked with the value after promise has been fulfilled * @param {Function} [onRejected] Callback that will to be invoked with the reason after promise has been rejected * @param {Function} [onProgress] Callback that will to be invoked with the value after promise has been notified * @param {Object} [ctx] Context of callbacks execution */ done : function(value, onFulfilled, onRejected, onProgress, ctx) { vow.when(value).done(onFulfilled, onRejected, onProgress, ctx); }, /** * Checks whether the given `value` is a promise-like object * * @param {*} value * @returns {Boolean} * * @example * ```js * vow.isPromise('something'); // returns false * vow.isPromise(vow.defer().promise()); // returns true * vow.isPromise({ then : function() { }); // returns true * ``` */ isPromise : function(value) { return isObject(value) && isFunction(value.then); }, /** * Coerces given `value` to a promise, or returns the `value` if it's already a promise. * * @param {*} value * @returns {vow:Promise} */ cast : function(value) { return value && !!value._vow? value : vow.resolve(value); }, /** * Static equivalent to `promise.valueOf`. * If given `value` is not an instance of `vow.Promise`, then `value` is equivalent to fulfilled promise. * * @param {*} value * @returns {*} */ valueOf : function(value) { return value && isFunction(value.valueOf)? value.valueOf() : value; }, /** * Static equivalent to `promise.isFulfilled`. * If given `value` is not an instance of `vow.Promise`, then `value` is equivalent to fulfilled promise. * * @param {*} value * @returns {Boolean} */ isFulfilled : function(value) { return value && isFunction(value.isFulfilled)? value.isFulfilled() : true; }, /** * Static equivalent to `promise.isRejected`. * If given `value` is not an instance of `vow.Promise`, then `value` is equivalent to fulfilled promise. * * @param {*} value * @returns {Boolean} */ isRejected : function(value) { return value && isFunction(value.isRejected)? value.isRejected() : false; }, /** * Static equivalent to `promise.isResolved`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @returns {Boolean} */ isResolved : function(value) { return value && isFunction(value.isResolved)? value.isResolved() : true; }, /** * Returns a promise that has already been resolved with the given `value`. * If `value` is a promise, returned promise will be adopted with the state of given promise. * * @param {*} value * @returns {vow:Promise} */ resolve : function(value) { var res = vow.defer(); res.resolve(value); return res.promise(); }, /** * Returns a promise that has already been fulfilled with the given `value`. * If `value` is a promise, returned promise will be fulfilled with fulfill/rejection value of given promise. * * @param {*} value * @returns {vow:Promise} */ fulfill : function(value) { var defer = vow.defer(), promise = defer.promise(); defer.resolve(value); return promise.isFulfilled()? promise : promise.then(null, function(reason) { return reason; }); }, /** * Returns a promise that has already been rejected with the given `reason`. * If `reason` is a promise, returned promise will be rejected with fulfill/rejection value of given promise. * * @param {*} reason * @returns {vow:Promise} */ reject : function(reason) { var defer = vow.defer(); defer.reject(reason); return defer.promise(); }, /** * Invokes a given function `fn` with arguments `args` * * @param {Function} fn * @param {...*} [args] * @returns {vow:Promise} * * @example * ```js * var promise1 = vow.invoke(function(value) { * return value; * }, 'ok'), * promise2 = vow.invoke(function() { * throw Error(); * }); * * promise1.isFulfilled(); // true * promise1.valueOf(); // 'ok' * promise2.isRejected(); // true * promise2.valueOf(); // instance of Error * ``` */ invoke : function(fn, args) { var len = Math.max(arguments.length - 1, 0), callArgs; if(len) { // optimization for V8 callArgs = Array(len); var i = 0; while(i < len) { callArgs[i++] = arguments[i]; } } try { return vow.resolve(callArgs? fn.apply(global, callArgs) : fn.call(global)); } catch(e) { return vow.reject(e); } }, /** * Returns a promise to be fulfilled only after all the items in `iterable` are fulfilled, * or to be rejected when any of the `iterable` is rejected. * * @param {Array|Object} iterable * @returns {vow:Promise} * * @example * with array: * ```js * var defer1 = vow.defer(), * defer2 = vow.defer(); * * vow.all([defer1.promise(), defer2.promise(), 3]) * .then(function(value) { * // value is "[1, 2, 3]" here * }); * * defer1.resolve(1); * defer2.resolve(2); * ``` * * @example * with object: * ```js * var defer1 = vow.defer(), * defer2 = vow.defer(); * * vow.all({ p1 : defer1.promise(), p2 : defer2.promise(), p3 : 3 }) * .then(function(value) { * // value is "{ p1 : 1, p2 : 2, p3 : 3 }" here * }); * * defer1.resolve(1); * defer2.resolve(2); * ``` */ all : function(iterable) { var defer = new Deferred(), isPromisesArray = isArray(iterable), keys = isPromisesArray? getArrayKeys(iterable) : getObjectKeys(iterable), len = keys.length, res = isPromisesArray? [] : {}; if(!len) { defer.resolve(res); return defer.promise(); } var i = len; vow._forEach( iterable, function(value, idx) { res[keys[idx]] = value; if(!--i) { defer.resolve(res); } }, defer.reject, defer.notify, defer, keys); return defer.promise(); }, /** * Returns a promise to be fulfilled only after all the items in `iterable` are resolved. * * @param {Array|Object} iterable * @returns {vow:Promise} * * @example * ```js * var defer1 = vow.defer(), * defer2 = vow.defer(); * * vow.allResolved([defer1.promise(), defer2.promise()]).spread(function(promise1, promise2) { * promise1.isRejected(); // returns true * promise1.valueOf(); // returns "'error'" * promise2.isFulfilled(); // returns true * promise2.valueOf(); // returns "'ok'" * }); * * defer1.reject('error'); * defer2.resolve('ok'); * ``` */ allResolved : function(iterable) { var defer = new Deferred(), isPromisesArray = isArray(iterable), keys = isPromisesArray? getArrayKeys(iterable) : getObjectKeys(iterable), i = keys.length, res = isPromisesArray? [] : {}; if(!i) { defer.resolve(res); return defer.promise(); } var onResolved = function() { --i || defer.resolve(iterable); }; vow._forEach( iterable, onResolved, onResolved, defer.notify, defer, keys); return defer.promise(); }, allPatiently : function(iterable) { return vow.allResolved(iterable).then(function() { var isPromisesArray = isArray(iterable), keys = isPromisesArray? getArrayKeys(iterable) : getObjectKeys(iterable), rejectedPromises, fulfilledPromises, len = keys.length, i = 0, key, promise; if(!len) { return isPromisesArray? [] : {}; } while(i < len) { key = keys[i++]; promise = iterable[key]; if(vow.isRejected(promise)) { rejectedPromises || (rejectedPromises = isPromisesArray? [] : {}); isPromisesArray? rejectedPromises.push(promise.valueOf()) : rejectedPromises[key] = promise.valueOf(); } else if(!rejectedPromises) { (fulfilledPromises || (fulfilledPromises = isPromisesArray? [] : {}))[key] = vow.valueOf(promise); } } if(rejectedPromises) { throw rejectedPromises; } return fulfilledPromises; }); }, /** * Returns a promise to be fulfilled only when any of the items in `iterable` is fulfilled, * or to be rejected when all the items are rejected (with the reason of the first rejected item). * * @param {Array} iterable * @returns {vow:Promise} */ any : function(iterable) { var defer = new Deferred(), len = iterable.length; if(!len) { defer.reject(Error()); return defer.promise(); } var i = 0, reason; vow._forEach( iterable, defer.resolve, function(e) { i || (reason = e); ++i === len && defer.reject(reason); }, defer.notify, defer); return defer.promise(); }, /** * Returns a promise to be fulfilled only when any of the items in `iterable` is fulfilled, * or to be rejected when the first item is rejected. * * @param {Array} iterable * @returns {vow:Promise} */ anyResolved : function(iterable) { var defer = new Deferred(), len = iterable.length; if(!len) { defer.reject(Error()); return defer.promise(); } vow._forEach( iterable, defer.resolve, defer.reject, defer.notify, defer); return defer.promise(); }, /** * Static equivalent to `promise.delay`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @param {Number} delay * @returns {vow:Promise} */ delay : function(value, delay) { return vow.resolve(value).delay(delay); }, /** * Static equivalent to `promise.timeout`. * If given `value` is not a promise, then `value` is equivalent to fulfilled promise. * * @param {*} value * @param {Number} timeout * @returns {vow:Promise} */ timeout : function(value, timeout) { return vow.resolve(value).timeout(timeout); }, _forEach : function(promises, onFulfilled, onRejected, onProgress, ctx, keys) { var len = keys? keys.length : promises.length, i = 0; while(i < len) { vow.when( promises[keys? keys[i] : i], wrapOnFulfilled(onFulfilled, i), onRejected, onProgress, ctx); ++i; } }, TimedOutError : defineCustomErrorType('TimedOut') }; var defineAsGlobal = true; if(typeof module === 'object' && typeof module.exports === 'object') { module.exports = vow; defineAsGlobal = false; } if(typeof modules === 'object' && isFunction(modules.define)) { modules.define('vow', function(provide) { provide(vow); }); defineAsGlobal = false; } if(typeof define === 'function') { define(function(require, exports, module) { module.exports = vow; }); defineAsGlobal = false; } defineAsGlobal && (global.vow = vow); })(this); (function (global) { /** * API error. * * @param {String} type Error type. * @param {String} message Human-readable description of the error. */ function ApiError(type, message) { this.name = 'ApiError'; this.type = type; this.message = message; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } ApiError.prototype = Object.create(Error.prototype, { constructor: { value: ApiError } }); /** * Invalid or missed parameter. */ ApiError.BAD_REQUEST = 'BAD_REQUEST'; /** * Unspecified error or server logic error. */ ApiError.INTERNAL_ERROR = 'INTERNAL_ERROR'; /** * API middleware wasn't found. */ ApiError.NOT_FOUND = 'NOT_FOUND'; var defineAsGlobal = true; /** * @see https://github.com/ymaps/modules */ if (typeof global.modules === 'object') { global.modules.define('bla-error', function (provide) { provide(ApiError); }); defineAsGlobal = false; } /** * @see requirejs.org */ if (typeof global.define === 'function') { global.define('bla-error', function () { return ApiError; }); defineAsGlobal = false; } /** * Common JS. * @see http://wiki.commonjs.org/wiki/Modules/1.1.1 */ if (typeof require === 'function' && typeof module === 'object' && typeof module.exports === 'object') { module.exports = ApiError; defineAsGlobal = false; } if (defineAsGlobal) { global.bla = global.bla || {}; global.bla.ApiError = ApiError; } }(window)); (function (global) { /** * Returns API class based on dependencies. * * @param {Object} vow * @param {Object} ApiError * @returns {Function} */ function createApiClass(vow, ApiError) { /** * Makes an ajax request. * * @param {String} url A string containing the URL to which the request is sent. * @param {String} data Data to be sent to the server. * @returns {vow.Promise} */ function sendAjaxRequest(url, data) { var xhr = new XMLHttpRequest(); var d = vow.defer(); xhr.onreadystatechange = function () { if (xhr.readyState === XMLHttpRequest.DONE) { if (xhr.status === 200) { d.resolve(JSON.parse(xhr.responseText)); } else { d.reject(xhr); } } }; xhr.open('POST', url, true); xhr.setRequestHeader('Accept', 'application/json, text/javascript, */*; q=0.01'); xhr.setRequestHeader('Content-type', 'application/json'); xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.send(data); return d.promise(); } /** * Api provider. * * @param {String} basePath Url path to the middleware root. * @param {Object} [options] Extra options. * @param {Boolean} [options.enableBatching=true] Enables batching. */ function Api(basePath, options) { this._basePath = basePath; options = options || {}; this._options = { enableBatching: options.hasOwnProperty('enableBatching') ? options.enableBatching : true }; this._batch = []; this._deferreds = {}; } Api.prototype = { constructor: Api, /** * Executes api by path with specified parameters. * * @param {String} methodName Method name. * @param {Object} params Data should be sent to the method. * @param {Object} [execOptions] Exec-specific options. * @param {Boolean} [execOptions.enableBatching=true] Should the current call of the method be batched. * method be batched. * @returns {vow.Promise} */ exec: function (methodName, params, execOptions) { execOptions = execOptions || {}; var enableBatching = execOptions.hasOwnProperty('enableBatching') ? execOptions.enableBatching : this._options.enableBatching; return enableBatching ? this._execWithBatching(methodName, params) : this._execWithoutBatching(methodName, params); }, /** * Executes method immediately. * * @param {String} methodName Method name. * @param {Object} params Data should be sent to the method. * @returns {vow.Promise} */ _execWithoutBatching: function (methodName, params) { var defer = vow.defer(); var url = this._basePath + methodName; var data = JSON.stringify(params); sendAjaxRequest(url, data).then( this._resolvePromise.bind(this, defer), this._rejectPromise.bind(this, defer) ); return defer.promise(); }, /** * Executes method with a little delay, adding it to batch. * * @param {String} methodName Method name. * @param {Object} params Data should be sent to the method. * @returns {vow.Promise} */ _execWithBatching: function (methodName, params) { var requestId = this._getRequestId(methodName, params); var promise = this._getRequestPromise(requestId); if (!promise) { this._addToBatch(methodName, params); promise = this._createPromise(requestId); this._run(); } return promise; }, /** * Generates an ID for a method request. * * @param {String} methodName * @param {Object} params * @returns {String} */ _getRequestId: function (methodName, params) { var stringifiedParams = JSON.stringify(params) || ''; return methodName + stringifiedParams; }, /** * Gets the promise object for given request ID. * * @param {String} requestId Request ID for which promise is retrieved. * @returns {vow.Promise|undefined} */ _getRequestPromise: function (requestId) { var defer = this._deferreds[requestId]; return defer && defer.promise(); }, /** * Appends data to the batch array. * * @param {String} methodName * @param {Object} params */ _addToBatch: function (methodName, params) { this._batch.push({ method: methodName, params: params }); }, /** * Creates new deferred promise. * * @param {String} requestId Request ID for which promise is generated. * @returns {vow.Promise} */ _createPromise: function (requestId) { var defer = vow.defer(); this._deferreds[requestId] = defer; return defer.promise(); }, /** * Initializes async batch request. */ _run: function () { // The collecting requests for the batch will start when a first request is received. // That's why the batch length is checked there. if (this._batch.length === 1) { vow.resolve().then(this._sendBatchRequest, this); } }, /** * Performs batch request. */ _sendBatchRequest: function () { var url = this._basePath + 'batch'; var data = JSON.stringify({methods: this._batch}); sendAjaxRequest(url, data).then( this._resolvePromises.bind(this, this._batch), this._rejectPromises.bind(this, this._batch) ); this._batch = []; }, /** * Resolve deferred promise. * * @param {vow.Deferred} defer * @param {Object} response Server response. */ _resolvePromise: function (defer, response) { var error = response.error; if (error) { defer.reject(new ApiError(error.type, error.message)); } else { defer.resolve(response.data); } }, /** * Resolves deferred promises. * * @param {Object[]} batch Batch request data. * @param {Object} response Server response. */ _resolvePromises: function (batch, response) { var data = response.data; for (var i = 0, requestId; i < batch.length; i++) { requestId = this._getRequestId(batch[i].method, batch[i].params); this._resolvePromise(this._deferreds[requestId], data[i]); delete this._deferreds[requestId]; } }, /** * Rejects deferred promise. * * @param {vow.Deferred} defer * @param {XMLHttpRequest} xhr */ _rejectPromise: function (defer, xhr) { var errorMessage = xhr.responseText || xhr.message || xhr.statusText; defer.reject(new ApiError(xhr.status, errorMessage)); }, /** * Rejects deferred promises. * * @param {Object[]} batch Batch request data. * @param {XMLHttpRequest} xhr */ _rejectPromises: function (batch, xhr) { for (var i = 0, requestId; i < batch.length; i++) { requestId = this._getRequestId(batch[i].method, batch[i].params); this._rejectPromise(this._deferreds[requestId], xhr); delete this._deferreds[requestId]; } } }; return Api; } var defineAsGlobal = true; /** * @see https://github.com/ymaps/modules */ if (typeof global.modules === 'object') { global.modules.define('bla', ['vow', 'bla-error'], function (provide, vow, ApiError) { var Api = createApiClass(vow, ApiError); provide(Api); }); defineAsGlobal = false; } /** * @see requirejs.org */ if (typeof global.define === 'function') { global.define('bla', ['bla-error', 'vow'], function (ApiError, vow) { return createApiClass(vow, ApiError); }); defineAsGlobal = false; } /** * Common JS. * @see http://wiki.commonjs.org/wiki/Modules/1.1.1 */ if (typeof require === 'function' && typeof module === 'object' && typeof module.exports === 'object') { var vow = require('vow'); var ApiError = require('../bla-error/bla-error.js'); module.exports = createApiClass(vow, ApiError); defineAsGlobal = false; } if (defineAsGlobal) { global.bla = global.bla || {}; global.bla.Api = createApiClass(global.vow, global.bla.ApiError); } }(window));
ajax/libs/yui/3.1.0pr1/event-custom/event-custom.js
emijrp/cdnjs
YUI.add('event-custom-base', function(Y) { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom */ Y.Env.evt = { handles: {}, plugins: {} }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ (function() { /** * Allows for the insertion of methods that are executed before or after * a specified method * @class Do * @static */ var BEFORE = 0, AFTER = 1; Y.Do = { /** * Cache of objects touched by the utility * @property objs * @static */ objs: {}, /** * Execute the supplied method before the specified function * @method before * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @static */ before: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(BEFORE, f, obj, sFn); }, /** * Execute the supplied method after the specified function * @method after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @static */ after: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(AFTER, f, obj, sFn); }, /** * Execute the supplied method after the specified function * @method _inject * @param when {string} before or after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @private * @static */ _inject: function(when, fn, obj, sFn) { // object id var id = Y.stamp(obj), o, sid; if (! this.objs[id]) { // create a map entry for the obj if it doesn't exist this.objs[id] = {}; } o = this.objs[id]; if (! o[sFn]) { // create a map entry for the method if it doesn't exist o[sFn] = new Y.Do.Method(obj, sFn); // re-route the method to our wrapper obj[sFn] = function() { return o[sFn].exec.apply(o[sFn], arguments); }; } // subscriber id sid = id + Y.stamp(fn) + sFn; // register the callback o[sFn].register(sid, fn, when); return new Y.EventHandle(o[sFn], sid); }, /** * Detach a before or after subscription * @method detach * @param handle {string} the subscription handle */ detach: function(handle) { if (handle.detach) { handle.detach(); } }, _unload: function(e, me) { } }; ////////////////////////////////////////////////////////////////////////// /** * Wrapper for a displaced method with aop enabled * @class Do.Method * @constructor * @param obj The object to operate on * @param sFn The name of the method to displace */ Y.Do.Method = function(obj, sFn) { this.obj = obj; this.methodName = sFn; this.method = obj[sFn]; this.before = {}; this.after = {}; }; /** * Register a aop subscriber * @method register * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ Y.Do.Method.prototype.register = function (sid, fn, when) { if (when) { this.after[sid] = fn; } else { this.before[sid] = fn; } }; /** * Unregister a aop subscriber * @method delete * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ Y.Do.Method.prototype._delete = function (sid) { delete this.before[sid]; delete this.after[sid]; }; /** * Execute the wrapped method * @method exec */ Y.Do.Method.prototype.exec = function () { var args = Y.Array(arguments, 0, true), i, ret, newRet, bf = this.before, af = this.after, prevented = false; // execute before for (i in bf) { if (bf.hasOwnProperty(i)) { ret = bf[i].apply(this.obj, args); if (ret) { switch (ret.constructor) { case Y.Do.Halt: return ret.retVal; case Y.Do.AlterArgs: args = ret.newArgs; break; case Y.Do.Prevent: prevented = true; break; default: } } } } // execute method if (!prevented) { ret = this.method.apply(this.obj, args); } // execute after methods. for (i in af) { if (af.hasOwnProperty(i)) { newRet = af[i].apply(this.obj, args); // Stop processing if a Halt object is returned if (newRet && newRet.constructor == Y.Do.Halt) { return newRet.retVal; // Check for a new return value } else if (newRet && newRet.constructor == Y.Do.AlterReturn) { ret = newRet.newRetVal; } } } return ret; }; ////////////////////////////////////////////////////////////////////////// /** * Return an AlterArgs object when you want to change the arguments that * were passed into the function. An example would be a service that scrubs * out illegal characters prior to executing the core business logic. * @class Do.AlterArgs */ Y.Do.AlterArgs = function(msg, newArgs) { this.msg = msg; this.newArgs = newArgs; }; /** * Return an AlterReturn object when you want to change the result returned * from the core method to the caller * @class Do.AlterReturn */ Y.Do.AlterReturn = function(msg, newRetVal) { this.msg = msg; this.newRetVal = newRetVal; }; /** * Return a Halt object when you want to terminate the execution * of all subsequent subscribers as well as the wrapped method * if it has not exectued yet. * @class Do.Halt */ Y.Do.Halt = function(msg, retVal) { this.msg = msg; this.retVal = retVal; }; /** * Return a Prevent object when you want to prevent the wrapped function * from executing, but want the remaining listeners to execute * @class Do.Prevent */ Y.Do.Prevent = function(msg) { this.msg = msg; }; /** * Return an Error object when you want to terminate the execution * of all subsequent method calls. * @class Do.Error * @deprecated use Y.Do.Halt or Y.Do.Prevent */ Y.Do.Error = Y.Do.Halt; ////////////////////////////////////////////////////////////////////////// // Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do); })(); /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * Return value from all subscribe operations * @class EventHandle * @constructor * @param evt {CustomEvent} the custom event * @param sub {Subscriber} the subscriber */ // var onsubscribeType = "_event:onsub", var AFTER = 'after', CONFIGS = [ 'broadcast', 'monitored', 'bubbles', 'context', 'contextFn', 'currentTarget', 'defaultFn', 'defaultTargetOnly', 'details', 'emitFacade', 'fireOnce', 'host', 'preventable', 'preventedFn', 'queuable', 'silent', 'stoppedFn', 'target', 'type' ], YUI3_SIGNATURE = 9, YUI_LOG = 'yui:log'; Y.EventHandle = function(evt, sub) { /** * The custom event * @type CustomEvent */ this.evt = evt; /** * The subscriber object * @type Subscriber */ this.sub = sub; }; Y.EventHandle.prototype = { /** * Detaches this subscriber * @method detach */ detach: function() { var evt = this.evt, detached = 0, i; if (evt) { if (Y.Lang.isArray(evt)) { for (i=0; i<evt.length; i++) { detached += evt[i].detach(); } } else { evt._delete(this.sub); detached = 1; } } return detached; }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('attach', 'detach', 'publish') * return {EventHandle} return value from the monitor event subscription */ monitor: function(what) { return this.evt.monitor.apply(this.evt, arguments); } }; /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires * @param o configuration object * @class CustomEvent * @constructor */ Y.CustomEvent = function(type, o) { // if (arguments.length > 2) { // this.log('CustomEvent context and silent are now in the config', 'warn', 'Event'); // } o = o || {}; this.id = Y.stamp(this); /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ this.type = type; /** * The context the the event will fire from by default. Defaults to the YUI * instance. * @property context * @type object */ this.context = Y; /** * Monitor when an event is attached or detached. * * @property monitored * @type boolean */ // this.monitored = false; this.logSystem = (type == YUI_LOG); /** * If 0, this event does not broadcast. If 1, the YUI instance is notified * every time this event fires. If 2, the YUI instance and the YUI global * (if event is enabled on the global) are notified every time this event * fires. * @property broadcast * @type int */ // this.broadcast = 0; /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ this.silent = this.logSystem; /** * Specifies whether this event should be queued when the host is actively * processing an event. This will effect exectution order of the callbacks * for the various events. * @property queuable * @type boolean * @default false */ // this.queuable = false; /** * The subscribers to this event * @property subscribers * @type Subscriber{} */ this.subscribers = {}; /** * 'After' subscribers * @property afters * @type Subscriber{} */ this.afters = {}; /** * This event has fired if true * * @property fired * @type boolean * @default false; */ // this.fired = false; /** * An array containing the arguments the custom event * was last fired with. * @property firedWith * @type Array */ // this.firedWith; /** * This event should only fire one time if true, and if * it has fired, any new subscribers should be notified * immediately. * * @property fireOnce * @type boolean * @default false; */ // this.fireOnce = false; /** * Flag for stopPropagation that is modified during fire() * 1 means to stop propagation to bubble targets. 2 means * to also stop additional subscribers on this target. * @property stopped * @type int */ // this.stopped = 0; /** * Flag for preventDefault that is modified during fire(). * if it is not 0, the default behavior for this event * @property prevented * @type int */ // this.prevented = 0; /** * Specifies the host for this custom event. This is used * to enable event bubbling * @property host * @type EventTarget */ // this.host = null; /** * The default function to execute after event listeners * have fire, but only if the default action was not * prevented. * @property defaultFn * @type Function */ // this.defaultFn = null; /** * The function to execute if a subscriber calls * stopPropagation or stopImmediatePropagation * @property stoppedFn * @type Function */ // this.stoppedFn = null; /** * The function to execute if a subscriber calls * preventDefault * @property preventedFn * @type Function */ // this.preventedFn = null; /** * Specifies whether or not this event's default function * can be cancelled by a subscriber by executing preventDefault() * on the event facade * @property preventable * @type boolean * @default true */ this.preventable = true; /** * Specifies whether or not a subscriber can stop the event propagation * via stopPropagation(), stopImmediatePropagation(), or halt() * * Events can only bubble if emitFacade is true. * * @property bubbles * @type boolean * @default true */ this.bubbles = true; /** * Supports multiple options for listener signatures in order to * port YUI 2 apps. * @property signature * @type int * @default 9 */ this.signature = YUI3_SIGNATURE; this.subCount = 0; this.afterCount = 0; // this.hasSubscribers = false; // this.hasAfters = false; /** * If set to true, the custom event will deliver an EventFacade object * that is similar to a DOM event object. * @property emitFacade * @type boolean * @default false */ // this.emitFacade = false; this.applyConfig(o, true); // this.log("Creating " + this.type); }; Y.CustomEvent.prototype = { hasSubs: function(when) { var s = this.subCount, a = this.afterCount, sib = this.sibling; if (sib) { s += sib.subCount; a += sib.afterCount; } if (when) { return (when == 'after') ? a : s; } return (s + a); }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('detach', 'attach', 'publish') * return {EventHandle} return value from the monitor event subscription */ monitor: function(what) { this.monitored = true; var type = this.id + '|' + this.type + '_' + what, args = Y.Array(arguments, 0, true); args[0] = type; return this.host.on.apply(this.host, args); }, /** * Get all of the subscribers to this event and any sibling event * @return {Array} first item is the on subscribers, second the after */ getSubs: function() { var s = Y.merge(this.subscribers), a = Y.merge(this.afters), sib = this.sibling; if (sib) { Y.mix(s, sib.subscribers); Y.mix(a, sib.afters); } return [s, a]; }, /** * Apply configuration properties. Only applies the CONFIG whitelist * @method applyConfig * @param o hash of properties to apply * @param force {boolean} if true, properties that exist on the event * will be overwritten. */ applyConfig: function(o, force) { if (o) { Y.mix(this, o, force, CONFIGS); } }, _on: function(fn, context, args, when) { if (!fn) { this.log("Invalid callback for CE: " + this.type); } var s = new Y.Subscriber(fn, context, args, when); if (this.fireOnce && this.fired) { // Y.later(0, this, Y.bind(this._notify, this, s, this.firedWith)); setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0); } if (when == AFTER) { this.afters[s.id] = s; this.afterCount++; } else { this.subscribers[s.id] = s; this.subCount++; } return new Y.EventHandle(this, s); }, /** * Listen for this event * @method subscribe * @param {Function} fn The function to execute * @return {EventHandle} handle Unsubscribe handle * @deprecated use on */ subscribe: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true): null; return this._on(fn, context, a, true); }, /** * Listen for this event * @method on * @param {Function} fn The function to execute * @return {EventHandle} handle Unsubscribe handle */ on: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true): null; this.host._monitor('attach', this.type, { args: arguments }); return this._on(fn, context, a, true); }, /** * Listen for this event after the normal subscribers have been notified and * the default behavior has been applied. If a normal subscriber prevents the * default behavior, it also prevents after listeners from firing. * @method after * @param {Function} fn The function to execute * @return {EventHandle} handle Unsubscribe handle */ after: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true): null; return this._on(fn, context, a, AFTER); }, /** * Detach listeners. * @method detach * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed * @param {Object} context The context object passed to subscribe. * @return {int} returns the number of subscribers unsubscribed */ detach: function(fn, context) { // unsubscribe handle if (fn && fn.detach) { return fn.detach(); } var found = 0, subs = this.subscribers, i, s; for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && (!fn || fn === s.fn)) { this._delete(s); found++; } } } return found; }, /** * Detach listeners. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed * @param {Object} context The context object passed to subscribe. * @return {int|undefined} returns the number of subscribers unsubscribed * @deprecated use detach */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Notify a single subscriber * @method _notify * @param s {Subscriber} the subscriber * @param args {Array} the arguments array to apply to the listener * @private */ _notify: function(s, args, ef) { this.log(this.type + "->" + "sub: " + s.id); var ret; ret = s.notify(args, this); if (false === ret || this.stopped > 1) { this.log(this.type + " cancelled by subscriber"); return false; } return true; }, /** * Logger abstraction to centralize the application of the silent flag * @method log * @param msg {string} message to log * @param cat {string} log category */ log: function(msg, cat) { if (!this.silent) { } }, /** * Notifies the subscribers. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters: * <ul> * <li>The type of event</li> * <li>All of the arguments fire() was executed with as an array</li> * <li>The custom object (if any) that was passed into the subscribe() * method</li> * </ul> * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise * */ fire: function() { if (this.fireOnce && this.fired) { this.log('fireOnce event: ' + this.type + ' already fired'); return true; } else { var args = Y.Array(arguments, 0, true); // this doesn't happen if the event isn't published // this.host._monitor('fire', this.type, args); this.fired = true; this.firedWith = args; if (this.emitFacade) { return this.fireComplex(args); } else { return this.fireSimple(args); } } }, fireSimple: function(args) { this.stopped = 0; this.prevented = 0; if (this.hasSubs()) { // this._procSubs(Y.merge(this.subscribers, this.afters), args); var subs = this.getSubs(); this._procSubs(subs[0], args); this._procSubs(subs[1], args); } this._broadcast(args); return this.stopped ? false : true; }, // Requires the event-custom-complex module for full funcitonality. fireComplex: function(args) { args[0] = args[0] || {}; return this.fireSimple(args); }, _procSubs: function(subs, args, ef) { var s, i; for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && s.fn) { if (false === this._notify(s, args, ef)) { this.stopped = 2; } if (this.stopped == 2) { return false; } } } } return true; }, _broadcast: function(args) { if (!this.stopped && this.broadcast) { var a = Y.Array(args); a.unshift(this.type); if (this.host !== Y) { Y.fire.apply(Y, a); } if (this.broadcast == 2) { Y.Global.fire.apply(Y.Global, a); } } }, /** * Removes all listeners * @method unsubscribeAll * @return {int} The number of listeners unsubscribed * @deprecated use detachAll */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Removes all listeners * @method detachAll * @return {int} The number of listeners unsubscribed */ detachAll: function() { return this.detach(); }, /** * @method _delete * @param subscriber object * @private */ _delete: function(s) { if (s) { delete s.fn; delete s.context; delete this.subscribers[s.id]; delete this.afters[s.id]; } this.host._monitor('detach', this.type, { ce: this, sub: s }); } }; ///////////////////////////////////////////////////////////////////// /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The wrapped function to execute * @param {Object} context The value of the keyword 'this' in the listener * @param {Array} args* 0..n additional arguments to supply the listener * * @class Subscriber * @constructor */ Y.Subscriber = function(fn, context, args) { /** * The callback that will be execute when the event fires * This is wrapped by Y.rbind if obj was supplied. * @property fn * @type Function */ this.fn = fn; /** * Optional 'this' keyword for the listener * @property context * @type Object */ this.context = context; /** * Unique subscriber id * @property id * @type String */ this.id = Y.stamp(this); /** * Additional arguments to propagate to the subscriber * @property args * @type Array */ this.args = args; /** * Custom events for a given fire transaction. * @property events * @type {EventTarget} */ // this.events = null; /** * This listener only reacts to the event once * @property once */ // this.once = false; }; Y.Subscriber.prototype = { _notify: function(c, args, ce) { var a = this.args, ret; switch (ce.signature) { case 0: ret = this.fn.call(c, ce.type, args, c); break; case 1: ret = this.fn.call(c, args[0] || null, c); break; default: if (a || args) { args = args || []; a = (a) ? args.concat(a) : args; ret = this.fn.apply(c, a); } else { ret = this.fn.call(c); } } if (this.once) { ce._delete(this); } return ret; }, /** * Executes the subscriber. * @method notify * @param args {Array} Arguments array for the subscriber * @param ce {CustomEvent} The custom event that sent the notification */ notify: function(args, ce) { var c = this.context, ret = true; if (!c) { c = (ce.contextFn) ? ce.contextFn() : ce.context; } // only catch errors if we will not re-throw them. if (Y.config.throwFail) { ret = this._notify(c, args, ce); } else { try { ret = this._notify(c, args, ce); } catch(e) { Y.error(this + ' failed: ' + e.message, e); } } return ret; }, /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute * @param {Object} context optional 'this' keyword for the listener * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ contains: function(fn, context) { if (context) { return ((this.fn == fn) && this.context == context); } else { return (this.fn == fn); } } }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ (function() { /** * EventTarget provides the implementation for any object to * publish, subscribe and fire to custom events, and also * alows other EventTargets to target the object with events * sourced from the other object. * EventTarget is designed to be used with Y.augment to wrap * EventCustom in an interface that allows events to be listened to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * @class EventTarget * @param opts a configuration object * @config emitFacade {boolean} if true, all events will emit event * facade payloads by default (default false) * @config prefix {string} the prefix to apply to non-prefixed event names * @config chain {boolean} if true, on/after/detach return the host to allow * chaining, otherwise they return an EventHandle (default false) */ var L = Y.Lang, PREFIX_DELIMITER = ':', CATEGORY_DELIMITER = '|', AFTER_PREFIX = '~AFTER~', _wildType = Y.cached(function(type) { return type.replace(/(.*)(:)(.*)/, "*$2$3"); }), /** * If the instance has a prefix attribute and the * event type is not prefixed, the instance prefix is * applied to the supplied type. * @method _getType * @private */ _getType = Y.cached(function(type, pre) { if (!pre || !L.isString(type) || type.indexOf(PREFIX_DELIMITER) > -1) { return type; } return pre + PREFIX_DELIMITER + type; }), /** * Returns an array with the detach key (if provided), * and the prefixed event name from _getType * Y.on('detachcategory| menu:click', fn) * @method _parseType * @private */ _parseType = Y.cached(function(type, pre) { var t = type, detachcategory, after, i; if (!L.isString(t)) { return t; } i = t.indexOf(AFTER_PREFIX); if (i > -1) { after = true; t = t.substr(AFTER_PREFIX.length); } i = t.indexOf(CATEGORY_DELIMITER); if (i > -1) { detachcategory = t.substr(0, (i)); t = t.substr(i+1); if (t == '*') { t = null; } } // detach category, full type with instance prefix, is this an after listener, short type return [detachcategory, (pre) ? _getType(t, pre) : t, after, t]; }), ET = function(opts) { var o = (L.isObject(opts)) ? opts : {}; this._yuievt = this._yuievt || { id: Y.guid(), events: {}, targets: {}, config: o, chain: ('chain' in o) ? o.chain : Y.config.chain, bubbling: false, defaults: { context: o.context || this, host: this, emitFacade: o.emitFacade, fireOnce: o.fireOnce, queuable: o.queuable, monitored: o.monitored, broadcast: o.broadcast, defaultTargetOnly: o.defaulTargetOnly, bubbles: ('bubbles' in o) ? o.bubbles : true } }; }; ET.prototype = { /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>on</code> except the * listener is immediatelly detached when it is executed. * @method once * @param type {string} The type of the event * @param fn {Function} The callback * @return the event target or a detach handle per 'chain' config */ once: function() { var handle = this.on.apply(this, arguments); handle.sub.once = true; return handle; }, /** * Subscribe to a custom event hosted by this object * @method on * @param type {string} The type of the event * @param fn {Function} The callback * @return the event target or a detach handle per 'chain' config */ on: function(type, fn, context, x) { var parts = _parseType(type, this._yuievt.config.prefix), f, c, args, ret, ce, detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype, Node = Y.Node, n, domevent, isArr; // full name, args, detachcategory, after this._monitor('attach', parts[1], { args: arguments, category: parts[0], after: parts[2] }); if (L.isObject(type)) { if (L.isFunction(type)) { return Y.Do.before.apply(Y.Do, arguments); } f = fn; c = context; args = Y.Array(arguments, 0, true); ret = {}; if (L.isArray(type)) { isArr = true; } else { after = type._after; delete type._after; } Y.each(type, function(v, k) { if (L.isObject(v)) { f = v.fn || ((L.isFunction(v)) ? v : f); c = v.context || c; } args[0] = (isArr) ? v : ((after) ? AFTER_PREFIX + k : k); args[1] = f; args[2] = c; ret[k] = this.on.apply(this, args); }, this); return (this._yuievt.chain) ? this : new Y.EventHandle(ret); } detachcategory = parts[0]; after = parts[2]; shorttype = parts[3]; // extra redirection so we catch adaptor events too. take a look at this. if (Node && (this instanceof Node) && (shorttype in Node.DOM_EVENTS)) { args = Y.Array(arguments, 0, true); args.splice(2, 0, Node.getDOMNode(this)); return Y.on.apply(Y, args); } type = parts[1]; if (this instanceof YUI) { adapt = Y.Env.evt.plugins[type]; args = Y.Array(arguments, 0, true); args[0] = shorttype; if (Node) { n = args[2]; if (n instanceof Y.NodeList) { n = Y.NodeList.getDOMNodes(n); } else if (n instanceof Node) { n = Node.getDOMNode(n); } domevent = (shorttype in Node.DOM_EVENTS); // Captures both DOM events and event plugins. if (domevent) { args[2] = n; } } // check for the existance of an event adaptor if (adapt) { handle = adapt.on.apply(Y, args); } else if ((!type) || domevent) { handle = Y.Event._attach(args); } } if (!handle) { ce = this._yuievt.events[type] || this.publish(type); handle = ce._on(fn, context, (arguments.length > 3) ? Y.Array(arguments, 3, true) : null, (after) ? 'after' : true); } if (detachcategory) { store[detachcategory] = store[detachcategory] || {}; store[detachcategory][type] = store[detachcategory][type] || []; store[detachcategory][type].push(handle); } return (this._yuievt.chain) ? this : handle; }, /** * subscribe to an event * @method subscribe * @deprecated use on */ subscribe: function() { return this.on.apply(this, arguments); }, /** * Detach one or more listeners the from the specified event * @method detach * @param type {string|Object} Either the handle to the subscriber or the * type of event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param context {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {EventTarget} the host */ detach: function(type, fn, context) { var evts = this._yuievt.events, i, Node = Y.Node, isNode = Node && (this instanceof Node); // detachAll disabled on the Y instance. if (!type && (this !== Y)) { for (i in evts) { if (evts.hasOwnProperty(i)) { evts[i].detach(fn, context); } } if (isNode) { Y.Event.purgeElement(Node.getDOMNode(this)); } return this; } var parts = _parseType(type, this._yuievt.config.prefix), detachcategory = L.isArray(parts) ? parts[0] : null, shorttype = (parts) ? parts[3] : null, handle, adapt, store = Y.Env.evt.handles, cat, args, ce, keyDetacher = function(lcat, ltype) { var handles = lcat[ltype]; if (handles) { while (handles.length) { handle = handles.pop(); handle.detach(); } } }; if (detachcategory) { cat = store[detachcategory]; type = parts[1]; if (cat) { if (type) { keyDetacher(cat, type); } else { for (i in cat) { if (cat.hasOwnProperty(i)) { keyDetacher(cat, i); } } } return this; } // If this is an event handle, use it to detach } else if (L.isObject(type) && type.detach) { type.detach(); return this; // extra redirection so we catch adaptor events too. take a look at this. } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) { args = Y.Array(arguments, 0, true); args[2] = Node.getDOMNode(this); Y.detach.apply(Y, args); return this; } adapt = Y.Env.evt.plugins[shorttype]; // The YUI instance handles DOM events and adaptors if (this instanceof YUI) { args = Y.Array(arguments, 0, true); // use the adaptor specific detach code if if (adapt && adapt.detach) { adapt.detach.apply(Y, args); return this; // DOM event fork } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) { args[0] = type; Y.Event.detach.apply(Y.Event, args); return this; } } ce = evts[type]; if (ce) { ce.detach(fn, context); } return this; }, /** * detach a listener * @method unsubscribe * @deprecated use detach */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method detachAll * @param type {string} The type, or name of the event */ detachAll: function(type) { return this.detach(type); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param type {string} The type, or name of the event * @deprecated use detachAll */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method publish * * @param type {string} the type, or name of the event * @param opts {object} optional config params. Valid properties are: * * <ul> * <li> * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) * </li> * <li> * 'bubbles': whether or not this event bubbles (true) * Events can only bubble if emitFacade is true. * </li> * <li> * 'context': the default execution context for the listeners (this) * </li> * <li> * 'defaultFn': the default function to execute when this event fires if preventDefault was not called * </li> * <li> * 'emitFacade': whether or not this event emits a facade (false) * </li> * <li> * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' * </li> * <li> * 'fireOnce': if an event is configured to fire once, new subscribers after * the fire will be notified immediately. * </li> * <li> * 'preventable': whether or not preventDefault() has an effect (true) * </li> * <li> * 'preventedFn': a function that is executed when preventDefault is called * </li> * <li> * 'queuable': whether or not this event can be queued during bubbling (false) * </li> * <li> * 'silent': if silent is true, debug messages are not provided for this event. * </li> * <li> * 'stoppedFn': a function that is executed when stopPropagation is called * </li> * * <li> * 'monitored': specifies whether or not this event should send notifications about * when the event has been attached, detached, or published. * </li> * <li> * 'type': the event type (valid option if not provided as the first parameter to publish) * </li> * </ul> * * @return {CustomEvent} the custom event * */ publish: function(type, opts) { var events, ce, ret, pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; this._monitor('publish', type, { args: arguments }); if (L.isObject(type)) { ret = {}; Y.each(type, function(v, k) { ret[k] = this.publish(k, v || opts); }, this); return ret; } events = this._yuievt.events; ce = events[type]; if (ce) { // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event'); if (opts) { ce.applyConfig(opts, true); } } else { // apply defaults ce = new Y.CustomEvent(type, (opts) ? Y.mix(opts, this._yuievt.defaults) : this._yuievt.defaults); events[type] = ce; } // make sure we turn the broadcast flag off if this // event was published as a result of bubbling // if (opts instanceof Y.CustomEvent) { // events[type].broadcast = false; // } return events[type]; }, /** * This is the entry point for the event monitoring system. * You can monitor 'attach', 'detach', and 'publish. When * configured, these events generate an event. click -> * click_attach, click_detach, click_publish -- these can * be subscribed to like other events to monitor the event * system. Inividual published events can have monitoring * turned on or off (publish can't be turned off before it * it published) by setting the events 'monitor' config. * * @private */ _monitor: function(what, type, o) { var monitorevt, ce = this.getEvent(type); if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { monitorevt = type + '_' + what; o.monitored = what; this.fire.call(this, monitorevt, o); } }, /** * Fire a custom event by name. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters. * * If the custom event object hasn't been created, then the event hasn't * been published and it has no subscribers. For performance sake, we * immediate exit in this case. This means the event won't bubble, so * if the intention is that a bubble target be notified, the event must * be published on this object first. * * The first argument is the event type, and any additional arguments are * passed to the listeners as parameters. If the first of these is an * object literal, and the event is configured to emit an event facade, * that object is mixed into the event facade and the facade is provided * in place of the original object. * * @method fire * @param type {String|Object} The type of the event, or an object that contains * a 'type' property. * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. If the first of these is an object literal and the event is * configured to emit an event facade, the event facade will replace that * parameter after the properties the object literal contains are copied to * the event facade. * @return {EventTarget} the event host * */ fire: function(type) { var typeIncluded = L.isString(type), t = (typeIncluded) ? type : (type && type.type), ce, ret, pre = this._yuievt.config.prefix, ce2, args = (typeIncluded) ? Y.Array(arguments, 1, true) : arguments; t = (pre) ? _getType(t, pre) : t; this._monitor('fire', t, { args: args }); ce = this.getEvent(t, true); ce2 = this.getSibling(t, ce); if (ce2 && !ce) { ce = this.publish(t); } // this event has not been published or subscribed to if (!ce) { if (this._yuievt.hasTargets) { return this.bubble({ type: t }, args, this); } // otherwise there is nothing to be done ret = true; } else { ce.sibling = ce2; ret = ce.fire.apply(ce, args); } return (this._yuievt.chain) ? this : ret; }, getSibling: function(type, ce) { var ce2; // delegate to *:type events if there are subscribers if (type.indexOf(PREFIX_DELIMITER) > -1) { type = _wildType(type); // console.log(type); ce2 = this.getEvent(type, true); if (ce2) { // console.log("GOT ONE: " + type); ce2.applyConfig(ce); ce2.bubbles = false; ce2.broadcast = 0; // ret = ce2.fire.apply(ce2, a); } } return ce2; }, /** * Returns the custom event of the provided type has been created, a * falsy value otherwise * @method getEvent * @param type {string} the type, or name of the event * @param prefixed {string} if true, the type is prefixed already * @return {CustomEvent} the custom event or null */ getEvent: function(type, prefixed) { var pre, e; if (!prefixed) { pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; } e = this._yuievt.events; return e[type] || null; }, /** * Subscribe to a custom event hosted by this object. The * supplied callback will execute after any listeners add * via the subscribe method, and after the default function, * if configured for the event, has executed. * @method after * @param type {string} The type of the event * @param fn {Function} The callback * @return the event target or a detach handle per 'chain' config */ after: function(type, fn) { var a = Y.Array(arguments, 0, true); switch (L.type(type)) { case 'function': return Y.Do.after.apply(Y.Do, arguments); case 'object': a[0]._after = true; break; default: a[0] = AFTER_PREFIX + type; } return this.on.apply(this, a); }, /** * Executes the callback before a DOM event, custom event * or method. If the first argument is a function, it * is assumed the target is a method. For DOM and custom * events, this is an alias for Y.on. * * For DOM and custom events: * type, callback, context, 0-n arguments * * For methods: * callback, object (method host), methodName, context, 0-n arguments * * @method before * @return detach handle */ before: function() { return this.on.apply(this, arguments); } }; Y.EventTarget = ET; // make Y an event target Y.mix(Y, ET.prototype, false, false, { bubbles: false }); ET.call(Y); YUI.Env.globalEvents = YUI.Env.globalEvents || new ET(); /** * Hosts YUI page level events. This is where events bubble to * when the broadcast config is set to 2. This property is * only available if the custom event module is loaded. * @property Global * @type EventTarget * @for YUI */ Y.Global = YUI.Env.globalEvents; // @TODO implement a global namespace function on Y.Global? })(); /** * <code>YUI</code>'s <code>on</code> method is a unified interface for subscribing to * most events exposed by YUI. This includes custom events, DOM events, and * function events. <code>detach</code> is also provided to remove listeners * serviced by this function. * * The signature that <code>on</code> accepts varies depending on the type * of event being consumed. Refer to the specific methods that will * service a specific request for additional information about subscribing * to that type of event. * * <ul> * <li>Custom events. These events are defined by various * modules in the library. This type of event is delegated to * <code>EventTarget</code>'s <code>on</code> method. * <ul> * <li>The type of the event</li> * <li>The callback to execute</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example: * <code>Y.on('domready', function() { // start work });</code> * </li> * <li>DOM events. These are moments reported by the browser related * to browser functionality and user interaction. * This type of event is delegated to <code>Event</code>'s * <code>attach</code> method. * <ul> * <li>The type of the event</li> * <li>The callback to execute</li> * <li>The specification for the Node(s) to attach the listener * to. This can be a selector, collections, or Node/Element * refereces.</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example: * <code>Y.on('click', function(e) { // something was clicked }, '#someelement');</code> * </li> * <li>Function events. These events can be used to react before or after a * function is executed. This type of event is delegated to <code>Event.Do</code>'s * <code>before</code> method. * <ul> * <li>The callback to execute</li> * <li>The object that has the function that will be listened for.</li> * <li>The name of the function to listen for.</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example <code>Y.on(function(arg1, arg2, etc) { // obj.methodname was executed }, obj 'methodname');</code> * </li> * </ul> * * <code>on</code> corresponds to the moment before any default behavior of * the event. <code>after</code> works the same way, but these listeners * execute after the event's default behavior. <code>before</code> is an * alias for <code>on</code>. * * @method on * @param type** event type (this parameter does not apply for function events) * @param fn the callback * @param target** a descriptor for the target (applies to custom events only). * For function events, this is the object that contains the function to * execute. * @param extra** 0..n Extra information a particular event may need. These * will be documented with the event. In the case of function events, this * is the name of the function to execute on the host. In the case of * delegate listeners, this is the event delegation specification. * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ /** * Listen for an event one time. Equivalent to <code>on</code>, except that * the listener is immediately detached when executed. * @see on * @method once * @param type** event type (this parameter does not apply for function events) * @param fn the callback * @param target** a descriptor for the target (applies to custom events only). * For function events, this is the object that contains the function to * execute. * @param extra** 0..n Extra information a particular event may need. These * will be documented with the event. In the case of function events, this * is the name of the function to execute on the host. In the case of * delegate listeners, this is the event delegation specification. * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ /** * after() is a unified interface for subscribing to * most events exposed by YUI. This includes custom events, * DOM events, and AOP events. This works the same way as * the on() function, only it operates after any default * behavior for the event has executed. @see <code>on</code> for more * information. * @method after * @param type event type (this parameter does not apply for function events) * @param fn the callback * @param target a descriptor for the target (applies to custom events only). * For function events, this is the object that contains the function to * execute. * @param extra 0..n Extra information a particular event may need. These * will be documented with the event. In the case of function events, this * is the name of the function to execute on the host. In the case of * delegate listeners, this is the event delegation specification. * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ }, '@VERSION@' ,{requires:['oop']}); YUI.add('event-custom-complex', function(Y) { /** * Adds event facades, preventable default behavior, and bubbling. * events. * @module event-custom * @submodule event-custom-complex */ (function() { var FACADE, FACADE_KEYS, CEProto = Y.CustomEvent.prototype, ETProto = Y.EventTarget.prototype; /** * Wraps and protects a custom event for use when emitFacade is set to true. * Requires the event-custom-complex module * @class EventFacade * @param e {Event} the custom event * @param currentTarget {HTMLElement} the element the listener was attached to */ Y.EventFacade = function(e, currentTarget) { e = e || {}; /** * The arguments passed to fire * @property details * @type Array */ this.details = e.details; /** * The event type, this can be overridden by the fire() payload * @property type * @type string */ this.type = e.type; /** * The real event type * @property type * @type string */ this._type = e.type; ////////////////////////////////////////////////////// /** * Node reference for the targeted eventtarget * @propery target * @type Node */ this.target = e.target; /** * Node reference for the element that the listener was attached to. * @propery currentTarget * @type Node */ this.currentTarget = currentTarget; /** * Node reference to the relatedTarget * @propery relatedTarget * @type Node */ this.relatedTarget = e.relatedTarget; /** * Stops the propagation to the next bubble target * @method stopPropagation */ this.stopPropagation = function() { e.stopPropagation(); }; /** * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * on the current target. * @method stopImmediatePropagation */ this.stopImmediatePropagation = function() { e.stopImmediatePropagation(); }; /** * Prevents the event's default behavior * @method preventDefault */ this.preventDefault = function() { e.preventDefault(); }; /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ this.halt = function(immediate) { e.halt(immediate); }; }; CEProto.fireComplex = function(args) { var es = Y.Env._eventstack, ef, q, queue, ce, ret, events, subs, self = this, host = self.host || self, next, oldbubble; if (es) { // queue this event if the current item in the queue bubbles if (self.queuable && self.type != es.next.type) { self.log('queue ' + self.type); es.queue.push([self, args]); return true; } } else { Y.Env._eventstack = { // id of the first event in the stack id: self.id, next: self, silent: self.silent, stopped: 0, prevented: 0, bubbling: null, type: self.type, // defaultFnQueue: new Y.Queue(), afterQueue: new Y.Queue(), defaultTargetOnly: self.defaultTargetOnly, queue: [] }; es = Y.Env._eventstack; } subs = self.getSubs(); self.stopped = (self.type !== es.type) ? 0 : es.stopped; self.prevented = (self.type !== es.type) ? 0 : es.prevented; self.target = self.target || host; events = new Y.EventTarget({ fireOnce: true, context: host }); self.events = events; if (self.preventedFn) { events.on('prevented', self.preventedFn); } if (self.stoppedFn) { events.on('stopped', self.stoppedFn); } self.currentTarget = host; self.details = args.slice(); // original arguments in the details // self.log("Firing " + self + ", " + "args: " + args); self.log("Firing " + self.type); self._facade = null; // kill facade to eliminate stale properties ef = self._getFacade(args); if (Y.Lang.isObject(args[0])) { args[0] = ef; } else { args.unshift(ef); } // if (subCount) { if (subs[0]) { // self._procSubs(Y.merge(self.subscribers), args, ef); self._procSubs(subs[0], args, ef); } // bubble if this is hosted in an event target and propagation has not been stopped if (self.bubbles && host.bubble && !self.stopped) { oldbubble = es.bubbling; // self.bubbling = true; es.bubbling = self.type; // if (host !== ef.target || es.type != self.type) { if (es.type != self.type) { es.stopped = 0; es.prevented = 0; } ret = host.bubble(self); self.stopped = Math.max(self.stopped, es.stopped); self.prevented = Math.max(self.prevented, es.prevented); // self.bubbling = false; es.bubbling = oldbubble; } // execute the default behavior if not prevented // console.log('defaultTargetOnly: ' + self.defaultTargetOnly); // console.log('host === target: ' + (host === ef.target)); // if (self.defaultFn && !self.prevented && ((!self.defaultTargetOnly) || host === es.id === self.id)) { if (self.defaultFn && !self.prevented && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) { // if (es.id === self.id) { // self.defaultFn.apply(host, args); // while ((next = es.defaultFnQueue.last())) { // next(); // } // } else { // es.defaultFnQueue.add(function() { // self.defaultFn.apply(host, args); // }); // } self.defaultFn.apply(host, args); } // broadcast listeners are fired as discreet events on the // YUI instance and potentially the YUI global. self._broadcast(args); // process after listeners. If the default behavior was // prevented, the after events don't fire. // if (self.afterCount && !self.prevented && self.stopped < 2) { // if (subs[1] && !self.prevented && self.stopped < 2) { // // self._procSubs(Y.merge(self.afters), args, ef); // self._procSubs(subs[1], args, ef); // } // Queue the after if (subs[1] && !self.prevented && self.stopped < 2) { if (es.id === self.id || self.type != host._yuievt.bubbling) { self._procSubs(subs[1], args, ef); while ((next = es.afterQueue.last())) { next(); } } else { es.afterQueue.add(function() { self._procSubs(subs[1], args, ef); }); } } self.target = null; // es.stopped = 0; // es.prevented = 0; if (es.id === self.id) { queue = es.queue; while (queue.length) { q = queue.pop(); ce = q[0]; // set up stack to allow the next item to be processed es.next = ce; ce.fire.apply(ce, q[1]); // es.stopped = 0; // es.prevented = 0; } Y.Env._eventstack = null; } ret = !(self.stopped); if (self.type != host._yuievt.bubbling) { es.stopped = 0; es.prevented = 0; self.stopped = 0; self.prevented = 0; } return ret; }; CEProto._getFacade = function() { var ef = this._facade, o, o2, args = this.details; if (!ef) { ef = new Y.EventFacade(this, this.currentTarget); } // if the first argument is an object literal, apply the // properties to the event facade o = args && args[0]; if (Y.Lang.isObject(o, true)) { o2 = {}; // protect the event facade properties Y.mix(o2, ef, true, FACADE_KEYS); // mix the data Y.mix(ef, o, true); // restore ef Y.mix(ef, o2, true, FACADE_KEYS); // Allow the event type to be faked // http://yuilibrary.com/projects/yui3/ticket/2528376 ef.type = o.type || ef.type; } // update the details field with the arguments // ef.type = this.type; ef.details = this.details; // use the original target when the event bubbled to this target ef.target = this.originalTarget || this.target; ef.currentTarget = this.currentTarget; ef.stopped = 0; ef.prevented = 0; this._facade = ef; return this._facade; }; /** * Stop propagation to bubble targets * @for CustomEvent * @method stopPropagation */ CEProto.stopPropagation = function() { this.stopped = 1; Y.Env._eventstack.stopped = 1; this.events.fire('stopped', this); }; /** * Stops propagation to bubble targets, and prevents any remaining * subscribers on the current target from executing. * @method stopImmediatePropagation */ CEProto.stopImmediatePropagation = function() { this.stopped = 2; Y.Env._eventstack.stopped = 2; this.events.fire('stopped', this); }; /** * Prevents the execution of this event's defaultFn * @method preventDefault */ CEProto.preventDefault = function() { if (this.preventable) { this.prevented = 1; Y.Env._eventstack.prevented = 1; this.events.fire('prevented', this); } }; /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ CEProto.halt = function(immediate) { if (immediate) { this.stopImmediatePropagation(); } else { this.stopPropagation(); } this.preventDefault(); }; /** * Registers another EventTarget as a bubble target. Bubble order * is determined by the order registered. Multiple targets can * be specified. * * Events can only bubble if emitFacade is true. * * Included in the event-custom-complex submodule. * * @method addTarget * @param o {EventTarget} the target to add * @for EventTarget */ ETProto.addTarget = function(o) { this._yuievt.targets[Y.stamp(o)] = o; this._yuievt.hasTargets = true; }; /** * Returns an array of bubble targets for this object. * @method getTargets * @return EventTarget[] */ ETProto.getTargets = function() { return Y.Object.values(this._yuievt.targets); }; /** * Removes a bubble target * @method removeTarget * @param o {EventTarget} the target to remove * @for EventTarget */ ETProto.removeTarget = function(o) { delete this._yuievt.targets[Y.stamp(o)]; }; /** * Propagate an event. Requires the event-custom-complex module. * @method bubble * @param evt {Event.Custom} the custom event to propagate * @return {boolean} the aggregated return value from Event.Custom.fire * @for EventTarget */ ETProto.bubble = function(evt, args, target) { var targs = this._yuievt.targets, ret = true, t, type = evt && evt.type, ce, i, bc, ce2, originalTarget = target || (evt && evt.target) || this, es = Y.Env._eventstack, oldbubble; if (!evt || ((!evt.stopped) && targs)) { for (i in targs) { if (targs.hasOwnProperty(i)) { t = targs[i]; ce = t.getEvent(type, true); ce2 = t.getSibling(type, ce); if (ce2 && !ce) { ce = t.publish(type); } oldbubble = t._yuievt.bubbling; t._yuievt.bubbling = type; // if this event was not published on the bubble target, // continue propagating the event. if (!ce) { if (t._yuievt.hasTargets) { t.bubble(evt, args, originalTarget); } } else { ce.sibling = ce2; // set the original target to that the target payload on the // facade is correct. ce.target = originalTarget; ce.originalTarget = originalTarget; ce.currentTarget = t; bc = ce.broadcast; ce.broadcast = false; ret = ret && ce.fire.apply(ce, args || evt.details || []); ce.broadcast = bc; ce.originalTarget = null; // stopPropagation() was called if (ce.stopped) { break; } } t._yuievt.bubbling = oldbubble; } } } return ret; }; FACADE = new Y.EventFacade(); FACADE_KEYS = Y.Object.keys(FACADE); })(); }, '@VERSION@' ,{requires:['event-custom-base']}); YUI.add('event-custom', function(Y){}, '@VERSION@' ,{use:['event-custom-base', 'event-custom-complex']});
src/components/Story/Body.js
ryanbaer/busy
import React from 'react'; import PropTypes from 'prop-types'; import _ from 'lodash'; import classNames from 'classnames'; import sanitizeHtml from 'sanitize-html'; import Remarkable from 'remarkable'; import embedjs from 'embedjs'; import { jsonParse } from '../../helpers/formatter'; import sanitizeConfig from '../../vendor/SanitizeConfig'; import { imageRegex } from '../../helpers/regexHelpers'; import htmlReady from '../../vendor/steemitHtmlReady'; import PostFeedEmbed from './PostFeedEmbed'; import './Body.less'; export const remarkable = new Remarkable({ html: true, // remarkable renders first then sanitize runs... breaks: true, linkify: false, // linkify is done locally typographer: false, // https://github.com/jonschlinkert/remarkable/issues/142#issuecomment-221546793 quotes: '“”‘’', }); // Should return text(html) if returnType is text // Should return Object(React Compatible) if returnType is Object export function getHtml(body, jsonMetadata = {}, returnType = 'Object') { const parsedJsonMetadata = jsonParse(jsonMetadata) || {}; parsedJsonMetadata.image = parsedJsonMetadata.image || []; let parsedBody = body.replace(/<!--([\s\S]+?)(-->|$)/g, '(html comment removed: $1)'); parsedBody.replace(imageRegex, (img) => { if (_.filter(parsedJsonMetadata.image, i => i.indexOf(img) !== -1).length === 0) { parsedJsonMetadata.image.push(img); } }); const htmlReadyOptions = { mutate: true, resolveIframe: returnType === 'text' }; parsedBody = remarkable.render(parsedBody); parsedBody = htmlReady(parsedBody, htmlReadyOptions).html; parsedBody = sanitizeHtml(parsedBody, sanitizeConfig({})); if (returnType === 'text') { return parsedBody; } const sections = []; const splittedBody = parsedBody.split('~~~ embed:'); for (let i = 0; i < splittedBody.length; i += 1) { let section = splittedBody[i]; const match = section.match(/^([A-Za-z0-9_-]+) ([A-Za-z]+) (\S+) ~~~/); if (match && match.length >= 4) { const id = match[1]; const type = match[2]; const link = match[3]; const embed = embedjs.get(link, { width: '100%', height: 400, autoplay: false }); sections.push(<PostFeedEmbed key={`embed-a-${i}`} inPost embed={embed} />); section = section.substring(`${id} ${type} ${link} ~~~`.length); } if (section !== '') { // eslint-disable-next-line react/no-danger sections.push(<div key={`embed-b-${i}`} dangerouslySetInnerHTML={{ __html: section }} />); } } return sections; } const Body = (props) => { const htmlSections = getHtml(props.body, props.jsonMetadata); return <div className={classNames('Body', { 'Body--full': props.full })}>{htmlSections}</div>; }; Body.propTypes = { body: PropTypes.string, jsonMetadata: PropTypes.string, full: PropTypes.bool, }; Body.defaultProps = { body: '', jsonMetadata: '', full: false, }; export default Body;
src/svg-icons/image/flip.js
spiermar/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageFlip = (props) => ( <SvgIcon {...props}> <path d="M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"/> </SvgIcon> ); ImageFlip = pure(ImageFlip); ImageFlip.displayName = 'ImageFlip'; ImageFlip.muiName = 'SvgIcon'; export default ImageFlip;
src/pages/components/Books/components/Loading.js
H3yfinn/finbarmaunsell.com
import React from 'react' const Loading = () => ( <div className="fullscreen"> <div className="loader" /> </div> ) export default Loading
packages/material-ui-icons/src/LocalPhoneSharp.js
allanalexandre/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><path d="M21 15.46l-5.27-.61-2.52 2.52c-2.83-1.44-5.15-3.75-6.59-6.59l2.53-2.53L8.54 3H3.03C2.45 13.18 10.82 21.55 21 20.97v-5.51z" /></React.Fragment> , 'LocalPhoneSharp');
redux-demo/todos/src/containers/AddTodo.js
zhangjunhd/react-examples
import React from 'react' import { connect } from 'react-redux' import { addTodo } from '../actions' let AddTodo = ({ dispatch }) => { let input return ( <div> <form onSubmit={e => { e.preventDefault() if (!input.value.trim()) { return } dispatch(addTodo(input.value)) input.value = '' }}> <input ref={node => { input = node }} /> <button type="submit"> Add Todo </button> </form> </div> ) } AddTodo = connect()(AddTodo) export default AddTodo
ajax/libs/material-ui/5.0.0-alpha.26/modern/RadioGroup/RadioGroupContext.min.js
cdnjs/cdnjs
import*as React from"react";const RadioGroupContext=React.createContext();"production"!==process.env.NODE_ENV&&(RadioGroupContext.displayName="RadioGroupContext");export default RadioGroupContext;
src/components/Editor/Editor.js
hhj679/mybition-web
import React from 'react' import { Editor } from 'react-draft-wysiwyg' import styles from './Editor.less' import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css' const DraftEditor = (props) => { return (<Editor toolbarClassName={styles.toolbar} wrapperClassName={styles.wrapper} editorClassName={styles.editor} {...props} />) } export default DraftEditor
src/containers/shared-assets/class-selection-wrapper/class-selection-snippet/mobile/create-from-scratch/create-from-scratch.js
vFujin/HearthLounge
import React from 'react'; import PropTypes from 'prop-types'; import ProceedBtn from "./proceed-btn"; import SelectModeWrapper from '../../../selection/select-mode/select-mode-wrapper'; import SelectClassWrapper from '../../../selection/select-class/select-class-wrapper'; const CreateDeckFromScratchMobile = ({stage, handleStageChange}) => { const activeStage = (stage) => { switch(stage) { case 2: return <SelectClassWrapper />; default: return <SelectModeWrapper />; } }; return ( <div className="content active-stage container__selection"> {activeStage(stage)} <div className="buttons"> <ProceedBtn type="backward" stage={stage} handleStageChange={handleStageChange}/> <ProceedBtn type="forward" stage={stage} handleStageChange={handleStageChange}/> </div> </div> ) }; CreateDeckFromScratchMobile.propTypes = { stage: PropTypes.number.isRequired, handleStageChange: PropTypes.func.isRequired }; CreateDeckFromScratchMobile.defaultProps = { stage: 1 }; export default CreateDeckFromScratchMobile;
Skin/index.android.js
beckasaurus/Skin
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; export default class Skin extends Component { render() { return ( <View style={styles.container}> <Text style={styles.welcome}> Welcome to React Native! </Text> <Text style={styles.instructions}> To get started, edit index.android.js </Text> <Text style={styles.instructions}> Double tap R on your keyboard to reload,{'\n'} Shake or press menu button for dev menu </Text> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, }); AppRegistry.registerComponent('Skin', () => Skin);
client/components/app/index.js
wheelcomplex/go-starter-kit
import React, { Component } from 'react'; import Helmet from 'react-helmet'; export default class App extends Component { render() { return <div> <Helmet title='Go + React + Redux = rocks!' /> {this.props.children} </div>; } }
client/src/core-components/toggle-list.js
ivandiazwm/opensupports
import React from 'react'; import _ from 'lodash'; import classNames from 'classnames'; class ToggleList extends React.Component { static propTypes = { items: React.PropTypes.arrayOf(React.PropTypes.shape({ content: React.PropTypes.node })), onChange: React.PropTypes.func, type: React.PropTypes.oneOf(['default', 'small']) }; state = { selected: [] }; render() { return ( <div className={this.getClass()}> {this.props.items.map(this.renderItem.bind(this))} </div> ); } getClass() { let classes = { 'toggle-list': true, 'toggle-list_small': this.props.type == 'small', [this.props.className]: (this.props.className) }; return classNames(classes); } renderItem(obj, index) { return ( <div className={this.getItemClass(index, obj)} onClick={this.selectItem.bind(this, index)} key={index}> {obj.content} </div> ); } getItemClass(index, obj) { let classes = { 'toggle-list__item': true, 'toggle-list__first-item': (index === 0), 'toggle-list__last-item': (index === this.props.items.length - 1), 'toggle-list__selected': _.includes(this.getSelectedList(), index) }; classes[obj.className] = (obj.className); return classNames(classes); } selectItem(index) { let newSelected = _.clone(this.getSelectedList()); _.includes(this.getSelectedList(), index) ? _.remove(newSelected, _index => _index == index) : newSelected.push(index); this.setState({ selected: newSelected }); if (this.props.onChange) { this.props.onChange({ target: { value: newSelected } }); } } getSelectedList() { return (this.props.values === undefined) ? this.state.selected : this.props.values; } } export default ToggleList;
test/connect.spec.js
jordangarcia/nuclear-js-react-addons
import { Reactor, Store } from 'nuclear-js' import expect from 'expect' import React from 'react' import ReactDOM from 'react-dom' import { Provider, connect } from '../src/index' import setup from './setup' function mountTestComponent(reactor, children) { class TestComponent extends React.Component { constructor(props, context) { super(props, context) } render() { return <Provider reactor={reactor}>{children}</Provider> } } ReactDOM.render(<TestComponent />, document.getElementById('test-root')) } describe('connect', () => { setup() let reactor beforeEach(() => { reactor = new Reactor() reactor.registerStores({ store1: Store({ getInitialState: () => 1, initialize() { this.on('increment1', state => state + 1) }, }), store2: Store({ getInitialState: () => 2, initialize() { this.on('increment1', state => state + 1) }, }), }) }) describe('when no mapStateToProps function is passed', () => { it('it should provide reactor as a prop', () => { class Child extends React.Component { constructor(props, context) { super(props, context) } componentDidMount() { expect(this.props.reactor).toEqual(reactor) } render() { return <div></div> } } let ReactoredChild = connect()(Child) mountTestComponent(reactor, <ReactoredChild />) }) }) describe('when a mapStateToProps function is passed', () => { it('should provide initial values based on the state', () => { class Child extends React.Component { constructor(props, context) { super(props, context) } componentDidMount() { expect(this.props.value1).toEqual(1) expect(this.props.value2).toEqual(2) } render() { return <div></div> } } let ReactoredChild = connect(props => ({ value1: ['store1'], value2: ['store2'], }))(Child) mountTestComponent(reactor, <ReactoredChild />) }) it('should subscribe to updates', () => { let renderedValues = [] class Child extends React.Component { constructor(props, context) { super(props, context) } render() { renderedValues.push(this.props.value1) return <div></div> } } let ReactoredChild = connect(props => ({ value1: ['store1'], }))(Child) mountTestComponent(reactor, <ReactoredChild />) expect(renderedValues).toEqual([1]) reactor.dispatch('increment1') expect(renderedValues).toEqual([1, 2]) reactor.dispatch('otherAction') expect(renderedValues).toEqual([1, 2]) }) it('should rebind subscriptions when a prop changes', () => { let renderedValues = [] class Child extends React.Component { constructor(props, context) { super(props, context) } render() { renderedValues.push(this.props.value) return <div></div> } } let ReactoredChild = connect(props => { return { value: [props.propValue], } })(Child) class ResubscribingChild extends ReactoredChild { constructor(props, context) { super(props, context) } componentWillReceiveProps(nextProps) { this.resubscribe(nextProps) } } let setPropValue class TestComponent extends React.Component { state = { propValue: 'store1', } constructor(props, context) { super(props, context) } componentWillMount() { setPropValue = (val) => { this.setState({ propValue: val }) } } render() { return <Provider reactor={reactor}><ResubscribingChild propValue={this.state.propValue} /></Provider> } } ReactDOM.render(<TestComponent />, document.getElementById('test-root')) expect(renderedValues).toEqual([1]) setPropValue('store2') expect(renderedValues).toEqual([1, 2]) reactor.dispatch('increment1') reactor.dispatch('increment2') expect(renderedValues).toEqual([1, 2, 3]) }) }) describe('when used as a decorator', () => { it('it should provide reactor as a prop', () => { @connect() class Child extends React.Component { constructor(props, context) { super(props, context) } componentDidMount() { expect(this.props.reactor).toEqual(reactor) } render() { return <div></div> } } mountTestComponent(reactor, <Child />) }) it('should subscribe to updates', () => { let renderedValues = [] @connect(props => ({ value1: ['store1'], })) class Child extends React.Component { constructor(props, context) { super(props, context) } render() { renderedValues.push(this.props.value1) return <div></div> } } class ResubscribingChild extends Child { constructor(props, state) { super(props, state) } componentWillReceiveProps(nextProps) { this.resubscribe() } } mountTestComponent(reactor, <ResubscribingChild />) expect(renderedValues).toEqual([1]) reactor.dispatch('increment1') expect(renderedValues).toEqual([1, 2]) reactor.dispatch('otherAction') expect(renderedValues).toEqual([1, 2]) }) }) })
src/09-custom-hook/App.js
benmvp/react-workshop
import React from 'react' import useGiphy from './useGiphy' import Results from './Results' import SearchForm from './SearchForm' const App = () => { const [results, setSearchParams] = useGiphy() return ( <main> <h1>Giphy Search!</h1> <SearchForm onChange={setSearchParams} initialSearchQuery="friend" initialLimit={24} /> <Results items={results} /> </main> ) } export default App
examples/real-world/store/configureStore.dev.js
winstonewert/redux-reactions
import { createStore, applyMiddleware, compose } from 'redux' import { reduxReactRouter } from 'redux-router' import DevTools from '../containers/DevTools' import createHistory from 'history/lib/createBrowserHistory' import routes from '../routes' import createLogger from 'redux-logger' import rootReducer from '../reducers' import { startReactions } from '../../../lib' import { reactions, REACTION_TYPES } from '../reactions' const finalCreateStore = compose( reduxReactRouter({ routes, createHistory }), applyMiddleware(createLogger()), DevTools.instrument() )(createStore) export default function configureStore(initialState) { const store = finalCreateStore(rootReducer, initialState) if (module.hot) { // Enable Webpack hot module replacement for reducers module.hot.accept('../reducers', () => { const nextRootReducer = require('../reducers') store.replaceReducer(nextRootReducer) }) } startReactions(store, reactions, REACTION_TYPES) return store }
src/svg-icons/av/music-video.js
IsenrichO/mui-with-arrows
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvMusicVideo = (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-2zm0 16H3V5h18v14zM8 15c0-1.66 1.34-3 3-3 .35 0 .69.07 1 .18V6h5v2h-3v7.03c-.02 1.64-1.35 2.97-3 2.97-1.66 0-3-1.34-3-3z"/> </SvgIcon> ); AvMusicVideo = pure(AvMusicVideo); AvMusicVideo.displayName = 'AvMusicVideo'; AvMusicVideo.muiName = 'SvgIcon'; export default AvMusicVideo;
ajax/libs/remoteStorage/0.11.0/remotestorage.js
kennynaoh/cdnjs
/** remotestorage.js 0.11.0, http://remotestorage.io, MIT-licensed **/ /** FILE: lib/bluebird.js **/ /** * bluebird build version 2.3.4 * Features enabled: core, nodeify * Features disabled: race, call_get, generators, map, promisify, props, reduce, settle, some, progress, cancel, using, filter, any, each, timers */ /** * @preserve Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; var schedule = _dereq_("./schedule.js"); var Queue = _dereq_("./queue.js"); var errorObj = _dereq_("./util.js").errorObj; var tryCatch1 = _dereq_("./util.js").tryCatch1; var _process = typeof process !== "undefined" ? process : void 0; function Async() { this._isTickUsed = false; this._schedule = schedule; this._length = 0; this._lateBuffer = new Queue(16); this._functionBuffer = new Queue(65536); var self = this; this.consumeFunctionBuffer = function Async$consumeFunctionBuffer() { self._consumeFunctionBuffer(); }; } Async.prototype.haveItemsQueued = function Async$haveItemsQueued() { return this._length > 0; }; Async.prototype.invokeLater = function Async$invokeLater(fn, receiver, arg) { if (_process !== void 0 && _process.domain != null && !fn.domain) { fn = _process.domain.bind(fn); } this._lateBuffer.push(fn, receiver, arg); this._queueTick(); }; Async.prototype.invoke = function Async$invoke(fn, receiver, arg) { if (_process !== void 0 && _process.domain != null && !fn.domain) { fn = _process.domain.bind(fn); } var functionBuffer = this._functionBuffer; functionBuffer.push(fn, receiver, arg); this._length = functionBuffer.length(); this._queueTick(); }; Async.prototype._consumeFunctionBuffer = function Async$_consumeFunctionBuffer() { var functionBuffer = this._functionBuffer; while (functionBuffer.length() > 0) { var fn = functionBuffer.shift(); var receiver = functionBuffer.shift(); var arg = functionBuffer.shift(); fn.call(receiver, arg); } this._reset(); this._consumeLateBuffer(); }; Async.prototype._consumeLateBuffer = function Async$_consumeLateBuffer() { var buffer = this._lateBuffer; while(buffer.length() > 0) { var fn = buffer.shift(); var receiver = buffer.shift(); var arg = buffer.shift(); var res = tryCatch1(fn, receiver, arg); if (res === errorObj) { this._queueTick(); if (fn.domain != null) { fn.domain.emit("error", res.e); } else { throw res.e; } } } }; Async.prototype._queueTick = function Async$_queue() { if (!this._isTickUsed) { this._schedule(this.consumeFunctionBuffer); this._isTickUsed = true; } }; Async.prototype._reset = function Async$_reset() { this._isTickUsed = false; this._length = 0; }; module.exports = new Async(); },{"./queue.js":15,"./schedule.js":16,"./util.js":19}],2:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; var Promise = _dereq_("./promise.js")(); module.exports = Promise; },{"./promise.js":12}],3:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function() { var inherits = _dereq_("./util.js").inherits; var defineProperty = _dereq_("./es5.js").defineProperty; var rignore = new RegExp( "\\b(?:[a-zA-Z0-9.]+\\$_\\w+|" + "tryCatch(?:1|2|3|4|Apply)|new \\w*PromiseArray|" + "\\w*PromiseArray\\.\\w*PromiseArray|" + "setTimeout|CatchFilter\\$_\\w+|makeNodePromisified|processImmediate|" + "process._tickCallback|nextTick|Async\\$\\w+)\\b" ); var rtraceline = null; var formatStack = null; function formatNonError(obj) { var str; if (typeof obj === "function") { str = "[function " + (obj.name || "anonymous") + "]"; } else { str = obj.toString(); var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; if (ruselessToString.test(str)) { try { var newStr = JSON.stringify(obj); str = newStr; } catch(e) { } } if (str.length === 0) { str = "(empty array)"; } } return ("(<" + snip(str) + ">, no stack trace)"); } function snip(str) { var maxChars = 41; if (str.length < maxChars) { return str; } return str.substr(0, maxChars - 3) + "..."; } function CapturedTrace(ignoreUntil, isTopLevel) { this.captureStackTrace(CapturedTrace, isTopLevel); } inherits(CapturedTrace, Error); CapturedTrace.prototype.captureStackTrace = function CapturedTrace$captureStackTrace(ignoreUntil, isTopLevel) { captureStackTrace(this, ignoreUntil, isTopLevel); }; CapturedTrace.possiblyUnhandledRejection = function CapturedTrace$PossiblyUnhandledRejection(reason) { if (typeof console === "object") { var message; if (typeof reason === "object" || typeof reason === "function") { var stack = reason.stack; message = "Possibly unhandled " + formatStack(stack, reason); } else { message = "Possibly unhandled " + String(reason); } if (typeof console.error === "function" || typeof console.error === "object") { console.error(message); } else if (typeof console.log === "function" || typeof console.log === "object") { console.log(message); } } }; CapturedTrace.combine = function CapturedTrace$Combine(current, prev) { var curLast = current.length - 1; for (var i = prev.length - 1; i >= 0; --i) { var line = prev[i]; if (current[curLast] === line) { current.pop(); curLast--; } else { break; } } current.push("From previous event:"); var lines = current.concat(prev); var ret = []; for (var i = 0, len = lines.length; i < len; ++i) { if (((rignore.test(lines[i]) && rtraceline.test(lines[i])) || (i > 0 && !rtraceline.test(lines[i])) && lines[i] !== "From previous event:") ) { continue; } ret.push(lines[i]); } return ret; }; CapturedTrace.protectErrorMessageNewlines = function(stack) { for (var i = 0; i < stack.length; ++i) { if (rtraceline.test(stack[i])) { break; } } if (i <= 1) return; var errorMessageLines = []; for (var j = 0; j < i; ++j) { errorMessageLines.push(stack.shift()); } stack.unshift(errorMessageLines.join("\u0002\u0000\u0001")); }; CapturedTrace.isSupported = function CapturedTrace$IsSupported() { return typeof captureStackTrace === "function"; }; var captureStackTrace = (function stackDetection() { if (typeof Error.stackTraceLimit === "number" && typeof Error.captureStackTrace === "function") { rtraceline = /^\s*at\s*/; formatStack = function(stack, error) { if (typeof stack === "string") return stack; if (error.name !== void 0 && error.message !== void 0) { return error.name + ". " + error.message; } return formatNonError(error); }; var captureStackTrace = Error.captureStackTrace; return function CapturedTrace$_captureStackTrace( receiver, ignoreUntil) { captureStackTrace(receiver, ignoreUntil); }; } var err = new Error(); if (typeof err.stack === "string" && typeof "".startsWith === "function" && (err.stack.startsWith("stackDetection@")) && stackDetection.name === "stackDetection") { defineProperty(Error, "stackTraceLimit", { writable: true, enumerable: false, configurable: false, value: 25 }); rtraceline = /@/; var rline = /[@\n]/; formatStack = function(stack, error) { if (typeof stack === "string") { return (error.name + ". " + error.message + "\n" + stack); } if (error.name !== void 0 && error.message !== void 0) { return error.name + ". " + error.message; } return formatNonError(error); }; return function captureStackTrace(o) { var stack = new Error().stack; var split = stack.split(rline); var len = split.length; var ret = ""; for (var i = 0; i < len; i += 2) { ret += split[i]; ret += "@"; ret += split[i + 1]; ret += "\n"; } o.stack = ret; }; } else { formatStack = function(stack, error) { if (typeof stack === "string") return stack; if ((typeof error === "object" || typeof error === "function") && error.name !== void 0 && error.message !== void 0) { return error.name + ". " + error.message; } return formatNonError(error); }; return null; } })(); return CapturedTrace; }; },{"./es5.js":8,"./util.js":19}],4:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function(NEXT_FILTER) { var util = _dereq_("./util.js"); var errors = _dereq_("./errors.js"); var tryCatch1 = util.tryCatch1; var errorObj = util.errorObj; var keys = _dereq_("./es5.js").keys; var TypeError = errors.TypeError; function CatchFilter(instances, callback, promise) { this._instances = instances; this._callback = callback; this._promise = promise; } function CatchFilter$_safePredicate(predicate, e) { var safeObject = {}; var retfilter = tryCatch1(predicate, safeObject, e); if (retfilter === errorObj) return retfilter; var safeKeys = keys(safeObject); if (safeKeys.length) { errorObj.e = new TypeError( "Catch filter must inherit from Error " + "or be a simple predicate function"); return errorObj; } return retfilter; } CatchFilter.prototype.doFilter = function CatchFilter$_doFilter(e) { var cb = this._callback; var promise = this._promise; var boundTo = promise._boundTo; for (var i = 0, len = this._instances.length; i < len; ++i) { var item = this._instances[i]; var itemIsErrorType = item === Error || (item != null && item.prototype instanceof Error); if (itemIsErrorType && e instanceof item) { var ret = tryCatch1(cb, boundTo, e); if (ret === errorObj) { NEXT_FILTER.e = ret.e; return NEXT_FILTER; } return ret; } else if (typeof item === "function" && !itemIsErrorType) { var shouldHandle = CatchFilter$_safePredicate(item, e); if (shouldHandle === errorObj) { var trace = errors.canAttach(errorObj.e) ? errorObj.e : new Error(errorObj.e + ""); this._promise._attachExtraTrace(trace); e = errorObj.e; break; } else if (shouldHandle) { var ret = tryCatch1(cb, boundTo, e); if (ret === errorObj) { NEXT_FILTER.e = ret.e; return NEXT_FILTER; } return ret; } } } NEXT_FILTER.e = e; return NEXT_FILTER; }; return CatchFilter; }; },{"./errors.js":6,"./es5.js":8,"./util.js":19}],5:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; var util = _dereq_("./util.js"); var isPrimitive = util.isPrimitive; var wrapsPrimitiveReceiver = util.wrapsPrimitiveReceiver; module.exports = function(Promise) { var returner = function Promise$_returner() { return this; }; var thrower = function Promise$_thrower() { throw this; }; var wrapper = function Promise$_wrapper(value, action) { if (action === 1) { return function Promise$_thrower() { throw value; }; } else if (action === 2) { return function Promise$_returner() { return value; }; } }; Promise.prototype["return"] = Promise.prototype.thenReturn = function Promise$thenReturn(value) { if (wrapsPrimitiveReceiver && isPrimitive(value)) { return this._then( wrapper(value, 2), void 0, void 0, void 0, void 0 ); } return this._then(returner, void 0, void 0, value, void 0); }; Promise.prototype["throw"] = Promise.prototype.thenThrow = function Promise$thenThrow(reason) { if (wrapsPrimitiveReceiver && isPrimitive(reason)) { return this._then( wrapper(reason, 1), void 0, void 0, void 0, void 0 ); } return this._then(thrower, void 0, void 0, reason, void 0); }; }; },{"./util.js":19}],6:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; var Objectfreeze = _dereq_("./es5.js").freeze; var util = _dereq_("./util.js"); var inherits = util.inherits; var notEnumerableProp = util.notEnumerableProp; function markAsOriginatingFromRejection(e) { try { notEnumerableProp(e, "isOperational", true); } catch(ignore) {} } function originatesFromRejection(e) { if (e == null) return false; return ((e instanceof OperationalError) || e["isOperational"] === true); } function isError(obj) { return obj instanceof Error; } function canAttach(obj) { return isError(obj); } function subError(nameProperty, defaultMessage) { function SubError(message) { if (!(this instanceof SubError)) return new SubError(message); this.message = typeof message === "string" ? message : defaultMessage; this.name = nameProperty; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } inherits(SubError, Error); return SubError; } var _TypeError, _RangeError; var CancellationError = subError("CancellationError", "cancellation error"); var TimeoutError = subError("TimeoutError", "timeout error"); var AggregateError = subError("AggregateError", "aggregate error"); try { _TypeError = TypeError; _RangeError = RangeError; } catch(e) { _TypeError = subError("TypeError", "type error"); _RangeError = subError("RangeError", "range error"); } var methods = ("join pop push shift unshift slice filter forEach some " + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); for (var i = 0; i < methods.length; ++i) { if (typeof Array.prototype[methods[i]] === "function") { AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; } } AggregateError.prototype.length = 0; AggregateError.prototype["isOperational"] = true; var level = 0; AggregateError.prototype.toString = function() { var indent = Array(level * 4 + 1).join(" "); var ret = "\n" + indent + "AggregateError of:" + "\n"; level++; indent = Array(level * 4 + 1).join(" "); for (var i = 0; i < this.length; ++i) { var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; var lines = str.split("\n"); for (var j = 0; j < lines.length; ++j) { lines[j] = indent + lines[j]; } str = lines.join("\n"); ret += str + "\n"; } level--; return ret; }; function OperationalError(message) { this.name = "OperationalError"; this.message = message; this.cause = message; this["isOperational"] = true; if (message instanceof Error) { this.message = message.message; this.stack = message.stack; } else if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } inherits(OperationalError, Error); var key = "__BluebirdErrorTypes__"; var errorTypes = Error[key]; if (!errorTypes) { errorTypes = Objectfreeze({ CancellationError: CancellationError, TimeoutError: TimeoutError, OperationalError: OperationalError, RejectionError: OperationalError, AggregateError: AggregateError }); notEnumerableProp(Error, key, errorTypes); } module.exports = { Error: Error, TypeError: _TypeError, RangeError: _RangeError, CancellationError: errorTypes.CancellationError, OperationalError: errorTypes.OperationalError, TimeoutError: errorTypes.TimeoutError, AggregateError: errorTypes.AggregateError, originatesFromRejection: originatesFromRejection, markAsOriginatingFromRejection: markAsOriginatingFromRejection, canAttach: canAttach }; },{"./es5.js":8,"./util.js":19}],7:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function(Promise) { var TypeError = _dereq_('./errors.js').TypeError; function apiRejection(msg) { var error = new TypeError(msg); var ret = Promise.rejected(error); var parent = ret._peekContext(); if (parent != null) { parent._attachExtraTrace(error); } return ret; } return apiRejection; }; },{"./errors.js":6}],8:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ var isES5 = (function(){ "use strict"; return this === void 0; })(); if (isES5) { module.exports = { freeze: Object.freeze, defineProperty: Object.defineProperty, keys: Object.keys, getPrototypeOf: Object.getPrototypeOf, isArray: Array.isArray, isES5: isES5 }; } else { var has = {}.hasOwnProperty; var str = {}.toString; var proto = {}.constructor.prototype; var ObjectKeys = function ObjectKeys(o) { var ret = []; for (var key in o) { if (has.call(o, key)) { ret.push(key); } } return ret; } var ObjectDefineProperty = function ObjectDefineProperty(o, key, desc) { o[key] = desc.value; return o; } var ObjectFreeze = function ObjectFreeze(obj) { return obj; } var ObjectGetPrototypeOf = function ObjectGetPrototypeOf(obj) { try { return Object(obj).constructor.prototype; } catch (e) { return proto; } } var ArrayIsArray = function ArrayIsArray(obj) { try { return str.call(obj) === "[object Array]"; } catch(e) { return false; } } module.exports = { isArray: ArrayIsArray, keys: ObjectKeys, defineProperty: ObjectDefineProperty, freeze: ObjectFreeze, getPrototypeOf: ObjectGetPrototypeOf, isES5: isES5 }; } },{}],9:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function(Promise, NEXT_FILTER, cast) { var util = _dereq_("./util.js"); var wrapsPrimitiveReceiver = util.wrapsPrimitiveReceiver; var isPrimitive = util.isPrimitive; var thrower = util.thrower; function returnThis() { return this; } function throwThis() { throw this; } function return$(r) { return function Promise$_returner() { return r; }; } function throw$(r) { return function Promise$_thrower() { throw r; }; } function promisedFinally(ret, reasonOrValue, isFulfilled) { var then; if (wrapsPrimitiveReceiver && isPrimitive(reasonOrValue)) { then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue); } else { then = isFulfilled ? returnThis : throwThis; } return ret._then(then, thrower, void 0, reasonOrValue, void 0); } function finallyHandler(reasonOrValue) { var promise = this.promise; var handler = this.handler; var ret = promise._isBound() ? handler.call(promise._boundTo) : handler(); if (ret !== void 0) { var maybePromise = cast(ret, void 0); if (maybePromise instanceof Promise) { return promisedFinally(maybePromise, reasonOrValue, promise.isFulfilled()); } } if (promise.isRejected()) { NEXT_FILTER.e = reasonOrValue; return NEXT_FILTER; } else { return reasonOrValue; } } function tapHandler(value) { var promise = this.promise; var handler = this.handler; var ret = promise._isBound() ? handler.call(promise._boundTo, value) : handler(value); if (ret !== void 0) { var maybePromise = cast(ret, void 0); if (maybePromise instanceof Promise) { return promisedFinally(maybePromise, value, true); } } return value; } Promise.prototype._passThroughHandler = function Promise$_passThroughHandler(handler, isFinally) { if (typeof handler !== "function") return this.then(); var promiseAndHandler = { promise: this, handler: handler }; return this._then( isFinally ? finallyHandler : tapHandler, isFinally ? finallyHandler : void 0, void 0, promiseAndHandler, void 0); }; Promise.prototype.lastly = Promise.prototype["finally"] = function Promise$finally(handler) { return this._passThroughHandler(handler, true); }; Promise.prototype.tap = function Promise$tap(handler) { return this._passThroughHandler(handler, false); }; }; },{"./util.js":19}],10:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function(Promise, PromiseArray, cast, INTERNAL) { var util = _dereq_("./util.js"); var canEvaluate = util.canEvaluate; var tryCatch1 = util.tryCatch1; var errorObj = util.errorObj; if (canEvaluate) { var thenCallback = function(i) { return new Function("value", "holder", " \n\ 'use strict'; \n\ holder.pIndex = value; \n\ holder.checkFulfillment(this); \n\ ".replace(/Index/g, i)); }; var caller = function(count) { var values = []; for (var i = 1; i <= count; ++i) values.push("holder.p" + i); return new Function("holder", " \n\ 'use strict'; \n\ var callback = holder.fn; \n\ return callback(values); \n\ ".replace(/values/g, values.join(", "))); }; var thenCallbacks = []; var callers = [void 0]; for (var i = 1; i <= 5; ++i) { thenCallbacks.push(thenCallback(i)); callers.push(caller(i)); } var Holder = function(total, fn) { this.p1 = this.p2 = this.p3 = this.p4 = this.p5 = null; this.fn = fn; this.total = total; this.now = 0; }; Holder.prototype.callers = callers; Holder.prototype.checkFulfillment = function(promise) { var now = this.now; now++; var total = this.total; if (now >= total) { var handler = this.callers[total]; var ret = tryCatch1(handler, void 0, this); if (ret === errorObj) { promise._rejectUnchecked(ret.e); } else if (!promise._tryFollow(ret)) { promise._fulfillUnchecked(ret); } } else { this.now = now; } }; } Promise.join = function Promise$Join() { var last = arguments.length - 1; var fn; if (last > 0 && typeof arguments[last] === "function") { fn = arguments[last]; if (last < 6 && canEvaluate) { var ret = new Promise(INTERNAL); ret._setTrace(void 0); var holder = new Holder(last, fn); var reject = ret._reject; var callbacks = thenCallbacks; for (var i = 0; i < last; ++i) { var maybePromise = cast(arguments[i], void 0); if (maybePromise instanceof Promise) { if (maybePromise.isPending()) { maybePromise._then(callbacks[i], reject, void 0, ret, holder); } else if (maybePromise.isFulfilled()) { callbacks[i].call(ret, maybePromise._settledValue, holder); } else { ret._reject(maybePromise._settledValue); maybePromise._unsetRejectionIsUnhandled(); } } else { callbacks[i].call(ret, maybePromise, holder); } } return ret; } } var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];} var ret = new PromiseArray(args).promise(); return fn !== void 0 ? ret.spread(fn) : ret; }; }; },{"./util.js":19}],11:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function(Promise) { var util = _dereq_("./util.js"); var async = _dereq_("./async.js"); var tryCatch2 = util.tryCatch2; var tryCatch1 = util.tryCatch1; var errorObj = util.errorObj; function thrower(r) { throw r; } function Promise$_spreadAdapter(val, receiver) { if (!util.isArray(val)) return Promise$_successAdapter(val, receiver); var ret = util.tryCatchApply(this, [null].concat(val), receiver); if (ret === errorObj) { async.invokeLater(thrower, void 0, ret.e); } } function Promise$_successAdapter(val, receiver) { var nodeback = this; var ret = val === void 0 ? tryCatch1(nodeback, receiver, null) : tryCatch2(nodeback, receiver, null, val); if (ret === errorObj) { async.invokeLater(thrower, void 0, ret.e); } } function Promise$_errorAdapter(reason, receiver) { var nodeback = this; var ret = tryCatch1(nodeback, receiver, reason); if (ret === errorObj) { async.invokeLater(thrower, void 0, ret.e); } } Promise.prototype.nodeify = function Promise$nodeify(nodeback, options) { if (typeof nodeback == "function") { var adapter = Promise$_successAdapter; if (options !== void 0 && Object(options).spread) { adapter = Promise$_spreadAdapter; } this._then( adapter, Promise$_errorAdapter, void 0, nodeback, this._boundTo ); } return this; }; }; },{"./async.js":1,"./util.js":19}],12:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; var old; if (typeof Promise !== "undefined") old = Promise; function noConflict(bluebird) { try { if (Promise === bluebird) Promise = old; } catch (e) {} return bluebird; } module.exports = function() { var util = _dereq_("./util.js"); var async = _dereq_("./async.js"); var errors = _dereq_("./errors.js"); var INTERNAL = function(){}; var APPLY = {}; var NEXT_FILTER = {e: null}; var cast = _dereq_("./thenables.js")(Promise, INTERNAL); var PromiseArray = _dereq_("./promise_array.js")(Promise, INTERNAL, cast); var CapturedTrace = _dereq_("./captured_trace.js")(); var CatchFilter = _dereq_("./catch_filter.js")(NEXT_FILTER); var PromiseResolver = _dereq_("./promise_resolver.js"); var isArray = util.isArray; var errorObj = util.errorObj; var tryCatch1 = util.tryCatch1; var tryCatch2 = util.tryCatch2; var tryCatchApply = util.tryCatchApply; var RangeError = errors.RangeError; var TypeError = errors.TypeError; var CancellationError = errors.CancellationError; var TimeoutError = errors.TimeoutError; var OperationalError = errors.OperationalError; var originatesFromRejection = errors.originatesFromRejection; var markAsOriginatingFromRejection = errors.markAsOriginatingFromRejection; var canAttach = errors.canAttach; var thrower = util.thrower; var apiRejection = _dereq_("./errors_api_rejection")(Promise); var makeSelfResolutionError = function Promise$_makeSelfResolutionError() { return new TypeError("circular promise resolution chain"); }; function Promise(resolver) { if (typeof resolver !== "function") { throw new TypeError("the promise constructor requires a resolver function"); } if (this.constructor !== Promise) { throw new TypeError("the promise constructor cannot be invoked directly"); } this._bitField = 0; this._fulfillmentHandler0 = void 0; this._rejectionHandler0 = void 0; this._promise0 = void 0; this._receiver0 = void 0; this._settledValue = void 0; this._boundTo = void 0; if (resolver !== INTERNAL) this._resolveFromResolver(resolver); } function returnFirstElement(elements) { return elements[0]; } Promise.prototype.bind = function Promise$bind(thisArg) { var maybePromise = cast(thisArg, void 0); var ret = new Promise(INTERNAL); if (maybePromise instanceof Promise) { var binder = maybePromise.then(function(thisArg) { ret._setBoundTo(thisArg); }); var p = Promise.all([this, binder]).then(returnFirstElement); ret._follow(p); } else { ret._follow(this); ret._setBoundTo(thisArg); } ret._propagateFrom(this, 2 | 1); return ret; }; Promise.prototype.toString = function Promise$toString() { return "[object Promise]"; }; Promise.prototype.caught = Promise.prototype["catch"] = function Promise$catch(fn) { var len = arguments.length; if (len > 1) { var catchInstances = new Array(len - 1), j = 0, i; for (i = 0; i < len - 1; ++i) { var item = arguments[i]; if (typeof item === "function") { catchInstances[j++] = item; } else { var catchFilterTypeError = new TypeError( "A catch filter must be an error constructor " + "or a filter function"); this._attachExtraTrace(catchFilterTypeError); return Promise.reject(catchFilterTypeError); } } catchInstances.length = j; fn = arguments[i]; this._resetTrace(); var catchFilter = new CatchFilter(catchInstances, fn, this); return this._then(void 0, catchFilter.doFilter, void 0, catchFilter, void 0); } return this._then(void 0, fn, void 0, void 0, void 0); }; Promise.prototype.then = function Promise$then(didFulfill, didReject, didProgress) { return this._then(didFulfill, didReject, didProgress, void 0, void 0); }; Promise.prototype.done = function Promise$done(didFulfill, didReject, didProgress) { var promise = this._then(didFulfill, didReject, didProgress, void 0, void 0); promise._setIsFinal(); }; Promise.prototype.spread = function Promise$spread(didFulfill, didReject) { return this._then(didFulfill, didReject, void 0, APPLY, void 0); }; Promise.prototype.isCancellable = function Promise$isCancellable() { return !this.isResolved() && this._cancellable(); }; Promise.prototype.toJSON = function Promise$toJSON() { var ret = { isFulfilled: false, isRejected: false, fulfillmentValue: void 0, rejectionReason: void 0 }; if (this.isFulfilled()) { ret.fulfillmentValue = this._settledValue; ret.isFulfilled = true; } else if (this.isRejected()) { ret.rejectionReason = this._settledValue; ret.isRejected = true; } return ret; }; Promise.prototype.all = function Promise$all() { return new PromiseArray(this).promise(); }; Promise.is = function Promise$Is(val) { return val instanceof Promise; }; Promise.all = function Promise$All(promises) { return new PromiseArray(promises).promise(); }; Promise.prototype.error = function Promise$_error(fn) { return this.caught(originatesFromRejection, fn); }; Promise.prototype._resolveFromSyncValue = function Promise$_resolveFromSyncValue(value) { if (value === errorObj) { this._cleanValues(); this._setRejected(); this._settledValue = value.e; this._ensurePossibleRejectionHandled(); } else { var maybePromise = cast(value, void 0); if (maybePromise instanceof Promise) { this._follow(maybePromise); } else { this._cleanValues(); this._setFulfilled(); this._settledValue = value; } } }; Promise.method = function Promise$_Method(fn) { if (typeof fn !== "function") { throw new TypeError("fn must be a function"); } return function Promise$_method() { var value; switch(arguments.length) { case 0: value = tryCatch1(fn, this, void 0); break; case 1: value = tryCatch1(fn, this, arguments[0]); break; case 2: value = tryCatch2(fn, this, arguments[0], arguments[1]); break; default: var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];} value = tryCatchApply(fn, args, this); break; } var ret = new Promise(INTERNAL); ret._setTrace(void 0); ret._resolveFromSyncValue(value); return ret; }; }; Promise.attempt = Promise["try"] = function Promise$_Try(fn, args, ctx) { if (typeof fn !== "function") { return apiRejection("fn must be a function"); } var value = isArray(args) ? tryCatchApply(fn, args, ctx) : tryCatch1(fn, ctx, args); var ret = new Promise(INTERNAL); ret._setTrace(void 0); ret._resolveFromSyncValue(value); return ret; }; Promise.defer = Promise.pending = function Promise$Defer() { var promise = new Promise(INTERNAL); promise._setTrace(void 0); return new PromiseResolver(promise); }; Promise.bind = function Promise$Bind(thisArg) { var maybePromise = cast(thisArg, void 0); var ret = new Promise(INTERNAL); ret._setTrace(void 0); if (maybePromise instanceof Promise) { var p = maybePromise.then(function(thisArg) { ret._setBoundTo(thisArg); }); ret._follow(p); } else { ret._setBoundTo(thisArg); ret._setFulfilled(); } return ret; }; Promise.cast = function Promise$_Cast(obj) { var ret = cast(obj, void 0); if (!(ret instanceof Promise)) { var val = ret; ret = new Promise(INTERNAL); ret._setTrace(void 0); ret._setFulfilled(); ret._cleanValues(); ret._settledValue = val; } return ret; }; Promise.resolve = Promise.fulfilled = Promise.cast; Promise.reject = Promise.rejected = function Promise$Reject(reason) { var ret = new Promise(INTERNAL); ret._setTrace(void 0); markAsOriginatingFromRejection(reason); ret._cleanValues(); ret._setRejected(); ret._settledValue = reason; if (!canAttach(reason)) { var trace = new Error(reason + ""); ret._setCarriedStackTrace(trace); } ret._ensurePossibleRejectionHandled(); return ret; }; Promise.onPossiblyUnhandledRejection = function Promise$OnPossiblyUnhandledRejection(fn) { CapturedTrace.possiblyUnhandledRejection = typeof fn === "function" ? fn : void 0; }; var unhandledRejectionHandled; Promise.onUnhandledRejectionHandled = function Promise$onUnhandledRejectionHandled(fn) { unhandledRejectionHandled = typeof fn === "function" ? fn : void 0; }; var debugging = false || !!( typeof process !== "undefined" && typeof process.execPath === "string" && typeof process.env === "object" && (process.env["BLUEBIRD_DEBUG"] || process.env["NODE_ENV"] === "development") ); Promise.longStackTraces = function Promise$LongStackTraces() { if (async.haveItemsQueued() && debugging === false ) { throw new Error("cannot enable long stack traces after promises have been created"); } debugging = CapturedTrace.isSupported(); }; Promise.hasLongStackTraces = function Promise$HasLongStackTraces() { return debugging && CapturedTrace.isSupported(); }; Promise.prototype._then = function Promise$_then( didFulfill, didReject, didProgress, receiver, internalData ) { var haveInternalData = internalData !== void 0; var ret = haveInternalData ? internalData : new Promise(INTERNAL); if (!haveInternalData) { if (debugging) { var haveSameContext = this._peekContext() === this._traceParent; ret._traceParent = haveSameContext ? this._traceParent : this; } ret._propagateFrom(this, 7); } var callbackIndex = this._addCallbacks(didFulfill, didReject, didProgress, ret, receiver); if (this.isResolved()) { async.invoke(this._queueSettleAt, this, callbackIndex); } return ret; }; Promise.prototype._length = function Promise$_length() { return this._bitField & 262143; }; Promise.prototype._isFollowingOrFulfilledOrRejected = function Promise$_isFollowingOrFulfilledOrRejected() { return (this._bitField & 939524096) > 0; }; Promise.prototype._isFollowing = function Promise$_isFollowing() { return (this._bitField & 536870912) === 536870912; }; Promise.prototype._setLength = function Promise$_setLength(len) { this._bitField = (this._bitField & -262144) | (len & 262143); }; Promise.prototype._setFulfilled = function Promise$_setFulfilled() { this._bitField = this._bitField | 268435456; }; Promise.prototype._setRejected = function Promise$_setRejected() { this._bitField = this._bitField | 134217728; }; Promise.prototype._setFollowing = function Promise$_setFollowing() { this._bitField = this._bitField | 536870912; }; Promise.prototype._setIsFinal = function Promise$_setIsFinal() { this._bitField = this._bitField | 33554432; }; Promise.prototype._isFinal = function Promise$_isFinal() { return (this._bitField & 33554432) > 0; }; Promise.prototype._cancellable = function Promise$_cancellable() { return (this._bitField & 67108864) > 0; }; Promise.prototype._setCancellable = function Promise$_setCancellable() { this._bitField = this._bitField | 67108864; }; Promise.prototype._unsetCancellable = function Promise$_unsetCancellable() { this._bitField = this._bitField & (~67108864); }; Promise.prototype._setRejectionIsUnhandled = function Promise$_setRejectionIsUnhandled() { this._bitField = this._bitField | 2097152; }; Promise.prototype._unsetRejectionIsUnhandled = function Promise$_unsetRejectionIsUnhandled() { this._bitField = this._bitField & (~2097152); if (this._isUnhandledRejectionNotified()) { this._unsetUnhandledRejectionIsNotified(); this._notifyUnhandledRejectionIsHandled(); } }; Promise.prototype._isRejectionUnhandled = function Promise$_isRejectionUnhandled() { return (this._bitField & 2097152) > 0; }; Promise.prototype._setUnhandledRejectionIsNotified = function Promise$_setUnhandledRejectionIsNotified() { this._bitField = this._bitField | 524288; }; Promise.prototype._unsetUnhandledRejectionIsNotified = function Promise$_unsetUnhandledRejectionIsNotified() { this._bitField = this._bitField & (~524288); }; Promise.prototype._isUnhandledRejectionNotified = function Promise$_isUnhandledRejectionNotified() { return (this._bitField & 524288) > 0; }; Promise.prototype._setCarriedStackTrace = function Promise$_setCarriedStackTrace(capturedTrace) { this._bitField = this._bitField | 1048576; this._fulfillmentHandler0 = capturedTrace; }; Promise.prototype._unsetCarriedStackTrace = function Promise$_unsetCarriedStackTrace() { this._bitField = this._bitField & (~1048576); this._fulfillmentHandler0 = void 0; }; Promise.prototype._isCarryingStackTrace = function Promise$_isCarryingStackTrace() { return (this._bitField & 1048576) > 0; }; Promise.prototype._getCarriedStackTrace = function Promise$_getCarriedStackTrace() { return this._isCarryingStackTrace() ? this._fulfillmentHandler0 : void 0; }; Promise.prototype._receiverAt = function Promise$_receiverAt(index) { var ret = index === 0 ? this._receiver0 : this[(index << 2) + index - 5 + 4]; if (this._isBound() && ret === void 0) { return this._boundTo; } return ret; }; Promise.prototype._promiseAt = function Promise$_promiseAt(index) { return index === 0 ? this._promise0 : this[(index << 2) + index - 5 + 3]; }; Promise.prototype._fulfillmentHandlerAt = function Promise$_fulfillmentHandlerAt(index) { return index === 0 ? this._fulfillmentHandler0 : this[(index << 2) + index - 5 + 0]; }; Promise.prototype._rejectionHandlerAt = function Promise$_rejectionHandlerAt(index) { return index === 0 ? this._rejectionHandler0 : this[(index << 2) + index - 5 + 1]; }; Promise.prototype._addCallbacks = function Promise$_addCallbacks( fulfill, reject, progress, promise, receiver ) { var index = this._length(); if (index >= 262143 - 5) { index = 0; this._setLength(0); } if (index === 0) { this._promise0 = promise; if (receiver !== void 0) this._receiver0 = receiver; if (typeof fulfill === "function" && !this._isCarryingStackTrace()) this._fulfillmentHandler0 = fulfill; if (typeof reject === "function") this._rejectionHandler0 = reject; if (typeof progress === "function") this._progressHandler0 = progress; } else { var base = (index << 2) + index - 5; this[base + 3] = promise; this[base + 4] = receiver; this[base + 0] = typeof fulfill === "function" ? fulfill : void 0; this[base + 1] = typeof reject === "function" ? reject : void 0; this[base + 2] = typeof progress === "function" ? progress : void 0; } this._setLength(index + 1); return index; }; Promise.prototype._setProxyHandlers = function Promise$_setProxyHandlers(receiver, promiseSlotValue) { var index = this._length(); if (index >= 262143 - 5) { index = 0; this._setLength(0); } if (index === 0) { this._promise0 = promiseSlotValue; this._receiver0 = receiver; } else { var base = (index << 2) + index - 5; this[base + 3] = promiseSlotValue; this[base + 4] = receiver; this[base + 0] = this[base + 1] = this[base + 2] = void 0; } this._setLength(index + 1); }; Promise.prototype._proxyPromiseArray = function Promise$_proxyPromiseArray(promiseArray, index) { this._setProxyHandlers(promiseArray, index); }; Promise.prototype._proxyPromise = function Promise$_proxyPromise(promise) { promise._setProxied(); this._setProxyHandlers(promise, -15); }; Promise.prototype._setBoundTo = function Promise$_setBoundTo(obj) { if (obj !== void 0) { this._bitField = this._bitField | 8388608; this._boundTo = obj; } else { this._bitField = this._bitField & (~8388608); } }; Promise.prototype._isBound = function Promise$_isBound() { return (this._bitField & 8388608) === 8388608; }; Promise.prototype._resolveFromResolver = function Promise$_resolveFromResolver(resolver) { var promise = this; this._setTrace(void 0); this._pushContext(); function Promise$_resolver(val) { if (promise._tryFollow(val)) { return; } promise._fulfill(val); } function Promise$_rejecter(val) { var trace = canAttach(val) ? val : new Error(val + ""); promise._attachExtraTrace(trace); markAsOriginatingFromRejection(val); promise._reject(val, trace === val ? void 0 : trace); } var r = tryCatch2(resolver, void 0, Promise$_resolver, Promise$_rejecter); this._popContext(); if (r !== void 0 && r === errorObj) { var e = r.e; var trace = canAttach(e) ? e : new Error(e + ""); promise._reject(e, trace); } }; Promise.prototype._spreadSlowCase = function Promise$_spreadSlowCase(targetFn, promise, values, boundTo) { var promiseForAll = new PromiseArray(values).promise(); var promise2 = promiseForAll._then(function() { return targetFn.apply(boundTo, arguments); }, void 0, void 0, APPLY, void 0); promise._follow(promise2); }; Promise.prototype._callSpread = function Promise$_callSpread(handler, promise, value) { var boundTo = this._boundTo; if (isArray(value)) { for (var i = 0, len = value.length; i < len; ++i) { if (cast(value[i], void 0) instanceof Promise) { this._spreadSlowCase(handler, promise, value, boundTo); return; } } } promise._pushContext(); return tryCatchApply(handler, value, boundTo); }; Promise.prototype._callHandler = function Promise$_callHandler( handler, receiver, promise, value) { var x; if (receiver === APPLY && !this.isRejected()) { x = this._callSpread(handler, promise, value); } else { promise._pushContext(); x = tryCatch1(handler, receiver, value); } promise._popContext(); return x; }; Promise.prototype._settlePromiseFromHandler = function Promise$_settlePromiseFromHandler( handler, receiver, value, promise ) { if (!(promise instanceof Promise)) { handler.call(receiver, value, promise); return; } var x = this._callHandler(handler, receiver, promise, value); if (promise._isFollowing()) return; if (x === errorObj || x === promise || x === NEXT_FILTER) { var err = x === promise ? makeSelfResolutionError() : x.e; var trace = canAttach(err) ? err : new Error(err + ""); if (x !== NEXT_FILTER) promise._attachExtraTrace(trace); promise._rejectUnchecked(err, trace); } else { var castValue = cast(x, promise); if (castValue instanceof Promise) { if (castValue.isRejected() && !castValue._isCarryingStackTrace() && !canAttach(castValue._settledValue)) { var trace = new Error(castValue._settledValue + ""); promise._attachExtraTrace(trace); castValue._setCarriedStackTrace(trace); } promise._follow(castValue); promise._propagateFrom(castValue, 1); } else { promise._fulfillUnchecked(x); } } }; Promise.prototype._follow = function Promise$_follow(promise) { this._setFollowing(); if (promise.isPending()) { this._propagateFrom(promise, 1); promise._proxyPromise(this); } else if (promise.isFulfilled()) { this._fulfillUnchecked(promise._settledValue); } else { this._rejectUnchecked(promise._settledValue, promise._getCarriedStackTrace()); } if (promise._isRejectionUnhandled()) promise._unsetRejectionIsUnhandled(); if (debugging && promise._traceParent == null) { promise._traceParent = this; } }; Promise.prototype._tryFollow = function Promise$_tryFollow(value) { if (this._isFollowingOrFulfilledOrRejected() || value === this) { return false; } var maybePromise = cast(value, void 0); if (!(maybePromise instanceof Promise)) { return false; } this._follow(maybePromise); return true; }; Promise.prototype._resetTrace = function Promise$_resetTrace() { if (debugging) { this._trace = new CapturedTrace(this._peekContext() === void 0); } }; Promise.prototype._setTrace = function Promise$_setTrace(parent) { if (debugging) { var context = this._peekContext(); this._traceParent = context; var isTopLevel = context === void 0; if (parent !== void 0 && parent._traceParent === context) { this._trace = parent._trace; } else { this._trace = new CapturedTrace(isTopLevel); } } return this; }; Promise.prototype._attachExtraTrace = function Promise$_attachExtraTrace(error) { if (debugging) { var promise = this; var stack = error.stack; stack = typeof stack === "string" ? stack.split("\n") : []; CapturedTrace.protectErrorMessageNewlines(stack); var headerLineCount = 1; var combinedTraces = 1; while(promise != null && promise._trace != null) { stack = CapturedTrace.combine( stack, promise._trace.stack.split("\n") ); promise = promise._traceParent; combinedTraces++; } var stackTraceLimit = Error.stackTraceLimit || 10; var max = (stackTraceLimit + headerLineCount) * combinedTraces; var len = stack.length; if (len > max) { stack.length = max; } if (len > 0) stack[0] = stack[0].split("\u0002\u0000\u0001").join("\n"); if (stack.length <= headerLineCount) { error.stack = "(No stack trace)"; } else { error.stack = stack.join("\n"); } } }; Promise.prototype._cleanValues = function Promise$_cleanValues() { if (this._cancellable()) { this._cancellationParent = void 0; } }; Promise.prototype._propagateFrom = function Promise$_propagateFrom(parent, flags) { if ((flags & 1) > 0 && parent._cancellable()) { this._setCancellable(); this._cancellationParent = parent; } if ((flags & 4) > 0) { this._setBoundTo(parent._boundTo); } if ((flags & 2) > 0) { this._setTrace(parent); } }; Promise.prototype._fulfill = function Promise$_fulfill(value) { if (this._isFollowingOrFulfilledOrRejected()) return; this._fulfillUnchecked(value); }; Promise.prototype._reject = function Promise$_reject(reason, carriedStackTrace) { if (this._isFollowingOrFulfilledOrRejected()) return; this._rejectUnchecked(reason, carriedStackTrace); }; Promise.prototype._settlePromiseAt = function Promise$_settlePromiseAt(index) { var handler = this.isFulfilled() ? this._fulfillmentHandlerAt(index) : this._rejectionHandlerAt(index); var value = this._settledValue; var receiver = this._receiverAt(index); var promise = this._promiseAt(index); if (typeof handler === "function") { this._settlePromiseFromHandler(handler, receiver, value, promise); } else { var done = false; var isFulfilled = this.isFulfilled(); if (receiver !== void 0) { if (receiver instanceof Promise && receiver._isProxied()) { receiver._unsetProxied(); if (isFulfilled) receiver._fulfillUnchecked(value); else receiver._rejectUnchecked(value, this._getCarriedStackTrace()); done = true; } else if (receiver instanceof PromiseArray) { if (isFulfilled) receiver._promiseFulfilled(value, promise); else receiver._promiseRejected(value, promise); done = true; } } if (!done) { if (isFulfilled) promise._fulfill(value); else promise._reject(value, this._getCarriedStackTrace()); } } if (index >= 4) { this._queueGC(); } }; Promise.prototype._isProxied = function Promise$_isProxied() { return (this._bitField & 4194304) === 4194304; }; Promise.prototype._setProxied = function Promise$_setProxied() { this._bitField = this._bitField | 4194304; }; Promise.prototype._unsetProxied = function Promise$_unsetProxied() { this._bitField = this._bitField & (~4194304); }; Promise.prototype._isGcQueued = function Promise$_isGcQueued() { return (this._bitField & -1073741824) === -1073741824; }; Promise.prototype._setGcQueued = function Promise$_setGcQueued() { this._bitField = this._bitField | -1073741824; }; Promise.prototype._unsetGcQueued = function Promise$_unsetGcQueued() { this._bitField = this._bitField & (~-1073741824); }; Promise.prototype._queueGC = function Promise$_queueGC() { if (this._isGcQueued()) return; this._setGcQueued(); async.invokeLater(this._gc, this, void 0); }; Promise.prototype._gc = function Promise$gc() { var len = this._length() * 5 - 5; for (var i = 0; i < len; i++) { delete this[i]; } this._clearFirstHandlerData(); this._setLength(0); this._unsetGcQueued(); }; Promise.prototype._clearFirstHandlerData = function Promise$_clearFirstHandlerData() { this._fulfillmentHandler0 = void 0; this._rejectionHandler0 = void 0; this._promise0 = void 0; this._receiver0 = void 0; }; Promise.prototype._queueSettleAt = function Promise$_queueSettleAt(index) { if (this._isRejectionUnhandled()) this._unsetRejectionIsUnhandled(); async.invoke(this._settlePromiseAt, this, index); }; Promise.prototype._fulfillUnchecked = function Promise$_fulfillUnchecked(value) { if (!this.isPending()) return; if (value === this) { var err = makeSelfResolutionError(); this._attachExtraTrace(err); return this._rejectUnchecked(err, void 0); } this._cleanValues(); this._setFulfilled(); this._settledValue = value; var len = this._length(); if (len > 0) { async.invoke(this._settlePromises, this, len); } }; Promise.prototype._rejectUncheckedCheckError = function Promise$_rejectUncheckedCheckError(reason) { var trace = canAttach(reason) ? reason : new Error(reason + ""); this._rejectUnchecked(reason, trace === reason ? void 0 : trace); }; Promise.prototype._rejectUnchecked = function Promise$_rejectUnchecked(reason, trace) { if (!this.isPending()) return; if (reason === this) { var err = makeSelfResolutionError(); this._attachExtraTrace(err); return this._rejectUnchecked(err); } this._cleanValues(); this._setRejected(); this._settledValue = reason; if (this._isFinal()) { async.invokeLater(thrower, void 0, trace === void 0 ? reason : trace); return; } var len = this._length(); if (trace !== void 0) this._setCarriedStackTrace(trace); if (len > 0) { async.invoke(this._rejectPromises, this, null); } else { this._ensurePossibleRejectionHandled(); } }; Promise.prototype._rejectPromises = function Promise$_rejectPromises() { this._settlePromises(); this._unsetCarriedStackTrace(); }; Promise.prototype._settlePromises = function Promise$_settlePromises() { var len = this._length(); for (var i = 0; i < len; i++) { this._settlePromiseAt(i); } }; Promise.prototype._ensurePossibleRejectionHandled = function Promise$_ensurePossibleRejectionHandled() { this._setRejectionIsUnhandled(); if (CapturedTrace.possiblyUnhandledRejection !== void 0) { async.invokeLater(this._notifyUnhandledRejection, this, void 0); } }; Promise.prototype._notifyUnhandledRejectionIsHandled = function Promise$_notifyUnhandledRejectionIsHandled() { if (typeof unhandledRejectionHandled === "function") { async.invokeLater(unhandledRejectionHandled, void 0, this); } }; Promise.prototype._notifyUnhandledRejection = function Promise$_notifyUnhandledRejection() { if (this._isRejectionUnhandled()) { var reason = this._settledValue; var trace = this._getCarriedStackTrace(); this._setUnhandledRejectionIsNotified(); if (trace !== void 0) { this._unsetCarriedStackTrace(); reason = trace; } if (typeof CapturedTrace.possiblyUnhandledRejection === "function") { CapturedTrace.possiblyUnhandledRejection(reason, this); } } }; var contextStack = []; Promise.prototype._peekContext = function Promise$_peekContext() { var lastIndex = contextStack.length - 1; if (lastIndex >= 0) { return contextStack[lastIndex]; } return void 0; }; Promise.prototype._pushContext = function Promise$_pushContext() { if (!debugging) return; contextStack.push(this); }; Promise.prototype._popContext = function Promise$_popContext() { if (!debugging) return; contextStack.pop(); }; Promise.noConflict = function Promise$NoConflict() { return noConflict(Promise); }; Promise.setScheduler = function(fn) { if (typeof fn !== "function") throw new TypeError("fn must be a function"); async._schedule = fn; }; if (!CapturedTrace.isSupported()) { Promise.longStackTraces = function(){}; debugging = false; } Promise._makeSelfResolutionError = makeSelfResolutionError; _dereq_("./finally.js")(Promise, NEXT_FILTER, cast); _dereq_("./direct_resolve.js")(Promise); _dereq_("./synchronous_inspection.js")(Promise); _dereq_("./join.js")(Promise, PromiseArray, cast, INTERNAL); Promise.RangeError = RangeError; Promise.CancellationError = CancellationError; Promise.TimeoutError = TimeoutError; Promise.TypeError = TypeError; Promise.OperationalError = OperationalError; Promise.RejectionError = OperationalError; Promise.AggregateError = errors.AggregateError; util.toFastProperties(Promise); util.toFastProperties(Promise.prototype); Promise.Promise = Promise; _dereq_('./nodeify.js')(Promise); Promise.prototype = Promise.prototype; return Promise; }; },{"./async.js":1,"./captured_trace.js":3,"./catch_filter.js":4,"./direct_resolve.js":5,"./errors.js":6,"./errors_api_rejection":7,"./finally.js":9,"./join.js":10,"./nodeify.js":11,"./promise_array.js":13,"./promise_resolver.js":14,"./synchronous_inspection.js":17,"./thenables.js":18,"./util.js":19}],13:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function(Promise, INTERNAL, cast) { var canAttach = _dereq_("./errors.js").canAttach; var util = _dereq_("./util.js"); var isArray = util.isArray; function toResolutionValue(val) { switch(val) { case -1: return void 0; case -2: return []; case -3: return {}; } } function PromiseArray(values) { var promise = this._promise = new Promise(INTERNAL); var parent = void 0; if (values instanceof Promise) { parent = values; promise._propagateFrom(parent, 1 | 4); } promise._setTrace(parent); this._values = values; this._length = 0; this._totalResolved = 0; this._init(void 0, -2); } PromiseArray.prototype.length = function PromiseArray$length() { return this._length; }; PromiseArray.prototype.promise = function PromiseArray$promise() { return this._promise; }; PromiseArray.prototype._init = function PromiseArray$_init(_, resolveValueIfEmpty) { var values = cast(this._values, void 0); if (values instanceof Promise) { this._values = values; values._setBoundTo(this._promise._boundTo); if (values.isFulfilled()) { values = values._settledValue; if (!isArray(values)) { var err = new Promise.TypeError("expecting an array, a promise or a thenable"); this.__hardReject__(err); return; } } else if (values.isPending()) { values._then( PromiseArray$_init, this._reject, void 0, this, resolveValueIfEmpty ); return; } else { values._unsetRejectionIsUnhandled(); this._reject(values._settledValue); return; } } else if (!isArray(values)) { var err = new Promise.TypeError("expecting an array, a promise or a thenable"); this.__hardReject__(err); return; } if (values.length === 0) { if (resolveValueIfEmpty === -5) { this._resolveEmptyArray(); } else { this._resolve(toResolutionValue(resolveValueIfEmpty)); } return; } var len = this.getActualLength(values.length); var newLen = len; var newValues = this.shouldCopyValues() ? new Array(len) : this._values; var isDirectScanNeeded = false; for (var i = 0; i < len; ++i) { var maybePromise = cast(values[i], void 0); if (maybePromise instanceof Promise) { if (maybePromise.isPending()) { maybePromise._proxyPromiseArray(this, i); } else { maybePromise._unsetRejectionIsUnhandled(); isDirectScanNeeded = true; } } else { isDirectScanNeeded = true; } newValues[i] = maybePromise; } this._values = newValues; this._length = newLen; if (isDirectScanNeeded) { this._scanDirectValues(len); } }; PromiseArray.prototype._settlePromiseAt = function PromiseArray$_settlePromiseAt(index) { var value = this._values[index]; if (!(value instanceof Promise)) { this._promiseFulfilled(value, index); } else if (value.isFulfilled()) { this._promiseFulfilled(value._settledValue, index); } else if (value.isRejected()) { this._promiseRejected(value._settledValue, index); } }; PromiseArray.prototype._scanDirectValues = function PromiseArray$_scanDirectValues(len) { for (var i = 0; i < len; ++i) { if (this._isResolved()) { break; } this._settlePromiseAt(i); } }; PromiseArray.prototype._isResolved = function PromiseArray$_isResolved() { return this._values === null; }; PromiseArray.prototype._resolve = function PromiseArray$_resolve(value) { this._values = null; this._promise._fulfill(value); }; PromiseArray.prototype.__hardReject__ = PromiseArray.prototype._reject = function PromiseArray$_reject(reason) { this._values = null; var trace = canAttach(reason) ? reason : new Error(reason + ""); this._promise._attachExtraTrace(trace); this._promise._reject(reason, trace); }; PromiseArray.prototype._promiseProgressed = function PromiseArray$_promiseProgressed(progressValue, index) { if (this._isResolved()) return; this._promise._progress({ index: index, value: progressValue }); }; PromiseArray.prototype._promiseFulfilled = function PromiseArray$_promiseFulfilled(value, index) { if (this._isResolved()) return; this._values[index] = value; var totalResolved = ++this._totalResolved; if (totalResolved >= this._length) { this._resolve(this._values); } }; PromiseArray.prototype._promiseRejected = function PromiseArray$_promiseRejected(reason, index) { if (this._isResolved()) return; this._totalResolved++; this._reject(reason); }; PromiseArray.prototype.shouldCopyValues = function PromiseArray$_shouldCopyValues() { return true; }; PromiseArray.prototype.getActualLength = function PromiseArray$getActualLength(len) { return len; }; return PromiseArray; }; },{"./errors.js":6,"./util.js":19}],14:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; var util = _dereq_("./util.js"); var maybeWrapAsError = util.maybeWrapAsError; var errors = _dereq_("./errors.js"); var TimeoutError = errors.TimeoutError; var OperationalError = errors.OperationalError; var async = _dereq_("./async.js"); var haveGetters = util.haveGetters; var es5 = _dereq_("./es5.js"); function isUntypedError(obj) { return obj instanceof Error && es5.getPrototypeOf(obj) === Error.prototype; } function wrapAsOperationalError(obj) { var ret; if (isUntypedError(obj)) { ret = new OperationalError(obj); } else { ret = obj; } errors.markAsOriginatingFromRejection(ret); return ret; } function nodebackForPromise(promise) { function PromiseResolver$_callback(err, value) { if (promise === null) return; if (err) { var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); promise._attachExtraTrace(wrapped); promise._reject(wrapped); } else if (arguments.length > 2) { var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} promise._fulfill(args); } else { promise._fulfill(value); } promise = null; } return PromiseResolver$_callback; } var PromiseResolver; if (!haveGetters) { PromiseResolver = function PromiseResolver(promise) { this.promise = promise; this.asCallback = nodebackForPromise(promise); this.callback = this.asCallback; }; } else { PromiseResolver = function PromiseResolver(promise) { this.promise = promise; }; } if (haveGetters) { var prop = { get: function() { return nodebackForPromise(this.promise); } }; es5.defineProperty(PromiseResolver.prototype, "asCallback", prop); es5.defineProperty(PromiseResolver.prototype, "callback", prop); } PromiseResolver._nodebackForPromise = nodebackForPromise; PromiseResolver.prototype.toString = function PromiseResolver$toString() { return "[object PromiseResolver]"; }; PromiseResolver.prototype.resolve = PromiseResolver.prototype.fulfill = function PromiseResolver$resolve(value) { if (!(this instanceof PromiseResolver)) { throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead."); } var promise = this.promise; if (promise._tryFollow(value)) { return; } async.invoke(promise._fulfill, promise, value); }; PromiseResolver.prototype.reject = function PromiseResolver$reject(reason) { if (!(this instanceof PromiseResolver)) { throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead."); } var promise = this.promise; errors.markAsOriginatingFromRejection(reason); var trace = errors.canAttach(reason) ? reason : new Error(reason + ""); promise._attachExtraTrace(trace); async.invoke(promise._reject, promise, reason); if (trace !== reason) { async.invoke(this._setCarriedStackTrace, this, trace); } }; PromiseResolver.prototype.progress = function PromiseResolver$progress(value) { if (!(this instanceof PromiseResolver)) { throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead."); } async.invoke(this.promise._progress, this.promise, value); }; PromiseResolver.prototype.cancel = function PromiseResolver$cancel() { async.invoke(this.promise.cancel, this.promise, void 0); }; PromiseResolver.prototype.timeout = function PromiseResolver$timeout() { this.reject(new TimeoutError("timeout")); }; PromiseResolver.prototype.isResolved = function PromiseResolver$isResolved() { return this.promise.isResolved(); }; PromiseResolver.prototype.toJSON = function PromiseResolver$toJSON() { return this.promise.toJSON(); }; PromiseResolver.prototype._setCarriedStackTrace = function PromiseResolver$_setCarriedStackTrace(trace) { if (this.promise.isRejected()) { this.promise._setCarriedStackTrace(trace); } }; module.exports = PromiseResolver; },{"./async.js":1,"./errors.js":6,"./es5.js":8,"./util.js":19}],15:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; function arrayCopy(src, srcIndex, dst, dstIndex, len) { for (var j = 0; j < len; ++j) { dst[j + dstIndex] = src[j + srcIndex]; } } function Queue(capacity) { this._capacity = capacity; this._length = 0; this._front = 0; this._makeCapacity(); } Queue.prototype._willBeOverCapacity = function Queue$_willBeOverCapacity(size) { return this._capacity < size; }; Queue.prototype._pushOne = function Queue$_pushOne(arg) { var length = this.length(); this._checkCapacity(length + 1); var i = (this._front + length) & (this._capacity - 1); this[i] = arg; this._length = length + 1; }; Queue.prototype.push = function Queue$push(fn, receiver, arg) { var length = this.length() + 3; if (this._willBeOverCapacity(length)) { this._pushOne(fn); this._pushOne(receiver); this._pushOne(arg); return; } var j = this._front + length - 3; this._checkCapacity(length); var wrapMask = this._capacity - 1; this[(j + 0) & wrapMask] = fn; this[(j + 1) & wrapMask] = receiver; this[(j + 2) & wrapMask] = arg; this._length = length; }; Queue.prototype.shift = function Queue$shift() { var front = this._front, ret = this[front]; this[front] = void 0; this._front = (front + 1) & (this._capacity - 1); this._length--; return ret; }; Queue.prototype.length = function Queue$length() { return this._length; }; Queue.prototype._makeCapacity = function Queue$_makeCapacity() { var len = this._capacity; for (var i = 0; i < len; ++i) { this[i] = void 0; } }; Queue.prototype._checkCapacity = function Queue$_checkCapacity(size) { if (this._capacity < size) { this._resizeTo(this._capacity << 3); } }; Queue.prototype._resizeTo = function Queue$_resizeTo(capacity) { var oldFront = this._front; var oldCapacity = this._capacity; var oldQueue = new Array(oldCapacity); var length = this.length(); arrayCopy(this, 0, oldQueue, 0, oldCapacity); this._capacity = capacity; this._makeCapacity(); this._front = 0; if (oldFront + length <= oldCapacity) { arrayCopy(oldQueue, oldFront, this, 0, length); } else { var lengthBeforeWrapping = length - ((oldFront + length) & (oldCapacity - 1)); arrayCopy(oldQueue, oldFront, this, 0, lengthBeforeWrapping); arrayCopy(oldQueue, 0, this, lengthBeforeWrapping, length - lengthBeforeWrapping); } }; module.exports = Queue; },{}],16:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; var schedule; var _MutationObserver; if (typeof process === "object" && typeof process.version === "string") { schedule = function Promise$_Scheduler(fn) { process.nextTick(fn); }; } else if ((typeof MutationObserver !== "undefined" && (_MutationObserver = MutationObserver)) || (typeof WebKitMutationObserver !== "undefined" && (_MutationObserver = WebKitMutationObserver))) { schedule = (function() { var div = document.createElement("div"); var queuedFn = void 0; var observer = new _MutationObserver( function Promise$_Scheduler() { var fn = queuedFn; queuedFn = void 0; fn(); } ); observer.observe(div, { attributes: true }); return function Promise$_Scheduler(fn) { queuedFn = fn; div.classList.toggle("foo"); }; })(); } else if (typeof setTimeout !== "undefined") { schedule = function Promise$_Scheduler(fn) { setTimeout(fn, 0); }; } else throw new Error("no async scheduler available"); module.exports = schedule; },{}],17:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function(Promise) { function PromiseInspection(promise) { if (promise !== void 0) { this._bitField = promise._bitField; this._settledValue = promise.isResolved() ? promise._settledValue : void 0; } else { this._bitField = 0; this._settledValue = void 0; } } PromiseInspection.prototype.isFulfilled = Promise.prototype.isFulfilled = function Promise$isFulfilled() { return (this._bitField & 268435456) > 0; }; PromiseInspection.prototype.isRejected = Promise.prototype.isRejected = function Promise$isRejected() { return (this._bitField & 134217728) > 0; }; PromiseInspection.prototype.isPending = Promise.prototype.isPending = function Promise$isPending() { return (this._bitField & 402653184) === 0; }; PromiseInspection.prototype.value = Promise.prototype.value = function Promise$value() { if (!this.isFulfilled()) { throw new TypeError("cannot get fulfillment value of a non-fulfilled promise"); } return this._settledValue; }; PromiseInspection.prototype.error = PromiseInspection.prototype.reason = Promise.prototype.reason = function Promise$reason() { if (!this.isRejected()) { throw new TypeError("cannot get rejection reason of a non-rejected promise"); } return this._settledValue; }; PromiseInspection.prototype.isResolved = Promise.prototype.isResolved = function Promise$isResolved() { return (this._bitField & 402653184) > 0; }; Promise.PromiseInspection = PromiseInspection; }; },{}],18:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; module.exports = function(Promise, INTERNAL) { var util = _dereq_("./util.js"); var canAttach = _dereq_("./errors.js").canAttach; var errorObj = util.errorObj; var isObject = util.isObject; function getThen(obj) { try { return obj.then; } catch(e) { errorObj.e = e; return errorObj; } } function Promise$_Cast(obj, originalPromise) { if (isObject(obj)) { if (obj instanceof Promise) { return obj; } else if (isAnyBluebirdPromise(obj)) { var ret = new Promise(INTERNAL); ret._setTrace(void 0); obj._then( ret._fulfillUnchecked, ret._rejectUncheckedCheckError, ret._progressUnchecked, ret, null ); ret._setFollowing(); return ret; } var then = getThen(obj); if (then === errorObj) { if (originalPromise !== void 0 && canAttach(then.e)) { originalPromise._attachExtraTrace(then.e); } return Promise.reject(then.e); } else if (typeof then === "function") { return Promise$_doThenable(obj, then, originalPromise); } } return obj; } var hasProp = {}.hasOwnProperty; function isAnyBluebirdPromise(obj) { return hasProp.call(obj, "_promise0"); } function Promise$_doThenable(x, then, originalPromise) { var resolver = Promise.defer(); var called = false; try { then.call( x, Promise$_resolveFromThenable, Promise$_rejectFromThenable, Promise$_progressFromThenable ); } catch(e) { if (!called) { called = true; var trace = canAttach(e) ? e : new Error(e + ""); if (originalPromise !== void 0) { originalPromise._attachExtraTrace(trace); } resolver.promise._reject(e, trace); } } return resolver.promise; function Promise$_resolveFromThenable(y) { if (called) return; called = true; if (x === y) { var e = Promise._makeSelfResolutionError(); if (originalPromise !== void 0) { originalPromise._attachExtraTrace(e); } resolver.promise._reject(e, void 0); return; } resolver.resolve(y); } function Promise$_rejectFromThenable(r) { if (called) return; called = true; var trace = canAttach(r) ? r : new Error(r + ""); if (originalPromise !== void 0) { originalPromise._attachExtraTrace(trace); } resolver.promise._reject(r, trace); } function Promise$_progressFromThenable(v) { if (called) return; var promise = resolver.promise; if (typeof promise._progress === "function") { promise._progress(v); } } } return Promise$_Cast; }; },{"./errors.js":6,"./util.js":19}],19:[function(_dereq_,module,exports){ /** * Copyright (c) 2014 Petka Antonov * * 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:</p> * * 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. * */ "use strict"; var es5 = _dereq_("./es5.js"); var haveGetters = (function(){ try { var o = {}; es5.defineProperty(o, "f", { get: function () { return 3; } }); return o.f === 3; } catch (e) { return false; } })(); var canEvaluate = typeof navigator == "undefined"; var errorObj = {e: {}}; function tryCatch1(fn, receiver, arg) { try { return fn.call(receiver, arg); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatch2(fn, receiver, arg, arg2) { try { return fn.call(receiver, arg, arg2); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatch3(fn, receiver, arg, arg2, arg3) { try { return fn.call(receiver, arg, arg2, arg3); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatch4(fn, receiver, arg, arg2, arg3, arg4) { try { return fn.call(receiver, arg, arg2, arg3, arg4); } catch (e) { errorObj.e = e; return errorObj; } } function tryCatchApply(fn, args, receiver) { try { return fn.apply(receiver, args); } catch (e) { errorObj.e = e; return errorObj; } } var inherits = function(Child, Parent) { var hasProp = {}.hasOwnProperty; function T() { this.constructor = Child; this.constructor$ = Parent; for (var propertyName in Parent.prototype) { if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length-1) !== "$" ) { this[propertyName + "$"] = Parent.prototype[propertyName]; } } } T.prototype = Parent.prototype; Child.prototype = new T(); return Child.prototype; }; function asString(val) { return typeof val === "string" ? val : ("" + val); } function isPrimitive(val) { return val == null || val === true || val === false || typeof val === "string" || typeof val === "number"; } function isObject(value) { return !isPrimitive(value); } function maybeWrapAsError(maybeError) { if (!isPrimitive(maybeError)) return maybeError; return new Error(asString(maybeError)); } function withAppended(target, appendee) { var len = target.length; var ret = new Array(len + 1); var i; for (i = 0; i < len; ++i) { ret[i] = target[i]; } ret[i] = appendee; return ret; } function getDataPropertyOrDefault(obj, key, defaultValue) { if (es5.isES5) { var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc != null) { return desc.get == null && desc.set == null ? desc.value : defaultValue; } } else { return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0; } } function notEnumerableProp(obj, name, value) { if (isPrimitive(obj)) return obj; var descriptor = { value: value, configurable: true, enumerable: false, writable: true }; es5.defineProperty(obj, name, descriptor); return obj; } var wrapsPrimitiveReceiver = (function() { return this !== "string"; }).call("string"); function thrower(r) { throw r; } var inheritedDataKeys = (function() { if (es5.isES5) { return function(obj, opts) { var ret = []; var visitedKeys = Object.create(null); var getKeys = Object(opts).includeHidden ? Object.getOwnPropertyNames : Object.keys; while (obj != null) { var keys; try { keys = getKeys(obj); } catch (e) { return ret; } for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (visitedKeys[key]) continue; visitedKeys[key] = true; var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc != null && desc.get == null && desc.set == null) { ret.push(key); } } obj = es5.getPrototypeOf(obj); } return ret; }; } else { return function(obj) { var ret = []; /*jshint forin:false */ for (var key in obj) { ret.push(key); } return ret; }; } })(); function isClass(fn) { try { if (typeof fn === "function") { var keys = es5.keys(fn.prototype); return keys.length > 0 && !(keys.length === 1 && keys[0] === "constructor"); } return false; } catch (e) { return false; } } function toFastProperties(obj) { /*jshint -W027*/ function f() {} f.prototype = obj; return f; eval(obj); } var rident = /^[a-z$_][a-z$_0-9]*$/i; function isIdentifier(str) { return rident.test(str); } function filledRange(count, prefix, suffix) { var ret = new Array(count); for(var i = 0; i < count; ++i) { ret[i] = prefix + i + suffix; } return ret; } var ret = { isClass: isClass, isIdentifier: isIdentifier, inheritedDataKeys: inheritedDataKeys, getDataPropertyOrDefault: getDataPropertyOrDefault, thrower: thrower, isArray: es5.isArray, haveGetters: haveGetters, notEnumerableProp: notEnumerableProp, isPrimitive: isPrimitive, isObject: isObject, canEvaluate: canEvaluate, errorObj: errorObj, tryCatch1: tryCatch1, tryCatch2: tryCatch2, tryCatch3: tryCatch3, tryCatch4: tryCatch4, tryCatchApply: tryCatchApply, inherits: inherits, withAppended: withAppended, asString: asString, maybeWrapAsError: maybeWrapAsError, wrapsPrimitiveReceiver: wrapsPrimitiveReceiver, toFastProperties: toFastProperties, filledRange: filledRange }; module.exports = ret; },{"./es5.js":8}]},{},[2]) (2) }); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } /** FILE: lib/bluebird-defer.js **/ // wrapper to implement defer() functionality (function () { Promise.defer = function () { var resolve, reject; var promise = new Promise(function() { resolve = arguments[0]; reject = arguments[1]; }); return { resolve: resolve, reject: reject, promise: promise }; }; }()); /** FILE: src/remotestorage.js **/ (function (global) { function logError(error) { if (typeof(error) === 'string') { console.error(error); } else { console.error(error.message, error.stack); } } function emitUnauthorized(r) { if (r.statusCode === 403 || r.statusCode === 401) { this._emit('error', new RemoteStorage.Unauthorized()); } return Promise.resolve(r); } function shareFirst(path) { return ( this.backend === 'dropbox' && path.match(/^\/public\/.*[^\/]$/) ); } var SyncedGetPutDelete = { get: function (path, maxAge) { var self = this; if (this.local) { if (maxAge === undefined) { if (this.connected) { maxAge = 2*this.getSyncInterval(); } else { maxAge = false; } } var maxAgeInvalid = function (maxAge) { return maxAge !== false && typeof(maxAge) !== 'number'; }; if (maxAgeInvalid(maxAge)) { return Promise.reject('Argument \'maxAge\' must be false or a number'); } return this.local.get(path, maxAge, this.sync.queueGetRequest.bind(this.sync)); } else { return this.remote.get(path); } }, put: function (path, body, contentType) { if (shareFirst.bind(this)(path)) { return SyncedGetPutDelete._wrapBusyDone.call(this, this.remote.put(path, body, contentType)); } else if (this.local) { return this.local.put(path, body, contentType); } else { return SyncedGetPutDelete._wrapBusyDone.call(this, this.remote.put(path, body, contentType)); } }, 'delete': function (path) { if (this.local) { return this.local.delete(path); } else { return SyncedGetPutDelete._wrapBusyDone.call(this, this.remote.delete(path)); } }, _wrapBusyDone: function (result) { var self = this; this._emit('wire-busy'); return result.then(function (r) { self._emit('wire-done', { success: true }); return Promise.resolve(r); }, function (err) { self._emit('wire-done', { success: false }); return Promise.reject(err); }); } }; /** * Class: RemoteStorage * * TODO needs proper introduction and links to relevant classes etc * * Constructor for global remoteStorage object. * * This class primarily contains feature detection code and a global convenience API. * * Depending on which features are built in, it contains different attributes and * functions. See the individual features for more information. * * (start code) * var remoteStorage = new RemoteStorage({ * logging: true // defaults to false * }); * (end code) */ var RemoteStorage = function (cfg) { /** * Event: ready * * Fired when ready **/ /** * Event: not-connected * * Fired when ready, but no storage connected ("anonymous mode") **/ /** * Event: connected * * Fired when a remote storage has been connected **/ /** * Event: disconnected * * Fired after disconnect **/ /** * Event: error * * Fired when an error occurs * * Arguments: * the error **/ /** * Event: features-loaded * * Fired when all features are loaded **/ /** * Event: connecting * * Fired before webfinger lookup **/ /** * Event: authing * * Fired before redirecting to the authing server **/ /** * Event: wire-busy * * Fired when a wire request starts **/ /** * Event: wire-done * * Fired when a wire request completes **/ // Initial configuration property settings. if (typeof cfg === 'object') { RemoteStorage.config.logging = !!cfg.logging; } RemoteStorage.eventHandling( this, 'ready', 'connected', 'disconnected', 'not-connected', 'conflict', 'error', 'features-loaded', 'connecting', 'authing', 'wire-busy', 'wire-done', 'sync-interval-change' ); // pending get/put/delete calls. this._pending = []; this._setGPD({ get: this._pendingGPD('get'), put: this._pendingGPD('put'), delete: this._pendingGPD('delete') }); this._cleanups = []; this._pathHandlers = { change: {} }; this.apiKeys = {}; if (this.localStorageAvailable()) { try { this.apiKeys = JSON.parse(localStorage['remotestorage:api-keys']); } catch(exc) { // ignored } this.setBackend(localStorage['remotestorage:backend'] || 'remotestorage'); } var origOn = this.on; this.on = function (eventName, handler) { if (eventName === 'ready' && this.remote.connected && this._allLoaded) { setTimeout(handler, 0); } else if (eventName === 'features-loaded' && this._allLoaded) { setTimeout(handler, 0); } return origOn.call(this, eventName, handler); }; this._init(); this.fireInitial = function () { if (this.local) { setTimeout(this.local.fireInitial.bind(this.local), 0); } }.bind(this); this.on('ready', this.fireInitial.bind(this)); }; RemoteStorage.SyncedGetPutDelete = SyncedGetPutDelete; RemoteStorage.DiscoveryError = function (message) { Error.apply(this, arguments); this.message = message; }; RemoteStorage.DiscoveryError.prototype = Object.create(Error.prototype); RemoteStorage.Unauthorized = function () { Error.apply(this, arguments); }; RemoteStorage.Unauthorized.prototype = Object.create(Error.prototype); /** * Method: RemoteStorage.log * * Log using console.log, when remoteStorage logging is enabled. * * You can enable logging with <enableLog>. * * (In node.js you can also enable logging during remoteStorage object * creation. See: <RemoteStorage>). */ RemoteStorage.log = function () { if (RemoteStorage.config.logging) { console.log.apply(console, arguments); } }; RemoteStorage.config = { logging: false, changeEvents: { local: true, window: false, remote: true, conflict: true }, discoveryTimeout: 10000 }; RemoteStorage.prototype = { /** * Method: displayWidget * * Displays the widget at the top right of the page. Make sure to call this function * once on every pageload (after the html 'body' tag), unless you use a custom widget. * * Parameters: * * domID: identifier of the DOM element which should embody the widget (optional) */ // (see src/widget.js for implementation) /** * Property: remote * * Properties: * * connected - Boolean, whether or not a remote store is connected * online - Boolean, whether last sync action was successful or not * userAddress - String, the user address of the connected user * properties - String, the properties of the WebFinger link */ /** * Method: scope * * Returns a BaseClient with a certain scope (base path). Please use this method * only for debugging, and always use defineModule instead, to get access to a * BaseClient from a module in an app. * * Parameters: * * scope - A string, with a leading and a trailing slash, specifying the * base path of the BaseClient that will be returned. * * Code example: * * (start code) * remoteStorage.scope('/pictures/').getListing(''); * remoteStorage.scope('/public/pictures/').getListing(''); */ /** * Method: connect * * Connect to a remoteStorage server. * * Parameters: * userAddress - The user address (user@host) to connect to. * * Discovers the webfinger profile of the given user address and initiates * the OAuth dance. * * This method must be called *after* all required access has been claimed. * */ connect: function (userAddress) { this.setBackend('remotestorage'); if (userAddress.indexOf('@') < 0) { this._emit('error', new RemoteStorage.DiscoveryError("User address doesn't contain an @.")); return; } this.remote.configure({ userAddress: userAddress }); this._emit('connecting'); var discoveryTimeout = setTimeout(function () { this._emit('error', new RemoteStorage.DiscoveryError("No storage information found at that user address.")); }.bind(this), RemoteStorage.config.discoveryTimeout); RemoteStorage.Discover(userAddress).then(function (info) { // Info contains fields: href, storageApi, authURL (optional), properties clearTimeout(discoveryTimeout); this._emit('authing'); info.userAddress = userAddress; this.remote.configure(info); if (! this.remote.connected) { if (info.authURL) { this.authorize(info.authURL); } else { // In lieu of an excplicit authURL, assume that the browser // and server handle any authorization needs; for instance, // TLS may trigger the browser to use a client certificate, // or a 401 Not Authorized response may make the browser // send a Kerberos ticket using the SPNEGO method. this.impliedauth(); } } }.bind(this), function(err) { this._emit('error', new RemoteStorage.DiscoveryError("Failed to contact storage server.")); }.bind(this)); }, /** * Method: disconnect * * "Disconnect" from remotestorage server to terminate current session. * This method clears all stored settings and deletes the entire local * cache. */ disconnect: function () { if (this.remote) { this.remote.configure({ userAddress: null, href: null, storageApi: null, token: null, properties: null }); } this._setGPD({ get: this._pendingGPD('get'), put: this._pendingGPD('put'), delete: this._pendingGPD('delete') }); var n = this._cleanups.length, i = 0; var oneDone = function () { i++; if (i >= n) { this._init(); RemoteStorage.log('Done cleaning up, emitting disconnected and disconnect events'); this._emit('disconnected'); } }.bind(this); if (n > 0) { this._cleanups.forEach(function (cleanup) { var cleanupResult = cleanup(this); if (typeof(cleanup) === 'object' && typeof(cleanup.then) === 'function') { cleanupResult.then(oneDone); } else { oneDone(); } }.bind(this)); } else { oneDone(); } }, setBackend: function (what) { this.backend = what; if (this.localStorageAvailable()) { if (what) { localStorage['remotestorage:backend'] = what; } else { delete localStorage['remotestorage:backend']; } } }, /** * Method: onChange * * Add a "change" event handler to the given path. Whenever a "change" * happens (as determined by the backend, such as e.g. * <RemoteStorage.IndexedDB>) and the affected path is equal to or below * the given 'path', the given handler is called. * * You should usually not use this method directly, but instead use the * "change" events provided by <RemoteStorage.BaseClient>. * * Parameters: * path - Absolute path to attach handler to. * handler - Handler function. */ onChange: function (path, handler) { if (! this._pathHandlers.change[path]) { this._pathHandlers.change[path] = []; } this._pathHandlers.change[path].push(handler); }, /** * Method: enableLog * * Enable remoteStorage logging. */ enableLog: function () { RemoteStorage.config.logging = true; }, /** * Method: disableLog * * Disable remoteStorage logging */ disableLog: function () { RemoteStorage.config.logging = false; }, /** * Method: log * * The same as <RemoteStorage.log>. */ log: function () { RemoteStorage.log.apply(RemoteStorage, arguments); }, /** * Method: setApiKeys (experimental) * * Set API keys for (currently) GoogleDrive and/or Dropbox backend support. * See also the 'backends' example in the starter-kit. Note that support for * both these backends is still experimental. * * Parameters: * type - string, either 'googledrive' or 'dropbox' * keys - object, with one string field; 'client_id' for GoogleDrive, or * 'api_key' for Dropbox. * */ setApiKeys: function (type, keys) { if (keys) { this.apiKeys[type] = keys; } else { delete this.apiKeys[type]; } if (this.localStorageAvailable()) { localStorage['remotestorage:api-keys'] = JSON.stringify(this.apiKeys); } }, /** ** INITIALIZATION **/ _init: function () { var self = this, readyFired = false; function fireReady() { try { if (!readyFired) { self._emit('ready'); readyFired = true; } } catch(e) { console.error("'ready' failed: ", e, e.stack); self._emit('error', e); } } this._loadFeatures(function (features) { this.log('[RemoteStorage] All features loaded'); this.local = features.local && new features.local(); // this.remote set by WireClient._rs_init as lazy property on // RS.prototype if (this.local && this.remote) { this._setGPD(SyncedGetPutDelete, this); this._bindChange(this.local); } else if (this.remote) { this._setGPD(this.remote, this.remote); } if (this.remote) { this.remote.on('connected', function (){ fireReady(); self._emit('connected'); }); this.remote.on('not-connected', function (){ fireReady(); self._emit('not-connected'); }); if (this.remote.connected) { fireReady(); self._emit('connected'); } if (!this.hasFeature('Authorize')) { this.remote.stopWaitingForToken(); } } this._collectCleanupFunctions(); try { this._allLoaded = true; this._emit('features-loaded'); } catch(exc) { logError(exc); this._emit('error', exc); } this._processPending(); }.bind(this)); }, _collectCleanupFunctions: function () { for (var i=0; i < this.features.length; i++) { var cleanup = this.features[i].cleanup; if (typeof(cleanup) === 'function') { this._cleanups.push(cleanup); } } }, /** ** FEATURE DETECTION **/ _loadFeatures: function (callback) { var featureList = [ 'WireClient', 'I18n', 'Dropbox', 'GoogleDrive', 'Access', 'Caching', 'Discover', 'Authorize', 'Widget', 'IndexedDB', 'LocalStorage', 'InMemoryStorage', 'Sync', 'BaseClient', 'Env' ]; var features = []; var featuresDone = 0; var self = this; function featureDone() { featuresDone++; if (featuresDone === featureList.length) { setTimeout(function () { features.caching = !!RemoteStorage.Caching; features.sync = !!RemoteStorage.Sync; [ 'IndexedDB', 'LocalStorage', 'InMemoryStorage' ].some(function (cachingLayer) { if (features.some(function (feature) { return feature.name === cachingLayer; })) { features.local = RemoteStorage[cachingLayer]; return true; } }); self.features = features; callback(features); }, 0); } } function featureInitialized(name) { self.log("[RemoteStorage] [FEATURE "+name+"] initialized."); features.push({ name : name, init : RemoteStorage[name]._rs_init, supported : true, cleanup : RemoteStorage[name]._rs_cleanup }); featureDone(); } function featureFailed(name, err) { self.log("[RemoteStorage] [FEATURE "+name+"] initialization failed ( "+err+")"); featureDone(); } function featureSupported(name, success) { self.log("[RemoteStorage] [FEATURE "+name+"]" + success ? "":" not"+" supported"); if (!success) { featureDone(); } } function initFeature(name) { var initResult; try { initResult = RemoteStorage[name]._rs_init(self); } catch(e) { featureFailed(name, e); return; } if (typeof(initResult) === 'object' && typeof(initResult.then) === 'function') { initResult.then( function (){ featureInitialized(name); }, function (err){ featureFailed(name, err); } ); } else { featureInitialized(name); } } featureList.forEach(function (featureName) { self.log("[RemoteStorage] [FEATURE " + featureName + "] initializing..."); var impl = RemoteStorage[featureName]; var supported; if (impl) { supported = !impl._rs_supported || impl._rs_supported(); if (typeof supported === 'object') { supported.then( function (){ featureSupported(featureName, true); initFeature(featureName); }, function (){ featureSupported(featureName, false); } ); } else if (typeof supported === 'boolean') { featureSupported(featureName, supported); if (supported) { initFeature(featureName); } } } else { featureSupported(featureName, false); } }); }, /** * Method: hasFeature * * Checks whether a feature is enabled or not within remoteStorage. * Returns a boolean. * * Parameters: * name - Capitalized name of the feature. e.g. Authorize, or IndexedDB * * Example: * (start code) * if (remoteStorage.hasFeature('LocalStorage')) { * console.log('LocalStorage is enabled!'); * } * (end code) * */ hasFeature: function (feature) { for (var i = this.features.length - 1; i >= 0; i--) { if (this.features[i].name === feature) { return this.features[i].supported; } } return false; }, localStorageAvailable: function () { try { return !!global.localStorage; } catch(error) { return false; } }, /** ** GET/PUT/DELETE INTERFACE HELPERS **/ _setGPD: function (impl, context) { function wrap(func) { return function () { return func.apply(context, arguments) .then(emitUnauthorized.bind(this)); }; } this.get = wrap(impl.get); this.put = wrap(impl.put); this.delete = wrap(impl.delete); }, _pendingGPD: function (methodName) { return function () { var pending = Promise.defer(); this._pending.push({ method: methodName, args: Array.prototype.slice.call(arguments), promise: pending }); return pending.promise; }.bind(this); }, _processPending: function () { this._pending.forEach(function (pending) { try { this[pending.method].apply(this, pending.args).then(pending.promise.resolve, pending.promise.reject); } catch(e) { pending.promise.reject(e); } }.bind(this)); this._pending = []; }, /** ** CHANGE EVENT HANDLING **/ _bindChange: function (object) { object.on('change', this._dispatchEvent.bind(this, 'change')); }, _dispatchEvent: function (eventName, event) { for (var path in this._pathHandlers[eventName]) { var pl = path.length; var self = this; if (event.path.substr(0, pl) === path) { this._pathHandlers[eventName][path].forEach(function (handler) { var ev = {}; for (var key in event) { ev[key] = event[key]; } ev.relativePath = event.path.replace(new RegExp('^' + path), ''); try { handler(ev); } catch(e) { console.error("'change' handler failed: ", e, e.stack); self._emit('error', e); } }); } } } }; /** * Property: connected * * Boolean property indicating if remoteStorage is currently connected. */ Object.defineProperty(RemoteStorage.prototype, 'connected', { get: function () { return this.remote.connected; } }); /** * Property: access * * Tracking claimed access scopes. A <RemoteStorage.Access> instance. * * * Property: caching * * Caching settings. A <RemoteStorage.Caching> instance. * * Not available in no-cache builds. * * * Property: remote * * Access to the remote backend used. Usually a <RemoteStorage.WireClient>. * * * Property: local * * Access to the local caching backend used. Usually either a * <RemoteStorage.IndexedDB> or <RemoteStorage.LocalStorage> instance. * * Not available in no-cache builds. */ if ((typeof module === 'object') && (typeof module.exports !== undefined)){ module.exports = RemoteStorage; } else { global.RemoteStorage = RemoteStorage; } })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/util.js **/ /** * Class: RemoteStorage.Util * * Provides reusable utility functions at RemoteStorage.util * */ (function () { /** * Function: fixArrayBuffers * * Takes an object and its copy as produced by the _deepClone function * below, and finds and fixes any ArrayBuffers that were cast to `{}` instead * of being cloned to new ArrayBuffers with the same content. * * It recurses into sub-objects, but skips arrays if they occur. */ function fixArrayBuffers(srcObj, dstObj) { var field, srcArr, dstArr; if (typeof(srcObj) !== 'object' || Array.isArray(srcObj) || srcObj === null) { return; } for (field in srcObj) { if (typeof(srcObj[field]) === 'object' && srcObj[field] !== null) { if (srcObj[field].toString() === '[object ArrayBuffer]') { dstObj[field] = new ArrayBuffer(srcObj[field].byteLength); srcArr = new Int8Array(srcObj[field]); dstArr = new Int8Array(dstObj[field]); dstArr.set(srcArr); } else { fixArrayBuffers(srcObj[field], dstObj[field]); } } } } RemoteStorage.util = { getEventEmitter: function () { var object = {}; var args = Array.prototype.slice.call(arguments); args.unshift(object); RemoteStorage.eventHandling.apply(RemoteStorage, args); object.emit = object._emit; return object; }, extend: function (target) { var sources = Array.prototype.slice.call(arguments, 1); sources.forEach(function (source) { for (var key in source) { target[key] = source[key]; } }); return target; }, asyncEach: function (array, callback) { return this.asyncMap(array, callback). then(function () { return array; }); }, asyncMap: function (array, callback) { var pending = Promise.defer(); var n = array.length, i = 0; var results = [], errors = []; function oneDone() { i++; if (i === n) { pending.resolve(results, errors); } } array.forEach(function (item, index) { var result; try { result = callback(item); } catch(exc) { oneDone(); errors[index] = exc; } if (typeof(result) === 'object' && typeof(result.then) === 'function') { result.then(function (res) { results[index] = res; oneDone(); }, function (error) { errors[index] = error; oneDone(); }); } else { oneDone(); results[index] = result; } }); return pending.promise; }, containingFolder: function (path) { if (path === '') { return '/'; } if (! path) { throw "Path not given!"; } return path.replace(/\/+/g, '/').replace(/[^\/]+\/?$/, ''); }, isFolder: function (path) { return path.substr(-1) === '/'; }, isDocument: function (path) { return path.substr(-1) !== '/'; }, baseName: function (path) { var parts = path.split('/'); if (this.isFolder(path)) { return parts[parts.length-2]+'/'; } else { return parts[parts.length-1]; } }, bindAll: function (object) { for (var key in this) { if (typeof(object[key]) === 'function') { object[key] = object[key].bind(object); } } }, equal: function (a, b, seen) { seen = seen || []; if (typeof(a) !== typeof(b)) { return false; } if (typeof(a) === 'number' || typeof(a) === 'boolean' || typeof(a) === 'string') { return a === b; } if (typeof(a) === 'function') { return a.toString() === b.toString(); } if (a instanceof ArrayBuffer && b instanceof ArrayBuffer) { // Without the following conversion the browsers wouldn't be able to // tell the ArrayBuffer instances apart. a = new Uint8Array(a); b = new Uint8Array(b); } // If this point has been reached, a and b are either arrays or objects. if (a instanceof Array) { if (a.length !== b.length) { return false; } for (var i = 0, c = a.length; i < c; i++) { if (!RemoteStorage.util.equal(a[i], b[i], seen)) { return false; } } } else { // Check that keys from a exist in b for (var key in a) { if (a.hasOwnProperty(key) && !(key in b)) { return false; } } // Check that keys from b exist in a, and compare the values for (var key in b) { if (!b.hasOwnProperty(key)) { continue; } if (!(key in a)) { return false; } var seenArg; if (typeof(b[key]) === 'object') { if (seen.indexOf(b[key]) >= 0) { // Circular reference, don't attempt to compare this object. // If nothing else returns false, the objects match. continue; } seenArg = seen.slice(); seenArg.push(b[key]); } if (!RemoteStorage.util.equal(a[key], b[key], seenArg)) { return false; } } } return true; }, equalObj: function (obj1, obj2) { console.warn('DEPRECATION WARNING: RemoteStorage.util.equalObj has been replaced by RemoteStorage.util.equal.'); return RemoteStorage.util.equal(obj1, obj2); }, deepClone: function (obj) { var clone; if (obj === undefined) { return undefined; } else { clone = JSON.parse(JSON.stringify(obj)); fixArrayBuffers(obj, clone); return clone; } }, pathsFromRoot: function (path) { var paths = [path]; var parts = path.replace(/\/$/, '').split('/'); while (parts.length > 1) { parts.pop(); paths.push(parts.join('/')+'/'); } return paths; }, md5sum: function(str) { // // http://www.myersdaily.org/joseph/javascript/md5.js // function md5cycle(x, k) { var a = x[0], b = x[1], c = x[2], d = x[3]; a = ff(a, b, c, d, k[0], 7, -680876936); d = ff(d, a, b, c, k[1], 12, -389564586); c = ff(c, d, a, b, k[2], 17, 606105819); b = ff(b, c, d, a, k[3], 22, -1044525330); a = ff(a, b, c, d, k[4], 7, -176418897); d = ff(d, a, b, c, k[5], 12, 1200080426); c = ff(c, d, a, b, k[6], 17, -1473231341); b = ff(b, c, d, a, k[7], 22, -45705983); a = ff(a, b, c, d, k[8], 7, 1770035416); d = ff(d, a, b, c, k[9], 12, -1958414417); c = ff(c, d, a, b, k[10], 17, -42063); b = ff(b, c, d, a, k[11], 22, -1990404162); a = ff(a, b, c, d, k[12], 7, 1804603682); d = ff(d, a, b, c, k[13], 12, -40341101); c = ff(c, d, a, b, k[14], 17, -1502002290); b = ff(b, c, d, a, k[15], 22, 1236535329); a = gg(a, b, c, d, k[1], 5, -165796510); d = gg(d, a, b, c, k[6], 9, -1069501632); c = gg(c, d, a, b, k[11], 14, 643717713); b = gg(b, c, d, a, k[0], 20, -373897302); a = gg(a, b, c, d, k[5], 5, -701558691); d = gg(d, a, b, c, k[10], 9, 38016083); c = gg(c, d, a, b, k[15], 14, -660478335); b = gg(b, c, d, a, k[4], 20, -405537848); a = gg(a, b, c, d, k[9], 5, 568446438); d = gg(d, a, b, c, k[14], 9, -1019803690); c = gg(c, d, a, b, k[3], 14, -187363961); b = gg(b, c, d, a, k[8], 20, 1163531501); a = gg(a, b, c, d, k[13], 5, -1444681467); d = gg(d, a, b, c, k[2], 9, -51403784); c = gg(c, d, a, b, k[7], 14, 1735328473); b = gg(b, c, d, a, k[12], 20, -1926607734); a = hh(a, b, c, d, k[5], 4, -378558); d = hh(d, a, b, c, k[8], 11, -2022574463); c = hh(c, d, a, b, k[11], 16, 1839030562); b = hh(b, c, d, a, k[14], 23, -35309556); a = hh(a, b, c, d, k[1], 4, -1530992060); d = hh(d, a, b, c, k[4], 11, 1272893353); c = hh(c, d, a, b, k[7], 16, -155497632); b = hh(b, c, d, a, k[10], 23, -1094730640); a = hh(a, b, c, d, k[13], 4, 681279174); d = hh(d, a, b, c, k[0], 11, -358537222); c = hh(c, d, a, b, k[3], 16, -722521979); b = hh(b, c, d, a, k[6], 23, 76029189); a = hh(a, b, c, d, k[9], 4, -640364487); d = hh(d, a, b, c, k[12], 11, -421815835); c = hh(c, d, a, b, k[15], 16, 530742520); b = hh(b, c, d, a, k[2], 23, -995338651); a = ii(a, b, c, d, k[0], 6, -198630844); d = ii(d, a, b, c, k[7], 10, 1126891415); c = ii(c, d, a, b, k[14], 15, -1416354905); b = ii(b, c, d, a, k[5], 21, -57434055); a = ii(a, b, c, d, k[12], 6, 1700485571); d = ii(d, a, b, c, k[3], 10, -1894986606); c = ii(c, d, a, b, k[10], 15, -1051523); b = ii(b, c, d, a, k[1], 21, -2054922799); a = ii(a, b, c, d, k[8], 6, 1873313359); d = ii(d, a, b, c, k[15], 10, -30611744); c = ii(c, d, a, b, k[6], 15, -1560198380); b = ii(b, c, d, a, k[13], 21, 1309151649); a = ii(a, b, c, d, k[4], 6, -145523070); d = ii(d, a, b, c, k[11], 10, -1120210379); c = ii(c, d, a, b, k[2], 15, 718787259); b = ii(b, c, d, a, k[9], 21, -343485551); x[0] = add32(a, x[0]); x[1] = add32(b, x[1]); x[2] = add32(c, x[2]); x[3] = add32(d, x[3]); } function cmn(q, a, b, x, s, t) { a = add32(add32(a, q), add32(x, t)); return add32((a << s) | (a >>> (32 - s)), b); } function ff(a, b, c, d, x, s, t) { return cmn((b & c) | ((~b) & d), a, b, x, s, t); } function gg(a, b, c, d, x, s, t) { return cmn((b & d) | (c & (~d)), a, b, x, s, t); } function hh(a, b, c, d, x, s, t) { return cmn(b ^ c ^ d, a, b, x, s, t); } function ii(a, b, c, d, x, s, t) { return cmn(c ^ (b | (~d)), a, b, x, s, t); } function md51(s) { txt = ''; var n = s.length, state = [1732584193, -271733879, -1732584194, 271733878], i; for (i=64; i<=s.length; i+=64) { md5cycle(state, md5blk(s.substring(i-64, i))); } s = s.substring(i-64); var tail = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; for (i=0; i<s.length; i++) tail[i>>2] |= s.charCodeAt(i) << ((i%4) << 3); tail[i>>2] |= 0x80 << ((i%4) << 3); if (i > 55) { md5cycle(state, tail); for (i=0; i<16; i++) tail[i] = 0; } tail[14] = n*8; md5cycle(state, tail); return state; } function md5blk(s) { var md5blks = [], i; for (i=0; i<64; i+=4) { md5blks[i>>2] = s.charCodeAt(i) + (s.charCodeAt(i+1) << 8) + (s.charCodeAt(i+2) << 16) + (s.charCodeAt(i+3) << 24); } return md5blks; } var hex_chr = '0123456789abcdef'.split(''); function rhex(n) { var s='', j=0; for(; j<4; j++) s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F]; return s; } function hex(x) { for (var i=0; i<x.length; i++) x[i] = rhex(x[i]); return x.join(''); } function md5(s) { return hex(md51(s)); } function add32(a, b) { return (a + b) & 0xFFFFFFFF; } if (md5('hello') !== '5d41402abc4b2a76b9719d911017c592') { function add32(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF), msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); } } return md5(str); } }; if (!RemoteStorage.prototype.util) { Object.defineProperty(RemoteStorage.prototype, 'util', { get: function () { console.log('DEPRECATION WARNING: remoteStorage.util was moved to RemoteStorage.util'); return RemoteStorage.util; } }); } })(); /** FILE: src/eventhandling.js **/ (function (global) { /** * Interface: eventhandling */ var methods = { /** * Method: addEventListener * * Install an event handler for the given event name */ addEventListener: function (eventName, handler) { if (typeof(eventName) !== 'string') { throw new Error('Argument eventName should be a string'); } if (typeof(handler) !== 'function') { throw new Error('Argument handler should be a function'); } RemoteStorage.log('[Eventhandling] Adding event listener', eventName, handler); this._validateEvent(eventName); this._handlers[eventName].push(handler); }, /** * Method: removeEventListener * * Remove a previously installed event handler */ removeEventListener: function (eventName, handler) { this._validateEvent(eventName); var hl = this._handlers[eventName].length; for (var i=0;i<hl;i++) { if (this._handlers[eventName][i] === handler) { this._handlers[eventName].splice(i, 1); return; } } }, _emit: function (eventName) { this._validateEvent(eventName); var args = Array.prototype.slice.call(arguments, 1); this._handlers[eventName].forEach(function (handler) { handler.apply(this, args); }); }, _validateEvent: function (eventName) { if (! (eventName in this._handlers)) { throw new Error("Unknown event: " + eventName); } }, _delegateEvent: function (eventName, target) { target.on(eventName, function (event) { this._emit(eventName, event); }.bind(this)); }, _addEvent: function (eventName) { this._handlers[eventName] = []; } }; /** * Method: eventhandling.on * * Alias for <addEventListener> **/ methods.on = methods.addEventListener; /** * Function: eventHandling * * Mixes event handling functionality into an object. * * The first parameter is always the object to be extended. * All remaining parameter are expected to be strings, interpreted as valid event * names. * * Example: * (start code) * var MyConstructor = function () { * eventHandling(this, 'connected', 'disconnected'); * * this._emit('connected'); * this._emit('disconnected'); * // This would throw an exception: * // this._emit('something-else'); * }; * * var myObject = new MyConstructor(); * myObject.on('connected', function () { console.log('connected'); }); * myObject.on('disconnected', function () { console.log('disconnected'); }); * // This would throw an exception as well: * // myObject.on('something-else', function () {}); * (end code) */ RemoteStorage.eventHandling = function (object) { var eventNames = Array.prototype.slice.call(arguments, 1); for (var key in methods) { object[key] = methods[key]; } object._handlers = {}; eventNames.forEach(function (eventName) { object._addEvent(eventName); }); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/wireclient.js **/ (function (global) { var RS = RemoteStorage; /** * Class: RemoteStorage.WireClient * * WireClient Interface * -------------------- * * This file exposes a get/put/delete interface on top of XMLHttpRequest. * It requires to be configured with parameters about the remotestorage server to * connect to. * Each instance of WireClient is always associated with a single remotestorage * server and access token. * * Usually the WireClient instance can be accessed via `remoteStorage.remote`. * * This is the get/put/delete interface: * * - #get() takes a path and optionally a ifNoneMatch option carrying a version * string to check. It returns a promise that will be fulfilled with the HTTP * response status, the response body, the MIME type as returned in the * 'Content-Type' header and the current revision, as returned in the 'ETag' * header. * - #put() takes a path, the request body and a content type string. It also * accepts the ifMatch and ifNoneMatch options, that map to the If-Match and * If-None-Match headers respectively. See the remotestorage-01 specification * for details on handling these headers. It returns a promise, fulfilled with * the same values as the one for #get(). * - #delete() takes a path and the ifMatch option as well. It returns a promise * fulfilled with the same values as the one for #get(). * * In addition to this, the WireClient has some compatibility features to work with * remotestorage 2012.04 compatible storages. For example it will cache revisions * from folder listings in-memory and return them accordingly as the "revision" * parameter in response to #get() requests. Similarly it will return 404 when it * receives an empty folder listing, to mimic remotestorage-01 behavior. Note * that it is not always possible to know the revision beforehand, hence it may * be undefined at times (especially for caching-roots). */ var hasLocalStorage; var SETTINGS_KEY = "remotestorage:wireclient"; var API_2012 = 1, API_00 = 2, API_01 = 3, API_02 = 4, API_HEAD = 5; var STORAGE_APIS = { 'draft-dejong-remotestorage-00': API_00, 'draft-dejong-remotestorage-01': API_01, 'draft-dejong-remotestorage-02': API_02, 'https://www.w3.org/community/rww/wiki/read-write-web-00#simple': API_2012 }; var isArrayBufferView; if (typeof(ArrayBufferView) === 'function') { isArrayBufferView = function (object) { return object && (object instanceof ArrayBufferView); }; } else { var arrayBufferViews = [ Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ]; isArrayBufferView = function (object) { for (var i=0;i<8;i++) { if (object instanceof arrayBufferViews[i]) { return true; } } return false; }; } var isFolder = RemoteStorage.util.isFolder; function addQuotes(str) { if (typeof(str) !== 'string') { return str; } if (str === '*') { return '*'; } return '"' + str + '"'; } function stripQuotes(str) { if (typeof(str) !== 'string') { return str; } return str.replace(/^["']|["']$/g, ''); } function readBinaryData(content, mimeType, callback) { var blob = new Blob([content], { type: mimeType }); var reader = new FileReader(); reader.addEventListener("loadend", function () { callback(reader.result); // reader.result contains the contents of blob as a typed array }); reader.readAsArrayBuffer(blob); } function getTextFromArrayBuffer(arrayBuffer, encoding) { var pending = Promise.defer(); if (typeof Blob === 'undefined') { var buffer = new Buffer(new Uint8Array(arrayBuffer)); pending.resolve(buffer.toString(encoding)); } else { var blob = new Blob([arrayBuffer]); var fileReader = new FileReader(); fileReader.addEventListener("loadend", function (evt) { pending.resolve(evt.target.result); }); fileReader.readAsText(blob, encoding); } return pending.promise; } function determineCharset(mimeType) { var charset = 'UTF-8'; var charsetMatch; if (mimeType) { charsetMatch = mimeType.match(/charset=(.+)$/); if (charsetMatch) { charset = charsetMatch[1]; } } return charset; } function cleanPath(path) { return path.replace(/\/+/g, '/').split('/').map(encodeURIComponent).join('/'); } function isFolderDescription(body) { return ((body['@context'] === 'http://remotestorage.io/spec/folder-description') && (typeof(body['items']) === 'object')); } function isSuccessStatus(status) { return [201, 204, 304].indexOf(status) >= 0; } function isErrorStatus(status) { return [401, 403, 404, 412].indexOf(status) >= 0; } var onErrorCb; /** * Class : RemoteStorage.WireClient **/ RS.WireClient = function (rs) { this.connected = false; /** * Event: change * never fired for some reason * * Event: connected * fired when the wireclient connect method realizes that it is * in posession of a token and a href **/ RS.eventHandling(this, 'change', 'connected', 'wire-busy', 'wire-done', 'not-connected'); onErrorCb = function (error){ if (error instanceof RemoteStorage.Unauthorized) { this.configure({token: null}); } }.bind(this); rs.on('error', onErrorCb); if (hasLocalStorage) { var settings; try { settings = JSON.parse(localStorage[SETTINGS_KEY]); } catch(e) {} if (settings) { setTimeout(function () { this.configure(settings); }.bind(this), 0); } } this._revisionCache = {}; if (this.connected) { setTimeout(this._emit.bind(this), 0, 'connected'); } }; RS.WireClient.REQUEST_TIMEOUT = 30000; RS.WireClient.prototype = { /** * Property: token * * Holds the bearer token of this WireClient, as obtained in the OAuth dance * * Example: * (start code) * * remoteStorage.remote.token * // -> 'DEADBEEF01==' */ /** * Property: href * * Holds the server's base URL, as obtained in the Webfinger discovery * * Example: * (start code) * * remoteStorage.remote.href * // -> 'https://storage.example.com/users/jblogg/' */ /** * Property: storageApi * * Holds the spec version the server claims to be compatible with * * Example: * (start code) * * remoteStorage.remote.storageApi * // -> 'draft-dejong-remotestorage-01' */ _request: function (method, uri, token, headers, body, getEtag, fakeRevision) { if ((method === 'PUT' || method === 'DELETE') && uri[uri.length - 1] === '/') { return Promise.reject("Don't " + method + " on directories!"); } var revision; var reqType; var self = this; if (token !== RemoteStorage.Authorize.IMPLIED_FAKE_TOKEN) { headers['Authorization'] = 'Bearer ' + token; } this._emit('wire-busy', { method: method, isFolder: isFolder(uri) }); return RS.WireClient.request(method, uri, { body: body, headers: headers, responseType: 'arraybuffer' }).then(function (response) { self._emit('wire-done', { method: method, isFolder: isFolder(uri), success: true }); self.online = true; if (isErrorStatus(response.status)) { RemoteStorage.log('[WireClient] Error response status', response.status); if (getEtag) { revision = stripQuotes(response.getResponseHeader('ETag')); } else { revision = undefined; } return Promise.resolve({statusCode: response.status, revision: revision}); } else if (isSuccessStatus(response.status) || (response.status === 200 && method !== 'GET')) { revision = stripQuotes(response.getResponseHeader('ETag')); RemoteStorage.log('[WireClient] Successful request', revision); return Promise.resolve({statusCode: response.status, revision: revision}); } else { var mimeType = response.getResponseHeader('Content-Type'); var body; if (getEtag) { revision = stripQuotes(response.getResponseHeader('ETag')); } else { revision = response.status === 200 ? fakeRevision : undefined; } var charset = determineCharset(mimeType); if ((!mimeType) || charset === 'binary') { RemoteStorage.log('[WireClient] Successful request with unknown or binary mime-type', revision); return Promise.resolve({statusCode: response.status, body: response.response, contentType: mimeType, revision: revision}); } else { return getTextFromArrayBuffer(response.response, charset).then(function (body) { RemoteStorage.log('[WireClient] Successful request', revision); return Promise.resolve({statusCode: response.status, body: body, contentType: mimeType, revision: revision}); }); } } }, function (error) { self._emit('wire-done', { method: method, isFolder: isFolder(uri), success: false }); return Promise.reject(error); }); }, /** * * Method: configure * * Sets the userAddress, href, storageApi, token, and properties of a * remote store. Also sets connected and online to true and emits the * 'connected' event, if both token and href are present. * * Parameters: * settings - An object that may contain userAddress (string or null), * href (string or null), storageApi (string or null), token (string * or null), and/or properties (the JSON-parsed properties object * from the user's WebFinger record, see section 10 of * http://tools.ietf.org/html/draft-dejong-remotestorage-03 * or null). * Fields that are not included (i.e. `undefined`), stay at * their current value. To set a field, include that field * with a `string` value. To reset a field, for instance when * the user disconnected their storage, or you found that the * token you have has expired, simply set that field to `null`. */ configure: function (settings) { if (typeof settings !== 'object') { throw new Error('WireClient configure settings parameter should be an object'); } if (typeof settings.userAddress !== 'undefined') { this.userAddress = settings.userAddress; } if (typeof settings.href !== 'undefined') { this.href = settings.href; } if (typeof settings.storageApi !== 'undefined') { this.storageApi = settings.storageApi; } if (typeof settings.token !== 'undefined') { this.token = settings.token; } if (typeof settings.properties !== 'undefined') { this.properties = settings.properties; } if (typeof this.storageApi !== 'undefined') { this._storageApi = STORAGE_APIS[this.storageApi] || API_HEAD; this.supportsRevs = this._storageApi >= API_00; } if (this.href && this.token) { this.connected = true; this.online = true; this._emit('connected'); } else { this.connected = false; } if (hasLocalStorage) { localStorage[SETTINGS_KEY] = JSON.stringify({ userAddress: this.userAddress, href: this.href, storageApi: this.storageApi, token: this.token, properties: this.properties }); } }, stopWaitingForToken: function () { if (!this.connected) { this._emit('not-connected'); } }, get: function (path, options) { var self = this; if (!this.connected) { return Promise.reject("not connected (path: " + path + ")"); } if (!options) { options = {}; } var headers = {}; if (this.supportsRevs) { if (options.ifNoneMatch) { headers['If-None-Match'] = addQuotes(options.ifNoneMatch); } } else if (options.ifNoneMatch) { var oldRev = this._revisionCache[path]; } return this._request('GET', this.href + cleanPath(path), this.token, headers, undefined, this.supportsRevs, this._revisionCache[path]) .then(function (r) { if (!isFolder(path)) { return Promise.resolve(r); } var itemsMap = {}; if (typeof(r.body) !== 'undefined') { try { r.body = JSON.parse(r.body); } catch (e) { return Promise.reject('Folder description at ' + self.href + cleanPath(path) + ' is not JSON'); } } if (r.statusCode === 200 && typeof(r.body) === 'object') { // New folder listing received if (Object.keys(r.body).length === 0) { // Empty folder listing of any spec r.statusCode = 404; } else if (isFolderDescription(r.body)) { // >= 02 spec for (var item in r.body.items) { self._revisionCache[path + item] = r.body.items[item].ETag; } itemsMap = r.body.items; } else { // < 02 spec Object.keys(r.body).forEach(function (key){ self._revisionCache[path + key] = r.body[key]; itemsMap[key] = {"ETag": r.body[key]}; }); } r.body = itemsMap; return Promise.resolve(r); } else { return Promise.resolve(r); } }); }, put: function (path, body, contentType, options) { if (!this.connected) { return Promise.reject("not connected (path: " + path + ")"); } if (!options) { options = {}; } if ((!contentType.match(/charset=/)) && (body instanceof ArrayBuffer || isArrayBufferView(body))) { contentType += '; charset=binary'; } var headers = { 'Content-Type': contentType }; if (this.supportsRevs) { if (options.ifMatch) { headers['If-Match'] = addQuotes(options.ifMatch); } if (options.ifNoneMatch) { headers['If-None-Match'] = addQuotes(options.ifNoneMatch); } } return this._request('PUT', this.href + cleanPath(path), this.token, headers, body, this.supportsRevs); }, 'delete': function (path, options) { if (!this.connected) { throw new Error("not connected (path: " + path + ")"); } if (!options) { options = {}; } var headers = {}; if (this.supportsRevs) { if (options.ifMatch) { headers['If-Match'] = addQuotes(options.ifMatch); } } return this._request('DELETE', this.href + cleanPath(path), this.token, headers, undefined, this.supportsRevs); } }; // Shared cleanPath used by Dropbox RS.WireClient.cleanPath = cleanPath; // Shared isArrayBufferView used by WireClient and Dropbox RS.WireClient.isArrayBufferView = isArrayBufferView; RS.WireClient.readBinaryData = readBinaryData; // Shared request function used by WireClient, GoogleDrive and Dropbox. RS.WireClient.request = function (method, url, options) { var pending = Promise.defer(); RemoteStorage.log('[WireClient]', method, url); var timedOut = false; var timer = setTimeout(function () { timedOut = true; pending.reject('timeout'); }, RS.WireClient.REQUEST_TIMEOUT); var xhr = new XMLHttpRequest(); xhr.open(method, url, true); if (options.responseType) { xhr.responseType = options.responseType; } if (options.headers) { for (var key in options.headers) { xhr.setRequestHeader(key, options.headers[key]); } } xhr.onload = function () { if (timedOut) { return; } clearTimeout(timer); pending.resolve(xhr); }; xhr.onerror = function (error) { if (timedOut) { return; } clearTimeout(timer); pending.reject(error); }; var body = options.body; if (typeof(body) === 'object') { if (isArrayBufferView(body)) { /* alright. */ //FIXME empty block } else if (body instanceof ArrayBuffer) { body = new Uint8Array(body); } } xhr.send(body); return pending.promise; }; Object.defineProperty(RemoteStorage.WireClient.prototype, 'storageType', { get: function () { if (this.storageApi) { var spec = this.storageApi.match(/draft-dejong-(remotestorage-\d\d)/); return spec ? spec[1] : '2012.04'; } } }); RS.WireClient._rs_init = function (remoteStorage) { hasLocalStorage = remoteStorage.localStorageAvailable(); remoteStorage.remote = new RS.WireClient(remoteStorage); this.online = true; }; RS.WireClient._rs_supported = function () { return !! global.XMLHttpRequest; }; RS.WireClient._rs_cleanup = function (remoteStorage){ if (hasLocalStorage){ delete localStorage[SETTINGS_KEY]; } remoteStorage.removeEventListener('error', onErrorCb); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/discover.js **/ (function (global) { // feature detection flags var haveXMLHttpRequest, hasLocalStorage; // used to store settings in localStorage var SETTINGS_KEY = 'remotestorage:discover'; // cache loaded from localStorage var cachedInfo = {}; /** * Class: RemoteStorage.Discover * * This function deals with the Webfinger lookup, discovering a connecting * user's storage details. * * The discovery timeout can be configured via * `RemoteStorage.config.discoveryTimeout` (in ms). * * Arguments: * * userAddress - user@host * * Returns: * * A promise for an object with the following properties. * * href - Storage base URL, * storageType - Storage type, * authUrl - OAuth URL, * properties - Webfinger link properties **/ RemoteStorage.Discover = function (userAddress) { if (userAddress in cachedInfo) { return Promise.resolve(cachedInfo[userAddress]); } var webFinger = new WebFinger({ tls_only: false, uri_fallback: true, request_timeout: 5000 }); var pending = Promise.defer(); webFinger.lookup(userAddress, function (err, response) { if (err) { return pending.reject(err.message); } else if ((typeof response.idx.links.remotestorage !== 'object') || (typeof response.idx.links.remotestorage.length !== 'number') || (response.idx.links.remotestorage.length <= 0)) { RemoteStorage.log("[Discover] WebFinger record for " + userAddress + " does not have remotestorage defined in the links section ", JSON.stringify(response.json)); return pending.reject("WebFinger record for " + userAddress + " does not have remotestorage defined in the links section."); } var rs = response.idx.links.remotestorage[0]; var authURL = rs.properties['http://tools.ietf.org/html/rfc6749#section-4.2'] || rs.properties['auth-endpoint']; var storageType = rs.properties['http://remotestorage.io/spec/version'] || rs.type; // cache fetched data cachedInfo[userAddress] = { href: rs.href, storageType: storageType, authURL: authURL, properties: rs.properties }; if (hasLocalStorage) { localStorage[SETTINGS_KEY] = JSON.stringify({ cache: cachedInfo }); } return pending.resolve(cachedInfo[userAddress]); }); return pending.promise; }; RemoteStorage.Discover._rs_init = function (remoteStorage) { hasLocalStorage = remoteStorage.localStorageAvailable(); if (hasLocalStorage) { var settings; try { settings = JSON.parse(localStorage[SETTINGS_KEY]); } catch(e) {} if (settings) { cachedInfo = settings.cache; } } }; RemoteStorage.Discover._rs_supported = function () { haveXMLHttpRequest = !! global.XMLHttpRequest; return haveXMLHttpRequest; }; RemoteStorage.Discover._rs_cleanup = function () { if (hasLocalStorage) { delete localStorage[SETTINGS_KEY]; } }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: node_modules/webfinger.js/src/webfinger.js **/ // -*- mode:js; js-indent-level:2 -*- /*! * webfinger.js * version 2.0.5 * http://github.com/silverbucket/webfinger.js * * Developed and Maintained by: * Nick Jennings <nick@silverbucket.net> 2012 - 2014 * * webfinger.js is released under the AGPL (see LICENSE). * * You don't have to do anything special to choose one license or the other and you don't * have to notify anyone which license you are using. * Please see the corresponding license file for details of these licenses. * You are free to use, modify and distribute this software, but all copyright * information must remain. * */ if (typeof XMLHttpRequest === 'undefined') { XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; } if (typeof window === 'undefined') { var window = {}; } (function (window, undefined) { // URI to property name map var LINK_URI_MAPS = { 'http://webfist.org/spec/rel': 'webfist', 'http://webfinger.net/rel/avatar': 'avatar', 'remotestorage': 'remotestorage', 'remoteStorage': 'remotestorage', 'http://www.packetizer.com/rel/share': 'share', 'http://webfinger.net/rel/profile-page': 'profile', 'me': 'profile', 'vcard': 'vcard', 'blog': 'blog', 'http://packetizer.com/rel/blog': 'blog', 'http://schemas.google.com/g/2010#updates-from': 'updates', 'https://camlistore.org/rel/server': 'camilstore' }; var LINK_PROPERTIES = { 'avatar': [], 'remotestorage': [], 'blog': [], 'vcard': [], 'updates': [], 'share': [], 'profile': [], 'webfist': [], 'camilstore': [] }; // list of endpoints to try, fallback from beginning to end. var URIS = ['webfinger', 'host-meta', 'host-meta.json']; var LOGABLE = false; if ((typeof console === 'object') && (typeof console.log === 'function')) { LOGABLE = true; } function _err(obj) { obj.toString = function () { return this.message; }; return obj; } /** * Function: WebFinger * * WebFinger constructor * * Returns: * * return WebFinger object */ function WebFinger(config) { if (typeof config !== 'object') { config = {}; } this.config = { debug: (typeof config.debug !== 'undefined') ? config.debug : false, tls_only: (typeof config.tls_only !== 'undefined') ? config.tls_only : true, webfist_fallback: (typeof config.webfist_fallback !== 'undefined') ? config.webfist_fallback : false, uri_fallback: (typeof config.uri_fallback !== 'undefined') ? config.uri_fallback : false, request_timeout: (typeof config.request_timeout !== 'undefined') ? config.request_timeout : 10000 }; } // make an http request and look for JRD response, fails if request fails // or response not json. WebFinger.prototype._fetchJRD = function (url, cb) { var self = this; self._log('Request URL: ' + url); var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { if (self._isValidJSON(xhr.responseText)) { cb(null, xhr.responseText); } else { cb(_err({ message: 'invalid json', url: url, status: xhr.status })); } } else if (xhr.status === 404) { cb(_err({ message: 'webfinger endpoint unreachable', url: url, status: xhr.status })); } else { cb(_err({ message: 'error during request', url: url, status: xhr.status })); } } }; xhr.open('GET', url, true); xhr.setRequestHeader('Accept', 'application/jrd+json, application/json'); xhr.send(); }; WebFinger.prototype._isValidJSON = function (str) { try { JSON.parse(str); } catch (e) { return false; } return true; }; WebFinger.prototype._isLocalhost = function (host) { console.log('checking: ', host); var local = /^localhost(\.localdomain)?(\:[0-9]+)?$/; return local.test(host); }; WebFinger.prototype._log = function () { var args = Array.prototype.splice.call(arguments, 0); if ((this.config.debug) && (LOGABLE)) { console.log.apply(window.console, args); } }; // processes JRD object as if it's a webfinger response object // looks for known properties and adds them to profile datat struct. WebFinger.prototype._processJRD = function (JRD, cb) { var self = this; var parsedJRD = JSON.parse(JRD); if ((typeof parsedJRD !== 'object') || (typeof parsedJRD.links !== 'object')) { if (typeof parsedJRD.error !== 'undefined') { cb(_err({ message: parsedJRD.error })); } else { cb(_err({ message: 'received unknown response from server' })); } return false; } var links = parsedJRD.links; var result = { // webfinger JRD - object, json, and our own indexing object: parsedJRD, json: JRD, idx: {} }; result.idx.properties = { 'name': undefined }; result.idx.links = JSON.parse(JSON.stringify(LINK_PROPERTIES)); // process links links.map(function (link, i) { if (LINK_URI_MAPS.hasOwnProperty(link.rel)) { if (result.idx.links[LINK_URI_MAPS[link.rel]]) { var entry = {}; Object.keys(link).map(function (item, n) { entry[item] = link[item]; }); result.idx.links[LINK_URI_MAPS[link.rel]].push(entry); } else { self._log('URI ' + links[i].rel + ' has no corresponding link property ' + LINK_URI_MAPS[link.rel]); } } }); // process properties var props = JSON.parse(JRD).properties; for (var key in props) { if (props.hasOwnProperty(key)) { if (key === 'http://packetizer.com/ns/name') { result.idx.properties.name = props[key]; } } } cb(null, result); }; WebFinger.prototype.lookup = function (address, cb) { if (typeof address !== 'string') { throw new Error('first parameter must be a user address'); } else if (typeof cb !== 'function') { throw new Error('second parameter must be a callback function'); } var self = this; var parts = address.replace(/ /g,'').split('@'); var host = parts[1]; // host name for this useraddress var uri_index = 0; // track which URIS we've tried already var protocol = 'https'; // we use https by default if (parts.length !== 2) { cb(_err({ message: 'invalid user address ( should be in the format of: user@host.com )' })); return false; } else if (self._isLocalhost(host)) { protocol = 'http'; } function _buildURL() { return protocol + '://' + host + '/.well-known/' + URIS[uri_index] + '?resource=acct:' + address; } // control flow for failures, what to do in various cases, etc. function _fallbackChecks(err) { if ((self.config.uri_fallback) && (host !== 'webfist.org') && (uri_index !== URIS.length - 1)) { // we have uris left to try uri_index = uri_index + 1; _call(); } else if ((!self.config.tls_only) && (protocol === 'https')) { // try normal http uri_index = 0; protocol = 'http'; _call(); } else if ((self.config.webfist_fallback) && (host !== 'webfist.org')) { // webfist attempt uri_index = 0; protocol = 'http'; host = 'webfist.org'; // webfist will // 1. make a query to the webfist server for the users account // 2. from the response, get a link to the actual webfinger json data // (stored somewhere in control of the user) // 3. make a request to that url and get the json // 4. process it like a normal webfinger response self._fetchJRD(_buildURL(), function (err, data) { // get link to users JRD if (err) { cb(err); return false; } self._processJRD(data, function (err, result) { if ((typeof result.idx.links.webfist === 'object') && (typeof result.idx.links.webfist[0].href === 'string')) { self._fetchJRD(result.idx.links.webfist[0].href, function (err, JRD) { if (err) { cb(err); } else { self._processJRD(JRD, cb); } }); } }); }); } else { cb(err); return false; } } function _call() { // make request self._fetchJRD(_buildURL(), function (err, JRD) { if (err) { _fallbackChecks(err); } else { self._processJRD(JRD, cb); } }); } setTimeout(_call, 0); }; window.WebFinger = WebFinger; })(window); if (typeof (define) === 'function' && define.amd) { define([], function () { return window.WebFinger; }); } else { try { module.exports = window.WebFinger; } catch (e) {} } /** FILE: src/authorize.js **/ (function (global) { function extractParams() { //FF already decodes the URL fragment in document.location.hash, so use this instead: var location = RemoteStorage.Authorize.getLocation(), hashPos = location.href.indexOf('#'), hash; if (hashPos === -1) { return; } hash = location.href.substring(hashPos+1); // if hash is not of the form #key=val&key=val, it's probably not for us if (hash.indexOf('=') === -1) { return; } return hash.split('&').reduce(function (m, kvs) { var kv = kvs.split('='); m[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); return m; }, {}); } RemoteStorage.ImpliedAuth = function (storageApi, redirectUri) { RemoteStorage.log('ImpliedAuth proceeding due to absent authURL; storageApi = ' + storageApi + ' redirectUri = ' + redirectUri); // Set a fixed access token, signalling to not send it as Bearer remoteStorage.remote.configure({ token: RemoteStorage.Authorize.IMPLIED_FAKE_TOKEN }); document.location = redirectUri; }; RemoteStorage.Authorize = function (authURL, scope, redirectUri, clientId) { RemoteStorage.log('[Authorize] authURL = ', authURL, 'scope = ', scope, 'redirectUri = ', redirectUri, 'clientId = ', clientId); var url = authURL, hashPos = redirectUri.indexOf('#'); url += authURL.indexOf('?') > 0 ? '&' : '?'; url += 'redirect_uri=' + encodeURIComponent(redirectUri.replace(/#.*$/, '')); url += '&scope=' + encodeURIComponent(scope); url += '&client_id=' + encodeURIComponent(clientId); if (hashPos !== -1) { url += '&state=' + encodeURIComponent(redirectUri.substring(hashPos+1)); } url += '&response_type=token'; RemoteStorage.Authorize.setLocation(url); }; RemoteStorage.Authorize.IMPLIED_FAKE_TOKEN = false; RemoteStorage.prototype.authorize = function (authURL) { this.access.setStorageType(this.remote.storageType); var scope = this.access.scopeParameter; var redirectUri = String(RemoteStorage.Authorize.getLocation()); var clientId = redirectUri.match(/^(https?:\/\/[^\/]+)/)[0]; RemoteStorage.Authorize(authURL, scope, redirectUri, clientId); }; /** * Get current document location * * Override this method if access to document.location is forbidden */ RemoteStorage.Authorize.getLocation = function () { return global.document.location; }; /** * Set current document location * * Override this method if access to document.location is forbidden */ RemoteStorage.Authorize.setLocation = function (location) { if (typeof location === 'string') { global.document.location.href = location; } else if (typeof location === 'object') { global.document.location = location; } else { throw "Invalid location " + location; } }; RemoteStorage.prototype.impliedauth = function () { RemoteStorage.ImpliedAuth(this.remote.storageApi, String(document.location)); }; RemoteStorage.Authorize._rs_supported = function () { return typeof(document) !== 'undefined'; }; var onFeaturesLoaded; RemoteStorage.Authorize._rs_init = function (remoteStorage) { onFeaturesLoaded = function () { var authParamsUsed = false; if (params) { if (params.error) { throw "Authorization server errored: " + params.error; } if (params.access_token) { remoteStorage.remote.configure({ token: params.access_token }); authParamsUsed = true; } if (params.remotestorage) { remoteStorage.connect(params.remotestorage); authParamsUsed = true; } if (params.state) { RemoteStorage.Authorize.setLocation('#'+params.state); } } if (!authParamsUsed) { remoteStorage.remote.stopWaitingForToken(); } }; var params = extractParams(), location; if (params) { location = RemoteStorage.Authorize.getLocation(); location.hash = ''; } remoteStorage.on('features-loaded', onFeaturesLoaded); }; RemoteStorage.Authorize._rs_cleanup = function (remoteStorage) { remoteStorage.removeEventListener('features-loaded', onFeaturesLoaded); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/access.js **/ (function(global) { var SETTINGS_KEY = "remotestorage:access"; /** * Class: RemoteStorage.Access * * Keeps track of claimed access and scopes. */ RemoteStorage.Access = function() { this.reset(); }; RemoteStorage.Access.prototype = { /** * Method: claim * * Claim access on a given scope with given mode. * * Parameters: * scope - An access scope, such as "contacts" or "calendar". * mode - Access mode to use. Either "r" or "rw". * * Example: * (start code) * remoteStorage.access.claim('contacts', 'r'); * remoteStorage.access.claim('pictures', 'rw'); */ claim: function(scope, mode) { if (typeof(scope) !== 'string' || scope.indexOf('/') !== -1 || scope.length === 0) { throw new Error('Scope should be a non-empty string without forward slashes'); } if (!mode.match(/^rw?$/)) { throw new Error('Mode should be either \'r\' or \'rw\''); } this._adjustRootPaths(scope); this.scopeModeMap[scope] = mode; }, get: function(scope) { return this.scopeModeMap[scope]; }, remove: function(scope) { var savedMap = {}; var name; for (name in this.scopeModeMap) { savedMap[name] = this.scopeModeMap[name]; } this.reset(); delete savedMap[scope]; for (name in savedMap) { this.set(name, savedMap[name]); } }, /** * Verify permission for a given scope. */ checkPermission: function(scope, mode) { var actualMode = this.get(scope); return actualMode && (mode === 'r' || actualMode === 'rw'); }, /** * Verify permission for a given path. */ checkPathPermission: function(path, mode) { if (this.checkPermission('*', mode)) { return true; } return !!this.checkPermission(this._getModuleName(path), mode); }, reset: function() { this.rootPaths = []; this.scopeModeMap = {}; }, /** * Return the module name for a given path. */ _getModuleName: function(path) { if (path[0] !== '/') { throw new Error('Path should start with a slash'); } var moduleMatch = path.replace(/^\/public/, '').match(/^\/([^\/]*)\//); return moduleMatch ? moduleMatch[1] : '*'; }, _adjustRootPaths: function(newScope) { if ('*' in this.scopeModeMap || newScope === '*') { this.rootPaths = ['/']; } else if (! (newScope in this.scopeModeMap)) { this.rootPaths.push('/' + newScope + '/'); this.rootPaths.push('/public/' + newScope + '/'); } }, _scopeNameForParameter: function(scope) { if (scope.name === '*' && this.storageType) { if (this.storageType === '2012.04') { return ''; } else if (this.storageType.match(/remotestorage-0[01]/)) { return 'root'; } } return scope.name; }, setStorageType: function(type) { this.storageType = type; } }; /** * Property: scopes * * Holds an array of claimed scopes in the form * > { name: "<scope-name>", mode: "<mode>" } */ Object.defineProperty(RemoteStorage.Access.prototype, 'scopes', { get: function() { return Object.keys(this.scopeModeMap).map(function(key) { return { name: key, mode: this.scopeModeMap[key] }; }.bind(this)); } }); Object.defineProperty(RemoteStorage.Access.prototype, 'scopeParameter', { get: function() { return this.scopes.map(function(scope) { return this._scopeNameForParameter(scope) + ':' + scope.mode; }.bind(this)).join(' '); } }); // Documented in src/remotestorage.js Object.defineProperty(RemoteStorage.prototype, 'access', { get: function() { var access = new RemoteStorage.Access(); Object.defineProperty(this, 'access', { value: access }); return access; }, configurable: true }); RemoteStorage.Access._rs_init = function() {}; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/env.js **/ (function (pMode) { var mode = pMode, env = {}, isBackground = false; RemoteStorage.Env = function () { return env; }; RemoteStorage.Env.isBrowser = function () { return mode === "browser"; }; RemoteStorage.Env.isNode = function () { return mode === "node"; }; RemoteStorage.Env.goBackground = function () { isBackground = true; RemoteStorage.Env._emit("background"); }; RemoteStorage.Env.goForeground = function () { isBackground = false; RemoteStorage.Env._emit("foreground"); }; RemoteStorage.Env._rs_init = function (remoteStorage) { RemoteStorage.eventHandling(RemoteStorage.Env, "background", "foreground"); function visibility() { if (document[env.hiddenProperty]) { RemoteStorage.Env.goBackground(); } else { RemoteStorage.Env.goForeground(); } } if ( mode === 'browser') { if ( typeof(document.hidden) !== "undefined" ) { env.hiddenProperty = "hidden"; env.visibilityChangeEvent = "visibilitychange"; } else if ( typeof(document.mozHidden) !== "undefined" ) { env.hiddenProperty = "mozHidden"; env.visibilityChangeEvent = "mozvisibilitychange"; } else if ( typeof(document.msHidden) !== "undefined" ) { env.hiddenProperty = "msHidden"; env.visibilityChangeEvent = "msvisibilitychange"; } else if ( typeof(document.webkitHidden) !== "undefined" ) { env.hiddenProperty = "webkitHidden"; env.visibilityChangeEvent = "webkitvisibilitychange"; } document.addEventListener(env.visibilityChangeEvent, visibility, false); visibility(); } }; RemoteStorage.Env._rs_cleanup = function (remoteStorage) { }; })(typeof(window) !== 'undefined' ? 'browser' : 'node'); /** FILE: src/i18n.js **/ (function () { /** * Class: RemoteStorage.I18n * * TODO add documentation **/ "use strict"; var dictionary = { "view_info": 'This app allows you to use your own storage. <a href="http://remotestorage.io/" target="_blank">Learn more!</a>', "view_connect": "<strong>Connect</strong> remote storage", "view_connecting": "Connecting <strong>%s</strong>", "view_offline": "Offline", "view_error_occured": "Sorry! An error occured.", "view_invalid_key": "Wrong key!", "view_confirm_reset": "Are you sure you want to reset everything? This will clear your local data and reload the page.", "view_get_me_out": "Get me out of here!", "view_error_plz_report": 'If this problem persists, please <a href="http://remotestorage.io/community/" target="_blank">let us know</a>!', "view_unauthorized": "Unauthorized! Click here to reconnect." }; RemoteStorage.I18n = { translate: function () { var str = arguments[0], params = Array.prototype.splice.call(arguments, 1); if (typeof dictionary[str] !== "string") { throw "Unknown translation string: " + str; } else { str = dictionary[str]; } return (str.replace(/%s/g, function (){ return params.shift(); })); }, getDictionary: function () { return dictionary; }, setDictionary: function (newDictionary) { dictionary = newDictionary; } }; })(); /** FILE: src/assets.js **/ /** THIS FILE WAS GENERATED BY build/compile-assets.js. DO NOT CHANGE IT MANUALLY, BUT INSTEAD CHANGE THE ASSETS IN assets/. **/ RemoteStorage.Assets = { cipherIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHdpZHRoPSIyNS4xNzciIHZlcnNpb249IjEuMSIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxwYXRoIGQ9Im0yNS4xNzcgNS41MzIzYy0wLjA1NjQtMC4xMTI5MS0wLjA1NjQtMC4yMjU4MS0wLjE2OTM2LTAuMzM4NzEtMC4xMTI5LTAuMTEyOS0wLjI4MjI1LTAuMTY5MzYtMC4zOTUxNi0wLjE2OTM2aC0xMS40MDNjLTAuNzMzLTIuODc5LTMuMzg2NC01LjAyNDItNi40OTEzLTUuMDI0Mi0zLjY2OTMgMC02LjcxNzcgMy4wNDg0LTYuNzE3NyA2LjcxNzcgMCAzLjcyNjMgMy4wNDg0IDYuNzE3MyA2LjcxNzcgNi43MTczIDMuMzMwNyAwIDYuMDQwMy0yLjQyNzQgNi42MDQ4LTUuNTg4N2gyLjU0MDN2My42Njk0YzAgMC4yODIyNiAwLjI4MjI2IDAuNTA4MDYgMC41NjQ1MiAwLjUwODA2aDEuNzVjMC4yODIyNiAwIDAuNTY0NTItMC4yMjU4IDAuNTY0NTItMC41MDgwNnYtMy42Njk0aDEuNDY3N3Y1LjY0NTJjMCAwLjI4MjI1IDAuMjI1OCAwLjUwODA2IDAuNTA4MDYgMC41MDgwNmgxLjgwNjRjMC4yODIyNiAwIDAuNTA4MDctMC4yMjU4MSAwLjU2NDUyLTAuNTA4MDZ2LTUuNjQ1MmgxLjUyNDJjMC4xMTI5MSAwIDAuMjgyMjYgMCAwLjM5NTE2LTAuMTEyOSAwLjExMjkxLTAuMTEyOSAwLjE2OTM2LTAuMjgyMjYgMC4xNjkzNi0wLjM5NTE2di0xLjgwNjR6bS0xOC40NTkgNS4wODA3Yy0yLjA4ODcgMC0zLjgzODctMS42OTM2LTMuODM4Ny0zLjgzODcgMC0yLjE0NTIgMS43NS0zLjgzODcgMy44Mzg3LTMuODM4NyAyLjE0NTIgMCAzLjgzODcgMS42OTM2IDMuODM4NyAzLjgzODcgMCAyLjE0NTItMS42OTM2IDMuODM4Ny0zLjgzODcgMy44Mzg3eiIgZmlsbD0iI2ZmZiIvPgo8L3N2Zz4K', connectIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMTAzNi40KSI+CiAgPHBhdGggZD0ibTEgMTA0Ny40di02aDd2LTRsNyA3LTcgN3YtNHoiIGZpbGw9IiNmZmYiLz4KIDwvZz4KPC9zdmc+Cg==', disconnectIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgdmVyc2lvbj0iMS4wIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxwYXRoIHN0eWxlPSJibG9jay1wcm9ncmVzc2lvbjp0Yjt0ZXh0LWluZGVudDowO2NvbG9yOiMwMDAwMDA7dGV4dC10cmFuc2Zvcm06bm9uZSIgZD0ibTguMDAwMSAwYy0wLjQ3MTQgMC0wLjk2MTAzIDAuNTQxOS0wLjk1IDF2NmMtMC4wMDc0NyAwLjUyODMxIDAuNDIxNjMgMSAwLjk1IDFzMC45NTc0Ny0wLjQ3MTY5IDAuOTUtMXYtNmMwLjAxNDYyMi0wLjYwNTEtMC40Nzg2LTEtMC45NS0xem0tMy4zNDM4IDIuNWMtMC4wODcxODYgMC4wMTkyOTQtMC4xNzE2MyAwLjA1MDk1OS0wLjI1IDAuMDkzNzUtMi45OTk1IDEuNTcxNS0zLjkxODQgNC43OTc5LTMuMTI1IDcuNDY4OCAwLjc5MzQgMi42NyAzLjI3OTkgNC45MzcgNi42ODc1IDQuOTM3IDMuMzU5MiAwIDUuODc3Mi0yLjE0OSA2LjcxOTItNC43ODEgMC44NDEtMi42MzIxLTAuMDU4LTUuODIzNC0zLjEyNS03LjU5NC0wLjQzNC0wLjI1MzYtMS4wNTktMC4wODk5LTEuMzEzIDAuMzQzNy0wLjI1MzYgMC40MzM2LTAuMDkgMS4wNTg5IDAuMzQ0IDEuMzEyNSAyLjM5MDggMS4zNzk4IDIuODgyNSAzLjQ5NDQgMi4yODEyIDUuMzc1LTAuNjAxMiAxLjg4MDYtMi4zNDQgMy40Mzc1LTQuOTA2MiAzLjQzNzUtMi41NzU5IDAtNC4yOTc2LTEuNjUwMi00Ljg3NS0zLjU5MzgtMC41Nzc2LTEuOTQzNS0wLjA0Ny00LjA0OCAyLjE4NzMtNS4yMTg3IDAuMzc4Ny0wLjIwNjMgMC41NzkxLTAuNjkyNSAwLjQ1NTgtMS4xMDU3LTAuMTIzMi0wLjQxMzMtMC41NTcyLTAuNzEwMy0wLjk4Ny0wLjY3NTUtMC4wMzEzLTAuMDAxNS0wLjA2MjYtMC4wMDE1LTAuMDkzOCAweiIgZmlsbD0iI2ZmZiIvPgo8L3N2Zz4K', dropbox: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QgPEBAhEOpfuQAABhZJREFUWMPVl31snVUdxz+/5/2577e3b7QbHaOD0nXshW4ZZkpGQmJYZkJUDAaZzCBGAxGd+pdZQsJIjCaKgFu09GWybIggm8yhMCsY92rcOkPHunbdtKOUbX36svX23uc+xz+eDsrWlztiNJzk5D7JPS+fc8739/2dA5+EsqJtyK18ZlCKbX9Lk6fd1uo5xbTVZmtwa4v35Np5Mry4TLYXCzAnyhsry2SwrmnokdnaTruq6i3e0lXl0tqQlkURCxwdDp9Th5p3+p9iS8afqk/VZq9kaZoDN8apdU3B1KFnmLde7AkezH0n3V0UQOJpz2hIsqEhLU+WOeAagmtCxISYBe1nVf4vfWrByYdSpyf3W9ziLapy6JgbAduAiBn2S1rCQBYODAQP7H01/zxby4JpAW5s8mproxypiRKNGIJrQNT8EMA1wTGEU8MBP/q7umPw0dSbAA3N3n3zI2yLG2oScPgbNYWICY4Be86o/le6g0W576bPXQWwcqvXdJ2t1idMsA1hJoCoCRfGYdOhwsa4TUWFrr7pGmDrzAiQCHfD//Xxwk/33Z/6HoA0tnhLXZ3XMoYqsy4PYs4M4Ohg6pB2ddqO+vR6BWL27AARXbBNiBjwh9Oqs+O8ukcT4eaopjLqGsJSCdSX29SX23x/lctXlzgE1zBAANxWIQuGxlWNACxr8WozJp0lljKsGXbA0qGu1GRBxsTUQRAGLgboIuQVvHI8S+f7eeK2TLsDSQd296rhPaeDm09+PdX/gQYqN3uZ+jh7ro+oRusKDdgmVEY1GqstSiOhdegCmoQAIoImIWTPYIHdXVlyBYhaVwLA70+rPz7fllvLi2W5KcPw9q3eS/VJ7kmYgm1A3BIWV5osq7IIlMLUQJOrAXQBXQtr1BR2d2XpOu8TtULR+gq2nQh+vv8rqUdnNaKGZm/9qnJpmp/U+fxCB5lYsaGFdTYAY9L3jmNj9F9S7OgKVh9/KNVelBVf8untv8TYSS8gbsrHyh8C2LqQtGE0z9CJYfVuUblgRZv3WGOJvJG0cF8/lWPNdo+O93xsHYoVuqkL/xzIs/HPHt2DPg0Zko+v0I8vbfHun9aKE5sH9YaobJsf5V4mRLXv33kSlmAYwspqgw23R7A1EJlahKYOSsHTB0cZHQ9IOBA3NSrjGo4hWAY82xH8rH1b/jF2laoPAOb80jPqYtKTMdRcTQNd+xAgbgmuJbiGELfh3lsc7q41KQSTABBcC1qPjLH/XzniNqScsP1kgMsm9nJ34e2mNcmFAMby1qFPZyz1WlxXrprhuEUgUPDbd8Y59n6edbe61KZ1TF14vSfPLw5dYjhXIOMIM6lGAV+u0+tv+ttI/2+6/LsMQVXpUFCAqJkS9MT5anB2NGDjWxf5Yp3DvjN5th/LUhETolaRTqigxMGIWVKtHVyX2tGTJd2X5agUIfi8CmvUFOKGT++gT8wqLlKUgnwATxwq7P32m35Z+32pPQZA54MpH1iSb/XWZmx2VthTD1AATCBlCZ+dpwNg6EJjlUH3hQIKRaCujhZFaOPtfUH+8HvBnQceSP11yjA8vC616+A5FevL8jt/YiCR0HiQcAUVrnDHHO0jHTUNllXrpC0NRXiefjAxM4rhHLzQpZqf+eFFd/LkM17JGlu9p+xC8IgPhGlaqE1rNJZrxOzQok0dnjviY+nhbSntCH3DAWN+QMIWEhYsqTD4wYHChrPfSP9kqnmM6QAMkYtz4xqmDqeGA+rLNObGZVozkglx1ZfqZAvC2ZGAz9RYlEbAlsLoNd+Kx5RqO5/njKXDsnKdhCXFOaFAZUzjznlhyt5xIjiSLbBz2oVO98fRdalOoGZ5m/dUQ4pvJZ3Zr/CXlS5A74gabzlYePztr6U2faxr+eRy/RYvtjgjHauvkxvi9oTDXaGBuAUJWyh1hb3vqsOvfiG5/L/yMAE483BqdNeuXO3LvcGX3vEUhsZVsaYL9IzACz3BXcVOXvQOfKRsupBZv8R4bnW19rmqGPzqHz4BcMGn5U/Hgod5oiT3P3kvVj7rrfnx/pHBu7d7Azc1eY3/l0drzWbPXNjsGXySy38AbtMqneWU7BkAAAAASUVORK5CYII=', googledrive: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QgPEA85ztzJcQAABZVJREFUWMPtl1uoXVcVhr8x5tprn7M1NG1i0pQqSG2jLcXipYJXjPogqFgpaHMSFUkpIjU+leKbDxIQSiHgjZgmrfXgQ6SKj5Ji7YVS05aUUqKQlNLQeDnN5Zzk9Jy99xy/D3OttU/StDlV33TBZM3FXmuMf/5jjv+fG/7XL1vti9tnv3Dtnnf+87JY8YmZNxEMM1sZ7tWpjz764mriVqvKvmfb1ONLy3+dGyWu6EWbvQwoydv5BMSqFuereakmfnls1GP25IDaBGYYjplhljDz5tk7YMtPfurAf6UE9Z6tNwDPAPXwtcxL1x9n4zRgDjjm1gCyC6JpCLoW/OX65of1nzCwG6gNo3aYeXF981mTvK2/WWFiMmoj7X+z5JcE0N87c4e7b3EvyTwZT5/r8ezZHu6GuWGpSegJ8/ZeBu6fHv35s1/7t0rQv29mjWF/ATZ1L4bQwohrpkYc/sBpwhJYAVdKYECzYAESIk4Am3sf+sPCW2LAzb9jbpvMDXfD3fEqkRIcGdbsevlt9LylPYG1K6/K3QzK75uAr78lBgb3b7sc2cl2Uaa21sDiGMvB2iQeu/EMm6bKHjD3SUsCEChnpEAKiLisd/PB+UsyMPjZNwzzh1ixcnOfsFCX51NU/PTvA6pkTUdYw4R3zyu1ArMDqyvBQB82+FiJUQJ4C8YgVT1SSvSTs+vEmkcwe7qEsUnt233Aij0BW4ZPbfngKpRQs7hXpYQNvRiuEtATWOW4bLi+z04pJbCnBAkBJggBQlIBIZCUJM0Cm9+QgcED2+/G7BprdMZaAFZExm1FWcz+NLdj32G/6XfPCB5GoJKp7H5FARHRtgRI1y0/+cm7Lwpg+v7t64DvNd5S2mqirKXHy6RoArp1Ykrc2hKtKCtXlNEyoQ6Ydi498fF1F2FAdwEbV9UnZne+8q19Z7o63vTb+TPnRneeWxwxHGdyziii6wApQNEydKUUd5wHYGrftvci7tKKLSME5bvCaruynI9rNL7vdZgiHhiP898Wl8bMnxty+uyIhcURo1FgjSg1DCDph4uPfuR9AFbvvS25p2cxbiyKVuh2o1O44n2lLLacb5v75v5fX6yl5h753IwUD+YcRAQ5B6FMMhj0jboSRhnAE258wvp7Z7aYcbCYCeCGt97ubfICLDP/q4WZ32x7M20fPfb+hxbH9ZdjHOQIIoR74EDywA3coa6MqtJnrP+LmRmcB63ob8dA1wllRm95LVc//22S16TGeKqqpqoHk10ESGJj/zjjgIhAISKCyJmcY6Uu8Pbq7C0V6ABh35dzvYWQG0QAhmSYCaUlNhzdCrlX2jpE6tV4b9DYcGFKEgG8svQucoicC4CsII8zeTxutAEQzx1duPL3vrxjdlnou0SDLdTulxJQmalXNzN98jpEJiSo+qTeoEnsnWC5lVZNRhkOZiq0G8XCmz1gpp3j/ZYdYLhj9qCkn3fJQ4QKeh9OccWxz6O0hGKM9wakeoBEZ1BmqfOMyYFk4gXS+edG4J4ju6/644VK+AOJhSIYpVRBpn/qPVRL65A51dRavJoG2UQkOqf0hgVrGG7u6syoJDObB+55nRANb589Afy40W0UwkY91h39CiLweg1UU+W3ohLNvC2VurJ1htR6A3QaYPCjI7uvOvGGOlfv2XoSuBzEhmNfZXDqBrweUPVqUlWodneSG+6J1NTevThfDpEjmnsmzuuCPPfCvRvfcakT0S2Aeq9tYPr0ZryeBvOOlZBKUIEiCAVZwTgy41x6v6hm0LFZ4o7N7IuXPA+EDx+XjQ+tP/4lUrW2vCI1ydR0iYgmWdtu4yzG7bOiAdn8iYlA0iFJh1Z1JJv+ye2b3n1419XRH2riP0aqqlKClABIjUMW+rtSlw5qmCpgsynnl56/d+M/+P91wfUvQjDgTzx9h9AAAAAASUVORK5CYII=', nocipherIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogPHBhdGggZD0ibSAxMy4yMDMxMjQsMTEuNzczNDM4IGMgMC4yODEyNSwwLjI4MTI1IDAuNDIxODc1LDAuNjA5Mzc1IDAuNDIxODc1LDEuMDMxMjUgMCwwLjM3NSAtMC4xNDA2MjUsMC43NSAtMC40MjE4NzUsMS4wMzEyNSAtMC4yODEyNSwwLjIzNDM3NSAtMC42MDkzNzUsMC4zNzUgLTEuMDMxMjUsMC4zNzUgLTAuMzc1LDAgLTAuNzUsLTAuMTQwNjI1IC0xLjAzMTI1LC0wLjM3NSAwLDAgLTMuMTg3NDk4MSwtMy42NTYyNSAtMy4xODc0OTgxLC0zLjY1NjI1IDAsMCAtMy4xNDA2MjUsMy42NTYyNSAtMy4xNDA2MjUsMy42NTYyNSAtMC4yODEyNSwwLjIzNDM3NSAtMC42NTYyNSwwLjM3NSAtMS4wMzEyNSwwLjM3NSAtMC40MjE4NzUsMCAtMC43NSwtMC4xNDA2MjUgLTEuMDMxMjUsLTAuMzc1IC0wLjI4MTI1LC0wLjI4MTI1IC0wLjM3NSwtMC42NTYyNSAtMC4zNzUsLTEuMDMxMjUgMCwtMC40MjE4NzUgMC4wOTM3NSwtMC43NSAwLjM3NSwtMS4wMzEyNSAwLDAgMy4zMjgxMjUsLTMuNzUwMDAwNSAzLjMyODEyNSwtMy43NTAwMDA1IDAsMCAtMy4zMjgxMjUsLTMuNzk2ODc1IC0zLjMyODEyNSwtMy43OTY4NzUgLTAuMjgxMjUsLTAuMjgxMjUgLTAuMzc1LC0wLjYwOTM3NSAtMC4zNzUsLTEuMDMxMjUgMCwtMC4zNzUgMC4wOTM3NSwtMC43NSAwLjM3NSwtMS4wMzEyNSAwLjI4MTI1LC0wLjIzNDM3NSAwLjYwOTM3NSwtMC4zNzUgMS4wMzEyNSwtMC4zNzUgMC4zNzUsMCAwLjc1LDAuMTQwNjI1IDEuMDMxMjUsMC4zNzUgMCwwIDMuMTQwNjI1LDMuNjU2MjUgMy4xNDA2MjUsMy42NTYyNSAwLDAgMy4xODc0OTgxLC0zLjY1NjI1IDMuMTg3NDk4MSwtMy42NTYyNSAwLjI4MTI1LC0wLjIzNDM3NSAwLjY1NjI1LC0wLjM3NSAxLjAzMTI1LC0wLjM3NSAwLjQyMTg3NSwwIDAuNzUsMC4xNDA2MjUgMS4wMzEyNSwwLjM3NSAwLjI4MTI1LDAuMjgxMjUgMC40MjE4NzUsMC42NTYyNSAwLjQyMTg3NSwxLjAzMTI1IDAsMC40MjE4NzUgLTAuMTQwNjI1LDAuNzUgLTAuNDIxODc1LDEuMDMxMjUgMCwwIC0zLjMyODEyMzEsMy43OTY4NzUgLTMuMzI4MTIzMSwzLjc5Njg3NSAwLDAgMy4zMjgxMjMxLDMuNzUwMDAwNSAzLjMyODEyMzEsMy43NTAwMDA1IiBmaWxsPSIjZmZmIi8+Cjwvc3ZnPgo=', remoteStorageIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIzMiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxkZWZzPgogIDxyYWRpYWxHcmFkaWVudCBpZD0iYSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN5PSI1NzEuNDIiIGN4PSIxMDQ2LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLjE0NDMzIDAgMCAuMTY2NjcgMTIwMS41IDg3Ny4xMSkiIHI9Ijk2Ij4KICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZmNGEwNCIgc3RvcC1vcGFjaXR5PSIuNzYxNTQiIG9mZnNldD0iMCIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjZmY0YTA0IiBvZmZzZXQ9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogPC9kZWZzPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEzMzYuNiAtOTU2LjM1KSI+CiAgPHBhdGggc3R5bGU9ImNvbG9yOiMwMDAwMDAiIGQ9Im0xMzUyLjYgOTU2LjM1IDAuMjg4NiAxNS4xMzYgMTMuNTY3LTcuMTM1Mi0xMy44NTUtOC4wMDExemwtMTMuODU1IDguMDAxMSAxMy41NjcgNy4xMzUyIDAuMjg4Ny0xNS4xMzZ6bS0xMy44NTUgOC4wMDExdjE1Ljk5OGwxMi45NTgtNy44MTYyLTEyLjk1OC04LjE4MTV6bTAgMTUuOTk4IDEzLjg1NSA4LjAwMTEtMC42MDg5LTE1LjMxNy0xMy4yNDYgNy4zMTU2em0xMy44NTUgOC4wMDExIDEzLjg1NS04LjAwMTEtMTMuMjUxLTcuMzE1Ni0wLjYwNDQgMTUuMzE3em0xMy44NTUtOC4wMDExdi0xNS45OThsLTEyLjk2MiA4LjE4MTUgMTIuOTYyIDcuODE2MnoiIGZpbGw9InVybCgjYSkiLz4KIDwvZz4KPC9zdmc+Cg==', remoteStorageIconCiphered: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIzMiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxkZWZzPgogIDxyYWRpYWxHcmFkaWVudCBpZD0iYSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN5PSI1NzEuNDIiIGN4PSIxMDQ2LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLjE0NDMzIDAgMCAuMTY2NjcgMTIwMS41IDg3Ny4xMSkiIHI9Ijk2Ij4KICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZmNGEwNCIgc3RvcC1vcGFjaXR5PSIuNzYxNTQiIG9mZnNldD0iMCIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjZmY0YTA0IiBvZmZzZXQ9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogPC9kZWZzPgogPHBhdGggc3R5bGU9ImNvbG9yOiMwMDAwMDAiIGQ9Im0xNiAwbDAuMTI1IDYuMzc1YzIuMDk4IDAuMDY3IDMuNzUgMS43NTk1IDMuNzUgMy44NzV2MS45NjloMS45MzcgMC4wMzJsOC00LjIxOS0xMy44NDQtOHpsLTEzLjg0NCA4IDggNC4yMTloMC4wMzIgMS45MDZ2LTEuOTY5YzAtMi4xMTU1IDEuNjgzLTMuODA4IDMuNzgxLTMuODc1bDAuMTI1LTYuMzc1em0tMTMuODQ0IDh2MTZsNy45OTk4LTQuODQ0di02LjA5NGwtNy45OTk4LTUuMDYyem0wIDE2bDEzLjg0NCA4LTAuMzc1LTEwLjA2MmgtNS40Njl2LTIuMzQ0bC03Ljk5OTggNC40MDZ6bTEzLjg0NCA4bDEzLjg0NC04LTgtNC40MDZ2Mi4zNDRoLTUuNDY5bC0wLjM3NSAxMC4wNjJ6bTEzLjg0NC04di0xNmwtOCA1LjA2MnY2LjA5NGw4IDQuODQ0em0tMTMuOTY5LTE3Yy0xLjczNSAwLjA2NjYtMy4xMjUgMS40OTg3LTMuMTI1IDMuMjV2MS45NjloMy4wMzFsMC4wOTQtNS4yMTl6bTAuMjUgMGwwLjA5NCA1LjIxOWgzLjAzMXYtMS45NjljMC0xLjc1MTMtMS4zOS0zLjE4MzQtMy4xMjUtMy4yNXptLTQuNzUgNS44NDRsNC4zNDQgMi4yODEgMC4wMzEtMi4yODFoLTQuMzc1em00Ljg3NSAwbDAuMDMxIDIuMjgxIDQuMzQ0LTIuMjgxaC00LjM3NXptLTUuNDM4IDAuNjI1djUuMzEybDQuMjgyLTIuNTkzLTQuMjgyLTIuNzE5em0xMC4zNzYgMGwtNC4yODIgMi43MTkgNC4yODIgMi41OTN2LTUuMzEyem0tNS43ODIgMy4yMTlsLTQuNTk0IDIuNTMxdjIuMDYyaDQuNzgybC0wLjE4OC00LjU5M3ptMS4xODggMGwtMC4xODggNC41OTNoNC43ODJ2LTIuMDYybC00LjU5NC0yLjUzMXoiIGZpbGw9InVybCgjYSkiLz4KPC9zdmc+Cg==', remoteStorageIconError: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIzMiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxkZWZzPgogIDxyYWRpYWxHcmFkaWVudCBpZD0iYSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN5PSI1NzEuNDIiIGN4PSIxMDQ2LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLjE0NDMzIDAgMCAuMTY2NjcgMTIwMS41IDg3Ny4xMSkiIHI9Ijk2Ij4KICAgPHN0b3Agc3RvcC1jb2xvcj0iI2U5MDAwMCIgc3RvcC1vcGFjaXR5PSIuNzYwNzgiIG9mZnNldD0iMCIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjZTkwMDAwIiBvZmZzZXQ9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogPC9kZWZzPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEzMzYuNiAtOTU2LjM1KSI+CiAgPHBhdGggc3R5bGU9ImNvbG9yOiMwMDAwMDAiIGQ9Im0xMzUyLjYgOTU2LjM1IDAuMjg4NiAxNS4xMzYgMTMuNTY3LTcuMTM1Mi0xMy44NTUtOC4wMDExemwtMTMuODU1IDguMDAxMSAxMy41NjcgNy4xMzUyIDAuMjg4Ny0xNS4xMzZ6bS0xMy44NTUgOC4wMDExdjE1Ljk5OGwxMi45NTgtNy44MTYyLTEyLjk1OC04LjE4MTV6bTAgMTUuOTk4IDEzLjg1NSA4LjAwMTEtMC42MDg5LTE1LjMxNy0xMy4yNDYgNy4zMTU2em0xMy44NTUgOC4wMDExIDEzLjg1NS04LjAwMTEtMTMuMjUxLTcuMzE1Ni0wLjYwNDQgMTUuMzE3em0xMy44NTUtOC4wMDExdi0xNS45OThsLTEyLjk2MiA4LjE4MTUgMTIuOTYyIDcuODE2MnoiIGZpbGw9InVybCgjYSkiLz4KIDwvZz4KPC9zdmc+Cg==', remoteStorageIconOffline: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIiIHdpZHRoPSIzMiIgdmVyc2lvbj0iMS4xIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KIDxkZWZzPgogIDxyYWRpYWxHcmFkaWVudCBpZD0iYSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGN5PSI1NzEuNDIiIGN4PSIxMDQ2LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLjE0NDMzIDAgMCAuMTY2NjcgMTIwMS41IDg3Ny4xMSkiIHI9Ijk2Ij4KICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5Njk2OSIgc3RvcC1vcGFjaXR5PSIuNzYxNTQiIG9mZnNldD0iMCIvPgogICA8c3RvcCBzdG9wLWNvbG9yPSIjNjc2NzY3IiBvZmZzZXQ9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogPC9kZWZzPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEzMzYuNiAtOTU2LjM1KSI+CiAgPHBhdGggc3R5bGU9ImNvbG9yOiMwMDAwMDAiIGQ9Im0xMzUyLjYgOTU2LjM1IDAuMjg4NiAxNS4xMzYgMTMuNTY3LTcuMTM1Mi0xMy44NTUtOC4wMDExemwtMTMuODU1IDguMDAxMSAxMy41NjcgNy4xMzUyIDAuMjg4Ny0xNS4xMzZ6bS0xMy44NTUgOC4wMDExdjE1Ljk5OGwxMi45NTgtNy44MTYyLTEyLjk1OC04LjE4MTV6bTAgMTUuOTk4IDEzLjg1NSA4LjAwMTEtMC42MDg5LTE1LjMxNy0xMy4yNDYgNy4zMTU2em0xMy44NTUgOC4wMDExIDEzLjg1NS04LjAwMTEtMTMuMjUxLTcuMzE1Ni0wLjYwNDQgMTUuMzE3em0xMy44NTUtOC4wMDExdi0xNS45OThsLTEyLjk2MiA4LjE4MTUgMTIuOTYyIDcuODE2MnoiIGZpbGw9InVybCgjYSkiLz4KIDwvZz4KPC9zdmc+Cg==', syncIcon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDg3LjUgMTAwIiB4bWw6c3BhY2U9InByZXNlcnZlIiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTUuOTk5OTk5IDE2IiB3aWR0aD0iMTYiIHZlcnNpb249IjEuMSIgeT0iMHB4IiB4PSIwcHgiIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC01LjUxMTIgLTc2LjUyNSkiIGRpc3BsYXk9Im5vbmUiPgoJPHBhdGggZGlzcGxheT0iaW5saW5lIiBkPSJtNTEuNDczIDQyLjI1NS0yLjIwNSAyLjIxMmMxLjQ3OCAxLjQ3NyAyLjI5NSAzLjQ0MiAyLjI5NSA1LjUzMyAwIDQuMzA5LTMuNTA0IDcuODEyLTcuODEyIDcuODEydi0xLjU2MmwtMy4xMjUgMy4xMjUgMy4xMjQgMy4xMjV2LTEuNTYyYzYuMDI5IDAgMTAuOTM4LTQuOTA2IDEwLjkzOC0xMC45MzggMC0yLjkyNy0xLjE0MS01LjY3Ni0zLjIxNS03Ljc0NXoiLz4KCTxwYXRoIGRpc3BsYXk9ImlubGluZSIgZD0ibTQ2Ljg3NSA0MC42MjUtMy4xMjUtMy4xMjV2MS41NjJjLTYuMDMgMC0xMC45MzggNC45MDctMTAuOTM4IDEwLjkzOCAwIDIuOTI3IDEuMTQxIDUuNjc2IDMuMjE3IDcuNzQ1bDIuMjAzLTIuMjEyYy0xLjQ3Ny0xLjQ3OS0yLjI5NC0zLjQ0Mi0yLjI5NC01LjUzMyAwLTQuMzA5IDMuNTA0LTcuODEyIDcuODEyLTcuODEydjEuNTYybDMuMTI1LTMuMTI1eiIvPgo8L2c+CjxwYXRoIGZpbGw9IiNmZmYiIGQ9Im0xMCAwbC0wLjc1IDEuOTA2MmMtMS4wMDc4LTAuMjk0Mi0zLjQ1ODYtMC43NzA4LTUuNjU2MiAwLjkzNzYgMC0wLjAwMDItMy45MzAyIDIuNTk0MS0yLjA5MzggNy41OTQybDEuNjU2Mi0wLjcxOTJzLTEuNTM5OS0zLjExMjIgMS42ODc2LTUuNTMxM2MwIDAgMS42OTU3LTEuMTMzOSAzLjY4NzQtMC41OTM3bC0wLjcxODcgMS44MTI0IDMuODEyNS0xLjYyNS0xLjYyNS0zLjc4MTJ6Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTE0IDUuNTYyNWwtMS42NTYgMC43MTg3czEuNTQxIDMuMTEzNS0xLjY4OCA1LjUzMDhjMCAwLTEuNzI3MiAxLjEzNS0zLjcxODUgMC41OTRsMC43NS0xLjgxMi0zLjgxMjUgMS41OTQgMS41OTM4IDMuODEyIDAuNzgxMi0xLjkwNmMxLjAxMTMgMC4yOTUgMy40NjE1IDAuNzY2IDUuNjU2LTAuOTM4IDAgMCAzLjkyOC0yLjU5NCAyLjA5NC03LjU5MzV6Ii8+Cjwvc3ZnPgo=', widget: '<div class="rs-bubble rs-hidden"> <div class="rs-bubble-text remotestorage-initial remotestorage-error remotestorage-authing remotestorage-offline"> <span class="rs-status-text">{{view_connect}}</span> </div> <div class="rs-bubble-expandable"> <!-- error --> <div class="remotestorage-error"> <pre class="rs-status-text rs-error-msg">{{ERROR_MSG}}</pre> <button class="remotestorage-reset">{{view_get_me_out}}</button> <p class="rs-centered-text rs-error-plz-report">{{view_error_plz_report}}</p> </div> <!-- connected --> <div class="rs-bubble-text remotestorage-connected"> <strong class="userAddress">{{USER_ADDRESS}}</strong> <p class="remotestorage-unauthorized">{{view_unauthorized}}</p> <p class="remotestorage-invalid-key">{{view_invalid_key}}</p> <form novalidate class="remotestorage-cipher-form"> <input placeholder="Secret key" name="userSecretKey" novalidate> <button class="rs-cipher" name="rs-cipher" title="cipher" disabled="disabled"> <img> </button> <button class="rs-nocipher" name="rs-nocipher" title="no cipher"> <img> </button> </form> </div> <div class="rs-content remotestorage-connected"> <button class="rs-sync" title="sync"><img></button> <button class="rs-disconnect" title="disconnect"><img></button> </div> <!-- initial --> <form novalidate class="remotestorage-initial"> <input type="email" placeholder="user@provider.com" name="userAddress" novalidate> <button class="connect" name="connect" title="connect" disabled="disabled"> <img> </button> </form> <div class="rs-info-msg remotestorage-initial">{{view_info}}</div> </div> </div> <img class="rs-dropbox rs-backends rs-action" alt="Connect to Dropbox"> <img class="rs-googledrive rs-backends rs-action" alt="Connect to Google Drive"> <img class="rs-cube rs-action"> ', widgetCss: '/** encoding:utf-8 **/ /* RESET */ #remotestorage-widget{text-align:left;}#remotestorage-widget input, #remotestorage-widget button{font-size:11px;}#remotestorage-widget form input[type=email]{margin-bottom:0;/* HTML5 Boilerplate */}#remotestorage-widget form input[type=submit]{margin-top:0;/* HTML5 Boilerplate */}/* /RESET */ #remotestorage-widget, #remotestorage-widget *{-moz-box-sizing:border-box;box-sizing:border-box;}#remotestorage-widget{position:absolute;right:10px;top:10px;font:normal 16px/100% sans-serif !important;user-select:none;-webkit-user-select:none;-moz-user-select:-moz-none;cursor:default;z-index:10000;}#remotestorage-widget .rs-bubble{background:rgba(80, 80, 80, .7);border-radius:5px 15px 5px 5px;color:white;font-size:0.8em;padding:5px;position:absolute;right:3px;top:9px;min-height:24px;white-space:nowrap;text-decoration:none;}.rs-bubble .rs-bubble-text{padding-right:32px;/* make sure the bubble doesn\'t "jump" when initially opening. */ min-width:182px;}#remotestorage-widget .rs-action{cursor:pointer;}/* less obtrusive cube when connected */ #remotestorage-widget.remotestorage-state-connected .rs-cube, #remotestorage-widget.remotestorage-state-busy .rs-cube{opacity:.3;-webkit-transition:opacity .3s ease;-moz-transition:opacity .3s ease;-ms-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease;}#remotestorage-widget.remotestorage-state-connected:hover .rs-cube, #remotestorage-widget.remotestorage-state-busy:hover .rs-cube, #remotestorage-widget.remotestorage-state-connected .rs-bubble:not(.rs-hidden) + .rs-cube{opacity:1 !important;}#remotestorage-widget .rs-backends{position:relative;top:5px;right:0;}#remotestorage-widget .rs-cube{position:relative;top:5px;right:0;}/* pulsing animation for cube when loading */ #remotestorage-widget .rs-cube.remotestorage-loading{-webkit-animation:remotestorage-loading .5s ease-in-out infinite alternate;-moz-animation:remotestorage-loading .5s ease-in-out infinite alternate;-o-animation:remotestorage-loading .5s ease-in-out infinite alternate;-ms-animation:remotestorage-loading .5s ease-in-out infinite alternate;animation:remotestorage-loading .5s ease-in-out infinite alternate;}@-webkit-keyframes remotestorage-loading{to{opacity:.7}}@-moz-keyframes remotestorage-loading{to{opacity:.7}}@-o-keyframes remotestorage-loading{to{opacity:.7}}@-ms-keyframes remotestorage-loading{to{opacity:.7}}@keyframes remotestorage-loading{to{opacity:.7}}#remotestorage-widget a{text-decoration:underline;color:inherit;}#remotestorage-widget form{margin-top:.7em;position:relative;}#remotestorage-widget form input{display:table-cell;vertical-align:top;border:none;border-radius:6px;font-weight:bold;color:white;outline:none;line-height:1.5em;height:2em;}#remotestorage-widget form input:disabled{color:#999;background:#444 !important;cursor:default !important;}#remotestorage-widget form input[type=email]:focus, #remotestorage-widget form input[type=password]:focus{background:#223;}#remotestorage-widget form input[type=email], #remotestorage-widget form input[type=password]{background:#000;width:100%;height:26px;padding:0 30px 0 5px;border-top:1px solid #111;border-bottom:1px solid #999;}#remotestorage-widget form input[type=email]:focus, #remotestorage-widget form input[type=password]:focus{background:#223;}#remotestorage-widget button:focus, #remotestorage-widget input:focus{box-shadow:0 0 4px #ccc;}#remotestorage-widget form input[type=email]::-webkit-input-placeholder, #remotestorage-widget form input[type=password]::-webkit-input-placeholder{color:#999;}#remotestorage-widget form input[type=email]:-moz-placeholder, #remotestorage-widget form input[type=password]:-moz-placeholder{color:#999;}#remotestorage-widget form input[type=email]::-moz-placeholder, #remotestorage-widget form input[type=password]::-moz-placeholder{color:#999;}#remotestorage-widget form input[type=email]:-ms-input-placeholder, #remotestorage-widget form input[type=password]:-ms-input-placeholder{color:#999;}#remotestorage-widget form input[type=submit]{background:#000;cursor:pointer;padding:0 5px;}#remotestorage-widget form input[type=submit]:hover{background:#333;}#remotestorage-widget .rs-info-msg{font-size:10px;color:#eee;margin-top:0.7em;white-space:normal;}#remotestorage-widget .rs-info-msg.last-synced-message{display:inline;white-space:nowrap;margin-bottom:.7em}#remotestorage-widget .rs-info-msg a:hover, #remotestorage-widget .rs-info-msg a:active{color:#fff;}#remotestorage-widget button img{vertical-align:baseline;}#remotestorage-widget button{border:none;border-radius:6px;font-weight:bold;color:white;outline:none;line-height:1.5em;height:26px;width:26px;background:#000;cursor:pointer;margin:0;padding:5px;}#remotestorage-widget button:hover{background:#333;}#remotestorage-widget .rs-bubble button.connect, #remotestorage-widget .rs-bubble button.rs-cipher, #remotestorage-widget .rs-bubble button.rs-nocipher{display:block;background:none;position:absolute;right:0;top:0;opacity:1;/* increase clickable area of connect, rs-cipher & rs-nocipher buttons */ margin:-5px;padding:10px;width:36px;height:36px;}#remotestorage-widget .rs-bubble button.rs-cipher{width:46px;}#remotestorage-widget .rs-bubble button.rs-nocipher{height:26px;margin:0;padding:4px 5px 5px;right:-32px;width:26px;}#remotestorage-widget .rs-bubble button.connect:not([disabled]):hover, #remotestorage-widget .rs-bubble button.rs-cipher:not([disabled]):hover, #remotestorage-widget .rs-bubble button.rs-nocipher:not([disabled]):hover{background:rgba(150,150,150,.5);}#remotestorage-widget .rs-bubble button.connect[disabled], #remotestorage-widget .rs-bubble button.rs-cipher[disabled]{opacity:.5;cursor:default !important;}#remotestorage-widget .rs-bubble button.rs-sync{position:relative;left:-5px;bottom:-5px;padding:4px 4px 0 4px;background:#555;}#remotestorage-widget .rs-bubble button.rs-sync:hover{background:#444;}#remotestorage-widget .rs-bubble button.rs-disconnect{background:#721;position:absolute;right:0;bottom:0;padding:4px 4px 0 4px;}#remotestorage-widget .rs-bubble button.rs-disconnect:hover{background:#921;}#remotestorage-widget .remotestorage-error-info{color:#f92;}#remotestorage-widget .remotestorage-reset{width:100%;background:#721;}#remotestorage-widget .remotestorage-reset:hover{background:#921;}#remotestorage-widget .rs-bubble .rs-content{margin-top:7px;}#remotestorage-widget pre{user-select:initial;-webkit-user-select:initial;-moz-user-select:text;max-width:27em;margin-top:1em;overflow:auto;}#remotestorage-widget .rs-centered-text{text-align:center;}#remotestorage-widget .rs-bubble.rs-hidden{padding-bottom:2px;border-radius:5px 15px 15px 5px;}#remotestorage-widget .rs-error-msg{min-height:5em;}.rs-bubble.rs-hidden .rs-bubble-expandable{display:none;}.remotestorage-state-connected .rs-bubble.rs-hidden{display:none;}.remotestorage-connected{display:none;}.remotestorage-state-connected .remotestorage-connected{display:block;}.remotestorage-cipher-form{display:none;}.remotestorage-cipher .remotestorage-cipher-form{display:block;}.remotestorage-invalid-key{display:none;}.remotestorage-invalid-key.remotestorage-cipher-error{display:block;}.remotestorage-initial{display:none;}.remotestorage-state-initial .remotestorage-initial{display:block;}.remotestorage-error{display:none;}.remotestorage-state-error .remotestorage-error{display:block;}.remotestorage-state-authing .remotestorage-authing{display:block;}.remotestorage-state-offline .remotestorage-connected, .remotestorage-state-offline .remotestorage-offline{display:block;}.remotestorage-unauthorized{display:none;}.remotestorage-state-unauthorized .rs-bubble.rs-hidden{display:none;}.remotestorage-state-unauthorized .remotestorage-connected, .remotestorage-state-unauthorized .remotestorage-unauthorized{display:block;}.remotestorage-state-unauthorized .rs-sync{display:none;}.remotestorage-state-busy .rs-bubble.rs-hidden{display:none;}.remotestorage-state-busy .rs-bubble{display:block;}.remotestorage-state-busy .remotestorage-connected{display:block;}.remotestorage-state-authing .rs-bubble-expandable{display:none;}' }; /** FILE: src/widget.js **/ (function (window) { var hasLocalStorage; var LS_STATE_KEY = "remotestorage:widget:state"; // states allowed to immediately jump into after a reload. var VALID_ENTRY_STATES = { initial: true, connected: true, offline: true }; /** * Class: RemoteStorage.Widget * * The widget controller that communicates with the view and listens to * its remoteStorage instance. * * While listening to the events emitted by its remoteStorage it sets * corresponding states of the view. * * - connected -> connected * - disconnected -> initial * - connecting -> authing * - authing -> authing * - wire-busy -> busy * - wire-done -> connected * - error -> one of initial, offline, unauthorized, or error **/ RemoteStorage.Widget = function (remoteStorage) { var self = this; var requestsToFlashFor = 0; // setting event listeners on rs events to put // the widget into corresponding states this.rs = remoteStorage; this.rs.remote.on('connected', stateSetter(this, 'connected')); this.rs.on('disconnected', stateSetter(this, 'initial')); this.rs.on('connecting', stateSetter(this, 'authing')); this.rs.on('authing', stateSetter(this, 'authing')); this.rs.on('error', errorsHandler(this)); if (this.rs.remote) { this.rs.remote.on('wire-busy', function (evt) { if (flashFor(evt)) { requestsToFlashFor++; stateSetter(self, 'busy')(); } }); this.rs.remote.on('wire-done', function (evt) { if (flashFor(evt)) { requestsToFlashFor--; } if (requestsToFlashFor <= 0 && evt.success) { stateSetter(self, 'connected')(); } }); } if (hasLocalStorage) { var state = localStorage[LS_STATE_KEY]; if (state && VALID_ENTRY_STATES[state]) { this._rememberedState = state; } } }; RemoteStorage.Widget.prototype = { /** * Method: display * * Displays the widget via the view.display method * * Parameters: * * options **/ display: function (options) { if (typeof(options) === 'string') { options = { domID: options }; } else if (typeof(options) === 'undefined') { options = {}; } if (! this.view) { this.setView(new RemoteStorage.Widget.View(this.rs)); } this.view.display(options); return this; }, linkWidgetToSync: function () { if (typeof(this.rs.sync) === 'object' && typeof(this.rs.sync.sync) === 'function') { this.view.on('sync', this.rs.sync.sync.bind(this.rs.sync)); } else { RemoteStorage.log('[Widget] typeof this.rs.sync check fail', this.rs.sync); setTimeout(this.linkWidgetToSync.bind(this), 1000); } }, /** * Method: setView(view) * * Sets the view and initializes event listeners to react on * widget (widget.view) events **/ setView: function (view) { this.view = view; this.view.on('connect', function (options) { if (typeof(options) === 'string') { // options is simply a useraddress this.rs.connect(options); } else if (options.special) { this.rs[options.special].connect(options); } }.bind(this)); this.view.on('secret-entered', function (secretKey) { this.view.setUserSecretKey(secretKey); stateSetter(this, 'ciphered')(); }.bind(this)); this.view.on('secret-cancelled', function () { stateSetter(this, 'notciphered')(); }.bind(this)); this.view.on('disconnect', this.rs.disconnect.bind(this.rs)); this.linkWidgetToSync(); try { this.view.on('reset', function (){ var location = RemoteStorage.Authorize.getLocation(); this.rs.on('disconnected', location.reload.bind(location)); this.rs.disconnect(); }.bind(this)); } catch(e) { if (e.message && e.message.match(/Unknown event/)) { // ignored. (the 0.7 widget-view interface didn't have a 'reset' event) } else { throw e; } } if (this._rememberedState) { setTimeout(stateSetter(this, this._rememberedState), 0); delete this._rememberedState; } } }; /** * Method: displayWidget * * Same as <display> **/ RemoteStorage.prototype.displayWidget = function (options) { return this.widget.display(options); }; RemoteStorage.Widget._rs_init = function (remoteStorage) { hasLocalStorage = remoteStorage.localStorageAvailable(); if (! remoteStorage.widget) { remoteStorage.widget = new RemoteStorage.Widget(remoteStorage); } }; RemoteStorage.Widget._rs_supported = function (remoteStorage) { return typeof(document) !== 'undefined'; }; function stateSetter(widget, state) { RemoteStorage.log('[Widget] Producing stateSetter for', state); return function () { RemoteStorage.log('[Widget] Setting state', state, arguments); if (hasLocalStorage) { localStorage[LS_STATE_KEY] = state; } if (widget.view) { if (widget.rs.remote) { widget.view.setUserAddress(widget.rs.remote.userAddress); } widget.view.setState(state, arguments); } else { widget._rememberedState = state; } }; } function errorsHandler(widget) { return function (error) { if (error instanceof RemoteStorage.DiscoveryError) { console.error('Discovery failed', error, '"' + error.message + '"'); widget.view.setState('initial', [error.message]); } else if (error instanceof RemoteStorage.SyncError) { widget.view.setState('offline', []); } else if (error instanceof RemoteStorage.Unauthorized) { widget.view.setState('unauthorized'); } else { RemoteStorage.log('[Widget] Unknown error'); widget.view.setState('error', [error]); } }; } function flashFor(evt) { if (evt.method === 'GET' && evt.isFolder) { return false; } return true; } })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/view.js **/ (function (window){ var t = RemoteStorage.I18n.translate; /** * Class: RemoteStorage.Widget.View * * Controls the visible widget * * States: * * initial - not connected * authing - in auth flow * connected - connected to remote storage, not syncing at the moment * ciphered - connected, with cipher * notciphered - connected, without cipher * busy - connected, syncing at the moment * offline - connected, but no network connectivity * error - connected, but sync error happened * unauthorized - connected, but request returned 401 **/ RemoteStorage.Widget.View = function (remoteStorage) { this.rs = remoteStorage; if (typeof(document) === 'undefined') { throw "Widget not supported"; } RemoteStorage.eventHandling(this, 'connect', 'secret-entered', 'secret-cancelled', 'disconnect', 'sync', 'display', 'reset'); // Re-binding the event so they can be called from the window for (var event in this.events){ this.events[event] = this.events[event].bind(this); } this.hideBubbleOnBodyClick = function (event) { for (var p = event.target; p !== document.body; p = p.parentElement) { if (p.id === 'remotestorage-widget') { return; } } this.hideBubble(); }.bind(this); }; RemoteStorage.Widget.View.prototype = { connectGdrive: function () { this._emit('connect', { special: 'googledrive' }); }, connectDropbox: function (){ this._emit('connect', { special: 'dropbox'}); }, /** * Method: setState * * Call the function that applies the state to the widget * * Parameters: * * state * args **/ setState: function (state, args) { RemoteStorage.log('[View] widget.view.setState(',state,',',args,');'); var s = this.states[state]; if (typeof(s) === 'undefined') { throw new Error("Bad State assigned to view: " + state); } s.apply(this, args); }, /** * Method: setUserAddress * * Set user address of the input field **/ setUserAddress: function (addr) { this.userAddress = addr || ''; var el; if (this.div && (el = this.div.querySelector('form.remotestorage-initial').userAddress)) { el.value = this.userAddress; } }, /** * Method: setUserSecretKey * * Set user secret key **/ setUserSecretKey: function (secretKey) { this.userSecretKey = secretKey; }, /** * Method: toggleBubble * * Show the bubble when hidden and the other way around **/ toggleBubble: function (event) { if (this.bubble.className.search('rs-hidden') < 0) { this.hideBubble(event); } else { this.showBubble(event); } }, /** * Method: hideBubble * * Hide the bubble **/ hideBubble: function (){ addClass(this.bubble, 'rs-hidden'); document.body.removeEventListener('click', this.hideBubbleOnBodyClick); }, /** * Method: showBubble * * Show the bubble **/ showBubble: function (event){ removeClass(this.bubble, 'rs-hidden'); if (typeof(event) !== 'undefined') { stopPropagation(event); } document.body.addEventListener('click', this.hideBubbleOnBodyClick); if (this.div.querySelector('.remotestorage-connected').classList.contains('remotestorage-cipher') && !this.userSecretKey) { this.bubble.querySelector('form.remotestorage-cipher-form').userSecretKey.focus(); } else { this.bubble.querySelector('form.remotestorage-initial').userAddress.focus(); } }, /** * Method: display * * Draw the widget inside of the dom element with the id options.domID * * Parameters: * * options * * Returns: * * The widget div **/ display: function (options) { if (typeof this.div !== 'undefined') { return this.div; } var element = document.createElement('div'); var style = document.createElement('style'); style.innerHTML = RemoteStorage.Assets.widgetCss; element.id = "remotestorage-widget"; element.innerHTML = RemoteStorage.Assets.widget; element.appendChild(style); if (options.domID) { var parent = document.getElementById(options.domID); if (! parent) { throw "Failed to find target DOM element with id=\"" + options.domID + "\""; } parent.appendChild(element); } else { document.body.appendChild(element); } // Sync button setupButton(element, 'rs-sync', 'syncIcon', this.events.sync); // Disconnect button setupButton(element, 'rs-disconnect', 'disconnectIcon', this.events.disconnect); // Get me out of here setupButton(element, 'remotestorage-reset', undefined, this.events.reset); // Connect button var connectButton = setupButton(element, 'connect', 'connectIcon', this.events.connect); // Handle connectButton state this.form = element.querySelector('form.remotestorage-initial'); var el = this.form.userAddress; el.addEventListener('load', handleButtonState); el.addEventListener('keyup', handleButtonState); if (this.userAddress) { el.value = this.userAddress; } if (options.encryption) { this.cipher = true; var secretKeyInput = element.querySelector('form.remotestorage-cipher-form').userSecretKey; // This is to avoid the 'password field on an insecured page' warning, when not used and on http (not https) secretKeyInput.type = 'password'; // Cipher button var cipherButton = setupButton(element, 'rs-cipher', 'cipherIcon', this.events['secret-entered']); // Handle cipherButton state secretKeyInput.addEventListener('load', handleButtonState); secretKeyInput.addEventListener('keyup', handleButtonState); // No cipher button setupButton(element, 'rs-nocipher', 'nocipherIcon', this.events['secret-cancelled']); } // The cube this.cube = setupButton(element, 'rs-cube', 'remoteStorageIcon', this.toggleBubble.bind(this)); // Google Drive and Dropbox icons setupButton(element, 'rs-dropbox', 'dropbox', this.connectDropbox.bind(this)); setupButton(element, 'rs-googledrive', 'googledrive', this.connectGdrive.bind(this)); var bubbleDontCatch = { INPUT: true, BUTTON: true, IMG: true }; var eventListener = function (event) { if (! bubbleDontCatch[event.target.tagName] && ! (this.div.classList.contains('remotestorage-state-unauthorized') )) { this.showBubble(event); } }.bind(this); this.bubble = setupButton(element, 'rs-bubble', undefined, eventListener); this.hideBubble(); this.div = element; this.states.initial.call(this); this.events.display.call(this); return this.div; }, states: { initial: function (message) { var cube = this.cube; var info = message || t("view_info"); cube.src = RemoteStorage.Assets.remoteStorageIcon; this._renderTranslatedInitialContent(); if (message) { cube.src = RemoteStorage.Assets.remoteStorageIconError; removeClass(this.cube, 'remotestorage-loading'); this.showBubble(); // Show the red error cube for 5 seconds, then show the normal orange one again setTimeout(function (){ cube.src = RemoteStorage.Assets.remoteStorageIcon; },2000); } else { this.hideBubble(); } this.div.className = "remotestorage-state-initial"; if (this.userSecretKey) { delete this.userSecretKey; } // Google Drive and Dropbox icons var backends = 1; if (this._activateBackend('dropbox')) { backends += 1; } if (this._activateBackend('googledrive')) { backends += 1; } this.div.querySelector('.rs-bubble-text').style.paddingRight = backends*32+8+'px'; // If address not empty connect button enabled var cb = this.div.querySelector('.connect'); if (this.form.userAddress.value) { cb.removeAttribute('disabled'); } var infoEl = this.div.querySelector('.rs-info-msg'); infoEl.innerHTML = info; if (message) { infoEl.classList.add('remotestorage-error-info'); } else { infoEl.classList.remove('remotestorage-error-info'); } }, authing: function () { this.div.removeEventListener('click', this.events.connect); this.div.className = "remotestorage-state-authing"; this.div.querySelector('.rs-status-text').innerHTML = t("view_connecting", this.userAddress); addClass(this.cube, 'remotestorage-loading'); }, connected: function () { var cube = this.cube; this.div.className = "remotestorage-state-connected"; this.div.querySelector('.userAddress').innerHTML = this.userAddress; cube.src = RemoteStorage.Assets.remoteStorageIcon; removeClass(cube, 'remotestorage-loading'); if (this.cipher) { if (this.userSecretKey) { if (this.userSecretKeyError) { cube.src = RemoteStorage.Assets.remoteStorageIconError; addClass(this.div.querySelector('.remotestorage-connected'), 'remotestorage-cipher'); addClass(this.div.querySelector('.remotestorage-invalid-key'), 'remotestorage-cipher-error'); this.showBubble(); // Show the red error cube for 5 seconds, then show the normal orange one again setTimeout(function (){ cube.src = RemoteStorage.Assets.remoteStorageIcon; },5000); } else { removeClass(this.div.querySelector('.remotestorage-invalid-key'), 'remotestorage-cipher-error'); cube.src = RemoteStorage.Assets.remoteStorageIconCiphered; } } else { addClass(this.div.querySelector('.remotestorage-connected'), 'remotestorage-cipher'); this.showBubble(); } } var icons = { googledrive: this.div.querySelector('.rs-googledrive'), dropbox: this.div.querySelector('.rs-dropbox') }; icons.googledrive.style.display = icons.dropbox.style.display = 'none'; if (icons[this.rs.backend]) { icons[this.rs.backend].style.display = 'inline-block'; this.div.querySelector('.rs-bubble-text').style.paddingRight = 2*32+8+'px'; } else { this.div.querySelector('.rs-bubble-text').style.paddingRight = 32+8+'px'; } }, ciphered: function () { this.div.querySelector('form.remotestorage-cipher-form').userSecretKey.value = ''; removeClass(this.div.querySelector('.remotestorage-invalid-key'), 'remotestorage-cipher-error'); removeClass(this.div.querySelector('.remotestorage-connected'), 'remotestorage-cipher'); this.cube.src = RemoteStorage.Assets.remoteStorageIconCiphered; this.hideBubble(); }, notciphered: function () { this.cipher = false; removeClass(this.div.querySelector('.remotestorage-invalid-key'), 'remotestorage-cipher-error'); removeClass(this.div.querySelector('.remotestorage-connected'), 'remotestorage-cipher'); this.hideBubble(); }, busy: function () { this.div.className = "remotestorage-state-busy"; addClass(this.cube, 'remotestorage-loading'); //TODO needs to be undone when is that neccesary }, offline: function () { this.div.className = "remotestorage-state-offline"; this.cube.src = RemoteStorage.Assets.remoteStorageIconOffline; this.div.querySelector('.rs-status-text').innerHTML = t("view_offline"); }, error: function (err) { var errorMsg = err; this.div.className = "remotestorage-state-error"; this.div.querySelector('.rs-bubble-text').innerHTML = '<strong>'+t('view_error_occured')+'</strong>'; //FIXME I don't know what an DOMError is and my browser doesn't know too(how to handle this?) if (err instanceof Error /*|| err instanceof DOMError*/) { errorMsg = err.message + '\n\n' + err.stack; } this.div.querySelector('.rs-error-msg').textContent = errorMsg; this.cube.src = RemoteStorage.Assets.remoteStorageIconError; this.showBubble(); }, unauthorized: function () { this.div.className = "remotestorage-state-unauthorized"; this.cube.src = RemoteStorage.Assets.remoteStorageIconError; this.showBubble(); this.div.addEventListener('click', this.events.connect); } }, events: { /** * Event: connect * * Emitted when the connect button is clicked **/ connect: function (event) { stopPropagation(event); event.preventDefault(); this._emit('connect', this.div.querySelector('form.remotestorage-initial').userAddress.value); }, /** * Event: secret-entered * * Emitted when the cipher button is clicked **/ 'secret-entered': function (event) { stopPropagation(event); event.preventDefault(); this._emit('secret-entered', this.div.querySelector('form.remotestorage-cipher-form').userSecretKey.value); }, /** * Event: secret-cancelled * * Emitted when the nocipher button is clicked **/ 'secret-cancelled': function (event) { stopPropagation(event); event.preventDefault(); this._emit('secret-cancelled'); }, /** * Event: sync * * Emitted when the sync button is clicked **/ sync: function (event) { stopPropagation(event); event.preventDefault(); this._emit('sync'); }, /** * Event: disconnect * * Emitted when the disconnect button is clicked **/ disconnect: function (event) { stopPropagation(event); event.preventDefault(); this._emit('disconnect'); }, /** * Event: reset * * Emitted after crash triggers disconnect **/ reset: function (event){ event.preventDefault(); var result = window.confirm(t('view_confirm_reset')); if (result){ this._emit('reset'); } }, /** * Event: display * * Emitted when finished displaying the widget **/ display : function (event) { if (event) { event.preventDefault(); } this._emit('display'); } }, _renderTranslatedInitialContent: function () { this.div.querySelector('.rs-status-text').innerHTML = t("view_connect"); this.div.querySelector('.remotestorage-reset').innerHTML = t("view_get_me_out"); this.div.querySelector('.rs-error-plz-report').innerHTML = t("view_error_plz_report"); this.div.querySelector('.remotestorage-unauthorized').innerHTML = t("view_unauthorized"); this.div.querySelector('.remotestorage-invalid-key').innerHTML = t("view_invalid_key"); }, _activateBackend: function activateBackend(backendName) { var className = 'rs-' + backendName; if (this.rs.apiKeys[backendName]) { this.div.querySelector('.' + className).style.display = 'inline-block'; return true; } else { this.div.querySelector('.' + className).style.display = 'none'; return false; } } }; function removeClass(el, className) { return el.classList.remove(className); } function addClass(el, className) { return el.classList.add(className); } function stopPropagation(event) { if (typeof(event.stopPropagation) === 'function') { event.stopPropagation(); } else { event.cancelBubble = true; } } function setupButton(parent, className, iconName, eventListener) { var element = parent.querySelector('.' + className); if (typeof iconName !== 'undefined') { var img = element.querySelector('img'); (img || element).src = RemoteStorage.Assets[iconName]; } element.addEventListener('click', eventListener); return element; } function handleButtonState(event) { if (event.target.value) { event.target.nextElementSibling.removeAttribute('disabled'); } else { event.target.nextElementSibling.setAttribute('disabled','disabled'); } } })(typeof(window) !== 'undefined' ? window : global); /** FILE: node_modules/tv4/tv4.js **/ /* Author: Geraint Luff and others Year: 2013 This code is released into the "public domain" by its author(s). Anybody may use, alter and distribute the code without restriction. The author makes no guarantees, and takes no liability of any kind for use of this code. If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory. */ (function (global, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define([], factory); } else if (typeof module !== 'undefined' && module.exports){ // CommonJS. Define export. module.exports = factory(); } else { // Browser globals global.tv4 = factory(); } }(this, function () { // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys if (!Object.keys) { Object.keys = (function () { var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ], dontEnumsLength = dontEnums.length; return function (obj) { if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) { throw new TypeError('Object.keys called on non-object'); } var result = []; for (var prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (var i=0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; })(); } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create if (!Object.create) { Object.create = (function(){ function F(){} return function(o){ if (arguments.length !== 1) { throw new Error('Object.create implementation only accepts one parameter.'); } F.prototype = o; return new F(); }; })(); } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FisArray if(!Array.isArray) { Array.isArray = function (vArg) { return Object.prototype.toString.call(vArg) === "[object Array]"; }; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { if (this === null) { throw new TypeError(); } var t = Object(this); var len = t.length >>> 0; if (len === 0) { return -1; } var n = 0; if (arguments.length > 1) { n = Number(arguments[1]); if (n !== n) { // shortcut for verifying if it's NaN n = 0; } else if (n !== 0 && n !== Infinity && n !== -Infinity) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } } if (n >= len) { return -1; } var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); for (; k < len; k++) { if (k in t && t[k] === searchElement) { return k; } } return -1; }; } // Grungey Object.isFrozen hack if (!Object.isFrozen) { Object.isFrozen = function (obj) { var key = "tv4_test_frozen_key"; while (obj.hasOwnProperty(key)) { key += Math.random(); } try { obj[key] = true; delete obj[key]; return false; } catch (e) { return true; } }; } // Based on: https://github.com/geraintluff/uri-templates, but with all the de-substitution stuff removed var uriTemplateGlobalModifiers = { "+": true, "#": true, ".": true, "/": true, ";": true, "?": true, "&": true }; var uriTemplateSuffices = { "*": true }; function notReallyPercentEncode(string) { return encodeURI(string).replace(/%25[0-9][0-9]/g, function (doubleEncoded) { return "%" + doubleEncoded.substring(3); }); } function uriTemplateSubstitution(spec) { var modifier = ""; if (uriTemplateGlobalModifiers[spec.charAt(0)]) { modifier = spec.charAt(0); spec = spec.substring(1); } var separator = ""; var prefix = ""; var shouldEscape = true; var showVariables = false; var trimEmptyString = false; if (modifier === '+') { shouldEscape = false; } else if (modifier === ".") { prefix = "."; separator = "."; } else if (modifier === "/") { prefix = "/"; separator = "/"; } else if (modifier === '#') { prefix = "#"; shouldEscape = false; } else if (modifier === ';') { prefix = ";"; separator = ";"; showVariables = true; trimEmptyString = true; } else if (modifier === '?') { prefix = "?"; separator = "&"; showVariables = true; } else if (modifier === '&') { prefix = "&"; separator = "&"; showVariables = true; } var varNames = []; var varList = spec.split(","); var varSpecs = []; var varSpecMap = {}; for (var i = 0; i < varList.length; i++) { var varName = varList[i]; var truncate = null; if (varName.indexOf(":") !== -1) { var parts = varName.split(":"); varName = parts[0]; truncate = parseInt(parts[1], 10); } var suffices = {}; while (uriTemplateSuffices[varName.charAt(varName.length - 1)]) { suffices[varName.charAt(varName.length - 1)] = true; varName = varName.substring(0, varName.length - 1); } var varSpec = { truncate: truncate, name: varName, suffices: suffices }; varSpecs.push(varSpec); varSpecMap[varName] = varSpec; varNames.push(varName); } var subFunction = function (valueFunction) { var result = ""; var startIndex = 0; for (var i = 0; i < varSpecs.length; i++) { var varSpec = varSpecs[i]; var value = valueFunction(varSpec.name); if (value === null || value === undefined || (Array.isArray(value) && value.length === 0) || (typeof value === 'object' && Object.keys(value).length === 0)) { startIndex++; continue; } if (i === startIndex) { result += prefix; } else { result += (separator || ","); } if (Array.isArray(value)) { if (showVariables) { result += varSpec.name + "="; } for (var j = 0; j < value.length; j++) { if (j > 0) { result += varSpec.suffices['*'] ? (separator || ",") : ","; if (varSpec.suffices['*'] && showVariables) { result += varSpec.name + "="; } } result += shouldEscape ? encodeURIComponent(value[j]).replace(/!/g, "%21") : notReallyPercentEncode(value[j]); } } else if (typeof value === "object") { if (showVariables && !varSpec.suffices['*']) { result += varSpec.name + "="; } var first = true; for (var key in value) { if (!first) { result += varSpec.suffices['*'] ? (separator || ",") : ","; } first = false; result += shouldEscape ? encodeURIComponent(key).replace(/!/g, "%21") : notReallyPercentEncode(key); result += varSpec.suffices['*'] ? '=' : ","; result += shouldEscape ? encodeURIComponent(value[key]).replace(/!/g, "%21") : notReallyPercentEncode(value[key]); } } else { if (showVariables) { result += varSpec.name; if (!trimEmptyString || value !== "") { result += "="; } } if (varSpec.truncate != null) { value = value.substring(0, varSpec.truncate); } result += shouldEscape ? encodeURIComponent(value).replace(/!/g, "%21"): notReallyPercentEncode(value); } } return result; }; subFunction.varNames = varNames; return { prefix: prefix, substitution: subFunction }; } function UriTemplate(template) { if (!(this instanceof UriTemplate)) { return new UriTemplate(template); } var parts = template.split("{"); var textParts = [parts.shift()]; var prefixes = []; var substitutions = []; var varNames = []; while (parts.length > 0) { var part = parts.shift(); var spec = part.split("}")[0]; var remainder = part.substring(spec.length + 1); var funcs = uriTemplateSubstitution(spec); substitutions.push(funcs.substitution); prefixes.push(funcs.prefix); textParts.push(remainder); varNames = varNames.concat(funcs.substitution.varNames); } this.fill = function (valueFunction) { var result = textParts[0]; for (var i = 0; i < substitutions.length; i++) { var substitution = substitutions[i]; result += substitution(valueFunction); result += textParts[i + 1]; } return result; }; this.varNames = varNames; this.template = template; } UriTemplate.prototype = { toString: function () { return this.template; }, fillFromObject: function (obj) { return this.fill(function (varName) { return obj[varName]; }); } }; var ValidatorContext = function ValidatorContext(parent, collectMultiple, errorMessages, checkRecursive, trackUnknownProperties) { this.missing = []; this.missingMap = {}; this.formatValidators = parent ? Object.create(parent.formatValidators) : {}; this.schemas = parent ? Object.create(parent.schemas) : {}; this.collectMultiple = collectMultiple; this.errors = []; this.handleError = collectMultiple ? this.collectError : this.returnError; if (checkRecursive) { this.checkRecursive = true; this.scanned = []; this.scannedFrozen = []; this.scannedFrozenSchemas = []; this.scannedFrozenValidationErrors = []; this.validatedSchemasKey = 'tv4_validation_id'; this.validationErrorsKey = 'tv4_validation_errors_id'; } if (trackUnknownProperties) { this.trackUnknownProperties = true; this.knownPropertyPaths = {}; this.unknownPropertyPaths = {}; } this.errorMessages = errorMessages; this.definedKeywords = {}; if (parent) { for (var key in parent.definedKeywords) { this.definedKeywords[key] = parent.definedKeywords[key].slice(0); } } }; ValidatorContext.prototype.defineKeyword = function (keyword, keywordFunction) { this.definedKeywords[keyword] = this.definedKeywords[keyword] || []; this.definedKeywords[keyword].push(keywordFunction); }; ValidatorContext.prototype.createError = function (code, messageParams, dataPath, schemaPath, subErrors) { var messageTemplate = this.errorMessages[code] || ErrorMessagesDefault[code]; if (typeof messageTemplate !== 'string') { return new ValidationError(code, "Unknown error code " + code + ": " + JSON.stringify(messageParams), messageParams, dataPath, schemaPath, subErrors); } // Adapted from Crockford's supplant() var message = messageTemplate.replace(/\{([^{}]*)\}/g, function (whole, varName) { var subValue = messageParams[varName]; return typeof subValue === 'string' || typeof subValue === 'number' ? subValue : whole; }); return new ValidationError(code, message, messageParams, dataPath, schemaPath, subErrors); }; ValidatorContext.prototype.returnError = function (error) { return error; }; ValidatorContext.prototype.collectError = function (error) { if (error) { this.errors.push(error); } return null; }; ValidatorContext.prototype.prefixErrors = function (startIndex, dataPath, schemaPath) { for (var i = startIndex; i < this.errors.length; i++) { this.errors[i] = this.errors[i].prefixWith(dataPath, schemaPath); } return this; }; ValidatorContext.prototype.banUnknownProperties = function () { for (var unknownPath in this.unknownPropertyPaths) { var error = this.createError(ErrorCodes.UNKNOWN_PROPERTY, {path: unknownPath}, unknownPath, ""); var result = this.handleError(error); if (result) { return result; } } return null; }; ValidatorContext.prototype.addFormat = function (format, validator) { if (typeof format === 'object') { for (var key in format) { this.addFormat(key, format[key]); } return this; } this.formatValidators[format] = validator; }; ValidatorContext.prototype.resolveRefs = function (schema, urlHistory) { if (schema['$ref'] !== undefined) { urlHistory = urlHistory || {}; if (urlHistory[schema['$ref']]) { return this.createError(ErrorCodes.CIRCULAR_REFERENCE, {urls: Object.keys(urlHistory).join(', ')}, '', ''); } urlHistory[schema['$ref']] = true; schema = this.getSchema(schema['$ref'], urlHistory); } return schema; }; ValidatorContext.prototype.getSchema = function (url, urlHistory) { var schema; if (this.schemas[url] !== undefined) { schema = this.schemas[url]; return this.resolveRefs(schema, urlHistory); } var baseUrl = url; var fragment = ""; if (url.indexOf('#') !== -1) { fragment = url.substring(url.indexOf("#") + 1); baseUrl = url.substring(0, url.indexOf("#")); } if (typeof this.schemas[baseUrl] === 'object') { schema = this.schemas[baseUrl]; var pointerPath = decodeURIComponent(fragment); if (pointerPath === "") { return this.resolveRefs(schema, urlHistory); } else if (pointerPath.charAt(0) !== "/") { return undefined; } var parts = pointerPath.split("/").slice(1); for (var i = 0; i < parts.length; i++) { var component = parts[i].replace(/~1/g, "/").replace(/~0/g, "~"); if (schema[component] === undefined) { schema = undefined; break; } schema = schema[component]; } if (schema !== undefined) { return this.resolveRefs(schema, urlHistory); } } if (this.missing[baseUrl] === undefined) { this.missing.push(baseUrl); this.missing[baseUrl] = baseUrl; this.missingMap[baseUrl] = baseUrl; } }; ValidatorContext.prototype.searchSchemas = function (schema, url) { if (schema && typeof schema === "object") { if (typeof schema.id === "string") { if (isTrustedUrl(url, schema.id)) { if (this.schemas[schema.id] === undefined) { this.schemas[schema.id] = schema; } } } for (var key in schema) { if (key !== "enum") { if (typeof schema[key] === "object") { this.searchSchemas(schema[key], url); } else if (key === "$ref") { var uri = getDocumentUri(schema[key]); if (uri && this.schemas[uri] === undefined && this.missingMap[uri] === undefined) { this.missingMap[uri] = uri; } } } } } }; ValidatorContext.prototype.addSchema = function (url, schema) { //overload if (typeof url !== 'string' || typeof schema === 'undefined') { if (typeof url === 'object' && typeof url.id === 'string') { schema = url; url = schema.id; } else { return; } } if (url === getDocumentUri(url) + "#") { // Remove empty fragment url = getDocumentUri(url); } this.schemas[url] = schema; delete this.missingMap[url]; normSchema(schema, url); this.searchSchemas(schema, url); }; ValidatorContext.prototype.getSchemaMap = function () { var map = {}; for (var key in this.schemas) { map[key] = this.schemas[key]; } return map; }; ValidatorContext.prototype.getSchemaUris = function (filterRegExp) { var list = []; for (var key in this.schemas) { if (!filterRegExp || filterRegExp.test(key)) { list.push(key); } } return list; }; ValidatorContext.prototype.getMissingUris = function (filterRegExp) { var list = []; for (var key in this.missingMap) { if (!filterRegExp || filterRegExp.test(key)) { list.push(key); } } return list; }; ValidatorContext.prototype.dropSchemas = function () { this.schemas = {}; this.reset(); }; ValidatorContext.prototype.reset = function () { this.missing = []; this.missingMap = {}; this.errors = []; }; ValidatorContext.prototype.validateAll = function (data, schema, dataPathParts, schemaPathParts, dataPointerPath) { var topLevel; schema = this.resolveRefs(schema); if (!schema) { return null; } else if (schema instanceof ValidationError) { this.errors.push(schema); return schema; } var startErrorCount = this.errors.length; var frozenIndex, scannedFrozenSchemaIndex = null, scannedSchemasIndex = null; if (this.checkRecursive && data && typeof data === 'object') { topLevel = !this.scanned.length; if (data[this.validatedSchemasKey]) { var schemaIndex = data[this.validatedSchemasKey].indexOf(schema); if (schemaIndex !== -1) { this.errors = this.errors.concat(data[this.validationErrorsKey][schemaIndex]); return null; } } if (Object.isFrozen(data)) { frozenIndex = this.scannedFrozen.indexOf(data); if (frozenIndex !== -1) { var frozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].indexOf(schema); if (frozenSchemaIndex !== -1) { this.errors = this.errors.concat(this.scannedFrozenValidationErrors[frozenIndex][frozenSchemaIndex]); return null; } } } this.scanned.push(data); if (Object.isFrozen(data)) { if (frozenIndex === -1) { frozenIndex = this.scannedFrozen.length; this.scannedFrozen.push(data); this.scannedFrozenSchemas.push([]); } scannedFrozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].length; this.scannedFrozenSchemas[frozenIndex][scannedFrozenSchemaIndex] = schema; this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = []; } else { if (!data[this.validatedSchemasKey]) { try { Object.defineProperty(data, this.validatedSchemasKey, { value: [], configurable: true }); Object.defineProperty(data, this.validationErrorsKey, { value: [], configurable: true }); } catch (e) { //IE 7/8 workaround data[this.validatedSchemasKey] = []; data[this.validationErrorsKey] = []; } } scannedSchemasIndex = data[this.validatedSchemasKey].length; data[this.validatedSchemasKey][scannedSchemasIndex] = schema; data[this.validationErrorsKey][scannedSchemasIndex] = []; } } var errorCount = this.errors.length; var error = this.validateBasic(data, schema, dataPointerPath) || this.validateNumeric(data, schema, dataPointerPath) || this.validateString(data, schema, dataPointerPath) || this.validateArray(data, schema, dataPointerPath) || this.validateObject(data, schema, dataPointerPath) || this.validateCombinations(data, schema, dataPointerPath) || this.validateHypermedia(data, schema, dataPointerPath) || this.validateFormat(data, schema, dataPointerPath) || this.validateDefinedKeywords(data, schema, dataPointerPath) || null; if (topLevel) { while (this.scanned.length) { var item = this.scanned.pop(); delete item[this.validatedSchemasKey]; } this.scannedFrozen = []; this.scannedFrozenSchemas = []; } if (error || errorCount !== this.errors.length) { while ((dataPathParts && dataPathParts.length) || (schemaPathParts && schemaPathParts.length)) { var dataPart = (dataPathParts && dataPathParts.length) ? "" + dataPathParts.pop() : null; var schemaPart = (schemaPathParts && schemaPathParts.length) ? "" + schemaPathParts.pop() : null; if (error) { error = error.prefixWith(dataPart, schemaPart); } this.prefixErrors(errorCount, dataPart, schemaPart); } } if (scannedFrozenSchemaIndex !== null) { this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = this.errors.slice(startErrorCount); } else if (scannedSchemasIndex !== null) { data[this.validationErrorsKey][scannedSchemasIndex] = this.errors.slice(startErrorCount); } return this.handleError(error); }; ValidatorContext.prototype.validateFormat = function (data, schema) { if (typeof schema.format !== 'string' || !this.formatValidators[schema.format]) { return null; } var errorMessage = this.formatValidators[schema.format].call(null, data, schema); if (typeof errorMessage === 'string' || typeof errorMessage === 'number') { return this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage}).prefixWith(null, "format"); } else if (errorMessage && typeof errorMessage === 'object') { return this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage.message || "?"}, errorMessage.dataPath || null, errorMessage.schemaPath || "/format"); } return null; }; ValidatorContext.prototype.validateDefinedKeywords = function (data, schema) { for (var key in this.definedKeywords) { if (typeof schema[key] === 'undefined') { continue; } var validationFunctions = this.definedKeywords[key]; for (var i = 0; i < validationFunctions.length; i++) { var func = validationFunctions[i]; var result = func(data, schema[key], schema); if (typeof result === 'string' || typeof result === 'number') { return this.createError(ErrorCodes.KEYWORD_CUSTOM, {key: key, message: result}).prefixWith(null, "format"); } else if (result && typeof result === 'object') { var code = result.code || ErrorCodes.KEYWORD_CUSTOM; if (typeof code === 'string') { if (!ErrorCodes[code]) { throw new Error('Undefined error code (use defineError): ' + code); } code = ErrorCodes[code]; } var messageParams = (typeof result.message === 'object') ? result.message : {key: key, message: result.message || "?"}; var schemaPath = result.schemaPath ||( "/" + key.replace(/~/g, '~0').replace(/\//g, '~1')); return this.createError(code, messageParams, result.dataPath || null, schemaPath); } } } return null; }; function recursiveCompare(A, B) { if (A === B) { return true; } if (typeof A === "object" && typeof B === "object") { if (Array.isArray(A) !== Array.isArray(B)) { return false; } else if (Array.isArray(A)) { if (A.length !== B.length) { return false; } for (var i = 0; i < A.length; i++) { if (!recursiveCompare(A[i], B[i])) { return false; } } } else { var key; for (key in A) { if (B[key] === undefined && A[key] !== undefined) { return false; } } for (key in B) { if (A[key] === undefined && B[key] !== undefined) { return false; } } for (key in A) { if (!recursiveCompare(A[key], B[key])) { return false; } } } return true; } return false; } ValidatorContext.prototype.validateBasic = function validateBasic(data, schema, dataPointerPath) { var error; if (error = this.validateType(data, schema, dataPointerPath)) { return error.prefixWith(null, "type"); } if (error = this.validateEnum(data, schema, dataPointerPath)) { return error.prefixWith(null, "type"); } return null; }; ValidatorContext.prototype.validateType = function validateType(data, schema) { if (schema.type === undefined) { return null; } var dataType = typeof data; if (data === null) { dataType = "null"; } else if (Array.isArray(data)) { dataType = "array"; } var allowedTypes = schema.type; if (typeof allowedTypes !== "object") { allowedTypes = [allowedTypes]; } for (var i = 0; i < allowedTypes.length; i++) { var type = allowedTypes[i]; if (type === dataType || (type === "integer" && dataType === "number" && (data % 1 === 0))) { return null; } } return this.createError(ErrorCodes.INVALID_TYPE, {type: dataType, expected: allowedTypes.join("/")}); }; ValidatorContext.prototype.validateEnum = function validateEnum(data, schema) { if (schema["enum"] === undefined) { return null; } for (var i = 0; i < schema["enum"].length; i++) { var enumVal = schema["enum"][i]; if (recursiveCompare(data, enumVal)) { return null; } } return this.createError(ErrorCodes.ENUM_MISMATCH, {value: (typeof JSON !== 'undefined') ? JSON.stringify(data) : data}); }; ValidatorContext.prototype.validateNumeric = function validateNumeric(data, schema, dataPointerPath) { return this.validateMultipleOf(data, schema, dataPointerPath) || this.validateMinMax(data, schema, dataPointerPath) || this.validateNaN(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateMultipleOf = function validateMultipleOf(data, schema) { var multipleOf = schema.multipleOf || schema.divisibleBy; if (multipleOf === undefined) { return null; } if (typeof data === "number") { if (data % multipleOf !== 0) { return this.createError(ErrorCodes.NUMBER_MULTIPLE_OF, {value: data, multipleOf: multipleOf}); } } return null; }; ValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema) { if (typeof data !== "number") { return null; } if (schema.minimum !== undefined) { if (data < schema.minimum) { return this.createError(ErrorCodes.NUMBER_MINIMUM, {value: data, minimum: schema.minimum}).prefixWith(null, "minimum"); } if (schema.exclusiveMinimum && data === schema.minimum) { return this.createError(ErrorCodes.NUMBER_MINIMUM_EXCLUSIVE, {value: data, minimum: schema.minimum}).prefixWith(null, "exclusiveMinimum"); } } if (schema.maximum !== undefined) { if (data > schema.maximum) { return this.createError(ErrorCodes.NUMBER_MAXIMUM, {value: data, maximum: schema.maximum}).prefixWith(null, "maximum"); } if (schema.exclusiveMaximum && data === schema.maximum) { return this.createError(ErrorCodes.NUMBER_MAXIMUM_EXCLUSIVE, {value: data, maximum: schema.maximum}).prefixWith(null, "exclusiveMaximum"); } } return null; }; ValidatorContext.prototype.validateNaN = function validateNaN(data) { if (typeof data !== "number") { return null; } if (isNaN(data) === true || data === Infinity || data === -Infinity) { return this.createError(ErrorCodes.NUMBER_NOT_A_NUMBER, {value: data}).prefixWith(null, "type"); } return null; }; ValidatorContext.prototype.validateString = function validateString(data, schema, dataPointerPath) { return this.validateStringLength(data, schema, dataPointerPath) || this.validateStringPattern(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateStringLength = function validateStringLength(data, schema) { if (typeof data !== "string") { return null; } if (schema.minLength !== undefined) { if (data.length < schema.minLength) { return this.createError(ErrorCodes.STRING_LENGTH_SHORT, {length: data.length, minimum: schema.minLength}).prefixWith(null, "minLength"); } } if (schema.maxLength !== undefined) { if (data.length > schema.maxLength) { return this.createError(ErrorCodes.STRING_LENGTH_LONG, {length: data.length, maximum: schema.maxLength}).prefixWith(null, "maxLength"); } } return null; }; ValidatorContext.prototype.validateStringPattern = function validateStringPattern(data, schema) { if (typeof data !== "string" || schema.pattern === undefined) { return null; } var regexp = new RegExp(schema.pattern); if (!regexp.test(data)) { return this.createError(ErrorCodes.STRING_PATTERN, {pattern: schema.pattern}).prefixWith(null, "pattern"); } return null; }; ValidatorContext.prototype.validateArray = function validateArray(data, schema, dataPointerPath) { if (!Array.isArray(data)) { return null; } return this.validateArrayLength(data, schema, dataPointerPath) || this.validateArrayUniqueItems(data, schema, dataPointerPath) || this.validateArrayItems(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateArrayLength = function validateArrayLength(data, schema) { var error; if (schema.minItems !== undefined) { if (data.length < schema.minItems) { error = (this.createError(ErrorCodes.ARRAY_LENGTH_SHORT, {length: data.length, minimum: schema.minItems})).prefixWith(null, "minItems"); if (this.handleError(error)) { return error; } } } if (schema.maxItems !== undefined) { if (data.length > schema.maxItems) { error = (this.createError(ErrorCodes.ARRAY_LENGTH_LONG, {length: data.length, maximum: schema.maxItems})).prefixWith(null, "maxItems"); if (this.handleError(error)) { return error; } } } return null; }; ValidatorContext.prototype.validateArrayUniqueItems = function validateArrayUniqueItems(data, schema) { if (schema.uniqueItems) { for (var i = 0; i < data.length; i++) { for (var j = i + 1; j < data.length; j++) { if (recursiveCompare(data[i], data[j])) { var error = (this.createError(ErrorCodes.ARRAY_UNIQUE, {match1: i, match2: j})).prefixWith(null, "uniqueItems"); if (this.handleError(error)) { return error; } } } } } return null; }; ValidatorContext.prototype.validateArrayItems = function validateArrayItems(data, schema, dataPointerPath) { if (schema.items === undefined) { return null; } var error, i; if (Array.isArray(schema.items)) { for (i = 0; i < data.length; i++) { if (i < schema.items.length) { if (error = this.validateAll(data[i], schema.items[i], [i], ["items", i], dataPointerPath + "/" + i)) { return error; } } else if (schema.additionalItems !== undefined) { if (typeof schema.additionalItems === "boolean") { if (!schema.additionalItems) { error = (this.createError(ErrorCodes.ARRAY_ADDITIONAL_ITEMS, {})).prefixWith("" + i, "additionalItems"); if (this.handleError(error)) { return error; } } } else if (error = this.validateAll(data[i], schema.additionalItems, [i], ["additionalItems"], dataPointerPath + "/" + i)) { return error; } } } } else { for (i = 0; i < data.length; i++) { if (error = this.validateAll(data[i], schema.items, [i], ["items"], dataPointerPath + "/" + i)) { return error; } } } return null; }; ValidatorContext.prototype.validateObject = function validateObject(data, schema, dataPointerPath) { if (typeof data !== "object" || data === null || Array.isArray(data)) { return null; } return this.validateObjectMinMaxProperties(data, schema, dataPointerPath) || this.validateObjectRequiredProperties(data, schema, dataPointerPath) || this.validateObjectProperties(data, schema, dataPointerPath) || this.validateObjectDependencies(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateObjectMinMaxProperties = function validateObjectMinMaxProperties(data, schema) { var keys = Object.keys(data); var error; if (schema.minProperties !== undefined) { if (keys.length < schema.minProperties) { error = this.createError(ErrorCodes.OBJECT_PROPERTIES_MINIMUM, {propertyCount: keys.length, minimum: schema.minProperties}).prefixWith(null, "minProperties"); if (this.handleError(error)) { return error; } } } if (schema.maxProperties !== undefined) { if (keys.length > schema.maxProperties) { error = this.createError(ErrorCodes.OBJECT_PROPERTIES_MAXIMUM, {propertyCount: keys.length, maximum: schema.maxProperties}).prefixWith(null, "maxProperties"); if (this.handleError(error)) { return error; } } } return null; }; ValidatorContext.prototype.validateObjectRequiredProperties = function validateObjectRequiredProperties(data, schema) { if (schema.required !== undefined) { for (var i = 0; i < schema.required.length; i++) { var key = schema.required[i]; if (data[key] === undefined) { var error = this.createError(ErrorCodes.OBJECT_REQUIRED, {key: key}).prefixWith(null, "" + i).prefixWith(null, "required"); if (this.handleError(error)) { return error; } } } } return null; }; ValidatorContext.prototype.validateObjectProperties = function validateObjectProperties(data, schema, dataPointerPath) { var error; for (var key in data) { var keyPointerPath = dataPointerPath + "/" + key.replace(/~/g, '~0').replace(/\//g, '~1'); var foundMatch = false; if (schema.properties !== undefined && schema.properties[key] !== undefined) { foundMatch = true; if (error = this.validateAll(data[key], schema.properties[key], [key], ["properties", key], keyPointerPath)) { return error; } } if (schema.patternProperties !== undefined) { for (var patternKey in schema.patternProperties) { var regexp = new RegExp(patternKey); if (regexp.test(key)) { foundMatch = true; if (error = this.validateAll(data[key], schema.patternProperties[patternKey], [key], ["patternProperties", patternKey], keyPointerPath)) { return error; } } } } if (!foundMatch) { if (schema.additionalProperties !== undefined) { if (this.trackUnknownProperties) { this.knownPropertyPaths[keyPointerPath] = true; delete this.unknownPropertyPaths[keyPointerPath]; } if (typeof schema.additionalProperties === "boolean") { if (!schema.additionalProperties) { error = this.createError(ErrorCodes.OBJECT_ADDITIONAL_PROPERTIES, {}).prefixWith(key, "additionalProperties"); if (this.handleError(error)) { return error; } } } else { if (error = this.validateAll(data[key], schema.additionalProperties, [key], ["additionalProperties"], keyPointerPath)) { return error; } } } else if (this.trackUnknownProperties && !this.knownPropertyPaths[keyPointerPath]) { this.unknownPropertyPaths[keyPointerPath] = true; } } else if (this.trackUnknownProperties) { this.knownPropertyPaths[keyPointerPath] = true; delete this.unknownPropertyPaths[keyPointerPath]; } } return null; }; ValidatorContext.prototype.validateObjectDependencies = function validateObjectDependencies(data, schema, dataPointerPath) { var error; if (schema.dependencies !== undefined) { for (var depKey in schema.dependencies) { if (data[depKey] !== undefined) { var dep = schema.dependencies[depKey]; if (typeof dep === "string") { if (data[dep] === undefined) { error = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: dep}).prefixWith(null, depKey).prefixWith(null, "dependencies"); if (this.handleError(error)) { return error; } } } else if (Array.isArray(dep)) { for (var i = 0; i < dep.length; i++) { var requiredKey = dep[i]; if (data[requiredKey] === undefined) { error = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: requiredKey}).prefixWith(null, "" + i).prefixWith(null, depKey).prefixWith(null, "dependencies"); if (this.handleError(error)) { return error; } } } } else { if (error = this.validateAll(data, dep, [], ["dependencies", depKey], dataPointerPath)) { return error; } } } } } return null; }; ValidatorContext.prototype.validateCombinations = function validateCombinations(data, schema, dataPointerPath) { return this.validateAllOf(data, schema, dataPointerPath) || this.validateAnyOf(data, schema, dataPointerPath) || this.validateOneOf(data, schema, dataPointerPath) || this.validateNot(data, schema, dataPointerPath) || null; }; ValidatorContext.prototype.validateAllOf = function validateAllOf(data, schema, dataPointerPath) { if (schema.allOf === undefined) { return null; } var error; for (var i = 0; i < schema.allOf.length; i++) { var subSchema = schema.allOf[i]; if (error = this.validateAll(data, subSchema, [], ["allOf", i], dataPointerPath)) { return error; } } return null; }; ValidatorContext.prototype.validateAnyOf = function validateAnyOf(data, schema, dataPointerPath) { if (schema.anyOf === undefined) { return null; } var errors = []; var startErrorCount = this.errors.length; var oldUnknownPropertyPaths, oldKnownPropertyPaths; if (this.trackUnknownProperties) { oldUnknownPropertyPaths = this.unknownPropertyPaths; oldKnownPropertyPaths = this.knownPropertyPaths; } var errorAtEnd = true; for (var i = 0; i < schema.anyOf.length; i++) { if (this.trackUnknownProperties) { this.unknownPropertyPaths = {}; this.knownPropertyPaths = {}; } var subSchema = schema.anyOf[i]; var errorCount = this.errors.length; var error = this.validateAll(data, subSchema, [], ["anyOf", i], dataPointerPath); if (error === null && errorCount === this.errors.length) { this.errors = this.errors.slice(0, startErrorCount); if (this.trackUnknownProperties) { for (var knownKey in this.knownPropertyPaths) { oldKnownPropertyPaths[knownKey] = true; delete oldUnknownPropertyPaths[knownKey]; } for (var unknownKey in this.unknownPropertyPaths) { if (!oldKnownPropertyPaths[unknownKey]) { oldUnknownPropertyPaths[unknownKey] = true; } } // We need to continue looping so we catch all the property definitions, but we don't want to return an error errorAtEnd = false; continue; } return null; } if (error) { errors.push(error.prefixWith(null, "" + i).prefixWith(null, "anyOf")); } } if (this.trackUnknownProperties) { this.unknownPropertyPaths = oldUnknownPropertyPaths; this.knownPropertyPaths = oldKnownPropertyPaths; } if (errorAtEnd) { errors = errors.concat(this.errors.slice(startErrorCount)); this.errors = this.errors.slice(0, startErrorCount); return this.createError(ErrorCodes.ANY_OF_MISSING, {}, "", "/anyOf", errors); } }; ValidatorContext.prototype.validateOneOf = function validateOneOf(data, schema, dataPointerPath) { if (schema.oneOf === undefined) { return null; } var validIndex = null; var errors = []; var startErrorCount = this.errors.length; var oldUnknownPropertyPaths, oldKnownPropertyPaths; if (this.trackUnknownProperties) { oldUnknownPropertyPaths = this.unknownPropertyPaths; oldKnownPropertyPaths = this.knownPropertyPaths; } for (var i = 0; i < schema.oneOf.length; i++) { if (this.trackUnknownProperties) { this.unknownPropertyPaths = {}; this.knownPropertyPaths = {}; } var subSchema = schema.oneOf[i]; var errorCount = this.errors.length; var error = this.validateAll(data, subSchema, [], ["oneOf", i], dataPointerPath); if (error === null && errorCount === this.errors.length) { if (validIndex === null) { validIndex = i; } else { this.errors = this.errors.slice(0, startErrorCount); return this.createError(ErrorCodes.ONE_OF_MULTIPLE, {index1: validIndex, index2: i}, "", "/oneOf"); } if (this.trackUnknownProperties) { for (var knownKey in this.knownPropertyPaths) { oldKnownPropertyPaths[knownKey] = true; delete oldUnknownPropertyPaths[knownKey]; } for (var unknownKey in this.unknownPropertyPaths) { if (!oldKnownPropertyPaths[unknownKey]) { oldUnknownPropertyPaths[unknownKey] = true; } } } } else if (error) { errors.push(error); } } if (this.trackUnknownProperties) { this.unknownPropertyPaths = oldUnknownPropertyPaths; this.knownPropertyPaths = oldKnownPropertyPaths; } if (validIndex === null) { errors = errors.concat(this.errors.slice(startErrorCount)); this.errors = this.errors.slice(0, startErrorCount); return this.createError(ErrorCodes.ONE_OF_MISSING, {}, "", "/oneOf", errors); } else { this.errors = this.errors.slice(0, startErrorCount); } return null; }; ValidatorContext.prototype.validateNot = function validateNot(data, schema, dataPointerPath) { if (schema.not === undefined) { return null; } var oldErrorCount = this.errors.length; var oldUnknownPropertyPaths, oldKnownPropertyPaths; if (this.trackUnknownProperties) { oldUnknownPropertyPaths = this.unknownPropertyPaths; oldKnownPropertyPaths = this.knownPropertyPaths; this.unknownPropertyPaths = {}; this.knownPropertyPaths = {}; } var error = this.validateAll(data, schema.not, null, null, dataPointerPath); var notErrors = this.errors.slice(oldErrorCount); this.errors = this.errors.slice(0, oldErrorCount); if (this.trackUnknownProperties) { this.unknownPropertyPaths = oldUnknownPropertyPaths; this.knownPropertyPaths = oldKnownPropertyPaths; } if (error === null && notErrors.length === 0) { return this.createError(ErrorCodes.NOT_PASSED, {}, "", "/not"); } return null; }; ValidatorContext.prototype.validateHypermedia = function validateCombinations(data, schema, dataPointerPath) { if (!schema.links) { return null; } var error; for (var i = 0; i < schema.links.length; i++) { var ldo = schema.links[i]; if (ldo.rel === "describedby") { var template = new UriTemplate(ldo.href); var allPresent = true; for (var j = 0; j < template.varNames.length; j++) { if (!(template.varNames[j] in data)) { allPresent = false; break; } } if (allPresent) { var schemaUrl = template.fillFromObject(data); var subSchema = {"$ref": schemaUrl}; if (error = this.validateAll(data, subSchema, [], ["links", i], dataPointerPath)) { return error; } } } } }; // parseURI() and resolveUrl() are from https://gist.github.com/1088850 // - released as public domain by author ("Yaffle") - see comments on gist function parseURI(url) { var m = String(url).replace(/^\s+|\s+$/g, '').match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); // authority = '//' + user + ':' + pass '@' + hostname + ':' port return (m ? { href : m[0] || '', protocol : m[1] || '', authority: m[2] || '', host : m[3] || '', hostname : m[4] || '', port : m[5] || '', pathname : m[6] || '', search : m[7] || '', hash : m[8] || '' } : null); } function resolveUrl(base, href) {// RFC 3986 function removeDotSegments(input) { var output = []; input.replace(/^(\.\.?(\/|$))+/, '') .replace(/\/(\.(\/|$))+/g, '/') .replace(/\/\.\.$/, '/../') .replace(/\/?[^\/]*/g, function (p) { if (p === '/..') { output.pop(); } else { output.push(p); } }); return output.join('').replace(/^\//, input.charAt(0) === '/' ? '/' : ''); } href = parseURI(href || ''); base = parseURI(base || ''); return !href || !base ? null : (href.protocol || base.protocol) + (href.protocol || href.authority ? href.authority : base.authority) + removeDotSegments(href.protocol || href.authority || href.pathname.charAt(0) === '/' ? href.pathname : (href.pathname ? ((base.authority && !base.pathname ? '/' : '') + base.pathname.slice(0, base.pathname.lastIndexOf('/') + 1) + href.pathname) : base.pathname)) + (href.protocol || href.authority || href.pathname ? href.search : (href.search || base.search)) + href.hash; } function getDocumentUri(uri) { return uri.split('#')[0]; } function normSchema(schema, baseUri) { if (schema && typeof schema === "object") { if (baseUri === undefined) { baseUri = schema.id; } else if (typeof schema.id === "string") { baseUri = resolveUrl(baseUri, schema.id); schema.id = baseUri; } if (Array.isArray(schema)) { for (var i = 0; i < schema.length; i++) { normSchema(schema[i], baseUri); } } else { if (typeof schema['$ref'] === "string") { schema['$ref'] = resolveUrl(baseUri, schema['$ref']); } for (var key in schema) { if (key !== "enum") { normSchema(schema[key], baseUri); } } } } } var ErrorCodes = { INVALID_TYPE: 0, ENUM_MISMATCH: 1, ANY_OF_MISSING: 10, ONE_OF_MISSING: 11, ONE_OF_MULTIPLE: 12, NOT_PASSED: 13, // Numeric errors NUMBER_MULTIPLE_OF: 100, NUMBER_MINIMUM: 101, NUMBER_MINIMUM_EXCLUSIVE: 102, NUMBER_MAXIMUM: 103, NUMBER_MAXIMUM_EXCLUSIVE: 104, NUMBER_NOT_A_NUMBER: 105, // String errors STRING_LENGTH_SHORT: 200, STRING_LENGTH_LONG: 201, STRING_PATTERN: 202, // Object errors OBJECT_PROPERTIES_MINIMUM: 300, OBJECT_PROPERTIES_MAXIMUM: 301, OBJECT_REQUIRED: 302, OBJECT_ADDITIONAL_PROPERTIES: 303, OBJECT_DEPENDENCY_KEY: 304, // Array errors ARRAY_LENGTH_SHORT: 400, ARRAY_LENGTH_LONG: 401, ARRAY_UNIQUE: 402, ARRAY_ADDITIONAL_ITEMS: 403, // Custom/user-defined errors FORMAT_CUSTOM: 500, KEYWORD_CUSTOM: 501, // Schema structure CIRCULAR_REFERENCE: 600, // Non-standard validation options UNKNOWN_PROPERTY: 1000 }; var ErrorCodeLookup = {}; for (var key in ErrorCodes) { ErrorCodeLookup[ErrorCodes[key]] = key; } var ErrorMessagesDefault = { INVALID_TYPE: "Invalid type: {type} (expected {expected})", ENUM_MISMATCH: "No enum match for: {value}", ANY_OF_MISSING: "Data does not match any schemas from \"anyOf\"", ONE_OF_MISSING: "Data does not match any schemas from \"oneOf\"", ONE_OF_MULTIPLE: "Data is valid against more than one schema from \"oneOf\": indices {index1} and {index2}", NOT_PASSED: "Data matches schema from \"not\"", // Numeric errors NUMBER_MULTIPLE_OF: "Value {value} is not a multiple of {multipleOf}", NUMBER_MINIMUM: "Value {value} is less than minimum {minimum}", NUMBER_MINIMUM_EXCLUSIVE: "Value {value} is equal to exclusive minimum {minimum}", NUMBER_MAXIMUM: "Value {value} is greater than maximum {maximum}", NUMBER_MAXIMUM_EXCLUSIVE: "Value {value} is equal to exclusive maximum {maximum}", NUMBER_NOT_A_NUMBER: "Value {value} is not a valid number", // String errors STRING_LENGTH_SHORT: "String is too short ({length} chars), minimum {minimum}", STRING_LENGTH_LONG: "String is too long ({length} chars), maximum {maximum}", STRING_PATTERN: "String does not match pattern: {pattern}", // Object errors OBJECT_PROPERTIES_MINIMUM: "Too few properties defined ({propertyCount}), minimum {minimum}", OBJECT_PROPERTIES_MAXIMUM: "Too many properties defined ({propertyCount}), maximum {maximum}", OBJECT_REQUIRED: "Missing required property: {key}", OBJECT_ADDITIONAL_PROPERTIES: "Additional properties not allowed", OBJECT_DEPENDENCY_KEY: "Dependency failed - key must exist: {missing} (due to key: {key})", // Array errors ARRAY_LENGTH_SHORT: "Array is too short ({length}), minimum {minimum}", ARRAY_LENGTH_LONG: "Array is too long ({length}), maximum {maximum}", ARRAY_UNIQUE: "Array items are not unique (indices {match1} and {match2})", ARRAY_ADDITIONAL_ITEMS: "Additional items not allowed", // Format errors FORMAT_CUSTOM: "Format validation failed ({message})", KEYWORD_CUSTOM: "Keyword failed: {key} ({message})", // Schema structure CIRCULAR_REFERENCE: "Circular $refs: {urls}", // Non-standard validation options UNKNOWN_PROPERTY: "Unknown property (not in schema)" }; function ValidationError(code, message, params, dataPath, schemaPath, subErrors) { Error.call(this); if (code === undefined) { throw new Error ("No code supplied for error: "+ message); } this.message = message; this.params = params; this.code = code; this.dataPath = dataPath || ""; this.schemaPath = schemaPath || ""; this.subErrors = subErrors || null; var err = new Error(this.message); this.stack = err.stack || err.stacktrace; if (!this.stack) { try { throw err; } catch(err) { this.stack = err.stack || err.stacktrace; } } } ValidationError.prototype = Object.create(Error.prototype); ValidationError.prototype.constructor = ValidationError; ValidationError.prototype.name = 'ValidationError'; ValidationError.prototype.prefixWith = function (dataPrefix, schemaPrefix) { if (dataPrefix !== null) { dataPrefix = dataPrefix.replace(/~/g, "~0").replace(/\//g, "~1"); this.dataPath = "/" + dataPrefix + this.dataPath; } if (schemaPrefix !== null) { schemaPrefix = schemaPrefix.replace(/~/g, "~0").replace(/\//g, "~1"); this.schemaPath = "/" + schemaPrefix + this.schemaPath; } if (this.subErrors !== null) { for (var i = 0; i < this.subErrors.length; i++) { this.subErrors[i].prefixWith(dataPrefix, schemaPrefix); } } return this; }; function isTrustedUrl(baseUrl, testUrl) { if(testUrl.substring(0, baseUrl.length) === baseUrl){ var remainder = testUrl.substring(baseUrl.length); if ((testUrl.length > 0 && testUrl.charAt(baseUrl.length - 1) === "/") || remainder.charAt(0) === "#" || remainder.charAt(0) === "?") { return true; } } return false; } var languages = {}; function createApi(language) { var globalContext = new ValidatorContext(); var currentLanguage = language || 'en'; var api = { addFormat: function () { globalContext.addFormat.apply(globalContext, arguments); }, language: function (code) { if (!code) { return currentLanguage; } if (!languages[code]) { code = code.split('-')[0]; // fall back to base language } if (languages[code]) { currentLanguage = code; return code; // so you can tell if fall-back has happened } return false; }, addLanguage: function (code, messageMap) { var key; for (key in ErrorCodes) { if (messageMap[key] && !messageMap[ErrorCodes[key]]) { messageMap[ErrorCodes[key]] = messageMap[key]; } } var rootCode = code.split('-')[0]; if (!languages[rootCode]) { // use for base language if not yet defined languages[code] = messageMap; languages[rootCode] = messageMap; } else { languages[code] = Object.create(languages[rootCode]); for (key in messageMap) { if (typeof languages[rootCode][key] === 'undefined') { languages[rootCode][key] = messageMap[key]; } languages[code][key] = messageMap[key]; } } return this; }, freshApi: function (language) { var result = createApi(); if (language) { result.language(language); } return result; }, validate: function (data, schema, checkRecursive, banUnknownProperties) { var context = new ValidatorContext(globalContext, false, languages[currentLanguage], checkRecursive, banUnknownProperties); if (typeof schema === "string") { schema = {"$ref": schema}; } context.addSchema("", schema); var error = context.validateAll(data, schema, null, null, ""); if (!error && banUnknownProperties) { error = context.banUnknownProperties(); } this.error = error; this.missing = context.missing; this.valid = (error === null); return this.valid; }, validateResult: function () { var result = {}; this.validate.apply(result, arguments); return result; }, validateMultiple: function (data, schema, checkRecursive, banUnknownProperties) { var context = new ValidatorContext(globalContext, true, languages[currentLanguage], checkRecursive, banUnknownProperties); if (typeof schema === "string") { schema = {"$ref": schema}; } context.addSchema("", schema); context.validateAll(data, schema, null, null, ""); if (banUnknownProperties) { context.banUnknownProperties(); } var result = {}; result.errors = context.errors; result.missing = context.missing; result.valid = (result.errors.length === 0); return result; }, addSchema: function () { return globalContext.addSchema.apply(globalContext, arguments); }, getSchema: function () { return globalContext.getSchema.apply(globalContext, arguments); }, getSchemaMap: function () { return globalContext.getSchemaMap.apply(globalContext, arguments); }, getSchemaUris: function () { return globalContext.getSchemaUris.apply(globalContext, arguments); }, getMissingUris: function () { return globalContext.getMissingUris.apply(globalContext, arguments); }, dropSchemas: function () { globalContext.dropSchemas.apply(globalContext, arguments); }, defineKeyword: function () { globalContext.defineKeyword.apply(globalContext, arguments); }, defineError: function (codeName, codeNumber, defaultMessage) { if (typeof codeName !== 'string' || !/^[A-Z]+(_[A-Z]+)*$/.test(codeName)) { throw new Error('Code name must be a string in UPPER_CASE_WITH_UNDERSCORES'); } if (typeof codeNumber !== 'number' || codeNumber%1 !== 0 || codeNumber < 10000) { throw new Error('Code number must be an integer > 10000'); } if (typeof ErrorCodes[codeName] !== 'undefined') { throw new Error('Error already defined: ' + codeName + ' as ' + ErrorCodes[codeName]); } if (typeof ErrorCodeLookup[codeNumber] !== 'undefined') { throw new Error('Error code already used: ' + ErrorCodeLookup[codeNumber] + ' as ' + codeNumber); } ErrorCodes[codeName] = codeNumber; ErrorCodeLookup[codeNumber] = codeName; ErrorMessagesDefault[codeName] = ErrorMessagesDefault[codeNumber] = defaultMessage; for (var langCode in languages) { var language = languages[langCode]; if (language[codeName]) { language[codeNumber] = language[codeNumber] || language[codeName]; } } }, reset: function () { globalContext.reset(); this.error = null; this.missing = []; this.valid = true; }, missing: [], error: null, valid: true, normSchema: normSchema, resolveUrl: resolveUrl, getDocumentUri: getDocumentUri, errorCodes: ErrorCodes }; return api; } var tv4 = createApi(); tv4.addLanguage('en-gb', ErrorMessagesDefault); //legacy property tv4.tv4 = tv4; return tv4; // used by _header.js to globalise. })); /** FILE: lib/Math.uuid.js **/ /*! Math.uuid.js (v1.4) http://www.broofa.com mailto:robert@broofa.com Copyright (c) 2010 Robert Kieffer Dual licensed under the MIT and GPL licenses. ******** Changes within remoteStorage.js: 2012-10-31: - added AMD wrapper <niklas@unhosted.org> - moved extensions for Math object into exported object. */ /* * Generate a random uuid. * * USAGE: Math.uuid(length, radix) * length - the desired number of characters * radix - the number of allowable values for each character. * * EXAMPLES: * // No arguments - returns RFC4122, version 4 ID * >>> Math.uuid() * "92329D39-6F5C-4520-ABFC-AAB64544E172" * * // One argument - returns ID of the specified length * >>> Math.uuid(15) // 15 character ID (default base=62) * "VcydxgltxrVZSTV" * * // Two arguments - returns ID of the specified length, and radix. (Radix must be <= 62) * >>> Math.uuid(8, 2) // 8 character ID (base=2) * "01001010" * >>> Math.uuid(8, 10) // 8 character ID (base=10) * "47473046" * >>> Math.uuid(8, 16) // 8 character ID (base=16) * "098F4D35" */ // Private array of chars to use var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); Math.uuid = function (len, radix) { var chars = CHARS, uuid = [], i; radix = radix || chars.length; if (len) { // Compact form for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random()*radix]; } else { // rfc4122, version 4 form var r; // rfc4122 requires these characters uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'; uuid[14] = '4'; // Fill in random data. At i==19 set the high bits of clock sequence as // per rfc4122, sec. 4.1.5 for (i = 0; i < 36; i++) { if (!uuid[i]) { r = 0 | Math.random()*16; uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r]; } } } return uuid.join(''); }; /** FILE: src/baseclient.js **/ (function (global) { function deprecate(thing, replacement) { console.log('WARNING: ' + thing + ' is deprecated. Use ' + replacement + ' instead.'); } var RS = RemoteStorage; /** * Class: RemoteStorage.BaseClient * * Provides a high-level interface to access data below a given root path. * * A BaseClient deals with three types of data: folders, objects and files. * * <getListing> returns a mapping of all items within a folder. Items that * end with a forward slash ("/") are child folders. For instance: * { * 'folder/': true, * 'document.txt': true * } * * <getObject> / <storeObject> operate on JSON objects. Each object has a type. * * <getFile> / <storeFile> operates on files. Each file has a MIME type. * * <remove> operates on either objects or files (but not folders, folders are * created and removed implictly). */ RS.BaseClient = function (storage, base) { if (base[base.length - 1] !== '/') { throw "Not a folder: " + base; } if (base === '/') { // allow absolute and relative paths for the root scope. this.makePath = function (path) { return (path[0] === '/' ? '' : '/') + path; }; } /** * Property: storage * * The <RemoteStorage> instance this <BaseClient> operates on. */ this.storage = storage; /** * Property: base * * Base path this <BaseClient> operates on. * * For the module's privateClient this would be /<moduleName>/, for the * corresponding publicClient /public/<moduleName>/. */ this.base = base; var parts = this.base.split('/'); if (parts.length > 2) { this.moduleName = parts[1]; } else { this.moduleName = 'root'; } // Defined in baseclient/types.js /** * Property: schemas * * Contains schema objects of all types known to the BaseClient instance **/ /** * Event: change * * Emitted when a node changes * * Arguments: * event - Event object containing information about the changed node * * (start code) * { * path: path, // Absolute path of the changed node, from the storage root * relativePath: relativePath, // Path of the changed node, relative to this baseclient's scope root * origin: 'window', 'local', 'remote', or 'conflict' // emitted by user action within the app, local data store, remote sync, or versioning conflicts * oldValue: oldBody, // Old body of the changed node (local version in conflicts; undefined if creation) * newValue: newBody, // New body of the changed node (remote version in conflicts; undefined if deletion) * lastCommonValue: lastCommonValue, //most recent known common ancestor body of 'yours' and 'theirs' in case of conflict * oldContentType: oldContentType, // Old contentType of the changed node ('yours' for conflicts; undefined if creation) * newContentType: newContentType, // New contentType of the changed node ('theirs' for conflicts; undefined if deletion) * lastCommonContentType: lastCommonContentType // Most recent known common ancestor contentType of 'yours' and 'theirs' in case of conflict * } * (end code) * * Example of an event with origin 'local' (fired on page load): * * (start code) * { * path: '/public/design/color.txt', * relativePath: 'color.txt', * origin: 'local', * oldValue: undefined, * newValue: 'white', * oldContentType: undefined, * newContentType: 'text/plain' * } * (end code) * * Example of a conflict: * Say you changed 'color.txt' from 'white' to 'blue'; if you have set `RemoteStorage.config.changeEvents.window` to `true`, * then you will receive: * * (start code) * { * path: '/public/design/color.txt', * relativePath: 'color.txt', * origin: 'window', * oldValue: 'white', * newValue: 'blue', * oldContentType: 'text/plain', * newContentType: 'text/plain' * } * (end code) * * But when this change is pushed out by asynchronous synchronization, this change may rejected by the * server, if the remote version has in the meantime changed from 'white' to for instance 'red'; this will then lead to a change * event with origin 'conflict' (usually a few seconds after the event with origin 'window', if you had that activated). Note * that since you already changed it from 'white' to 'blue' in the local version a few seconds ago, `oldValue` is now your local * value of 'blue': * * (start code) * { * path: '/public/design/color.txt', * relativePath: 'color.txt', * origin: 'conflict', * oldValue: 'blue', * newValue: 'red', * lastCommonValue: 'white', * oldContentType: 'text/plain, * newContentType: 'text/plain' * lastCommonContentType: 'text/plain' * } * (end code) * * In practice, you should always redraw your views to display the content of the `newValue` field when a change event is received, * regardless of its origin. Events with origin 'local' are fired conveniently during the page load, so that you can fill your views * when the page loads. Events with origin 'window' are fired whenever you change a value by calling a method on the baseClient; * these are disabled by default. Events with origin 'remote' are fired when remote changes are discovered during sync (only for caching * startegies 'SEEN' and 'ALL'). Events with origin 'conflict' are fired when a conflict occurs while pushing out your local changes to * the remote store in asynchronous synchronization (see example above). **/ RS.eventHandling(this, 'change'); this.on = this.on.bind(this); storage.onChange(this.base, this._fireChange.bind(this)); }; RS.BaseClient.prototype = { extend: function (object) { for (var key in object) { this[key] = object[key]; } return this; }, /** * Method: scope * * Returns a new <BaseClient> operating on a subpath of the current <base> path. */ scope: function (path) { return new RS.BaseClient(this.storage, this.makePath(path)); }, // folder operations /** * Method: getListing * * Get a list of child nodes below a given path. * * The callback semantics of getListing are identical to those of getObject. * * Parameters: * path - The path to query. It MUST end with a forward slash. * maxAge - Either false or the maximum age of cached listing in * milliseconds. Defaults to false in anonymous mode and to * 2*syncInterval in connected mode. * * Returns: * * A promise for an object, representing child nodes. If the maxAge * requirement cannot be met because of network problems, this promise * will be rejected. If the maxAge requirement is set to false, the * promise will always be fulfilled with data from the local store. * * Keys ending in a forward slash represent *folder nodes*, while all * other keys represent *data nodes*. * * For spec versions <= 01, the data node information will contain only * the item's ETag. For later spec versions, it will also contain the * content type and -length of the item. * * Example: * (start code) * client.getListing('', false).then(function (listing) { * // listing is for instance: * // { * // 'folder/': true, * // 'document.txt': true * // } * }); * (end code) */ getListing: function (path, maxAge) { if (typeof(path) !== 'string') { path = ''; } else if (path.length > 0 && path[path.length - 1] !== '/') { Promise.reject("Not a folder: " + path); } return this.storage.get(this.makePath(path), maxAge).then( function (r) { return (r.statusCode === 404) ? {} : r.body; } ); }, /** * Method: getAll * * Get all objects directly below a given path. * * Parameters: * path - Path to the folder. * maxAge - Either false or the maximum age of cached objects in * milliseconds. Defaults to false in anonymous mode and to * 2*syncInterval in connected mode. * * Returns: * A promise for an object in the form { path : object, ... }. If the * maxAge requirement cannot be met because of network problems, this * promise will be rejected. If the maxAge requirement is set to false, * the promise will always be fulfilled with data from the local store. * * For items that are not JSON-stringified objects (e.g. stored using * `storeFile` instead of `storeObject`), the object's value is filled in * with `true`. * * Example: * (start code) * client.getAll('', false).then(function (objects) { * for (var key in objects) { * console.log('- ' + key + ': ', objects[key]); * } * }); * (end code) */ getAll: function (path, maxAge) { if (typeof(path) !== 'string') { path = ''; } else if (path.length > 0 && path[path.length - 1] !== '/') { return Promise.reject("Not a folder: " + path); } return this.storage.get(this.makePath(path), maxAge).then(function (r) { if (r.statusCode === 404) { return {}; } if (typeof(r.body) === 'object') { var keys = Object.keys(r.body); if (keys.length === 0) { // treat this like 404. it probably means a folder listing that // has changes that haven't been pushed out yet. return {}; } var calls = keys.map(function (key) { return this.storage.get(this.makePath(path + key), maxAge) .then(function (o) { if (typeof(o.body) === 'string') { try { o.body = JSON.parse(o.body); } catch (e) { } } if (typeof(o.body) === 'object') { r.body[key] = o.body; } }); }.bind(this)); return Promise.all(calls).then(function () { return r.body; }); } }.bind(this)); }, // file operations /** * Method: getFile * * Get the file at the given path. A file is raw data, as opposed to * a JSON object (use <getObject> for that). * * Except for the return value structure, getFile works exactly like * getObject. * * Parameters: * path - See getObject. * maxAge - Either false or the maximum age of cached file in * milliseconds. Defaults to false in anonymous mode and to * 2*syncInterval in connected mode. * * Returns: * A promise for an object: * * mimeType - String representing the MIME Type of the document. * data - Raw data of the document (either a string or an ArrayBuffer) * * If the maxAge requirement cannot be met because of network problems, this * promise will be rejected. If the maxAge requirement is set to false, the * promise will always be fulfilled with data from the local store. * * Example: * (start code) * // Display an image: * client.getFile('path/to/some/image', false).then(function (file) { * var blob = new Blob([file.data], { type: file.mimeType }); * var targetElement = document.findElementById('my-image-element'); * targetElement.src = window.URL.createObjectURL(blob); * }); * (end code) */ getFile: function (path, maxAge) { if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.getFile must be a string'); } return this.storage.get(this.makePath(path), maxAge).then(function (r) { return { data: r.body, contentType: r.contentType, revision: r.revision // (this is new) }; }); }, /** * Method: storeFile * * Store raw data at a given path. * * Parameters: * mimeType - MIME media type of the data being stored * path - path relative to the module root. MAY NOT end in a forward slash. * data - string, ArrayBuffer or ArrayBufferView of raw data to store * * The given mimeType will later be returned, when retrieving the data * using <getFile>. * * Example (UTF-8 data): * (start code) * client.storeFile('text/html', 'index.html', '<h1>Hello World!</h1>'); * (end code) * * Example (Binary data): * (start code) * // MARKUP: * <input type="file" id="file-input"> * // CODE: * var input = document.getElementById('file-input'); * var file = input.files[0]; * var fileReader = new FileReader(); * * fileReader.onload = function () { * client.storeFile(file.type, file.name, fileReader.result); * }; * * fileReader.readAsArrayBuffer(file); * (end code) * */ storeFile: function (mimeType, path, body) { if (typeof(mimeType) !== 'string') { return Promise.reject('Argument \'mimeType\' of baseClient.storeFile must be a string'); } if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.storeFile must be a string'); } if (typeof(body) !== 'string' && typeof(body) !== 'object') { return Promise.reject('Argument \'body\' of baseClient.storeFile must be a string, ArrayBuffer, or ArrayBufferView'); } if (!this.storage.access.checkPathPermission(this.makePath(path), 'rw')) { console.warn('WARNING: Editing a document to which only read access (\'r\') was claimed'); } return this.storage.put(this.makePath(path), body, mimeType).then(function (r) { if (r.statusCode === 200 || r.statusCode === 201) { return r.revision; } else { return Promise.reject("Request (PUT " + this.makePath(path) + ") failed with status: " + r.statusCode); } }.bind(this)); }, // object operations /** * Method: getObject * * Get a JSON object from given path. * * Parameters: * path - Relative path from the module root (without leading slash). * maxAge - Either false or the maximum age of cached object in * milliseconds. Defaults to false in anonymous mode and to * 2*syncInterval in connected mode. * * Returns: * A promise for the object. If the maxAge requirement cannot be met * because of network problems, this promise will be rejected. If the * maxAge requirement is set to false, the promise will always be * fulfilled with data from the local store. * * Example: * (start code) * client.getObject('/path/to/object', false). * then(function (object) { * // object is either an object or null * }); * (end code) */ getObject: function (path, maxAge) { if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.getObject must be a string'); } return this.storage.get(this.makePath(path), maxAge).then(function (r) { if (typeof(r.body) === 'object') { // will be the case for documents stored with rs.js <= 0.10.0-beta2 return r.body; } else if (typeof(r.body) === 'string') { try { return JSON.parse(r.body); } catch (e) { throw "Not valid JSON: " + this.makePath(path); } } else if (typeof(r.body) !== 'undefined' && r.statusCode === 200) { return Promise.reject("Not an object: " + this.makePath(path)); } }.bind(this)); }, /** * Method: storeObject * * Store object at given path. Triggers synchronization. * * Parameters: * * type - unique type of this object within this module. See description below. * path - path relative to the module root. * object - an object to be saved to the given node. It must be serializable as JSON. * * Returns: * A promise to store the object. The promise fails with a ValidationError, when validations fail. * * * What about the type?: * * A great thing about having data on the web, is to be able to link to * it and rearrange it to fit the current circumstances. To facilitate * that, eventually you need to know how the data at hand is structured. * For documents on the web, this is usually done via a MIME type. The * MIME type of JSON objects however, is always application/json. * To add that extra layer of "knowing what this object is", remoteStorage * aims to use <JSON-LD at http://json-ld.org/>. * A first step in that direction, is to add a *@context attribute* to all * JSON data put into remoteStorage. * Now that is what the *type* is for. * * Within remoteStorage.js, @context values are built using three components: * http://remotestorage.io/spec/modules/ - A prefix to guarantee uniqueness * the module name - module names should be unique as well * the type given here - naming this particular kind of object within this module * * In retrospect that means, that whenever you introduce a new "type" in calls to * storeObject, you should make sure that once your code is in the wild, future * versions of the code are compatible with the same JSON structure. * * How to define types?: * * See <declareType> for examples. */ storeObject: function (typeAlias, path, object) { if (typeof(typeAlias) !== 'string') { return Promise.reject('Argument \'typeAlias\' of baseClient.storeObject must be a string'); } if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.storeObject must be a string'); } if (typeof(object) !== 'object') { return Promise.reject('Argument \'object\' of baseClient.storeObject must be an object'); } this._attachType(object, typeAlias); try { var validationResult = this.validate(object); if (! validationResult.valid) { return Promise.reject(validationResult); } } catch(exc) { return Promise.reject(exc); } return this.storage.put(this.makePath(path), JSON.stringify(object), 'application/json; charset=UTF-8').then(function (r) { if (r.statusCode === 200 || r.statusCode === 201) { return r.revision; } else { return Promise.reject("Request (PUT " + this.makePath(path) + ") failed with status: " + r.statusCode); } }.bind(this)); }, // generic operations /** * Method: remove * * Remove node at given path from storage. Triggers synchronization. * * Parameters: * path - Path relative to the module root. */ remove: function (path) { if (typeof(path) !== 'string') { return Promise.reject('Argument \'path\' of baseClient.remove must be a string'); } if (!this.storage.access.checkPathPermission(this.makePath(path), 'rw')) { console.warn('WARNING: Removing a document to which only read access (\'r\') was claimed'); } return this.storage.delete(this.makePath(path)); }, cache: function (path, strategy) { if (typeof(path) !== 'string') { throw 'Argument \'path\' of baseClient.cache must be a string'; } if (strategy === false) { deprecate('caching strategy <false>', '<"FLUSH">'); strategy = 'FLUSH'; } else if (strategy === undefined) { strategy = 'ALL'; } else if (typeof(strategy) !== 'string') { deprecate('that caching strategy', '<"ALL">'); strategy = 'ALL'; } if (strategy !== 'FLUSH' && strategy !== 'SEEN' && strategy !== 'ALL') { throw 'Argument \'strategy\' of baseclient.cache must be one of ' + '["FLUSH", "SEEN", "ALL"]'; } this.storage.caching.set(this.makePath(path), strategy); return this; }, flush: function (path) { return this.storage.local.flush(path); }, makePath: function (path) { return this.base + (path || ''); }, _fireChange: function (event) { if (RemoteStorage.config.changeEvents[event.origin]) { ['new', 'old', 'lastCommon'].forEach(function (fieldNamePrefix) { if ((!event[fieldNamePrefix+'ContentType']) || (/^application\/(.*)json(.*)/.exec(event[fieldNamePrefix+'ContentType']))) { if (typeof(event[fieldNamePrefix+'Value']) === 'string') { try { event[fieldNamePrefix+'Value'] = JSON.parse(event[fieldNamePrefix+'Value']); } catch(e) { } } } }); this._emit('change', event); } }, _cleanPath: RS.WireClient.cleanPath, /** * Method: getItemURL * * Retrieve full URL of item * * Parameters: * path - Path relative to the module root. */ getItemURL: function (path) { if (typeof(path) !== 'string') { throw 'Argument \'path\' of baseClient.getItemURL must be a string'; } if (this.storage.connected) { path = this._cleanPath( this.makePath(path) ); return this.storage.remote.href + path; } else { return undefined; } }, uuid: function () { return Math.uuid(); } }; /** * Method: RS#scope * * Returns a new <RS.BaseClient> scoped to the given path. * * Parameters: * path - Root path of new BaseClient. * * * Example: * (start code) * * var foo = remoteStorage.scope('/foo/'); * * // PUTs data "baz" to path /foo/bar * foo.storeFile('text/plain', 'bar', 'baz'); * * var something = foo.scope('something/'); * * // GETs listing from path /foo/something/bla/ * something.getListing('bla/'); * * (end code) * */ RS.BaseClient._rs_init = function () { RS.prototype.scope = function (path) { if (typeof(path) !== 'string') { throw 'Argument \'path\' of baseClient.scope must be a string'; } if (!this.access.checkPathPermission(path, 'r')) { var escapedPath = path.replace(/(['\\])/g, '\\$1'); console.warn('WARNING: please call remoteStorage.access.claim(\'' + escapedPath + '\', \'r\') (read only) or remoteStorage.access.claim(\'' + escapedPath + '\', \'rw\') (read/write) first'); } return new RS.BaseClient(this, path); }; }; /* e.g.: remoteStorage.defineModule('locations', function (priv, pub) { return { exports: { features: priv.scope('features/').defaultType('feature'), collections: priv.scope('collections/').defaultType('feature-collection'); } }; }); */ // Defined in baseclient/types.js /** * Method: declareType * * Declare a remoteStorage object type using a JSON schema. See * <RemoteStorage.BaseClient.Types> **/ })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/baseclient/types.js **/ (function(global) { /** * Class: RemoteStorage.BaseClient.Types * * - Manages and validates types of remoteStorage objects, using JSON-LD and * JSON Schema * - Adds schema declaration/validation methods to BaseClient instances. **/ RemoteStorage.BaseClient.Types = { // <alias> -> <uri> uris: {}, // <uri> -> <schema> schemas: {}, // <uri> -> <alias> aliases: {}, declare: function(moduleName, alias, uri, schema) { var fullAlias = moduleName + '/' + alias; if (schema.extends) { var extendedAlias; var parts = schema.extends.split('/'); if (parts.length === 1) { extendedAlias = moduleName + '/' + parts.shift(); } else { extendedAlias = parts.join('/'); } var extendedUri = this.uris[extendedAlias]; if (! extendedUri) { throw "Type '" + fullAlias + "' tries to extend unknown schema '" + extendedAlias + "'"; } schema.extends = this.schemas[extendedUri]; } this.uris[fullAlias] = uri; this.aliases[uri] = fullAlias; this.schemas[uri] = schema; }, resolveAlias: function(alias) { return this.uris[alias]; }, getSchema: function(uri) { return this.schemas[uri]; }, inScope: function(moduleName) { var ml = moduleName.length; var schemas = {}; for (var alias in this.uris) { if (alias.substr(0, ml + 1) === moduleName + '/') { var uri = this.uris[alias]; schemas[uri] = this.schemas[uri]; } } return schemas; } }; var SchemaNotFound = function(uri) { var error = new Error("Schema not found: " + uri); error.name = "SchemaNotFound"; return error; }; SchemaNotFound.prototype = Error.prototype; RemoteStorage.BaseClient.Types.SchemaNotFound = SchemaNotFound; /** * Class: RemoteStorage.BaseClient **/ RemoteStorage.BaseClient.prototype.extend({ /** * Method: declareType * * Declare a remoteStorage object type using a JSON schema. * * Parameters: * alias - A type alias/shortname * uri - (optional) JSON-LD URI of the schema. Automatically generated if none given * schema - A JSON Schema object describing the object type * * Example: * * (start code) * client.declareType('todo-item', { * "type": "object", * "properties": { * "id": { * "type": "string" * }, * "title": { * "type": "string" * }, * "finished": { * "type": "boolean" * "default": false * }, * "createdAt": { * "type": "date" * } * }, * "required": ["id", "title"] * }) * (end code) * * Visit <http://json-schema.org> for details on how to use JSON Schema. **/ declareType: function(alias, uri, schema) { if (! schema) { schema = uri; uri = this._defaultTypeURI(alias); } RemoteStorage.BaseClient.Types.declare(this.moduleName, alias, uri, schema); }, /** * Method: validate * * Validate an object against the associated schema. * * Parameters: * object - Object to validate. Must have a @context property. * * Returns: * An object containing information about validation errors **/ validate: function(object) { var schema = RemoteStorage.BaseClient.Types.getSchema(object['@context']); if (schema) { return tv4.validateResult(object, schema); } else { throw new SchemaNotFound(object['@context']); } }, _defaultTypeURI: function(alias) { return 'http://remotestorage.io/spec/modules/' + encodeURIComponent(this.moduleName) + '/' + encodeURIComponent(alias); }, _attachType: function(object, alias) { object['@context'] = RemoteStorage.BaseClient.Types.resolveAlias(this.moduleName + '/' + alias) || this._defaultTypeURI(alias); } }); // Documented in baseclient.js Object.defineProperty(RemoteStorage.BaseClient.prototype, 'schemas', { configurable: true, get: function() { return RemoteStorage.BaseClient.Types.inScope(this.moduleName); } }); })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/caching.js **/ /** * Class: RemoteStorage.Caching * * Holds/manages caching configuration. * * Caching strategies: * * For each subtree, you can set the caching strategy to 'ALL', * 'SEEN' (default), and 'FLUSH'. * * - 'ALL' means that once all outgoing changes have been pushed, sync * will start retrieving nodes to cache pro-actively. If a local * copy exists of everything, it will check on each sync whether * the ETag of the root folder changed, and retrieve remote changes * if they exist. * - 'SEEN' does this only for documents and folders that have been either * read from or written to at least once since connecting to the current * remote backend, plus their parent/ancestor folders up to the root * (to make tree-based sync possible). * - 'FLUSH' will only cache outgoing changes, and forget them as soon as * they have been saved to remote successfully. * **/ (function (global) { var SETTINGS_KEY = "remotestorage:caching"; var containingFolder = RemoteStorage.util.containingFolder; RemoteStorage.Caching = function () { this.reset(); }; RemoteStorage.Caching.prototype = { pendingActivations: [], /** * Method: set * * Set the caching strategy for a given path explicitly. * * Not needed when using <enable>/<disable>. * * Parameters: * path - Path to cache * value - Caching strategy. One of 'ALL', 'SEEN', or 'FLUSH'. * * Example: * (start code) * remoteStorage.caching.set('/bookmarks/archive') */ set: function (path, value) { if (typeof(path) !== 'string') { throw new Error('path should be a string'); } if (typeof(value) === 'undefined') { throw new Error("value should be 'FLUSH', 'SEEN', or 'ALL'"); } this._rootPaths[path] = value; if (value === 'ALL') { if (this.activateHandler) { this.activateHandler(path); } else { this.pendingActivations.push(path); } } }, /** * Method: enable * * Enable caching for a given path. * * Uses caching strategy 'ALL'. * * Parameters: * path - Path to enable caching for */ enable: function (path) { this.set(path, 'ALL'); }, /** * Method: disable * * Disable caching for a given path. * * Uses caching strategy 'FLUSH' (meaning items are only cached until * successfully pushed to the remote). * * Parameters: * path - Path to disable caching for */ disable: function (path) { this.set(path, 'FLUSH'); }, /** * Method: onActivate * * Set a callback for when caching is activated for a path. * * Parameters: * callback - Callback function */ onActivate: function (cb) { var i; RemoteStorage.log('[Caching] Setting activate handler', cb, this.pendingActivations); this.activateHandler = cb; for (i=0; i<this.pendingActivations.length; i++) { cb(this.pendingActivations[i]); } delete this.pendingActivations; }, /** * Method: checkPath * * Retrieve caching setting for a given path, or its next parent * with a caching strategy set. * * Parameters: * path - Path to retrieve setting for **/ checkPath: function (path) { if (this._rootPaths[path] !== undefined) { return this._rootPaths[path]; } else if (path === '/') { return 'SEEN'; } else { return this.checkPath(containingFolder(path)); } }, /** * Method: reset * * Reset the state of caching by deleting all caching information. **/ reset: function () { this._rootPaths = {}; } }; // TODO clean up/harmonize how modules are loaded and/or document this architecture properly // // At this point the global remoteStorage object has not been created yet. // Only its prototype exists so far, so we define a self-constructing // property on there: Object.defineProperty(RemoteStorage.prototype, 'caching', { configurable: true, get: function () { var caching = new RemoteStorage.Caching(); Object.defineProperty(this, 'caching', { value: caching }); return caching; } }); RemoteStorage.Caching._rs_init = function () {}; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/sync.js **/ (function (global) { var syncInterval = 10000, backgroundSyncInterval = 60000, isBackground = false; var isFolder = RemoteStorage.util.isFolder; var isDocument = RemoteStorage.util.isDocument; var equal = RemoteStorage.util.equal; var deepClone = RemoteStorage.util.deepClone; var pathsFromRoot = RemoteStorage.util.pathsFromRoot; function taskFor(action, path, promise) { return { action: action, path: path, promise: promise }; } function isStaleChild(node) { return node.remote && node.remote.revision && !node.remote.itemsMap && !node.remote.body; } function hasCommonRevision(node) { return node.common && node.common.revision; } function handleVisibility() { var hidden, visibilityChange, rs = this; function handleVisibilityChange(fg) { var oldValue, newValue; oldValue = rs.getCurrentSyncInterval(); isBackground = !fg; newValue = rs.getCurrentSyncInterval(); rs._emit('sync-interval-change', {oldValue: oldValue, newValue: newValue}); } RemoteStorage.Env.on("background", function () { handleVisibilityChange(false); }); RemoteStorage.Env.on("foreground", function () { handleVisibilityChange(true); }); } /** * Check if interval is valid: numeric and between 1000ms and 3600000ms * */ function isValidInterval(interval) { return (typeof interval === 'number' && interval > 1000 && interval < 3600000); } /** * Class: RemoteStorage.Sync * * What this class does is basically six things: * - retrieving the remote version of relevant documents and folders * - add all local and remote documents together into one tree * - push local documents out if they don't exist remotely * - push local changes out to remote documents (conditionally, to * avoid race conditions where both have changed) * - adopt the local version of a document to its remote version if * both exist and they differ * - delete the local version of a document if it was deleted remotely * - if any get requests were waiting for remote data, resolve them once * this data comes in. * * It does this using requests to documents, and to folders. Whenever a * folder GET comes in, it gives information about all the documents it * contains (this is the `markChildren` function). **/ RemoteStorage.Sync = function (setLocal, setRemote, setAccess, setCaching) { this.local = setLocal; this.local.onDiff(function (path) { this.addTask(path); this.doTasks(); }.bind(this)); this.remote = setRemote; this.access = setAccess; this.caching = setCaching; this._tasks = {}; this._running = {}; this._timeStarted = {}; RemoteStorage.eventHandling(this, 'done', 'req-done'); this.caching.onActivate(function (path) { this.addTask(path); this.doTasks(); }.bind(this)); }; RemoteStorage.Sync.prototype = { now: function () { return new Date().getTime(); }, queueGetRequest: function (path) { var pending = Promise.defer(); if (!this.remote.connected) { pending.reject('cannot fulfill maxAge requirement - remote is not connected'); } else if (!this.remote.online) { pending.reject('cannot fulfill maxAge requirement - remote is not online'); } else { this.addTask(path, function () { this.local.get(path).then(function (r) { return pending.resolve(r); }); }.bind(this)); this.doTasks(); } return pending.promise; }, corruptServerItemsMap: function (itemsMap, force02) { if ((typeof(itemsMap) !== 'object') || (Array.isArray(itemsMap))) { return true; } for (var itemName in itemsMap) { var item = itemsMap[itemName]; if (typeof(item) !== 'object') { return true; } if (typeof(item.ETag) !== 'string') { return true; } if (isFolder(itemName)) { if (itemName.substring(0, itemName.length-1).indexOf('/') !== -1) { return true; } } else { if (itemName.indexOf('/') !== -1) { return true; } if (force02) { if (typeof(item['Content-Type']) !== 'string') { return true; } if (typeof(item['Content-Length']) !== 'number') { return true; } } } } return false; }, corruptItemsMap: function (itemsMap) { if ((typeof(itemsMap) !== 'object') || (Array.isArray(itemsMap))) { return true; } for (var itemName in itemsMap) { if (typeof(itemsMap[itemName]) !== 'boolean') { return true; } } return false; }, corruptRevision: function (rev) { return ((typeof(rev) !== 'object') || (Array.isArray(rev)) || (rev.revision && typeof(rev.revision) !== 'string') || (rev.body && typeof(rev.body) !== 'string' && typeof(rev.body) !== 'object') || (rev.contentType && typeof(rev.contentType) !== 'string') || (rev.contentLength && typeof(rev.contentLength) !== 'number') || (rev.timestamp && typeof(rev.timestamp) !== 'number') || (rev.itemsMap && this.corruptItemsMap(rev.itemsMap))); }, isCorrupt: function (node) { return ((typeof(node) !== 'object') || (Array.isArray(node)) || (typeof(node.path) !== 'string') || (this.corruptRevision(node.common)) || (node.local && this.corruptRevision(node.local)) || (node.remote && this.corruptRevision(node.remote)) || (node.push && this.corruptRevision(node.push))); }, hasTasks: function () { return Object.getOwnPropertyNames(this._tasks).length > 0; }, collectDiffTasks: function () { var num = 0; return this.local.forAllNodes(function (node) { if (num > 100) { return; } if (this.isCorrupt(node)) { RemoteStorage.log('[Sync] WARNING: corrupt node in local cache', node); if (typeof(node) === 'object' && node.path) { this.addTask(node.path); num++; } } else if (this.needsFetch(node) && this.access.checkPathPermission(node.path, 'r')) { this.addTask(node.path); num++; } else if (isDocument(node.path) && this.needsPush(node) && this.access.checkPathPermission(node.path, 'rw')) { this.addTask(node.path); num++; } }.bind(this)).then(function () { return num; }, function (err) { throw err; }); }, inConflict: function (node) { return (node.local && node.remote && (node.remote.body !== undefined || node.remote.itemsMap)); }, needsRefresh: function (node) { if (node.common) { if (!node.common.timestamp) { return true; } return (this.now() - node.common.timestamp > syncInterval); } return false; }, needsFetch: function (node) { if (this.inConflict(node)) { return true; } if (node.common && node.common.itemsMap === undefined && node.common.body === undefined) { return true; } if (node.remote && node.remote.itemsMap === undefined && node.remote.body === undefined) { return true; } return false; }, needsPush: function (node) { if (this.inConflict(node)) { return false; } if (node.local && !node.push) { return true; } }, needsRemotePut: function (node) { return node.local && node.local.body; }, needsRemoteDelete: function (node) { return node.local && node.local.body === false; }, getParentPath: function (path) { var parts = path.match(/^(.*\/)([^\/]+\/?)$/); if (parts) { return parts[1]; } else { throw new Error('Not a valid path: "'+path+'"'); } }, deleteChildPathsFromTasks: function () { for (var path in this._tasks) { paths = pathsFromRoot(path); for (var i=1; i<paths.length; i++) { if (this._tasks[paths[i]]) { delete this._tasks[path]; } } } }, collectRefreshTasks: function () { return this.local.forAllNodes(function (node) { var parentPath; if (this.needsRefresh(node)) { try { parentPath = this.getParentPath(node.path); } catch(e) { // node.path is already '/', can't take parentPath } if (parentPath && this.access.checkPathPermission(parentPath, 'r')) { this.addTask(parentPath); } else if (this.access.checkPathPermission(node.path, 'r')) { this.addTask(node.path); } } }.bind(this)).then(function () { this.deleteChildPathsFromTasks(); }.bind(this), function (err) { throw err; }); }, flush: function (nodes) { for (var path in nodes) { // Strategy is 'FLUSH' and no local changes exist if (this.caching.checkPath(path) === 'FLUSH' && nodes[path] && !nodes[path].local) { RemoteStorage.log('[Sync] Flushing', path); nodes[path] = undefined; // Cause node to be flushed from cache } } return nodes; }, doTask: function (path) { return this.local.getNodes([path]).then(function (nodes) { var node = nodes[path]; // First fetch: if (typeof(node) === 'undefined') { return taskFor('get', path, this.remote.get(path)); } // Fetch known-stale child: else if (isStaleChild(node)) { return taskFor('get', path, this.remote.get(path)); } // Push PUT: else if (this.needsRemotePut(node)) { node.push = deepClone(node.local); node.push.timestamp = this.now(); return this.local.setNodes(this.flush(nodes)).then(function () { var options; if (hasCommonRevision(node)) { options = { ifMatch: node.common.revision }; } else { // Initial PUT (fail if something is already there) options = { ifNoneMatch: '*' }; } return taskFor('put', path, this.remote.put(path, node.push.body, node.push.contentType, options) ); }.bind(this)); } // Push DELETE: else if (this.needsRemoteDelete(node)) { node.push = { body: false, timestamp: this.now() }; return this.local.setNodes(this.flush(nodes)).then(function () { if (hasCommonRevision(node)) { return taskFor('delete', path, this.remote.delete(path, { ifMatch: node.common.revision }) ); } else { // Ascertain current common or remote revision first return taskFor('get', path, this.remote.get(path)); } }.bind(this)); } // Conditional refresh: else if (hasCommonRevision(node)) { return taskFor('get', path, this.remote.get(path, { ifNoneMatch: node.common.revision }) ); } else { return taskFor('get', path, this.remote.get(path)); } }.bind(this)); }, autoMergeFolder: function (node) { if (node.remote.itemsMap) { node.common = node.remote; delete node.remote; if (node.common.itemsMap) { for (var itemName in node.common.itemsMap) { if (!node.local.itemsMap[itemName]) { // Indicates the node is either newly being fetched // has been deleted locally (whether or not leading to conflict); // before listing it in local listings, check if a local deletion // exists. node.local.itemsMap[itemName] = false; } } if (equal(node.local.itemsMap, node.common.itemsMap)) { delete node.local; } } } return node; }, autoMergeDocument: function (node) { hasNoRemoteChanges = function (node) { if (node.remote && node.remote.revision && node.remote.revision !== node.common.revision) { return false; } return (node.common.body === undefined && node.remote.body === false) || (node.remote.body === node.common.body && node.remote.contentType === node.common.contentType); }; mergeMutualDeletion = function (node) { if (node.remote && node.remote.body === false && node.local && node.local.body === false) { delete node.local; } return node; }; if (hasNoRemoteChanges(node)) { node = mergeMutualDeletion(node); delete node.remote; } else if (node.remote.body !== undefined) { // keep/revert: RemoteStorage.log('[Sync] Emitting keep/revert'); this.local._emitChange({ origin: 'conflict', path: node.path, oldValue: node.local.body, newValue: node.remote.body, lastCommonValue: node.common.body, oldContentType: node.local.contentType, newContentType: node.remote.contentType, lastCommonContentType: node.common.contentType }); if (node.remote.body) { node.common = node.remote; } else { node.common = {}; } delete node.remote; delete node.local; } return node; }, autoMerge: function (node) { if (node.remote) { if (node.local) { if (isFolder(node.path)) { return this.autoMergeFolder(node); } else { return this.autoMergeDocument(node); } } else { // no local changes if (isFolder(node.path)) { if (node.remote.itemsMap !== undefined) { node.common = node.remote; delete node.remote; } } else { if (node.remote.body !== undefined) { var change = { origin: 'remote', path: node.path, oldValue: (node.common.body === false ? undefined : node.common.body), newValue: (node.remote.body === false ? undefined : node.remote.body), oldContentType: node.common.contentType, newContentType: node.remote.contentType }; if (change.oldValue || change.newValue) { this.local._emitChange(change); } if (!node.remote.body) { // no remote, so delete/don't create return; } node.common = node.remote; delete node.remote; } } } } else { if (node.common.body) { this.local._emitChange({ origin: 'remote', path: node.path, oldValue: node.common.body, newValue: undefined, oldContentType: node.common.contentType, newContentType: undefined }); } return undefined; } return node; }, updateCommonTimestamp: function (path, revision) { return this.local.getNodes([path]).then(function (nodes) { if (nodes[path] && nodes[path].common && nodes[path].common.revision === revision) { nodes[path].common.timestamp = this.now(); } return this.local.setNodes(this.flush(nodes)); }.bind(this)); }, markChildren: function (path, itemsMap, changedNodes, missingChildren) { var paths = []; var meta = {}; var recurse = {}; for (var item in itemsMap) { paths.push(path+item); meta[path+item] = itemsMap[item]; } for (var childName in missingChildren) { paths.push(path+childName); } return this.local.getNodes(paths).then(function (nodes) { var cachingStrategy; var node; nodeChanged = function (node, etag) { return node.common.revision !== etag && (!node.remote || node.remote.revision !== etag); }; for (var nodePath in nodes) { node = nodes[nodePath]; if (meta[nodePath]) { if (node && node.common) { if (nodeChanged(node, meta[nodePath].ETag)) { changedNodes[nodePath] = deepClone(node); changedNodes[nodePath].remote = { revision: meta[nodePath].ETag, timestamp: this.now() }; changedNodes[nodePath] = this.autoMerge(changedNodes[nodePath]); } } else { cachingStrategy = this.caching.checkPath(nodePath); if (cachingStrategy === 'ALL') { changedNodes[nodePath] = { path: nodePath, common: { timestamp: this.now() }, remote: { revision: meta[nodePath].ETag, timestamp: this.now() } }; } } if (changedNodes[nodePath] && meta[nodePath]['Content-Type']) { changedNodes[nodePath].remote.contentType = meta[nodePath]['Content-Type']; } if (changedNodes[nodePath] && meta[nodePath]['Content-Length']) { changedNodes[nodePath].remote.contentLength = meta[nodePath]['Content-Length']; } } else if (missingChildren[nodePath.substring(path.length)] && node && node.common) { if (node.common.itemsMap) { for (var commonItem in node.common.itemsMap) { recurse[nodePath+commonItem] = true; } } if (node.local && node.local.itemsMap) { for (var localItem in node.local.itemsMap) { recurse[nodePath+localItem] = true; } } if (node.remote || isFolder(nodePath)) { changedNodes[nodePath] = undefined; } else { changedNodes[nodePath] = this.autoMerge(node); if (typeof changedNodes[nodePath] === 'undefined') { var parentPath = this.getParentPath(nodePath); var parentNode = changedNodes[parentPath]; var itemName = nodePath.substring(path.length); if (parentNode && parentNode.local) { delete parentNode.local.itemsMap[itemName]; if (equal(parentNode.local.itemsMap, parentNode.common.itemsMap)) { delete parentNode.local; } } } } } } return this.deleteRemoteTrees(Object.keys(recurse), changedNodes).then(function (changedObjs2) { return this.local.setNodes(this.flush(changedObjs2)); }.bind(this)); }.bind(this)); }, deleteRemoteTrees: function (paths, changedNodes) { if (paths.length === 0) { return Promise.resolve(changedNodes); } return this.local.getNodes(paths).then(function (nodes) { var subPaths = {}; collectSubPaths = function (folder, path) { if (folder && folder.itemsMap) { for (var itemName in folder.itemsMap) { subPaths[path+itemName] = true; } } }; for (var path in nodes) { var node = nodes[path]; // TODO Why check for the node here? I don't think this check ever applies if (!node) { continue; } if (isFolder(path)) { collectSubPaths(node.common, path); collectSubPaths(node.local, path); } else { if (node.common && typeof(node.common.body) !== undefined) { changedNodes[path] = deepClone(node); changedNodes[path].remote = { body: false, timestamp: this.now() }; changedNodes[path] = this.autoMerge(changedNodes[path]); } } } // Recurse whole tree depth levels at once: return this.deleteRemoteTrees(Object.keys(subPaths), changedNodes).then(function (changedNodes2) { return this.local.setNodes(this.flush(changedNodes2)); }.bind(this)); }.bind(this)); }, completeFetch: function (path, bodyOrItemsMap, contentType, revision) { var paths; var parentPath; var pathsFromRootArr = pathsFromRoot(path); if (isFolder(path)) { paths = [path]; } else { parentPath = pathsFromRootArr[1]; paths = [path, parentPath]; } return this.local.getNodes(paths).then(function (nodes) { var itemName; var missingChildren = {}; var node = nodes[path]; var parentNode; collectMissingChildren = function (folder) { if (folder && folder.itemsMap) { for (var itemName in folder.itemsMap) { if (!bodyOrItemsMap[itemName]) { missingChildren[itemName] = true; } } } }; if (typeof(node) !== 'object' || node.path !== path || typeof(node.common) !== 'object') { node = { path: path, common: {} }; nodes[path] = node; } node.remote = { revision: revision, timestamp: this.now() }; if (isFolder(path)) { collectMissingChildren(node.common); collectMissingChildren(node.remote); node.remote.itemsMap = {}; for (itemName in bodyOrItemsMap) { node.remote.itemsMap[itemName] = true; } } else { node.remote.body = bodyOrItemsMap; node.remote.contentType = contentType; parentNode = nodes[parentPath]; if (parentNode && parentNode.local && parentNode.local.itemsMap) { itemName = path.substring(parentPath.length); parentNode.local.itemsMap[itemName] = true; if (equal(parentNode.local.itemsMap, parentNode.common.itemsMap)) { delete parentNode.local; } } } nodes[path] = this.autoMerge(node); return { toBeSaved: nodes, missingChildren: missingChildren }; }.bind(this)); }, completePush: function (path, action, conflict, revision) { return this.local.getNodes([path]).then(function (nodes) { var node = nodes[path]; if (!node.push) { this.stopped = true; throw new Error('completePush called but no push version!'); } if (conflict) { RemoteStorage.log('[Sync] We have a conflict'); if (!node.remote || node.remote.revision !== revision) { node.remote = { revision: revision || 'conflict', timestamp: this.now() }; delete node.push; } nodes[path] = this.autoMerge(node); } else { node.common = { revision: revision, timestamp: this.now() }; if (action === 'put') { node.common.body = node.push.body; node.common.contentType = node.push.contentType; if (equal(node.local.body, node.push.body) && node.local.contentType === node.push.contentType) { delete node.local; } delete node.push; } else if (action === 'delete') { if (node.local.body === false) { // No new local changes since push; flush it. nodes[path] = undefined; } else { delete node.push; } } } return this.local.setNodes(this.flush(nodes)); }.bind(this)); }, dealWithFailure: function (path, action, statusMeaning) { return this.local.getNodes([path]).then(function (nodes) { if (nodes[path]) { delete nodes[path].push; return this.local.setNodes(this.flush(nodes)); } }.bind(this)); }, interpretStatus: function (statusCode) { // if (typeof statusCode.length === 'number') { // statusCode = statusCode[0]; // } if (statusCode === 'offline' || statusCode === 'timeout') { return { successful: false, networkProblems: true, statusCode: statusCode }; } var series = Math.floor(statusCode / 100); return { successful: (series === 2 || statusCode === 304 || statusCode === 412 || statusCode === 404), conflict: (statusCode === 412), unAuth: ((statusCode === 401 && this.remote.token !== RemoteStorage.Authorize.IMPLIED_FAKE_TOKEN) || statusCode === 402 || statusCode === 403), notFound: (statusCode === 404), changed: (statusCode !== 304), statusCode: statusCode }; }, handleGetResponse: function (path, status, bodyOrItemsMap, contentType, revision) { if (status.notFound) { if (isFolder(path)) { bodyOrItemsMap = {}; } else { bodyOrItemsMap = false; } } if (status.changed) { return this.completeFetch(path, bodyOrItemsMap, contentType, revision).then(function (dataFromFetch) { if (isFolder(path)) { if (this.corruptServerItemsMap(bodyOrItemsMap)) { RemoteStorage.log('[Sync] WARNING: Discarding corrupt folder description from server for ' + path); return false; } else { return this.markChildren(path, bodyOrItemsMap, dataFromFetch.toBeSaved, dataFromFetch.missingChildren).then(function () { return true; }); } } else { return this.local.setNodes(this.flush(dataFromFetch.toBeSaved)).then(function () { return true; }); } }.bind(this)); } else { return this.updateCommonTimestamp(path, revision).then(function () { return true; }); } }, handleResponse: function (path, action, r) { var status = this.interpretStatus(r.statusCode); if (status.successful) { if (action === 'get') { return this.handleGetResponse(path, status, r.body, r.contentType, r.revision); } else if (action === 'put' || action === 'delete') { return this.completePush(path, action, status.conflict, r.revision).then(function () { return true; }); } else { throw new Error('cannot handle response for unknown action', action); } } else { // Unsuccessful var error; if (status.unAuth) { error = new RemoteStorage.Unauthorized(); } else if (status.networkProblems) { error = new RemoteStorage.SyncError('Network request failed.'); this.remote.online = false; } else { error = new Error('HTTP response code ' + status.statusCode + ' received.'); } return this.dealWithFailure(path, action, status).then(function () { remoteStorage._emit('error', error); throw error; }); } }, numThreads: 10, finishTask: function (task) { if (task.action === undefined) { delete this._running[task.path]; return; } var self = this; return task.promise.then(function (r) { return self.handleResponse(task.path, task.action, r); }, function (err) { RemoteStorage.log('[Sync] wireclient rejects its promise!', task.path, task.action, err); return self.handleResponse(task.path, task.action, {statusCode: 'offline'}); }) .then(function (completed) { delete self._timeStarted[task.path]; delete self._running[task.path]; self.remote.online = true; if (completed) { if (self._tasks[task.path]) { for (i=0; i<self._tasks[task.path].length; i++) { self._tasks[task.path][i](); } delete self._tasks[task.path]; } } self._emit('req-done'); self.collectTasks(false).then(function () { // See if there are any more tasks that are not refresh tasks if (!self.hasTasks() || self.stopped) { RemoteStorage.log('[Sync] Sync is done! Reschedule?', Object.getOwnPropertyNames(self._tasks).length, self.stopped); if (!self.done) { self.done = true; self._emit('done'); } } else { // Use a 10ms timeout to let the JavaScript runtime catch its breath // (and hopefully force an IndexedDB auto-commit?), and also to cause // the threads to get staggered and get a good spread over time: setTimeout(function () { self.doTasks(); }, 10); } }); }, function (err) { console.error('[Sync] Error', err); delete self._timeStarted[task.path]; delete self._running[task.path]; self._emit('req-done'); if (!self.done) { self.done = true; self._emit('done'); } }); }, doTasks: function () { var numToHave, numAdded = 0, numToAdd, path; if (this.remote.connected) { if (this.remote.online) { numToHave = this.numThreads; } else { numToHave = 1; } } else { numToHave = 0; } numToAdd = numToHave - Object.getOwnPropertyNames(this._running).length; if (numToAdd <= 0) { return true; } for (path in this._tasks) { if (!this._running[path]) { this._timeStarted = this.now(); this._running[path] = this.doTask(path); this._running[path].then(this.finishTask.bind(this)); numAdded++; if (numAdded >= numToAdd) { return true; } } } return (numAdded >= numToAdd); }, collectTasks: function (alsoCheckRefresh) { if (this.hasTasks() || this.stopped) { return Promise.resolve(); } return this.collectDiffTasks().then(function (numDiffs) { if (numDiffs || alsoCheckRefresh === false) { return Promise.resolve(); } else { return this.collectRefreshTasks(); } }.bind(this), function (err) { throw err; }); }, addTask: function (path, cb) { if (!this._tasks[path]) { this._tasks[path] = []; } if (typeof(cb) === 'function') { this._tasks[path].push(cb); } }, /** * Method: sync **/ sync: function () { this.done = false; if (!this.doTasks()) { return this.collectTasks().then(function () { try { this.doTasks(); } catch(e) { console.error('[Sync] doTasks error', e); } }.bind(this), function (e) { console.error('[Sync] Sync error', e); throw new Error('Local cache unavailable'); }); } else { return Promise.resolve(); } }, }; /** * Method: getSyncInterval * * Get the value of the sync interval when application is in the foreground * * Returns a number of milliseconds * */ RemoteStorage.prototype.getSyncInterval = function () { return syncInterval; }; /** * Method: setSyncInterval * * Set the value of the sync interval when application is in the foreground * * Parameters: * interval - sync interval in milliseconds * */ RemoteStorage.prototype.setSyncInterval = function (interval) { if (!isValidInterval(interval)) { throw interval + " is not a valid sync interval"; } var oldValue = syncInterval; syncInterval = parseInt(interval, 10); this._emit('sync-interval-change', {oldValue: oldValue, newValue: interval}); }; /** * Method: getBackgroundSyncInterval * * Get the value of the sync interval when application is in the background * * Returns a number of milliseconds * */ RemoteStorage.prototype.getBackgroundSyncInterval = function () { return backgroundSyncInterval; }; /** * Method: setBackgroundSyncInterval * * Set the value of the sync interval when the application is in the background * * Parameters: * interval - sync interval in milliseconds * */ RemoteStorage.prototype.setBackgroundSyncInterval = function (interval) { if(!isValidInterval(interval)) { throw interval + " is not a valid sync interval"; } var oldValue = backgroundSyncInterval; backgroundSyncInterval = parseInt(interval, 10); this._emit('sync-interval-change', {oldValue: oldValue, newValue: interval}); }; /** * Method: getCurrentSyncInterval * * Get the value of the current sync interval * * Returns a number of milliseconds * */ RemoteStorage.prototype.getCurrentSyncInterval = function () { return isBackground ? backgroundSyncInterval : syncInterval; }; var SyncError = function (originalError) { var msg = 'Sync failed: '; if (typeof(originalError) === 'object' && 'message' in originalError) { msg += originalError.message; } else { msg += originalError; } this.originalError = originalError; this.message = msg; }; SyncError.prototype = new Error(); SyncError.prototype.constructor = SyncError; RemoteStorage.SyncError = SyncError; RemoteStorage.prototype.syncCycle = function () { if (this.sync.stopped) { return; } this.sync.on('done', function () { RemoteStorage.log('[Sync] Sync done. Setting timer to', this.getCurrentSyncInterval()); if (!this.sync.stopped) { if (this._syncTimer) { clearTimeout(this._syncTimer); } this._syncTimer = setTimeout(this.sync.sync.bind(this.sync), this.getCurrentSyncInterval()); } }.bind(this)); this.sync.sync(); }; RemoteStorage.prototype.stopSync = function () { if (this.sync) { RemoteStorage.log('[Sync] Stopping sync'); this.sync.stopped = true; } else { // TODO When is this ever the case and what is syncStopped for then? RemoteStorage.log('[Sync] Will instantiate sync stopped'); this.syncStopped = true; } }; RemoteStorage.prototype.startSync = function () { this.sync.stopped = false; this.syncStopped = false; this.sync.sync(); }; var syncCycleCb; RemoteStorage.Sync._rs_init = function (remoteStorage) { syncCycleCb = function () { RemoteStorage.log('[Sync] syncCycleCb calling syncCycle'); if (RemoteStorage.Env.isBrowser()) { handleVisibility.bind(remoteStorage)(); } if (!remoteStorage.sync) { // Call this now that all other modules are also ready: remoteStorage.sync = new RemoteStorage.Sync( remoteStorage.local, remoteStorage.remote, remoteStorage.access, remoteStorage.caching); if (remoteStorage.syncStopped) { RemoteStorage.log('[Sync] Instantiating sync stopped'); remoteStorage.sync.stopped = true; delete remoteStorage.syncStopped; } } RemoteStorage.log('[Sync] syncCycleCb calling syncCycle'); remoteStorage.syncCycle(); }; remoteStorage.on('ready', syncCycleCb); }; RemoteStorage.Sync._rs_cleanup = function (remoteStorage) { remoteStorage.stopSync(); remoteStorage.removeEventListener('ready', syncCycleCb); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/cachinglayer.js **/ (function () { /** * Interface: cachinglayer * * This module defines functions that are mixed into remoteStorage.local when * it is instantiated (currently one of indexeddb.js, localstorage.js, or * inmemorystorage.js). * * All remoteStorage.local implementations should therefore implement * this.getNodes, this.setNodes, and this.forAllNodes. The rest is blended in * here to create a GPD (get/put/delete) interface which the BaseClient can * talk to. */ var isFolder = RemoteStorage.util.isFolder; var isDocument = RemoteStorage.util.isDocument; var deepClone = RemoteStorage.util.deepClone; var equal = RemoteStorage.util.equal; function getLatest(node) { if (typeof(node) !== 'object' || typeof(node.path) !== 'string') { return; } if (isFolder(node.path)) { if (node.local && node.local.itemsMap) { return node.local; } if (node.common && node.common.itemsMap) { return node.common; } } else { if (node.local && node.local.body && node.local.contentType) { return node.local; } if (node.common && node.common.body && node.common.contentType) { return node.common; } // Migration code! Once all apps use at least this version of the lib, we // can publish clean-up code that migrates over any old-format data, and // stop supporting it. For now, new apps will support data in both // formats, thanks to this: if (node.body && node.contentType) { return { body: node.body, contentType: node.contentType }; } } } function isOutdated(nodes, maxAge) { var path, node; for (path in nodes) { if (nodes[path] && nodes[path].remote) { return true; } nodeVersion = getLatest(nodes[path]); if (nodeVersion && nodeVersion.timestamp && (new Date().getTime()) - nodeVersion.timestamp <= maxAge) { return false; } else if (!nodeVersion) { return true; } } return true; } var pathsFromRoot = RemoteStorage.util.pathsFromRoot; function makeNode(path) { var node = { path: path, common: { } }; if (isFolder(path)) { node.common.itemsMap = {}; } return node; } function updateFolderNodeWithItemName(node, itemName) { if (!node.common) { node.common = { itemsMap: {} }; } if (!node.common.itemsMap) { node.common.itemsMap = {}; } if (!node.local) { node.local = deepClone(node.common); } if (!node.local.itemsMap) { node.local.itemsMap = node.common.itemsMap; } node.local.itemsMap[itemName] = true; return node; } var methods = { // TODO: improve our code structure so that this function // could call sync.queueGetRequest directly instead of needing // this hacky third parameter as a callback get: function (path, maxAge, queueGetRequest) { var self = this; if (typeof(maxAge) === 'number') { return self.getNodes(pathsFromRoot(path)) .then(function (objs) { var node = getLatest(objs[path]); if (isOutdated(objs, maxAge)) { return queueGetRequest(path); } else if (node) { return {statusCode: 200, body: node.body || node.itemsMap, contentType: node.contentType}; } else { return {statusCode: 404}; } }); } else { return self.getNodes([path]) .then(function (objs) { var node = getLatest(objs[path]); if (node) { if (isFolder(path)) { for (var i in node.itemsMap) { // the hasOwnProperty check here is only because our jshint settings require it: if (node.itemsMap.hasOwnProperty(i) && node.itemsMap[i] === false) { delete node.itemsMap[i]; } } } return {statusCode: 200, body: node.body || node.itemsMap, contentType: node.contentType}; } else { return {statusCode: 404}; } }); } }, put: function (path, body, contentType) { var paths = pathsFromRoot(path); var self = this; function _processNodes(paths, nodes) { try { for (var i = 0, len = paths.length; i < len; i++) { var path = paths[i]; var node = nodes[path]; var previous; if (!node) { nodes[path] = node = makeNode(path); } // Document if (i === 0) { previous = getLatest(node); node.local = { body: body, contentType: contentType, previousBody: (previous ? previous.body : undefined), previousContentType: (previous ? previous.contentType : undefined), }; } // Folder else { var itemName = paths[i-1].substring(path.length); node = updateFolderNodeWithItemName(node, itemName); } } return nodes; } catch (e) { RemoteStorage.log('[Cachinglayer] Error during PUT', nodes, i, e); throw e; } } return this._updateNodes(paths, _processNodes); }, delete: function (path) { var paths = pathsFromRoot(path); return this._updateNodes(paths, function (paths, nodes) { for (var i = 0, len = paths.length; i < len; i++) { var path = paths[i]; var node = nodes[path]; if (!node) { throw new Error('Cannot delete non-existing node '+path); } if (i === 0) { // Document previous = getLatest(node); node.local = { body: false, previousBody: (previous ? previous.body : undefined), previousContentType: (previous ? previous.contentType : undefined), }; } else { // Folder if (!node.local) { node.local = deepClone(node.common); } var itemName = paths[i-1].substring(path.length); delete node.local.itemsMap[itemName]; if (Object.getOwnPropertyNames(node.local.itemsMap).length > 0) { // This folder still contains other items, don't remove any further ancestors break; } } } return nodes; }); }, flush: function (path) { var self = this; return self._getAllDescendentPaths(path).then(function (paths) { return self.getNodes(paths); }).then(function (nodes) { for (var path in nodes) { var node = nodes[path]; if (node && node.common && node.local) { self._emitChange({ path: node.path, origin: 'local', oldValue: (node.local.body === false ? undefined : node.local.body), newValue: (node.common.body === false ? undefined : node.common.body) }); } nodes[path] = undefined; } return self.setNodes(nodes); }); }, _emitChange: function (obj) { if (RemoteStorage.config.changeEvents[obj.origin]) { this._emit('change', obj); } }, fireInitial: function () { if (!RemoteStorage.config.changeEvents.local) { return; } var self = this; self.forAllNodes(function (node) { var latest; if (isDocument(node.path)) { latest = getLatest(node); if (latest) { self._emitChange({ path: node.path, origin: 'local', oldValue: undefined, oldContentType: undefined, newValue: latest.body, newContentType: latest.contentType }); } } }).then(function () { self._emit('local-events-done'); }); }, onDiff: function (diffHandler) { this.diffHandler = diffHandler; }, migrate: function (node) { if (typeof(node) === 'object' && !node.common) { node.common = {}; if (typeof(node.path) === 'string') { if (node.path.substr(-1) === '/' && typeof(node.body) === 'object') { node.common.itemsMap = node.body; } } else { //save legacy content of document node as local version if (!node.local) { node.local = {}; } node.local.body = node.body; node.local.contentType = node.contentType; } } return node; }, // FIXME // this process of updating nodes needs to be heavily documented first, then // refactored. Right now it's almost impossible to refactor as there's no // explanation of why things are implemented certain ways or what the goal(s) // of the behavior are. -slvrbckt _updateNodesRunning: false, _updateNodesQueued: [], _updateNodes: function (paths, _processNodes) { var pending = Promise.defer(); this._doUpdateNodes(paths, _processNodes, pending); return pending.promise; }, _doUpdateNodes: function (paths, _processNodes, promise) { var self = this; if (self._updateNodesRunning) { self._updateNodesQueued.push({ paths: paths, cb: _processNodes, promise: promise }); return; } else { self._updateNodesRunning = true; } self.getNodes(paths).then(function (nodes) { var existingNodes = deepClone(nodes); var changeEvents = []; var node; nodes = _processNodes(paths, nodes); for (var path in nodes) { node = nodes[path]; if (equal(node, existingNodes[path])) { delete nodes[path]; } else if (isDocument(path)) { changeEvents.push({ path: path, origin: 'window', oldValue: node.local.previousBody, newValue: node.local.body === false ? undefined : node.local.body, oldContentType: node.local.previousContentType, newContentType: node.local.contentType }); delete node.local.previousBody; delete node.local.previousContentType; } } self.setNodes(nodes).then(function () { self._emitChangeEvents(changeEvents); promise.resolve({statusCode: 200}); }); }).then(function () { return Promise.resolve(); }, function (err) { promise.reject(err); }).then(function () { self._updateNodesRunning = false; var nextJob = self._updateNodesQueued.shift(); if (nextJob) { self._doUpdateNodes(nextJob.paths, nextJob.cb, nextJob.promise); } }); }, _emitChangeEvents: function (events) { for (var i = 0, len = events.length; i < len; i++) { this._emitChange(events[i]); if (this.diffHandler) { this.diffHandler(events[i].path); } } }, _getAllDescendentPaths: function (path) { var self = this; if (isFolder(path)) { return self.getNodes([path]).then(function (nodes) { var allPaths = [path]; var latest = getLatest(nodes[path]); var itemNames = Object.keys(latest.itemsMap); var calls = itemNames.map(function (itemName) { return self._getAllDescendentPaths(path+itemName).then(function (paths) { for (var i = 0, len = paths.length; i < len; i++) { allPaths.push(paths[i]); } }); }); return Promise.all(calls).then(function () { return allPaths; }); }); } else { return Promise.resolve([path]); } }, _getInternals: function () { return { getLatest: getLatest, makeNode: makeNode, isOutdated: isOutdated }; } }; /** * Function: cachingLayer * * Mixes common caching layer functionality into an object. * * The first parameter is always the object to be extended. * * Example: * (start code) * var MyConstructor = function () { * cachingLayer(this); * }; * (end code) */ RemoteStorage.cachingLayer = function (object) { for (var key in methods) { object[key] = methods[key]; } }; })(); /** FILE: src/indexeddb.js **/ (function (global) { /** * Class: RemoteStorage.IndexedDB * * * IndexedDB Interface * ------------------- * * TODO rewrite, doesn't expose GPD anymore, it's in cachinglayer now * * This file exposes a get/put/delete interface, accessing data in an IndexedDB. * * There are multiple parts to this interface: * * The RemoteStorage integration: * - RemoteStorage.IndexedDB._rs_supported() determines if IndexedDB support * is available. If it isn't, RemoteStorage won't initialize the feature. * - RemoteStorage.IndexedDB._rs_init() initializes the feature. It returns * a promise that is fulfilled as soon as the database has been opened and * migrated. * * The storage interface (RemoteStorage.IndexedDB object): * - Usually this is accessible via "remoteStorage.local" * - #get() takes a path and returns a promise. * - #put() takes a path, body and contentType and also returns a promise. * - #delete() takes a path and also returns a promise. * - #on('change', ...) events, being fired whenever something changes in * the storage. Change events roughly follow the StorageEvent pattern. * They have "oldValue" and "newValue" properties, which can be used to * distinguish create/update/delete operations and analyze changes in * change handlers. In addition they carry a "origin" property, which * is either "window", "local", or "remote". "remote" events are fired * whenever a change comes in from RemoteStorage.Sync. * * The sync interface (also on RemoteStorage.IndexedDB object): * - #getNodes([paths]) returns the requested nodes in a promise. * - #setNodes(map) stores all the nodes given in the (path -> node) map. * */ var RS = RemoteStorage; var DB_VERSION = 2; var DEFAULT_DB_NAME = 'remotestorage'; var DEFAULT_DB; RS.IndexedDB = function (database) { this.db = database || DEFAULT_DB; if (!this.db) { RemoteStorage.log("[IndexedDB] Failed to open DB"); return undefined; } RS.cachingLayer(this); RS.eventHandling(this, 'change', 'local-events-done'); this.getsRunning = 0; this.putsRunning = 0; /** * Property: changesQueued * * Given a node for which uncommitted changes exist, this cache * stores either the entire uncommitted node, or false for a deletion. * The node's path is used as the key. * * changesQueued stores changes for which no IndexedDB transaction has * been started yet. */ this.changesQueued = {}; /** * Property: changesRunning * * Given a node for which uncommitted changes exist, this cache * stores either the entire uncommitted node, or false for a deletion. * The node's path is used as the key. * * At any time there is at most one IndexedDB transaction running. * changesRunning stores the changes that are included in that currently * running IndexedDB transaction, or if none is running, of the last one * that ran. */ this.changesRunning = {}; }; RS.IndexedDB.prototype = { getNodes: function (paths) { var misses = [], fromCache = {}; for (var i = 0, len = paths.length; i < len; i++) { if (this.changesQueued[paths[i]] !== undefined) { fromCache[paths[i]] = RemoteStorage.util.deepClone(this.changesQueued[paths[i]] || undefined); } else if(this.changesRunning[paths[i]] !== undefined) { fromCache[paths[i]] = RemoteStorage.util.deepClone(this.changesRunning[paths[i]] || undefined); } else { misses.push(paths[i]); } } if (misses.length > 0) { return this.getNodesFromDb(misses).then(function (nodes) { for (var i in fromCache) { nodes[i] = fromCache[i]; } return nodes; }); } else { return Promise.resolve(fromCache); } }, setNodes: function (nodes) { for (var i in nodes) { this.changesQueued[i] = nodes[i] || false; } this.maybeFlush(); return Promise.resolve(); }, maybeFlush: function () { if (this.putsRunning === 0) { this.flushChangesQueued(); } else { if (!this.commitSlownessWarning) { this.commitSlownessWarning = setInterval(function () { console.log('WARNING: waited more than 10 seconds for previous commit to finish'); }, 10000); } } }, flushChangesQueued: function () { if (this.commitSlownessWarning) { clearInterval(this.commitSlownessWarning); this.commitSlownessWarning = null; } if (Object.keys(this.changesQueued).length > 0) { this.changesRunning = this.changesQueued; this.changesQueued = {}; this.setNodesInDb(this.changesRunning).then(this.flushChangesQueued.bind(this)); } }, getNodesFromDb: function (paths) { var pending = Promise.defer(); var transaction = this.db.transaction(['nodes'], 'readonly'); var nodes = transaction.objectStore('nodes'); var retrievedNodes = {}; var startTime = new Date().getTime(); this.getsRunning++; paths.map(function (path, i) { nodes.get(path).onsuccess = function (evt) { retrievedNodes[path] = evt.target.result; }; }); transaction.oncomplete = function () { pending.resolve(retrievedNodes); this.getsRunning--; }.bind(this); transaction.onerror = transaction.onabort = function () { pending.reject('get transaction error/abort'); this.getsRunning--; }.bind(this); return pending.promise; }, setNodesInDb: function (nodes) { var pending = Promise.defer(); var transaction = this.db.transaction(['nodes'], 'readwrite'); var nodesStore = transaction.objectStore('nodes'); var startTime = new Date().getTime(); this.putsRunning++; RemoteStorage.log('[IndexedDB] Starting put', nodes, this.putsRunning); for (var path in nodes) { var node = nodes[path]; if(typeof(node) === 'object') { try { nodesStore.put(node); } catch(e) { RemoteStorage.log('[IndexedDB] Error while putting', node, e); throw e; } } else { try { nodesStore.delete(path); } catch(e) { RemoteStorage.log('[IndexedDB] Error while removing', nodesStore, node, e); throw e; } } } transaction.oncomplete = function () { this.putsRunning--; RemoteStorage.log('[IndexedDB] Finished put', nodes, this.putsRunning, (new Date().getTime() - startTime)+'ms'); pending.resolve(); }.bind(this); transaction.onerror = function () { this.putsRunning--; pending.reject('transaction error'); }.bind(this); transaction.onabort = function () { pending.reject('transaction abort'); this.putsRunning--; }.bind(this); return pending.promise; }, reset: function (callback) { var dbName = this.db.name; var self = this; this.db.close(); RS.IndexedDB.clean(this.db.name, function() { RS.IndexedDB.open(dbName, function (err, other) { if (err) { RemoteStorage.log('[IndexedDB] Error while resetting local storage', err); } else { // hacky! self.db = other; } if (typeof callback === 'function') { callback(self); } }); }); }, forAllNodes: function (cb) { var pending = Promise.defer(); var transaction = this.db.transaction(['nodes'], 'readonly'); var cursorReq = transaction.objectStore('nodes').openCursor(); cursorReq.onsuccess = function (evt) { var cursor = evt.target.result; if (cursor) { cb(this.migrate(cursor.value)); cursor.continue(); } else { pending.resolve(); } }.bind(this); return pending.promise; }, closeDB: function () { this.db.close(); } }; RS.IndexedDB.open = function (name, callback) { var timer = setTimeout(function () { callback("timeout trying to open db"); }, 10000); var req = indexedDB.open(name, DB_VERSION); req.onerror = function () { RemoteStorage.log('[IndexedDB] Opening DB failed', req); clearTimeout(timer); callback(req.error); }; req.onupgradeneeded = function (event) { var db = req.result; RemoteStorage.log("[IndexedDB] Upgrade: from ", event.oldVersion, " to ", event.newVersion); if (event.oldVersion !== 1) { RemoteStorage.log("[IndexedDB] Creating object store: nodes"); db.createObjectStore('nodes', { keyPath: 'path' }); } RemoteStorage.log("[IndexedDB] Creating object store: changes"); db.createObjectStore('changes', { keyPath: 'path' }); }; req.onsuccess = function () { clearTimeout(timer); callback(null, req.result); }; }; RS.IndexedDB.clean = function (databaseName, callback) { var req = indexedDB.deleteDatabase(databaseName); req.onsuccess = function () { RemoteStorage.log('[IndexedDB] Done removing DB'); callback(); }; req.onerror = req.onabort = function (evt) { console.error('Failed to remove database "' + databaseName + '"', evt); }; }; RS.IndexedDB._rs_init = function (remoteStorage) { var pending = Promise.defer(); RS.IndexedDB.open(DEFAULT_DB_NAME, function (err, db) { if (err) { pending.reject(err); } else { DEFAULT_DB = db; db.onerror = function () { remoteStorage._emit('error', err); }; pending.resolve(); } }); return pending.promise; }; RS.IndexedDB._rs_supported = function () { var pending = Promise.defer(); if ('indexedDB' in global) { try { var check = indexedDB.open("rs-check"); check.onerror = function (event) { pending.reject(); }; check.onsuccess = function (event) { indexedDB.deleteDatabase("rs-check"); pending.resolve(); }; } catch(e) { pending.reject(); } } else { pending.reject(); } return pending.promise; }; RS.IndexedDB._rs_cleanup = function (remoteStorage) { var pending = Promise.defer(); if (remoteStorage.local) { remoteStorage.local.closeDB(); } RS.IndexedDB.clean(DEFAULT_DB_NAME, function () { pending.resolve(); }); return pending.promise; }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/localstorage.js **/ (function (global) { /** * Class: RemoteStorage.LocalStorage * * localStorage caching adapter. Used when no IndexedDB available. **/ var NODES_PREFIX = "remotestorage:cache:nodes:"; var CHANGES_PREFIX = "remotestorage:cache:changes:"; RemoteStorage.LocalStorage = function () { RemoteStorage.cachingLayer(this); RemoteStorage.log('[LocalStorage] Registering events'); RemoteStorage.eventHandling(this, 'change', 'local-events-done'); }; function b64ToUint6(nChr) { return nChr > 64 && nChr < 91 ? nChr - 65 : nChr > 96 && nChr < 123 ? nChr - 71 : nChr > 47 && nChr < 58 ? nChr + 4 : nChr === 43 ? 62 : nChr === 47 ? 63 : 0; } function base64DecToArr(sBase64, nBlocksSize) { var sB64Enc = sBase64.replace(/[^A-Za-z0-9\+\/]/g, ""), nInLen = sB64Enc.length, nOutLen = nBlocksSize ? Math.ceil((nInLen * 3 + 1 >> 2) / nBlocksSize) * nBlocksSize : nInLen * 3 + 1 >> 2, taBytes = new Uint8Array(nOutLen); for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) { nMod4 = nInIdx & 3; nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4; if (nMod4 === 3 || nInLen - nInIdx === 1) { for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255; } nUint24 = 0; } } return taBytes; } function isBinary(node) { return node.match(/charset=binary/); } function isRemoteStorageKey(key) { return key.substr(0, NODES_PREFIX.length) === NODES_PREFIX || key.substr(0, CHANGES_PREFIX.length) === CHANGES_PREFIX; } function isNodeKey(key) { return key.substr(0, NODES_PREFIX.length) === NODES_PREFIX; } RemoteStorage.LocalStorage.prototype = { getNodes: function (paths) { var nodes = {}; for(var i = 0, len = paths.length; i < len; i++) { try { nodes[paths[i]] = JSON.parse(localStorage[NODES_PREFIX+paths[i]]); } catch(e) { nodes[paths[i]] = undefined; } } return Promise.resolve(nodes); }, setNodes: function (nodes) { for (var path in nodes) { // TODO shouldn't we use getItem/setItem? localStorage[NODES_PREFIX+path] = JSON.stringify(nodes[path]); } return Promise.resolve(); }, forAllNodes: function (cb) { var node; for(var i = 0, len = localStorage.length; i < len; i++) { if (isNodeKey(localStorage.key(i))) { try { node = this.migrate(JSON.parse(localStorage[localStorage.key(i)])); } catch(e) { node = undefined; } if (node) { cb(node); } } } return Promise.resolve(); } }; RemoteStorage.LocalStorage._rs_init = function () {}; RemoteStorage.LocalStorage._rs_supported = function () { return 'localStorage' in global; }; // TODO tests missing! RemoteStorage.LocalStorage._rs_cleanup = function () { var keys = []; for (var i = 0, len = localStorage.length; i < len; i++) { var key = localStorage.key(i); if (isRemoteStorageKey(key)) { keys.push(key); } } keys.forEach(function (key) { RemoteStorage.log('[LocalStorage] Removing', key); delete localStorage[key]; }); }; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/inmemorystorage.js **/ (function (global) { /** * Class: RemoteStorage.InMemoryStorage * * In-memory caching adapter. Used when no IndexedDB or localStorage * available. **/ RemoteStorage.InMemoryStorage = function () { RemoteStorage.cachingLayer(this); RemoteStorage.log('[InMemoryStorage] Registering events'); RemoteStorage.eventHandling(this, 'change', 'local-events-done'); this._storage = {}; }; RemoteStorage.InMemoryStorage.prototype = { getNodes: function (paths) { var nodes = {}; for(var i = 0, len = paths.length; i < len; i++) { nodes[paths[i]] = this._storage[paths[i]]; } return Promise.resolve(nodes); }, setNodes: function (nodes) { for (var path in nodes) { if (nodes[path] === undefined) { delete this._storage[path]; } else { this._storage[path] = nodes[path]; } } return Promise.resolve(); }, forAllNodes: function (cb) { for (var path in this._storage) { cb(this.migrate(this._storage[path])); } return Promise.resolve(); } }; RemoteStorage.InMemoryStorage._rs_init = function () {}; RemoteStorage.InMemoryStorage._rs_supported = function () { // In-memory storage is always supported return true; }; RemoteStorage.InMemoryStorage._rs_cleanup = function () {}; })(typeof(window) !== 'undefined' ? window : global); /** FILE: src/modules.js **/ (function () { RemoteStorage.MODULES = {}; /* * Method: RemoteStorage.defineModule * * Method for defining a new remoteStorage data module * * Parameters: * moduleName - Name of the module * builder - Builder function defining the module * * The module builder function should return an object containing another * object called exports, which will be exported to any <RemoteStorage> * instance under the module's name. So when defining a locations module, * like in the example below, it would be accessible via * `remoteStorage.locations`, which would in turn have a `features` and a * `collections` property. * * The function receives a private and a public client, which are both * instances of <RemoteStorage.BaseClient>. In the following example, the * scope of privateClient is `/locations` and the scope of publicClient is * `/public/locations`. * * Example: * (start code) * RemoteStorage.defineModule('locations', function (privateClient, publicClient) { * return { * exports: { * features: privateClient.scope('features/').defaultType('feature'), * collections: privateClient.scope('collections/').defaultType('feature-collection') * } * }; * }); * (end code) */ RemoteStorage.defineModule = function (moduleName, builder) { RemoteStorage.MODULES[moduleName] = builder; Object.defineProperty(RemoteStorage.prototype, moduleName, { configurable: true, get: function () { var instance = this._loadModule(moduleName); Object.defineProperty(this, moduleName, { value: instance }); return instance; } }); if (moduleName.indexOf('-') !== -1) { var camelizedName = moduleName.replace(/\-[a-z]/g, function (s) { return s[1].toUpperCase(); }); Object.defineProperty(RemoteStorage.prototype, camelizedName, { get: function () { return this[moduleName]; } }); } }; RemoteStorage.prototype._loadModule = function (moduleName) { var builder = RemoteStorage.MODULES[moduleName]; if (builder) { var module = builder(new RemoteStorage.BaseClient(this, '/' + moduleName + '/'), new RemoteStorage.BaseClient(this, '/public/' + moduleName + '/')); return module.exports; } else { throw "Unknown module: " + moduleName; } }; RemoteStorage.prototype.defineModule = function (moduleName) { console.log("remoteStorage.defineModule is deprecated, use RemoteStorage.defineModule instead!"); RemoteStorage.defineModule.apply(RemoteStorage, arguments); }; })(); /** FILE: src/debug/inspect.js **/ (function() { function loadTable(table, storage, paths) { table.setAttribute('border', '1'); table.style.margin = '8px'; table.style.color = 'white'; table.innerHTML = ''; var thead = document.createElement('thead'); table.appendChild(thead); var titleRow = document.createElement('tr'); thead.appendChild(titleRow); ['Path', 'Content-Type', 'Revision'].forEach(function(label) { var th = document.createElement('th'); th.textContent = label; thead.appendChild(th); }); var tbody = document.createElement('tbody'); table.appendChild(tbody); function renderRow(tr, path, contentType, revision) { [path, contentType, revision].forEach(function(value) { var td = document.createElement('td'); td.textContent = value || ''; tr.appendChild(td); }); } function loadRow(path) { if (storage.connected === false) { return; } function processRow(status, body, contentType, revision) { if (status === 200) { var tr = document.createElement('tr'); tbody.appendChild(tr); renderRow(tr, path, contentType, revision); if (path[path.length - 1] === '/') { for (var key in body) { loadRow(path + key); } } } } storage.get(path).then(processRow); } paths.forEach(loadRow); } function renderWrapper(title, table, storage, paths) { var wrapper = document.createElement('div'); //wrapper.style.display = 'inline-block'; var heading = document.createElement('h2'); heading.textContent = title; wrapper.appendChild(heading); var updateButton = document.createElement('button'); updateButton.textContent = "Refresh"; updateButton.onclick = function() { loadTable(table, storage, paths); }; wrapper.appendChild(updateButton); if (storage.reset) { var resetButton = document.createElement('button'); resetButton.textContent = "Reset"; resetButton.onclick = function() { storage.reset(function(newStorage) { storage = newStorage; loadTable(table, storage, paths); }); }; wrapper.appendChild(resetButton); } wrapper.appendChild(table); loadTable(table, storage, paths); return wrapper; } function renderLocalChanges(local) { var wrapper = document.createElement('div'); //wrapper.style.display = 'inline-block'; var heading = document.createElement('h2'); heading.textContent = "Outgoing changes"; wrapper.appendChild(heading); var updateButton = document.createElement('button'); updateButton.textContent = "Refresh"; wrapper.appendChild(updateButton); var list = document.createElement('ul'); list.style.fontFamily = 'courier'; wrapper.appendChild(list); function updateList() { list.innerHTML = ''; local.forAllNodes(function(node) { if (node.local && node.local.body) { var el = document.createElement('li'); el.textContent = JSON.stringify(node.local); list.appendChild(el); } }); } updateButton.onclick = updateList; updateList(); return wrapper; } RemoteStorage.prototype.inspect = function() { var widget = document.createElement('div'); widget.id = 'remotestorage-inspect'; widget.style.position = 'absolute'; widget.style.top = 0; widget.style.left = 0; widget.style.background = 'black'; widget.style.color = 'white'; widget.style.border = 'groove 5px #ccc'; var controls = document.createElement('div'); controls.style.position = 'absolute'; controls.style.top = 0; controls.style.left = 0; var heading = document.createElement('strong'); heading.textContent = " remotestorage.js inspector "; controls.appendChild(heading); var syncButton; if (this.local) { syncButton = document.createElement('button'); syncButton.textContent = "Synchronize"; controls.appendChild(syncButton); } var closeButton = document.createElement('button'); closeButton.textContent = "Close"; closeButton.onclick = function() { document.body.removeChild(widget); }; controls.appendChild(closeButton); widget.appendChild(controls); var remoteRootPaths = []; for (var path in this.caching._rootPaths) { if (this.caching._rootPaths.hasOwnProperty(path)) { remoteRootPaths.push(path); } } var remoteTable = document.createElement('table'); var localTable = document.createElement('table'); widget.appendChild(renderWrapper("Remote", remoteTable, this.remote, remoteRootPaths)); if (this.local) { widget.appendChild(renderWrapper("Local", localTable, this.local, ['/'])); widget.appendChild(renderLocalChanges(this.local)); syncButton.onclick = function() { this.log('sync clicked'); this.sync.sync().then(function() { this.log('SYNC FINISHED'); loadTable(localTable, this.local, ['/']); }.bind(this), function(err) { console.error("SYNC FAILED", err, err.stack); }); }.bind(this); } document.body.appendChild(widget); }; })(); /** FILE: src/googledrive.js **/ (function (global) { /** * Class: RemoteStorage.GoogleDrive * * WORK IN PROGRESS, NOT RECOMMENDED FOR PRODUCTION USE **/ var RS = RemoteStorage; var BASE_URL = 'https://www.googleapis.com'; var AUTH_URL = 'https://accounts.google.com/o/oauth2/auth'; var AUTH_SCOPE = 'https://www.googleapis.com/auth/drive'; var GD_DIR_MIME_TYPE = 'application/vnd.google-apps.folder'; var RS_DIR_MIME_TYPE = 'application/json; charset=UTF-8'; function buildQueryString(params) { return Object.keys(params).map(function (key) { return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]); }).join('&'); } function fileNameFromMeta(meta) { return encodeURIComponent(meta.title) + (meta.mimeType === GD_DIR_MIME_TYPE ? '/' : ''); } function metaTitleFromFileName(filename) { if (filename.substr(-1) === '/') { filename = filename.substr(0, filename.length - 1); } return decodeURIComponent(filename); } function parentPath(path) { return path.replace(/[^\/]+\/?$/, ''); } function baseName(path) { var parts = path.split('/'); if (path.substr(-1) === '/') { return parts[parts.length-2]+'/'; } else { return parts[parts.length-1]; } } var Cache = function (maxAge) { this.maxAge = maxAge; this._items = {}; }; Cache.prototype = { get: function (key) { var item = this._items[key]; var now = new Date().getTime(); return (item && item.t >= (now - this.maxAge)) ? item.v : undefined; }, set: function (key, value) { this._items[key] = { v: value, t: new Date().getTime() }; } }; RS.GoogleDrive = function (remoteStorage, clientId) { RS.eventHandling(this, 'change', 'connected', 'wire-busy', 'wire-done', 'not-connected'); this.rs = remoteStorage; this.clientId = clientId; this._fileIdCache = new Cache(60 * 5); // ids expire after 5 minutes (is this a good idea?) }; RS.GoogleDrive.prototype = { connected: false, online: true, configure: function (settings) { // Settings parameter compatible with WireClient if (settings.token) { localStorage['remotestorage:googledrive:token'] = settings.token; this.token = settings.token; this.connected = true; this._emit('connected'); } else { this.connected = false; delete this.token; delete localStorage['remotestorage:googledrive:token']; } }, connect: function () { this.rs.setBackend('googledrive'); RS.Authorize(AUTH_URL, AUTH_SCOPE, String(RS.Authorize.getLocation()), this.clientId); }, stopWaitingForToken: function () { if (!this.connected) { this._emit('not-connected'); } }, get: function (path, options) { if (path.substr(-1) === '/') { return this._getFolder(path, options); } else { return this._getFile(path, options); } }, put: function (path, body, contentType, options) { var self = this; function putDone(response) { if (response.status >= 200 && response.status < 300) { var meta = JSON.parse(response.responseText); var etagWithoutQuotes = meta.etag.substring(1, meta.etag.length-1); return Promise.resolve({statusCode: 200, contentType: meta.mimeType, revision: etagWithoutQuotes}); } else if (response.status === 412) { return Promise.resolve({statusCode: 412, revision: 'conflict'}); } else { return Promise.reject("PUT failed with status " + response.status + " (" + response.responseText + ")"); } } return self._getFileId(path).then(function (id) { if (id) { if (options && (options.ifNoneMatch === '*')) { return putDone({ status: 412 }); } return self._updateFile(id, path, body, contentType, options).then(putDone); } else { return self._createFile(path, body, contentType, options).then(putDone); } }); }, 'delete': function (path, options) { var self = this; return self._getFileId(path).then(function (id) { if (!id) { // File doesn't exist. Ignore. return Promise.resolve({statusCode: 200}); } return self._getMeta(id).then(function (meta) { var etagWithoutQuotes; if ((typeof meta === 'object') && (typeof meta.etag === 'string')) { etagWithoutQuotes = meta.etag.substring(1, meta.etag.length-1); } if (options && options.ifMatch && (options.ifMatch !== etagWithoutQuotes)) { return {statusCode: 412, revision: etagWithoutQuotes}; } return self._request('DELETE', BASE_URL + '/drive/v2/files/' + id, {}).then(function (response) { if (response.status === 200 || response.status === 204) { return {statusCode: 200}; } else { return Promise.reject("Delete failed: " + response.status + " (" + response.responseText + ")"); } }); }); }); }, _updateFile: function (id, path, body, contentType, options) { var self = this; var metadata = { mimeType: contentType }; var headers = { 'Content-Type': 'application/json; charset=UTF-8' }; if (options && options.ifMatch) { headers['If-Match'] = '"' + options.ifMatch + '"'; } return self._request('PUT', BASE_URL + '/upload/drive/v2/files/' + id + '?uploadType=resumable', { body: JSON.stringify(metadata), headers: headers }).then(function (response) { if (response.status === 412) { return (response); } else { return self._request('PUT', response.getResponseHeader('Location'), { body: contentType.match(/^application\/json/) ? JSON.stringify(body) : body }); } }); }, _createFile: function (path, body, contentType, options) { var self = this; return self._getParentId(path).then(function (parentId) { var fileName = baseName(path); var metadata = { title: metaTitleFromFileName(fileName), mimeType: contentType, parents: [{ kind: "drive#fileLink", id: parentId }] }; return self._request('POST', BASE_URL + '/upload/drive/v2/files?uploadType=resumable', { body: JSON.stringify(metadata), headers: { 'Content-Type': 'application/json; charset=UTF-8' } }).then(function (response) { return self._request('POST', response.getResponseHeader('Location'), { body: contentType.match(/^application\/json/) ? JSON.stringify(body) : body }); }); }); }, _getFile: function (path, options) { var self = this; return self._getFileId(path).then(function (id) { return self._getMeta(id).then(function (meta) { var etagWithoutQuotes; if (typeof(meta) === 'object' && typeof(meta.etag) === 'string') { etagWithoutQuotes = meta.etag.substring(1, meta.etag.length-1); } if (options && options.ifNoneMatch && (etagWithoutQuotes == options.ifNoneMatch)) { return Promise.resolve({statusCode: 304}); } var options2 = {}; if (!meta.downloadUrl) { if (meta.exportLinks && meta.exportLinks['text/html']) { // Documents that were generated inside GoogleDocs have no // downloadUrl, but you can export them to text/html instead: meta.mimeType += ';export=text/html'; meta.downloadUrl = meta.exportLinks['text/html']; } else { // empty file return Promise.resolve({statusCode: 200, body: '', contentType: meta.mimeType, revision: etagWithoutQuotes}); } } if (meta.mimeType.match(/charset=binary/)) { options2.responseType = 'blob'; } return self._request('GET', meta.downloadUrl, options2).then(function (response) { var body = response.response; if (meta.mimeType.match(/^application\/json/)) { try { body = JSON.parse(body); } catch(e) {} } return Promise.resolve({statusCode: 200, body: body, contentType: meta.mimeType, revision: etagWithoutQuotes}); }); }); }); }, _getFolder: function (path, options) { var self = this; return self._getFileId(path).then(function (id) { var query, fields, data, i, etagWithoutQuotes, itemsMap; if (! id) { return Promise.resolve({statusCode: 404}); } query = '\'' + id + '\' in parents'; fields = 'items(downloadUrl,etag,fileSize,id,mimeType,title)'; return self._request('GET', BASE_URL + '/drive/v2/files?' + 'q=' + encodeURIComponent(query) + '&fields=' + encodeURIComponent(fields) + '&maxResults=1000', {}) .then(function (response) { if (response.status !== 200) { return Promise.reject('request failed or something: ' + response.status); } try { data = JSON.parse(response.responseText); } catch(e) { return Promise.reject('non-JSON response from GoogleDrive'); } itemsMap = {}; for (var i = 0, len = data.items.length; i < len; i++) { etagWithoutQuotes = data.items[i].etag.substring(1, data.items[i].etag.length-1); if (data.items[i].mimeType === GD_DIR_MIME_TYPE) { self._fileIdCache.set(path + data.items[i].title + '/', data.items[i].id); itemsMap[data.items[i].title + '/'] = { ETag: etagWithoutQuotes }; } else { self._fileIdCache.set(path + data.items[i].title, data.items[i].id); itemsMap[data.items[i].title] = { ETag: etagWithoutQuotes, 'Content-Type': data.items[i].mimeType, 'Content-Length': data.items[i].fileSize }; } } // FIXME: add revision of folder! return Promise.resolve({statusCode: 200, body: itemsMap, contentType: RS_DIR_MIME_TYPE, revision: undefined}); }); }); }, _getParentId: function (path) { var foldername = parentPath(path); var self = this; return self._getFileId(foldername).then(function (parentId) { if (parentId) { return Promise.resolve(parentId); } else { return self._createFolder(foldername); } }); }, _createFolder: function (path) { var self = this; return self._getParentId(path).then(function (parentId) { return self._request('POST', BASE_URL + '/drive/v2/files', { body: JSON.stringify({ title: metaTitleFromFileName(baseName(path)), mimeType: GD_DIR_MIME_TYPE, parents: [{ id: parentId }] }), headers: { 'Content-Type': 'application/json; charset=UTF-8' } }).then(function (response) { var meta = JSON.parse(response.responseText); return Promise.resolve(meta.id); }); }); }, _getFileId: function (path) { var self = this; var id; if (path === '/') { // "root" is a special alias for the fileId of the root folder return Promise.resolve('root'); } else if ((id = this._fileIdCache.get(path))) { // id is cached. return Promise.resolve(id); } // id is not cached (or file doesn't exist). // load parent folder listing to propagate / update id cache. return self._getFolder(parentPath(path)).then(function () { id = self._fileIdCache.get(path); if (!id) { if (path.substr(-1) === '/') { return self._createFolder(path).then(function () { return self._getFileId(path); }); } else { return Promise.resolve(); } return; } return Promise.resolve(id); }); }, _getMeta: function (id) { return this._request('GET', BASE_URL + '/drive/v2/files/' + id, {}).then(function (response) { if (response.status === 200) { return Promise.resolve(JSON.parse(response.responseText)); } else { return Promise.reject("request (getting metadata for " + id + ") failed with status: " + response.status); } }); }, _request: function (method, url, options) { var self = this; if (! options.headers) { options.headers = {}; } options.headers['Authorization'] = 'Bearer ' + self.token; return RS.WireClient.request(method, url, options).then(function (xhr) { // google tokens expire from time to time... if (xhr && xhr.status === 401) { self.connect(); return; } return xhr; }); } }; RS.GoogleDrive._rs_init = function (remoteStorage) { var config = remoteStorage.apiKeys.googledrive; if (config) { remoteStorage.googledrive = new RS.GoogleDrive(remoteStorage, config.client_id); if (remoteStorage.backend === 'googledrive') { remoteStorage._origRemote = remoteStorage.remote; remoteStorage.remote = remoteStorage.googledrive; } } }; RS.GoogleDrive._rs_supported = function (rs) { return true; }; RS.GoogleDrive._rs_cleanup = function (remoteStorage) { remoteStorage.setBackend(undefined); if (remoteStorage._origRemote) { remoteStorage.remote = remoteStorage._origRemote; delete remoteStorage._origRemote; } }; })(this); /** FILE: src/dropbox.js **/ (function (global) { var RS = RemoteStorage; /** * File: Dropbox * * WORK IN PROGRESS, NOT RECOMMENDED FOR PRODUCTION USE * * Dropbox backend for RemoteStorage.js * This file exposes a get/put/delete interface which is compatible with * <RemoteStorage.WireClient>. * * When remoteStorage.backend is set to 'dropbox', this backend will * initialize and replace remoteStorage.remote with remoteStorage.dropbox. * * In order to ensure compatibility with the public folder, <BaseClient.getItemURL> * gets hijacked to return the DropBox public share URL. * * To use this backend, you need to specify the DropBox API key like so: * * (start code) * * remoteStorage.setaApiKeys('dropbox', { * api_key: 'your-api-key' * }); * * (end code) * * An API key can be obtained by registering your app at https://www.dropbox.com/developers/apps * * Known issues: * * - Storing files larger than 150MB is not yet supported * - Listing and deleting folders with more than 10'000 files will cause problems * - Content-Type is not fully supported due to limitations of the DropBox API * - DropBox preserves cases but is not case-sensitive * - getItemURL is asynchronous which means getIetmURL returns useful values * after the syncCycle */ var hasLocalStorage; var AUTH_URL = 'https://www.dropbox.com/1/oauth2/authorize'; var SETTINGS_KEY = 'remotestorage:dropbox'; var cleanPath = RS.WireClient.cleanPath; /** * class: LowerCaseCache * * A cache which automatically converts all keys to lower case and can * propagate changes up to parent folders. * * By default the set and delete methods are aliased to justSet and justDelete. * * Parameters: * * defaultValue - the value that is returned for all keys that don't exist * in the cache */ function LowerCaseCache(defaultValue){ this.defaultValue = defaultValue; this._storage = { }; this.set = this.justSet; this.delete = this.justDelete; } LowerCaseCache.prototype = { /** * Method: get * * Get a value from the cache or defaultValue, if the key is not in the * cache. */ get : function (key) { key = key.toLowerCase(); var stored = this._storage[key]; if (typeof stored === 'undefined'){ stored = this.defaultValue; this._storage[key] = stored; } return stored; }, /** * Method: propagateSet * * Set a value and also update the parent folders with that value. */ propagateSet : function (key, value) { key = key.toLowerCase(); if (this._storage[key] === value) { return value; } this._propagate(key, value); return this._storage[key] = value; }, /** * Method: propagateDelete * * Delete a value and propagate the changes to the parent folders. */ propagateDelete : function (key) { key = key.toLowerCase(); this._propagate(key, this._storage[key]); return delete this._storage[key]; }, _activatePropagation: function (){ this.set = this.propagateSet; this.delete = this.propagateDelete; return true; }, /** * Method: justSet * * Set a value without propagating. */ justSet : function (key, value) { key = key.toLowerCase(); return this._storage[key] = value; }, /** * Method: justDelete * * Delete a value without propagating. */ justDelete : function (key, value) { key = key.toLowerCase(); return delete this._storage[key]; }, _propagate: function (key, rev){ var folders = key.split('/').slice(0,-1); var path = ''; for (var i = 0, len = folders.length; i < len; i++){ path += folders[i]+'/'; if (!rev) { rev = this._storage[path]+1; } this._storage[path] = rev; } } }; var onErrorCb; /** * Class: RemoteStorage.Dropbox */ RS.Dropbox = function (rs) { this.rs = rs; this.connected = false; this.rs = rs; var self = this; onErrorCb = function (error){ if (error instanceof RemoteStorage.Unauthorized) { // Delete all the settings - see the documentation of wireclient.configure self.configure({ userAddress: null, href: null, storageApi: null, token: null, options: null }); } }; RS.eventHandling(this, 'change', 'connected', 'wire-busy', 'wire-done', 'not-connected'); rs.on('error', onErrorCb); this.clientId = rs.apiKeys.dropbox.api_key; this._revCache = new LowerCaseCache('rev'); this._itemRefs = {}; this._metadataCache = {}; if (hasLocalStorage){ var settings; try { settings = JSON.parse(localStorage[SETTINGS_KEY]); } catch(e){} if (settings) { this.configure(settings); } try { this._itemRefs = JSON.parse(localStorage[ SETTINGS_KEY+':shares' ]); } catch(e) { } } if (this.connected) { setTimeout(this._emit.bind(this), 0, 'connected'); } }; RS.Dropbox.prototype = { online: true, /** * Method: connect * * Set the backed to 'dropbox' and start the authentication flow in order * to obtain an API token from DropBox. */ connect: function () { // TODO handling when token is already present this.rs.setBackend('dropbox'); if (this.token){ hookIt(this.rs); } else { RS.Authorize(AUTH_URL, '', String(RS.Authorize.getLocation()), this.clientId); } }, /** * Method : configure(settings) * Accepts its parameters according to the <RemoteStorage.WireClient>. * Sets the connected flag **/ configure: function (settings) { // We only update this.userAddress if settings.userAddress is set to a string or to null: if (typeof settings.userAddress !== 'undefined') { this.userAddress = settings.userAddress; } // Same for this.token. If only one of these two is set, we leave the other one at its existing value: if (typeof settings.token !== 'undefined') { this.token = settings.token; } if (this.token) { this.connected = true; if ( !this.userAddress ){ this.info().then(function (info){ this.userAddress = info.display_name; this.rs.widget.view.setUserAddress(this.userAddress); this._emit('connected'); }.bind(this)); } } else { this.connected = false; } if (hasLocalStorage){ localStorage[SETTINGS_KEY] = JSON.stringify({ userAddress: this.userAddress, token: this.token }); } }, /** * Method: stopWaitingForToken * * Stop waiting for the token and emit not-connected */ stopWaitingForToken: function () { if (!this.connected) { this._emit('not-connected'); } }, /** * Method: _getFolder * * Get all items in a folder. * * Parameters: * * path - path of the folder to get, with leading slash * options - not used * * Returns: * * statusCode - HTTP status code * body - array of the items found * contentType - 'application/json; charset=UTF-8' * revision - revision of the folder */ _getFolder: function (path, options) { // FIXME simplify promise handling var url = 'https://api.dropbox.com/1/metadata/auto' + cleanPath(path); var revCache = this._revCache; var self = this; return this._request('GET', url, {}).then(function (resp) { var status = resp.status; if (status === 304) { return Promise.resolve({statusCode: status}); } var listing, body, mime, rev; try{ body = JSON.parse(resp.responseText); } catch (e) { return Promise.reject(e); } rev = self._revCache.get(path); mime = 'application/json; charset=UTF-8'; if (body.contents) { listing = body.contents.reduce(function (m, item) { var itemName = item.path.split('/').slice(-1)[0] + ( item.is_dir ? '/' : '' ); if (item.is_dir){ m[itemName] = { ETag: revCache.get(path+itemName) }; } else { m[itemName] = { ETag: item.rev }; } return m; }, {}); } return Promise.resolve({statusCode: status, body: listing, contentType: mime, revision: rev}); }); }, /** * Method: get * * Compatible with <RemoteStorage.WireClient.get> * * Checks for the path in _revCache and decides based on that if file has * changed. Calls _getFolder is the path points to a folder. * * Calls <RemoteStorage.Dropbox.share> afterwards to fill _itemRefs. */ get: function (path, options) { if (! this.connected) { return Promise.reject("not connected (path: " + path + ")"); } var url = 'https://api-content.dropbox.com/1/files/auto' + cleanPath(path); var self = this; var savedRev = this._revCache.get(path); if (savedRev === null) { // file was deleted server side return Promise.resolve({statusCode: 404}); } if (options && options.ifNoneMatch && savedRev && (savedRev === options.ifNoneMatch)) { // nothing changed. return Promise.resolve({statusCode: 304}); } //use _getFolder for folders if (path.substr(-1) === '/') { return this._getFolder(path, options); } return this._request('GET', url, {}).then(function (resp) { var status = resp.status; var meta, body, mime, rev; if (status !== 200) { return Promise.resolve({statusCode: status}); } body = resp.responseText; try { meta = JSON.parse( resp.getResponseHeader('x-dropbox-metadata') ); } catch(e) { return Promise.reject(e); } mime = meta.mime_type; //resp.getResponseHeader('Content-Type'); rev = meta.rev; self._revCache.set(path, rev); self._shareIfNeeded(path); // The shared link expires every 4 hours // handling binary if (!resp.getResponseHeader('Content-Type') || resp.getResponseHeader('Content-Type').match(/charset=binary/)) { var pending = Promise.defer(); RS.WireClient.readBinaryData(resp.response, mime, function (result) { pending.resolve({ statusCode: status, body: result, contentType: mime, revision: rev }); }); return pending.promise; } // handling json (always try) if (mime && mime.search('application/json') >= 0 || true) { try { body = JSON.parse(body); mime = 'application/json; charset=UTF-8'; } catch(e) { //Failed parsing Json, assume it is something else then } } return Promise.resolve({statusCode: status, body: body, contentType: mime, revision: rev}); }); }, /** * Method: put * * Compatible with <RemoteStorage.WireClient> * * Checks for the path in _revCache and decides based on that if file has * changed. * * Calls <RemoteStorage.Dropbox.share> afterwards to fill _itemRefs. */ put: function (path, body, contentType, options) { var self = this; if (!this.connected) { throw new Error("not connected (path: " + path + ")"); } //check if file has changed and return 412 var savedRev = this._revCache.get(path); if (options && options.ifMatch && savedRev && (savedRev !== options.ifMatch)) { return Promise.resolve({statusCode: 412, revision: savedRev}); } if (options && (options.ifNoneMatch === '*') && savedRev && (savedRev !== 'rev')) { return Promise.resolve({statusCode: 412, revision: savedRev}); } if ((!contentType.match(/charset=/)) && (body instanceof ArrayBuffer || RS.WireClient.isArrayBufferView(body))) { contentType += '; charset=binary'; } if (body.length > 150 * 1024 * 1024) { //https://www.dropbox.com/developers/core/docs#chunked-upload return Promise.reject(new Error("Cannot upload file larger than 150MB")); } var result; var needsMetadata = options && (options.ifMatch || (options.ifNoneMatch === '*')); var uploadParams = { body: body, contentType: contentType, path: path }; if (needsMetadata) { result = this._getMetadata(path).then(function (metadata) { if (options && (options.ifNoneMatch === '*') && metadata) { // if !!metadata === true, the file exists return Promise.resolve({ statusCode: 412, revision: metadata.rev }); } if (options && options.ifMatch && metadata && (metadata.rev !== options.ifMatch)) { return Promise.resolve({ statusCode: 412, revision: metadata.rev }); } return self._uploadSimple(uploadParams); }); } else { result = self._uploadSimple(uploadParams); } return result.then(function (ret) { self._shareIfNeeded(path); return ret; }); }, /** * Method: delete * * Compatible with <RemoteStorage.WireClient.delete> * * Checks for the path in _revCache and decides based on that if file has * changed. * * Calls <RemoteStorage.Dropbox.share> afterwards to fill _itemRefs. */ 'delete': function (path, options) { var self = this; if (!this.connected) { throw new Error("not connected (path: " + path + ")"); } //check if file has changed and return 412 var savedRev = this._revCache.get(path); if (options && options.ifMatch && savedRev && (options.ifMatch !== savedRev)) { return Promise.resolve({ statusCode: 412, revision: savedRev }); } if (options && options.ifMatch) { return this._getMetadata(path).then(function (metadata) { if (options && options.ifMatch && metadata && (metadata.rev !== options.ifMatch)) { return Promise.resolve({ statusCode: 412, revision: metadata.rev }); } return self._deleteSimple(path); }); } return self._deleteSimple(path); }, /** * Method: _shareIfNeeded * * Calls share, if the provided path resides in a public folder. */ _shareIfNeeded: function (path) { if (path.match(/^\/public\/.*[^\/]$/) && this._itemRefs[path] === undefined) { this.share(path); } }, /** * Method: share * * Gets a publicly-accessible URL for the path from DropBox and stores it * in _itemRefs. * * Returns: * * A promise for the URL */ share: function (path) { var self = this; var url = 'https://api.dropbox.com/1/media/auto/' + cleanPath(path); return this._request('POST', url, {}).then(function (response) { if (response.status !== 200) { return Promise.reject(new Error('Invalid DropBox API response status when sharing "' + path + '":' + response.status)); } try { response = JSON.parse(response.responseText); } catch (e) { return Promise.reject(new Error('Invalid DropBox API response when sharing "' + path + '": ' + response.responseText)); } self._itemRefs[path] = response.url; if (hasLocalStorage) { localStorage[SETTINGS_KEY + ':shares'] = JSON.stringify(self._itemRefs); } return Promise.resolve(url); }, function (error) { err.message = 'Sharing DropBox file or folder ("' + path + '") failed.' + err.message; return Promise.reject(error); }); }, /** * Method: info * * Fetches the user's info from DropBox and returns a promise for it. * * Returns: * * A promise to the user's info */ info: function () { var url = 'https://api.dropbox.com/1/account/info'; // requesting user info(mainly for userAdress) return this._request('GET', url, {}).then(function (resp){ try { var info = JSON.parse(resp.responseText); return Promise.resolve(info); } catch (e) { return Promise.reject(e); } }); }, /** * Method: _request * * Make a HTTP request. * * Options: * * headers - an object containing the request headers * * Parameters: * * method - the method to use * url - the URL to make the request to * options - see above */ _request: function (method, url, options) { var self = this; if (! options.headers) { options.headers = {}; } options.headers['Authorization'] = 'Bearer ' + this.token; return RS.WireClient.request.call(this, method, url, options).then(function (xhr) { //503 means retry this later if (xhr && xhr.status === 503) { return global.setTimeout(self._request(method, url, options), 3210); } else { return Promise.resolve(xhr); } }); }, /** * Method: fetchDelta * * Fetches the revision of all the files from DropBox API and puts them * into _revCache. These values can then be used to determine if something * has changed. */ fetchDelta: function () { // TODO: Handle `has_more` var args = Array.prototype.slice.call(arguments); var self = this; return self._request('POST', 'https://api.dropbox.com/1/delta', { body: self._deltaCursor ? ('cursor=' + encodeURIComponent(self._deltaCursor)) : '', headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }).then(function (response) { // break if status != 200 if (response.status !== 200 ) { if (response.status === 400) { self.rs._emit('error', new RemoteStorage.Unauthorized()); return Promise.resolve(args); } else { return Promise.reject("dropbox.fetchDelta returned "+response.status+response.responseText); } return; } var delta; try { delta = JSON.parse(response.responseText); } catch(error) { RS.log('fetchDeltas can not parse response',error); return Promise.reject("can not parse response of fetchDelta : "+error.message); } // break if no entries found if (!delta.entries) { return Promise.reject('dropbox.fetchDeltas failed, no entries found'); } // Dropbox sends the complete state if (delta.reset) { self._revCache = new LowerCaseCache('rev'); } //saving the cursor for requesting further deltas in relation to the cursor position if (delta.cursor) { self._deltaCursor = delta.cursor; } //updating revCache RemoteStorage.log("Delta : ", delta.entries); delta.entries.forEach(function (entry) { var path = entry[0]; var rev; if (!entry[1]){ rev = null; } else { if (entry[1].is_dir) { return; } rev = entry[1].rev; } self._revCache.set(path, rev); }); return Promise.resolve(args); }, function (err) { this.rs.log('fetchDeltas', err); this.rs._emit('error', new RemoteStorage.SyncError('fetchDeltas failed.' + err)); promise.reject(err); }).then(function () { if (self._revCache) { var args = Array.prototype.slice.call(arguments); self._revCache._activatePropagation(); return Promise.resolve(args); } }); }, /** * Method: _getMetadata * * Gets metadata for a path (can point to either a file or a folder). * * Options: * * list - if path points to a folder, specifies whether to list the * metadata of the folder's children. False by default. * * Parameters: * * path - the path to get metadata for * options - see above * * Returns: * * A promise for the metadata */ _getMetadata: function (path, options) { var self = this; var cached = this._metadataCache[path]; var url = 'https://api.dropbox.com/1/metadata/auto' + cleanPath(path); url += '?list=' + ((options && options.list) ? 'true' : 'false'); if (cached && cached.hash) { url += '&hash=' + encodeURIComponent(cached.hash); } return this._request('GET', url, {}).then(function (resp) { if (resp.status === 304) { return Promise.resolve(cached); } else if (resp.status === 200) { var response = JSON.parse(resp.responseText); self._metadataCache[path] = response; return Promise.resolve(response); } else { // The file doesn't exist return Promise.resolve(); } }); }, /** * Method: _uploadSimple * * Upload a simple file (the size is no more than 150MB). * * Parameters: * * ifMatch - same as for get * path - path of the file * body - contents of the file to upload * contentType - mime type of the file * * Returns: * * statusCode - HTTP status code * revision - revision of the newly-created file, if any */ _uploadSimple: function (params) { var self = this; var url = 'https://api-content.dropbox.com/1/files_put/auto' + cleanPath(params.path) + '?'; if (params && params.ifMatch) { url += "parent_rev=" + encodeURIComponent(params.ifMatch); } return self._request('PUT', url, { body: params.body, headers: { 'Content-Type': params.contentType } }).then(function (resp) { if (resp.status !== 200) { return Promise.resolve({ statusCode: resp.status }); } var response; try { response = JSON.parse(resp.responseText); } catch (e) { return Promise.reject(e); } // Conflict happened. Delete the copy created by DropBox if (response.path != params.path) { var deleteUrl = 'https://api.dropbox.com/1/fileops/delete?root=auto&path=' + encodeURIComponent(response.path); self._request('POST', deleteUrl, {}); return self._getMetadata(params.path).then(function (metadata) { return Promise.resolve({ statusCode: 412, revision: metadata.rev }); }); } self._revCache.propagateSet(params.path, response.rev); return Promise.resolve({ statusCode: resp.status }); }); }, /** * Method: _deleteSimple * * Deletes a file or a folder. If the folder contains more than 10'000 items * (recursively) then the operation may not complete successfully. If that * is the case, an Error gets thrown. * * Parameters: * * path - the path to delete * * Returns: * * statusCode - HTTP status code */ _deleteSimple: function (path) { var self = this; var url = 'https://api.dropbox.com/1/fileops/delete?root=auto&path=' + encodeURIComponent(path); return self._request('POST', url, {}).then(function (resp) { if (resp.status === 406) { // Too many files would be involved in the operation for it to // complete successfully. // TODO: Handle this somehow return Promise.reject(new Error("Cannot delete '" + path + "': too many files involved")); } if (resp.status === 200) { self._revCache.delete(path); delete self._itemRefs[path]; } return Promise.resolve({ statusCode: resp.status }); }); } }; //hooking and unhooking the sync function hookSync(rs) { if (rs._dropboxOrigSync) { return; } // already hooked rs._dropboxOrigSync = rs.sync.bind(rs); rs.sync = function () { return this.dropbox.fetchDelta.apply(this.dropbox, arguments). then(rs._dropboxOrigSync, function (err) { rs._emit('error', new rs.SyncError(err)); }); }; } function unHookSync(rs) { if (! rs._dropboxOrigSync) { return; } // not hooked rs.sync = rs._dropboxOrigSync; delete rs._dropboxOrigSync; } // hooking and unhooking getItemURL function hookGetItemURL(rs) { if (rs._origBaseClientGetItemURL) { return; } rs._origBaseClientGetItemURL = RS.BaseClient.prototype.getItemURL; RS.BaseClient.prototype.getItemURL = function (path){ var ret = rs.dropbox._itemRefs[path]; return ret ? ret : ''; }; } function unHookGetItemURL(rs){ if (! rs._origBaseClieNtGetItemURL) { return; } RS.BaseClient.prototype.getItemURL = rs._origBaseClietGetItemURL; delete rs._origBaseClietGetItemURL; } function hookRemote(rs){ if (rs._origRemote) { return; } rs._origRemote = rs.remote; rs.remote = rs.dropbox; } function unHookRemote(rs){ if (rs._origRemote) { rs.remote = rs._origRemote; delete rs._origRemote; } } function hookIt(rs){ hookRemote(rs); if (rs.sync) { hookSync(rs); } hookGetItemURL(rs); } function unHookIt(rs){ unHookRemote(rs); unHookSync(rs); unHookGetItemURL(rs); } RS.Dropbox._rs_init = function (rs) { hasLocalStorage = rs.localStorageAvailable(); if ( rs.apiKeys.dropbox ) { rs.dropbox = new RS.Dropbox(rs); } if (rs.backend === 'dropbox') { hookIt(rs); } }; RS.Dropbox._rs_supported = function () { return true; }; RS.Dropbox._rs_cleanup = function (rs) { unHookIt(rs); if (hasLocalStorage){ delete localStorage[SETTINGS_KEY]; } rs.removeEventListener('error', onErrorCb); rs.setBackend(undefined); }; })(this); remoteStorage = new RemoteStorage();
ajax/libs/instantsearch.js/0.14.6/instantsearch.min.js
pvnr0082t/cdnjs
/*! instantsearch.js 0.14.6 | © Algolia Inc. and other contributors; Licensed MIT | github.com/algolia/instantsearch.js */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.instantsearch=t():e.instantsearch=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=n(1)},function(e,t,n){"use strict";n(2);var r=n(3),o=n(4),i=r(o),a=n(72);i.widgets={clearAll:n(217),hierarchicalMenu:n(386),hits:n(389),hitsPerPageSelector:n(392),menu:n(397),refinementList:n(399),numericRefinementList:n(401),numericSelector:n(403),pagination:n(404),priceRanges:n(411),searchBox:n(416),rangeSlider:n(418),sortBySelector:n(426),starRating:n(427),stats:n(430),toggle:n(433)},i.version=n(214),i.createQueryString=a.url.getQueryStringFromState,e.exports=i},function(){"use strict";Object.freeze||(Object.freeze=function(e){if(Object(e)!==e)throw new TypeError("Object.freeze can only be called on Objects.");return e})},function(e){"use strict";function t(e){var t=function(){for(var t=arguments.length,r=Array(t),o=0;t>o;o++)r[o]=arguments[o];return new(n.apply(e,[null].concat(r)))};return t.__proto__=e,t.prototype=e.prototype,t}var n=Function.prototype.bind;e.exports=t},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(){return"#"}function a(e,t){if(!t.getConfiguration)return e;var n=t.getConfiguration(e);return f({},e,n,function(e,t){return Array.isArray(e)?d(e,t):void 0})}var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},c=n(5),l=n(72),p=n(17),f=n(53),d=n(211),h=n(63).EventEmitter,m=n(213),v=n(214),g=function(e){function t(e){var o=e.appId,i=void 0===o?null:o,a=e.apiKey,s=void 0===a?null:a,l=e.indexName,p=void 0===l?null:l,f=e.numberLocale,d=void 0===f?"en-EN":f,h=e.searchParameters,m=void 0===h?{}:h,g=e.urlSync,y=void 0===g?null:g;if(r(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),null===i||null===s||null===p){var b="\nUsage: instantsearch({\n appId: 'my_application_id',\n apiKey: 'my_search_api_key',\n indexName: 'my_index_name'\n});";throw new Error(b)}var w=c(i,s);w.addAlgoliaAgent("instantsearch.js "+v),this.client=w,this.helper=null,this.indexName=p,this.searchParameters=m||{},this.widgets=[],this.templatesConfig={helpers:n(216)({numberLocale:d}),compileOptions:{}},this.urlSync=y}return o(t,e),s(t,[{key:"addWidget",value:function(e){if(void 0===e.render&&void 0===e.init)throw new Error("Widget definition missing render or init method");this.widgets.push(e)}},{key:"start",value:function(){if(!this.widgets)throw new Error("No widgets were added to instantsearch.js");if(this.urlSync){var e=m(this.urlSync);this._createURL=e.createURL.bind(e),this.widgets.push(e)}else this._createURL=i;this.searchParameters=this.widgets.reduce(a,this.searchParameters);var t=l(this.client,this.searchParameters.index||this.indexName,this.searchParameters);this.helper=t,this._init(t.state,t),t.on("result",this._render.bind(this,t)),t.search()}},{key:"createURL",value:function(e){if(!this._createURL)throw new Error("You need to call start() before calling createURL()");return this._createURL(this.helper.state.setQueryParameters(e))}},{key:"_render",value:function(e,t,n){p(this.widgets,function(r){r.render&&r.render({templatesConfig:this.templatesConfig,results:t,state:n,helper:e,createURL:this._createURL})},this),this.emit("render")}},{key:"_init",value:function(e,t){p(this.widgets,function(n){if(n.init){var r=this.templatesConfig;n.init({state:e,helper:t,templatesConfig:r})}},this)}}]),t}(h);e.exports=g},function(e,t,n){"use strict";function r(e,t,i){var a=n(69),s=n(70);return i=a(i||{}),void 0===i.protocol&&(i.protocol=s()),i._ua=i._ua||r.ua,new o(e,t,i)}function o(){s.apply(this,arguments)}e.exports=r;var i=n(6),a=window.Promise||n(7).Promise,s=n(12),u=n(16),c=n(64),l=n(68);r.version=n(71),r.ua="Algolia for vanilla JavaScript "+r.version,window.__algolia={debug:n(13),algoliasearch:r};var p={hasXMLHttpRequest:"XMLHttpRequest"in window,hasXDomainRequest:"XDomainRequest"in window,cors:"withCredentials"in new XMLHttpRequest,timeout:"timeout"in new XMLHttpRequest};i(o,s),o.prototype._request=function(e,t){return new a(function(n,r){function o(){if(!l){p.timeout||clearTimeout(s);var e;try{e={body:JSON.parse(d.responseText),responseText:d.responseText,statusCode:d.status,headers:d.getAllResponseHeaders&&d.getAllResponseHeaders()||{}}}catch(t){e=new u.UnparsableJSON({more:d.responseText})}e instanceof u.UnparsableJSON?r(e):n(e)}}function i(e){l||(p.timeout||clearTimeout(s),r(new u.Network({more:e})))}function a(){p.timeout||(l=!0,d.abort()),r(new u.RequestTimeout)}if(!p.cors&&!p.hasXDomainRequest)return void r(new u.Network("CORS not supported"));e=c(e,t.headers);var s,l,f=t.body,d=p.cors?new XMLHttpRequest:new XDomainRequest;d instanceof XMLHttpRequest?d.open(t.method,e,!0):d.open(t.method,e),p.cors&&(f&&("POST"===t.method?d.setRequestHeader("content-type","application/x-www-form-urlencoded"):d.setRequestHeader("content-type","application/json")),d.setRequestHeader("accept","application/json")),d.onprogress=function(){},d.onload=o,d.onerror=i,p.timeout?(d.timeout=t.timeout,d.ontimeout=a):s=setTimeout(a,t.timeout),d.send(f)})},o.prototype._request.fallback=function(e,t){return e=c(e,t.headers),new a(function(n,r){l(e,t,function(e,t){return e?void r(e):void n(t)})})},o.prototype._promise={reject:function(e){return a.reject(e)},resolve:function(e){return a.resolve(e)},delay:function(e){return new a(function(t){setTimeout(t,e)})}}},function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r;(function(e,o,i){(function(){"use strict";function a(e){return"function"==typeof e||"object"==typeof e&&null!==e}function s(e){return"function"==typeof e}function u(e){return"object"==typeof e&&null!==e}function c(e){Y=e}function l(e){J=e}function p(){return function(){e.nextTick(v)}}function f(){return function(){Q(v)}}function d(){var e=0,t=new ee(v),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function h(){var e=new MessageChannel;return e.port1.onmessage=v,function(){e.port2.postMessage(0)}}function m(){return function(){setTimeout(v,1)}}function v(){for(var e=0;$>e;e+=2){var t=re[e],n=re[e+1];t(n),re[e]=void 0,re[e+1]=void 0}$=0}function g(){try{var e=n(10);return Q=e.runOnLoop||e.runOnContext,f()}catch(t){return m()}}function y(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function w(){return new TypeError("A promises callback cannot return that same promise.")}function x(e){try{return e.then}catch(t){return se.error=t,se}}function P(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function _(e,t,n){J(function(e){var r=!1,o=P(n,t,function(n){r||(r=!0,t!==n?R(e,n):O(e,n))},function(t){r||(r=!0,S(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,S(e,o))},e)}function C(e,t){t._state===ie?O(e,t._result):t._state===ae?S(e,t._result):N(t,void 0,function(t){R(e,t)},function(t){S(e,t)})}function E(e,t){if(t.constructor===e.constructor)C(e,t);else{var n=x(t);n===se?S(e,se.error):void 0===n?O(e,t):s(n)?_(e,t,n):O(e,t)}}function R(e,t){e===t?S(e,b()):a(t)?E(e,t):O(e,t)}function T(e){e._onerror&&e._onerror(e._result),k(e)}function O(e,t){e._state===oe&&(e._result=t,e._state=ie,0!==e._subscribers.length&&J(k,e))}function S(e,t){e._state===oe&&(e._state=ae,e._result=t,J(T,e))}function N(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ie]=n,o[i+ae]=r,0===i&&e._state&&J(k,e)}function k(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,o,i=e._result,a=0;a<t.length;a+=3)r=t[a],o=t[a+n],r?D(n,r,o,i):o(i);e._subscribers.length=0}}function j(){this.error=null}function I(e,t){try{return e(t)}catch(n){return ue.error=n,ue}}function D(e,t,n,r){var o,i,a,u,c=s(n);if(c){if(o=I(n,r),o===ue?(u=!0,i=o.error,o=null):a=!0,t===o)return void S(t,w())}else o=r,a=!0;t._state!==oe||(c&&a?R(t,o):u?S(t,i):e===ie?O(t,o):e===ae&&S(t,o))}function A(e,t){try{t(function(t){R(e,t)},function(t){S(e,t)})}catch(n){S(e,n)}}function M(e,t){var n=this;n._instanceConstructor=e,n.promise=new e(y),n._validateInput(t)?(n._input=t,n.length=t.length,n._remaining=t.length,n._init(),0===n.length?O(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&O(n.promise,n._result))):S(n.promise,n._validationError())}function F(e){return new ce(this,e).promise}function U(e){function t(e){R(o,e)}function n(e){S(o,e)}var r=this,o=new r(y);if(!G(e))return S(o,new TypeError("You must pass an array to race.")),o;for(var i=e.length,a=0;o._state===oe&&i>a;a++)N(r.resolve(e[a]),void 0,t,n);return o}function L(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(y);return R(n,e),n}function B(e){var t=this,n=new t(y);return S(n,e),n}function H(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(e){this._id=he++,this._state=void 0,this._result=void 0,this._subscribers=[],y!==e&&(s(e)||H(),this instanceof V||q(),A(this,e))}function W(){var e;if("undefined"!=typeof o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(e.Promise=me)}var K;K=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var Q,Y,z,G=K,$=0,J=({}.toString,function(e,t){re[$]=e,re[$+1]=t,$+=2,2===$&&(Y?Y(v):z())}),X="undefined"!=typeof window?window:void 0,Z=X||{},ee=Z.MutationObserver||Z.WebKitMutationObserver,te="undefined"!=typeof e&&"[object process]"==={}.toString.call(e),ne="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,re=new Array(1e3);z=te?p():ee?d():ne?h():void 0===X?g():m();var oe=void 0,ie=1,ae=2,se=new j,ue=new j;M.prototype._validateInput=function(e){return G(e)},M.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},M.prototype._init=function(){this._result=new Array(this.length)};var ce=M;M.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,o=0;n._state===oe&&t>o;o++)e._eachEntry(r[o],o)},M.prototype._eachEntry=function(e,t){var n=this,r=n._instanceConstructor;u(e)?e.constructor===r&&e._state!==oe?(e._onerror=null,n._settledAt(e._state,t,e._result)):n._willSettleAt(r.resolve(e),t):(n._remaining--,n._result[t]=e)},M.prototype._settledAt=function(e,t,n){var r=this,o=r.promise;o._state===oe&&(r._remaining--,e===ae?S(o,n):r._result[t]=n),0===r._remaining&&O(o,r._result)},M.prototype._willSettleAt=function(e,t){var n=this;N(e,void 0,function(e){n._settledAt(ie,t,e)},function(e){n._settledAt(ae,t,e)})};var le=F,pe=U,fe=L,de=B,he=0,me=V;V.all=le,V.race=pe,V.resolve=fe,V.reject=de,V._setScheduler=c,V._setAsap=l,V._asap=J,V.prototype={constructor:V,then:function(e,t){var n=this,r=n._state;if(r===ie&&!e||r===ae&&!t)return this;var o=new this.constructor(y),i=n._result;if(r){var a=arguments[r-1];J(function(){D(r,o,a,i)})}else N(n,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var ve=W,ge={Promise:me,polyfill:ve};n(11).amd?(r=function(){return ge}.call(t,n,t,i),!(void 0!==r&&(i.exports=r))):"undefined"!=typeof i&&i.exports?i.exports=ge:"undefined"!=typeof this&&(this.ES6Promise=ge),ve()}).call(this)}).call(t,n(8),function(){return this}(),n(9)(e))},function(e){function t(){u=!1,i.length?s=i.concat(s):c=-1,s.length&&n()}function n(){if(!u){var e=setTimeout(t);u=!0;for(var n=s.length;n;){for(i=s,s=[];++c<n;)i&&i[c].run();c=-1,n=s.length}i=null,u=!1,clearTimeout(e)}}function r(e,t){this.fun=e,this.array=t}function o(){}var i,a=e.exports={},s=[],u=!1,c=-1;a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)t[o-1]=arguments[o];s.push(new r(e,t)),1!==s.length||u||setTimeout(n,0)},r.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=o,a.addListener=o,a.once=o,a.off=o,a.removeListener=o,a.removeAllListeners=o,a.emit=o,a.binding=function(){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(){},function(e){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";function r(e,t,r){var a=n(13)("algoliasearch"),s=n(43),u=n(36),c="Usage: algoliasearch(applicationID, apiKey, opts)";if(!e)throw new f.AlgoliaSearchError("Please provide an application ID. "+c);if(!t)throw new f.AlgoliaSearchError("Please provide an API key. "+c);this.applicationID=e,this.apiKey=t;var l=[this.applicationID+"-1.algolianet.com",this.applicationID+"-2.algolianet.com",this.applicationID+"-3.algolianet.com"];this.hosts={read:[],write:[]},this.hostIndex={read:0,write:0},r=r||{};var p=r.protocol||"https:",d=void 0===r.timeout?2e3:r.timeout;if(/:$/.test(p)||(p+=":"),"http:"!==r.protocol&&"https:"!==r.protocol)throw new f.AlgoliaSearchError("protocol must be `http:` or `https:` (was `"+r.protocol+"`)");r.hosts?u(r.hosts)?(this.hosts.read=s(r.hosts),this.hosts.write=s(r.hosts)):(this.hosts.read=s(r.hosts.read),this.hosts.write=s(r.hosts.write)):(this.hosts.read=[this.applicationID+"-dsn.algolia.net"].concat(l),this.hosts.write=[this.applicationID+".algolia.net"].concat(l)),this.hosts.read=o(this.hosts.read,i(p)),this.hosts.write=o(this.hosts.write,i(p)),this.requestTimeout=d,this.extraHeaders=[],this.cache={},this._ua=r._ua,this._useCache=void 0===r._useCache?!0:r._useCache,this._setTimeout=r._setTimeout,a("init done, %j",this)}function o(e,t){for(var n=[],r=0;r<e.length;++r)n.push(t(e[r],r));return n}function i(e){return function(t){return e+"//"+t.toLowerCase()}}function a(){var e="Not implemented in this environment.\nIf you feel this is a mistake, write to support@algolia.com";throw new f.AlgoliaSearchError(e)}function s(e,t){var n=e.toLowerCase().replace(".","").replace("()","");return"algoliasearch: `"+e+"` was replaced by `"+t+"`. Please see https://github.com/algolia/algoliasearch-client-js/wiki/Deprecated#"+n}function u(e,t){t(e,0)}function c(e,t){function n(){return r||(console.log(t),r=!0),e.apply(this,arguments)}var r=!1;return n}function l(e){if(void 0===Array.prototype.toJSON)return JSON.stringify(e);var t=Array.prototype.toJSON;delete Array.prototype.toJSON;var n=JSON.stringify(e);return Array.prototype.toJSON=t,n}function p(e){return function(t,n,r){if("function"==typeof t&&"object"==typeof n||"object"==typeof r)throw new f.AlgoliaSearchError("index.search usage is index.search(query, params, cb)");0===arguments.length||"function"==typeof t?(r=t,t=""):(1===arguments.length||"function"==typeof n)&&(r=n,n=void 0),"object"==typeof t&&null!==t?(n=t,t=void 0):(void 0===t||null===t)&&(t="");var o="";return void 0!==t&&(o+=e+"="+encodeURIComponent(t)),void 0!==n&&(o=this.as._getSearchParams(n,o)),this._search(o,r)}}e.exports=r,"development"==={NODE_ENV:"production"}.APP_ENV&&n(13).enable("algoliasearch*");var f=n(16);r.prototype={deleteIndex:function(e,t){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(e),hostType:"write",callback:t})},moveIndex:function(e,t,n){var r={operation:"move",destination:t};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:r,hostType:"write",callback:n})},copyIndex:function(e,t,n){var r={operation:"copy",destination:t};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:r,hostType:"write",callback:n})},getLogs:function(e,t,n){return 0===arguments.length||"function"==typeof e?(n=e,e=0,t=10):(1===arguments.length||"function"==typeof t)&&(n=t,t=10),this._jsonRequest({method:"GET",url:"/1/logs?offset="+e+"&length="+t,hostType:"read",callback:n})},listIndexes:function(e,t){var n="";return void 0===e||"function"==typeof e?t=e:n="?page="+e,this._jsonRequest({method:"GET",url:"/1/indexes"+n,hostType:"read",callback:t})},initIndex:function(e){return new this.Index(this,e)},listUserKeys:function(e){return this._jsonRequest({method:"GET",url:"/1/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){return this._jsonRequest({method:"GET",url:"/1/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+e,hostType:"write",callback:t})},addUserKey:function(e,t,r){var o=n(36),i="Usage: client.addUserKey(arrayOfAcls[, params, callback])";if(!o(e))throw new Error(i);(1===arguments.length||"function"==typeof t)&&(r=t,t=null);var a={acl:e};return t&&(a.validity=t.validity,a.maxQueriesPerIPPerHour=t.maxQueriesPerIPPerHour,a.maxHitsPerQuery=t.maxHitsPerQuery,a.indexes=t.indexes,a.description=t.description,t.queryParameters&&(a.queryParameters=this._getSearchParams(t.queryParameters,"")),a.referers=t.referers),this._jsonRequest({method:"POST",url:"/1/keys",body:a,hostType:"write",callback:r})},addUserKeyWithValidity:c(function(e,t,n){return this.addUserKey(e,t,n)},s("client.addUserKeyWithValidity()","client.addUserKey()")),updateUserKey:function(e,t,r,o){var i=n(36),a="Usage: client.updateUserKey(key, arrayOfAcls[, params, callback])";if(!i(t))throw new Error(a);(2===arguments.length||"function"==typeof r)&&(o=r,r=null);var s={acl:t};return r&&(s.validity=r.validity,s.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour,s.maxHitsPerQuery=r.maxHitsPerQuery,s.indexes=r.indexes,s.description=r.description,r.queryParameters&&(s.queryParameters=this._getSearchParams(r.queryParameters,"")),s.referers=r.referers),this._jsonRequest({method:"PUT",url:"/1/keys/"+e,body:s,hostType:"write",callback:o})},setSecurityTags:function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],n=0;n<e.length;++n)if("[object Array]"===Object.prototype.toString.call(e[n])){for(var r=[],o=0;o<e[n].length;++o)r.push(e[n][o]);t.push("("+r.join(",")+")")}else t.push(e[n]);e=t.join(",")}this.securityTags=e},setUserToken:function(e){this.userToken=e},startQueriesBatch:c(function(){this._batch=[]},s("client.startQueriesBatch()","client.search()")),addQueryInBatch:c(function(e,t,n){this._batch.push({indexName:e,query:t,params:n})},s("client.addQueryInBatch()","client.search()")),clearCache:function(){this.cache={}},sendQueriesBatch:c(function(e){return this.search(this._batch,e)},s("client.sendQueriesBatch()","client.search()")),setRequestTimeout:function(e){e&&(this.requestTimeout=parseInt(e,10))},search:function(e,t){var r=n(36),i="Usage: client.search(arrayOfQueries[, callback])";if(!r(e))throw new Error(i);var a=this,s={requests:o(e,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:a._getSearchParams(e.params,t)}})};return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:s,hostType:"read",callback:t})},batch:function(e,t){var r=n(36),o="Usage: client.batch(operations[, callback])";if(!r(e))throw new Error(o);return this._jsonRequest({method:"POST",url:"/1/indexes/*/batch",body:{requests:e},hostType:"write",callback:t})},destroy:a,enableRateLimitForward:a,disableRateLimitForward:a,useSecuredAPIKey:a,disableSecuredAPIKey:a,generateSecuredApiKey:a,Index:function(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}},setExtraHeader:function(e,t){this.extraHeaders.push({name:e.toLowerCase(),value:t})},addAlgoliaAgent:function(e){this._ua+=";"+e},_sendQueriesBatch:function(e,t){function n(){for(var t="",n=0;n<e.requests.length;++n){var r="/1/indexes/"+encodeURIComponent(e.requests[n].indexName)+"?"+e.requests[n].params;t+=n+"="+encodeURIComponent(r)+"&"}return t}return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:e,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:n()}},callback:t})},_jsonRequest:function(e){function t(n,u){function p(e){var t=e&&e.body&&e.body.message&&e.body.status||e.statusCode||e&&e.body&&200;o("received response: statusCode: %s, computed statusCode: %d, headers: %j",e.statusCode,t,e.headers),{NODE_ENV:"production"}.DEBUG&&-1!=={NODE_ENV:"production"}.DEBUG.indexOf("debugBody")&&o("body: %j",e.body);var n=200===t||201===t,r=!n&&4!==Math.floor(t/100)&&1!==Math.floor(t/100);if(a._useCache&&n&&i&&(i[m]=e.responseText),n)return e.body;if(r)return s+=1,h();var u=new f.AlgoliaSearchError(e.body&&e.body.message);return a._promise.reject(u)}function d(r){return o("error: %s, stack: %s",r.message,r.stack),r instanceof f.AlgoliaSearchError||(r=new f.Unknown(r&&r.message,r)),s+=1,r instanceof f.Unknown||r instanceof f.UnparsableJSON||s>=a.hosts[e.hostType].length&&(c||!e.fallback||!a._request.fallback)?a._promise.reject(r):(a.hostIndex[e.hostType]=++a.hostIndex[e.hostType]%a.hosts[e.hostType].length,r instanceof f.RequestTimeout?h():(a._request.fallback&&!a.useFallback&&(a.useFallback=!0),t(n,u)))}function h(){return a.hostIndex[e.hostType]=++a.hostIndex[e.hostType]%a.hosts[e.hostType].length,u.timeout=a.requestTimeout*(s+1),t(n,u)}var m;if(a._useCache&&(m=e.url),a._useCache&&r&&(m+="_body_"+u.body),a._useCache&&i&&void 0!==i[m])return o("serving response from cache"),a._promise.resolve(JSON.parse(i[m]));if(s>=a.hosts[e.hostType].length||a.useFallback&&!c)return e.fallback&&a._request.fallback&&!c?(o("switching to fallback"),s=0,u.method=e.fallback.method,u.url=e.fallback.url,u.jsonBody=e.fallback.body,u.jsonBody&&(u.body=l(u.jsonBody)),u.timeout=a.requestTimeout*(s+1),a.hostIndex[e.hostType]=0,c=!0,t(a._request.fallback,u)):(o("could not get any response"),a._promise.reject(new f.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue. Application id was: "+a.applicationID)));var v=a.hosts[e.hostType][a.hostIndex[e.hostType]]+u.url,g={body:r,jsonBody:e.body,method:u.method,headers:a._computeRequestHeaders(),timeout:u.timeout,debug:o};return o("method: %s, url: %s, headers: %j, timeout: %d",g.method,v,g.headers,g.timeout),n===a._request.fallback&&o("using fallback"),n.call(a,v,g).then(p,d)}var r,o=n(13)("algoliasearch:"+e.url),i=e.cache,a=this,s=0,c=!1;void 0!==e.body&&(r=l(e.body)),o("request start");var p=a.useFallback&&e.fallback,d=p?e.fallback:e,h=t(p?a._request.fallback:a._request,{url:d.url,method:d.method,body:r,jsonBody:e.body,timeout:a.requestTimeout*(s+1)});return e.callback?void h.then(function(t){u(function(){e.callback(null,t)},a._setTimeout||setTimeout)},function(t){u(function(){e.callback(t)},a._setTimeout||setTimeout)}):h},_getSearchParams:function(e,t){if(this._isUndefined(e)||null===e)return t;for(var n in e)null!==n&&void 0!==e[n]&&e.hasOwnProperty(n)&&(t+=""===t?"":"&",t+=n+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[n])?l(e[n]):e[n]));return t},_isUndefined:function(e){return void 0===e},_computeRequestHeaders:function(){var e=n(17),t={"x-algolia-api-key":this.apiKey,"x-algolia-application-id":this.applicationID,"x-algolia-agent":this._ua};return this.userToken&&(t["x-algolia-usertoken"]=this.userToken),this.securityTags&&(t["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&e(this.extraHeaders,function(e){t[e.name]=e.value}),t}},r.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(e,t,n){var r=this;return(1===arguments.length||"function"==typeof t)&&(n=t,t=void 0),this.as._jsonRequest({method:void 0!==t?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(r.indexName)+(void 0!==t?"/"+encodeURIComponent(t):""),body:e,hostType:"write",callback:n})},addObjects:function(e,t){var r=n(36),o="Usage: index.addObjects(arrayOfObjects[, callback])";if(!r(e))throw new Error(o);for(var i=this,a={requests:[]},s=0;s<e.length;++s){var u={action:"addObject",body:e[s]};a.requests.push(u)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(i.indexName)+"/batch",body:a,hostType:"write",callback:t})},getObject:function(e,t,n){var r=this;(1===arguments.length||"function"==typeof t)&&(n=t,t=void 0);var o="";if(void 0!==t){o="?attributes=";for(var i=0;i<t.length;++i)0!==i&&(o+=","),o+=t[i]}return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e)+o,hostType:"read",callback:n})},getObjects:function(e,t,r){var i=n(36),a="Usage: index.getObjects(arrayOfObjectIDs[, callback])";if(!i(e))throw new Error(a);var s=this;(1===arguments.length||"function"==typeof t)&&(r=t,t=void 0);var u={requests:o(e,function(e){var n={indexName:s.indexName,objectID:e};return t&&(n.attributesToRetrieve=t.join(",")),n})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",hostType:"read",body:u,callback:r})},partialUpdateObject:function(e,t){var n=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/"+encodeURIComponent(e.objectID)+"/partial",body:e,hostType:"write",callback:t})},partialUpdateObjects:function(e,t){var r=n(36),o="Usage: index.partialUpdateObjects(arrayOfObjects[, callback])";if(!r(e))throw new Error(o);for(var i=this,a={requests:[]},s=0;s<e.length;++s){var u={action:"partialUpdateObject",objectID:e[s].objectID,body:e[s]};a.requests.push(u)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(i.indexName)+"/batch",body:a,hostType:"write",callback:t})},saveObject:function(e,t){var n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/"+encodeURIComponent(e.objectID),body:e,hostType:"write",callback:t})},saveObjects:function(e,t){var r=n(36),o="Usage: index.saveObjects(arrayOfObjects[, callback])";if(!r(e))throw new Error(o);for(var i=this,a={requests:[]},s=0;s<e.length;++s){var u={action:"updateObject",objectID:e[s].objectID,body:e[s]};a.requests.push(u)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(i.indexName)+"/batch",body:a,hostType:"write",callback:t})},deleteObject:function(e,t){if("function"==typeof e||"string"!=typeof e&&"number"!=typeof e){var n=new f.AlgoliaSearchError("Cannot delete an object without an objectID");return t=e,"function"==typeof t?t(n):this.as._promise.reject(n)}var r=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e),hostType:"write",callback:t})},deleteObjects:function(e,t){var r=n(36),i="Usage: index.deleteObjects(arrayOfObjectIDs[, callback])";if(!r(e))throw new Error(i);var a=this,s={requests:o(e,function(e){return{action:"deleteObject",objectID:e,body:{objectID:e}}})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a.indexName)+"/batch",body:s,hostType:"write",callback:t})},deleteByQuery:function(e,t,r){function i(e){if(0===e.nbHits)return e;var t=o(e.hits,function(e){return e.objectID});return f.deleteObjects(t).then(a).then(s)}function a(e){return f.waitTask(e.taskID)}function s(){return f.deleteByQuery(e,t)}function c(){u(function(){r(null)},d._setTimeout||setTimeout)}function l(e){u(function(){r(e)},d._setTimeout||setTimeout)}var p=n(43),f=this,d=f.as;1===arguments.length||"function"==typeof t?(r=t,t={}):t=p(t),t.attributesToRetrieve="objectID",t.hitsPerPage=1e3,t.distinct=!1,this.clearCache();var h=this.search(e,t).then(i);return r?void h.then(c,l):h},search:p("query"),similarSearch:p("similarQuery"),browse:function(e,t,r){var o,i,a=n(53),s=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(o=0,r=arguments[0],e=void 0):"number"==typeof arguments[0]?(o=arguments[0],"number"==typeof arguments[1]?i=arguments[1]:"function"==typeof arguments[1]&&(r=arguments[1],i=void 0),e=void 0,t=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(r=arguments[1]),t=arguments[0],e=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(r=arguments[1],t=void 0),t=a({},t||{},{page:o,hitsPerPage:i,query:e});var u=this.as._getSearchParams(t,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(s.indexName)+"/browse?"+u,hostType:"read",callback:r})},browseFrom:function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+encodeURIComponent(e),hostType:"read",callback:t})},browseAll:function(e,t){function r(e){if(!s._stopped){var t;t=void 0!==e?"cursor="+encodeURIComponent(e):l,u._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(c.indexName)+"/browse?"+t,hostType:"read",callback:o})}}function o(e,t){return s._stopped?void 0:e?void s._error(e):(s._result(t),void 0===t.cursor?void s._end():void r(t.cursor))}"object"==typeof e&&(t=e,e=void 0);var i=n(53),a=n(62),s=new a,u=this.as,c=this,l=u._getSearchParams(i({},t||{},{query:e}),"");return r(),s},ttAdapter:function(e){var t=this;return function(n,r,o){var i;i="function"==typeof o?o:r,t.search(n,e,function(e,t){return e?void i(e):void i(t.hits)})}},waitTask:function(e,t){function n(){return l._jsonRequest({method:"GET",hostType:"read",url:"/1/indexes/"+encodeURIComponent(c.indexName)+"/task/"+e}).then(function(e){s++;var t=i*s*s;return t>a&&(t=a),"published"!==e.status?l._promise.delay(t).then(n):e})}function r(e){u(function(){t(null,e)},l._setTimeout||setTimeout)}function o(e){u(function(){t(e)},l._setTimeout||setTimeout)}var i=100,a=5e3,s=0,c=this,l=c.as,p=n();return t?void p.then(r,o):p},clearIndex:function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},getSettings:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings",hostType:"read",callback:e})},setSettings:function(e,t){var n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/settings",hostType:"write",body:e,callback:t})},listUserKeys:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){var n=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){ var n=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/keys/"+e,hostType:"write",callback:t})},addUserKey:function(e,t,r){var o=n(36),i="Usage: index.addUserKey(arrayOfAcls[, params, callback])";if(!o(e))throw new Error(i);(1===arguments.length||"function"==typeof t)&&(r=t,t=null);var a={acl:e};return t&&(a.validity=t.validity,a.maxQueriesPerIPPerHour=t.maxQueriesPerIPPerHour,a.maxHitsPerQuery=t.maxHitsPerQuery,a.description=t.description,t.queryParameters&&(a.queryParameters=this.as._getSearchParams(t.queryParameters,"")),a.referers=t.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:a,hostType:"write",callback:r})},addUserKeyWithValidity:c(function(e,t,n){return this.addUserKey(e,t,n)},s("index.addUserKeyWithValidity()","index.addUserKey()")),updateUserKey:function(e,t,r,o){var i=n(36),a="Usage: index.updateUserKey(key, arrayOfAcls[, params, callback])";if(!i(t))throw new Error(a);(2===arguments.length||"function"==typeof r)&&(o=r,r=null);var s={acl:t};return r&&(s.validity=r.validity,s.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour,s.maxHitsPerQuery=r.maxHitsPerQuery,s.description=r.description,r.queryParameters&&(s.queryParameters=this.as._getSearchParams(r.queryParameters,"")),s.referers=r.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+e,body:s,hostType:"write",callback:o})},_search:function(e,t){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:t})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}},function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0,i=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))}),e.splice(i,0,r),e}function i(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(n){}}function s(){var e;try{e=t.storage.debug}catch(n){}return e}function u(){try{return window.localStorage}catch(e){}}t=e.exports=n(14),t.log=i,t.formatArgs=o,t.save=a,t.load=s,t.useColors=r,t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(s())},function(e,t,n){function r(){return t.colors[l++%t.colors.length]}function o(e){function n(){}function o(){var e=o,n=+new Date,i=n-(c||n);e.diff=i,e.prev=c,e.curr=n,c=n,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=r());var a=Array.prototype.slice.call(arguments);a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(n,r){if("%%"===n)return n;s++;var o=t.formatters[r];if("function"==typeof o){var i=a[s];n=o.call(e,i),a.splice(s,1),s--}return n}),"function"==typeof t.formatArgs&&(a=t.formatArgs.apply(e,a));var u=o.log||t.log||console.log.bind(console);u.apply(e,a)}n.enabled=!1,o.enabled=!0;var i=t.enabled(e)?o:n;return i.namespace=e,i}function i(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),r=n.length,o=0;r>o;o++)n[o]&&(e=n[o].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function a(){t.enable("")}function s(e){var n,r;for(n=0,r=t.skips.length;r>n;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;r>n;n++)if(t.names[n].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=o,t.coerce=u,t.disable=a,t.enable=i,t.enabled=s,t.humanize=n(15),t.names=[],t.skips=[],t.formatters={};var c,l=0},function(e){function t(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*c;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function n(e){return e>=u?Math.round(e/u)+"d":e>=s?Math.round(e/s)+"h":e>=a?Math.round(e/a)+"m":e>=i?Math.round(e/i)+"s":e+"ms"}function r(e){return o(e,u,"day")||o(e,s,"hour")||o(e,a,"minute")||o(e,i,"second")||e+" ms"}function o(e,t,n){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var i=1e3,a=60*i,s=60*a,u=24*s,c=365.25*u;e.exports=function(e,o){return o=o||{},"string"==typeof e?t(e):o["long"]?r(e):n(e)}},function(e,t,n){"use strict";function r(e,t){var r=n(17),o=this;"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):o.stack=(new Error).stack||"Cannot get a stacktrace, browser is too old",this.name=this.constructor.name,this.message=e||"Unknown error",t&&r(t,function(e,t){o[t]=e})}function o(e,t){function n(){var n=Array.prototype.slice.call(arguments,0);"string"!=typeof n[0]&&n.unshift(t),r.apply(this,n),this.name="AlgoliaSearch"+e+"Error"}return i(n,r),n}var i=n(6);i(r,Error),e.exports={AlgoliaSearchError:r,UnparsableJSON:o("UnparsableJSON","Could not parse the incoming response as JSON, see err.more for details"),RequestTimeout:o("RequestTimeout","Request timedout before getting a response"),Network:o("Network","Network issue, see err.more for details"),JSONPScriptFail:o("JSONPScriptFail","<script> was loaded but did not call our provided callback"),JSONPScriptError:o("JSONPScriptError","<script> unable to load due to an `error` event on it"),Unknown:o("Unknown","Unknown error occured")}},function(e,t,n){var r=n(18),o=n(19),i=n(40),a=i(r,o);e.exports=a},function(e){function t(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}e.exports=t},function(e,t,n){var r=n(20),o=n(39),i=o(r);e.exports=i},function(e,t,n){function r(e,t){return o(e,t,i)}var o=n(21),i=n(25);e.exports=r},function(e,t,n){var r=n(22),o=r();e.exports=o},function(e,t,n){function r(e){return function(t,n,r){for(var i=o(t),a=r(t),s=a.length,u=e?s:-1;e?u--:++u<s;){var c=a[u];if(n(i[c],c,i)===!1)break}return t}}var o=n(23);e.exports=r},function(e,t,n){function r(e){return o(e)?e:Object(e)}var o=n(24);e.exports=r},function(e){function t(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=t},function(e,t,n){var r=n(26),o=n(30),i=n(24),a=n(34),s=r(Object,"keys"),u=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&o(e)?a(e):i(e)?s(e):[]}:a;e.exports=u},function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return o(n)?n:void 0}var o=n(27);e.exports=r},function(e,t,n){function r(e){return null==e?!1:o(e)?l.test(u.call(e)):i(e)&&a.test(e)}var o=n(28),i=n(29),a=/^\[object .+?Constructor\]$/,s=Object.prototype,u=Function.prototype.toString,c=s.hasOwnProperty,l=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){function r(e){return o(e)&&s.call(e)==i}var o=n(24),i="[object Function]",a=Object.prototype,s=a.toString;e.exports=r},function(e){function t(e){return!!e&&"object"==typeof e}e.exports=t},function(e,t,n){function r(e){return null!=e&&i(o(e))}var o=n(31),i=n(33);e.exports=r},function(e,t,n){var r=n(32),o=r("length");e.exports=o},function(e){function t(e){return function(t){return null==t?void 0:t[e]}}e.exports=t},function(e){function t(e){return"number"==typeof e&&e>-1&&e%1==0&&n>=e}var n=9007199254740991;e.exports=t},function(e,t,n){function r(e){for(var t=u(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(i(e)||o(e)),p=-1,f=[];++p<n;){var d=t[p];(c&&a(d,r)||l.call(e,d))&&f.push(d)}return f}var o=n(35),i=n(36),a=n(37),s=n(33),u=n(38),c=Object.prototype,l=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return i(e)&&o(e)&&s.call(e,"callee")&&!u.call(e,"callee")}var o=n(30),i=n(29),a=Object.prototype,s=a.hasOwnProperty,u=a.propertyIsEnumerable;e.exports=r},function(e,t,n){var r=n(26),o=n(33),i=n(29),a="[object Array]",s=Object.prototype,u=s.toString,c=r(Array,"isArray"),l=c||function(e){return i(e)&&o(e.length)&&u.call(e)==a};e.exports=l},function(e){function t(e,t){return e="number"==typeof e||n.test(e)?+e:-1,t=null==t?r:t,e>-1&&e%1==0&&t>e}var n=/^\d+$/,r=9007199254740991;e.exports=t},function(e,t,n){function r(e){if(null==e)return[];u(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(i(e)||o(e))&&t||0;for(var n=e.constructor,r=-1,c="function"==typeof n&&n.prototype===e,p=Array(t),f=t>0;++r<t;)p[r]=r+"";for(var d in e)f&&a(d,t)||"constructor"==d&&(c||!l.call(e,d))||p.push(d);return p}var o=n(35),i=n(36),a=n(37),s=n(33),u=n(24),c=Object.prototype,l=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return function(n,r){var s=n?o(n):0;if(!i(s))return e(n,r);for(var u=t?s:-1,c=a(n);(t?u--:++u<s)&&r(c[u],u,c)!==!1;);return n}}var o=n(31),i=n(33),a=n(23);e.exports=r},function(e,t,n){function r(e,t){return function(n,r,a){return"function"==typeof r&&void 0===a&&i(n)?e(n,r):t(n,o(r,a,3))}}var o=n(41),i=n(36);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return o;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,i){return e.call(t,n,r,o,i)};case 5:return function(n,r,o,i,a){return e.call(t,n,r,o,i,a)}}return function(){return e.apply(t,arguments)}}var o=n(42);e.exports=r},function(e){function t(e){return e}e.exports=t},function(e,t,n){function r(e,t,n,r){return t&&"boolean"!=typeof t&&a(e,t,n)?t=!1:"function"==typeof t&&(r=n,n=t,t=!1),"function"==typeof n?o(e,t,i(n,r,3)):o(e,t)}var o=n(44),i=n(41),a=n(52);e.exports=r},function(e,t,n){function r(e,t,n,h,m,v,g){var b;if(n&&(b=m?n(e,h,m):n(e)),void 0!==b)return b;if(!f(e))return e;var w=p(e);if(w){if(b=u(e),!t)return o(e,b)}else{var P=U.call(e),_=P==y;if(P!=x&&P!=d&&(!_||m))return M[P]?c(e,P,t):m?e:{};if(b=l(_?{}:e),!t)return a(b,e)}v||(v=[]),g||(g=[]);for(var C=v.length;C--;)if(v[C]==e)return g[C];return v.push(e),g.push(b),(w?i:s)(e,function(o,i){b[i]=r(o,t,n,i,e,v,g)}),b}var o=n(45),i=n(18),a=n(46),s=n(20),u=n(48),c=n(49),l=n(51),p=n(36),f=n(24),d="[object Arguments]",h="[object Array]",m="[object Boolean]",v="[object Date]",g="[object Error]",y="[object Function]",b="[object Map]",w="[object Number]",x="[object Object]",P="[object RegExp]",_="[object Set]",C="[object String]",E="[object WeakMap]",R="[object ArrayBuffer]",T="[object Float32Array]",O="[object Float64Array]",S="[object Int8Array]",N="[object Int16Array]",k="[object Int32Array]",j="[object Uint8Array]",I="[object Uint8ClampedArray]",D="[object Uint16Array]",A="[object Uint32Array]",M={};M[d]=M[h]=M[R]=M[m]=M[v]=M[T]=M[O]=M[S]=M[N]=M[k]=M[w]=M[x]=M[P]=M[C]=M[j]=M[I]=M[D]=M[A]=!0,M[g]=M[y]=M[b]=M[_]=M[E]=!1;var F=Object.prototype,U=F.toString;e.exports=r},function(e){function t(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}e.exports=t},function(e,t,n){function r(e,t){return null==t?e:o(t,i(t),e)}var o=n(47),i=n(25);e.exports=r},function(e){function t(e,t,n){n||(n={});for(var r=-1,o=t.length;++r<o;){var i=t[r];n[i]=e[i]}return n}e.exports=t},function(e){function t(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&r.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var n=Object.prototype,r=n.hasOwnProperty;e.exports=t},function(e,t,n){function r(e,t,n){var r=e.constructor;switch(t){case l:return o(e);case i:case a:return new r(+e);case p:case f:case d:case h:case m:case v:case g:case y:case b:var x=e.buffer;return new r(n?o(x):x,e.byteOffset,e.length);case s:case c:return new r(e);case u:var P=new r(e.source,w.exec(e));P.lastIndex=e.lastIndex}return P}var o=n(50),i="[object Boolean]",a="[object Date]",s="[object Number]",u="[object RegExp]",c="[object String]",l="[object ArrayBuffer]",p="[object Float32Array]",f="[object Float64Array]",d="[object Int8Array]",h="[object Int16Array]",m="[object Int32Array]",v="[object Uint8Array]",g="[object Uint8ClampedArray]",y="[object Uint16Array]",b="[object Uint32Array]",w=/\w*$/;e.exports=r},function(e,t){(function(t){function n(e){var t=new r(e.byteLength),n=new o(t);return n.set(new o(e)),t}var r=t.ArrayBuffer,o=t.Uint8Array;e.exports=n}).call(t,function(){return this}())},function(e){function t(e){var t=e.constructor;return"function"==typeof t&&t instanceof t||(t=Object),new t}e.exports=t},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?o(n)&&i(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var o=n(30),i=n(37),a=n(24);e.exports=r},function(e,t,n){var r=n(54),o=n(60),i=o(r);e.exports=i},function(e,t,n){function r(e,t,n,f,d){if(!u(e))return e;var h=s(t)&&(a(t)||l(t)),m=h?void 0:p(t);return o(m||t,function(o,a){if(m&&(a=o,o=t[a]),c(o))f||(f=[]),d||(d=[]),i(e,t,a,r,n,f,d);else{var s=e[a],u=n?n(s,o,a,e,t):void 0,l=void 0===u;l&&(u=o),void 0===u&&(!h||a in e)||!l&&(u===u?u===s:s!==s)||(e[a]=u)}}),e}var o=n(18),i=n(55),a=n(36),s=n(30),u=n(24),c=n(29),l=n(58),p=n(25);e.exports=r},function(e,t,n){function r(e,t,n,r,p,f,d){for(var h=f.length,m=t[n];h--;)if(f[h]==m)return void(e[n]=d[h]);var v=e[n],g=p?p(v,m,n,e,t):void 0,y=void 0===g;y&&(g=m,s(m)&&(a(m)||c(m))?g=a(v)?v:s(v)?o(v):[]:u(m)||i(m)?g=i(v)?l(v):u(v)?v:{}:y=!1),f.push(m),d.push(g),y?e[n]=r(g,m,p,f,d):(g===g?g!==v:v===v)&&(e[n]=g)}var o=n(45),i=n(35),a=n(36),s=n(30),u=n(56),c=n(58),l=n(59);e.exports=r},function(e,t,n){function r(e){var t;if(!a(e)||l.call(e)!=s||i(e)||!c.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return o(e,function(e,t){n=t}),void 0===n||c.call(e,n)}var o=n(57),i=n(35),a=n(29),s="[object Object]",u=Object.prototype,c=u.hasOwnProperty,l=u.toString;e.exports=r},function(e,t,n){function r(e,t){return o(e,t,i)}var o=n(21),i=n(38);e.exports=r},function(e,t,n){function r(e){return i(e)&&o(e.length)&&!!S[k.call(e)]}var o=n(33),i=n(29),a="[object Arguments]",s="[object Array]",u="[object Boolean]",c="[object Date]",l="[object Error]",p="[object Function]",f="[object Map]",d="[object Number]",h="[object Object]",m="[object RegExp]",v="[object Set]",g="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",w="[object Float32Array]",x="[object Float64Array]",P="[object Int8Array]",_="[object Int16Array]",C="[object Int32Array]",E="[object Uint8Array]",R="[object Uint8ClampedArray]",T="[object Uint16Array]",O="[object Uint32Array]",S={};S[w]=S[x]=S[P]=S[_]=S[C]=S[E]=S[R]=S[T]=S[O]=!0,S[a]=S[s]=S[b]=S[u]=S[c]=S[l]=S[p]=S[f]=S[d]=S[h]=S[m]=S[v]=S[g]=S[y]=!1;var N=Object.prototype,k=N.toString;e.exports=r},function(e,t,n){function r(e){return o(e,i(e))}var o=n(47),i=n(38);e.exports=r},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,u=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=o(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),u&&i(n[0],n[1],u)&&(s=3>a?void 0:s,a=1);++r<a;){var l=n[r];l&&e(t,l,s)}return t})}var o=n(41),i=n(52),a=n(61);e.exports=r},function(e){function t(e,t){if("function"!=typeof e)throw new TypeError(n);return t=r(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,o=-1,i=r(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,n[0],a);case 2:return e.call(this,n[0],n[1],a)}var s=Array(t+1);for(o=-1;++o<t;)s[o]=n[o];return s[t]=a,e.apply(this,s)}}var n="Expected a function",r=Math.max;e.exports=t},function(e,t,n){"use strict";function r(){}e.exports=r;var o=n(6),i=n(63).EventEmitter;o(r,i),r.prototype.stop=function(){this._stopped=!0,this._clean()},r.prototype._end=function(){this.emit("end"),this._clean()},r.prototype._error=function(e){this.emit("error",e),this._clean()},r.prototype._result=function(e){this.emit("result",e)},r.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},function(e){function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function r(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if(!r(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,r,a,s,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[e],i(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(o(r))for(s=Array.prototype.slice.call(arguments,1),c=r.slice(),a=c.length,u=0;a>u;u++)c[u].apply(this,s);return!0},t.prototype.addListener=function(e,r){var a;if(!n(r))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(r.listener)?r.listener:r),this._events[e]?o(this._events[e])?this._events[e].push(r):this._events[e]=[this._events[e],r]:this._events[e]=r,o(this._events[e])&&!this._events[e].warned&&(a=i(this._maxListeners)?t.defaultMaxListeners:this._maxListeners,a&&a>0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){function r(){this.removeListener(e,r),o||(o=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var o=!1;return r.listener=t,this.on(e,r),this},t.prototype.removeListener=function(e,t){var r,i,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(r)){for(s=a;s-->0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(0>i)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";function r(e,t){return e+=/\?/.test(e)?"&":"?",e+o.encode(t)}e.exports=r;var o=n(65)},function(e,t,n){"use strict";t.decode=t.parse=n(66),t.encode=t.stringify=n(67)},function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,o,i){r=r||"&",o=o||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(r);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;c>l;++l){var p,f,d,h,m=e[l].replace(s,"%20"),v=m.indexOf(o);v>=0?(p=m.substr(0,v),f=m.substr(v+1)):(p=m,f=""),d=decodeURIComponent(p),h=decodeURIComponent(f),t(a,d)?n(a[d])?a[d].push(h):a[d]=[a[d],h]:a[d]=h}return a};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e){"use strict";function t(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,i,a,s){return i=i||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e?t(o(e),function(o){var s=encodeURIComponent(n(o))+a;return r(e[o])?t(e[o],function(e){return s+encodeURIComponent(n(e))}).join(i):s+encodeURIComponent(n(e[o]))}).join(i):s?encodeURIComponent(n(s))+a+encodeURIComponent(n(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";function r(e,t,n){function r(){t.debug("JSONP: success"),m||p||(m=!0,l||(t.debug("JSONP: Fail. Script loaded but did not call the callback"),s(),n(new o.JSONPScriptFail)))}function a(){("loaded"===this.readyState||"complete"===this.readyState)&&r()}function s(){clearTimeout(v),d.onload=null,d.onreadystatechange=null,d.onerror=null,f.removeChild(d);try{delete window[h],delete window[h+"_loaded"]}catch(e){window[h]=null,window[h+"_loaded"]=null}}function u(){t.debug("JSONP: Script timeout"),p=!0,s(),n(new o.RequestTimeout)}function c(){t.debug("JSONP: Script error"),m||p||(s(),n(new o.JSONPScriptError))}if("GET"!==t.method)return void n(new Error("Method "+t.method+" "+e+" is not supported by JSONP."));t.debug("JSONP: start");var l=!1,p=!1;i+=1;var f=document.getElementsByTagName("head")[0],d=document.createElement("script"),h="algoliaJSONP_"+i,m=!1;window[h]=function(e){try{delete window[h]}catch(t){window[h]=void 0}p||(l=!0,s(),n(null,{body:e}))},e+="&callback="+h,t.jsonBody&&t.jsonBody.params&&(e+="&"+t.jsonBody.params);var v=setTimeout(u,t.timeout);d.onreadystatechange=a,d.onload=r,d.onerror=c,d.async=!0,d.defer=!0,d.src=e,f.appendChild(d)}e.exports=r;var o=n(16),i=0},function(e,t,n){function r(e,t,n){return"function"==typeof t?o(e,!0,i(t,n,3)):o(e,!0)}var o=n(44),i=n(41);e.exports=r},function(e){"use strict";function t(){var e=window.document.location.protocol;return"http:"!==e&&"https:"!==e&&(e="http:"),e}e.exports=t},function(e){"use strict";e.exports="3.9.1"},function(e,t,n){"use strict";function r(e,t,n){return new o(e,t,n)}var o=n(73),i=n(74),a=n(141);r.version=n(210),r.AlgoliaSearchHelper=o,r.SearchParameters=i,r.SearchResults=a,r.url=n(200),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){this.client=e;var r=n||{};r.index=t,this.state=o.make(r),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1}var o=n(74),i=n(141),a=n(195),s=n(196),u=n(63),c=n(17),l=n(108),p=n(199),f=n(124),d=n(188),h=n(200);s.inherits(r,u.EventEmitter),r.prototype.search=function(){return this._search(),this},r.prototype.searchOnce=function(e,t){var n=this.state.setQueryParameters(e),r=a._getQueries(n.index,n);return t?this.client.search(r,function(e,r){t(e,new i(n,r),n)}):this.client.search(r).then(function(e){return{content:new i(n,e),state:n}})},r.prototype.setQuery=function(e){return this.state=this.state.setQuery(e),this._change(),this},r.prototype.clearRefinements=function(e){return this.state=this.state.clearRefinements(e),this._change(),this},r.prototype.clearTags=function(){return this.state=this.state.clearTags(),this._change(),this},r.prototype.addDisjunctiveFacetRefinement=function(e,t){return this.state=this.state.addDisjunctiveFacetRefinement(e,t),this._change(),this},r.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},r.prototype.addNumericRefinement=function(e,t,n){return this.state=this.state.addNumericRefinement(e,t,n),this._change(),this},r.prototype.addFacetRefinement=function(e,t){return this.state=this.state.addFacetRefinement(e,t),this._change(),this},r.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},r.prototype.addFacetExclusion=function(e,t){return this.state=this.state.addExcludeRefinement(e,t),this._change(),this},r.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},r.prototype.addTag=function(e){return this.state=this.state.addTagRefinement(e),this._change(),this},r.prototype.removeNumericRefinement=function(e,t,n){return this.state=this.state.removeNumericRefinement(e,t,n),this._change(),this},r.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this.state=this.state.removeDisjunctiveFacetRefinement(e,t),this._change(),this},r.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},r.prototype.removeFacetRefinement=function(e,t){return this.state=this.state.removeFacetRefinement(e,t),this._change(),this},r.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},r.prototype.removeFacetExclusion=function(e,t){return this.state=this.state.removeExcludeRefinement(e,t),this._change(),this},r.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},r.prototype.removeTag=function(e){return this.state=this.state.removeTagRefinement(e),this._change(),this},r.prototype.toggleFacetExclusion=function(e,t){return this.state=this.state.toggleExcludeFacetRefinement(e,t),this._change(),this},r.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},r.prototype.toggleRefinement=function(e,t){return this.state=this.state.toggleRefinement(e,t),this._change(),this},r.prototype.toggleRefine=function(){return this.toggleRefinement.apply(this,arguments)},r.prototype.toggleTag=function(e){return this.state=this.state.toggleTagRefinement(e),this._change(),this},r.prototype.nextPage=function(){return this.setCurrentPage(this.state.page+1)},r.prototype.previousPage=function(){return this.setCurrentPage(this.state.page-1)},r.prototype.setCurrentPage=function(e){if(0>e)throw new Error("Page requested below 0.");return this.state=this.state.setPage(e),this._change(),this},r.prototype.setIndex=function(e){return this.state=this.state.setIndex(e),this._change(),this},r.prototype.setQueryParameter=function(e,t){var n=this.state.setQueryParameter(e,t);return this.state===n?this:(this.state=n,this._change(),this)},r.prototype.setState=function(e){return this.state=new o(e),this._change(),this},r.prototype.getState=function(e){return void 0===e?this.state:this.state.filter(e)},r.prototype.getStateAsQueryString=function(e){var t=e&&e.filters||["query","attribute:*"],n=this.getState(t);return h.getQueryStringFromState(n,e)},r.getConfigurationFromQueryString=h.getStateFromQueryString,r.getForeignConfigurationInQueryString=h.getUnrecognizedParametersInQueryString,r.prototype.setStateFromQueryString=function(e,t){var n=t&&t.triggerChange||!1,r=h.getStateFromQueryString(e,t),o=this.state.setQueryParameters(r);n?this.setState(o):this.overrideStateWithoutTriggeringChangeEvent(o)},r.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new o(e),this},r.prototype.isRefined=function(e,t){if(this.state.isConjunctiveFacet(e))return this.state.isFacetRefined(e,t);if(this.state.isDisjunctiveFacet(e))return this.state.isDisjunctiveFacetRefined(e,t);throw new Error(e+" is not properly defined in this helper configuration(use the facets or disjunctiveFacets keys to configure it)")},r.prototype.hasRefinements=function(e){return f(this.state.getNumericRefinements(e))?this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):this.state.isHierarchicalFacet(e)?this.state.isHierarchicalFacetRefined(e):!1:!0},r.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},r.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},r.prototype.hasTag=function(e){return this.state.isTagRefined(e)},r.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},r.prototype.getIndex=function(){return this.state.index},r.prototype.getCurrentPage=function(){return this.state.page},r.prototype.getTags=function(){return this.state.tagRefinements},r.prototype.getQueryParameter=function(e){return this.state.getQueryParameter(e)},r.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e)){var n=this.state.getConjunctiveRefinements(e);c(n,function(e){t.push({value:e,type:"conjunctive"})});var r=this.state.getExcludeRefinements(e);c(r,function(e){t.push({value:e,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(e)){var o=this.state.getDisjunctiveRefinements(e);c(o,function(e){t.push({value:e,type:"disjunctive"})})}var i=this.state.getNumericRefinements(e);return c(i,function(e,n){t.push({value:e,operator:n,type:"numeric"})}),t},r.prototype.getHierarchicalFacetBreadcrumb=function(e){return l(this.state.getHierarchicalRefinement(e)[0].split(this.state._getHierarchicalFacetSeparator(this.state.getHierarchicalFacetByName(e))),function(e){return d(e)})},r.prototype._search=function(){var e=this.state,t=a._getQueries(e.index,e);this.emit("search",e,this.lastResults),this.client.search(t,p(this._handleResponse,this,e,this._queryId++))},r.prototype._handleResponse=function(e,t,n,r){if(!(t<this._lastQueryIdReceived)){if(this._lastQueryIdReceived=t,n)return void this.emit("error",n);var o=this.lastResults=new i(e,r);this.emit("result",o,e)}},r.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},r.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0},r.prototype._change=function(){this.emit("change",this.state,this.lastResults)},e.exports=r},function(e,t,n){"use strict";function r(e){var t=e?r._parseNumbers(e):{};this.index=t.index||"",this.query=t.query||"",this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{},this.numericFilters=t.numericFilters,this.tagFilters=t.tagFilters,this.hitsPerPage=t.hitsPerPage,this.maxValuesPerFacet=t.maxValuesPerFacet,this.page=t.page||0,this.queryType=t.queryType,this.typoTolerance=t.typoTolerance,this.minWordSizefor1Typo=t.minWordSizefor1Typo,this.minWordSizefor2Typos=t.minWordSizefor2Typos, this.minProximity=t.minProximity,this.allowTyposOnNumericTokens=t.allowTyposOnNumericTokens,this.ignorePlurals=t.ignorePlurals,this.restrictSearchableAttributes=t.restrictSearchableAttributes,this.advancedSyntax=t.advancedSyntax,this.analytics=t.analytics,this.analyticsTags=t.analyticsTags,this.synonyms=t.synonyms,this.replaceSynonymsInHighlight=t.replaceSynonymsInHighlight,this.optionalWords=t.optionalWords,this.removeWordsIfNoResults=t.removeWordsIfNoResults,this.attributesToRetrieve=t.attributesToRetrieve,this.attributesToHighlight=t.attributesToHighlight,this.highlightPreTag=t.highlightPreTag,this.highlightPostTag=t.highlightPostTag,this.attributesToSnippet=t.attributesToSnippet,this.getRankingInfo=t.getRankingInfo,this.distinct=t.distinct,this.aroundLatLng=t.aroundLatLng,this.aroundLatLngViaIP=t.aroundLatLngViaIP,this.aroundRadius=t.aroundRadius,this.minimumAroundRadius=t.minimumAroundRadius,this.aroundPrecision=t.aroundPrecision,this.insideBoundingBox=t.insideBoundingBox,this.insidePolygon=t.insidePolygon,this.offset=t.offset,this.length=t.length,a(t,function(e,t){if(!this.hasOwnProperty(t)){var n="Unsupported SearchParameter: `"+t+"` (this will throw in the next version)";window?window.console&&window.console.error(n):console.error(n)}},this)}var o=n(25),i=n(75),a=n(82),s=n(17),u=n(84),c=n(108),l=n(111),p=n(115),f=n(121),d=n(36),h=n(124),m=n(126),v=n(125),g=n(127),y=n(28),b=n(128),w=n(132),x=n(133),P=n(53),_=n(138),C=n(139),E=n(140);r.PARAMETERS=o(new r),r._parseNumbers=function(e){var t={},n=["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"];if(s(n,function(n){var r=e[n];v(r)&&(t[n]=parseFloat(e[n]))}),e.numericRefinements){var r={};s(e.numericRefinements,function(e,t){r[t]={},s(e,function(e,n){var o=c(e,function(e){return d(e)?c(e,function(e){return v(e)?parseFloat(e):e}):v(e)?parseFloat(e):e});r[t][n]=o})}),t.numericRefinements=r}return P({},e,t)},r.make=function(e){var t=new r(e);return _(t)},r.validate=function(e,t){var n=t||{},r=o(n),i=u(r,function(t){return!e.hasOwnProperty(t)});return 1===i.length?new Error("Property "+i[0]+" is not defined on SearchParameters (see http://algolia.github.io/algoliasearch-helper-js/docs/SearchParameters.html)"):i.length>1?new Error("Properties "+i.join(" ")+" are not defined on SearchParameters (see http://algolia.github.io/algoliasearch-helper-js/docs/SearchParameters.html)"):e.tagFilters&&n.tagRefinements&&n.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&n.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&n.numericRefinements&&!h(n.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):!h(e.numericRefinements)&&n.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},r.prototype={constructor:r,clearRefinements:function(e){var t=E.clearRefinement;return this.setQueryParameters({page:0,numericRefinements:this._clearNumericRefinements(e),facetsRefinements:t(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:t(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:t(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:t(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")})},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({page:0,tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e,page:0})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e,page:0})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e,page:0})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e,page:0})},addNumericRefinement:function(e,t,n){var r;if(g(n))r=n;else if(v(n))r=parseFloat(n);else{if(!d(n))throw new Error("The value should be a number, a parseable string or an array of those.");r=c(n,function(e){return v(e)?parseFloat(e):e})}if(this.isNumericRefined(e,t,r))return this;var o=P({},this.numericRefinements);return o[e]=P({},o[e]),o[e][t]?(o[e][t]=o[e][t].slice(),o[e][t].push(r)):o[e][t]=[r],this.setQueryParameters({page:0,numericRefinements:o})},getConjunctiveRefinements:function(e){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,n){return void 0!==n?this.isNumericRefined(e,t,n)?this.setQueryParameters({page:0,numericRefinements:this._clearNumericRefinements(function(r,o){return o===e&&r.op===t&&r.val===n})}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({page:0,numericRefinements:this._clearNumericRefinements(function(n,r){return r===e&&n.op===t})}):this:this.isNumericRefined(e)?this.setQueryParameters({page:0,numericRefinements:this._clearNumericRefinements(function(t,n){return n===e})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){return m(e)?{}:v(e)?p(this.numericRefinements,e):y(e)?l(this.numericRefinements,function(t,n,r){var o={};return s(n,function(t,n){var i=[];s(t,function(t){var o=e({val:t,op:n},r,"numeric");o||i.push(t)}),h(i)||(o[n]=i)}),h(o)||(t[r]=o),t},{}):void 0},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return E.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({page:0,facetsRefinements:E.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return E.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({page:0,facetsExcludes:E.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return E.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({page:0,disjunctiveFacetsRefinements:E.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={page:0,tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return E.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({page:0,facetsRefinements:E.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return E.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({page:0,facetsExcludes:E.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return E.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({page:0,disjunctiveFacetsRefinements:E.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={page:0,tagRefinements:u(this.tagRefinements,function(t){return t!==e})};return this.setQueryParameters(t)},toggleRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({page:0,facetsRefinements:E.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({page:0,facetsExcludes:E.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({page:0,disjunctiveFacetsRefinements:E.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),r={},o=void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n));return r[e]=o?-1===t.indexOf(n)?[]:[t.slice(0,t.lastIndexOf(n))]:[t],this.setQueryParameters({page:0,hierarchicalFacetsRefinements:x({},r,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return f(this.disjunctiveFacets,e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return f(this.facets,e)>-1},isFacetRefined:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return E.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return E.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return E.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this.getHierarchicalRefinement(e);return t?-1!==f(n,t):n.length>0},isNumericRefined:function(e,t,n){if(m(n)&&m(t))return!!this.numericRefinements[e];if(m(n))return this.numericRefinements[e]&&!m(this.numericRefinements[e][t]);var r=parseFloat(n);return this.numericRefinements[e]&&!m(this.numericRefinements[e][t])&&-1!==f(this.numericRefinements[e][t],r)},isTagRefined:function(e){return-1!==f(this.tagRefinements,e)},getRefinedDisjunctiveFacets:function(){var e=i(o(this.numericRefinements),this.disjunctiveFacets);return o(this.disjunctiveFacetsRefinements).concat(e).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){return i(w(this.hierarchicalFacets,"name"),o(this.hierarchicalFacetsRefinements))},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return u(this.disjunctiveFacets,function(t){return-1===f(e,t)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={};return a(this,function(n,r){-1===f(e,r)&&void 0!==n&&(t[r]=n)}),t},getQueryParameter:function(e){if(!this.hasOwnProperty(e))throw new Error("Parameter '"+e+"' is not an attribute of SearchParameters (http://algolia.github.io/algoliasearch-helper-js/docs/SearchParameters.html)");return this[e]},setQueryParameter:function(e,t){if(this[e]===t)return this;var n={};return n[e]=t,this.setQueryParameters(n)},setQueryParameters:function(e){var t=r.validate(this,e);if(t)throw t;var n=r._parseNumbers(e);return this.mutateMe(function(t){var r=o(e);return s(r,function(e){t[e]=n[e]}),t})},filter:function(e){return C(this,e)},mutateMe:function(e){var t=new this.constructor(this);return e(t,this),_(t)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},getHierarchicalFacetByName:function(e){return b(this.hierarchicalFacets,{name:e})}},e.exports=r},function(e,t,n){var r=n(76),o=n(78),i=n(79),a=n(30),s=n(61),u=s(function(e){for(var t=e.length,n=t,s=Array(h),u=r,c=!0,l=[];n--;){var p=e[n]=a(p=e[n])?p:[];s[n]=c&&p.length>=120?i(n&&p):null}var f=e[0],d=-1,h=f?f.length:0,m=s[0];e:for(;++d<h;)if(p=f[d],(m?o(m,p):u(l,p,0))<0){for(var n=t;--n;){var v=s[n];if((v?o(v,p):u(e[n],p,0))<0)continue e}m&&m.push(p),l.push(p)}return l});e.exports=u},function(e,t,n){function r(e,t,n){if(t!==t)return o(e,n);for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var o=n(77);e.exports=r},function(e){function t(e,t,n){for(var r=e.length,o=t+(n?0:-1);n?o--:++o<r;){var i=e[o];if(i!==i)return o}return-1}e.exports=t},function(e,t,n){function r(e,t){var n=e.data,r="string"==typeof t||o(t)?n.set.has(t):n.hash[t];return r?0:-1}var o=n(24);e.exports=r},function(e,t,n){(function(t){function r(e){return s&&a?new o(e):null}var o=n(80),i=n(26),a=i(t,"Set"),s=i(Object,"create");e.exports=r}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new a};t--;)this.push(e[t])}var o=n(81),i=n(26),a=i(t,"Set"),s=i(Object,"create");r.prototype.push=o,e.exports=r}).call(t,function(){return this}())},function(e,t,n){function r(e){var t=this.data;"string"==typeof e||o(e)?t.set.add(e):t.hash[e]=!0}var o=n(24);e.exports=r},function(e,t,n){var r=n(20),o=n(83),i=o(r);e.exports=i},function(e,t,n){function r(e){return function(t,n,r){return("function"!=typeof n||void 0!==r)&&(n=o(n,r,3)),e(t,n)}}var o=n(41);e.exports=r},function(e,t,n){function r(e,t,n){var r=s(e)?o:a;return t=i(t,n,3),r(e,t)}var o=n(85),i=n(86),a=n(107),s=n(36);e.exports=r},function(e){function t(e,t){for(var n=-1,r=e.length,o=-1,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[++o]=a)}return i}e.exports=t},function(e,t,n){function r(e,t,n){var r=typeof e;return"function"==r?void 0===t?e:a(e,t,n):null==e?s:"object"==r?o(e):void 0===t?u(e):i(e,t)}var o=n(87),i=n(98),a=n(41),s=n(42),u=n(105);e.exports=r},function(e,t,n){function r(e){var t=i(e);if(1==t.length&&t[0][2]){var n=t[0][0],r=t[0][1];return function(e){return null==e?!1:e[n]===r&&(void 0!==r||n in a(e))}}return function(e){return o(e,t)}}var o=n(88),i=n(95),a=n(23);e.exports=r},function(e,t,n){function r(e,t,n){var r=t.length,a=r,s=!n;if(null==e)return!a;for(e=i(e);r--;){var u=t[r];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++r<a;){u=t[r];var c=u[0],l=e[c],p=u[1];if(s&&u[2]){if(void 0===l&&!(c in e))return!1}else{var f=n?n(l,p,c):void 0;if(!(void 0===f?o(p,l,n,!0):f))return!1}}return!0}var o=n(89),i=n(23);e.exports=r},function(e,t,n){function r(e,t,n,s,u,c){return e===t?!0:null==e||null==t||!i(e)&&!a(t)?e!==e&&t!==t:o(e,t,r,n,s,u,c)}var o=n(90),i=n(24),a=n(29);e.exports=r},function(e,t,n){function r(e,t,n,r,f,m,v){var g=s(e),y=s(t),b=l,w=l;g||(b=h.call(e),b==c?b=p:b!=p&&(g=u(e))),y||(w=h.call(t),w==c?w=p:w!=p&&(y=u(t)));var x=b==p,P=w==p,_=b==w;if(_&&!g&&!x)return i(e,t,b);if(!f){var C=x&&d.call(e,"__wrapped__"),E=P&&d.call(t,"__wrapped__");if(C||E)return n(C?e.value():e,E?t.value():t,r,f,m,v)}if(!_)return!1;m||(m=[]),v||(v=[]);for(var R=m.length;R--;)if(m[R]==e)return v[R]==t;m.push(e),v.push(t);var T=(g?o:a)(e,t,n,r,f,m,v);return m.pop(),v.pop(),T}var o=n(91),i=n(93),a=n(94),s=n(36),u=n(58),c="[object Arguments]",l="[object Array]",p="[object Object]",f=Object.prototype,d=f.hasOwnProperty,h=f.toString;e.exports=r},function(e,t,n){function r(e,t,n,r,i,a,s){var u=-1,c=e.length,l=t.length;if(c!=l&&!(i&&l>c))return!1;for(;++u<c;){var p=e[u],f=t[u],d=r?r(i?f:p,i?p:f,u):void 0;if(void 0!==d){if(d)continue;return!1}if(i){if(!o(t,function(e){return p===e||n(p,e,r,i,a,s)}))return!1}else if(p!==f&&!n(p,f,r,i,a,s))return!1}return!0}var o=n(92);e.exports=r},function(e){function t(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}e.exports=t},function(e){function t(e,t,u){switch(u){case n:case r:return+e==+t;case o:return e.name==t.name&&e.message==t.message;case i:return e!=+e?t!=+t:e==+t;case a:case s:return e==t+""}return!1}var n="[object Boolean]",r="[object Date]",o="[object Error]",i="[object Number]",a="[object RegExp]",s="[object String]";e.exports=t},function(e,t,n){function r(e,t,n,r,i,s,u){var c=o(e),l=c.length,p=o(t),f=p.length;if(l!=f&&!i)return!1;for(var d=l;d--;){var h=c[d];if(!(i?h in t:a.call(t,h)))return!1}for(var m=i;++d<l;){h=c[d];var v=e[h],g=t[h],y=r?r(i?g:v,i?v:g,h):void 0;if(!(void 0===y?n(v,g,r,i,s,u):y))return!1;m||(m="constructor"==h)}if(!m){var b=e.constructor,w=t.constructor;if(b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w))return!1}return!0}var o=n(25),i=Object.prototype,a=i.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){for(var t=i(e),n=t.length;n--;)t[n][2]=o(t[n][1]);return t}var o=n(96),i=n(97);e.exports=r},function(e,t,n){function r(e){return e===e&&!o(e)}var o=n(24);e.exports=r},function(e,t,n){function r(e){e=i(e);for(var t=-1,n=o(e),r=n.length,a=Array(r);++t<r;){var s=n[t];a[t]=[s,e[s]]}return a}var o=n(25),i=n(23);e.exports=r},function(e,t,n){function r(e,t){var n=s(e),r=u(e)&&c(t),d=e+"";return e=f(e),function(s){if(null==s)return!1;var u=d;if(s=p(s),!(!n&&r||u in s)){if(s=1==e.length?s:o(s,a(e,0,-1)),null==s)return!1;u=l(e),s=p(s)}return s[u]===t?void 0!==t||u in s:i(t,s[u],void 0,!0)}}var o=n(99),i=n(89),a=n(100),s=n(36),u=n(101),c=n(96),l=n(102),p=n(23),f=n(103);e.exports=r},function(e,t,n){function r(e,t,n){if(null!=e){void 0!==n&&n in o(e)&&(t=[n]);for(var r=0,i=t.length;null!=e&&i>r;)e=e[t[r++]];return r&&r==i?e:void 0}}var o=n(23);e.exports=r},function(e){function t(e,t,n){var r=-1,o=e.length;t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),n=void 0===n||n>o?o:+n||0,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}e.exports=t},function(e,t,n){function r(e,t){var n=typeof e;if("string"==n&&s.test(e)||"number"==n)return!0;if(o(e))return!1;var r=!a.test(e);return r||null!=t&&e in i(t)}var o=n(36),i=n(23),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=r},function(e){function t(e){var t=e?e.length:0;return t?e[t-1]:void 0}e.exports=t},function(e,t,n){function r(e){if(i(e))return e;var t=[];return o(e).replace(a,function(e,n,r,o){t.push(r?o.replace(s,"$1"):n||e)}),t}var o=n(104),i=n(36),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;e.exports=r},function(e){function t(e){return null==e?"":e+""}e.exports=t},function(e,t,n){function r(e){return a(e)?o(e):i(e)}var o=n(32),i=n(106),a=n(101);e.exports=r},function(e,t,n){function r(e){var t=e+"";return e=i(e),function(n){return o(n,e,t)}}var o=n(99),i=n(103);e.exports=r},function(e,t,n){function r(e,t){var n=[];return o(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}var o=n(19);e.exports=r},function(e,t,n){function r(e,t,n){var r=s(e)?o:a;return t=i(t,n,3),r(e,t)}var o=n(109),i=n(86),a=n(110),s=n(36);e.exports=r},function(e){function t(e,t){for(var n=-1,r=e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}e.exports=t},function(e,t,n){function r(e,t){var n=-1,r=i(e)?Array(e.length):[];return o(e,function(e,o,i){r[++n]=t(e,o,i)}),r}var o=n(19),i=n(30);e.exports=r},function(e,t,n){var r=n(112),o=n(19),i=n(113),a=i(r,o);e.exports=a},function(e){function t(e,t,n,r){var o=-1,i=e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}e.exports=t},function(e,t,n){function r(e,t){return function(n,r,s,u){var c=arguments.length<3;return"function"==typeof r&&void 0===u&&a(n)?e(n,r,s,c):i(n,o(r,u,4),s,c,t)}}var o=n(86),i=n(114),a=n(36);e.exports=r},function(e){function t(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}e.exports=t},function(e,t,n){var r=n(109),o=n(116),i=n(117),a=n(41),s=n(38),u=n(119),c=n(120),l=n(61),p=l(function(e,t){if(null==e)return{};if("function"!=typeof t[0]){var t=r(i(t),String);return u(e,o(s(e),t))}var n=a(t[0],t[1],3);return c(e,function(e,t,r){return!n(e,t,r)})});e.exports=p},function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var u=-1,c=o,l=!0,p=l&&t.length>=s?a(t):null,f=t.length;p&&(c=i,l=!1,t=p);e:for(;++u<n;){var d=e[u];if(l&&d===d){for(var h=f;h--;)if(t[h]===d)continue e;r.push(d)}else c(t,d,0)<0&&r.push(d)}return r}var o=n(76),i=n(78),a=n(79),s=200;e.exports=r},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var l=-1,p=e.length;++l<p;){var f=e[l];u(f)&&s(f)&&(n||a(f)||i(f))?t?r(f,t,n,c):o(c,f):n||(c[c.length]=f)}return c}var o=n(118),i=n(35),a=n(36),s=n(30),u=n(29);e.exports=r},function(e){function t(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}e.exports=t},function(e,t,n){function r(e,t){e=o(e);for(var n=-1,r=t.length,i={};++n<r;){var a=t[n];a in e&&(i[a]=e[a])}return i}var o=n(23);e.exports=r},function(e,t,n){function r(e,t){var n={};return o(e,function(e,r,o){t(e,r,o)&&(n[r]=e)}),n}var o=n(57);e.exports=r},function(e,t,n){function r(e,t,n){var r=e?e.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?a(r+n,0):n;else if(n){var s=i(e,t);return r>s&&(t===t?t===e[s]:e[s]!==e[s])?s:-1}return o(e,t,n||0)}var o=n(76),i=n(122),a=Math.max;e.exports=r},function(e,t,n){function r(e,t,n){var r=0,a=e?e.length:r;if("number"==typeof t&&t===t&&s>=a){for(;a>r;){var u=r+a>>>1,c=e[u];(n?t>=c:t>c)&&null!==c?r=u+1:a=u}return a}return o(e,t,i,n)}var o=n(123),i=n(42),a=4294967295,s=a>>>1;e.exports=r},function(e){function t(e,t,o,a){t=o(t);for(var s=0,u=e?e.length:0,c=t!==t,l=null===t,p=void 0===t;u>s;){var f=n((s+u)/2),d=o(e[f]),h=void 0!==d,m=d===d;if(c)var v=m||a;else v=l?m&&h&&(a||null!=d):p?m&&(a||h):null==d?!1:a?t>=d:t>d;v?s=f+1:u=f}return r(u,i)}var n=Math.floor,r=Math.min,o=4294967295,i=o-1;e.exports=t},function(e,t,n){function r(e){return null==e?!0:a(e)&&(i(e)||c(e)||o(e)||u(e)&&s(e.splice))?!e.length:!l(e).length}var o=n(35),i=n(36),a=n(30),s=n(28),u=n(29),c=n(125),l=n(25);e.exports=r},function(e,t,n){function r(e){return"string"==typeof e||o(e)&&s.call(e)==i}var o=n(29),i="[object String]",a=Object.prototype,s=a.toString;e.exports=r},function(e){function t(e){return void 0===e}e.exports=t},function(e,t,n){function r(e){return"number"==typeof e||o(e)&&s.call(e)==i}var o=n(29),i="[object Number]",a=Object.prototype,s=a.toString;e.exports=r},function(e,t,n){var r=n(19),o=n(129),i=o(r);e.exports=i},function(e,t,n){function r(e,t){return function(n,r,u){if(r=o(r,u,3),s(n)){var c=a(n,r,t);return c>-1?n[c]:void 0}return i(n,r,e)}}var o=n(86),i=n(130),a=n(131),s=n(36);e.exports=r},function(e){function t(e,t,n,r){var o;return n(e,function(e,n,i){return t(e,n,i)?(o=r?n:e,!1):void 0}),o}e.exports=t},function(e){function t(e,t,n){for(var r=e.length,o=n?r:-1;n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}e.exports=t},function(e,t,n){function r(e,t){return o(e,i(t))}var o=n(108),i=n(105);e.exports=r},function(e,t,n){var r=n(134),o=n(136),i=n(137),a=i(r,o);e.exports=a},function(e,t,n){var r=n(135),o=n(46),i=n(60),a=i(function(e,t,n){return n?r(e,t,n):o(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,i=o(t),a=i.length;++r<a;){var s=i[r],u=e[s],c=n(u,t[s],s,e,t);(c===c?c===u:u!==u)&&(void 0!==u||s in e)||(e[s]=c)}return e}var o=n(25);e.exports=r},function(e){function t(e,t){return void 0===e?t:e}e.exports=t},function(e,t,n){function r(e,t){return o(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var o=n(61);e.exports=r},function(e,t,n){"use strict";var r=n(17),o=n(42),i=n(24),a=function(e){return i(e)?(r(e,a),Object.isFrozen(e)||Object.freeze(e),e):e};e.exports=Object.freeze?a:o},function(e,t,n){"use strict";function r(e,t){var n={},r=i(t,function(e){return-1!==e.indexOf("attribute:")}),c=a(r,function(e){return e.split(":")[1]});-1===u(c,"*")?o(c,function(t){e.isConjunctiveFacet(t)&&e.isFacetRefined(t)&&(n.facetsRefinements||(n.facetsRefinements={}),n.facetsRefinements[t]=e.facetsRefinements[t]),e.isDisjunctiveFacet(t)&&e.isDisjunctiveFacetRefined(t)&&(n.disjunctiveFacetsRefinements||(n.disjunctiveFacetsRefinements={}),n.disjunctiveFacetsRefinements[t]=e.disjunctiveFacetsRefinements[t]);var r=e.getNumericRefinements(t);s(r)||(n.numericRefinements||(n.numericRefinements={}),n.numericRefinements[t]=e.numericRefinements[t])}):(s(e.numericRefinements)||(n.numericRefinements=e.numericRefinements),s(e.facetsRefinements)||(n.facetsRefinements=e.facetsRefinements),s(e.disjunctiveFacetsRefinements)||(n.disjunctiveFacetsRefinements=e.disjunctiveFacetsRefinements),s(e.hierarchicalFacetsRefinements)||(n.hierarchicalFacetsRefinements=e.hierarchicalFacetsRefinements));var l=i(t,function(e){return-1===e.indexOf("attribute:")});return o(l,function(t){n[t]=e[t]}),n}var o=n(17),i=n(84),a=n(108),s=n(124),u=n(121);e.exports=r},function(e,t,n){"use strict";var r=n(126),o=n(125),i=n(28),a=n(124),s=n(133),u=n(111),c=n(84),l=n(115),p={addRefinement:function(e,t,n){if(p.isRefined(e,t,n))return e;var r=""+n,o=e[t]?e[t].concat(r):[r],i={};return i[t]=o,s({},i,e)},removeRefinement:function(e,t,n){if(r(n))return p.clearRefinement(e,t);var o=""+n;return p.clearRefinement(e,function(e,n){return t===n&&o===e})},toggleRefinement:function(e,t,n){if(r(n))throw new Error("toggleRefinement should be used with a value");return p.isRefined(e,t,n)?p.removeRefinement(e,t,n):p.addRefinement(e,t,n)},clearRefinement:function(e,t,n){return r(t)?{}:o(t)?l(e,t):i(t)?u(e,function(e,r,o){var i=c(r,function(e){return!t(e,o,n)});return a(i)||(e[o]=i),e},{}):void 0},isRefined:function(e,t,o){var i=n(121),a=!!e[t]&&e[t].length>0;if(r(o)||!a)return a;var s=""+o;return-1!==i(e[t],s)}};e.exports=p},function(e,t,n){"use strict";function r(e){var t={};return p(e,function(e,n){t[e]=n}),t}function o(e,t,n){t&&t[n]&&(e.stats=t[n])}function i(e,t){return v(e,function(e){return g(e.attributes,t)})}function a(e,t){var n=t.results[0];this.query=n.query,this.hits=n.hits,this.index=n.index,this.hitsPerPage=n.hitsPerPage,this.nbHits=n.nbHits,this.nbPages=n.nbPages,this.page=n.page,this.processingTimeMS=m(t.results,"processingTimeMS"),this.disjunctiveFacets=[],this.hierarchicalFacets=y(e.hierarchicalFacets,function(){return[]}),this.facets=[];var a=e.getRefinedDisjunctiveFacets(),s=r(e.facets),u=r(e.disjunctiveFacets),c=1;p(n.facets,function(t,r){var a=i(e.hierarchicalFacets,r);if(a)this.hierarchicalFacets[h(e.hierarchicalFacets,{name:a.name})].push({attribute:r,data:t,exhaustive:n.exhaustiveFacetsCount});else{var c,l=-1!==d(e.disjunctiveFacets,r),p=-1!==d(e.facets,r);l&&(c=u[r],this.disjunctiveFacets[c]={name:r,data:t,exhaustive:n.exhaustiveFacetsCount},o(this.disjunctiveFacets[c],n.facets_stats,r)),p&&(c=s[r],this.facets[c]={name:r,data:t,exhaustive:n.exhaustiveFacetsCount},o(this.facets[c],n.facets_stats,r))}},this),p(a,function(r){var i=t.results[c],a=e.getHierarchicalFacetByName(r);p(i.facets,function(t,r){var s;if(a){s=h(e.hierarchicalFacets,{name:a.name});var c=h(this.hierarchicalFacets[s],{attribute:r});if(-1===c)return;this.hierarchicalFacets[s][c].data=x({},this.hierarchicalFacets[s][c].data,t)}else{s=u[r];var l=n.facets&&n.facets[r]||{};this.disjunctiveFacets[s]={name:r,data:w({},t,l),exhaustive:i.exhaustiveFacetsCount},o(this.disjunctiveFacets[s],i.facets_stats,r),e.disjunctiveFacetsRefinements[r]&&p(e.disjunctiveFacetsRefinements[r],function(t){!this.disjunctiveFacets[s].data[t]&&d(e.disjunctiveFacetsRefinements[r],t)>-1&&(this.disjunctiveFacets[s].data[t]=0)},this)}},this),c++},this),p(e.getRefinedHierarchicalFacets(),function(n){var r=e.getHierarchicalFacetByName(n),o=e.getHierarchicalRefinement(n);if(!(0===o.length||o[0].split(e._getHierarchicalFacetSeparator(r)).length<2)){var i=t.results[c];p(i.facets,function(t,n){var i=h(e.hierarchicalFacets,{name:r.name}),a=h(this.hierarchicalFacets[i],{attribute:n});if(-1!==a){var s={};if(o.length>0){var u=o[0].split(e._getHierarchicalFacetSeparator(r))[0];s[u]=this.hierarchicalFacets[i][a].data[u]}this.hierarchicalFacets[i][a].data=w(s,t,this.hierarchicalFacets[i][a].data)}},this),c++}},this),p(e.facetsExcludes,function(e,t){var r=s[t];this.facets[r]={name:t,data:n.facets[t],exhaustive:n.exhaustiveFacetsCount},p(e,function(e){this.facets[r]=this.facets[r]||{name:t},this.facets[r].data=this.facets[r].data||{},this.facets[r].data[e]=0},this)},this),this.hierarchicalFacets=y(this.hierarchicalFacets,T(e)),this.facets=f(this.facets),this.disjunctiveFacets=f(this.disjunctiveFacets),this._state=e}function s(e,t){var n={name:t};if(e._state.isConjunctiveFacet(t)){var r=v(e.facets,n);return r?y(r.data,function(n,r){return{name:r,count:n,isRefined:e._state.isFacetRefined(t,r)}}):[]}if(e._state.isDisjunctiveFacet(t)){var o=v(e.disjunctiveFacets,n);return o?y(o.data,function(n,r){return{name:r,count:n,isRefined:e._state.isDisjunctiveFacetRefined(t,r)}}):[]}return e._state.isHierarchicalFacet(t)?v(e.hierarchicalFacets,n):void 0}function u(e,t){if(!t.data||0===t.data.length)return t;var n=y(t.data,C(u,e)),r=e(n),o=x({},t,{data:r});return o}function c(e,t){return t.sort(e)}function l(e,t){var n=v(e,{name:t});return n&&n.stats}var p=n(17),f=n(142),d=n(121),h=n(143),m=n(145),v=n(128),g=n(152),y=n(108),b=n(153),w=n(133),x=n(53),P=n(36),_=n(28),C=n(158),E=n(185),R=n(186),T=n(187);a.prototype.getFacetByName=function(e){var t={name:e};return v(this.facets,t)||v(this.disjunctiveFacets,t)||v(this.hierarchicalFacets,t)},a.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],a.prototype.getFacetValues=function(e,t){var n=s(this,e);if(!n)throw new Error(e+" is not a retrieved facet.");var r=w({},t,{sortBy:a.DEFAULT_SORT});if(P(r.sortBy)){var o=R(r.sortBy);return P(n)?b(n,o[0],o[1]):u(E(b,o[0],o[1]),n)}if(_(r.sortBy))return P(n)?n.sort(r.sortBy):u(C(c,r.sortBy),n);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},a.prototype.getFacetStats=function(e){if(this._state.isConjunctiveFacet(e))return l(this.facets,e); if(this._state.isDisjunctiveFacet(e))return l(this.disjunctiveFacets,e);throw new Error(e+" is not present in `facets` or `disjunctiveFacets`")},e.exports=a},function(e){function t(e){for(var t=-1,n=e?e.length:0,r=-1,o=[];++t<n;){var i=e[t];i&&(o[++r]=i)}return o}e.exports=t},function(e,t,n){var r=n(144),o=r();e.exports=o},function(e,t,n){function r(e){return function(t,n,r){return t&&t.length?(n=o(n,r,3),i(t,n,e)):-1}}var o=n(86),i=n(131);e.exports=r},function(e,t,n){e.exports=n(146)},function(e,t,n){function r(e,t,n){return n&&u(e,t,n)&&(t=void 0),t=i(t,n,3),1==t.length?o(s(e)?e:c(e),t):a(e,t)}var o=n(147),i=n(86),a=n(148),s=n(36),u=n(52),c=n(149);e.exports=r},function(e){function t(e,t){for(var n=e.length,r=0;n--;)r+=+t(e[n])||0;return r}e.exports=t},function(e,t,n){function r(e,t){var n=0;return o(e,function(e,r,o){n+=+t(e,r,o)||0}),n}var o=n(19);e.exports=r},function(e,t,n){function r(e){return null==e?[]:o(e)?i(e)?e:Object(e):a(e)}var o=n(30),i=n(24),a=n(150);e.exports=r},function(e,t,n){function r(e){return o(e,i(e))}var o=n(151),i=n(25);e.exports=r},function(e){function t(e,t){for(var n=-1,r=t.length,o=Array(r);++n<r;)o[n]=e[t[n]];return o}e.exports=t},function(e,t,n){function r(e,t,n,r){var f=e?i(e):0;return u(f)||(e=l(e),f=e.length),n="number"!=typeof n||r&&s(t,n,r)?0:0>n?p(f+n,0):n||0,"string"==typeof e||!a(e)&&c(e)?f>=n&&e.indexOf(t,n)>-1:!!f&&o(e,t,n)>-1}var o=n(76),i=n(31),a=n(36),s=n(52),u=n(33),c=n(125),l=n(150),p=Math.max;e.exports=r},function(e,t,n){function r(e,t,n,r){return null==e?[]:(r&&a(t,n,r)&&(n=void 0),i(t)||(t=null==t?[]:[t]),i(n)||(n=null==n?[]:[n]),o(e,t,n))}var o=n(154),i=n(36),a=n(52);e.exports=r},function(e,t,n){function r(e,t,n){var r=-1;t=o(t,function(e){return i(e)});var c=a(e,function(e){var n=o(t,function(t){return t(e)});return{criteria:n,index:++r,value:e}});return s(c,function(e,t){return u(e,t,n)})}var o=n(109),i=n(86),a=n(110),s=n(155),u=n(156);e.exports=r},function(e){function t(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}e.exports=t},function(e,t,n){function r(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,s=i.length,u=n.length;++r<s;){var c=o(i[r],a[r]);if(c){if(r>=u)return c;var l=n[r];return c*("asc"===l||l===!0?1:-1)}}return e.index-t.index}var o=n(157);e.exports=r},function(e){function t(e,t){if(e!==t){var n=null===e,r=void 0===e,o=e===e,i=null===t,a=void 0===t,s=t===t;if(e>t&&!i||!o||n&&!a&&s||r&&s)return 1;if(t>e&&!n||!s||i&&!r&&o||a&&o)return-1}return 0}e.exports=t},function(e,t,n){var r=n(159),o=32,i=r(o);i.placeholder={},e.exports=i},function(e,t,n){function r(e){var t=a(function(n,r){var a=i(r,t.placeholder);return o(n,e,void 0,r,a)});return t}var o=n(160),i=n(180),a=n(61);e.exports=r},function(e,t,n){function r(e,t,n,r,g,y,b,w){var x=t&f;if(!x&&"function"!=typeof e)throw new TypeError(m);var P=r?r.length:0;if(P||(t&=~(d|h),r=g=void 0),P-=g?g.length:0,t&h){var _=r,C=g;r=g=void 0}var E=x?void 0:u(e),R=[e,t,n,r,g,_,C,y,b,w];if(E&&(c(R,E),t=R[1],w=R[9]),R[9]=null==w?x?0:e.length:v(w-P,0)||0,t==p)var T=i(R[0],R[2]);else T=t!=d&&t!=(p|d)||R[4].length?a.apply(void 0,R):s.apply(void 0,R);var O=E?o:l;return O(T,R)}var o=n(161),i=n(163),a=n(166),s=n(183),u=n(172),c=n(184),l=n(181),p=1,f=2,d=32,h=64,m="Expected a function",v=Math.max;e.exports=r},function(e,t,n){var r=n(42),o=n(162),i=o?function(e,t){return o.set(e,t),e}:r;e.exports=i},function(e,t,n){(function(t){var r=n(26),o=r(t,"WeakMap"),i=o&&new o;e.exports=i}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(e,n){function r(){var o=this&&this!==t&&this instanceof r?i:e;return o.apply(n,arguments)}var i=o(e);return r}var o=n(164);e.exports=r}).call(t,function(){return this}())},function(e,t,n){function r(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=o(e.prototype),r=e.apply(n,t);return i(r)?r:n}}var o=n(165),i=n(24);e.exports=r},function(e,t,n){var r=n(24),o=function(){function e(){}return function(t){if(r(t)){e.prototype=t;var n=new e;e.prototype=void 0}return n||{}}}();e.exports=o},function(e,t,n){(function(t){function r(e,n,x,P,_,C,E,R,T,O){function S(){for(var h=arguments.length,m=h,v=Array(h);m--;)v[m]=arguments[m];if(P&&(v=i(v,P,_)),C&&(v=a(v,C,E)),I||A){var b=S.placeholder,F=l(v,b);if(h-=F.length,O>h){var U=R?o(R):void 0,L=w(O-h,0),B=I?F:void 0,H=I?void 0:F,q=I?v:void 0,V=I?void 0:v;n|=I?g:y,n&=~(I?y:g),D||(n&=~(f|d));var W=[e,n,x,q,B,V,H,U,T,L],K=r.apply(void 0,W);return u(e)&&p(K,W),K.placeholder=b,K}}var Q=k?x:this,Y=j?Q[e]:e;return R&&(v=c(v,R)),N&&T<v.length&&(v.length=T),this&&this!==t&&this instanceof S&&(Y=M||s(e)),Y.apply(Q,v)}var N=n&b,k=n&f,j=n&d,I=n&m,D=n&h,A=n&v,M=j?void 0:s(e);return S}var o=n(45),i=n(167),a=n(168),s=n(164),u=n(169),c=n(179),l=n(180),p=n(181),f=1,d=2,h=4,m=8,v=16,g=32,y=64,b=128,w=Math.max;e.exports=r}).call(t,function(){return this}())},function(e){function t(e,t,r){for(var o=r.length,i=-1,a=n(e.length-o,0),s=-1,u=t.length,c=Array(u+a);++s<u;)c[s]=t[s];for(;++i<o;)c[r[i]]=e[i];for(;a--;)c[s++]=e[i++];return c}var n=Math.max;e.exports=t},function(e){function t(e,t,r){for(var o=-1,i=r.length,a=-1,s=n(e.length-i,0),u=-1,c=t.length,l=Array(s+c);++a<s;)l[a]=e[a];for(var p=a;++u<c;)l[p+u]=t[u];for(;++o<i;)l[p+r[o]]=e[a++];return l}var n=Math.max;e.exports=t},function(e,t,n){function r(e){var t=a(e),n=s[t];if("function"!=typeof n||!(t in o.prototype))return!1;if(e===n)return!0;var r=i(n);return!!r&&e===r[0]}var o=n(170),i=n(172),a=n(174),s=n(176);e.exports=r},function(e,t,n){function r(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=a,this.__views__=[]}var o=n(165),i=n(171),a=Number.POSITIVE_INFINITY;r.prototype=o(i.prototype),r.prototype.constructor=r,e.exports=r},function(e){function t(){}e.exports=t},function(e,t,n){var r=n(162),o=n(173),i=r?function(e){return r.get(e)}:o;e.exports=i},function(e){function t(){}e.exports=t},function(e,t,n){function r(e){for(var t=e.name+"",n=o[t],r=n?n.length:0;r--;){var i=n[r],a=i.func;if(null==a||a==e)return i.name}return t}var o=n(175);e.exports=r},function(e){var t={};e.exports=t},function(e,t,n){function r(e){if(u(e)&&!s(e)&&!(e instanceof o)){if(e instanceof i)return e;if(p.call(e,"__chain__")&&p.call(e,"__wrapped__"))return c(e)}return new i(e)}var o=n(170),i=n(177),a=n(171),s=n(36),u=n(29),c=n(178),l=Object.prototype,p=l.hasOwnProperty;r.prototype=a.prototype,e.exports=r},function(e,t,n){function r(e,t,n){this.__wrapped__=e,this.__actions__=n||[],this.__chain__=!!t}var o=n(165),i=n(171);r.prototype=o(i.prototype),r.prototype.constructor=r,e.exports=r},function(e,t,n){function r(e){return e instanceof o?e.clone():new i(e.__wrapped__,e.__chain__,a(e.__actions__))}var o=n(170),i=n(177),a=n(45);e.exports=r},function(e,t,n){function r(e,t){for(var n=e.length,r=a(t.length,n),s=o(e);r--;){var u=t[r];e[r]=i(u,n)?s[u]:void 0}return e}var o=n(45),i=n(37),a=Math.min;e.exports=r},function(e){function t(e,t){for(var r=-1,o=e.length,i=-1,a=[];++r<o;)e[r]===t&&(e[r]=n,a[++i]=r);return a}var n="__lodash_placeholder__";e.exports=t},function(e,t,n){var r=n(161),o=n(182),i=150,a=16,s=function(){var e=0,t=0;return function(n,s){var u=o(),c=a-(u-t);if(t=u,c>0){if(++e>=i)return n}else e=0;return r(n,s)}}();e.exports=s},function(e,t,n){var r=n(26),o=r(Date,"now"),i=o||function(){return(new Date).getTime()};e.exports=i},function(e,t,n){(function(t){function r(e,n,r,a){function s(){for(var n=-1,o=arguments.length,i=-1,l=a.length,p=Array(l+o);++i<l;)p[i]=a[i];for(;o--;)p[i++]=arguments[++n];var f=this&&this!==t&&this instanceof s?c:e;return f.apply(u?r:this,p)}var u=n&i,c=o(e);return s}var o=n(164),i=1;e.exports=r}).call(t,function(){return this}())},function(e,t,n){function r(e,t){var n=e[1],r=t[1],m=n|r,v=p>m,g=r==p&&n==l||r==p&&n==f&&e[7].length<=t[8]||r==(p|f)&&n==l;if(!v&&!g)return e;r&u&&(e[2]=t[2],m|=n&u?0:c);var y=t[3];if(y){var b=e[3];e[3]=b?i(b,y,t[4]):o(y),e[4]=b?s(e[3],d):o(t[4])}return y=t[5],y&&(b=e[5],e[5]=b?a(b,y,t[6]):o(y),e[6]=b?s(e[5],d):o(t[6])),y=t[7],y&&(e[7]=o(y)),r&p&&(e[8]=null==e[8]?t[8]:h(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=m,e}var o=n(45),i=n(167),a=n(168),s=n(180),u=1,c=4,l=8,p=128,f=256,d="__lodash_placeholder__",h=Math.min;e.exports=r},function(e,t,n){var r=n(159),o=64,i=r(o);i.placeholder={},e.exports=i},function(e,t,n){"use strict";var r=n(111);e.exports=function(e){return r(e,function(e,t){var n=t.split(":");return e[0].push(n[0]),e[1].push(n[1]),e},[[],[]])}},function(e,t,n){"use strict";function r(e){return function(t,n){var r=e.hierarchicalFacets[n],i=e.hierarchicalFacetsRefinements[r.name]&&e.hierarchicalFacetsRefinements[r.name][0]||"",a=e._getHierarchicalFacetSeparator(r),s=h(e._getHierarchicalFacetSortBy(r)),u=o(s,a,i);return c(t,u,{name:e.hierarchicalFacets[n].name,count:null,isRefined:!0,path:null,data:null})}}function o(e,t,n){return function(r,o,s){var c=r;if(s>0){var p=0;for(c=r;s>p;)c=c&&f(c.data,{isRefined:!0}),p++}if(c){var h=i(c.path,n,t);c.data=l(u(d(o.data,h),a(t,n)),e[0],e[1])}return r}}function i(e,t,n){return function(r,o){return-1===o.indexOf(n)||-1===o.indexOf(n)&&-1===t.indexOf(n)||0===t.indexOf(o+n)||0===o.indexOf(e+n)}}function a(e,t){return function(n,r){return{name:p(s(r.split(e))),path:r,count:n,isRefined:t===r||0===t.indexOf(r+e),data:null}}}e.exports=r;var s=n(102),u=n(108),c=n(111),l=n(153),p=n(188),f=n(128),d=n(194),h=n(186)},function(e,t,n){function r(e,t,n){var r=e;return(e=o(e))?(n?s(r,t,n):null==t)?e.slice(u(e),c(e)+1):(t+="",e.slice(i(e,t),a(e,t)+1)):e}var o=n(104),i=n(189),a=n(190),s=n(52),u=n(191),c=n(193);e.exports=r},function(e){function t(e,t){for(var n=-1,r=e.length;++n<r&&t.indexOf(e.charAt(n))>-1;);return n}e.exports=t},function(e){function t(e,t){for(var n=e.length;n--&&t.indexOf(e.charAt(n))>-1;);return n}e.exports=t},function(e,t,n){function r(e){for(var t=-1,n=e.length;++t<n&&o(e.charCodeAt(t)););return t}var o=n(192);e.exports=r},function(e){function t(e){return 160>=e&&e>=9&&13>=e||32==e||160==e||5760==e||6158==e||e>=8192&&(8202>=e||8232==e||8233==e||8239==e||8287==e||12288==e||65279==e)}e.exports=t},function(e,t,n){function r(e){for(var t=e.length;t--&&o(e.charCodeAt(t)););return t}var o=n(192);e.exports=r},function(e,t,n){var r=n(117),o=n(41),i=n(119),a=n(120),s=n(61),u=s(function(e,t){return null==e?{}:"function"==typeof t[0]?a(e,o(t[0],t[1],3)):i(e,r(t))});e.exports=u},function(e,t,n){"use strict";var r=n(17),o=n(108),i=n(111),a=n(53),s=n(36),u={_getQueries:function(e,t){var n=[];return n.push({indexName:e,query:t.query,params:this._getHitsSearchParams(t)}),r(t.getRefinedDisjunctiveFacets(),function(r){n.push({indexName:e,query:t.query,params:this._getDisjunctiveFacetSearchParams(t,r)})},this),r(t.getRefinedHierarchicalFacets(),function(r){var o=t.getHierarchicalFacetByName(r),i=t.getHierarchicalRefinement(r);i.length>0&&i[0].split(t._getHierarchicalFacetSeparator(o)).length>1&&n.push({indexName:e,query:t.query,params:this._getDisjunctiveFacetSearchParams(t,r,!0)})},this),n},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(this._getHitsHierarchicalFacetsAttributes(e)),n=this._getFacetFilters(e),r=this._getNumericFilters(e),o=this._getTagFilters(e),i={facets:t,tagFilters:o};return(e.distinct===!0||e.distinct===!1)&&(i.distinct=e.distinct),n.length>0&&(i.facetFilters=n),r.length>0&&(i.numericFilters=r),a(e.getQueryParams(),i)},_getDisjunctiveFacetSearchParams:function(e,t,n){var r=this._getFacetFilters(e,t,n),o=this._getNumericFilters(e,t),i=this._getTagFilters(e),s={hitsPerPage:1,page:0,attributesToRetrieve:[],attributesToHighlight:[],attributesToSnippet:[],tagFilters:i},u=e.getHierarchicalFacetByName(t);return s.facets=u?this._getDisjunctiveHierarchicalFacetAttribute(e,u,n):t,(e.distinct===!0||e.distinct===!1)&&(s.distinct=e.distinct),o.length>0&&(s.numericFilters=o),r.length>0&&(s.facetFilters=r),a(e.getQueryParams(),s)},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var n=[];return r(e.numericRefinements,function(e,i){r(e,function(e,a){t!==i&&r(e,function(e){if(s(e)){var t=o(e,function(e){return i+a+e});n.push(t)}else n.push(i+a+e)})})}),n},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,n){var o=[];return r(e.facetsRefinements,function(e,t){r(e,function(e){o.push(t+":"+e)})}),r(e.facetsExcludes,function(e,t){r(e,function(e){o.push(t+":-"+e)})}),r(e.disjunctiveFacetsRefinements,function(e,n){if(n!==t&&e&&0!==e.length){var i=[];r(e,function(e){i.push(n+":"+e)}),o.push(i)}}),r(e.hierarchicalFacetsRefinements,function(r,i){var a=r[0];if(void 0!==a){var s,u=e.getHierarchicalFacetByName(i),c=e._getHierarchicalFacetSeparator(u);if(t===i){if(-1===a.indexOf(c)||n===!0)return;s=u.attributes[a.split(c).length-2],a=a.slice(0,a.lastIndexOf(c))}else s=u.attributes[a.split(c).length-1];o.push([s+":"+a])}}),o},_getHitsHierarchicalFacetsAttributes:function(e){var t=[];return i(e.hierarchicalFacets,function(t,n){var r=e.getHierarchicalRefinement(n.name)[0];if(!r)return t.push(n.attributes[0]),t;var o=r.split(e._getHierarchicalFacetSeparator(n)).length,i=n.attributes.slice(0,o+1);return t.concat(i)},t)},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){if(n===!0)return[t.attributes[0]];var r=e.getHierarchicalRefinement(t.name)[0]||"",o=r.split(e._getHierarchicalFacetSeparator(t)).length-1;return t.attributes.slice(0,o+1)}};e.exports=u},function(e,t,n){(function(e,r){function o(e,n){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),u(r,e,r.depth)}function i(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function a(e){return e}function s(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function u(e,n,r){if(e.customInspect&&n&&R(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return b(o)||(o=u(e,o,r)),o}var i=c(e,n);if(i)return i;var a=Object.keys(n),m=s(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(n);if(0===a.length){if(R(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(P(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(C(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return l(n)}var g="",y=!1,w=["{","}"];if(h(n)&&(y=!0,w=["[","]"]),R(n)){var x=n.name?": "+n.name:"";g=" [Function"+x+"]"}if(P(n)&&(g=" "+RegExp.prototype.toString.call(n)),C(n)&&(g=" "+Date.prototype.toUTCString.call(n)),E(n)&&(g=" "+l(n)),0===a.length&&(!y||0==n.length))return w[0]+g+w[1];if(0>r)return P(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var _;return _=y?p(e,n,r,m,a):a.map(function(t){return f(e,n,r,m,t,y)}),e.seen.pop(),d(_,g,w)}function c(e,t){if(x(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,o){for(var i=[],a=0,s=t.length;s>a;++a)i.push(k(t,String(a))?f(e,t,n,r,String(a),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||i.push(f(e,t,n,r,o,!0))}),i}function f(e,t,n,r,o,i){var a,s,c;if(c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},c.get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),k(r,o)||(a="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=v(n)?u(e,c.value,null):u(e,c.value,n-1),s.indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),x(a)){if(i&&o.match(/^\d+$/))return s;a=JSON.stringify(""+o),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e,t,n){var r=0,o=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function g(e){return null==e}function y(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function x(e){return void 0===e}function P(e){return _(e)&&"[object RegExp]"===O(e)}function _(e){return"object"==typeof e&&null!==e}function C(e){return _(e)&&"[object Date]"===O(e)}function E(e){return _(e)&&("[object Error]"===O(e)||e instanceof Error)}function R(e){return"function"==typeof e}function T(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function O(e){return Object.prototype.toString.call(e)}function S(e){return 10>e?"0"+e.toString(10):e.toString(10)}function N(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var j=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(o(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,a=String(e).replace(j,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),s=r[n];i>n;s=r[++n])a+=v(s)||!_(s)?" "+s:" "+o(s);return a},t.deprecate=function(n,o){function i(){if(!a){if(r.throwDeprecation)throw new Error(o);r.traceDeprecation?console.trace(o):console.error(o),a=!0}return n.apply(this,arguments)}if(x(e.process))return function(){return t.deprecate(n,o).apply(this,arguments)};if(r.noDeprecation===!0)return n;var a=!1;return i};var I,D={};t.debuglog=function(e){if(x(I)&&(I={NODE_ENV:"production"}.NODE_DEBUG||""),e=e.toUpperCase(),!D[e])if(new RegExp("\\b"+e+"\\b","i").test(I)){var n=r.pid;D[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else D[e]=function(){};return D[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=g,t.isNumber=y,t.isString=b,t.isSymbol=w,t.isUndefined=x,t.isRegExp=P,t.isObject=_,t.isDate=C,t.isError=E,t.isFunction=R,t.isPrimitive=T,t.isBuffer=n(197);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",N(),t.format.apply(t,arguments))},t.inherits=n(198),t._extend=function(e,t){if(!t||!_(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,function(){return this}(),n(8))},function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(160),o=n(180),i=n(61),a=1,s=32,u=i(function(e,t,n){var i=a;if(n.length){var c=o(n,u.placeholder);i|=s}return r(e,i,t,n,c)});u.placeholder={},e.exports=u},function(e,t,n){"use strict";function r(e){return m(e)?d(e,r):v(e)?p(e,r):h(e)?g(e):e}function o(e,t,n){if(null!==e&&(t=t.replace(e,""),n=n.replace(e,"")),-1!==b.indexOf(t)||-1!==b.indexOf(n)){if("q"===t)return-1;if("q"===n)return 1;var r=-1!==y.indexOf(t),o=-1!==y.indexOf(n);if(r&&!o)return 1;if(o&&!r)return-1}return t.localeCompare(n)}var i=n(201),a=n(74),s=n(203),u=n(199),c=n(17),l=n(194),p=n(108),f=n(207),d=n(209),h=n(125),m=n(56),v=n(36),g=n(205).encode,y=["dFR","fR","nR","hFR","tR"],b=i.ENCODED_PARAMETERS;t.getStateFromQueryString=function(e,t){var n=t&&t.prefix||"",r=s.parse(e),o=new RegExp("^"+n),u=f(r,function(e,t){if(n&&o.test(t)){var r=t.replace(o,"");return i.decode(r)}var a=i.decode(t);return a||t}),c=a._parseNumbers(u);return l(c,a.PARAMETERS)},t.getUnrecognizedParametersInQueryString=function(e,t){var n=t&&t.prefix,r={},o=s.parse(e);if(n){var a=new RegExp("^"+n);c(o,function(e,t){a.test(t)||(r[t]=e)})}else c(o,function(e,t){i.decode(t)||(r[t]=e)});return r},t.getQueryStringFromState=function(e,t){var n=t&&t.moreAttributes,a=t&&t.prefix||"",c=r(e),l=f(c,function(e,t){var n=i.encode(t);return a+n}),p=""===a?null:new RegExp("^"+a),d=u(o,null,p);if(n){var h=s.stringify(l,{encode:!1,sort:d}),m=s.stringify(n,{encode:!1});return h?h+"&"+m:m}return s.stringify(l,{encode:!1,sort:d})}},function(e,t,n){"use strict";var r=n(202),o=n(25),i={advancedSyntax:"aS",allowTyposOnNumericTokens:"aTONT",analyticsTags:"aT",analytics:"a",aroundLatLngViaIP:"aLLVIP",aroundLatLng:"aLL",aroundPrecision:"aP",aroundRadius:"aR",attributesToHighlight:"aTH",attributesToRetrieve:"aTR",attributesToSnippet:"aTS",disjunctiveFacetsRefinements:"dFR",disjunctiveFacets:"dF",distinct:"d",facetsExcludes:"fE",facetsRefinements:"fR",facets:"f",getRankingInfo:"gRI",hierarchicalFacetsRefinements:"hFR",hierarchicalFacets:"hF",highlightPostTag:"hPoT",highlightPreTag:"hPrT",hitsPerPage:"hPP",ignorePlurals:"iP",index:"idx",insideBoundingBox:"iBB",insidePolygon:"iPg",length:"l",maxValuesPerFacet:"mVPF",minimumAroundRadius:"mAR",minProximity:"mP",minWordSizefor1Typo:"mWS1T",minWordSizefor2Typos:"mWS2T",numericFilters:"nF",numericRefinements:"nR",offset:"o",optionalWords:"oW",page:"p",queryType:"qT",query:"q",removeWordsIfNoResults:"rWINR",replaceSynonymsInHighlight:"rSIH",restrictSearchableAttributes:"rSA",synonyms:"s",tagFilters:"tF",tagRefinements:"tR",typoTolerance:"tT"},a=r(i);e.exports={ENCODED_PARAMETERS:o(a),decode:function(e){return a[e]},encode:function(e){return i[e]}}},function(e,t,n){function r(e,t,n){n&&o(e,t,n)&&(t=void 0);for(var r=-1,a=i(e),u=a.length,c={};++r<u;){var l=a[r],p=e[l];t?s.call(c,p)?c[p].push(l):c[p]=[l]:c[p]=l}return c}var o=n(52),i=n(25),a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){var r=n(204),o=n(206);e.exports={stringify:r,parse:o}},function(e,t,n){var r=n(205),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},strictNullHandling:!1,skipNulls:!1,encode:!0};o.stringify=function(e,t,n,i,a,s,u,c){if("function"==typeof u)e=u(t,e);else if(r.isBuffer(e))e=e.toString();else if(e instanceof Date)e=e.toISOString();else if(null===e){if(i)return s?r.encode(t):t;e=""}if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return s?[r.encode(t)+"="+r.encode(e)]:[t+"="+e];var l=[];if("undefined"==typeof e)return l;var p;if(Array.isArray(u))p=u;else{var f=Object.keys(e);p=c?f.sort(c):f}for(var d=0,h=p.length;h>d;++d){var m=p[d];a&&null===e[m]||(l=l.concat(Array.isArray(e)?o.stringify(e[m],n(t,m),n,i,a,s,u):o.stringify(e[m],t+"["+m+"]",n,i,a,s,u)))}return l},e.exports=function(e,t){t=t||{};var n,r,i="undefined"==typeof t.delimiter?o.delimiter:t.delimiter,a="boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling,s="boolean"==typeof t.skipNulls?t.skipNulls:o.skipNulls,u="boolean"==typeof t.encode?t.encode:o.encode,c="function"==typeof t.sort?t.sort:null;"function"==typeof t.filter?(r=t.filter,e=r("",e)):Array.isArray(t.filter)&&(n=r=t.filter);var l=[];if("object"!=typeof e||null===e)return"";var p;p=t.arrayFormat in o.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";var f=o.arrayPrefixGenerators[p];n||(n=Object.keys(e)),c&&n.sort(c);for(var d=0,h=n.length;h>d;++d){var m=n[d];s&&null===e[m]||(l=l.concat(o.stringify(e[m],m,f,a,s,u,r,c)))}return l.join(i)}},function(e,t){var n={};n.hexTable=new Array(256);for(var r=0;256>r;++r)n.hexTable[r]="%"+((16>r?"0":"")+r.toString(16)).toUpperCase();t.arrayToObject=function(e,t){for(var n=t.plainObjects?Object.create(null):{},r=0,o=e.length;o>r;++r)"undefined"!=typeof e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,r){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):"object"==typeof e?e[n]=!0:e=[e,n],e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e,r));for(var o=Object.keys(n),i=0,a=o.length;a>i;++i){var s=o[i],u=n[s];e[s]=Object.prototype.hasOwnProperty.call(e,s)?t.merge(e[s],u,r):u}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;"string"!=typeof e&&(e=""+e);for(var t="",r=0,o=e.length;o>r;++r){var i=e.charCodeAt(r);45===i||46===i||95===i||126===i||i>=48&&57>=i||i>=65&&90>=i||i>=97&&122>=i?t+=e[r]:128>i?t+=n.hexTable[i]:2048>i?t+=n.hexTable[192|i>>6]+n.hexTable[128|63&i]:55296>i||i>=57344?t+=n.hexTable[224|i>>12]+n.hexTable[128|i>>6&63]+n.hexTable[128|63&i]:(++r,i=65536+((1023&i)<<10|1023&e.charCodeAt(r)),t+=n.hexTable[240|i>>18]+n.hexTable[128|i>>12&63]+n.hexTable[128|i>>6&63]+n.hexTable[128|63&i])}return t},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],i=0,a=e.length;a>i;++i)"undefined"!=typeof e[i]&&o.push(e[i]);return o}var s=Object.keys(e);for(i=0,a=s.length;a>i;++i){var u=s[i];e[u]=t.compact(e[u],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t,n){var r=n(205),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1};o.parseValues=function(e,t){for(var n={},o=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),i=0,a=o.length;a>i;++i){var s=o[i],u=-1===s.indexOf("]=")?s.indexOf("="):s.indexOf("]=")+1;if(-1===u)n[r.decode(s)]="",t.strictNullHandling&&(n[r.decode(s)]=null);else{var c=r.decode(s.slice(0,u)),l=r.decode(s.slice(u+1));n[c]=Object.prototype.hasOwnProperty.call(n,c)?[].concat(n[c]).concat(l):l}}return n},o.parseObject=function(e,t,n){if(!e.length)return t;var r,i=e.shift();if("[]"===i)r=[],r=r.concat(o.parseObject(e,t,n));else{r=n.plainObjects?Object.create(null):{};var a="["===i[0]&&"]"===i[i.length-1]?i.slice(1,i.length-1):i,s=parseInt(a,10),u=""+s;!isNaN(s)&&i!==a&&u===a&&s>=0&&n.parseArrays&&s<=n.arrayLimit?(r=[],r[s]=o.parseObject(e,t,n)):r[a]=o.parseObject(e,t,n)}return r},o.parseKeys=function(e,t,n){if(e){n.allowDots&&(e=e.replace(/\.([^\.\[]+)/g,"[$1]"));var r=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,a=r.exec(e),s=[];if(a[1]){if(!n.plainObjects&&Object.prototype.hasOwnProperty(a[1])&&!n.allowPrototypes)return;s.push(a[1])}for(var u=0;null!==(a=i.exec(e))&&u<n.depth;)++u,(n.plainObjects||!Object.prototype.hasOwnProperty(a[1].replace(/\[|\]/g,""))||n.allowPrototypes)&&s.push(a[1]);return a&&s.push("["+e.slice(a.index)+"]"),o.parseObject(s,t,n)}},e.exports=function(e,t){if(t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:o.delimiter,t.depth="number"==typeof t.depth?t.depth:o.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,t.parseArrays=t.parseArrays!==!1,t.allowDots="boolean"==typeof t.allowDots?t.allowDots:o.allowDots,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling,""===e||null===e||"undefined"==typeof e)return t.plainObjects?Object.create(null):{};for(var n="string"==typeof e?o.parseValues(e,t):e,i=t.plainObjects?Object.create(null):{},a=Object.keys(n),s=0,u=a.length;u>s;++s){var c=a[s],l=o.parseKeys(c,n[c],t);i=r.merge(i,l,t)}return r.compact(i)}},function(e,t,n){var r=n(208),o=r(!0);e.exports=o},function(e,t,n){function r(e){return function(t,n,r){var a={};return n=o(n,r,3),i(t,function(t,r,o){var i=n(t,r,o);r=e?i:r,t=e?t:i,a[r]=t}),a}}var o=n(86),i=n(20);e.exports=r},function(e,t,n){var r=n(208),o=r();e.exports=o},function(e){"use strict";e.exports="2.6.7"},function(e,t,n){var r=n(117),o=n(212),i=n(61),a=i(function(e){return o(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t){var n=-1,r=o,u=e.length,c=!0,l=c&&u>=s,p=l?a():null,f=[];p?(r=i,c=!1):(l=!1,p=t?[]:f);e:for(;++n<u;){var d=e[n],h=t?t(d,n,e):d;if(c&&d===d){for(var m=p.length;m--;)if(p[m]===h)continue e;t&&p.push(h),f.push(d)}else r(p,h,0)<0&&((t||l)&&p.push(h),f.push(d))}return f}var o=n(76),i=n(78),a=n(79),s=200;e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){var t=e;return function(){var e=Date.now(),n=e-t;return t=e,n}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.useHash||!1,n=t?f:d;return new h(n,e)}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(72),u=s.AlgoliaSearchHelper,c=n(214).split(".")[0],l=n(215),p=n(53),f={character:"#",onpopstate:function(e){window.addEventListener("hashchange",e)},pushState:function(e){window.location.assign(this.createURL(e))},replaceState:function(e){window.location.replace(this.createURL(e))},createURL:function(e){return document.location.search+this.character+e},readUrl:function(){return window.location.hash.slice(1)}},d={character:"?",onpopstate:function(e){window.addEventListener("popstate",e)},pushState:function(e){window.history.pushState(null,"",this.createURL(e))},replaceState:function(e){window.history.replaceState(null,"",this.createURL(e))},createURL:function(e){return this.character+e+document.location.hash},readUrl:function(){return window.location.search.slice(1)}},h=function(){function e(t,n){r(this,e),this.urlUtils=t,this.originalConfig=null,this.timer=o(Date.now()),this.threshold=n.threshold||700,this.trackedParameters=n.trackedParameters||["query","attribute:*","index","page","hitsPerPage"]}return a(e,[{key:"getConfiguration",value:function(e){this.originalConfig=e;var t=this.urlUtils.readUrl(),n=u.getConfigurationFromQueryString(t);return n}},{key:"onPopState",value:function(e){var t=this.urlUtils.readUrl(),n=u.getConfigurationFromQueryString(t),r=p({},this.originalConfig,n),o=e.getState(this.trackedParameters),i=p({},this.originalConfig,o);l(i,r)||e.setState(r).search()}},{key:"init",value:function(e){var t=e.helper;this.urlUtils.onpopstate(this.onPopState.bind(this,t))}},{key:"render",value:function(e){ var t=e.helper,n=t.getState(this.trackedParameters),r=this.urlUtils.readUrl(),o=u.getConfigurationFromQueryString(r);if(!l(n,o)){var i=u.getForeignConfigurationInQueryString(r);i.is_v=c;var a=t.getStateAsQueryString({filters:this.trackedParameters,moreAttributes:i});this.timer()<this.threshold?this.urlUtils.replaceState(a):this.urlUtils.pushState(a)}}},{key:"createURL",value:function(e){var t=this.urlUtils.readUrl(),n=e.filter(this.trackedParameters),r=s.url.getUnrecognizedParametersInQueryString(t);return r.is_v=c,this.urlUtils.createURL(s.url.getQueryStringFromState(n))}}]),e}();e.exports=i},function(e){"use strict";e.exports="0.14.6"},function(e,t,n){function r(e,t,n,r){n="function"==typeof n?i(n,r,3):void 0;var a=n?n(e,t):void 0;return void 0===a?o(e,t,n):!!a}var o=n(89),i=n(41);e.exports=r},function(e){"use strict";e.exports=function(e){var t=e.numberLocale;return{formatNumber:function(e,n){return Number(n(e)).toLocaleString(t)}}}},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.templates,a=void 0===r?m:r,s=e.cssClasses,g=void 0===s?{}:s,y=e.autoHideContainer,b=void 0===y?!0:y;if(!t)throw new Error(v);var w=u(t),x=h(n(385));return b===!0&&(x=d(x)),{_clearAll:function(e){e.clearTags().clearRefinements().search()},render:function(e){var t=e.results,n=e.helper,r=e.state,s=e.templatesConfig,u=e.createURL,d=0!==l(t,r).length,h={root:f(p(null),g.root),header:f(p("header"),g.header),body:f(p("body"),g.body),footer:f(p("footer"),g.footer),link:f(p("link"),g.link)},v=u(r.clearRefinements()),y=this._clearAll.bind(null,n),b=c({defaultTemplates:m,templatesConfig:s,templates:a});i.render(o.createElement(x,{clearAll:y,cssClasses:h,hasRefinements:d,shouldAutoHideContainer:!d,templateProps:b,url:v}),w)}}}var o=n(218),i=n(371),a=n(373),s=a.bemHelper,u=a.getContainerNode,c=a.prepareTemplateProps,l=a.getRefinements,p=s("ais-clear-all"),f=n(375),d=n(376),h=n(377),m=n(384),v="Usage:\nclearAll({\n container,\n [cssClasses.{root,header,body,footer,link}={}],\n [templates.{header,link,footer}={header: '', link: 'Clear all', footer: ''}],\n [autoHideContainer=true]\n})";e.exports=r},function(e,t,n){(function(t){e.exports=t.React=n(219)}).call(t,function(){return this}())},function(e,t,n){"use strict";e.exports=n(220)},function(e,t,n){"use strict";var r=n(221),o=n(361),i=n(365),a=n(256),s=n(370),u={};a(u,i),a(u,{findDOMNode:s("findDOMNode","ReactDOM","react-dom",r,r.findDOMNode),render:s("render","ReactDOM","react-dom",r,r.render),unmountComponentAtNode:s("unmountComponentAtNode","ReactDOM","react-dom",r,r.unmountComponentAtNode),renderToString:s("renderToString","ReactDOMServer","react-dom/server",o,o.renderToString),renderToStaticMarkup:s("renderToStaticMarkup","ReactDOMServer","react-dom/server",o,o.renderToStaticMarkup)}),u.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r,e.exports=u},function(e,t,n){"use strict";{var r=n(222),o=n(223),i=n(288),a=n(262),s=n(245),u=n(235),c=n(267),l=n(271),p=n(359),f=n(308),d=n(360);n(242)}i.inject();var h=u.measure("React","render",s.render),m={findDOMNode:f,render:h,unmountComponentAtNode:s.unmountComponentAtNode,version:p,unstable_batchedUpdates:l.batchedUpdates,unstable_renderSubtreeIntoContainer:d};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:r,InstanceHandles:a,Mount:s,Reconciler:c,TextComponent:o});e.exports=m},function(e){"use strict";var t={current:null};e.exports=t},function(e,t,n){"use strict";var r=n(224),o=n(239),i=n(243),a=n(245),s=n(256),u=n(238),c=n(237),l=(n(287),function(){});s(l.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t,n){if(this._rootNodeID=e,t.useCreateElement){var r=n[a.ownerDocumentContextKey],i=r.createElement("span");return o.setAttributeForID(i,e),a.getID(i),c(i,this._stringText),i}var s=u(this._stringText);return t.renderToStaticMarkup?s:"<span "+o.createMarkupForID(e)+">"+s+"</span>"},receiveComponent:function(e){if(e!==this._currentElement){this._currentElement=e;var t=""+e;if(t!==this._stringText){this._stringText=t;var n=a.getNode(this._rootNodeID);r.updateTextContent(n,t)}}},unmountComponent:function(){i.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=l},function(e,t,n){"use strict";function r(e,t,n){var r=n>=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,r)}var o=n(225),i=n(233),a=n(235),s=n(236),u=n(237),c=n(230),l={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,updateTextContent:u,processUpdates:function(e,t){for(var n,a=null,l=null,p=0;p<e.length;p++)if(n=e[p],n.type===i.MOVE_EXISTING||n.type===i.REMOVE_NODE){var f=n.fromIndex,d=n.parentNode.childNodes[f],h=n.parentID;d?void 0:c(!1),a=a||{},a[h]=a[h]||[],a[h][f]=d,l=l||[],l.push(d)}var m;if(m=t.length&&"string"==typeof t[0]?o.dangerouslyRenderMarkup(t):t,l)for(var v=0;v<l.length;v++)l[v].parentNode.removeChild(l[v]);for(var g=0;g<e.length;g++)switch(n=e[g],n.type){case i.INSERT_MARKUP:r(n.parentNode,m[n.markupIndex],n.toIndex);break;case i.MOVE_EXISTING:r(n.parentNode,a[n.parentID][n.fromIndex],n.toIndex);break;case i.SET_MARKUP:s(n.parentNode,n.content);break;case i.TEXT_CONTENT:u(n.parentNode,n.content);break;case i.REMOVE_NODE:}}};a.measureMethods(l,"DOMChildrenOperations",{updateTextContent:"updateTextContent"}),e.exports=l},function(e,t,n){"use strict";function r(e){return e.substring(1,e.indexOf(" "))}var o=n(226),i=n(227),a=n(232),s=n(231),u=n(230),c=/^(<[^ \/>]+)/,l="data-danger-index",p={dangerouslyRenderMarkup:function(e){o.canUseDOM?void 0:u(!1);for(var t,n={},p=0;p<e.length;p++)e[p]?void 0:u(!1),t=r(e[p]),t=s(t)?t:"*",n[t]=n[t]||[],n[t][p]=e[p];var f=[],d=0;for(t in n)if(n.hasOwnProperty(t)){var h,m=n[t];for(h in m)if(m.hasOwnProperty(h)){var v=m[h];m[h]=v.replace(c,"$1 "+l+'="'+h+'" ')}for(var g=i(m.join(""),a),y=0;y<g.length;++y){var b=g[y];b.hasAttribute&&b.hasAttribute(l)&&(h=+b.getAttribute(l),b.removeAttribute(l),f.hasOwnProperty(h)?u(!1):void 0,f[h]=b,d+=1)}}return d!==f.length?u(!1):void 0,f.length!==e.length?u(!1):void 0,f},dangerouslyReplaceNodeWithMarkup:function(e,t){o.canUseDOM?void 0:u(!1),t?void 0:u(!1),"html"===e.tagName.toLowerCase()?u(!1):void 0;var n;n="string"==typeof t?i(t,a)[0]:t,e.parentNode.replaceChild(n,e)}};e.exports=p},function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},function(e,t,n){"use strict";function r(e){var t=e.match(l);return t&&t[1].toLowerCase()}function o(e,t){var n=c;c?void 0:u(!1);var o=r(e),i=o&&s(o);if(i){n.innerHTML=i[1]+e+i[2];for(var l=i[0];l--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t?void 0:u(!1),a(p).forEach(t));for(var f=a(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return f}var i=n(226),a=n(228),s=n(231),u=n(230),c=i.canUseDOM?document.createElement("div"):null,l=/^\s*<(\w+)/;e.exports=o},function(e,t,n){"use strict";function r(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function o(e){return r(e)?Array.isArray(e)?e.slice():i(e):[e]}var i=n(229);e.exports=o},function(e,t,n){"use strict";function r(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?o(!1):void 0,"number"!=typeof t?o(!1):void 0,0===t||t-1 in e?void 0:o(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var r=Array(t),i=0;t>i;i++)r[i]=e[i];return r}var o=n(230);e.exports=r},function(e){"use strict";var t=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}};e.exports=t},function(e,t,n){"use strict";function r(e){return a?void 0:i(!1),f.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||(a.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",s[e]=!a.firstChild),s[e]?f[e]:null}var o=n(226),i=n(230),a=o.canUseDOM?document.createElement("div"):null,s={},u=[1,'<select multiple="true">',"</select>"],c=[1,"<table>","</table>"],l=[3,"<table><tbody><tr>","</tr></tbody></table>"],p=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],f={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:u,option:u,caption:c,colgroup:c,tbody:c,tfoot:c,thead:c,td:l,th:l},d=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];d.forEach(function(e){f[e]=p,s[e]=!0}),e.exports=r},function(e){"use strict";function t(e){return function(){return e}}function n(){}n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},function(e,t,n){"use strict";var r=n(234),o=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});e.exports=o},function(e,t,n){"use strict";var r=n(230),o=function(e){var t,n={};e instanceof Object&&!Array.isArray(e)?void 0:r(!1);for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=o},function(e){"use strict";function t(e,t,n){return n}var n={enableMeasure:!1,storedMeasure:t,measureMethods:function(e,t,n){},measure:function(e,t,n){return n},injection:{injectMeasure:function(e){n.storedMeasure=e}}};e.exports=n},function(e,t,n){"use strict";var r=n(226),o=/^[ \r\n\t\f]/,i=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(a=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),o.test(t)||"<"===t[0]&&i.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=a},function(e,t,n){"use strict";var r=n(226),o=n(238),i=n(236),a=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){i(e,o(t))})),e.exports=a},function(e){"use strict";function t(e){return r[e]}function n(e){return(""+e).replace(o,t)}var r={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},o=/[&><"']/g;e.exports=n},function(e,t,n){"use strict";function r(e){return l.hasOwnProperty(e)?!0:c.hasOwnProperty(e)?!1:u.test(e)?(l[e]=!0,!0):(c[e]=!0,!1)}function o(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&1>t||e.hasOverloadedBooleanValue&&t===!1}var i=n(240),a=n(235),s=n(241),u=(n(242),/^[a-zA-Z_][\w\.\-]*$/),c={},l={},p={createMarkupForID:function(e){return i.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(i.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,t){var n=i.properties.hasOwnProperty(e)?i.properties[e]:null;if(n){if(o(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?r+'=""':r+"="+s(t)}return i.isCustomAttribute(e)?null==t?"":e+"="+s(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,t,n){var r=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else if(o(r,n))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute){var s=r.attributeName,u=r.attributeNamespace;u?e.setAttributeNS(u,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&n===!0?e.setAttribute(s,""):e.setAttribute(s,""+n)}else{var c=r.propertyName;r.hasSideEffects&&""+e[c]==""+n||(e[c]=n)}}else i.isCustomAttribute(t)&&p.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){var n=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseAttribute)e.removeAttribute(n.attributeName);else{var o=n.propertyName,a=i.getDefaultValueForProperty(e.nodeName,o);n.hasSideEffects&&""+e[o]===a||(e[o]=a)}}else i.isCustomAttribute(t)&&e.removeAttribute(t)}};a.measureMethods(p,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),e.exports=p},function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var o=n(230),i={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=i,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},c=e.DOMPropertyNames||{},l=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var p in n){s.properties.hasOwnProperty(p)?o(!1):void 0;var f=p.toLowerCase(),d=n[p],h={attributeName:f,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseAttribute:r(d,t.MUST_USE_ATTRIBUTE),mustUseProperty:r(d,t.MUST_USE_PROPERTY),hasSideEffects:r(d,t.HAS_SIDE_EFFECTS),hasBooleanValue:r(d,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(d,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(d,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(d,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(h.mustUseAttribute&&h.mustUseProperty?o(!1):void 0,!h.mustUseProperty&&h.hasSideEffects?o(!1):void 0,h.hasBooleanValue+h.hasNumericValue+h.hasOverloadedBooleanValue<=1?void 0:o(!1),u.hasOwnProperty(p)){var m=u[p];h.attributeName=m}a.hasOwnProperty(p)&&(h.attributeNamespace=a[p]),c.hasOwnProperty(p)&&(h.propertyName=c[p]),l.hasOwnProperty(p)&&(h.mutationMethod=l[p]),s.properties[p]=h}}},a={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){var n=s._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var n,r=a[e];return r||(a[e]=r={}),t in r||(n=document.createElement(e),r[t]=n[t]),r[t]},injection:i};e.exports=s},function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=n(238);e.exports=r},function(e,t,n){"use strict";var r=n(232),o=r;e.exports=o},function(e,t,n){"use strict";var r=n(244),o=n(245),i={processChildrenUpdates:r.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkupByID:r.dangerouslyReplaceNodeWithMarkupByID,unmountIDFromEnvironment:function(e){o.purgeID(e)}};e.exports=i},function(e,t,n){"use strict";var r=n(224),o=n(239),i=n(245),a=n(235),s=n(230),u={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},c={updatePropertyByID:function(e,t,n){var r=i.getNode(e);u.hasOwnProperty(t)?s(!1):void 0,null!=n?o.setValueForProperty(r,t,n):o.deleteValueForProperty(r,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=i.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;n<e.length;n++)e[n].parentNode=i.getNode(e[n].parentID);r.processUpdates(e,t)}};a.measureMethods(c,"ReactDOMIDOperations",{dangerouslyReplaceNodeWithMarkupByID:"dangerouslyReplaceNodeWithMarkupByID",dangerouslyProcessChildrenUpdates:"dangerouslyProcessChildrenUpdates"}),e.exports=c},function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){return e?e.nodeType===q?e.documentElement:e.firstChild:null}function i(e){var t=o(e);return t&&$.getID(t)}function a(e){var t=s(e);if(t)if(B.hasOwnProperty(t)){var n=B[t];n!==e&&(p(n,t)?M(!1):void 0,B[t]=e)}else B[t]=e;return t}function s(e){return e&&e.getAttribute&&e.getAttribute(L)||""}function u(e,t){var n=s(e);n!==t&&delete B[n],e.setAttribute(L,t),B[t]=e}function c(e){return B.hasOwnProperty(e)&&p(B[e],e)||(B[e]=$.findReactNodeByID(e)),B[e]}function l(e){var t=R.get(e)._rootNodeID;return C.isNullComponentID(t)?null:(B.hasOwnProperty(t)&&p(B[t],t)||(B[t]=$.findReactNodeByID(t)),B[t])}function p(e,t){if(e){s(e)!==t?M(!1):void 0;var n=$.findReactContainerForID(t);if(n&&D(n,e))return!0}return!1}function f(e){delete B[e]}function d(e){var t=B[e];return t&&p(t,e)?void(z=t):!1}function h(e){z=null,E.traverseAncestors(e,d);var t=z;return z=null,t}function m(e,t,n,r,o,i){P.useCreateElement&&(i=j({},i),i[W]=n.nodeType===q?n:n.ownerDocument);var a=S.mountComponent(e,t,r,i);e._renderedComponent._topLevelWrapper=e,$._mountImageIntoNode(a,n,o,r)}function v(e,t,n,r,o){var i=k.ReactReconcileTransaction.getPooled(r);i.perform(m,null,e,t,n,i,r,o),k.ReactReconcileTransaction.release(i)}function g(e,t){for(S.unmountComponent(e),t.nodeType===q&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function y(e){var t=i(e);return t?t!==E.getReactRootIDFromNodeID(t):!1}function b(e){for(;e&&e.parentNode!==e;e=e.parentNode)if(1===e.nodeType){var t=s(e);if(t){var n,r=E.getReactRootIDFromNodeID(t),o=e;do if(n=s(o),o=o.parentNode,null==o)return null;while(n!==r);if(o===Q[r])return e}}return null}var w=n(240),x=n(246),P=(n(222),n(258)),_=n(259),C=n(261),E=n(262),R=n(264),T=n(265),O=n(235),S=n(267),N=n(270),k=n(271),j=n(256),I=n(275),D=n(276),A=n(279),M=n(230),F=n(236),U=n(284),L=(n(287),n(242),w.ID_ATTRIBUTE_NAME),B={},H=1,q=9,V=11,W="__ReactMount_ownerDocument$"+Math.random().toString(36).slice(2),K={},Q={},Y=[],z=null,G=function(){};G.prototype.isReactComponent={},G.prototype.render=function(){return this.props};var $={TopLevelWrapper:G,_instancesByReactRootID:K,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return $.scrollMonitor(n,function(){N.enqueueElementInternal(e,t),r&&N.enqueueCallbackInternal(e,r)}),e},_registerComponent:function(e,t){!t||t.nodeType!==H&&t.nodeType!==q&&t.nodeType!==V?M(!1):void 0,x.ensureScrollValueMonitoring();var n=$.registerContainer(t);return K[n]=e,n},_renderNewRootComponent:function(e,t,n,r){var o=A(e,null),i=$._registerComponent(o,t);return k.batchedUpdates(v,o,i,t,n,r),o},renderSubtreeIntoContainer:function(e,t,n,r){return null==e||null==e._reactInternalInstance?M(!1):void 0,$._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){_.isValidElement(t)?void 0:M(!1);var a=new _(G,null,null,null,null,null,t),u=K[i(n)];if(u){var c=u._currentElement,l=c.props;if(U(l,t)){var p=u._renderedComponent.getPublicInstance(),f=r&&function(){r.call(p)};return $._updateRootComponent(u,a,n,f),p}$.unmountComponentAtNode(n)}var d=o(n),h=d&&!!s(d),m=y(n),v=h&&!u&&!m,g=$._renderNewRootComponent(a,n,v,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):I)._renderedComponent.getPublicInstance();return r&&r.call(g),g},render:function(e,t,n){return $._renderSubtreeIntoContainer(null,e,t,n)},registerContainer:function(e){var t=i(e);return t&&(t=E.getReactRootIDFromNodeID(t)),t||(t=E.createReactRootID()),Q[t]=e,t},unmountComponentAtNode:function(e){!e||e.nodeType!==H&&e.nodeType!==q&&e.nodeType!==V?M(!1):void 0;var t=i(e),n=K[t];if(!n){{var r=(y(e),s(e));r&&r===E.getReactRootIDFromNodeID(r)}return!1}return k.batchedUpdates(g,n,e),delete K[t],delete Q[t],!0},findReactContainerForID:function(e){var t=E.getReactRootIDFromNodeID(e),n=Q[t];return n},findReactNodeByID:function(e){var t=$.findReactContainerForID(e);return $.findComponentRoot(t,e)},getFirstReactDOM:function(e){return b(e)},findComponentRoot:function(e,t){var n=Y,r=0,o=h(t)||e;for(n[0]=o.firstChild,n.length=1;r<n.length;){for(var i,a=n[r++];a;){var s=$.getID(a);s?t===s?i=a:E.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,M(!1)},_mountImageIntoNode:function(e,t,n,i){if(!t||t.nodeType!==H&&t.nodeType!==q&&t.nodeType!==V?M(!1):void 0,n){var a=o(t);if(T.canReuseMarkup(e,a))return;var s=a.getAttribute(T.CHECKSUM_ATTR_NAME);a.removeAttribute(T.CHECKSUM_ATTR_NAME);var u=a.outerHTML;a.setAttribute(T.CHECKSUM_ATTR_NAME,s);{var c=e,l=r(c,u);" (client) "+c.substring(l-20,l+20)+"\n (server) "+u.substring(l-20,l+20)}t.nodeType===q?M(!1):void 0}if(t.nodeType===q?M(!1):void 0,i.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else F(t,e)},ownerDocumentContextKey:W,getReactRootID:i,getID:a,setID:u,getNode:c,getNodeFromInstance:l,isValid:p,purgeID:f};O.measureMethods($,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),e.exports=$},function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,v)||(e[v]=h++,f[e[v]]={}),f[e[v]]}var o=n(247),i=n(248),a=n(249),s=n(254),u=n(235),c=n(255),l=n(256),p=n(257),f={},d=!1,h=0,m={topAbort:"abort",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},v="_reactListenersID"+String(Math.random()).slice(2),g=l({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(g.handleTopLevel),g.ReactEventListener=e}},setEnabled:function(e){g.ReactEventListener&&g.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!g.ReactEventListener||!g.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,i=r(n),s=a.registrationNameDependencies[e],u=o.topLevelTypes,c=0;c<s.length;c++){var l=s[c];i.hasOwnProperty(l)&&i[l]||(l===u.topWheel?p("wheel")?g.ReactEventListener.trapBubbledEvent(u.topWheel,"wheel",n):p("mousewheel")?g.ReactEventListener.trapBubbledEvent(u.topWheel,"mousewheel",n):g.ReactEventListener.trapBubbledEvent(u.topWheel,"DOMMouseScroll",n):l===u.topScroll?p("scroll",!0)?g.ReactEventListener.trapCapturedEvent(u.topScroll,"scroll",n):g.ReactEventListener.trapBubbledEvent(u.topScroll,"scroll",g.ReactEventListener.WINDOW_HANDLE):l===u.topFocus||l===u.topBlur?(p("focus",!0)?(g.ReactEventListener.trapCapturedEvent(u.topFocus,"focus",n),g.ReactEventListener.trapCapturedEvent(u.topBlur,"blur",n)):p("focusin")&&(g.ReactEventListener.trapBubbledEvent(u.topFocus,"focusin",n),g.ReactEventListener.trapBubbledEvent(u.topBlur,"focusout",n)),i[u.topBlur]=!0,i[u.topFocus]=!0):m.hasOwnProperty(l)&&g.ReactEventListener.trapBubbledEvent(l,m[l],n),i[l]=!0)}},trapBubbledEvent:function(e,t,n){return g.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return g.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!d){var e=c.refreshScrollValues;g.ReactEventListener.monitorScrollValue(e),d=!0}},eventNameDispatchConfigs:i.eventNameDispatchConfigs,registrationNameModules:i.registrationNameModules,putListener:i.putListener,getListener:i.getListener,deleteListener:i.deleteListener,deleteAllListeners:i.deleteAllListeners});u.measureMethods(g,"ReactBrowserEventEmitter",{putListener:"putListener",deleteListener:"deleteListener"}),e.exports=g},function(e,t,n){"use strict";var r=n(234),o=r({bubbled:null,captured:null}),i=r({topAbort:null,topBlur:null,topCanPlay:null,topCanPlayThrough:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topDurationChange:null,topEmptied:null,topEncrypted:null,topEnded:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topLoadedData:null,topLoadedMetadata:null,topLoadStart:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topPause:null,topPlay:null,topPlaying:null,topProgress:null,topRateChange:null,topReset:null,topScroll:null,topSeeked:null,topSeeking:null,topSelectionChange:null,topStalled:null,topSubmit:null,topSuspend:null,topTextInput:null,topTimeUpdate:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topVolumeChange:null,topWaiting:null,topWheel:null}),a={topLevelTypes:i,PropagationPhases:o};e.exports=a},function(e,t,n){"use strict";var r=n(249),o=n(250),i=n(251),a=n(252),s=n(253),u=n(230),c=(n(242),{}),l=null,p=function(e,t){e&&(o.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},f=function(e){return p(e,!0)},d=function(e){return p(e,!1)},h=null,m={injection:{injectMount:o.injection.injectMount,injectInstanceHandle:function(e){h=e},getInstanceHandle:function(){return h},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,n){"function"!=typeof n?u(!1):void 0;var o=c[t]||(c[t]={});o[e]=n;var i=r.registrationNameModules[t];i&&i.didPutListener&&i.didPutListener(e,t,n)},getListener:function(e,t){var n=c[t];return n&&n[e]},deleteListener:function(e,t){var n=r.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var o=c[t];o&&delete o[e]},deleteAllListeners:function(e){for(var t in c)if(c[t][e]){var n=r.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t),delete c[t][e]}},extractEvents:function(e,t,n,o,i){for(var s,u=r.plugins,c=0;c<u.length;c++){var l=u[c];if(l){var p=l.extractEvents(e,t,n,o,i);p&&(s=a(s,p))}}return s},enqueueEvents:function(e){e&&(l=a(l,e))},processEventQueue:function(e){var t=l;l=null,e?s(t,f):s(t,d),l?u(!1):void 0,i.rethrowCaughtError()},__purge:function(){c={}},__getListenerBank:function(){return c}};e.exports=m},function(e,t,n){"use strict";function r(){if(s)for(var e in u){var t=u[e],n=s.indexOf(e);if(n>-1?void 0:a(!1),!c.plugins[n]){t.extractEvents?void 0:a(!1),c.plugins[n]=t;var r=t.eventTypes;for(var i in r)o(r[i],t,i)?void 0:a(!1)}}}function o(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)?a(!1):void 0,c.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var s=r[o];i(s,t,n)}return!0}return e.registrationName?(i(e.registrationName,t,n),!0):!1}function i(e,t,n){c.registrationNameModules[e]?a(!1):void 0,c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=n(230),s=null,u={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s?a(!1):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];u.hasOwnProperty(n)&&u[n]===o||(u[n]?a(!1):void 0,u[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=c.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};e.exports=c},function(e,t,n){"use strict";function r(e){return e===v.topMouseUp||e===v.topTouchEnd||e===v.topTouchCancel}function o(e){return e===v.topMouseMove||e===v.topTouchMove}function i(e){return e===v.topMouseDown||e===v.topTouchStart}function a(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=m.Mount.getNode(r),t?d.invokeGuardedCallbackWithCatch(o,n,e,r):d.invokeGuardedCallback(o,n,e,r),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)a(e,t,n[o],r[o]);else n&&a(e,t,n,r);e._dispatchListeners=null,e._dispatchIDs=null}function u(e){var t=e._dispatchListeners,n=e._dispatchIDs;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function c(e){var t=u(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function l(e){var t=e._dispatchListeners,n=e._dispatchIDs;Array.isArray(t)?h(!1):void 0;var r=t?t(e,n):null;return e._dispatchListeners=null,e._dispatchIDs=null,r}function p(e){return!!e._dispatchListeners}var f=n(247),d=n(251),h=n(230),m=(n(242),{Mount:null,injectMount:function(e){m.Mount=e}}),v=f.topLevelTypes,g={isEndish:r,isMoveish:o,isStartish:i,executeDirectDispatch:l,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:c,hasDispatches:p,getNode:function(e){return m.Mount.getNode(e)},getID:function(e){return m.Mount.getID(e)},injection:m};e.exports=g},function(e){"use strict";function t(e,t,r,o){try{return t(r,o)}catch(i){return void(null===n&&(n=i))}}var n=null,r={invokeGuardedCallback:t,invokeGuardedCallbackWithCatch:t,rethrowCaughtError:function(){if(n){var e=n;throw n=null,e}}};e.exports=r},function(e,t,n){"use strict";function r(e,t){if(null==t?o(!1):void 0,null==e)return t;var n=Array.isArray(e),r=Array.isArray(t);return n&&r?(e.push.apply(e,t),e):n?(e.push(t),e):r?[e].concat(t):[e,t]}var o=n(230);e.exports=r},function(e){"use strict";var t=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};e.exports=t},function(e,t,n){"use strict";function r(e){o.enqueueEvents(e),o.processEventQueue(!1)}var o=n(248),i={handleTopLevel:function(e,t,n,i,a){var s=o.extractEvents(e,t,n,i,a);r(s)}};e.exports=i},function(e){"use strict";var t={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){t.currentScrollLeft=e.x,t.currentScrollTop=e.y}};e.exports=t},function(e){"use strict";function t(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}e.exports=t; },function(e,t,n){"use strict";function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=n(226);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},function(e){"use strict";var t={useCreateElement:!1};e.exports=t},function(e,t,n){"use strict";var r=n(222),o=n(256),i=(n(260),"function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103),a={key:!0,ref:!0,__self:!0,__source:!0},s=function(e,t,n,r,o,a,s){var u={$$typeof:i,type:e,key:t,ref:n,props:s,_owner:a};return u};s.createElement=function(e,t,n){var o,i={},u=null,c=null,l=null,p=null;if(null!=t){c=void 0===t.ref?null:t.ref,u=void 0===t.key?null:""+t.key,l=void 0===t.__self?null:t.__self,p=void 0===t.__source?null:t.__source;for(o in t)t.hasOwnProperty(o)&&!a.hasOwnProperty(o)&&(i[o]=t[o])}var f=arguments.length-2;if(1===f)i.children=n;else if(f>1){for(var d=Array(f),h=0;f>h;h++)d[h]=arguments[h+2];i.children=d}if(e&&e.defaultProps){var m=e.defaultProps;for(o in m)"undefined"==typeof i[o]&&(i[o]=m[o])}return s(e,u,c,l,p,r.current,i)},s.createFactory=function(e){var t=s.createElement.bind(null,e);return t.type=e,t},s.cloneAndReplaceKey=function(e,t){var n=s(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return n},s.cloneAndReplaceProps=function(e,t){var n=s(e.type,e.key,e.ref,e._self,e._source,e._owner,t);return n},s.cloneElement=function(e,t,n){var i,u=o({},e.props),c=e.key,l=e.ref,p=e._self,f=e._source,d=e._owner;if(null!=t){void 0!==t.ref&&(l=t.ref,d=r.current),void 0!==t.key&&(c=""+t.key);for(i in t)t.hasOwnProperty(i)&&!a.hasOwnProperty(i)&&(u[i]=t[i])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var m=Array(h),v=0;h>v;v++)m[v]=arguments[v+2];u.children=m}return s(e.type,c,l,p,f,d,u)},s.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},e.exports=s},function(e){"use strict";var t=!1;e.exports=t},function(e){"use strict";function t(e){return!!o[e]}function n(e){o[e]=!0}function r(e){delete o[e]}var o={},i={isNullComponentID:t,registerNullComponentID:n,deregisterNullComponentID:r};e.exports=i},function(e,t,n){"use strict";function r(e){return d+e.toString(36)}function o(e,t){return e.charAt(t)===d||t===e.length}function i(e){return""===e||e.charAt(0)===d&&e.charAt(e.length-1)!==d}function a(e,t){return 0===t.indexOf(e)&&o(t,e.length)}function s(e){return e?e.substr(0,e.lastIndexOf(d)):""}function u(e,t){if(i(e)&&i(t)?void 0:f(!1),a(e,t)?void 0:f(!1),e===t)return e;var n,r=e.length+h;for(n=r;n<t.length&&!o(t,n);n++);return t.substr(0,n)}function c(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var r=0,a=0;n>=a;a++)if(o(e,a)&&o(t,a))r=a;else if(e.charAt(a)!==t.charAt(a))break;var s=e.substr(0,r);return i(s)?void 0:f(!1),s}function l(e,t,n,r,o,i){e=e||"",t=t||"",e===t?f(!1):void 0;var c=a(t,e);c||a(e,t)?void 0:f(!1);for(var l=0,p=c?s:u,d=e;;d=p(d,t)){var h;if(o&&d===e||i&&d===t||(h=n(d,c,r)),h===!1||d===t)break;l++<m?void 0:f(!1)}}var p=n(263),f=n(230),d=".",h=d.length,m=1e4,v={createReactRootID:function(){return r(p.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=c(e,t);i!==e&&l(e,i,n,r,!1,!0),i!==t&&l(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(l("",e,t,n,!0,!1),l(e,"",t,n,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,n){e&&(l("",e,t,n,!0,!0),l(e,"",t,n,!0,!0))},traverseAncestors:function(e,t,n){l("",e,t,n,!0,!1)},getFirstCommonAncestorID:c,_getNextDescendantID:u,isAncestorIDOf:a,SEPARATOR:d};e.exports=v},function(e){"use strict";var t={injectCreateReactRootIndex:function(e){n.createReactRootIndex=e}},n={createReactRootIndex:null,injection:t};e.exports=n},function(e){"use strict";var t={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}};e.exports=t},function(e,t,n){"use strict";var r=n(266),o=/\/?>/,i={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(o," "+i.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(i.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var o=r(e);return o===n}};e.exports=i},function(e){"use strict";function t(e){for(var t=1,r=0,o=0,i=e.length,a=-4&i;a>o;){for(;o<Math.min(o+4096,a);o+=4)r+=(t+=e.charCodeAt(o))+(t+=e.charCodeAt(o+1))+(t+=e.charCodeAt(o+2))+(t+=e.charCodeAt(o+3));t%=n,r%=n}for(;i>o;o++)r+=t+=e.charCodeAt(o);return t%=n,r%=n,t|r<<16}var n=65521;e.exports=t},function(e,t,n){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=n(268),i={mountComponent:function(e,t,n,o){var i=e.mountComponent(t,n,o);return e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e),i},unmountComponent:function(e){o.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){var s=o.shouldUpdateRefs(a,t);s&&o.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};e.exports=i},function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):i.addComponentAsRefTo(t,e,n)}function o(e,t,n){"function"==typeof e?e(null):i.removeComponentAsRefFrom(t,e,n)}var i=n(269),a={};a.attachRefs=function(e,t){if(null!==t&&t!==!1){var n=t.ref;null!=n&&r(n,e,t._owner)}},a.shouldUpdateRefs=function(e,t){var n=null===e||e===!1,r=null===t||t===!1;return n||r||t._owner!==e._owner||t.ref!==e.ref},a.detachRefs=function(e,t){if(null!==t&&t!==!1){var n=t.ref;null!=n&&o(n,e,t._owner)}},e.exports=a},function(e,t,n){"use strict";var r=n(230),o={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,n){o.isValidOwner(n)?void 0:r(!1),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){o.isValidOwner(n)?void 0:r(!1),n.getPublicInstance().refs[t]===e.getPublicInstance()&&n.detachRef(t)}};e.exports=o},function(e,t,n){"use strict";function r(e){s.enqueueUpdate(e)}function o(e,t){var n=a.get(e);return n?n:null}var i=(n(222),n(259)),a=n(264),s=n(271),u=n(256),c=n(230),l=(n(242),{isMounted:function(e){var t=a.get(e);return t?!!t._renderedComponent:!1},enqueueCallback:function(e,t){"function"!=typeof t?c(!1):void 0;var n=o(e);return n?(n._pendingCallbacks?n._pendingCallbacks.push(t):n._pendingCallbacks=[t],void r(n)):null},enqueueCallbackInternal:function(e,t){"function"!=typeof t?c(!1):void 0,e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=o(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t){var n=o(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,r(n))},enqueueSetState:function(e,t){var n=o(e,"setState");if(n){var i=n._pendingStateQueue||(n._pendingStateQueue=[]);i.push(t),r(n)}},enqueueSetProps:function(e,t){var n=o(e,"setProps");n&&l.enqueueSetPropsInternal(n,t)},enqueueSetPropsInternal:function(e,t){var n=e._topLevelWrapper;n?void 0:c(!1);var o=n._pendingElement||n._currentElement,a=o.props,s=u({},a.props,t);n._pendingElement=i.cloneAndReplaceProps(o,i.cloneAndReplaceProps(a,s)),r(n)},enqueueReplaceProps:function(e,t){var n=o(e,"replaceProps");n&&l.enqueueReplacePropsInternal(n,t)},enqueueReplacePropsInternal:function(e,t){var n=e._topLevelWrapper;n?void 0:c(!1);var o=n._pendingElement||n._currentElement,a=o.props;n._pendingElement=i.cloneAndReplaceProps(o,i.cloneAndReplaceProps(a,t)),r(n)},enqueueElementInternal:function(e,t){e._pendingElement=t,r(e)}});e.exports=l},function(e,t,n){"use strict";function r(){R.ReactReconcileTransaction&&w?void 0:v(!1)}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=l.getPooled(),this.reconcileTransaction=R.ReactReconcileTransaction.getPooled(!1)}function i(e,t,n,o,i,a){r(),w.batchedUpdates(e,t,n,o,i,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==g.length?v(!1):void 0,g.sort(a);for(var n=0;t>n;n++){var r=g[n],o=r._pendingCallbacks;if(r._pendingCallbacks=null,d.performUpdateIfNecessary(r,e.reconcileTransaction),o)for(var i=0;i<o.length;i++)e.callbackQueue.enqueue(o[i],r.getPublicInstance())}}function u(e){return r(),w.isBatchingUpdates?void g.push(e):void w.batchedUpdates(u,e)}function c(e,t){w.isBatchingUpdates?void 0:v(!1),y.enqueue(e,t),b=!0}var l=n(272),p=n(273),f=n(235),d=n(267),h=n(274),m=n(256),v=n(230),g=[],y=l.getPooled(),b=!1,w=null,x={initialize:function(){this.dirtyComponentsLength=g.length},close:function(){this.dirtyComponentsLength!==g.length?(g.splice(0,this.dirtyComponentsLength),C()):g.length=0}},P={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},_=[x,P];m(o.prototype,h.Mixin,{getTransactionWrappers:function(){return _},destructor:function(){this.dirtyComponentsLength=null,l.release(this.callbackQueue),this.callbackQueue=null,R.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return h.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),p.addPoolingTo(o);var C=function(){for(;g.length||b;){if(g.length){var e=o.getPooled();e.perform(s,null,e),o.release(e)}if(b){b=!1;var t=y;y=l.getPooled(),t.notifyAll(),l.release(t)}}};C=f.measure("ReactUpdates","flushBatchedUpdates",C);var E={injectReconcileTransaction:function(e){e?void 0:v(!1),R.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e?void 0:v(!1),"function"!=typeof e.batchedUpdates?v(!1):void 0,"boolean"!=typeof e.isBatchingUpdates?v(!1):void 0,w=e}},R={ReactReconcileTransaction:null,batchedUpdates:i,enqueueUpdate:u,flushBatchedUpdates:C,injection:E,asap:c};e.exports=R},function(e,t,n){"use strict";function r(){this._callbacks=null,this._contexts=null}var o=n(273),i=n(256),a=n(230);i(r.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){e.length!==t.length?a(!1):void 0,this._callbacks=null,this._contexts=null;for(var n=0;n<e.length;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r=n(230),o=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},u=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)},c=function(e){var t=this;e instanceof t?void 0:r(!1),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=10,p=o,f=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||p,n.poolSize||(n.poolSize=l),n.release=c,n},d={addPoolingTo:f,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:s,fiveArgumentPooler:u};e.exports=d},function(e,t,n){"use strict";var r=n(230),o={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,o,i,a,s,u){this.isInTransaction()?r(!1):void 0;var c,l;try{this._isInTransaction=!0,c=!0,this.initializeAll(0),l=e.call(t,n,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]=i.OBSERVED_ERROR,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===i.OBSERVED_ERROR)try{this.initializeAll(n+1)}catch(o){}}}},closeAll:function(e){this.isInTransaction()?void 0:r(!1);for(var t=this.transactionWrappers,n=e;n<t.length;n++){var o,a=t[n],s=this.wrapperInitData[n];try{o=!0,s!==i.OBSERVED_ERROR&&a.close&&a.close.call(this,s),o=!1}finally{if(o)try{this.closeAll(n+1)}catch(u){}}}this.wrapperInitData.length=0}},i={Mixin:o,OBSERVED_ERROR:{}};e.exports=i},function(e){"use strict";var t={};e.exports=t},function(e,t,n){"use strict";function r(e,t){var n=!0;e:for(;n;){var r=e,i=t;if(n=!1,r&&i){if(r===i)return!0;if(o(r))return!1;if(o(i)){e=r,t=i.parentNode,n=!0;continue e}return r.contains?r.contains(i):r.compareDocumentPosition?!!(16&r.compareDocumentPosition(i)):!1}return!1}}var o=n(277);e.exports=r},function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(278);e.exports=r},function(e){"use strict";function t(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=t},function(e,t,n){"use strict";function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e){var t;if(null===e||e===!1)t=new a(o);else if("object"==typeof e){var n=e;!n||"function"!=typeof n.type&&"string"!=typeof n.type?c(!1):void 0,t="string"==typeof n.type?s.createInternalComponent(n):r(n.type)?new n.type(n):new l}else"string"==typeof e||"number"==typeof e?t=s.createInstanceForText(e):c(!1);return t.construct(e),t._mountIndex=0,t._mountImage=null,t}var i=n(280),a=n(285),s=n(286),u=n(256),c=n(230),l=(n(242),function(){});u(l.prototype,i.Mixin,{_instantiateReactComponent:o}),e.exports=o},function(e,t,n){"use strict";function r(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" Check the render method of `"+n+"`."}return""}function o(){}{var i=n(281),a=n(222),s=n(259),u=n(264),c=n(235),l=n(282),p=(n(283),n(267)),f=n(270),d=n(256),h=n(275),m=n(230),v=n(284);n(242)}o.prototype.render=function(){var e=u.get(this)._currentElement.type;return e(this.props,this.context,this.updater)};var g=1,y={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null},mountComponent:function(e,t,n){this._context=n,this._mountOrder=g++,this._rootNodeID=e;var r,i,a=this._processProps(this._currentElement.props),c=this._processContext(n),l=this._currentElement.type,d="prototype"in l;d&&(r=new l(a,c,f)),(!d||null===r||r===!1||s.isValidElement(r))&&(i=r,r=new o(l)),r.props=a,r.context=c,r.refs=h,r.updater=f,this._instance=r,u.set(r,this);var v=r.state;void 0===v&&(r.state=v=null),"object"!=typeof v||Array.isArray(v)?m(!1):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,r.componentWillMount&&(r.componentWillMount(),this._pendingStateQueue&&(r.state=this._processPendingState(r.props,r.context))),void 0===i&&(i=this._renderValidatedComponent()),this._renderedComponent=this._instantiateReactComponent(i);var y=p.mountComponent(this._renderedComponent,e,t,this._processChildContext(n));return r.componentDidMount&&t.getReactMountReady().enqueue(r.componentDidMount,r),y},unmountComponent:function(){var e=this._instance;e.componentWillUnmount&&e.componentWillUnmount(),p.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._instance=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,this._topLevelWrapper=null,u.remove(e)},_maskContext:function(e){var t=null,n=this._currentElement.type,r=n.contextTypes;if(!r)return h;t={};for(var o in r)t[o]=e[o];return t},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t=this._currentElement.type,n=this._instance,r=n.getChildContext&&n.getChildContext();if(r){"object"!=typeof t.childContextTypes?m(!1):void 0;for(var o in r)o in t.childContextTypes?void 0:m(!1);return d({},e,r)}return e},_processProps:function(e){return e},_checkPropTypes:function(e,t,n){var o=this.getName();for(var i in e)if(e.hasOwnProperty(i)){var a;try{"function"!=typeof e[i]?m(!1):void 0,a=e[i](t,i,o,n)}catch(s){a=s}if(a instanceof Error){{r(this)}n===l.prop}}},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&p.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context)},updateComponent:function(e,t,n,r,o){var i,a=this._instance,s=this._context===o?a.context:this._processContext(o);t===n?i=n.props:(i=this._processProps(n.props),a.componentWillReceiveProps&&a.componentWillReceiveProps(i,s));var u=this._processPendingState(i,s),c=this._pendingForceUpdate||!a.shouldComponentUpdate||a.shouldComponentUpdate(i,u,s);c?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,i,u,s,e,o)):(this._currentElement=n,this._context=o,a.props=i,a.state=u,a.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,o=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(o&&1===r.length)return r[0];for(var i=d({},o?r[0]:n.state),a=o?1:0;a<r.length;a++){var s=r[a];d(i,"function"==typeof s?s.call(n,i,e,t):s)}return i},_performComponentUpdate:function(e,t,n,r,o,i){var a,s,u,c=this._instance,l=Boolean(c.componentDidUpdate);l&&(a=c.props,s=c.state,u=c.context),c.componentWillUpdate&&c.componentWillUpdate(t,n,r),this._currentElement=e,this._context=i,c.props=t,c.state=n,c.context=r,this._updateRenderedComponent(o,i),l&&o.getReactMountReady().enqueue(c.componentDidUpdate.bind(c,a,s,u),c)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent();if(v(r,o))p.receiveComponent(n,o,e,this._processChildContext(t));else{var i=this._rootNodeID,a=n._rootNodeID;p.unmountComponent(n),this._renderedComponent=this._instantiateReactComponent(o);var s=p.mountComponent(this._renderedComponent,i,e,this._processChildContext(t));this._replaceNodeWithMarkupByID(a,s)}},_replaceNodeWithMarkupByID:function(e,t){i.replaceNodeWithMarkupByID(e,t)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance,t=e.render();return t},_renderValidatedComponent:function(){var e;a.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{a.current=null}return null===e||e===!1||s.isValidElement(e)?void 0:m(!1),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n?m(!1):void 0;var r=t.getPublicInstance(),o=n.refs===h?n.refs={}:n.refs;o[e]=r},detachRef:function(e){var t=this.getPublicInstance().refs;delete t[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return e instanceof o?null:e},_instantiateReactComponent:null};c.measureMethods(y,"ReactCompositeComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent",_renderValidatedComponent:"_renderValidatedComponent"});var b={Mixin:y};e.exports=b},function(e,t,n){"use strict";var r=n(230),o=!1,i={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o?r(!1):void 0,i.unmountIDFromEnvironment=e.unmountIDFromEnvironment,i.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=i},function(e,t,n){"use strict";var r=n(234),o=r({prop:null,context:null,childContext:null});e.exports=o},function(e){"use strict";var t={};e.exports=t},function(e){"use strict";function t(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}e.exports=t},function(e,t,n){"use strict";var r,o=n(259),i=n(261),a=n(267),s=n(256),u={injectEmptyComponent:function(e){r=o.createElement(e)}},c=function(e){this._currentElement=null,this._rootNodeID=null,this._renderedComponent=e(r)};s(c.prototype,{construct:function(){},mountComponent:function(e,t,n){return i.registerNullComponentID(e),this._rootNodeID=e,a.mountComponent(this._renderedComponent,e,t,n)},receiveComponent:function(){},unmountComponent:function(){a.unmountComponent(this._renderedComponent),i.deregisterNullComponentID(this._rootNodeID),this._rootNodeID=null,this._renderedComponent=null}}),c.injection=u,e.exports=c},function(e,t,n){"use strict";function r(e){if("function"==typeof e.type)return e.type;var t=e.type,n=p[t];return null==n&&(p[t]=n=c(t)),n}function o(e){return l?void 0:u(!1),new l(e.type,e.props)}function i(e){return new f(e)}function a(e){return e instanceof f}var s=n(256),u=n(230),c=null,l=null,p={},f=null,d={injectGenericComponentClass:function(e){l=e},injectTextComponentClass:function(e){f=e},injectComponentClasses:function(e){s(p,e)}},h={getComponentClassForElement:r,createInternalComponent:o,createInstanceForText:i,isTextComponent:a,injection:d};e.exports=h},function(e,t,n){"use strict";var r=(n(256),n(232)),o=(n(242),r);e.exports=o},function(e,t,n){"use strict";function r(){if(!E){E=!0,g.EventEmitter.injectReactEventListener(v),g.EventPluginHub.injectEventPluginOrder(s),g.EventPluginHub.injectInstanceHandle(y),g.EventPluginHub.injectMount(b),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:_,EnterLeaveEventPlugin:u,ChangeEventPlugin:i,SelectEventPlugin:x,BeforeInputEventPlugin:o}),g.NativeComponent.injectGenericComponentClass(h),g.NativeComponent.injectTextComponentClass(m),g.Class.injectMixin(p),g.DOMProperty.injectDOMPropertyConfig(l),g.DOMProperty.injectDOMPropertyConfig(C),g.EmptyComponent.injectEmptyComponent("noscript"),g.Updates.injectReconcileTransaction(w),g.Updates.injectBatchingStrategy(d),g.RootIndex.injectCreateReactRootIndex(c.canUseDOM?a.createReactRootIndex:P.createReactRootIndex),g.Component.injectEnvironment(f)}}var o=n(289),i=n(297),a=n(300),s=n(301),u=n(302),c=n(226),l=n(306),p=n(307),f=n(243),d=n(309),h=n(310),m=n(223),v=n(335),g=n(338),y=n(262),b=n(245),w=n(342),x=n(347),P=n(348),_=n(349),C=n(358),E=!1;e.exports={inject:r}},function(e,t,n){"use strict";function r(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function o(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function i(e){switch(e){case O.topCompositionStart:return S.compositionStart;case O.topCompositionEnd:return S.compositionEnd;case O.topCompositionUpdate:return S.compositionUpdate}}function a(e,t){return e===O.topKeyDown&&t.keyCode===x}function s(e,t){switch(e){case O.topKeyUp:return-1!==w.indexOf(t.keyCode);case O.topKeyDown:return t.keyCode!==x;case O.topKeyPress:case O.topMouseDown:case O.topBlur:return!0;default:return!1}}function u(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function c(e,t,n,r,o){var c,l;if(P?c=i(e):k?s(e,r)&&(c=S.compositionEnd):a(e,r)&&(c=S.compositionStart),!c)return null;E&&(k||c!==S.compositionStart?c===S.compositionEnd&&k&&(l=k.getData()):k=v.getPooled(t));var p=g.getPooled(c,n,r,o);if(l)p.data=l;else{var f=u(r);null!==f&&(p.data=f)}return h.accumulateTwoPhaseDispatches(p),p}function l(e,t){switch(e){case O.topCompositionEnd:return u(t);case O.topKeyPress:var n=t.which;return n!==R?null:(N=!0,T);case O.topTextInput:var r=t.data;return r===T&&N?null:r;default:return null}}function p(e,t){if(k){if(e===O.topCompositionEnd||s(e,t)){var n=k.getData();return v.release(k),k=null,n}return null}switch(e){case O.topPaste:return null;case O.topKeyPress:return t.which&&!o(t)?String.fromCharCode(t.which):null;case O.topCompositionEnd:return E?null:t.data;default:return null}}function f(e,t,n,r,o){var i;if(i=C?l(e,r):p(e,r),!i)return null;var a=y.getPooled(S.beforeInput,n,r,o);return a.data=i,h.accumulateTwoPhaseDispatches(a),a}var d=n(247),h=n(290),m=n(226),v=n(291),g=n(293),y=n(295),b=n(296),w=[9,13,27,32],x=229,P=m.canUseDOM&&"CompositionEvent"in window,_=null;m.canUseDOM&&"documentMode"in document&&(_=document.documentMode);var C=m.canUseDOM&&"TextEvent"in window&&!_&&!r(),E=m.canUseDOM&&(!P||_&&_>8&&11>=_),R=32,T=String.fromCharCode(R),O=d.topLevelTypes,S={beforeInput:{phasedRegistrationNames:{bubbled:b({onBeforeInput:null}),captured:b({onBeforeInputCapture:null})},dependencies:[O.topCompositionEnd,O.topKeyPress,O.topTextInput,O.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:b({onCompositionEnd:null}),captured:b({onCompositionEndCapture:null})},dependencies:[O.topBlur,O.topCompositionEnd,O.topKeyDown,O.topKeyPress,O.topKeyUp,O.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:b({onCompositionStart:null}),captured:b({onCompositionStartCapture:null})},dependencies:[O.topBlur,O.topCompositionStart,O.topKeyDown,O.topKeyPress,O.topKeyUp,O.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:b({onCompositionUpdate:null}),captured:b({onCompositionUpdateCapture:null})},dependencies:[O.topBlur,O.topCompositionUpdate,O.topKeyDown,O.topKeyPress,O.topKeyUp,O.topMouseDown]}},N=!1,k=null,j={eventTypes:S,extractEvents:function(e,t,n,r,o){return[c(e,t,n,r,o),f(e,t,n,r,o)]}};e.exports=j},function(e,t,n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return y(e,r)}function o(e,t,n){var o=t?g.bubbled:g.captured,i=r(e,n,o);i&&(n._dispatchListeners=m(n._dispatchListeners,i),n._dispatchIDs=m(n._dispatchIDs,e))}function i(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,o,e)}function a(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(e.dispatchMarker,o,e)}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=y(e,r);o&&(n._dispatchListeners=m(n._dispatchListeners,o),n._dispatchIDs=m(n._dispatchIDs,e))}}function u(e){e&&e.dispatchConfig.registrationName&&s(e.dispatchMarker,null,e)}function c(e){v(e,i)}function l(e){v(e,a)}function p(e,t,n,r){h.injection.getInstanceHandle().traverseEnterLeave(n,r,s,e,t)}function f(e){v(e,u)}var d=n(247),h=n(248),m=(n(242),n(252)),v=n(253),g=d.PropagationPhases,y=h.getListener,b={accumulateTwoPhaseDispatches:c,accumulateTwoPhaseDispatchesSkipTarget:l,accumulateDirectDispatches:f,accumulateEnterLeaveDispatches:p};e.exports=b},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var o=n(273),i=n(256),a=n(292);i(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;r>e&&n[e]===o[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=n(226),i=null;e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(294),i={data:null};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n,this.target=r,this.currentTarget=r;var o=this.constructor.Interface;for(var i in o)if(o.hasOwnProperty(i)){var s=o[i];this[i]=s?s(n):n[i]}var u=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse}var o=n(273),i=n(256),a=n(232),s=(n(242),{type:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null});i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),r.Interface=s,r.augmentClass=function(e,t){var n=this,r=Object.create(n.prototype);i(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=i({},n.Interface,t),e.augmentClass=n.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(r,o.fourArgumentPooler),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(294),i={data:null};o.augmentClass(r,i),e.exports=r},function(e){"use strict";var t=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=t},function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function o(e){var t=_.getPooled(S.change,k,e,C(e));w.accumulateTwoPhaseDispatches(t),P.batchedUpdates(i,t)}function i(e){b.enqueueEvents(e),b.processEventQueue(!1)}function a(e,t){N=e,k=t,N.attachEvent("onchange",o)}function s(){N&&(N.detachEvent("onchange",o),N=null,k=null)}function u(e,t,n){return e===O.topChange?n:void 0}function c(e,t,n){e===O.topFocus?(s(),a(t,n)):e===O.topBlur&&s()}function l(e,t){N=e,k=t,j=e.value,I=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(N,"value",M),N.attachEvent("onpropertychange",f)}function p(){N&&(delete N.value,N.detachEvent("onpropertychange",f),N=null,k=null,j=null,I=null)}function f(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==j&&(j=t,o(e))}}function d(e,t,n){return e===O.topInput?n:void 0}function h(e,t,n){e===O.topFocus?(p(),l(t,n)):e===O.topBlur&&p()}function m(e){return e!==O.topSelectionChange&&e!==O.topKeyUp&&e!==O.topKeyDown||!N||N.value===j?void 0:(j=N.value,k)}function v(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function g(e,t,n){return e===O.topClick?n:void 0}var y=n(247),b=n(248),w=n(290),x=n(226),P=n(271),_=n(294),C=n(298),E=n(257),R=n(299),T=n(296),O=y.topLevelTypes,S={ change:{phasedRegistrationNames:{bubbled:T({onChange:null}),captured:T({onChangeCapture:null})},dependencies:[O.topBlur,O.topChange,O.topClick,O.topFocus,O.topInput,O.topKeyDown,O.topKeyUp,O.topSelectionChange]}},N=null,k=null,j=null,I=null,D=!1;x.canUseDOM&&(D=E("change")&&(!("documentMode"in document)||document.documentMode>8));var A=!1;x.canUseDOM&&(A=E("input")&&(!("documentMode"in document)||document.documentMode>9));var M={get:function(){return I.get.call(this)},set:function(e){j=""+e,I.set.call(this,e)}},F={eventTypes:S,extractEvents:function(e,t,n,o,i){var a,s;if(r(t)?D?a=u:s=c:R(t)?A?a=d:(a=m,s=h):v(t)&&(a=g),a){var l=a(e,t,n);if(l){var p=_.getPooled(S.change,l,o,i);return p.type="change",w.accumulateTwoPhaseDispatches(p),p}}s&&s(e,t,n)}};e.exports=F},function(e){"use strict";function t(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}e.exports=t},function(e){"use strict";function t(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&n[e.type]||"textarea"===t)}var n={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};e.exports=t},function(e){"use strict";var t=0,n={createReactRootIndex:function(){return t++}};e.exports=n},function(e,t,n){"use strict";var r=n(296),o=[r({ResponderEventPlugin:null}),r({SimpleEventPlugin:null}),r({TapEventPlugin:null}),r({EnterLeaveEventPlugin:null}),r({ChangeEventPlugin:null}),r({SelectEventPlugin:null}),r({BeforeInputEventPlugin:null})];e.exports=o},function(e,t,n){"use strict";var r=n(247),o=n(290),i=n(303),a=n(245),s=n(296),u=r.topLevelTypes,c=a.getFirstReactDOM,l={mouseEnter:{registrationName:s({onMouseEnter:null}),dependencies:[u.topMouseOut,u.topMouseOver]},mouseLeave:{registrationName:s({onMouseLeave:null}),dependencies:[u.topMouseOut,u.topMouseOver]}},p=[null,null],f={eventTypes:l,extractEvents:function(e,t,n,r,s){if(e===u.topMouseOver&&(r.relatedTarget||r.fromElement))return null;if(e!==u.topMouseOut&&e!==u.topMouseOver)return null;var f;if(t.window===t)f=t;else{var d=t.ownerDocument;f=d?d.defaultView||d.parentWindow:window}var h,m,v="",g="";if(e===u.topMouseOut?(h=t,v=n,m=c(r.relatedTarget||r.toElement),m?g=a.getID(m):m=f,m=m||f):(h=f,m=t,g=n),h===m)return null;var y=i.getPooled(l.mouseLeave,v,r,s);y.type="mouseleave",y.target=h,y.relatedTarget=m;var b=i.getPooled(l.mouseEnter,g,r,s);return b.type="mouseenter",b.target=m,b.relatedTarget=h,o.accumulateEnterLeaveDispatches(y,b,v,g),p[0]=y,p[1]=b,p}};e.exports=f},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(304),i=n(255),a=n(305),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:a,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+i.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+i.currentScrollTop}};o.augmentClass(r,s),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(294),i=n(298),a={view:function(e){if(e.view)return e.view;var t=i(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}};o.augmentClass(r,a),e.exports=r},function(e){"use strict";function t(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var o=r[e];return o?!!n[o]:!1}function n(){return t}var r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=n},function(e,t,n){"use strict";var r,o=n(240),i=n(226),a=o.injection.MUST_USE_ATTRIBUTE,s=o.injection.MUST_USE_PROPERTY,u=o.injection.HAS_BOOLEAN_VALUE,c=o.injection.HAS_SIDE_EFFECTS,l=o.injection.HAS_NUMERIC_VALUE,p=o.injection.HAS_POSITIVE_NUMERIC_VALUE,f=o.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(i.canUseDOM){var d=document.implementation;r=d&&d.hasFeature&&d.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var h={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:a|u,allowTransparency:a,alt:null,async:u,autoComplete:null,autoPlay:u,capture:a|u,cellPadding:null,cellSpacing:null,charSet:a,challenge:a,checked:s|u,classID:a,className:r?a:s,cols:a|p,colSpan:null,content:null,contentEditable:null,contextMenu:a,controls:s|u,coords:null,crossOrigin:null,data:null,dateTime:a,"default":u,defer:u,dir:null,disabled:a|u,download:f,draggable:null,encType:null,form:a,formAction:a,formEncType:a,formMethod:a,formNoValidate:u,formTarget:a,frameBorder:a,headers:null,height:a,hidden:a|u,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:s,inputMode:a,integrity:null,is:a,keyParams:a,keyType:a,kind:null,label:null,lang:null,list:a,loop:s|u,low:null,manifest:a,marginHeight:null,marginWidth:null,max:null,maxLength:a,media:a,mediaGroup:null,method:null,min:null,minLength:a,multiple:s|u,muted:s|u,name:null,noValidate:u,open:u,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:s|u,rel:null,required:u,role:a,rows:a|p,rowSpan:null,sandbox:null,scope:null,scoped:u,scrolling:null,seamless:a|u,selected:s|u,shape:null,size:a|p,sizes:a,span:p,spellCheck:null,src:null,srcDoc:s,srcLang:null,srcSet:a,start:l,step:null,style:null,summary:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:s|c,width:a,wmode:a,wrap:null,about:a,datatype:a,inlist:a,prefix:a,property:a,resource:a,"typeof":a,vocab:a,autoCapitalize:null,autoCorrect:null,autoSave:null,color:null,itemProp:a,itemScope:a|u,itemType:a,itemID:a,itemRef:a,results:null,security:a,unselectable:a},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};e.exports=h},function(e,t,n){"use strict";var r=(n(264),n(308)),o=(n(242),"_getDOMNodeDidWarn"),i={getDOMNode:function(){return this.constructor[o]=!0,r(this)}};e.exports=i},function(e,t,n){"use strict";function r(e){return null==e?null:1===e.nodeType?e:o.has(e)?i.getNodeFromInstance(e):(null!=e.render&&"function"==typeof e.render?a(!1):void 0,void a(!1))}{var o=(n(222),n(264)),i=n(245),a=n(230);n(242)}e.exports=r},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var o=n(271),i=n(274),a=n(256),s=n(232),u={initialize:s,close:function(){f.isBatchingUpdates=!1}},c={initialize:s,close:o.flushBatchedUpdates.bind(o)},l=[c,u];a(r.prototype,i.Mixin,{getTransactionWrappers:function(){return l}});var p=new r,f={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,i){var a=f.isBatchingUpdates;f.isBatchingUpdates=!0,a?e(t,n,r,o,i):p.perform(e,null,t,n,r,o,i)}};e.exports=f},function(e,t,n){"use strict";function r(){return this}function o(){var e=this._reactInternalComponent;return!!e}function i(){}function a(e,t){var n=this._reactInternalComponent;n&&(j.enqueueSetPropsInternal(n,e),t&&j.enqueueCallbackInternal(n,t))}function s(e,t){var n=this._reactInternalComponent;n&&(j.enqueueReplacePropsInternal(n,e),t&&j.enqueueCallbackInternal(n,t))}function u(e,t){t&&(null!=t.dangerouslySetInnerHTML&&(null!=t.children?M(!1):void 0,"object"==typeof t.dangerouslySetInnerHTML&&Q in t.dangerouslySetInnerHTML?void 0:M(!1)),null!=t.style&&"object"!=typeof t.style?M(!1):void 0)}function c(e,t,n,r){var o=S.findReactContainerForID(e);if(o){var i=o.nodeType===Y?o.ownerDocument:o;H(t,i)}r.getReactMountReady().enqueue(l,{id:e,registrationName:t,listener:n})}function l(){var e=this;P.putListener(e.id,e.registrationName,e.listener)}function p(){var e=this;e._rootNodeID?void 0:M(!1);var t=S.getNode(e._rootNodeID);switch(t?void 0:M(!1),e._tag){case"iframe":e._wrapperState.listeners=[P.trapBubbledEvent(x.topLevelTypes.topLoad,"load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in z)z.hasOwnProperty(n)&&e._wrapperState.listeners.push(P.trapBubbledEvent(x.topLevelTypes[n],z[n],t));break;case"img":e._wrapperState.listeners=[P.trapBubbledEvent(x.topLevelTypes.topError,"error",t),P.trapBubbledEvent(x.topLevelTypes.topLoad,"load",t)];break;case"form":e._wrapperState.listeners=[P.trapBubbledEvent(x.topLevelTypes.topReset,"reset",t),P.trapBubbledEvent(x.topLevelTypes.topSubmit,"submit",t)]}}function f(){E.mountReadyWrapper(this)}function d(){T.postUpdateWrapper(this)}function h(e){Z.call(X,e)||(J.test(e)?void 0:M(!1),X[e]=!0)}function m(e,t){return e.indexOf("-")>=0||null!=t.is}function v(e){h(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null}var g=n(311),y=n(313),b=n(240),w=n(239),x=n(247),P=n(246),_=n(243),C=n(321),E=n(322),R=n(326),T=n(329),O=n(330),S=n(245),N=n(331),k=n(235),j=n(270),I=n(256),D=n(260),A=n(238),M=n(230),F=(n(257),n(296)),U=n(236),L=n(237),B=(n(334),n(287),n(242),P.deleteListener),H=P.listenTo,q=P.registrationNameModules,V={string:!0,number:!0},W=F({children:null}),K=F({style:null}),Q=F({__html:null}),Y=1,z={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},G={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},$={listing:!0,pre:!0,textarea:!0},J=(I({menuitem:!0},G),/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/),X={},Z={}.hasOwnProperty;v.displayName="ReactDOMComponent",v.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(p,this);break;case"button":r=C.getNativeProps(this,r,n);break;case"input":E.mountWrapper(this,r,n),r=E.getNativeProps(this,r,n);break;case"option":R.mountWrapper(this,r,n),r=R.getNativeProps(this,r,n);break;case"select":T.mountWrapper(this,r,n),r=T.getNativeProps(this,r,n),n=T.processChildContext(this,r,n);break;case"textarea":O.mountWrapper(this,r,n),r=O.getNativeProps(this,r,n)}u(this,r);var o;if(t.useCreateElement){var i=n[S.ownerDocumentContextKey],a=i.createElement(this._currentElement.type);w.setAttributeForID(a,this._rootNodeID),S.getID(a),this._updateDOMProperties({},r,t,a),this._createInitialChildren(t,r,n,a),o=a}else{var s=this._createOpenTagMarkupAndPutListeners(t,r),c=this._createContentMarkup(t,r,n);o=!c&&G[this._tag]?s+"/>":s+">"+c+"</"+this._currentElement.type+">"}switch(this._tag){case"input":t.getReactMountReady().enqueue(f,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(g.focusDOMComponent,this)}return o},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)if(q.hasOwnProperty(r))o&&c(this._rootNodeID,r,o,e);else{r===K&&(o&&(o=this._previousStyleCopy=I({},t.style)),o=y.createMarkupForStyles(o));var i=null;null!=this._tag&&m(this._tag,t)?r!==W&&(i=w.createMarkupForCustomAttribute(r,o)):i=w.createMarkupForProperty(r,o),i&&(n+=" "+i)}}if(e.renderToStaticMarkup)return n;var a=w.createMarkupForID(this._rootNodeID);return n+" "+a},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=V[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=A(i);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return $[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&U(r,o.__html);else{var i=V[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)L(r,i);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u<s.length;u++)r.appendChild(s[u])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,i=this._currentElement.props;switch(this._tag){case"button":o=C.getNativeProps(this,o),i=C.getNativeProps(this,i);break;case"input":E.updateWrapper(this),o=E.getNativeProps(this,o),i=E.getNativeProps(this,i);break;case"option":o=R.getNativeProps(this,o),i=R.getNativeProps(this,i);break;case"select":o=T.getNativeProps(this,o),i=T.getNativeProps(this,i);break;case"textarea":O.updateWrapper(this),o=O.getNativeProps(this,o),i=O.getNativeProps(this,i)}u(this,i),this._updateDOMProperties(o,i,e,null),this._updateDOMChildren(o,i,e,r),!D&&this._nodeWithLegacyProperties&&(this._nodeWithLegacyProperties.props=i),"select"===this._tag&&e.getReactMountReady().enqueue(d,this)},_updateDOMProperties:function(e,t,n,r){var o,i,a;for(o in e)if(!t.hasOwnProperty(o)&&e.hasOwnProperty(o))if(o===K){var s=this._previousStyleCopy;for(i in s)s.hasOwnProperty(i)&&(a=a||{},a[i]="");this._previousStyleCopy=null}else q.hasOwnProperty(o)?e[o]&&B(this._rootNodeID,o):(b.properties[o]||b.isCustomAttribute(o))&&(r||(r=S.getNode(this._rootNodeID)),w.deleteValueForProperty(r,o));for(o in t){var u=t[o],l=o===K?this._previousStyleCopy:e[o];if(t.hasOwnProperty(o)&&u!==l)if(o===K)if(u?u=this._previousStyleCopy=I({},u):this._previousStyleCopy=null,l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(a=a||{},a[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(a=a||{},a[i]=u[i])}else a=u;else q.hasOwnProperty(o)?u?c(this._rootNodeID,o,u,n):l&&B(this._rootNodeID,o):m(this._tag,t)?(r||(r=S.getNode(this._rootNodeID)),o===W&&(u=null),w.setValueForAttribute(r,o,u)):(b.properties[o]||b.isCustomAttribute(o))&&(r||(r=S.getNode(this._rootNodeID)),null!=u?w.setValueForProperty(r,o,u):w.deleteValueForProperty(r,o))}a&&(r||(r=S.getNode(this._rootNodeID)),y.setValueForStyles(r,a))},_updateDOMChildren:function(e,t,n,r){var o=V[typeof e.children]?e.children:null,i=V[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=o?null:e.children,c=null!=i?null:t.children,l=null!=o||null!=a,p=null!=i||null!=s;null!=u&&null==c?this.updateChildren(null,n,r):l&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=s?a!==s&&this.updateMarkup(""+s):null!=c&&this.updateChildren(c,n,r)},unmountComponent:function(){switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":var e=this._wrapperState.listeners;if(e)for(var t=0;t<e.length;t++)e[t].remove();break;case"input":E.unmountWrapper(this);break;case"html":case"head":case"body":M(!1)}if(this.unmountChildren(),P.deleteAllListeners(this._rootNodeID),_.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null,this._wrapperState=null,this._nodeWithLegacyProperties){var n=this._nodeWithLegacyProperties;n._reactInternalComponent=null,this._nodeWithLegacyProperties=null}},getPublicInstance:function(){if(!this._nodeWithLegacyProperties){var e=S.getNode(this._rootNodeID);e._reactInternalComponent=this,e.getDOMNode=r,e.isMounted=o,e.setState=i,e.replaceState=i,e.forceUpdate=i,e.setProps=a,e.replaceProps=s,e.props=this._currentElement.props,this._nodeWithLegacyProperties=e}return this._nodeWithLegacyProperties}},k.measureMethods(v,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),I(v.prototype,v.Mixin,N.Mixin),e.exports=v},function(e,t,n){"use strict";var r=n(245),o=n(308),i=n(312),a={componentDidMount:function(){this.props.autoFocus&&i(o(this))}},s={Mixin:a,focusDOMComponent:function(){i(r.getNode(this._rootNodeID))}};e.exports=s},function(e){"use strict";function t(e){try{e.focus()}catch(t){}}e.exports=t},function(e,t,n){"use strict";var r=n(314),o=n(226),i=n(235),a=(n(315),n(317)),s=n(318),u=n(320),c=(n(242),u(function(e){return s(e)})),l=!1,p="cssFloat";if(o.canUseDOM){var f=document.createElement("div").style;try{f.font=""}catch(d){l=!0}void 0===document.documentElement.style.cssFloat&&(p="styleFloat")}var h={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=c(n)+":",t+=a(n,r)+";")}return t||null},setValueForStyles:function(e,t){var n=e.style;for(var o in t)if(t.hasOwnProperty(o)){var i=a(o,t[o]);if("float"===o&&(o=p),i)n[o]=i;else{var s=l&&r.shorthandPropertyExpansions[o];if(s)for(var u in s)n[u]="";else n[o]=""}}}};i.measureMethods(h,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),e.exports=h},function(e){"use strict";function t(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var n={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},r=["Webkit","ms","Moz","O"];Object.keys(n).forEach(function(e){r.forEach(function(r){n[t(r,e)]=n[e]})});var o={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},i={isUnitlessNumber:n,shorthandPropertyExpansions:o};e.exports=i},function(e,t,n){"use strict";function r(e){return o(e.replace(i,"ms-"))}var o=n(316),i=/^-ms-/;e.exports=r},function(e){"use strict";function t(e){return e.replace(n,function(e,t){return t.toUpperCase()})}var n=/-(.)/g;e.exports=t},function(e,t,n){"use strict";function r(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var r=isNaN(t);return r||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var o=n(314),i=o.isUnitlessNumber;e.exports=r},function(e,t,n){"use strict";function r(e){return o(e).replace(i,"-ms-")}var o=n(319),i=/^ms-/;e.exports=r},function(e){"use strict";function t(e){return e.replace(n,"-$1").toLowerCase()}var n=/([A-Z])/g;e.exports=t},function(e){"use strict";function t(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=t},function(e){"use strict";var t={onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0},n={getNativeProps:function(e,n){if(!n.disabled)return n;var r={};for(var o in n)n.hasOwnProperty(o)&&!t[o]&&(r[o]=n[o]);return r}};e.exports=n},function(e,t,n){"use strict";function r(){this._rootNodeID&&f.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);u.asap(r,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=s.getNode(this._rootNodeID),c=i;c.parentNode;)c=c.parentNode;for(var f=c.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),d=0;d<f.length;d++){var h=f[d];if(h!==i&&h.form===i.form){var m=s.getID(h);m?void 0:l(!1);var v=p[m];v?void 0:l(!1),u.asap(r,v)}}}return n}var i=n(244),a=n(323),s=n(245),u=n(271),c=n(256),l=n(230),p={},f={getNativeProps:function(e,t){var n=a.getValue(t),r=a.getChecked(t),o=c({},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange});return o},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:t.defaultChecked||!1,initialValue:null!=n?n:null,onChange:o.bind(e)}},mountReadyWrapper:function(e){p[e._rootNodeID]=e},unmountWrapper:function(e){delete p[e._rootNodeID]},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&i.updatePropertyByID(e._rootNodeID,"checked",n||!1);var r=a.getValue(t);null!=r&&i.updatePropertyByID(e._rootNodeID,"value",""+r)}};e.exports=f},function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink?c(!1):void 0}function o(e){r(e),null!=e.value||null!=e.onChange?c(!1):void 0}function i(e){r(e),null!=e.checked||null!=e.onChange?c(!1):void 0}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=n(324),u=n(282),c=n(230),l=(n(242),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),p={value:function(e,t){return!e[t]||l[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){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:s.func},f={},d={checkPropTypes:function(e,t,n){for(var r in p){if(p.hasOwnProperty(r))var o=p[r](t,r,e,u.prop);if(o instanceof Error&&!(o.message in f)){f[o.message]=!0;{a(n)}}}},getValue:function(e){return e.valueLink?(o(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(i(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(o(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(i(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=d},function(e,t,n){"use strict";function r(e){function t(t,n,r,o,i,a){if(o=o||P,a=a||r,null==n[r]){var s=b[i];return t?new Error("Required "+s+" `"+a+"` was not specified in "+("`"+o+"`.")):null}return e(n,r,o,i,a)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e){function t(t,n,r,o,i){var a=t[n],s=m(a);if(s!==e){var u=b[o],c=v(a);return new Error("Invalid "+u+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return r(t)}function i(){return r(w.thatReturns(null))}function a(e){function t(t,n,r,o,i){var a=t[n];if(!Array.isArray(a)){var s=b[o],u=m(a);return new Error("Invalid "+s+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an array."))}for(var c=0;c<a.length;c++){var l=e(a,c,r,o,i+"["+c+"]");if(l instanceof Error)return l}return null}return r(t)}function s(){function e(e,t,n,r,o){if(!y.isValidElement(e[t])){var i=b[r];return new Error("Invalid "+i+" `"+o+"` supplied to "+("`"+n+"`, expected a single ReactElement."))}return null}return r(e)}function u(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=b[o],s=e.name||P,u=g(t[n]);return new Error("Invalid "+a+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("instance of `"+s+"`."))}return null}return r(t)}function c(e){function t(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(a===e[s])return null;var u=b[o],c=JSON.stringify(e);return new Error("Invalid "+u+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+c+"."))}return r(Array.isArray(e)?t:function(){return new Error("Invalid argument supplied to oneOf, expected an instance of array.")})}function l(e){function t(t,n,r,o,i){var a=t[n],s=m(a);if("object"!==s){var u=b[o];return new Error("Invalid "+u+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an object."))}for(var c in a)if(a.hasOwnProperty(c)){var l=e(a,c,r,o,i+"."+c);if(l instanceof Error)return l}return null}return r(t)}function p(e){function t(t,n,r,o,i){for(var a=0;a<e.length;a++){var s=e[a];if(null==s(t,n,r,o,i))return null}var u=b[o];return new Error("Invalid "+u+" `"+i+"` supplied to "+("`"+r+"`."))}return r(Array.isArray(e)?t:function(){return new Error("Invalid argument supplied to oneOfType, expected an instance of array.")})}function f(){function e(e,t,n,r,o){if(!h(e[t])){var i=b[r];return new Error("Invalid "+i+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return null}return r(e)}function d(e){function t(t,n,r,o,i){var a=t[n],s=m(a);if("object"!==s){var u=b[o];return new Error("Invalid "+u+" `"+i+"` of type `"+s+"` "+("supplied to `"+r+"`, expected `object`."))}for(var c in e){var l=e[c];if(l){var p=l(a,c,r,o,i+"."+c);if(p)return p}}return null}return r(t)}function h(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(h);if(null===e||y.isValidElement(e))return!0;var t=x(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!h(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!h(o[1]))return!1}return!0;default:return!1}}function m(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":t}function v(e){var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){return e.constructor&&e.constructor.name?e.constructor.name:"<<anonymous>>"}var y=n(259),b=n(283),w=n(232),x=n(325),P="<<anonymous>>",_={array:o("array"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),any:i(),arrayOf:a,element:s(),instanceOf:u,node:f(),objectOf:l,oneOf:c,oneOfType:p,shape:d};e.exports=_},function(e){"use strict";function t(e){var t=e&&(n&&e[n]||e[r]);return"function"==typeof t?t:void 0}var n="function"==typeof Symbol&&Symbol.iterator,r="@@iterator";e.exports=t},function(e,t,n){"use strict";var r=n(327),o=n(329),i=n(256),a=(n(242),o.valueContextKey),s={mountWrapper:function(e,t,n){var r=n[a],o=null;if(null!=r)if(o=!1,Array.isArray(r)){for(var i=0;i<r.length;i++)if(""+r[i]==""+t.value){o=!0;break}}else o=""+r==""+t.value;e._wrapperState={selected:o}},getNativeProps:function(e,t){var n=i({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o="";return r.forEach(t.children,function(e){null!=e&&("string"==typeof e||"number"==typeof e)&&(o+=e)}),n.children=o,n}};e.exports=s},function(e,t,n){"use strict";function r(e){return(""+e).replace(w,"//")}function o(e,t){this.func=e,this.context=t,this.count=0}function i(e,t){var n=e.func,r=e.context;n.call(r,t,e.count++)}function a(e,t,n){if(null==e)return e;var r=o.getPooled(t,n);g(e,i,r),o.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var o=e.result,i=e.keyPrefix,a=e.func,s=e.context,u=a.call(s,t,e.count++);Array.isArray(u)?c(u,o,n,v.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,i+(u!==t?r(u.key||"")+"/":"")+n)),o.push(u))}function c(e,t,n,o,i){var a="";null!=n&&(a=r(n)+"/");var c=s.getPooled(t,a,o,i);g(e,u,c),s.release(c)}function l(e,t,n){if(null==e)return e;var r=[];return c(e,r,null,t,n),r}function p(){return null}function f(e){return g(e,p,null)}function d(e){var t=[];return c(e,t,null,v.thatReturnsArgument),t}var h=n(273),m=n(259),v=n(232),g=n(328),y=h.twoArgumentPooler,b=h.fourArgumentPooler,w=/\/(?!\/)/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,y),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(s,b);var x={forEach:a,map:l,mapIntoWithKeyPrefixInternal:c,count:f,toArray:d};e.exports=x},function(e,t,n){"use strict";function r(e){return m[e]}function o(e,t){return e&&null!=e.key?a(e.key):t.toString(36)}function i(e){return(""+e).replace(v,r)}function a(e){return"$"+i(e)}function s(e,t,n,r){var i=typeof e;if(("undefined"===i||"boolean"===i)&&(e=null),null===e||"string"===i||"number"===i||c.isValidElement(e))return n(r,e,""===t?d+o(e,0):t),1;var u,l,m=0,v=""===t?d:t+h;if(Array.isArray(e))for(var g=0;g<e.length;g++)u=e[g],l=v+o(u,g),m+=s(u,l,n,r);else{var y=p(e);if(y){var b,w=y.call(e);if(y!==e.entries)for(var x=0;!(b=w.next()).done;)u=b.value,l=v+o(u,x++),m+=s(u,l,n,r);else for(;!(b=w.next()).done;){var P=b.value;P&&(u=P[1],l=v+a(P[0])+h+o(u,0),m+=s(u,l,n,r))}}else if("object"===i){{String(e)}f(!1)}}return m}function u(e,t,n){return null==e?0:s(e,"",t,n)}var c=(n(222),n(259)),l=n(262),p=n(325),f=n(230),d=(n(242),l.SEPARATOR),h=":",m={"=":"=0",".":"=1",":":"=2"},v=/[=.:]/g;e.exports=u},function(e,t,n){"use strict";function r(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=a.getValue(e);null!=t&&o(this,e,t)}}function o(e,t,n){var r,o,i=s.getNode(e._rootNodeID).options;if(t){for(r={},o=0;o<n.length;o++)r[""+n[o]]=!0;for(o=0;o<i.length;o++){var a=r.hasOwnProperty(i[o].value);i[o].selected!==a&&(i[o].selected=a)}}else{for(r=""+n,o=0;o<i.length;o++)if(i[o].value===r)return void(i[o].selected=!0);i.length&&(i[0].selected=!0)}}function i(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);return this._wrapperState.pendingUpdate=!0,u.asap(r,this),n}var a=n(323),s=n(245),u=n(271),c=n(256),l=(n(242),"__ReactDOMSelect_value$"+Math.random().toString(36).slice(2)),p={valueContextKey:l,getNativeProps:function(e,t){return c({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=a.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,onChange:i.bind(e),wasMultiple:Boolean(t.multiple)}},processChildContext:function(e,t,n){var r=c({},n);return r[l]=e._wrapperState.initialValue,r},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=a.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,o(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?o(e,Boolean(t.multiple),t.defaultValue):o(e,Boolean(t.multiple),t.multiple?[]:""))}};e.exports=p},function(e,t,n){"use strict";function r(){this._rootNodeID&&l.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=i.executeOnChange(t,e);return s.asap(r,this),n}var i=n(323),a=n(244),s=n(271),u=n(256),c=n(230),l=(n(242),{getNativeProps:function(e,t){null!=t.dangerouslySetInnerHTML?c(!1):void 0;var n=u({},t,{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return n},mountWrapper:function(e,t){var n=t.defaultValue,r=t.children;null!=r&&(null!=n?c(!1):void 0,Array.isArray(r)&&(r.length<=1?void 0:c(!1),r=r[0]),n=""+r),null==n&&(n="");var a=i.getValue(t);e._wrapperState={initialValue:""+(null!=a?a:n),onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=i.getValue(t);null!=n&&a.updatePropertyByID(e._rootNodeID,"value",""+n)}});e.exports=l},function(e,t,n){"use strict";function r(e,t,n){v.push({parentID:e,parentNode:null,type:p.INSERT_MARKUP,markupIndex:g.push(t)-1, content:null,fromIndex:null,toIndex:n})}function o(e,t,n){v.push({parentID:e,parentNode:null,type:p.MOVE_EXISTING,markupIndex:null,content:null,fromIndex:t,toIndex:n})}function i(e,t){v.push({parentID:e,parentNode:null,type:p.REMOVE_NODE,markupIndex:null,content:null,fromIndex:t,toIndex:null})}function a(e,t){v.push({parentID:e,parentNode:null,type:p.SET_MARKUP,markupIndex:null,content:t,fromIndex:null,toIndex:null})}function s(e,t){v.push({parentID:e,parentNode:null,type:p.TEXT_CONTENT,markupIndex:null,content:t,fromIndex:null,toIndex:null})}function u(){v.length&&(l.processChildrenUpdates(v,g),c())}function c(){v.length=0,g.length=0}var l=n(281),p=n(233),f=(n(222),n(267)),d=n(332),h=n(333),m=0,v=[],g=[],y={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return d.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r){var o;return o=h(t),d.updateChildren(e,o,n,r)},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],i=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=this._rootNodeID+a,c=f.mountComponent(s,u,t,n);s._mountIndex=i++,o.push(c)}return o},updateTextContent:function(e){m++;var t=!0;try{var n=this._renderedChildren;d.unmountChildren(n);for(var r in n)n.hasOwnProperty(r)&&this._unmountChild(n[r]);this.setTextContent(e),t=!1}finally{m--,m||(t?c():u())}},updateMarkup:function(e){m++;var t=!0;try{var n=this._renderedChildren;d.unmountChildren(n);for(var r in n)n.hasOwnProperty(r)&&this._unmountChildByName(n[r],r);this.setMarkup(e),t=!1}finally{m--,m||(t?c():u())}},updateChildren:function(e,t,n){m++;var r=!0;try{this._updateChildren(e,t,n),r=!1}finally{m--,m||(r?c():u())}},_updateChildren:function(e,t,n){var r=this._renderedChildren,o=this._reconcilerUpdateChildren(r,e,t,n);if(this._renderedChildren=o,o||r){var i,a=0,s=0;for(i in o)if(o.hasOwnProperty(i)){var u=r&&r[i],c=o[i];u===c?(this.moveChild(u,s,a),a=Math.max(u._mountIndex,a),u._mountIndex=s):(u&&(a=Math.max(u._mountIndex,a),this._unmountChild(u)),this._mountChildByNameAtIndex(c,i,s,t,n)),s++}for(i in r)!r.hasOwnProperty(i)||o&&o.hasOwnProperty(i)||this._unmountChild(r[i])}},unmountChildren:function(){var e=this._renderedChildren;d.unmountChildren(e),this._renderedChildren=null},moveChild:function(e,t,n){e._mountIndex<n&&o(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){r(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){i(this._rootNodeID,e._mountIndex)},setTextContent:function(e){s(this._rootNodeID,e)},setMarkup:function(e){a(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,n,r,o){var i=this._rootNodeID+t,a=f.mountComponent(e,i,r,o);e._mountIndex=n,this.createChild(e,a)},_unmountChild:function(e){this.removeChild(e),e._mountIndex=null}}};e.exports=y},function(e,t,n){"use strict";function r(e,t,n){var r=void 0===e[n];null!=t&&r&&(e[n]=i(t,null))}var o=n(267),i=n(279),a=n(284),s=n(328),u=(n(242),{instantiateChildren:function(e){if(null==e)return null;var t={};return s(e,r,t),t},updateChildren:function(e,t,n,r){if(!t&&!e)return null;var s;for(s in t)if(t.hasOwnProperty(s)){var u=e&&e[s],c=u&&u._currentElement,l=t[s];if(null!=u&&a(c,l))o.receiveComponent(u,l,n,r),t[s]=u;else{u&&o.unmountComponent(u,s);var p=i(l,null);t[s]=p}}for(s in e)!e.hasOwnProperty(s)||t&&t.hasOwnProperty(s)||o.unmountComponent(e[s]);return t},unmountChildren:function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];o.unmountComponent(n)}}});e.exports=u},function(e,t,n){"use strict";function r(e,t,n){var r=e,o=void 0===r[n];o&&null!=t&&(r[n]=t)}function o(e){if(null==e)return e;var t={};return i(e,r,t),t}{var i=n(328);n(242)}e.exports=o},function(e){"use strict";function t(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(var i=n.bind(t),a=0;a<r.length;a++)if(!i(r[a])||e[r[a]]!==t[r[a]])return!1;return!0}var n=Object.prototype.hasOwnProperty;e.exports=t},function(e,t,n){"use strict";function r(e){var t=f.getID(e),n=p.getReactRootIDFromNodeID(t),r=f.findReactContainerForID(n),o=f.getFirstReactDOM(r);return o}function o(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function i(e){a(e)}function a(e){for(var t=f.getFirstReactDOM(m(e.nativeEvent))||window,n=t;n;)e.ancestors.push(n),n=r(n);for(var o=0;o<e.ancestors.length;o++){t=e.ancestors[o];var i=f.getID(t)||"";g._handleTopLevel(e.topLevelType,t,i,e.nativeEvent,m(e.nativeEvent))}}function s(e){var t=v(window);e(t)}var u=n(336),c=n(226),l=n(273),p=n(262),f=n(245),d=n(271),h=n(256),m=n(298),v=n(337);h(o.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),l.addPoolingTo(o,l.twoArgumentPooler);var g={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:c.canUseDOM?window:null,setHandleTopLevel:function(e){g._handleTopLevel=e},setEnabled:function(e){g._enabled=!!e},isEnabled:function(){return g._enabled},trapBubbledEvent:function(e,t,n){var r=n;return r?u.listen(r,t,g.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){var r=n;return r?u.capture(r,t,g.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=s.bind(null,e);u.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(g._enabled){var n=o.getPooled(e,t);try{d.batchedUpdates(i,n)}finally{o.release(n)}}}};e.exports=g},function(e,t,n){"use strict";var r=n(232),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},function(e){"use strict";function t(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=t},function(e,t,n){"use strict";var r=n(240),o=n(248),i=n(281),a=n(339),s=n(285),u=n(246),c=n(286),l=n(235),p=n(263),f=n(271),d={Component:i.injection,Class:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:o.injection,EventEmitter:u.injection,NativeComponent:c.injection,Perf:l.injection,RootIndex:p.injection,Updates:f.injection};e.exports=d},function(e,t,n){"use strict";function r(e,t){var n=P.hasOwnProperty(t)?P[t]:null;C.hasOwnProperty(t)&&(n!==w.OVERRIDE_BASE?v(!1):void 0),e.hasOwnProperty(t)&&(n!==w.DEFINE_MANY&&n!==w.DEFINE_MANY_MERGED?v(!1):void 0)}function o(e,t){if(t){"function"==typeof t?v(!1):void 0,f.isValidElement(t)?v(!1):void 0;var n=e.prototype;t.hasOwnProperty(b)&&_.mixins(e,t.mixins);for(var o in t)if(t.hasOwnProperty(o)&&o!==b){var i=t[o];if(r(n,o),_.hasOwnProperty(o))_[o](e,i);else{var a=P.hasOwnProperty(o),c=n.hasOwnProperty(o),l="function"==typeof i,p=l&&!a&&!c&&t.autobind!==!1;if(p)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[o]=i,n[o]=i;else if(c){var d=P[o];!a||d!==w.DEFINE_MANY_MERGED&&d!==w.DEFINE_MANY?v(!1):void 0,d===w.DEFINE_MANY_MERGED?n[o]=s(n[o],i):d===w.DEFINE_MANY&&(n[o]=u(n[o],i))}else n[o]=i}}}}function i(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in _;o?v(!1):void 0;var i=n in e;i?v(!1):void 0,e[n]=r}}}function a(e,t){e&&t&&"object"==typeof e&&"object"==typeof t?void 0:v(!1);for(var n in t)t.hasOwnProperty(n)&&(void 0!==e[n]?v(!1):void 0,e[n]=t[n]);return e}function s(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return a(o,n),a(o,r),o}}function u(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function c(e,t){var n=t.bind(e);return n}function l(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=c(e,n)}}var p=n(340),f=n(259),d=(n(282),n(283),n(341)),h=n(256),m=n(275),v=n(230),g=n(234),y=n(296),b=(n(242),y({mixins:null})),w=g({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),x=[],P={mixins:w.DEFINE_MANY,statics:w.DEFINE_MANY,propTypes:w.DEFINE_MANY,contextTypes:w.DEFINE_MANY,childContextTypes:w.DEFINE_MANY,getDefaultProps:w.DEFINE_MANY_MERGED,getInitialState:w.DEFINE_MANY_MERGED,getChildContext:w.DEFINE_MANY_MERGED,render:w.DEFINE_ONCE,componentWillMount:w.DEFINE_MANY,componentDidMount:w.DEFINE_MANY,componentWillReceiveProps:w.DEFINE_MANY,shouldComponentUpdate:w.DEFINE_ONCE,componentWillUpdate:w.DEFINE_MANY,componentDidUpdate:w.DEFINE_MANY,componentWillUnmount:w.DEFINE_MANY,updateComponent:w.OVERRIDE_BASE},_={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)o(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=h({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=h({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps=e.getDefaultProps?s(e.getDefaultProps,t):t},propTypes:function(e,t){e.propTypes=h({},e.propTypes,t)},statics:function(e,t){i(e,t)},autobind:function(){}},C={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e),t&&this.updater.enqueueCallback(this,t)},isMounted:function(){return this.updater.isMounted(this)},setProps:function(e,t){this.updater.enqueueSetProps(this,e),t&&this.updater.enqueueCallback(this,t)},replaceProps:function(e,t){this.updater.enqueueReplaceProps(this,e),t&&this.updater.enqueueCallback(this,t)}},E=function(){};h(E.prototype,p.prototype,C);var R={createClass:function(e){var t=function(e,t,n){this.__reactAutoBindMap&&l(this),this.props=e,this.context=t,this.refs=m,this.updater=n||d,this.state=null;var r=this.getInitialState?this.getInitialState():null;"object"!=typeof r||Array.isArray(r)?v(!1):void 0,this.state=r};t.prototype=new E,t.prototype.constructor=t,x.forEach(o.bind(null,t)),o(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),t.prototype.render?void 0:v(!1);for(var n in P)t.prototype[n]||(t.prototype[n]=null);return t},injection:{injectMixin:function(e){x.push(e)}}};e.exports=R},function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||o}{var o=n(341),i=(n(260),n(275)),a=n(230);n(242)}r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e?a(!1):void 0,this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t)},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e)};e.exports=r},function(e,t,n){"use strict";function r(e,t){}var o=(n(242),{isMounted:function(){return!1},enqueueCallback:function(){},enqueueForceUpdate:function(e){r(e,"forceUpdate")},enqueueReplaceState:function(e){r(e,"replaceState")},enqueueSetState:function(e){r(e,"setState")},enqueueSetProps:function(e){r(e,"setProps")},enqueueReplaceProps:function(e){r(e,"replaceProps")}});e.exports=o},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=!e&&s.useCreateElement}var o=n(272),i=n(273),a=n(246),s=n(258),u=n(343),c=n(274),l=n(256),p={initialize:u.getSelectionInformation,close:u.restoreSelection},f={initialize:function(){var e=a.isEnabled();return a.setEnabled(!1),e},close:function(e){a.setEnabled(e)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},h=[p,f,d],m={getTransactionWrappers:function(){return h},getReactMountReady:function(){return this.reactMountReady},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};l(r.prototype,c.Mixin,m),i.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e){return i(document.documentElement,e)}var o=n(344),i=n(276),a=n(312),s=n(346),u={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=s();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=s(),n=e.focusedElem,o=e.selectionRange;t!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,o),a(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=o.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if("undefined"==typeof r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",r-n),i.select()}else o.setOffsets(e,t)}};e.exports=u},function(e,t,n){"use strict";function r(e,t,n,r){return e===n&&t===r}function o(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 i(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(u){return null}var c=r(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=c?0:s.toString().length,p=s.cloneRange();p.selectNodeContents(e),p.setEnd(s.startContainer,s.startOffset);var f=r(p.startContainer,p.startOffset,p.endContainer,p.endOffset),d=f?0:p.toString().length,h=d+l,m=document.createRange();m.setStart(n,o),m.setEnd(i,a);var v=m.collapsed;return{start:v?h:d,end:v?d:h}}function a(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 s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[l()].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=c(e,o),u=c(e,i);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=n(226),c=n(345),l=n(292),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:p?o:i,setOffsets:p?a:s};e.exports=f},function(e){"use strict";function t(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function n(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function r(e,r){for(var o=t(e),i=0,a=0;o;){if(3===o.nodeType){if(a=i+o.textContent.length,r>=i&&a>=r)return{node:o,offset:r-i};i=a}o=t(n(o))}}e.exports=r},function(e){"use strict";function t(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(e){return document.body}}e.exports=t},function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&u.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function o(e,t){if(w||null==g||g!==l())return null;var n=r(g);if(!b||!d(b,n)){b=n;var o=c.getPooled(v.select,y,e,t);return o.type="select",o.target=g,a.accumulateTwoPhaseDispatches(o),o}return null}var i=n(247),a=n(290),s=n(226),u=n(343),c=n(294),l=n(346),p=n(299),f=n(296),d=n(334),h=i.topLevelTypes,m=s.canUseDOM&&"documentMode"in document&&document.documentMode<=11,v={select:{phasedRegistrationNames:{bubbled:f({onSelect:null}),captured:f({onSelectCapture:null})},dependencies:[h.topBlur,h.topContextMenu,h.topFocus,h.topKeyDown,h.topMouseDown,h.topMouseUp,h.topSelectionChange]}},g=null,y=null,b=null,w=!1,x=!1,P=f({onSelect:null}),_={eventTypes:v,extractEvents:function(e,t,n,r,i){if(!x)return null;switch(e){case h.topFocus:(p(t)||"true"===t.contentEditable)&&(g=t,y=n,b=null);break;case h.topBlur:g=null,y=null,b=null;break;case h.topMouseDown:w=!0;break;case h.topContextMenu:case h.topMouseUp:return w=!1,o(r,i);case h.topSelectionChange:if(m)break;case h.topKeyDown:case h.topKeyUp:return o(r,i)}return null},didPutListener:function(e,t){t===P&&(x=!0)}};e.exports=_},function(e){"use strict";var t=Math.pow(2,53),n={createReactRootIndex:function(){return Math.ceil(Math.random()*t)}};e.exports=n},function(e,t,n){"use strict";var r=n(247),o=n(336),i=n(290),a=n(245),s=n(350),u=n(294),c=n(351),l=n(352),p=n(303),f=n(355),d=n(356),h=n(304),m=n(357),v=n(232),g=n(353),y=n(230),b=n(296),w=r.topLevelTypes,x={abort:{phasedRegistrationNames:{bubbled:b({onAbort:!0}),captured:b({onAbortCapture:!0})}},blur:{phasedRegistrationNames:{bubbled:b({onBlur:!0}),captured:b({onBlurCapture:!0})}},canPlay:{phasedRegistrationNames:{bubbled:b({onCanPlay:!0}),captured:b({onCanPlayCapture:!0})}},canPlayThrough:{phasedRegistrationNames:{bubbled:b({onCanPlayThrough:!0}),captured:b({onCanPlayThroughCapture:!0})}},click:{phasedRegistrationNames:{bubbled:b({onClick:!0}),captured:b({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:b({onContextMenu:!0}),captured:b({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:b({onCopy:!0}),captured:b({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:b({onCut:!0}),captured:b({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:b({onDoubleClick:!0}),captured:b({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:b({onDrag:!0}),captured:b({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:b({onDragEnd:!0}),captured:b({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:b({onDragEnter:!0}),captured:b({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:b({onDragExit:!0}),captured:b({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:b({onDragLeave:!0}),captured:b({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:b({onDragOver:!0}),captured:b({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:b({onDragStart:!0}),captured:b({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:b({onDrop:!0}),captured:b({onDropCapture:!0})}},durationChange:{phasedRegistrationNames:{bubbled:b({onDurationChange:!0}),captured:b({onDurationChangeCapture:!0})}},emptied:{phasedRegistrationNames:{bubbled:b({onEmptied:!0}),captured:b({onEmptiedCapture:!0})}},encrypted:{phasedRegistrationNames:{bubbled:b({onEncrypted:!0}),captured:b({onEncryptedCapture:!0})}},ended:{phasedRegistrationNames:{bubbled:b({onEnded:!0}),captured:b({onEndedCapture:!0})}},error:{phasedRegistrationNames:{bubbled:b({onError:!0}),captured:b({onErrorCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:b({onFocus:!0}),captured:b({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:b({onInput:!0}),captured:b({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:b({onKeyDown:!0}),captured:b({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:b({onKeyPress:!0}),captured:b({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:b({onKeyUp:!0}),captured:b({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:b({onLoad:!0}),captured:b({onLoadCapture:!0})}},loadedData:{phasedRegistrationNames:{bubbled:b({onLoadedData:!0}),captured:b({onLoadedDataCapture:!0})}},loadedMetadata:{phasedRegistrationNames:{bubbled:b({onLoadedMetadata:!0}),captured:b({onLoadedMetadataCapture:!0})}},loadStart:{phasedRegistrationNames:{bubbled:b({onLoadStart:!0}),captured:b({onLoadStartCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:b({onMouseDown:!0}),captured:b({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:b({onMouseMove:!0}),captured:b({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:b({onMouseOut:!0}),captured:b({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:b({onMouseOver:!0}),captured:b({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:b({onMouseUp:!0}),captured:b({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:b({onPaste:!0}),captured:b({onPasteCapture:!0})}},pause:{phasedRegistrationNames:{bubbled:b({onPause:!0}),captured:b({onPauseCapture:!0})}},play:{phasedRegistrationNames:{bubbled:b({onPlay:!0}),captured:b({onPlayCapture:!0})}},playing:{phasedRegistrationNames:{bubbled:b({onPlaying:!0}),captured:b({onPlayingCapture:!0})}},progress:{phasedRegistrationNames:{bubbled:b({onProgress:!0}),captured:b({onProgressCapture:!0})}},rateChange:{phasedRegistrationNames:{bubbled:b({onRateChange:!0}),captured:b({onRateChangeCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:b({onReset:!0}),captured:b({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:b({onScroll:!0}),captured:b({onScrollCapture:!0})}},seeked:{phasedRegistrationNames:{bubbled:b({onSeeked:!0}),captured:b({onSeekedCapture:!0})}},seeking:{phasedRegistrationNames:{bubbled:b({onSeeking:!0}),captured:b({onSeekingCapture:!0})}},stalled:{phasedRegistrationNames:{bubbled:b({onStalled:!0}),captured:b({onStalledCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:b({onSubmit:!0}),captured:b({onSubmitCapture:!0})}},suspend:{phasedRegistrationNames:{bubbled:b({onSuspend:!0}),captured:b({onSuspendCapture:!0})}},timeUpdate:{phasedRegistrationNames:{bubbled:b({onTimeUpdate:!0}),captured:b({onTimeUpdateCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:b({onTouchCancel:!0}),captured:b({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:b({onTouchEnd:!0}),captured:b({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:b({onTouchMove:!0}),captured:b({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:b({onTouchStart:!0}),captured:b({onTouchStartCapture:!0})}},volumeChange:{phasedRegistrationNames:{bubbled:b({onVolumeChange:!0}),captured:b({onVolumeChangeCapture:!0})}},waiting:{phasedRegistrationNames:{bubbled:b({onWaiting:!0}),captured:b({onWaitingCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:b({onWheel:!0}),captured:b({onWheelCapture:!0})}}},P={topAbort:x.abort,topBlur:x.blur,topCanPlay:x.canPlay,topCanPlayThrough:x.canPlayThrough,topClick:x.click,topContextMenu:x.contextMenu,topCopy:x.copy,topCut:x.cut,topDoubleClick:x.doubleClick,topDrag:x.drag,topDragEnd:x.dragEnd,topDragEnter:x.dragEnter,topDragExit:x.dragExit,topDragLeave:x.dragLeave,topDragOver:x.dragOver,topDragStart:x.dragStart,topDrop:x.drop,topDurationChange:x.durationChange,topEmptied:x.emptied,topEncrypted:x.encrypted,topEnded:x.ended,topError:x.error,topFocus:x.focus,topInput:x.input,topKeyDown:x.keyDown,topKeyPress:x.keyPress,topKeyUp:x.keyUp,topLoad:x.load,topLoadedData:x.loadedData,topLoadedMetadata:x.loadedMetadata,topLoadStart:x.loadStart,topMouseDown:x.mouseDown,topMouseMove:x.mouseMove,topMouseOut:x.mouseOut,topMouseOver:x.mouseOver,topMouseUp:x.mouseUp,topPaste:x.paste,topPause:x.pause,topPlay:x.play,topPlaying:x.playing,topProgress:x.progress,topRateChange:x.rateChange,topReset:x.reset,topScroll:x.scroll,topSeeked:x.seeked,topSeeking:x.seeking,topStalled:x.stalled,topSubmit:x.submit,topSuspend:x.suspend,topTimeUpdate:x.timeUpdate,topTouchCancel:x.touchCancel,topTouchEnd:x.touchEnd,topTouchMove:x.touchMove,topTouchStart:x.touchStart,topVolumeChange:x.volumeChange,topWaiting:x.waiting,topWheel:x.wheel};for(var _ in P)P[_].dependencies=[_];var C=b({onClick:null}),E={},R={eventTypes:x,extractEvents:function(e,t,n,r,o){var a=P[e];if(!a)return null;var v;switch(e){case w.topAbort:case w.topCanPlay:case w.topCanPlayThrough:case w.topDurationChange:case w.topEmptied:case w.topEncrypted:case w.topEnded:case w.topError:case w.topInput:case w.topLoad:case w.topLoadedData:case w.topLoadedMetadata:case w.topLoadStart:case w.topPause:case w.topPlay:case w.topPlaying:case w.topProgress:case w.topRateChange:case w.topReset:case w.topSeeked:case w.topSeeking:case w.topStalled:case w.topSubmit:case w.topSuspend:case w.topTimeUpdate:case w.topVolumeChange:case w.topWaiting:v=u;break;case w.topKeyPress:if(0===g(r))return null;case w.topKeyDown:case w.topKeyUp:v=l;break;case w.topBlur:case w.topFocus:v=c;break;case w.topClick:if(2===r.button)return null;case w.topContextMenu:case w.topDoubleClick:case w.topMouseDown:case w.topMouseMove:case w.topMouseOut:case w.topMouseOver:case w.topMouseUp:v=p;break;case w.topDrag:case w.topDragEnd:case w.topDragEnter:case w.topDragExit:case w.topDragLeave:case w.topDragOver:case w.topDragStart:case w.topDrop:v=f;break;case w.topTouchCancel:case w.topTouchEnd:case w.topTouchMove:case w.topTouchStart:v=d;break;case w.topScroll:v=h;break;case w.topWheel:v=m;break;case w.topCopy:case w.topCut:case w.topPaste:v=s}v?void 0:y(!1);var b=v.getPooled(a,n,r,o);return i.accumulateTwoPhaseDispatches(b),b},didPutListener:function(e,t){if(t===C){var n=a.getNode(e);E[e]||(E[e]=o.listen(n,"click",v))}},willDeleteListener:function(e,t){t===C&&(E[e].remove(),delete E[e])}};e.exports=R},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(294),i={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(304),i={relatedTarget:null};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(304),i=n(353),a=n(354),s=n(305),u={key:a,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?i(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?i(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};o.augmentClass(r,u),e.exports=r},function(e){"use strict";function t(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}e.exports=t},function(e,t,n){"use strict";function r(e){if(e.key){var t=i[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=o(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var o=n(353),i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(303),i={dataTransfer:null};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(304),i=n(305),a={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:i};o.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){o.call(this,e,t,n,r)}var o=n(303),i={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};o.augmentClass(r,i),e.exports=r},function(e,t,n){"use strict";var r=n(240),o=r.injection.MUST_USE_ATTRIBUTE,i={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},a={Properties:{clipPath:o,cx:o,cy:o,d:o,dx:o,dy:o,fill:o,fillOpacity:o,fontFamily:o,fontSize:o,fx:o,fy:o,gradientTransform:o,gradientUnits:o,markerEnd:o,markerMid:o,markerStart:o,offset:o,opacity:o,patternContentUnits:o,patternUnits:o,points:o,preserveAspectRatio:o,r:o,rx:o,ry:o,spreadMethod:o,stopColor:o,stopOpacity:o,stroke:o,strokeDasharray:o,strokeLinecap:o,strokeOpacity:o,strokeWidth:o,textAnchor:o,transform:o,version:o,viewBox:o,x1:o,x2:o,x:o,xlinkActuate:o,xlinkArcrole:o,xlinkHref:o,xlinkRole:o,xlinkShow:o,xlinkTitle:o,xlinkType:o,xmlBase:o,xmlLang:o,xmlSpace:o,y1:o,y2:o,y:o},DOMAttributeNamespaces:{xlinkActuate:i.xlink,xlinkArcrole:i.xlink,xlinkHref:i.xlink,xlinkRole:i.xlink,xlinkShow:i.xlink,xlinkTitle:i.xlink,xlinkType:i.xlink,xmlBase:i.xml,xmlLang:i.xml,xmlSpace:i.xml},DOMAttributeNames:{clipPath:"clip-path",fillOpacity:"fill-opacity",fontFamily:"font-family",fontSize:"font-size",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",patternContentUnits:"patternContentUnits",patternUnits:"patternUnits",preserveAspectRatio:"preserveAspectRatio",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeLinecap:"stroke-linecap",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",viewBox:"viewBox",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xml:space"}};e.exports=a},function(e){"use strict";e.exports="0.14.2"},function(e,t,n){"use strict";var r=n(245);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";var r=n(288),o=n(362),i=n(359);r.inject();var a={renderToString:o.renderToString,renderToStaticMarkup:o.renderToStaticMarkup,version:i};e.exports=a},function(e,t,n){"use strict";function r(e){a.isValidElement(e)?void 0:h(!1);var t;try{p.injection.injectBatchingStrategy(c);var n=s.createReactRootID();return t=l.getPooled(!1),t.perform(function(){var r=d(e,null),o=r.mountComponent(n,t,f);return u.addChecksumToMarkup(o)},null)}finally{l.release(t),p.injection.injectBatchingStrategy(i)}}function o(e){a.isValidElement(e)?void 0:h(!1);var t;try{p.injection.injectBatchingStrategy(c);var n=s.createReactRootID();return t=l.getPooled(!0),t.perform(function(){var r=d(e,null);return r.mountComponent(n,t,f)},null)}finally{l.release(t),p.injection.injectBatchingStrategy(i)}}var i=n(309),a=n(259),s=n(262),u=n(265),c=n(363),l=n(364),p=n(271),f=n(275),d=n(279),h=n(230);e.exports={renderToString:r,renderToStaticMarkup:o}},function(e){"use strict";var t={isBatchingUpdates:!1,batchedUpdates:function(){}};e.exports=t},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=i.getPooled(null),this.useCreateElement=!1}var o=n(273),i=n(272),a=n(274),s=n(256),u=n(232),c={initialize:function(){this.reactMountReady.reset()},close:u},l=[c],p={getTransactionWrappers:function(){return l},getReactMountReady:function(){return this.reactMountReady},destructor:function(){i.release(this.reactMountReady),this.reactMountReady=null}};s(r.prototype,a.Mixin,p),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r=n(327),o=n(340),i=n(339),a=n(366),s=n(259),u=(n(367),n(324)),c=n(359),l=n(256),p=n(369),f=s.createElement,d=s.createFactory,h=s.cloneElement,m={Children:{map:r.map,forEach:r.forEach, count:r.count,toArray:r.toArray,only:p},Component:o,createElement:f,cloneElement:h,isValidElement:s.isValidElement,PropTypes:u,createClass:i.createClass,createFactory:d,createMixin:function(e){return e},DOM:a,version:c,__spread:l};e.exports=m},function(e,t,n){"use strict";function r(e){return o.createFactory(e)}var o=n(259),i=(n(367),n(368)),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",hgroup:"hgroup",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",image:"image",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},r);e.exports=a},function(e,t,n){"use strict";function r(){if(p.current){var e=p.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function o(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;{i("uniqueKey",e,t)}}}function i(e,t,n){var o=r();if(!o){var i="string"==typeof n?n:n.displayName||n.name;i&&(o=" Check the top-level render call using <"+i+">.")}var a=h[e]||(h[e]={});if(a[o])return null;a[o]=!0;var s={parentOrOwner:o,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==p.current&&(s.childOwner=" It was passed a child from "+t._owner.getName()+"."),s}function a(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];c.isValidElement(r)&&o(r,t)}else if(c.isValidElement(e))e._store&&(e._store.validated=!0);else if(e){var i=f(e);if(i&&i!==e.entries)for(var a,s=i.call(e);!(a=s.next()).done;)c.isValidElement(a.value)&&o(a.value,t)}}function s(e,t,n,o){for(var i in t)if(t.hasOwnProperty(i)){var a;try{"function"!=typeof t[i]?d(!1):void 0,a=t[i](n,i,e,o)}catch(s){a=s}if(a instanceof Error&&!(a.message in m)){m[a.message]=!0;{r()}}}}function u(e){var t=e.type;if("function"==typeof t){var n=t.displayName||t.name;t.propTypes&&s(n,t.propTypes,e.props,l.prop),"function"==typeof t.getDefaultProps}}var c=n(259),l=n(282),p=(n(283),n(222)),f=(n(260),n(325)),d=n(230),h=(n(242),{}),m={},v={createElement:function(e){var t="string"==typeof e||"function"==typeof e,n=c.createElement.apply(this,arguments);if(null==n)return n;if(t)for(var r=2;r<arguments.length;r++)a(arguments[r],e);return u(n),n},createFactory:function(e){var t=v.createElement.bind(null,e);return t.type=e,t},cloneElement:function(){for(var e=c.cloneElement.apply(this,arguments),t=2;t<arguments.length;t++)a(arguments[t],e.type);return u(e),e}};e.exports=v},function(e){"use strict";function t(e,t,r){if(!e)return null;var o={};for(var i in e)n.call(e,i)&&(o[i]=t.call(r,e[i],i,e));return o}var n=Object.prototype.hasOwnProperty;e.exports=t},function(e,t,n){"use strict";function r(e){return o.isValidElement(e)?void 0:i(!1),e}var o=n(259),i=n(230);e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,o){return o}n(256),n(242);e.exports=r},function(e,t,n){(function(t){e.exports=t.ReactDOM=n(372)}).call(t,function(){return this}())},function(e,t,n){"use strict";e.exports=n(221)},function(e,t,n){"use strict";function r(e){var t="string"==typeof e,n=void 0;if(n=t?document.querySelector(e):e,!o(n)){var r="Container must be `string` or `HTMLElement`.";throw t&&(r+=" Unable to find "+e),new Error(r)}return n}function o(e){return e instanceof HTMLElement||!!e&&e.nodeType>0}function i(e){var t=1===e.button;return t||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function a(e){return function(t,n){return t||n?t&&!n?e+"--"+t:t&&n?e+"--"+t+"__"+n:!t&&n?e+"__"+n:void 0:e}}function s(e){var t=e.transformData,n=e.defaultTemplates,r=e.templates,o=e.templatesConfig,i=u(n,r);return p({transformData:t,templatesConfig:o},i)}function u(e,t){return f(e,function(e,n,r){var o=t&&void 0!==t[r]&&t[r]!==n;return o?(e.templates[r]=t[r],e.useCustomCompileOptions[r]=!0):(e.templates[r]=n,e.useCustomCompileOptions[r]=!1),e},{templates:{},useCustomCompileOptions:{}})}function c(e,t,n){var r={attributeName:e,name:t},o=h(n,function(t){return t.name===e});if(void 0!==o){var i=m(o,"data."+t),a=m(o,"exhaustive");void 0!==i&&(r.count=i),void 0!==a&&(r.exhaustive=a)}return r}function l(e,t){var n=[];return d(t.facetsRefinements,function(t,r){d(t,function(t){n.push(c(r,t,e.facets))})}),d(t.facetsExcludes,function(e,t){d(e,function(e){n.push({attributeName:t,name:e,exclude:!0})})}),d(t.disjunctiveFacetsRefinements,function(t,r){d(t,function(t){n.push(c(r,t,e.disjunctiveFacets))})}),d(t.hierarchicalFacetsRefinements,function(t,r){d(t,function(t){n.push(c(r,t,e.hierarchicalFacets))})}),d(t.numericRefinements,function(e,t){d(e,function(e,r){d(e,function(e){n.push({attributeName:t,name:e,operator:r})})})}),d(t.tagRefinements,function(e){n.push({attributeName:"_tags",name:e})}),n}var p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=n(111),d=n(17),h=n(128),m=n(374),v={getContainerNode:r,bemHelper:a,prepareTemplateProps:s,isSpecialClick:i,isDomElement:o,getRefinements:l};e.exports=v},function(e,t,n){function r(e,t,n){var r=null==e?void 0:o(e,i(t),t+"");return void 0===r?n:r}var o=n(99),i=n(103);e.exports=r},function(e,t,n){var r;!function(){"use strict";function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e+=" "+n;else if(Array.isArray(n))e+=" "+o.apply(null,n);else if("object"===r)for(var a in n)i.call(n,a)&&n[a]&&(e+=" "+a)}}return e.substr(1)}var i={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?e.exports=o:(r=function(){return o}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=function(t){function n(){r(this,n),s(Object.getPrototypeOf(n.prototype),"constructor",this).apply(this,arguments)}return o(n,t),a(n,[{key:"componentDidMount",value:function(){this._hideOrShowContainer(this.props)}},{key:"componentWillReceiveProps",value:function(e){this._hideOrShowContainer(e)}},{key:"_hideOrShowContainer",value:function(e){var t=c.findDOMNode(this).parentNode;t.style.display=e.shouldAutoHideContainer===!0?"none":""}},{key:"render",value:function(){return this.props.shouldAutoHideContainer===!0?u.createElement("div",null):u.createElement(e,this.props)}}]),n}(u.Component);return t.propTypes={shouldAutoHideContainer:u.PropTypes.bool.isRequired},t.displayName=e.name+"-AutoHide",t}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},u=n(218),c=n(371);e.exports=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=function(t){function n(){r(this,n),u(Object.getPrototypeOf(n.prototype),"constructor",this).apply(this,arguments)}return o(n,t),s(n,[{key:"getTemplate",value:function(e){var t=this.props.templateProps.templates;if(!t||!t[e])return null;var n=l(this.props.cssClasses[e],"ais-"+e);return c.createElement(p,a({},this.props.templateProps,{cssClass:n,templateKey:e,transformData:null}))}},{key:"render",value:function(){var t={root:l(this.props.cssClasses.root),body:l(this.props.cssClasses.body)},n=this.getTemplate("header"),r=this.getTemplate("footer");return c.createElement("div",{className:t.root},n,c.createElement("div",{className:t.body},c.createElement(e,this.props)),r)}}]),n}(c.Component);return t.propTypes={cssClasses:c.PropTypes.shape({root:c.PropTypes.string,header:c.PropTypes.string,body:c.PropTypes.string,footer:c.PropTypes.string}),templateProps:c.PropTypes.object},t.defaultProps={cssClasses:{}},t.displayName=e.name+"-HeaderFooter",t}var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},c=n(218),l=n(375),p=n(378);e.exports=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t,n){if(!e)return n;var r=void 0;if("function"==typeof e)r=e(n);else{if("object"!=typeof e)throw new Error("`transformData` must be a function or an object");r=e[t]?e[t](n):n}var o=typeof r,i=typeof n;if(o!==i)throw new Error("`transformData` must return a `"+i+"`, got `"+o+"`.");return r}function a(e){var t=e.template,n=e.compileOptions,r=e.helpers,o=e.data,i="string"==typeof t,a="function"==typeof t;if(i||a){if(a)return t(o);var c=s(r,n,o),l=u({},o,{helpers:c});return h.compile(t,n).render(l)}throw new Error("Template must be `string` or `function`")}function s(e,t,n){return f(e,function(e){return d(function(r){var o=this,i=function(e){return h.compile(e,t).render(o)};return e.call(n,r,i)})})}var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},p=n(218),f=n(209),d=n(379),h=n(381),m=function(e){function t(){r(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),c(t,[{key:"render",value:function(){var e=this.props.useCustomCompileOptions[this.props.templateKey]?this.props.templatesConfig.compileOptions:{},t=a({template:this.props.templates[this.props.templateKey],compileOptions:e,helpers:this.props.templatesConfig.helpers,data:i(this.props.transformData,this.props.templateKey,this.props.data)});return null===t?null:p.createElement("div",{className:this.props.cssClass,dangerouslySetInnerHTML:{__html:t}})}}]),t}(p.Component);m.propTypes={cssClass:p.PropTypes.string,data:p.PropTypes.object,templateKey:p.PropTypes.string,templates:p.PropTypes.objectOf(p.PropTypes.oneOfType([p.PropTypes.string,p.PropTypes.func])),templatesConfig:p.PropTypes.shape({helpers:p.PropTypes.objectOf(p.PropTypes.func),compileOptions:p.PropTypes.shape({asString:p.PropTypes.bool,sectionTags:p.PropTypes.arrayOf(p.PropTypes.shape({o:p.PropTypes.string,c:p.PropTypes.string})),delimiters:p.PropTypes.string,disableLambda:p.PropTypes.bool})}),transformData:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.objectOf(p.PropTypes.func)]),useCustomCompileOptions:p.PropTypes.objectOf(p.PropTypes.bool)},m.defaultProps={data:{},useCustomCompileOptions:{},templates:{},templatesConfig:{}},e.exports=m},function(e,t,n){var r=n(380),o=8,i=r(o);i.placeholder={},e.exports=i},function(e,t,n){function r(e){function t(n,r,a){a&&i(n,r,a)&&(r=void 0);var s=o(n,e,void 0,void 0,void 0,void 0,void 0,r);return s.placeholder=t.placeholder,s}return t}var o=n(160),i=n(52);e.exports=r},function(e,t,n){var r=n(382);r.Template=n(383).Template,r.template=r.Template,e.exports=r},function(e,t){!function(e){function t(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function n(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function r(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,o=e.length;o>r;r++)if(t.charAt(n+r)!=e.charAt(r))return!1;return!0}function o(t,n,r,s){var u=[],c=null,l=null,p=null;for(l=r[r.length-1];t.length>0;){if(p=t.shift(),l&&"<"==l.tag&&!(p.tag in x))throw new Error("Illegal content in < super tag.");if(e.tags[p.tag]<=e.tags.$||i(p,s))r.push(p),p.nodes=o(t,p.tag,r,s);else{if("/"==p.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+p.n);if(c=r.pop(),p.n!=c.n&&!a(p.n,c.n,s))throw new Error("Nesting error: "+c.n+" vs. "+p.n);return c.end=p.i,u}"\n"==p.tag&&(p.last=0==t.length||"\n"==t[0].tag)}u.push(p)}if(r.length>0)throw new Error("missing closing tag: "+r.pop().n);return u}function i(e,t){for(var n=0,r=t.length;r>n;n++)if(t[n].o==e.n)return e.tag="#",!0}function a(e,t,n){for(var r=0,o=n.length;o>r;r++)if(n[r].c==e&&n[r].o==t)return!0}function s(e){var t=[];for(var n in e)t.push('"'+c(n)+'": function(c,p,t,i) {'+e[n]+"}");return"{ "+t.join(",")+" }"}function u(e){var t=[];for(var n in e.partials)t.push('"'+c(n)+'":{name:"'+c(e.partials[n].name)+'", '+u(e.partials[n])+"}");return"partials: {"+t.join(",")+"}, subs: "+s(e.subs)}function c(e){return e.replace(y,"\\\\").replace(m,'\\"').replace(v,"\\n").replace(g,"\\r").replace(b,"\\u2028").replace(w,"\\u2029")}function l(e){return~e.indexOf(".")?"d":"f"}function p(e,t){var n="<"+(t.prefix||""),r=n+e.n+P++;return t.partials[r]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+c(r)+'",c,p,"'+(e.indent||"")+'"));',r}function f(e,t){t.code+="t.b(t.t(t."+l(e.n)+'("'+c(e.n)+'",c,p,0)));'}function d(e){return"t.b("+e+");"}var h=/\S/,m=/\"/g,v=/\n/g,g=/\r/g,y=/\\/g,b=/\u2028/,w=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(o,i){function a(){y.length>0&&(b.push({tag:"_t",text:new String(y)}),y="")}function s(){for(var t=!0,n=P;n<b.length;n++)if(t=e.tags[b[n].tag]<e.tags._v||"_t"==b[n].tag&&null===b[n].text.match(h),!t)return!1;return t}function u(e,t){if(a(),e&&s())for(var n,r=P;r<b.length;r++)b[r].text&&((n=b[r+1])&&">"==n.tag&&(n.indent=b[r].text.toString()),b.splice(r,1));else t||b.push({tag:"\n"});w=!1,P=b.length}function c(e,t){var r="="+C,o=e.indexOf(r,t),i=n(e.substring(e.indexOf("=",t)+1,o)).split(" ");return _=i[0],C=i[i.length-1],o+r.length-1}var l=o.length,p=0,f=1,d=2,m=p,v=null,g=null,y="",b=[],w=!1,x=0,P=0,_="{{",C="}}";for(i&&(i=i.split(" "),_=i[0],C=i[1]),x=0;l>x;x++)m==p?r(_,o,x)?(--x,a(),m=f):"\n"==o.charAt(x)?u(w):y+=o.charAt(x):m==f?(x+=_.length-1,g=e.tags[o.charAt(x+1)],v=g?o.charAt(x+1):"_v","="==v?(x=c(o,x),m=p):(g&&x++,m=d),w=x):r(C,o,x)?(b.push({tag:v,n:n(y),otag:_,ctag:C,i:"/"==v?w-_.length:x+C.length}),y="",x+=C.length-1,m=p,"{"==v&&("}}"==C?x++:t(b[b.length-1]))):y+=o.charAt(x);return u(w,!0),b};var x={_t:!0,"\n":!0,$:!0,"/":!0};e.stringify=function(t){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+u(t)+"}"};var P=0;e.generate=function(t,n,r){P=0;var o={code:"",subs:{},partials:{}};return e.walk(t,o),r.asString?this.stringify(o,n,r):this.makeTemplate(o,n,r)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},e.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},e.codegen={"#":function(t,n){n.code+="if(t.s(t."+l(t.n)+'("'+c(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,n),n.code+="});c.pop();}"},"^":function(t,n){n.code+="if(!t.s(t."+l(t.n)+'("'+c(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,n),n.code+="};"},">":p,"<":function(t,n){var r={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,r);var o=n.partials[p(t,n)];o.subs=r.subs,o.partials=r.partials},$:function(t,n){var r={subs:{},code:"",partials:n.partials,prefix:t.n};e.walk(t.nodes,r),n.subs[t.n]=r.code,n.inPartial||(n.code+='t.sub("'+c(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=d('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+l(e.n)+'("'+c(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=d('"'+c(e.text)+'"')},"{":f,"&":f},e.walk=function(t,n){for(var r,o=0,i=t.length;i>o;o++)r=e.codegen[t[o].tag],r&&r(t[o],n);return n},e.parse=function(e,t,n){return n=n||{},o(e,"",[],n.sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,n){n=n||{};var r=e.cacheKey(t,n),o=this.cache[r];if(o){var i=o.partials;for(var a in i)delete i[a].instance;return o}return o=this.generate(this.parse(this.scan(t,n.delimiters),t,n),t,n),this.cache[r]=o}}(t)},function(e,t){!function(e){function t(e,t,n){var r;return t&&"object"==typeof t&&(void 0!==t[e]?r=t[e]:n&&t.get&&"function"==typeof t.get&&(r=t.get(e))),r}function n(e,t,n,r,o,i){function a(){}function s(){}a.prototype=e,s.prototype=e.subs;var u,c=new a;c.subs=new s,c.subsText={},c.buf="",r=r||{},c.stackSubs=r,c.subsText=i;for(u in t)r[u]||(r[u]=t[u]);for(u in r)c.subs[u]=r[u];o=o||{},c.stackPartials=o;for(u in n)o[u]||(o[u]=n[u]);for(u in o)c.partials[u]=o[u];return c}function r(e){return String(null===e||void 0===e?"":e)}function o(e){return e=r(e),l.test(e)?e.replace(i,"&amp;").replace(a,"&lt;").replace(s,"&gt;").replace(u,"&#39;").replace(c,"&quot;"):e}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(){return""},v:o,t:r,render:function(e,t,n){return this.ri([e],t||{},n)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var r=this.partials[e],o=t[r.name];if(r.instance&&r.base==o)return r.instance;if("string"==typeof o){if(!this.c)throw new Error("No compiler available.");o=this.c.compile(o,this.options)}if(!o)return null;if(this.partials[e].base=o,r.subs){t.stackText||(t.stackText={});for(key in r.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);o=n(o,r.subs,r.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=o,o},rp:function(e,t,n,r){var o=this.ep(e,n);return o?o.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(!p(r))return void n(e,t,this);for(var o=0;o<r.length;o++)e.push(r[o]),n(e,t,this),e.pop()},s:function(e,t,n,r,o,i,a){var s;return p(e)&&0===e.length?!1:("function"==typeof e&&(e=this.ms(e,t,n,r,o,i,a)),s=!!e,!r&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,n,r,o){var i,a=e.split("."),s=this.f(a[0],n,r,o),u=this.options.modelGet,c=null;if("."===e&&p(n[n.length-2]))s=n[n.length-1];else for(var l=1;l<a.length;l++)i=t(a[l],s,u),void 0!==i?(c=s,s=i):s="";return o&&!s?!1:(o||"function"!=typeof s||(n.push(c),s=this.mv(s,n,r),n.pop()),s)},f:function(e,n,r,o){for(var i=!1,a=null,s=!1,u=this.options.modelGet,c=n.length-1;c>=0;c--)if(a=n[c],i=t(e,a,u),void 0!==i){s=!0;break}return s?(o||"function"!=typeof i||(i=this.mv(i,n,r)),i):o?!1:""},ls:function(e,t,n,o,i){var a=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(r(e.call(t,o)),t,n)),this.options.delimiters=a,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,n,r,o,i,a){var s,u=t[t.length-1],c=e.call(u);return"function"==typeof c?r?!0:(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,u,n,s.substring(o,i),a)):c},mv:function(e,t,n){var o=t[t.length-1],i=e.call(o);return"function"==typeof i?this.ct(r(i.call(o)),o,n):i},sub:function(e,t,n,r){var o=this.subs[e];o&&(this.activeSub=e,o(t,n,this,r),this.activeSub=!1)}};var i=/&/g,a=/</g,s=/>/g,u=/\'/g,c=/\"/g,l=/[&<>\"\']/,p=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(t)},function(e){"use strict";e.exports={header:"",link:"Clear all",footer:""}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},u=n(218),c=n(378),l=n(373),p=l.isSpecialClick,f=function(e){function t(){r(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"handleClick",value:function(e){p(e)||(e.preventDefault(),this.props.clearAll())}},{key:"render",value:function(){var e=this.props.cssClasses.link,t={hasRefinements:this.props.hasRefinements};return u.createElement("a",{className:e,href:this.props.url,onClick:this.handleClick.bind(this)},u.createElement(c,i({data:t,templateKey:"link"},this.props.templateProps)))}}]),t}(u.Component);f.propTypes={clearAll:u.PropTypes.func.isRequired,cssClasses:u.PropTypes.shape({link:u.PropTypes.string}),hasRefinements:u.PropTypes.bool.isRequired,templateProps:u.PropTypes.object.isRequired,url:u.PropTypes.string.isRequired},e.exports=f},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.attributes,a=e.separator,v=void 0===a?" > ":a,g=e.limit,y=void 0===g?1e3:g,b=e.sortBy,w=void 0===b?["name:asc"]:b,x=e.cssClasses,P=void 0===x?{}:x,_=e.autoHideContainer,C=void 0===_?!0:_,E=e.templates,R=void 0===E?h:E,T=e.transformData;if(!t||!r||!r.length)throw new Error(m);var O=c.getContainerNode(t),S=d(n(388));C===!0&&(S=f(S));var N=r[0];return{getConfiguration:function(){return{hierarchicalFacets:[{name:N,attributes:r,separator:v}]}},render:function(e){var t=e.results,n=e.helper,r=e.templatesConfig,a=e.createURL,f=e.state,d=i(t,N,w,y),m=0===d.length,v=c.prepareTemplateProps({transformData:T,defaultTemplates:h,templatesConfig:r,templates:R}),g={root:p(l(null),P.root),header:p(l("header"),P.header),body:p(l("body"),P.body),footer:p(l("footer"),P.footer),list:p(l("list"),P.list),depth:l("list","lvl"),item:p(l("item"),P.item),active:p(l("item","active"),P.active),link:p(l("link"),P.link),count:p(l("count"),P.count)};u.render(s.createElement(S,{attributeNameKey:"path",createURL:function(e){return a(f.toggleRefinement(N,e))},cssClasses:g,facetValues:d,shouldAutoHideContainer:m,templateProps:v,toggleRefinement:o.bind(null,n,N)}),O)}}}function o(e,t,n){e.toggleRefinement(t,n).search()}function i(e,t,n,r){var o=e.getFacetValues(t,{sortBy:n}).data||[];return a(o,r)}function a(e,t){return e.slice(0,t).map(function(e){return Array.isArray(e.data)&&(e.data=a(e.data,t)),e})}var s=n(218),u=n(371),c=n(373),l=c.bemHelper("ais-hierarchical-menu"),p=n(375),f=n(376),d=n(377),h=n(387),m="Usage:\nhierarchicalMenu({\n container,\n attributes,\n [ separator=' > ' ],\n [ limit=1000 ],\n [ sortBy=['name:asc'] ],\n [ cssClasses.{root , header, body, footer, list, depth, item, active, link}={} ],\n [ templates.{header, item, footer} ],\n [ transformData ],\n [ autoHideContainer=true ]\n})";e.exports=r},function(e){"use strict";e.exports={header:"",item:'<a class="{{cssClasses.link}}" href="{{url}}">{{name}} <span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span></a>',footer:""}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},c=n(218),l=n(375),p=n(378),f=n(373),d=f.isSpecialClick,h=function(e){function t(){o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),s(t,[{key:"refine",value:function(e){this.props.toggleRefinement(e)}},{key:"_generateFacetItem",value:function(e){var n=void 0,o=e.data&&e.data.length>0;o&&(n=c.createElement(t,a({},this.props,{depth:this.props.depth+1,facetValues:e.data})));var i=e;this.props.createURL&&(i.url=this.props.createURL(e[this.props.attributeNameKey]));var s=a({},e,{cssClasses:this.props.cssClasses}),u=l(this.props.cssClasses.item,r({},this.props.cssClasses.active,e.isRefined)),f=e[this.props.attributeNameKey];return void 0!==e.isRefined&&(f+="/"+e.isRefined),void 0!==e.count&&(f+="/"+e.count),c.createElement("div",{className:u,key:f,onClick:this.handleClick.bind(this,e[this.props.attributeNameKey])},c.createElement(p,a({data:s,templateKey:"item"},this.props.templateProps)),n)}},{key:"handleClick",value:function(e,t){if(!d(t)){if("INPUT"===t.target.tagName)return void this.refine(e);for(var n=t.target;n!==t.currentTarget;){if("LABEL"===n.tagName&&(n.querySelector('input[type="checkbox"]')||n.querySelector('input[type="radio"]')))return;"A"===n.tagName&&n.href&&t.preventDefault(),n=n.parentNode}t.stopPropagation(),this.refine(e)}}},{key:"render",value:function(){var e=[this.props.cssClasses.list];return this.props.cssClasses.depth&&e.push(""+this.props.cssClasses.depth+this.props.depth),c.createElement("div",{className:l(e)},this.props.facetValues.map(this._generateFacetItem,this))}}]),t}(c.Component);h.propTypes={Template:c.PropTypes.func,attributeNameKey:c.PropTypes.string,createURL:c.PropTypes.func.isRequired,cssClasses:c.PropTypes.shape({active:c.PropTypes.string,depth:c.PropTypes.string,item:c.PropTypes.string,list:c.PropTypes.string}),depth:c.PropTypes.number,facetValues:c.PropTypes.array,templateProps:c.PropTypes.object.isRequired,toggleRefinement:c.PropTypes.func.isRequired},h.defaultProps={cssClasses:{},depth:0,attributeNameKey:"name"},e.exports=h},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.cssClasses,r=void 0===n?{}:n,f=e.templates,d=void 0===f?l:f,h=e.transformData,m=e.hitsPerPage,v=void 0===m?20:m;if(!t)throw new Error(p);var g=a.getContainerNode(t),y={root:u(s(null),r.root),item:u(s("item"),r.item),empty:u(s(null,"empty"),r.empty)};return{getConfiguration:function(){return{hitsPerPage:v}},render:function(e){var t=e.results,n=e.templatesConfig,r=a.prepareTemplateProps({transformData:h,defaultTemplates:l,templatesConfig:n,templates:d});i.render(o.createElement(c,{cssClasses:y,hits:t.hits,results:t,templateProps:r}),g)}}}var o=n(218),i=n(371),a=n(373),s=a.bemHelper("ais-hits"),u=n(375),c=n(390),l=n(391),p="Usage:\nhits({\n container,\n [ cssClasses.{root,empty,item}={} ],\n [ templates.{empty,item} ],\n [ transformData.{empty=identity,item=identity} ],\n [ hitsPerPage=20 ]\n})";e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){ var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},u=n(218),c=n(108),l=n(378),p=function(e){function t(){r(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"renderWithResults",value:function(){var e=this,t=c(this.props.results.hits,function(t){return u.createElement(l,i({cssClass:e.props.cssClasses.item,data:t,key:t.objectID,templateKey:"item"},e.props.templateProps))});return u.createElement("div",{className:this.props.cssClasses.root},t)}},{key:"renderNoResults",value:function(){var e=this.props.cssClasses.root+" "+this.props.cssClasses.empty;return u.createElement(l,i({cssClass:e,data:this.props.results,templateKey:"empty"},this.props.templateProps))}},{key:"render",value:function(){return this.props.results.hits.length>0?this.renderWithResults():this.renderNoResults()}}]),t}(u.Component);p.propTypes={cssClasses:u.PropTypes.shape({root:u.PropTypes.string,item:u.PropTypes.string,empty:u.PropTypes.string}),results:u.PropTypes.object,templateProps:u.PropTypes.object.isRequired},p.defaultProps={results:{hits:[]}},e.exports=p},function(e){"use strict";e.exports={empty:"No results",item:function(e){return JSON.stringify(e,null,2)}}},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.options,f=e.cssClasses,d=void 0===f?{}:f,h=e.autoHideContainer,m=void 0===h?!1:h;if(!t||!r)throw new Error(p);var v=a.getContainerNode(t),g=n(396);return m===!0&&(g=l(g)),{init:function(e){var t=e.state,n=s(r,function(e){return+t.hitsPerPage===+e.value});n||(void 0===t.hitsPerPage?window.console&&window.console.log("[Warning][hitsPerPageSelector] hitsPerPage not defined.You should probably used a `hits` widget or set the value `hitsPerPage` using the searchParameters attribute of the instantsearch constructor."):window.console&&window.console.log("[Warning][hitsPerPageSelector] No option in `options` with `value: hitsPerPage` (hitsPerPage: "+t.hitsPerPage+")"),r=[{value:void 0,label:""}].concat(r))},setHitsPerPage:function(e,t){e.setQueryParameter("hitsPerPage",+t),e.search()},render:function(e){var t=e.helper,n=e.state,a=e.results,s=n.hitsPerPage,l=0===a.nbHits,p=this.setHitsPerPage.bind(this,t),f={root:c(u(null),d.root),item:c(u("item"),d.item)};i.render(o.createElement(g,{cssClasses:f,currentValue:s,options:r,setValue:p,shouldAutoHideContainer:l}),v)}}}var o=n(218),i=n(371),a=n(373),s=n(393),u=a.bemHelper("ais-hits-per-page-selector"),c=n(375),l=n(376),p="Usage:\nhitsPerPageSelector({\n container,\n options,\n [ cssClasses.{root,item}={} ],\n [ autoHideContainer=false ]\n})";e.exports=r},function(e,t,n){e.exports=n(394)},function(e,t,n){function r(e,t,n){var r=s(e)?o:a;return n&&u(e,t,n)&&(t=void 0),("function"!=typeof t||void 0!==n)&&(t=i(t,n,3)),r(e,t)}var o=n(92),i=n(86),a=n(395),s=n(36),u=n(52);e.exports=r},function(e,t,n){function r(e,t){var n;return o(e,function(e,r,o){return n=t(e,r,o),!n}),!!n}var o=n(19);e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},s=n(218),u=function(e){function t(){r(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),i(t,[{key:"handleChange",value:function(e){this.props.setValue(e.target.value)}},{key:"render",value:function(){var e=this,t=this.props,n=t.currentValue,r=t.options,o=this.handleChange.bind(this);return s.createElement("select",{className:this.props.cssClasses.root,defaultValue:n,onChange:o},r.map(function(t){return s.createElement("option",{className:e.props.cssClasses.item,key:t.value,value:t.value},t.label)}))}}]),t}(s.Component);u.propTypes={cssClasses:s.PropTypes.shape({root:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.arrayOf(s.PropTypes.string)]),item:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.arrayOf(s.PropTypes.string)])}),currentValue:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.number]).isRequired,options:s.PropTypes.arrayOf(s.PropTypes.shape({value:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.number]).isRequired,label:s.PropTypes.string.isRequired})).isRequired,setValue:s.PropTypes.func.isRequired},e.exports=u},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.attributeName,m=e.sortBy,v=void 0===m?["count:desc"]:m,g=e.limit,y=void 0===g?100:g,b=e.cssClasses,w=void 0===b?{}:b,x=e.templates,P=void 0===x?d:x,_=e.transformData,C=e.autoHideContainer,E=void 0===C?!0:C;if(!t||!r)throw new Error(h);var R=u.getContainerNode(t),T=f(n(388));E===!0&&(T=p(T));var O=r;return{getConfiguration:function(){return{hierarchicalFacets:[{name:O,attributes:[r]}]}},render:function(e){var t=e.results,n=e.helper,r=e.templatesConfig,p=e.state,f=e.createURL,h=i(t,O,v,y),m=0===h.length,g=u.prepareTemplateProps({transformData:_,defaultTemplates:d,templatesConfig:r,templates:P}),b={root:l(c(null),w.root),header:l(c("header"),w.header),body:l(c("body"),w.body),footer:l(c("footer"),w.footer),list:l(c("list"),w.list),item:l(c("item"),w.item),active:l(c("item","active"),w.active),link:l(c("link"),w.link),count:l(c("count"),w.count)};s.render(a.createElement(T,{createURL:function(e){return f(p.toggleRefinement(O,e))},cssClasses:b,facetValues:h,shouldAutoHideContainer:m,templateProps:g,toggleRefinement:o.bind(null,n,O)}),R)}}}function o(e,t,n){e.toggleRefinement(t,n).search()}function i(e,t,n,r){var o=e.getFacetValues(t,{sortBy:n});return o.data&&o.data.slice(0,r)||[]}var a=n(218),s=n(371),u=n(373),c=u.bemHelper("ais-menu"),l=n(375),p=n(376),f=n(377),d=n(398),h="Usage:\nmenu({\n container,\n attributeName,\n [sortBy],\n [limit],\n [cssClasses.{root,list,item}],\n [templates.{header,item,footer}],\n [transformData],\n [autoHideContainer]\n})";e.exports=r},function(e){"use strict";e.exports={header:"",item:'<a class="{{cssClasses.link}}" href="{{url}}">{{name}} <span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span></a>',footer:""}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){var t=e.container,o=e.attributeName,h=e.operator,m=void 0===h?"or":h,v=e.sortBy,g=void 0===v?["count:desc"]:v,y=e.limit,b=void 0===y?1e3:y,w=e.cssClasses,x=void 0===w?{}:w,P=e.templates,_=void 0===P?f:P,C=e.transformData,E=e.autoHideContainer,R=void 0===E?!0:E,T=n(388);if(!t||!o)throw new Error(d);T=p(T),R===!0&&(T=l(T));var O=s.getContainerNode(t);if(m&&(m=m.toLowerCase(),"and"!==m&&"or"!==m))throw new Error(d);return{getConfiguration:function(e){var t=r({},"and"===m?"facets":"disjunctiveFacets",[o]),n=e.maxValuesPerFacet||0;return t.maxValuesPerFacet=Math.max(n,b),t},toggleRefinement:function(e,t){e.toggleRefinement(o,t).search()},render:function(e){var t=e.results,n=e.helper,r=e.templatesConfig,l=e.state,p=e.createURL,d=s.prepareTemplateProps({transformData:C,defaultTemplates:f,templatesConfig:r,templates:_}),h=t.getFacetValues(o,{sortBy:g}).slice(0,b),m=0===h.length,v={root:c(u(null),x.root),header:c(u("header"),x.header),body:c(u("body"),x.body),footer:c(u("footer"),x.footer),list:c(u("list"),x.list),item:c(u("item"),x.item),active:c(u("item","active"),x.active),label:c(u("label"),x.label),checkbox:c(u("checkbox"),x.checkbox),count:c(u("count"),x.count)},y=this.toggleRefinement.bind(this,n);a.render(i.createElement(T,{createURL:function(e){return p(l.toggleRefinement(o,e))},cssClasses:v,facetValues:h,shouldAutoHideContainer:m,templateProps:d,toggleRefinement:y}),O)}}}var i=n(218),a=n(371),s=n(373),u=s.bemHelper("ais-refinement-list"),c=n(375),l=n(376),p=n(377),f=n(400),d="Usage:\nrefinementList({\n container,\n attributeName,\n [ operator='or' ],\n [ sortBy=['count:desc'] ],\n [ limit=1000 ],\n [ cssClasses.{root,header,body,footer,list,item,active,label,checkbox,count}],\n [ templates.{header,item,footer} ],\n [ transformData ],\n [ autoHideContainer=true ]\n})";e.exports=o},function(e){"use strict";e.exports={header:"",item:'<label class="{{cssClasses.label}}">\n <input type="checkbox" class="{{cssClasses.checkbox}}" value="{{name}}" {{#isRefined}}checked{{/isRefined}} />{{name}}\n <span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span>\n</label>',footer:""}},function(e,t,n){"use strict";function r(e){var t=e.container,r=e.attributeName,a=e.options,f=e.cssClasses,d=void 0===f?{}:f,y=e.templates,b=void 0===y?v:y,w=e.transformData,x=e.autoHideContainer,P=void 0===x?!0:x;if(!t||!r||!a)throw new Error(g);var _=c.getContainerNode(t),C=m(n(388));return P===!0&&(C=h(C)),{getConfiguration:function(){return{}},render:function(e){var t=e.helper,n=e.results,f=e.templatesConfig,h=e.state,m=e.createURL,g=c.prepareTemplateProps({transformData:w,defaultTemplates:v,templatesConfig:f,templates:b}),y=a.map(function(e){return e.isRefined=o(t.state,r,e),e.attributeName=r,e}),x=0===n.nbHits,P={root:p(l(null),d.root),header:p(l("header"),d.header),body:p(l("body"),d.body),footer:p(l("footer"),d.footer),list:p(l("list"),d.list),item:p(l("item"),d.item),label:p(l("label"),d.label),radio:p(l("radio"),d.radio),active:p(l("item","active"),d.active)};u.render(s.createElement(C,{createURL:function(e){return m(i(h,r,a,e))},cssClasses:P,facetValues:y,shouldAutoHideContainer:x,templateProps:g,toggleRefinement:this._toggleRefinement.bind(null,t)}),_)},_toggleRefinement:function(e,t){var n=i(e.state,r,a,t);e.setState(n),e.search()}}}function o(e,t,n){var r=e.getNumericRefinements(t);return void 0!==n.start&&void 0!==n.end&&n.start===n.end?a(r,"=",n.start):void 0!==n.start?a(r,">=",n.start):void 0!==n.end?a(r,"<=",n.end):void 0===n.start&&void 0===n.end?0===Object.keys(r).length:void 0}function i(e,t,n,r){var i=f(n,{name:r}),s=e.getNumericRefinements(t);if(void 0===i.start&&void 0===i.end)return e.clearRefinements(t);if(o(e,t,i)||(e=e.clearRefinements(t)),void 0!==i.start&&void 0!==i.end){if(i.start>i.end)throw new Error("option.start should be > to option.end");if(i.start===i.end)return e=a(s,"=",i.start)?e.removeNumericRefinement(t,"=",i.start):e.addNumericRefinement(t,"=",i.start)}return void 0!==i.start&&(e=a(s,">=",i.start)?e.removeNumericRefinement(t,">=",i.start):e.addNumericRefinement(t,">=",i.start)),void 0!==i.end&&(e=a(s,"<=",i.end)?e.removeNumericRefinement(t,"<=",i.end):e.addNumericRefinement(t,"<=",i.end)),e}function a(e,t,n){var r=void 0!==e[t],o=d(e[t],n);return r&&o}var s=n(218),u=n(371),c=n(373),l=c.bemHelper("ais-refinement-list"),p=n(375),f=n(128),d=n(152),h=n(376),m=n(377),v=n(402),g="Usage:\nnumericRefinementList({\n container,\n attributeName,\n options,\n [ sortBy ],\n [ limit ],\n [ cssClasses.{root,header,body,footer,list,item,active,label,checkbox,count} ],\n [ templates.{header,item,footer} ],\n [ transformData ],\n [ autoHideContainer ]\n})";e.exports=r},function(e){"use strict";e.exports={header:"",item:'<label class="{{cssClasses.label}}">\n <input type="radio" class="{{cssClasses.checkbox}}" name="{{attributeName}}" {{#isRefined}}checked{{/isRefined}} />{{name}}\n</label>',footer:""}},function(e,t,n){"use strict";function r(e){var t=e.container,r=e.operator,p=void 0===r?"=":r,f=e.attributeName,d=e.options,h=e.cssClasses,m=void 0===h?{}:h,v=e.autoHideContainer,g=void 0===v?!1:v,y=a.getContainerNode(t),b="Usage: numericSelector({container, attributeName, options[, cssClasses.{root,item}, autoHideContainer]})",w=n(396);if(g===!0&&(w=c(w)),!t||!d||0===d.length||!f)throw new Error(b);return{init:function(e){var t=e.helper,n=this._getRefinedValue(t)||d[0].value;void 0!==n&&t.addNumericRefinement(f,p,n)},render:function(e){var t=e.helper,n=e.results,r=this._getRefinedValue(t),a=0===n.nbHits,u={root:s(l(null),m.root),item:s(l("item"),m.item)};i.render(o.createElement(w,{cssClasses:u,currentValue:r,options:d,setValue:this._refine.bind(this,t),shouldAutoHideContainer:a}),y)},_refine:function(e,t){e.clearRefinements(f),void 0!==t&&e.addNumericRefinement(f,p,t),e.search()},_getRefinedValue:function(e){var t=e.getRefinements(f),n=u(t,{operator:p});return n&&void 0!==n.value&&void 0!==n.value[0]?n.value[0]:void 0}}}var o=n(218),i=n(371),a=n(373),s=n(375),u=n(128),c=n(376),l=a.bemHelper("ais-numeric-selector");e.exports=r},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.cssClasses,d=void 0===r?{}:r,h=e.labels,m=void 0===h?{}:h,v=e.maxPages,g=void 0===v?20:v,y=e.padding,b=void 0===y?3:y,w=e.showFirstLast,x=void 0===w?!0:w,P=e.autoHideContainer,_=void 0===P?!0:P,C=e.scrollTo,E=void 0===C?"body":C;if(!t)throw new Error(f);E===!0&&(E="body");var R=u.getContainerNode(t),T=E!==!1?u.getContainerNode(E):!1,O=n(405);return _===!0&&(O=l(O)),m=a(m,p),{setCurrentPage:function(e,t){e.setCurrentPage(t),T!==!1&&T.scrollIntoView(),e.search()},render:function(e){var t=e.results,n=e.helper,r=e.createURL,a=e.state,u=t.page,l=t.nbPages,p=t.nbHits,f=0===p,h={root:s(c(null),d.root),item:s(c("item"),d.item),link:s(c("link"),d.link),page:s(c("item","page"),d.page),previous:s(c("item","previous"),d.previous),next:s(c("item","next"),d.next),first:s(c("item","first"),d.first),last:s(c("item","last"),d.last),active:s(c("item","active"),d.active),disabled:s(c("item","disabled"),d.disabled)};void 0!==g&&(l=Math.min(g,t.nbPages)),i.render(o.createElement(O,{createURL:function(e){return r(a.setPage(e))},cssClasses:h,currentPage:u,labels:m,nbHits:p,nbPages:l,padding:b,setCurrentPage:this.setCurrentPage.bind(this,n),shouldAutoHideContainer:f,showFirstLast:x}),R)}}}var o=n(218),i=n(371),a=n(133),s=n(375),u=n(373),c=u.bemHelper("ais-pagination"),l=n(376),p={previous:"‹",next:"›",first:"«",last:"»"},f="Usage:\npagination({\n container,\n [ cssClasses.{root,item,page,previous,next,first,last,active,disabled}={} ],\n [ labels.{previous,next,first,last} ],\n [ maxPages=20 ],\n [ padding=3 ],\n [ showFirstLast=true ],\n [ autoHideContainer=true ],\n [ scrollTo='body' ]\n})";e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},s=n(218),u=n(17),c=n(406),l=n(373),p=l.isSpecialClick,f=n(408),d=n(410),h=n(375),m=function(e){function t(e){r(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,c(e,t.defaultProps))}return o(t,e),i(t,[{key:"handleClick",value:function(e,t){p(t)||(t.preventDefault(),this.props.setCurrentPage(e))}},{key:"pageLink",value:function(e){var t=e.label,n=e.ariaLabel,r=e.pageNumber,o=e.additionalClassName,i=void 0===o?null:o,a=e.isDisabled,u=void 0===a?!1:a,c=e.isActive,l=void 0===c?!1:c,p=e.createURL,f=this.handleClick.bind(this,r),m={item:h(this.props.cssClasses.item,i),link:h(this.props.cssClasses.link)};u?m.item=h(m.item,this.props.cssClasses.disabled):l&&(m.item=h(m.item,this.props.cssClasses.active));var v=p&&!u?p(r):"#";return s.createElement(d,{ariaLabel:n,cssClasses:m,handleClick:f,key:t,label:t,url:v})}},{key:"previousPageLink",value:function(e,t){return this.pageLink({ariaLabel:"Previous",additionalClassName:this.props.cssClasses.previous,isDisabled:e.isFirstPage(),label:this.props.labels.previous,pageNumber:e.currentPage-1,createURL:t})}},{key:"nextPageLink",value:function(e,t){return this.pageLink({ariaLabel:"Next",additionalClassName:this.props.cssClasses.next,isDisabled:e.isLastPage(),label:this.props.labels.next,pageNumber:e.currentPage+1,createURL:t})}},{key:"firstPageLink",value:function(e,t){return this.pageLink({ariaLabel:"First",additionalClassName:this.props.cssClasses.first,isDisabled:e.isFirstPage(),label:this.props.labels.first,pageNumber:0,createURL:t})}},{key:"lastPageLink",value:function(e,t){return this.pageLink({ariaLabel:"Last",additionalClassName:this.props.cssClasses.last,isDisabled:e.isLastPage(),label:this.props.labels.last,pageNumber:e.total-1,createURL:t})}},{key:"pages",value:function n(e,t){var r=this,n=[];return u(e.pages(),function(o){var i=o===e.currentPage;n.push(r.pageLink({ariaLabel:o+1,additionalClassName:r.props.cssClasses.page,isActive:i,label:o+1,pageNumber:o,createURL:t}))}),n}},{key:"render",value:function(){var e=new f({currentPage:this.props.currentPage,total:this.props.nbPages,padding:this.props.padding}),t=this.props.createURL;return s.createElement("ul",{className:this.props.cssClasses.root},this.props.showFirstLast?this.firstPageLink(e,t):null,this.previousPageLink(e,t),this.pages(e,t),this.nextPageLink(e,t),this.props.showFirstLast?this.lastPageLink(e,t):null)}}]),t}(s.Component);m.propTypes={createURL:s.PropTypes.func,cssClasses:s.PropTypes.shape({root:s.PropTypes.string,item:s.PropTypes.string,link:s.PropTypes.string,page:s.PropTypes.string,previous:s.PropTypes.string,next:s.PropTypes.string,first:s.PropTypes.string,last:s.PropTypes.string,active:s.PropTypes.string,disabled:s.PropTypes.string}),currentPage:s.PropTypes.number,labels:s.PropTypes.shape({first:s.PropTypes.string,last:s.PropTypes.string,next:s.PropTypes.string,previous:s.PropTypes.string}),nbHits:s.PropTypes.number,nbPages:s.PropTypes.number,padding:s.PropTypes.number,setCurrentPage:s.PropTypes.func.isRequired,showFirstLast:s.PropTypes.bool},m.defaultProps={nbHits:0,currentPage:0,nbPages:0},e.exports=m},function(e,t,n){var r=n(137),o=n(53),i=n(407),a=r(o,i);e.exports=a},function(e,t,n){function r(e,t){return void 0===e?t:o(e,t,r)}var o=n(53);e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(409),a=function(){function e(t){r(this,e),this.currentPage=t.currentPage,this.total=t.total,this.padding=t.padding}return o(e,[{key:"pages",value:function(){var e=this.currentPage,t=this.padding,n=Math.min(this.calculatePaddingLeft(e,t,this.total),this.total),r=Math.max(Math.min(2*t+1,this.total)-n,1),o=Math.max(e-n,0),a=e+r;return i(o,a)}},{key:"calculatePaddingLeft",value:function(e,t,n){return t>=e?e:e>=n-t?2*t+1-(n-e):t}},{key:"isLastPage",value:function(){return this.currentPage===this.total-1}},{key:"isFirstPage",value:function(){return 0===this.currentPage}}]),e}();e.exports=a},function(e,t,n){function r(e,t,n){n&&o(e,t,n)&&(t=n=void 0),e=+e||0,n=null==n?1:+n||0,null==t?(t=e,e=0):t=+t||0;for(var r=-1,s=a(i((t-e)/(n||1)),0),u=Array(s);++r<s;)u[r]=e,e+=n;return u}var o=n(52),i=Math.ceil,a=Math.max;e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},s=n(218),u=function(e){function t(){r(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.cssClasses,n=e.label,r=e.ariaLabel,o=e.handleClick,i=e.url;return s.createElement("li",{className:t.item},s.createElement("a",{ariaLabel:r,className:t.link,dangerouslySetInnerHTML:{__html:n},href:i,onClick:o}))}}]),t}(s.Component);u.propTypes={ariaLabel:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.number]).isRequired,cssClasses:s.PropTypes.shape({item:s.PropTypes.string,link:s.PropTypes.string}),handleClick:s.PropTypes.func.isRequired,label:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.number]).isRequired,url:s.PropTypes.string},e.exports=u},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.attributeName,h=e.cssClasses,m=void 0===h?{}:h,v=e.templates,g=void 0===v?u:v,y=e.labels,b=void 0===y?{currency:"$",button:"Go",separator:"to"}:y,w=e.autoHideContainer,x=void 0===w?!0:w;if(!t||!r)throw new Error(d);var P=a.getContainerNode(t),_=l(n(414));return x===!0&&(_=c(_)),{getConfiguration:function(){return{facets:[r]}},_generateRanges:function(e){var t=e.getFacetStats(r);return s(t)},_extractRefinedRange:function(e){var t=e.getRefinements(r),n=void 0,o=void 0;return 0===t.length?[]:(t.forEach(function(e){-1!==e.operator.indexOf(">")?n=Math.floor(e.value[0]):-1!==e.operator.indexOf("<")&&(o=Math.ceil(e.value[0]))}),[{from:n,to:o,isRefined:!0}])},_refine:function(e,t,n){var o=this._extractRefinedRange(e);e.clearRefinements(r),(0===o.length||o[0].from!==t||o[0].to!==n)&&("undefined"!=typeof t&&e.addNumericRefinement(r,">=",Math.floor(t)),"undefined"!=typeof n&&e.addNumericRefinement(r,"<=",Math.ceil(n))),e.search()},render:function(e){var t=e.results,n=e.helper,s=e.templatesConfig,c=e.state,l=e.createURL,d=void 0;t.hits.length>0?(d=this._extractRefinedRange(n),0===d.length&&(d=this._generateRanges(t))):d=[];var h=a.prepareTemplateProps({defaultTemplates:u,templatesConfig:s,templates:g}),v=0===d.length,y={root:f(p(null),m.root),header:f(p("header"),m.header),body:f(p("body"),m.body),list:f(p("list"),m.list),link:f(p("link"),m.link),item:f(p("item"),m.item),active:f(p("item","active"),m.active),form:f(p("form"),m.form),label:f(p("label"),m.label),input:f(p("input"),m.input),currency:f(p("currency"),m.currency),button:f(p("button"),m.button),separator:f(p("separator"),m.separator),footer:f(p("footer"),m.footer)};i.render(o.createElement(_,{createURL:function(e,t,n){var o=c.clearRefinements(r);return n||("undefined"!=typeof e&&(o=o.addNumericRefinement(r,">=",Math.floor(e))),"undefined"!=typeof t&&(o=o.addNumericRefinement(r,"<=",Math.ceil(t)))),l(o)},cssClasses:y,facetValues:d,labels:b,refine:this._refine.bind(this,n),shouldAutoHideContainer:v,templateProps:h}),P)}}}var o=n(218),i=n(371),a=n(373),s=n(412),u=n(413),c=n(376),l=n(377),p=a.bemHelper("ais-price-ranges"),f=n(375),d="Usage:\npriceRanges({\n container,\n attributeName,\n [ cssClasses.{root,header,body,list,item,active,link,form,label,input,currency,separator,button,footer} ],\n [ templates.{header,item,footer} ],\n [ labels.{currency,separator,button} ],\n [ autoHideContainer=true ]\n})";e.exports=r},function(e){"use strict";function t(e,t){var n=Math.round(e/t)*t;return 1>n&&(n=1),n}function n(e){var n=void 0;n=e.avg<100?1:e.avg<1e3?10:100;for(var r=t(Math.round(e.avg),n),o=Math.ceil(e.min),i=t(Math.floor(e.max),n);i>e.max;)i-=n;var a=void 0,s=void 0,u=[];if(o!==i){for(a=t(o,n),u.push({to:a});r>a;)s=u[u.length-1].to,a=t(s+(r-o)/3,n),s>=a&&(a=s+1),u.push({from:s,to:a});for(;i>a;)s=u[u.length-1].to,a=t(s+(i-r)/3,n),s>=a&&(a=s+1),u.push({from:s,to:a});1===u.length&&a!==r&&(u.push({from:a,to:r}),a=r),1===u.length?(u[0].from=e.min,u[0].to=e.max):delete u[u.length-1].to}return u}e.exports=n},function(e){"use strict";e.exports={header:"",item:"\n {{#from}}\n {{^to}}\n &ge;\n {{/to}}\n ${{from}}\n {{/from}}\n {{#to}}\n {{#from}}\n -\n {{/from}}\n {{^from}}\n &le;\n {{/from}}\n ${{to}}\n {{/to}}\n ",footer:""}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},c=n(218),l=n(378),p=n(415),f=n(375),d=function(e){function t(){o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),s(t,[{key:"getForm",value:function(){return c.createElement(p,{cssClasses:this.props.cssClasses,labels:this.props.labels,refine:this.refine.bind(this)})}},{key:"getURLFromFacetValue",value:function(e){return this.props.createURL?this.props.createURL(e.from,e.to,e.isRefined):"#"}},{key:"getItemFromFacetValue",value:function(e){var t=f(this.props.cssClasses.item,r({},this.props.cssClasses.active,e.isRefined)),n=this.getURLFromFacetValue(e),o=e.from+"_"+e.to,i=this.refine.bind(this,e.from,e.to);return c.createElement("div",{className:t,key:o},c.createElement("a",{className:this.props.cssClasses.link,href:n,onClick:i},c.createElement(l,a({data:e,templateKey:"item"},this.props.templateProps))))}},{key:"refine",value:function(e,t,n){n.preventDefault(),this.setState({formFromValue:null,formToValue:null}),this.props.refine(e,t)}},{key:"render",value:function(){var e=this,t=this.getForm();return c.createElement("div",null,c.createElement("div",{className:this.props.cssClasses.list},this.props.facetValues.map(function(t){return e.getItemFromFacetValue(t)})),t)}}]),t}(c.Component);d.propTypes={createURL:c.PropTypes.func.isRequired,cssClasses:c.PropTypes.shape({active:c.PropTypes.string,button:c.PropTypes.string,form:c.PropTypes.string,input:c.PropTypes.string,item:c.PropTypes.string,label:c.PropTypes.string,link:c.PropTypes.string,list:c.PropTypes.string,separator:c.PropTypes.string}),facetValues:c.PropTypes.array,labels:c.PropTypes.shape({button:c.PropTypes.string,currency:c.PropTypes.string,to:c.PropTypes.string}),refine:c.PropTypes.func.isRequired,templateProps:c.PropTypes.object.isRequired},d.defaultProps={cssClasses:{}},e.exports=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},s=n(218),u=function(e){function t(){r(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),i(t,[{key:"getInput",value:function(e){return s.createElement("label",{className:this.props.cssClasses.label},s.createElement("span",{className:this.props.cssClasses.currency},this.props.labels.currency," "),s.createElement("input",{className:this.props.cssClasses.input,ref:e,type:"number"}))}},{key:"handleSubmit",value:function(e){var t=+this.refs.from.value||void 0,n=+this.refs.to.value||void 0;this.props.refine(t,n,e)}},{key:"render",value:function(){var e=this.getInput("from"),t=this.getInput("to"),n=this.handleSubmit.bind(this);return s.createElement("form",{className:this.props.cssClasses.form,onSubmit:n,ref:"form"},e,s.createElement("span",{className:this.props.cssClasses.separator}," ",this.props.labels.separator," "),t,s.createElement("button",{className:this.props.cssClasses.button,type:"submit"},this.props.labels.button))}}]),t}(s.Component);u.propTypes={cssClasses:s.PropTypes.shape({button:s.PropTypes.string,currency:s.PropTypes.string,form:s.PropTypes.string,input:s.PropTypes.string,label:s.PropTypes.string,separator:s.PropTypes.string}),labels:s.PropTypes.shape({button:s.PropTypes.string,currency:s.PropTypes.string,separator:s.PropTypes.string}),refine:s.PropTypes.func.isRequired},u.defaultProps={cssClasses:{},labels:{}},e.exports=u},function(e,t,n){"use strict";function r(e){var t=e.container,r=e.placeholder,d=void 0===r?"":r,h=e.cssClasses,m=void 0===h?{}:h,v=e.poweredBy,g=void 0===v?!1:v,y=e.wrapInput,b=void 0===y?!0:y,w=e.autofocus,x=void 0===w?"auto":w,P=e.searchOnEnterKeyPressOnly,_=void 0===P?!1:P;if(!t)throw new Error(f);return t=a.getContainerNode(t), "boolean"!=typeof x&&(x="auto"),{getInput:function(){return"INPUT"===t.tagName?t:document.createElement("input")},wrapInput:function(e){var t=document.createElement("div");return t.classList.add(c(u(null),m.root)),t.appendChild(e),t},addDefaultAttributesToInput:function(e,t){var n={autocapitalize:"off",autocomplete:"off",autocorrect:"off",placeholder:d,role:"textbox",spellcheck:"false",type:"text",value:t};s(n,function(t,n){e.hasAttribute(n)||e.setAttribute(n,t)}),e.classList.add(c(u("input"),m.input))},addPoweredBy:function(e){var t=n(417),r=document.createElement("div");e.parentNode.insertBefore(r,e.nextSibling);var a={root:c(u("powered-by"),m.poweredBy),link:u("powered-by-link")};i.render(o.createElement(t,{cssClasses:a}),r)},init:function(e){function n(e){var t=e.currentTarget?e.currentTarget:e.srcElement;o.setQuery(t.value),_||o.search()}var r=e.state,o=e.helper,i="INPUT"===t.tagName,a=this.getInput();if(this.addDefaultAttributesToInput(a,r.query),a.addEventListener("keyup",function(e){o.setQuery(a.value),_&&e.keyCode===l&&o.search(),window.attachEvent&&e.keyCode===p&&o.search()}),window.attachEvent?a.attachEvent("onpropertychange",n):a.addEventListener("input",n,!1),i){var s=document.createElement("div");a.parentNode.insertBefore(s,a);var u=a.parentNode,c=b?this.wrapInput(a):a;u.replaceChild(c,s)}else{var c=b?this.wrapInput(a):a;t.appendChild(c)}g&&this.addPoweredBy(a),o.on("change",function(e){a!==document.activeElement&&a.value!==e.query&&(a.value=r.query)}),(x===!0||"auto"===x&&""===o.state.query)&&a.focus()}}}var o=n(218),i=n(371),a=n(373),s=n(17),u=n(373).bemHelper("ais-search-box"),c=n(375),l=13,p=8,f="Usage:\nsearchBox({\n container,\n [ placeholder ],\n [ cssClasses.{input,poweredBy} ],\n [ poweredBy ],\n [ wrapInput ],\n [ autofocus ],\n [ searchOnEnterKeyPressOnly ]\n})";e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},s=n(218),u=function(e){function t(){r(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),i(t,[{key:"render",value:function(){return s.createElement("div",{className:this.props.cssClasses.root},"Powered by",s.createElement("a",{className:this.props.cssClasses.link,href:"https://www.algolia.com/",target:"_blank"},"Algolia"))}}]),t}(s.Component);u.propTypes={cssClasses:s.PropTypes.shape({root:s.PropTypes.string,link:s.PropTypes.string})},e.exports=u},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.attributeName,f=e.tooltips,d=void 0===f?!0:f,h=e.templates,m=void 0===h?l:h,v=e.cssClasses,g=void 0===v?{root:null,body:null}:v,y=e.step,b=void 0===y?1:y,w=e.pips,x=void 0===w?!0:w,P=e.autoHideContainer,_=void 0===P?!0:P;if(!t||!r)throw new Error(p);var C=a.getContainerNode(t),E=c(n(419));return _===!0&&(E=u(E)),{getConfiguration:function(){return{disjunctiveFacets:[r]}},_getCurrentRefinement:function(e){var t=e.state.getNumericRefinement(r,">="),n=e.state.getNumericRefinement(r,"<=");return t=t&&t.length?t[0]:-(1/0),n=n&&n.length?n[0]:1/0,{min:t,max:n}},_refine:function(e,t,n){e.clearRefinements(r),n[0]>t.min&&e.addNumericRefinement(r,">=",Math.round(n[0])),n[1]<t.max&&e.addNumericRefinement(r,"<=",Math.round(n[1])),e.search()},render:function(e){var t=e.results,n=e.helper,u=e.templatesConfig,c=s(t.disjunctiveFacets,{name:r}),p=void 0!==c?c.stats:void 0,f=this._getCurrentRefinement(n);void 0===p&&(p={min:null,max:null});var h=null===p.min&&null===p.max,v=a.prepareTemplateProps({defaultTemplates:l,templatesConfig:u,templates:m});i.render(o.createElement(E,{cssClasses:g,onChange:this._refine.bind(this,n,p),pips:x,range:{min:Math.floor(p.min),max:Math.ceil(p.max)},shouldAutoHideContainer:h,start:[f.min,f.max],step:b,templateProps:v,tooltips:d}),C)}}}var o=n(218),i=n(371),a=n(373),s=n(128),u=n(376),c=n(377),l={header:"",footer:""},p="Usage:\nrangeSlider({\n container,\n attributeName,\n [ tooltips=true ],\n [ templates.{header, footer} ],\n [ cssClasses.{root, body} ],\n [ step=1 ],\n [ pips=true ],\n [ autoHideContainer=true ]\n});\n";e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},u=n(218),c=n(420),l="ais-range-slider--",p=function(e){function t(){r(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"handleChange",value:function(e,t,n){this.props.onChange(n)}},{key:"render",value:function(){var e=void 0;return e=this.props.pips===!1?void 0:this.props.pips===!0||"undefined"==typeof this.props.pips?{mode:"positions",density:3,values:[0,50,100],stepped:!0,format:{to:function(e){return Number(e).toLocaleString()}}}:this.props.pips,u.createElement(c,i({},this.props,{animate:!1,behaviour:"snap",connect:!0,cssPrefix:l,onChange:this.handleChange.bind(this),pips:e}))}}]),t}(u.Component);p.propTypes={onChange:u.PropTypes.func,onSlide:u.PropTypes.func,pips:u.PropTypes.oneOfType([u.PropTypes.bool,u.PropTypes.object]),range:u.PropTypes.object.isRequired,start:u.PropTypes.arrayOf(u.PropTypes.number).isRequired,tooltips:u.PropTypes.oneOfType([u.PropTypes.bool,u.PropTypes.object])},e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},c=n(218),l=r(c),p=n(421),f=r(p),d=function(e){function t(){o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),s(t,[{key:"componentDidMount",value:function(){this.createSlider()}},{key:"componentDidUpdate",value:function(){this.slider.destroy(),this.createSlider()}},{key:"componentWillUnmount",value:function(){this.slider.destroy()}},{key:"createSlider",value:function(){var e=this.slider=f["default"].create(this.sliderContainer,a({},this.props));this.props.onUpdate&&e.on("update",this.props.onUpdate),this.props.onChange&&e.on("change",this.props.onChange)}},{key:"render",value:function(){var e=this;return l["default"].createElement("div",{ref:function(t){e.sliderContainer=t}})}}]),t}(l["default"].Component);d.propTypes={animate:l["default"].PropTypes.bool,connect:l["default"].PropTypes.oneOfType([l["default"].PropTypes.oneOf(["lower","upper"]),l["default"].PropTypes.bool]),cssPrefix:l["default"].PropTypes.string,direction:l["default"].PropTypes.oneOf(["ltr","rtl"]),limit:l["default"].PropTypes.number,margin:l["default"].PropTypes.number,onChange:l["default"].PropTypes.func,onUpdate:l["default"].PropTypes.func,orientation:l["default"].PropTypes.oneOf(["horizontal","vertical"]),pips:l["default"].PropTypes.object,range:l["default"].PropTypes.object.isRequired,start:l["default"].PropTypes.arrayOf(l["default"].PropTypes.number).isRequired,step:l["default"].PropTypes.number,tooltips:l["default"].PropTypes.oneOfType([l["default"].PropTypes.bool,l["default"].PropTypes.object])},e.exports=d},function(e,t,n){var r,o,i;(function(n){!function(n){o=[],r=n,i="function"==typeof r?r.apply(t,o):r,!(void 0!==i&&(e.exports=i))}(function(){"use strict";function e(e){return e.filter(function(e){return this[e]?!1:this[e]=!0},{})}function t(e,t){return Math.round(e/t)*t}function r(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=d();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(o.x=0),{top:t.top+o.y-r.clientTop,left:t.left+o.x-r.clientLeft}}function o(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function i(e){var t=Math.pow(10,7);return Number((Math.round(e*t)/t).toFixed(7))}function a(e,t,n){l(e,t),setTimeout(function(){p(e,t)},n)}function s(e){return Math.max(Math.min(e,100),0)}function u(e){return Array.isArray(e)?e:[e]}function c(e){var t=e.split(".");return t.length>1?t[1].length:0}function l(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function p(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function f(e,t){e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function d(){var e=void 0!==window.pageXOffset,t="CSS1Compat"===(document.compatMode||""),n=e?window.pageXOffset:t?document.documentElement.scrollLeft:document.body.scrollLeft,r=e?window.pageYOffset:t?document.documentElement.scrollTop:document.body.scrollTop;return{x:n,y:r}}function h(e){return function(t){return e+t}}function m(e,t,r,o){function i(e,r){if(null===e)return null;if(0==r)return e;var a,l;if("object"!=typeof e)return e;if(m.__isArray(e))a=[];else if(m.__isRegExp(e))a=new RegExp(e.source,w(e)),e.lastIndex&&(a.lastIndex=e.lastIndex);else if(m.__isDate(e))a=new Date(e.getTime());else{if(c&&n.isBuffer(e))return a=new n(e.length),e.copy(a),a;"undefined"==typeof o?(l=Object.getPrototypeOf(e),a=Object.create(l)):(a=Object.create(o),l=o)}if(t){var p=s.indexOf(e);if(-1!=p)return u[p];s.push(e),u.push(a)}for(var f in e){var d;l&&(d=Object.getOwnPropertyDescriptor(l,f)),d&&null==d.set||(a[f]=i(e[f],r-1))}return a}var a;"object"==typeof t&&(r=t.depth,o=t.prototype,a=t.filter,t=t.circular);var s=[],u=[],c="undefined"!=typeof n;return"undefined"==typeof t&&(t=!0),"undefined"==typeof r&&(r=1/0),i(e,r)}function v(e){return Object.prototype.toString.call(e)}function g(e){return"object"==typeof e&&"[object Date]"===v(e)}function y(e){return"object"==typeof e&&"[object Array]"===v(e)}function b(e){return"object"==typeof e&&"[object RegExp]"===v(e)}function w(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}function x(e,t){return 100/(t-e)}function P(e,t){return 100*t/(e[1]-e[0])}function _(e,t){return P(e,e[0]<0?t+Math.abs(e[0]):t-e[0])}function C(e,t){return t*(e[1]-e[0])/100+e[0]}function E(e,t){for(var n=1;e>=t[n];)n+=1;return n}function R(e,t,n){if(n>=e.slice(-1)[0])return 100;var r,o,i,a,s=E(n,e);return r=e[s-1],o=e[s],i=t[s-1],a=t[s],i+_([r,o],n)/x(i,a)}function T(e,t,n){if(n>=100)return e.slice(-1)[0];var r,o,i,a,s=E(n,t);return r=e[s-1],o=e[s],i=t[s-1],a=t[s],C([r,o],(n-i)*x(i,a))}function O(e,n,r,o){if(100===o)return o;var i,a,s=E(o,e);return r?(i=e[s-1],a=e[s],o-i>(a-i)/2?a:i):n[s-1]?e[s-1]+t(o-e[s-1],n[s-1]):o}function S(e,t,n){var r;if("number"==typeof t&&(t=[t]),"[object Array]"!==Object.prototype.toString.call(t))throw new Error("noUiSlider: 'range' contains invalid value.");if(r="min"===e?0:"max"===e?100:parseFloat(e),!o(r)||!o(t[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");n.xPct.push(r),n.xVal.push(t[0]),r?n.xSteps.push(isNaN(t[1])?!1:t[1]):isNaN(t[1])||(n.xSteps[0]=t[1])}function N(e,t,n){return t?void(n.xSteps[e]=P([n.xVal[e],n.xVal[e+1]],t)/x(n.xPct[e],n.xPct[e+1])):!0}function k(e,t,n,r){this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=t,this.direction=n;var o,i=[];for(o in e)e.hasOwnProperty(o)&&i.push([e[o],o]);for(i.sort(i.length&&"object"==typeof i[0][0]?function(e,t){return e[0][0]-t[0][0]}:function(e,t){return e[0]-t[0]}),o=0;o<i.length;o++)S(i[o][1],i[o][0],this);for(this.xNumSteps=this.xSteps.slice(0),o=0;o<this.xNumSteps.length;o++)N(o,this.xNumSteps[o],this)}function j(e,t){if(!o(t))throw new Error("noUiSlider: 'step' is not numeric.");e.singleStep=t}function I(e,t){if("object"!=typeof t||Array.isArray(t))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===t.min||void 0===t.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");e.spectrum=new k(t,e.snap,e.dir,e.singleStep)}function D(e,t){if(t=u(t),!Array.isArray(t)||!t.length||t.length>2)throw new Error("noUiSlider: 'start' option is incorrect.");e.handles=t.length,e.start=t}function A(e,t){if(e.snap=t,"boolean"!=typeof t)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function M(e,t){if(e.animate=t,"boolean"!=typeof t)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function F(e,t){if("lower"===t&&1===e.handles)e.connect=1;else if("upper"===t&&1===e.handles)e.connect=2;else if(t===!0&&2===e.handles)e.connect=3;else{if(t!==!1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");e.connect=0}}function U(e,t){switch(t){case"horizontal":e.ort=0;break;case"vertical":e.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function L(e,t){if(!o(t))throw new Error("noUiSlider: 'margin' option must be numeric.");if(e.margin=e.spectrum.getMargin(t),!e.margin)throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function B(e,t){if(!o(t))throw new Error("noUiSlider: 'limit' option must be numeric.");if(e.limit=e.spectrum.getMargin(t),!e.limit)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders.")}function H(e,t){switch(t){case"ltr":e.dir=0;break;case"rtl":e.dir=1,e.connect=[0,2,1,3][e.connect];break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function q(e,t){if("string"!=typeof t)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var n=t.indexOf("tap")>=0,r=t.indexOf("drag")>=0,o=t.indexOf("fixed")>=0,i=t.indexOf("snap")>=0;if(r&&!e.connect)throw new Error("noUiSlider: 'drag' behaviour must be used with 'connect': true.");e.events={tap:n||i,drag:r,fixed:o,snap:i}}function V(e,t){if(t===!0&&(e.tooltips=!0),t&&t.format){if("function"!=typeof t.format)throw new Error("noUiSlider: 'tooltips.format' must be an object.");e.tooltips={format:t.format}}}function W(e,t){if(e.format=t,"function"==typeof t.to&&"function"==typeof t.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function K(e,t){if(void 0!==t&&"string"!=typeof t)throw new Error("noUiSlider: 'cssPrefix' must be a string.");e.cssPrefix=t}function Q(e){var t,n={margin:0,limit:0,animate:!0,format:J};t={step:{r:!1,t:j},start:{r:!0,t:D},connect:{r:!0,t:F},direction:{r:!0,t:H},snap:{r:!1,t:A},animate:{r:!1,t:M},range:{r:!0,t:I},orientation:{r:!1,t:U},margin:{r:!1,t:L},limit:{r:!1,t:B},behaviour:{r:!0,t:q},format:{r:!1,t:W},tooltips:{r:!1,t:V},cssPrefix:{r:!1,t:K}};var r={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal"};return Object.keys(r).forEach(function(t){void 0===e[t]&&(e[t]=r[t])}),Object.keys(t).forEach(function(r){var o=t[r];if(void 0===e[r]){if(o.r)throw new Error("noUiSlider: '"+r+"' is required.");return!0}o.t(n,e[r])}),n.pips=e.pips,n.style=n.ort?"top":"left",n}function Y(t,n){function o(e,t,n){var r=e+t[0],o=e+t[1];return n?(0>r&&(o+=Math.abs(r)),o>100&&(r-=o-100),[s(r),s(o)]):[r,o]}function i(e,t){e.preventDefault();var n,r,o=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),a=0===e.type.indexOf("pointer"),s=e;return 0===e.type.indexOf("MSPointer")&&(a=!0),o&&(n=e.changedTouches[0].pageX,r=e.changedTouches[0].pageY),t=t||d(),(i||a)&&(n=e.clientX+t.x,r=e.clientY+t.y),s.pageOffset=t,s.points=[n,r],s.cursor=i||a,s}function m(e,t){var n=document.createElement("div"),r=document.createElement("div"),o=["-lower","-upper"];return e&&o.reverse(),l(r,ee[3]),l(r,ee[3]+o[t]),l(n,ee[2]),n.appendChild(r),n}function v(e,t,n){switch(e){case 1:l(t,ee[7]),l(n[0],ee[6]);break;case 3:l(n[1],ee[6]);case 2:l(n[0],ee[7]);case 0:l(t,ee[6])}}function g(e,t,n){var r,o=[];for(r=0;e>r;r+=1)o.push(n.appendChild(m(t,r)));return o}function y(e,t,n){l(n,ee[0]),l(n,ee[8+e]),l(n,ee[4+t]);var r=document.createElement("div");return l(r,ee[1]),n.appendChild(r),r}function b(e){return e}function w(e){var t=document.createElement("div");return t.className=ee[18],e.firstChild.appendChild(t)}function x(e){var t=e.format?e.format:b,n=K.map(w);H("update",function(e,r,o){n[r].innerHTML=t(e[r],o[r])})}function P(e,t,n){if("range"===e||"steps"===e)return J.xVal;if("count"===e){var r,o=100/(t-1),i=0;for(t=[];(r=i++*o)<=100;)t.push(r);e="positions"}return"positions"===e?t.map(function(e){return J.fromStepping(n?J.getStep(e):e)}):"values"===e?n?t.map(function(e){return J.fromStepping(J.getStep(J.toStepping(e)))}):t:void 0}function _(t,n,r){function o(e,t){return(e+t).toFixed(7)/1}var i=J.direction,a={},s=J.xVal[0],u=J.xVal[J.xVal.length-1],c=!1,l=!1,p=0;return J.direction=0,r=e(r.slice().sort(function(e,t){return e-t})),r[0]!==s&&(r.unshift(s),c=!0),r[r.length-1]!==u&&(r.push(u),l=!0),r.forEach(function(e,i){var s,u,f,d,h,m,v,g,y,b,w=e,x=r[i+1];if("steps"===n&&(s=J.xNumSteps[i]),s||(s=x-w),w!==!1&&void 0!==x)for(u=w;x>=u;u=o(u,s)){for(d=J.toStepping(u),h=d-p,g=h/t,y=Math.round(g),b=h/y,f=1;y>=f;f+=1)m=p+f*b,a[m.toFixed(5)]=["x",0];v=r.indexOf(u)>-1?1:"steps"===n?2:0,!i&&c&&(v=0),u===x&&l||(a[d.toFixed(5)]=[u,v]),p=d}}),J.direction=i,a}function C(e,t,r){function o(e){return["-normal","-large","-sub"][e]}function i(e,t,r){return'class="'+t+" "+t+"-"+s+" "+t+o(r[1])+'" style="'+n.style+": "+e+'%"'}function a(e,n){J.direction&&(e=100-e),n[1]=n[1]&&t?t(n[0],n[1]):n[1],u.innerHTML+="<div "+i(e,ee[21],n)+"></div>",n[1]&&(u.innerHTML+="<div "+i(e,ee[22],n)+">"+r.to(n[0])+"</div>")}var s=["horizontal","vertical"][n.ort],u=document.createElement("div");return l(u,ee[20]),l(u,ee[20]+"-"+s),Object.keys(e).forEach(function(t){a(t,e[t])}),u}function E(e){var t=e.mode,n=e.density||1,r=e.filter||!1,o=e.values||!1,i=e.stepped||!1,a=P(t,o,i),s=_(n,t,a),u=e.format||{to:Math.round};return Y.appendChild(C(s,r,u))}function R(){return W["offset"+["Width","Height"][n.ort]]}function T(e,t){void 0!==t&&1!==n.handles&&(t=Math.abs(t-n.dir)),Object.keys(Z).forEach(function(n){var r=n.split(".")[0];e===r&&Z[n].forEach(function(e){e(u(U()),t,O(Array.prototype.slice.call(X)))})})}function O(e){return 1===e.length?e[0]:n.dir?e.reverse():e}function S(e,t,r,o){var a=function(t){return Y.hasAttribute("disabled")?!1:f(Y,ee[14])?!1:(t=i(t,o.pageOffset),e===G.start&&void 0!==t.buttons&&t.buttons>1?!1:(t.calcPoint=t.points[n.ort],void r(t,o)))},s=[];return e.split(" ").forEach(function(e){t.addEventListener(e,a,!1),s.push([e,a])}),s}function N(e,t){if(0===e.buttons&&0===e.which&&0!==t.buttonsProperty)return k(e,t);var n,r,i=t.handles||K,a=!1,s=100*(e.calcPoint-t.start)/t.baseSize,u=i[0]===K[0]?0:1;if(n=o(s,t.positions,i.length>1),a=A(i[0],n[u],1===i.length),i.length>1){if(a=A(i[1],n[u?0:1],!1)||a)for(r=0;r<t.handles.length;r++)T("slide",r)}else a&&T("slide",u)}function k(e,t){var n=W.querySelector("."+ee[15]),r=t.handles[0]===K[0]?0:1;null!==n&&p(n,ee[15]),e.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener));var o=document.documentElement;o.noUiListeners.forEach(function(e){o.removeEventListener(e[0],e[1])}),p(Y,ee[12]),T("set",r),T("change",r)}function j(e,t){var n=document.documentElement;if(1===t.handles.length&&(l(t.handles[0].children[0],ee[15]),t.handles[0].hasAttribute("disabled")))return!1;e.stopPropagation();var r=S(G.move,n,N,{start:e.calcPoint,baseSize:R(),pageOffset:e.pageOffset,handles:t.handles,buttonsProperty:e.buttons,positions:[z[0],z[K.length-1]]}),o=S(G.end,n,k,{handles:t.handles});if(n.noUiListeners=r.concat(o),e.cursor){document.body.style.cursor=getComputedStyle(e.target).cursor,K.length>1&&l(Y,ee[12]);var i=function(){return!1};document.body.noUiListener=i,document.body.addEventListener("selectstart",i,!1)}}function I(e){var t,o,i=e.calcPoint,s=0;return e.stopPropagation(),K.forEach(function(e){s+=r(e)[n.style]}),t=s/2>i||1===K.length?0:1,i-=r(W)[n.style],o=100*i/R(),n.events.snap||a(Y,ee[14],300),K[t].hasAttribute("disabled")?!1:(A(K[t],o),T("slide",t),T("set",t),T("change",t),void(n.events.snap&&j(e,{handles:[K[t]]})))}function D(e){var t,n;if(!e.fixed)for(t=0;t<K.length;t+=1)S(G.start,K[t].children[0],j,{handles:[K[t]]});e.tap&&S(G.start,W,I,{handles:K}),e.drag&&(n=[W.querySelector("."+ee[7])],l(n[0],ee[10]),e.fixed&&n.push(K[n[0]===K[0]?1:0].children[0]),n.forEach(function(e){S(G.start,e,j,{handles:K})}))}function A(e,t,r){var o=e!==K[0]?1:0,i=z[0]+n.margin,a=z[1]-n.margin,u=z[0]+n.limit,c=z[1]-n.limit,f=J.fromStepping(t);return K.length>1&&(t=o?Math.max(t,i):Math.min(t,a)),r!==!1&&n.limit&&K.length>1&&(t=o?Math.min(t,u):Math.max(t,c)),t=J.getStep(t),t=s(parseFloat(t.toFixed(7))),t===z[o]&&f===X[o]?!1:(window.requestAnimationFrame?window.requestAnimationFrame(function(){e.style[n.style]=t+"%"}):e.style[n.style]=t+"%",e.previousSibling||(p(e,ee[17]),t>50&&l(e,ee[17])),z[o]=t,X[o]=J.fromStepping(t),T("update",o),!0)}function M(e,t){var r,o,i;for(n.limit&&(e+=1),r=0;e>r;r+=1)o=r%2,i=t[o],null!==i&&i!==!1&&("number"==typeof i&&(i=String(i)),i=n.format.from(i),(i===!1||isNaN(i)||A(K[o],J.toStepping(i),r===3-n.dir)===!1)&&T("update",o))}function F(e){var t,r,o=u(e);for(n.dir&&n.handles>1&&o.reverse(),n.animate&&-1!==z[0]&&a(Y,ee[14],300),t=K.length>1?3:1,1===o.length&&(t=1),M(t,o),r=0;r<K.length;r++)T("set",r)}function U(){var e,t=[];for(e=0;e<n.handles;e+=1)t[e]=n.format.to(X[e]);return O(t)}function L(){ee.forEach(function(e){e&&p(Y,e)}),Y.innerHTML="",delete Y.noUiSlider}function B(){var e=z.map(function(e,t){var n=J.getApplicableStep(e),r=c(String(n[2])),o=X[t],i=100===e?null:n[2],a=Number((o-n[2]).toFixed(r)),s=0===e?null:a>=n[1]?n[2]:n[0]||!1;return[s,i]});return O(e)}function H(e,t){Z[e]=Z[e]||[],Z[e].push(t),"update"===e.split(".")[0]&&K.forEach(function(e,t){T("update",t)})}function q(e){var t=e.split(".")[0],n=e.substring(t.length);Object.keys(Z).forEach(function(e){var r=e.split(".")[0],o=e.substring(r.length);t&&t!==r||n&&n!==o||delete Z[e]})}function V(e){var t=Q({start:[0,0],margin:e.margin,limit:e.limit,step:e.step,range:e.range,animate:e.animate});n.margin=t.margin,n.limit=t.limit,n.step=t.step,n.range=t.range,n.animate=t.animate,J=t.spectrum}var W,K,Y=t,z=[-1,-1],J=n.spectrum,X=[],Z={},ee=["target","base","origin","handle","horizontal","vertical","background","connect","ltr","rtl","draggable","","state-drag","","state-tap","active","","stacking","tooltip","","pips","marker","value"].map(h(n.cssPrefix||$));if(Y.noUiSlider)throw new Error("Slider was already initialized.");return W=y(n.dir,n.ort,Y),K=g(n.handles,n.dir,W),v(n.connect,Y,K),D(n.events),n.pips&&E(n.pips),n.tooltips&&x(n.tooltips),{destroy:L,steps:B,on:H,off:q,get:U,set:F,updateOptions:V}}function z(e,t){if(!e.nodeName)throw new Error("noUiSlider.create requires a single element.");var n=Q(m(t),e),r=Y(e,n);return r.set(n.start),e.noUiSlider=r,r}m.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},m.__objToStr=v,m.__isDate=g,m.__isArray=y,m.__isRegExp=b,m.__getRegExpFlags=w;var G=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},$="noUi-";k.prototype.getMargin=function(e){return 2===this.xPct.length?P(this.xVal,e):!1},k.prototype.toStepping=function(e){return e=R(this.xVal,this.xPct,e),this.direction&&(e=100-e),e},k.prototype.fromStepping=function(e){return this.direction&&(e=100-e),i(T(this.xVal,this.xPct,e))},k.prototype.getStep=function(e){return this.direction&&(e=100-e),e=O(this.xPct,this.xSteps,this.snap,e),this.direction&&(e=100-e),e},k.prototype.getApplicableStep=function(e){var t=E(e,this.xPct),n=100===e?2:1;return[this.xNumSteps[t-2],this.xVal[t-n],this.xNumSteps[t-n]]},k.prototype.convert=function(e){return this.getStep(this.toStepping(e))};var J={to:function(e){return void 0!==e&&e.toFixed(2)},from:Number};return{create:z}})}).call(t,n(422).Buffer)},function(e,t,n){(function(e,r){function o(){function e(){}try{var t=new Uint8Array(1);return t.foo=function(){return 42},t.constructor=e,42===t.foo()&&t.constructor===e&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(n){return!1}}function i(){return e.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function e(t){return this instanceof e?(this.length=0,this.parent=void 0,"number"==typeof t?a(this,t):"string"==typeof t?s(this,t,arguments.length>1?arguments[1]:"utf8"):u(this,t)):arguments.length>1?new e(t,arguments[1]):new e(t)}function a(t,n){if(t=m(t,0>n?0:0|v(n)),!e.TYPED_ARRAY_SUPPORT)for(var r=0;n>r;r++)t[r]=0;return t}function s(e,t,n){("string"!=typeof n||""===n)&&(n="utf8");var r=0|y(t,n);return e=m(e,r),e.write(t,n),e}function u(t,n){if(e.isBuffer(n))return c(t,n);if($(n))return l(t,n);if(null==n)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(n.buffer instanceof ArrayBuffer)return p(t,n);if(n instanceof ArrayBuffer)return f(t,n)}return n.length?d(t,n):h(t,n)}function c(e,t){var n=0|v(t.length);return e=m(e,n),t.copy(e,0,0,n),e}function l(e,t){var n=0|v(t.length);e=m(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function p(e,t){var n=0|v(t.length);e=m(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function f(t,n){return e.TYPED_ARRAY_SUPPORT?(n.byteLength,t=e._augment(new Uint8Array(n))):t=p(t,new Uint8Array(n)),t}function d(e,t){var n=0|v(t.length);e=m(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function h(e,t){var n,r=0;"Buffer"===t.type&&$(t.data)&&(n=t.data,r=0|v(n.length)),e=m(e,r);for(var o=0;r>o;o+=1)e[o]=255&n[o];return e}function m(t,n){e.TYPED_ARRAY_SUPPORT?(t=e._augment(new Uint8Array(n)),t.__proto__=e.prototype):(t.length=n,t._isBuffer=!0);var r=0!==n&&n<=e.poolSize>>>1;return r&&(t.parent=J),t}function v(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function g(t,n){if(!(this instanceof g))return new g(t,n);var r=new e(t,n);return delete r.parent,r}function y(e,t){"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function b(e,t,n){var r=!1;if(t=0|t,n=void 0===n||n===1/0?this.length:0|n,e||(e="utf8"),0>t&&(t=0),n>this.length&&(n=this.length),t>=n)return"";for(;;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return S(this,t,n);case"binary":return N(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;var i=t.length;if(i%2!==0)throw new Error("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;r>a;a++){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");e[n+a]=s}return a}function x(e,t,n,r){return Y(V(t,e.length-n),e,n,r)}function P(e,t,n,r){return Y(W(t),e,n,r)}function _(e,t,n,r){return P(e,t,n,r)}function C(e,t,n,r){return Y(Q(t),e,n,r)}function E(e,t,n,r){return Y(K(t,e.length-n),e,n,r)}function R(e,t,n){return z.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;n>o;){var i=e[o],a=null,s=i>239?4:i>223?3:i>191?2:1;if(n>=o+s){var u,c,l,p;switch(s){case 1:128>i&&(a=i);break;case 2:u=e[o+1],128===(192&u)&&(p=(31&i)<<6|63&u,p>127&&(a=p));break;case 3:u=e[o+1],c=e[o+2],128===(192&u)&&128===(192&c)&&(p=(15&i)<<12|(63&u)<<6|63&c,p>2047&&(55296>p||p>57343)&&(a=p));break;case 4:u=e[o+1],c=e[o+2],l=e[o+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(p=(15&i)<<18|(63&u)<<12|(63&c)<<6|63&l,p>65535&&1114112>p&&(a=p))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=s}return O(r)}function O(e){var t=e.length;if(X>=t)return String.fromCharCode.apply(String,e);for(var n="",r=0;t>r;)n+=String.fromCharCode.apply(String,e.slice(r,r+=X));return n}function S(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;n>o;o++)r+=String.fromCharCode(127&e[o]);return r}function N(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;n>o;o++)r+=String.fromCharCode(e[o]);return r}function k(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=t;n>i;i++)o+=q(e[i]);return o}function j(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function I(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(t,n,r,o,i,a){if(!e.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(n>i||a>n)throw new RangeError("value is out of bounds");if(r+o>t.length)throw new RangeError("index out of range")}function A(e,t,n,r){0>t&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);i>o;o++)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function M(e,t,n,r){0>t&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);i>o;o++)e[n+o]=t>>>8*(r?o:3-o)&255}function F(e,t,n,r,o,i){if(t>o||i>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function U(e,t,n,r,o){return o||F(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38), G.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return o||F(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),G.write(e,t,n,r,52,8),n+8}function B(e){if(e=H(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function H(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return 16>e?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,r=e.length,o=null,i=[],a=0;r>a;a++){if(n=e.charCodeAt(a),n>55295&&57344>n){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(56320>n){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=o-55296<<10|n-56320|65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,128>n){if((t-=1)<0)break;i.push(n)}else if(2048>n){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function W(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function K(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);a++)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}function Q(e){return z.toByteArray(B(e))}function Y(e,t,n,r){for(var o=0;r>o&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}var z=n(423),G=n(424),$=n(425);t.Buffer=e,t.SlowBuffer=g,t.INSPECT_MAX_BYTES=50,e.poolSize=8192;var J={};e.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:o(),e.TYPED_ARRAY_SUPPORT&&(e.prototype.__proto__=Uint8Array.prototype,e.__proto__=Uint8Array),e.isBuffer=function(e){return!(null==e||!e._isBuffer)},e.compare=function(t,n){if(!e.isBuffer(t)||!e.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var r=t.length,o=n.length,i=0,a=Math.min(r,o);a>i&&t[i]===n[i];)++i;return i!==a&&(r=t[i],o=n[i]),o>r?-1:r>o?1:0},e.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},e.concat=function(t,n){if(!$(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new e(0);var r;if(void 0===n)for(n=0,r=0;r<t.length;r++)n+=t[r].length;var o=new e(n),i=0;for(r=0;r<t.length;r++){var a=t[r];a.copy(o,i),i+=a.length}return o},e.byteLength=y,e.prototype.length=void 0,e.prototype.parent=void 0,e.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):b.apply(this,arguments)},e.prototype.equals=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===e.compare(this,t)},e.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},e.prototype.compare=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:e.compare(this,t)},e.prototype.indexOf=function(t,n){function r(e,t,n){for(var r=-1,o=0;n+o<e.length;o++)if(e[n+o]===t[-1===r?0:o-r]){if(-1===r&&(r=o),o-r+1===t.length)return n+r}else r=-1;return-1}if(n>2147483647?n=2147483647:-2147483648>n&&(n=-2147483648),n>>=0,0===this.length)return-1;if(n>=this.length)return-1;if(0>n&&(n=Math.max(this.length+n,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,n);if(e.isBuffer(t))return r(this,t,n);if("number"==typeof t)return e.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,n):r(this,[t],n);throw new TypeError("val must be string, number or Buffer")},e.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},e.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},e.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0);else{var o=r;r=t,t=0|n,n=o}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return P(this,e,t,n);case"binary":return _(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var X=4096;e.prototype.slice=function(t,n){var r=this.length;t=~~t,n=void 0===n?r:~~n,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>n?(n+=r,0>n&&(n=0)):n>r&&(n=r),t>n&&(n=t);var o;if(e.TYPED_ARRAY_SUPPORT)o=e._augment(this.subarray(t,n));else{var i=n-t;o=new e(i,void 0);for(var a=0;i>a;a++)o[a]=this[a+t]}return o.length&&(o.parent=this.parent||this),o},e.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},e.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||I(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},e.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},e.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},e.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},e.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},e.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},e.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},e.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||I(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},e.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},e.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},e.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},e.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},e.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},e.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),G.read(this,e,!0,23,4)},e.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),G.read(this,e,!1,23,4)},e.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),G.read(this,e,!0,52,8)},e.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),G.read(this,e,!1,52,8)},e.prototype.writeUIntLE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||D(this,e,t,n,Math.pow(2,8*n),0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},e.prototype.writeUIntBE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||D(this,e,t,n,Math.pow(2,8*n),0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},e.prototype.writeUInt8=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,1,255,0),e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=255&t,n+1},e.prototype.writeUInt16LE=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,2,65535,0),e.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):A(this,t,n,!0),n+2},e.prototype.writeUInt16BE=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,2,65535,0),e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):A(this,t,n,!1),n+2},e.prototype.writeUInt32LE=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,4,4294967295,0),e.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=255&t):M(this,t,n,!0),n+4},e.prototype.writeUInt32BE=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,4,4294967295,0),e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):M(this,t,n,!1),n+4},e.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=0,a=1,s=0>e?1:0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=(e/a>>0)-s&255;return t+n},e.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0>e?1:0;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=(e/a>>0)-s&255;return t+n},e.prototype.writeInt8=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,1,127,-128),e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[n]=255&t,n+1},e.prototype.writeInt16LE=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,2,32767,-32768),e.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):A(this,t,n,!0),n+2},e.prototype.writeInt16BE=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,2,32767,-32768),e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):A(this,t,n,!1),n+2},e.prototype.writeInt32LE=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,4,2147483647,-2147483648),e.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):M(this,t,n,!0),n+4},e.prototype.writeInt32BE=function(t,n,r){return t=+t,n=0|n,r||D(this,t,n,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):M(this,t,n,!1),n+4},e.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},e.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},e.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},e.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},e.prototype.copy=function(t,n,r,o){if(r||(r=0),o||0===o||(o=this.length),n>=t.length&&(n=t.length),n||(n=0),o>0&&r>o&&(o=r),o===r)return 0;if(0===t.length||0===this.length)return 0;if(0>n)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>o)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-n<o-r&&(o=t.length-n+r);var i,a=o-r;if(this===t&&n>r&&o>n)for(i=a-1;i>=0;i--)t[i+n]=this[i+r];else if(1e3>a||!e.TYPED_ARRAY_SUPPORT)for(i=0;a>i;i++)t[i+n]=this[i+r];else t._set(this.subarray(r,r+a),n);return a},e.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),t>n)throw new RangeError("end < start");if(n!==t&&0!==this.length){if(0>t||t>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof e)for(r=t;n>r;r++)this[r]=e;else{var o=V(e.toString()),i=o.length;for(r=t;n>r;r++)this[r]=o[r%i]}return this}},e.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(e.TYPED_ARRAY_SUPPORT)return new e(this).buffer;for(var t=new Uint8Array(this.length),n=0,r=t.length;r>n;n+=1)t[n]=this[n];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var Z=e.prototype;e._augment=function(t){return t.constructor=e,t._isBuffer=!0,t._set=t.set,t.get=Z.get,t.set=Z.set,t.write=Z.write,t.toString=Z.toString,t.toLocaleString=Z.toString,t.toJSON=Z.toJSON,t.equals=Z.equals,t.compare=Z.compare,t.indexOf=Z.indexOf,t.copy=Z.copy,t.slice=Z.slice,t.readUIntLE=Z.readUIntLE,t.readUIntBE=Z.readUIntBE,t.readUInt8=Z.readUInt8,t.readUInt16LE=Z.readUInt16LE,t.readUInt16BE=Z.readUInt16BE,t.readUInt32LE=Z.readUInt32LE,t.readUInt32BE=Z.readUInt32BE,t.readIntLE=Z.readIntLE,t.readIntBE=Z.readIntBE,t.readInt8=Z.readInt8,t.readInt16LE=Z.readInt16LE,t.readInt16BE=Z.readInt16BE,t.readInt32LE=Z.readInt32LE,t.readInt32BE=Z.readInt32BE,t.readFloatLE=Z.readFloatLE,t.readFloatBE=Z.readFloatBE,t.readDoubleLE=Z.readDoubleLE,t.readDoubleBE=Z.readDoubleBE,t.writeUInt8=Z.writeUInt8,t.writeUIntLE=Z.writeUIntLE,t.writeUIntBE=Z.writeUIntBE,t.writeUInt16LE=Z.writeUInt16LE,t.writeUInt16BE=Z.writeUInt16BE,t.writeUInt32LE=Z.writeUInt32LE,t.writeUInt32BE=Z.writeUInt32BE,t.writeIntLE=Z.writeIntLE,t.writeIntBE=Z.writeIntBE,t.writeInt8=Z.writeInt8,t.writeInt16LE=Z.writeInt16LE,t.writeInt16BE=Z.writeInt16BE,t.writeInt32LE=Z.writeInt32LE,t.writeInt32BE=Z.writeInt32BE,t.writeFloatLE=Z.writeFloatLE,t.writeFloatBE=Z.writeFloatBE,t.writeDoubleLE=Z.writeDoubleLE,t.writeDoubleBE=Z.writeDoubleBE,t.fill=Z.fill,t.inspect=Z.inspect,t.toArrayBuffer=Z.toArrayBuffer,t};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,n(422).Buffer,function(){return this}())},function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===a||t===p?62:t===s||t===f?63:u>t?-1:u+10>t?t-u+26+26:l+26>t?t-l:c+26>t?t-c+26:void 0}function r(e){function n(e){c[p++]=e}var r,o,a,s,u,c;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=e.length;u="="===e.charAt(l-2)?2:"="===e.charAt(l-1)?1:0,c=new i(3*e.length/4-u),a=u>0?e.length-4:e.length;var p=0;for(r=0,o=0;a>r;r+=4,o+=3)s=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===u?(s=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&s)):1===u&&(s=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(s>>8&255),n(255&s)),c}function o(e){function t(e){return n.charAt(e)}function r(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var o,i,a,s=e.length%3,u="";for(o=0,a=e.length-s;a>o;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],u+=r(i);switch(s){case 1:i=e[e.length-1],u+=t(i>>2),u+=t(i<<4&63),u+="==";break;case 2:i=(e[e.length-2]<<8)+e[e.length-1],u+=t(i>>10),u+=t(i>>4&63),u+=t(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0),p="-".charCodeAt(0),f="_".charCodeAt(0);e.toByteArray=r,e.fromByteArray=o}(t)},function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,p=n?o-1:0,f=n?-1:1,d=e[t+p];for(p+=f,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+p],p+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+p],p+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?0/0:(d?-1:1)*(1/0);a+=Math.pow(2,r),i-=c}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,p=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(a++,u/=2),a+p>=l?(s=0,a=l):a+p>=1?(s=(t*u-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+d]=255&a,d+=h,a/=256,c-=8);e[n+d-h]|=128*m}},function(e){var t=Array.isArray,n=Object.prototype.toString;e.exports=t||function(e){return!!e&&"[object Array]"==n.call(e)}},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.indices,d=e.cssClasses,h=void 0===d?{}:d,m=e.autoHideContainer,v=void 0===m?!1:m;if(!t||!r)throw new Error(f);var g=u.getContainerNode(t),y=n(396);v===!0&&(y=p(y));var b=s(r,function(e){return{label:e.label,value:e.name}});return{init:function(e){var t=e.helper,n=t.getIndex(),o=-1!==a(r,{name:n});if(!o)throw new Error("[sortBySelector]: Index "+n+" not present in `indices`")},setIndex:function(e,t){e.setIndex(t),e.search()},render:function(e){var t=e.helper,n=e.results,r=t.getIndex(),a=0===n.nbHits,s=this.setIndex.bind(this,t),u={root:l(c(null),h.root),item:l(c("item"),h.item)};i.render(o.createElement(y,{cssClasses:u,currentValue:r,options:b,setValue:s,shouldAutoHideContainer:a}),g)}}}var o=n(218),i=n(371),a=n(143),s=n(108),u=n(373),c=u.bemHelper("ais-sort-by-selector"),l=n(375),p=n(376),f="Usage:\nsortBySelector({\n container,\n indices,\n [cssClasses.{root,item}={}],\n [autoHideContainer=false]\n})";e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.container,r=e.attributeName,h=e.max,m=void 0===h?5:h,v=e.cssClasses,g=void 0===v?{}:v,y=e.labels,b=void 0===y?f:y,w=e.templates,x=void 0===w?p:w,P=e.transformData,_=e.autoHideContainer,C=void 0===_?!0:_,E=a.getContainerNode(t),R=l(n(388));if(C===!0&&(R=c(R)),!t||!r)throw new Error(d);return{getConfiguration:function(){return{disjunctiveFacets:[r]}},render:function(e){for(var t=e.helper,n=e.results,c=e.templatesConfig,l=e.state,f=e.createURL,d=a.prepareTemplateProps({transformData:P,defaultTemplates:p,templatesConfig:c,templates:x}),h=[],v={},y=m-1;y>=0;--y)v[y]=0;n.getFacetValues(r).forEach(function(e){var t=Math.round(e.name);!t||t>m-1||(v[t]+=e.count)});for(var w=this._getRefinedStar(t),_=m-1;_>=1;--_){var C=v[_];if(!w||_===w||0!==C){for(var T=[],O=1;m>=O;++O)T.push(_>=O);h.push({stars:T,name:""+_,count:C,isRefined:w===_,labels:b})}}var S={root:u(s(null),g.root),header:u(s("header"),g.header),body:u(s("body"),g.body),footer:u(s("footer"),g.footer),list:u(s("list"),g.list),item:u(s("item"),g.item),link:u(s("link"),g.link),disabledLink:u(s("link","disabled"),g.disabledLink),count:u(s("count"),g.count),star:u(s("star"),g.star),emptyStar:u(s("star","empty"),g.emptyStar),active:u(s("item","active"),g.active)};i.render(o.createElement(R,{createURL:function(e){return f(l.toggleRefinement(r,e))},cssClasses:S,facetValues:h,shouldAutoHideContainer:0===n.nbHits,templateProps:d,toggleRefinement:this._toggleRefinement.bind(this,t)}),E)},_toggleRefinement:function(e,t){var n=this._getRefinedStar(e)===+t;if(e.clearRefinements(r),!n)for(var o=+t;m>=o;++o)e.addDisjunctiveFacetRefinement(r,o);e.search()},_getRefinedStar:function(e){var t=void 0,n=e.getRefinements(r);return n.forEach(function(e){(!t||+e.value<t)&&(t=+e.value)}),t}}}var o=n(218),i=n(371),a=n(373),s=a.bemHelper("ais-star-rating"),u=n(375),c=n(376),l=n(377),p=n(428),f=n(429),d="Usage:\nstarRating({\n container,\n attributeName,\n [ max=5 ],\n [ cssClasses.{root,header,body,footer,list,item,active,link,disabledLink,star,emptyStar,count} ],\n [ templates.{header,item,footer} ],\n [ labels.{andUp} ],\n [ transformData ],\n [ autoHideContainer=true ]\n})";e.exports=r},function(e){"use strict";e.exports={header:"",item:'<a class="{{cssClasses.link}}{{^count}} {{cssClasses.disabledLink}}{{/count}}" {{#count}}href="{{href}}"{{/count}}>\n {{#stars}}<span class="{{#.}}{{cssClasses.star}}{{/.}}{{^.}}{{cssClasses.emptyStar}}{{/.}}"></span>{{/stars}}\n {{labels.andUp}}\n {{#count}}<span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span>{{/count}}\n</a>',footer:""}},function(e){"use strict";e.exports={andUp:"& Up"}},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.cssClasses,d=void 0===r?{}:r,h=e.autoHideContainer,m=void 0===h?!0:h,v=e.templates,g=void 0===v?p:v,y=e.transformData;if(!t)throw new Error(f);var b=a.getContainerNode(t),w=u(n(432));if(m===!0&&(w=s(w)),!b)throw new Error(f);return{render:function(e){var t=e.results,n=e.templatesConfig,r=0===t.nbHits,s=a.prepareTemplateProps({transformData:y,defaultTemplates:p,templatesConfig:n,templates:g}),u={body:l(c("body"),d.body),footer:l(c("footer"),d.footer),header:l(c("header"),d.header),root:l(c(null),d.root),time:l(c("time"),d.time)};i.render(o.createElement(w,{cssClasses:u,hitsPerPage:t.hitsPerPage,nbHits:t.nbHits,nbPages:t.nbPages,page:t.page,processingTimeMS:t.processingTimeMS,query:t.query,shouldAutoHideContainer:r,templateProps:s}),b)}}}var o=n(218),i=n(371),a=n(373),s=n(376),u=n(377),c=n(373).bemHelper("ais-stats"),l=n(375),p=n(431),f="Usage:\nstats({\n container,\n [ template ],\n [ transformData ],\n [ autoHideContainer]\n})";e.exports=r},function(e){"use strict";e.exports={header:"",body:'{{#hasNoResults}}No results{{/hasNoResults}}\n {{#hasOneResult}}1 result{{/hasOneResult}}\n {{#hasManyResults}}{{#helpers.formatNumber}}{{nbHits}}{{/helpers.formatNumber}} results{{/hasManyResults}}\n <span class="{{cssClasses.time}}">found in {{processingTimeMS}}ms</span>',footer:""}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;return void 0===u?void 0:u.call(a)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;e=c,t=i,n=a,r=!0,s=c=void 0}},u=n(218),c=n(378),l=function(e){function t(){r(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e={hasManyResults:this.props.nbHits>1,hasNoResults:0===this.props.nbHits,hasOneResult:1===this.props.nbHits,hitsPerPage:this.props.hitsPerPage,nbHits:this.props.nbHits,nbPages:this.props.nbPages,page:this.props.page,processingTimeMS:this.props.processingTimeMS,query:this.props.query,cssClasses:this.props.cssClasses};return u.createElement(c,i({data:e,templateKey:"body"},this.props.templateProps))}}]),t}(u.Component);l.propTypes={cssClasses:u.PropTypes.shape({time:u.PropTypes.string}),hitsPerPage:u.PropTypes.number,nbHits:u.PropTypes.number,nbPages:u.PropTypes.number,page:u.PropTypes.number,processingTimeMS:u.PropTypes.number,query:u.PropTypes.string,templateProps:u.PropTypes.object.isRequired},e.exports=l},function(e,t,n){"use strict";function r(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,r=e.attributeName,h=e.label,m=e.values,v=void 0===m?{on:!0,off:void 0}:m,g=e.templates,y=void 0===g?f:g,b=e.cssClasses,w=void 0===b?{}:b,x=e.transformData,P=e.autoHideContainer,_=void 0===P?!0:P,C=s.getContainerNode(t),E=p(n(388));if(_===!0&&(E=l(E)),!t||!r||!h)throw new Error(d);var R=void 0!==v.off;return{getConfiguration:function(){return{facets:[r]}},init:function(e){var t=e.state,n=e.helper;if(void 0!==v.off){var o=t.isFacetRefined(r,v.on);o||n.addFacetRefinement(r,v.off)}},toggleRefinement:function(e,t){var n=v.on,o=v.off;t?(e.removeFacetRefinement(r,n),R&&e.addFacetRefinement(r,o)):(R&&e.removeFacetRefinement(r,o),e.addFacetRefinement(r,n)),e.search()},render:function(e){var t=e.helper,n=e.results,l=e.templatesConfig,p=e.state,d=e.createURL,m=t.state.isFacetRefined(r,v.on),g=o(n.getFacetValues(r),{name:m.toString()}),b=0===n.nbHits,P=s.prepareTemplateProps({transformData:x,defaultTemplates:f,templatesConfig:l,templates:y}),_={name:h,isRefined:m,count:g&&g.count||null},R={root:c(u(null),w.root),header:c(u("header"),w.header),body:c(u("body"),w.body),footer:c(u("footer"),w.footer),list:c(u("list"),w.list),item:c(u("item"),w.item),active:c(u("item","active"),w.active),label:c(u("label"),w.label),checkbox:c(u("checkbox"),w.checkbox),count:c(u("count"),w.count)},T=this.toggleRefinement.bind(this,t,m);a.render(i.createElement(E,{createURL:function(){return d(p.toggleRefinement(r,_.isRefined))},cssClasses:R,facetValues:[_],shouldAutoHideContainer:b,templateProps:P,toggleRefinement:T}),C)}}}var o=n(128),i=n(218),a=n(371),s=n(373),u=s.bemHelper("ais-toggle"),c=n(375),l=n(376),p=n(377),f=n(434),d="Usage:\ntoggle({\n container,\n attributeName,\n label,\n [ userValues={on: true, off: undefined} ],\n [ cssClasses.{root,header,body,footer,list,item,active,label,checkbox,count} ],\n [ templates.{header,item,footer} ],\n [ transformData ],\n [ autoHideContainer=true ]\n})";e.exports=r},function(e){"use strict";e.exports={header:"",item:'<label class="{{cssClasses.label}}">\n <input type="checkbox" class="{{cssClasses.checkbox}}" value="{{name}}" {{#isRefined}}checked{{/isRefined}} />{{name}}\n <span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span>\n</label>',footer:""}}])}); //# sourceMappingURL=instantsearch.min.map
ajax/libs/can.js/4.0.0-pre.3/can.all.min.js
seogi1004/cdnjs
!function(e,t,n){var i=t.define,a=function(e){var n,i=e.split("."),a=t;for(n=0;n<i.length&&a;n++)a=a[i[n]];return a},r=function(e,n){var i,a,r,o=e.split("."),s=t;for(i=0;i<o.length-1;i++)(r=s[a=o[i]])||(r=s[a]={}),s=r;s[a=o[o.length-1]]=n},o=function(e){if(!e||!e.__esModule)return!1;var t={__esModule:!0,default:!0};for(var n in e)if(!t[n])return!1;return!0},s=function(e){return"require"===e[0]&&"exports"===e[1]&&"module"===e[2]},c=t.define&&t.define.modules||t._define&&t._define.modules||{},l=t.define=function(n,u,d){var p;"function"==typeof u&&(d=u,u=[]);var f,h=[];for(f=0;f<u.length;f++)h.push(e[u[f]]?a(e[u[f]]):c[u[f]]||a(u[f]));s(u)||!u.length&&d.length?(p={exports:{}},h[0]=function(t){return e[t]?a(e[t]):c[t]},h[1]=p.exports,h[2]=p):h[0]||"exports"!==u[0]?h[0]||"module"!==u[0]||(h[0]={id:n}):(p={exports:{}},h[0]=p.exports,"module"===u[1]&&(h[1]=p)),t.define=i;var v=d?d.apply(null,h):void 0;t.define=l,v=p&&p.exports?p.exports:v,c[n]=v;var m=e[n];m&&!a(m)&&(o(v)&&(v=v.default),r(m,v))};t.define.orig=i,t.define.modules=c,t.define.amd=!0,l("@loader",[],function(){var e=function(){};return{get:function(){return{prepareGlobal:e,retrieveGlobal:e}},global:t,__exec:function(e){n(e.source,t)}}})}({jquery:"jQuery","can-util/namespace":"can",kefir:"Kefir","validate.js":"validate",react:"React"},"object"==typeof self&&self.Object==Object?self:window,function(__$source__,__$global__){eval("(function() { "+__$source__+" \n }).call(__$global__);")}),define("can-namespace",function(e,t,n){n.exports={}}),define("can-util/namespace",["require","exports","module","can-namespace"],function(e,t,n){n.exports=e("can-namespace")}),define("can-assign",function(e,t,n){n.exports=function(e,t){for(var n in t)e[n]=t[n];return e}}),define("can-util/js/assign/assign",["require","exports","module","can-assign"],function(e,t,n){"use strict";n.exports=e("can-assign")}),define("can-util/js/is-function/is-function",function(e,t,n){"use strict";var i="undefined"!=typeof document&&"function"==typeof document.getElementsByTagName("body")?function(e){return"[object Function]"===Object.prototype.toString.call(e)}:function(e){return"function"==typeof e};n.exports=i}),define("can-util/js/is-plain-object/is-plain-object",function(e,t,n){"use strict";function i(e){return null!==e&&e==e.window}var a=Object.prototype.hasOwnProperty;n.exports=function(e){if(!e||"object"!=typeof e||e.nodeType||i(e)||e.constructor&&e.constructor.shortName)return!1;try{if(e.constructor&&!a.call(e,"constructor")&&!a.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var t;for(t in e);return void 0===t||a.call(e,t)}}),define("can-util/js/deep-assign/deep-assign",["require","exports","module","can-util/js/is-function/is-function","can-util/js/is-plain-object/is-plain-object"],function(e,t,n){"use strict";function i(){var e,t,n,o,s,c,l=arguments[0]||{},u=1,d=arguments.length;for("object"==typeof l||a(l)||(l={}),d===u&&(l=this,--u);u<d;u++)if(null!=(e=arguments[u]))for(t in e)n=l[t],l!==(o=e[t])&&(o&&(r(o)||(s=Array.isArray(o)))?(s?(s=!1,c=n&&Array.isArray(n)?n:[]):c=n&&r(n)?n:{},l[t]=i(c,o)):void 0!==o&&(l[t]=o));return l}var a=e("can-util/js/is-function/is-function"),r=e("can-util/js/is-plain-object/is-plain-object");n.exports=i}),define("can-log",function(e,t,n){"use strict";t.warnTimeout=5e3,t.logLevel=0,t.warn=function(e){this.logLevel<2&&(Array.prototype.unshift.call(arguments,"WARN:"),"undefined"!=typeof console&&console.warn?this._logger("warn",Array.prototype.slice.call(arguments)):"undefined"!=typeof console&&console.log?this._logger("log",Array.prototype.slice.call(arguments)):window&&window.opera&&window.opera.postError&&window.opera.postError("CanJS WARNING: "+e))},t.log=function(e){this.logLevel<1&&("undefined"!=typeof console&&console.log?(Array.prototype.unshift.call(arguments,"INFO:"),this._logger("log",Array.prototype.slice.call(arguments))):window&&window.opera&&window.opera.postError&&window.opera.postError("CanJS INFO: "+e))},t.error=function(e){this.logLevel<1&&("undefined"!=typeof console&&console.error?(Array.prototype.unshift.call(arguments,"ERROR:"),this._logger("error",Array.prototype.slice.call(arguments))):window&&window.opera&&window.opera.postError&&window.opera.postError("ERROR: "+e))},t._logger=function(e,t){try{console[e].apply(console,t)}catch(n){console[e](t)}}}),define("can-log/dev/dev",["require","exports","module","can-log"],function(e,t,n){"use strict";var i=e("can-log");n.exports={warnTimeout:5e3,logLevel:0,stringify:function(e){return JSON.stringify(e,function(e,t){return void 0===t?"/* void(undefined) */":t}," ").replace(/"\/\* void\(undefined\) \*\/"/g,"undefined")},warn:function(){i.warn.apply(this,arguments)},log:function(){i.log.apply(this,arguments)},error:function(){i.error.apply(this,arguments)},_logger:i._logger}}),define("can-util/js/dev/dev",["require","exports","module","can-log/dev/dev"],function(e,t,n){"use strict";n.exports=e("can-log/dev/dev")}),define("can-util/js/is-array-like/is-array-like",function(e,t,n){"use strict";n.exports=function(e){var t=typeof e;if("string"===t)return!0;if("number"===t)return!1;var n=e&&"boolean"!==t&&"number"!=typeof e&&"length"in e&&e.length;return"function"!=typeof e&&(0===n||"number"==typeof n&&n>0&&n-1 in e)}}),define("can-symbol",["require","exports","module","can-namespace"],function(e,t,n){!function(e,t,n,i){var a,r=t("can-namespace");if("undefined"!=typeof Symbol&&"function"==typeof Symbol.for)a=Symbol;else{var o=0,s={},c={};(a=function(e){var t="@@symbol"+o+++e,n={};return Object.defineProperties(n,{toString:{value:function(){return t}}}),n}).for=function(e){var t=s[e];return t||(t=s[e]=a(e),c[t]=e),t},a.keyFor=function(e){return c[e]},["hasInstance","isConcatSpreadable","iterator","match","prototype","replace","search","species","split","toPrimitive","toStringTag","unscopables"].forEach(function(e){a[e]=a.for(e)})}["isMapLike","isListLike","isValueLike","isFunctionLike","getOwnKeys","getOwnKeyDescriptor","proto","getOwnEnumerableKeys","hasOwnKey","size","getName","getIdentity","assignDeep","updateDeep","getValue","setValue","getKeyValue","setKeyValue","updateValues","addValue","removeValues","apply","new","onValue","offValue","onKeyValue","offKeyValue","getKeyDependencies","getValueDependencies","keyHasDependencies","valueHasDependencies","onKeys","onKeysAdded","onKeysRemoved"].forEach(function(e){a.for("can."+e)}),i.exports=r.Symbol=a}(0,e,0,n)}),define("can-util/js/is-iterable/is-iterable",["require","exports","module","can-symbol"],function(e,t,n){"use strict";var i=e("can-symbol");n.exports=function(e){return e&&!!e[i.iterator||i.for("iterator")]}}),define("can-util/js/each/each",["require","exports","module","can-util/js/is-array-like/is-array-like","can-util/js/is-iterable/is-iterable","can-symbol"],function(e,t,n){"use strict";var i=e("can-util/js/is-array-like/is-array-like"),a=Object.prototype.hasOwnProperty,r=e("can-util/js/is-iterable/is-iterable"),o=e("can-symbol");n.exports=function(e,t,n){var s,c,l,u=0;if(e)if(i(e))for(c=e.length;u<c&&(l=e[u],!1!==t.call(n||l,l,u,e));u++);else if(r(e))for(var d,p,f=e[o.iterator||o.for("iterator")]();!(d=f.next()).done;)p=d.value,t.call(n||e,Array.isArray(p)?p[1]:p,p[0]);else if("object"==typeof e)for(s in e)if(a.call(e,s)&&!1===t.call(n||e[s],e[s],s,e))break;return e}}),define("can-util/js/make-array/make-array",["require","exports","module","can-util/js/each/each","can-util/js/is-array-like/is-array-like"],function(e,t,n){"use strict";var i=e("can-util/js/each/each"),a=e("can-util/js/is-array-like/is-array-like");n.exports=function(e){var t=[];return a(e)?i(e,function(e,n){t[n]=e}):(0===e||e)&&t.push(e),t}}),define("can-util/js/is-container/is-container",function(e,t,n){"use strict";n.exports=function(e){return/^f|^o/.test(typeof e)}}),define("can-util/js/get/get",["require","exports","module","can-util/js/is-container/is-container"],function(e,t,n){"use strict";var i=e("can-util/js/is-container/is-container");n.exports=function(e,t){var n,a,r=void 0!==t?(t+"").replace(/\[/g,".").replace(/]/g,"").split("."):[],o=r.length;if(!o)return e;for(n=e,a=0;a<o&&i(n);a++)n=n[r[a]];return n}}),define("can-util/js/is-array/is-array",["require","exports","module","can-log/dev/dev"],function(e,t,n){"use strict";var i=e("can-log/dev/dev"),a=!1;n.exports=function(e){return a||(i.warn("js/is-array/is-array is deprecated; use Array.isArray"),a=!0),Array.isArray(e)}}),define("can-util/js/string/string",["require","exports","module","can-util/js/get/get","can-util/js/is-container/is-container","can-log/dev/dev","can-util/js/is-array/is-array"],function(e,t,n){"use strict";var i=e("can-util/js/get/get"),a=e("can-util/js/is-container/is-container"),r=e("can-log/dev/dev"),o=e("can-util/js/is-array/is-array"),s=/\=\=/,c=/([A-Z]+)([A-Z][a-z])/g,l=/([a-z\d])([A-Z])/g,u=/([a-z\d])([A-Z])/g,d=/\{([^\}]+)\}/g,p=/"/g,f=/'/g,h=/-+(.)?/g,v=/[a-z][A-Z]/g,m=function(e){return""+(null===e||void 0===e||isNaN(e)&&""+e=="NaN"?"":e)},g=function(e,t){for(var n=t?t.replace(/\[/g,".").replace(/]/g,"").split("."):[],i=e,a=0;a<n.length-1;a++)i&&(i=i[n[a]]);i&&delete i[n[n.length-1]]},y={esc:function(e){return m(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(p,"&#34;").replace(f,"&#39;")},getObject:function(e,t){r.warn("string.getObject is deprecated, please use can-util/js/get/get instead.");for(var n,a=(t=o(t)?t:[t||window]).length,s=0;s<a;s++)if(n=i(t[s],e))return n},capitalize:function(e,t){return e.charAt(0).toUpperCase()+e.slice(1)},camelize:function(e){return m(e).replace(h,function(e,t){return t?t.toUpperCase():""})},hyphenate:function(e){return m(e).replace(v,function(e,t){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})},underscore:function(e){return e.replace(s,"/").replace(c,"$1_$2").replace(l,"$1_$2").replace(u,"_").toLowerCase()},sub:function(e,t,n){var r=[];return e=e||"",r.push(e.replace(d,function(e,o){var s=i(t,o);return!0===n&&g(t,o),void 0===s||null===s?(r=null,""):a(s)&&r?(r.push(s),""):""+s})),null===r?r:r.length<=1?r[0]:r},replacer:d,undHash:/_|-/};n.exports=y}),define("can-construct",["require","exports","module","can-util/js/assign/assign","can-util/js/deep-assign/deep-assign","can-util/js/dev/dev","can-util/js/make-array/make-array","can-namespace","can-util/js/string/string"],function(e,t,n){"use strict";var i,a=e("can-util/js/assign/assign"),r=e("can-util/js/deep-assign/deep-assign"),o=e("can-util/js/dev/dev"),s=e("can-util/js/make-array/make-array"),c=e("can-namespace"),l=e("can-util/js/string/string"),u={abstract:!0,boolean:!0,break:!0,byte:!0,case:!0,catch:!0,char:!0,class:!0,const:!0,continue:!0,debugger:!0,default:!0,delete:!0,do:!0,double:!0,else:!0,enum:!0,export:!0,extends:!0,false:!0,final:!0,finally:!0,float:!0,for:!0,function:!0,goto:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,int:!0,interface:!0,let:!0,long:!0,native:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,short:!0,static:!0,super:!0,switch:!0,synchronized:!0,this:!0,throw:!0,throws:!0,transient:!0,true:!0,try:!0,typeof:!0,var:!0,void:!0,volatile:!0,while:!0,with:!0},d=/[^A-Z0-9_]/gi,p=0,f=function(e){return function(t,n){return(t in e?e[t]:e[t]=new Function("__","function "+t+"(){return __.apply(this,arguments)};return "+t))(n)}}({}),h=function(){if(arguments.length)return h.extend.apply(h,arguments)};try{Object.getOwnPropertyDescriptor({}),i=!0}catch(e){i=!1}var v=function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return n&&(n.get||n.set)?n:null};a(h,{constructorExtends:!0,newInstance:function(){var e,t=this.instance();if(t.setup){if(Object.defineProperty(t,"__inSetup",{configurable:!0,enumerable:!1,value:!0,writable:!0}),(e=t.setup.apply(t,arguments))instanceof h.ReturnValue)return e.value;t.__inSetup=!1}return t.init&&t.init.apply(t,e||arguments),t},_inherit:i?function(e,t,n){n=n||e;var i;for(var a in e)(i=v(e,a))?this._defineProperty(n,t,a,i):h._overwrite(n,t,a,e[a])}:function(e,t,n){n=n||e;for(var i in e)h._overwrite(n,t,i,e[i])},_defineProperty:function(e,t,n,i){Object.defineProperty(e,n,i)},_overwrite:function(e,t,n,i){Object.defineProperty(e,n,{value:i,configurable:!0,enumerable:!0,writable:!0})},setup:function(e){this.defaults=r(!0,{},e.defaults,this.defaults)},instance:function(){p=1;var e=new this;return p=0,e},extend:function(e,t,n){function i(){if(!p)return(!this||this.constructor!==m&&arguments.length&&m.constructorExtends)&&o.warn("can/construct/construct.js: extending a Construct without calling extend"),this&&this.constructor===m||!arguments.length||!m.constructorExtends?m.newInstance.apply(m,arguments):m.extend.apply(m,arguments)}var r=e,c=t,v=n;"string"!=typeof r&&(v=c,c=r,r=null),v||(v=c,c=null),v=v||{};var m,g,y=this,b=this.prototype;g=this.instance(),h._inherit(v,b,g),r||(c&&c.shortName?r=c.shortName:this.shortName&&(r=this.shortName));var w=r?r.replace(d,"_"):"Constructor";u[w]&&(w=l.capitalize(w)),m="function"==typeof f?f(w,i):function(){return i.apply(this,arguments)};for(var k in y)y.hasOwnProperty(k)&&(m[k]=y[k]);h._inherit(c,y,m),a(m,{constructor:m,prototype:g}),void 0!==r&&(m.shortName=r),m.prototype.constructor=m;var x=[y].concat(s(arguments)),j=m.setup.apply(m,x);return m.init&&m.init.apply(m,j||x),m},ReturnValue:function(e){this.value=e}}),h.prototype.setup=function(){},h.prototype.init=function(){},n.exports=c.Construct=h}),define("can-cid",["require","exports","module","can-namespace"],function(e,t,n){var i=e("can-namespace"),a=0,r="can"+new Date,o=function(e,t){var n=e.nodeName?r:"_cid";return e[n]||(a++,e[n]=(t||"")+a),e[n]};if(o.domExpando=r,o.get=function(e){var t=typeof e;return null!==t&&("object"===t||"function"===t)?o(e):t+":"+e},i.cid)throw new Error("You can't have two versions of can-cid, check your dependencies");n.exports=i.cid=o}),define("can-dom-data-state",["require","exports","module","can-namespace","can-cid"],function(e,t,n){"use strict";var i=e("can-namespace"),a=e("can-cid"),r={},o=function(e){for(var t in e)return!1;return!0},s=function(e,t){var n=a(this),i=r[n],o=!1;return r[n]||(o=!0,i=r[n]={}),void 0!==e&&(i[e]=t),o},c=function(){var e=a.get(this),t=!1;return e&&r[e]&&(t=!0,delete r[e]),t},l={_data:r,getCid:function(){return a.get(this)},cid:function(){return a(this)},expando:a.domExpando,get:function(e){var t=a.get(this),n=t&&r[t];return void 0===e?n||s(this):n&&n[e]},set:s,clean:function(e){var t=a.get(this),n=r[t];n&&n[e]&&delete n[e],o(n)&&c.call(this)},delete:c};if(i.domDataState)throw new Error("You can't have two versions of can-dom-data-state, check your dependencies");n.exports=i.domDataState=l}),define("can-reflect/reflections/helpers",["require","exports","module","can-symbol"],function(e,t,n){var i=e("can-symbol");n.exports={makeGetFirstSymbolValue:function(e){var t=e.map(function(e){return i.for(e)}),n=t.length;return function(e){for(var i=-1;++i<n;)if(void 0!==e[t[i]])return e[t[i]]}},hasLength:function(e){var t=typeof e,n=e&&"boolean"!==t&&"number"!=typeof e&&"length"in e&&e.length;return"function"!=typeof e&&(0===n||"number"==typeof n&&n>0&&n-1 in e)}}}),define("can-reflect/reflections/type/type",["require","exports","module","can-symbol","can-reflect/reflections/helpers"],function(e,t,n){function i(e){var t=typeof e;return null==e||"function"!==t&&"object"!==t}function a(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t)return!0;var n=p.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&f.call(n)===h}var r,o=e("can-symbol"),s=e("can-reflect/reflections/helpers"),c=Object.getOwnPropertyNames(function(){}.prototype),l=Object.getPrototypeOf(function(){}.prototype),u=s.makeGetFirstSymbolValue(["can.new","can.apply"]),d=s.makeGetFirstSymbolValue(["can.onValue","can.onKeyValue","can.onKeys","can.onKeysAdded"]);if("undefined"!=typeof Symbol&&"function"==typeof Symbol.for)r=function(e){return"symbol"==typeof e};else{r=function(e){return"object"==typeof e&&!Array.isArray(e)&&"@@symbol"===e.toString().substr(0,"@@symbol".length)}}var p=Object.prototype.hasOwnProperty,f=Function.prototype.toString,h=f.call(Object);n.exports={isConstructorLike:function(e){var t=e[o.for("can.new")];if(void 0!==t)return t;if("function"!=typeof e)return!1;var n=e.prototype;if(!n)return!1;if(l!==Object.getPrototypeOf(n))return!0;var i=Object.getOwnPropertyNames(n);if(i.length===c.length){for(var a=0,r=i.length;a<r;a++)if(i[a]!==c[a])return!0;return!1}return!0},isFunctionLike:function(e){var t,n=e[o.for("can.isFunctionLike")];return void 0!==n?n:void 0!==(t=u(e))?!!t:"function"==typeof e},isListLike:function(e){var t;if("string"==typeof e)return!0;if(i(e))return!1;if(void 0!==(t=e[o.for("can.isListLike")]))return t;var n=e[o.iterator];return void 0!==n?!!n:!!Array.isArray(e)||s.hasLength(e)},isMapLike:function(e){if(i(e))return!1;var t=e[o.for("can.isMapLike")];if(void 0!==t)return!!t;var n=e[o.for("can.getKeyValue")];return void 0===n||!!n},isObservableLike:function(e){if(i(e))return!1;var t=d(e);return void 0!==t&&!!t},isPrimitive:i,isBuiltIn:function(e){return!!(i(e)||Array.isArray(e)||a(e)||"[object Object]"!==Object.prototype.toString.call(e)&&-1!==Object.prototype.toString.call(e).indexOf("[object "))},isValueLike:function(e){var t;if(i(e))return!0;if(void 0!==(t=e[o.for("can.isValueLike")]))return t;var n=e[o.for("can.getValue")];return void 0!==n?!!n:void 0},isSymbolLike:r,isMoreListLikeThanMapLike:function(e){if(Array.isArray(e))return!0;var t=e[o.for("can.isMoreListLikeThanMapLike")];if(void 0!==t)return t;var n=this.isListLike(e),i=this.isMapLike(e);return!(!n||i)||!(!n&&i)&&void 0},isIteratorLike:function(e){return e&&"object"==typeof e&&"function"==typeof e.next&&0===e.next.length},isPromise:function(e){return e instanceof Promise||"[object Promise]"===Object.prototype.toString.call(e)},isPlainObject:a}}),define("can-reflect/reflections/call/call",["require","exports","module","can-symbol","can-reflect/reflections/type/type"],function(e,t,n){var i=e("can-symbol"),a=e("can-reflect/reflections/type/type");n.exports={call:function(e,t){var n=[].slice.call(arguments,2),a=e[i.for("can.apply")];return a?a.call(e,t,n):e.apply(t,n)},apply:function(e,t,n){var a=e[i.for("can.apply")];return a?a.call(e,t,n):e.apply(t,n)},new:function(e){var t=[].slice.call(arguments,1),n=e[i.for("can.new")];if(n)return n.apply(e,t);var r=Object.create(e.prototype),o=e.apply(r,t);return a.isPrimitive(o)?r:o}}}),define("can-reflect/reflections/get-set/get-set",["require","exports","module","can-symbol","can-reflect/reflections/type/type"],function(e,t,n){var i=e("can-symbol"),a=e("can-reflect/reflections/type/type"),r=i.for("can.setKeyValue"),o=i.for("can.getKeyValue"),s=i.for("can.getValue"),c=i.for("can.setValue"),l={setKeyValue:function(e,t,n){if(a.isSymbolLike(t))"symbol"==typeof t?e[t]=n:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n,writable:!0});else{var i=e[r];if(void 0!==i)return i.call(e,t,n);e[t]=n}},getKeyValue:function(e,t){var n=e[o];return n?n.call(e,t):e[t]},deleteKeyValue:function(e,t){var n=e[i.for("can.deleteKeyValue")];if(n)return n.call(e,t);delete e[t]},getValue:function(e){if(a.isPrimitive(e))return e;var t=e[s];return t?t.call(e):e},setValue:function(e,t){var n=e&&e[c];if(n)return n.call(e,t);throw new Error("can-reflect.setValue - Can not set value.")},splice:function(e,t,n,a){var r;if("number"!=typeof n){var o=e[i.for("can.updateValues")];if(o)return o.call(e,t,n,a);r=n.length}else r=n;var s=e[i.for("can.splice")];return s?s.call(e,t,r,a):[].splice.apply(e,[t,r].concat(a))},addValues:function(e,t,n){var a=e[i.for("can.addValues")];return a?a.call(e,t,n):Array.isArray(e)&&void 0===n?e.push.apply(e,t):l.splice(e,n,[],t)},removeValues:function(e,t,n){var a=e[i.for("can.removeValues")];if(a)return a.call(e,t,n);{if(!Array.isArray(e)||void 0!==n)return l.splice(e,n,t,[]);t.forEach(function(t){var n=e.indexOf(t);n>=0&&e.splice(n,1)})}}};l.get=l.getKeyValue,l.set=l.setKeyValue,l.delete=l.deleteKeyValue,n.exports=l}),define("can-reflect/reflections/observe/observe",["require","exports","module","can-symbol"],function(e,t,n){function i(e,t){return function(n,i,a,o){var s=n[r.for(e)];return void 0!==s?s.call(n,i,a,o):this[t].apply(this,arguments)}}function a(e,t){return function(n){var i=n[r.for(e)];if(void 0!==i){var a=o.call(arguments,1);return i.apply(n,a)}throw new Error(t)}}var r=e("can-symbol"),o=[].slice;n.exports={onKeyValue:i("can.onKeyValue","onEvent"),offKeyValue:i("can.offKeyValue","offEvent"),onKeys:a("can.onKeys","can-reflect: can not observe an onKeys event"),onKeysAdded:a("can.onKeysAdded","can-reflect: can not observe an onKeysAdded event"),onKeysRemoved:a("can.onKeysRemoved","can-reflect: can not unobserve an onKeysRemoved event"),getKeyDependencies:a("can.getKeyDependencies","can-reflect: can not determine dependencies"),keyHasDependencies:a("can.keyHasDependencies","can-reflect: can not determine if this has key dependencies"),onValue:a("can.onValue","can-reflect: can not observe value change"),offValue:a("can.offValue","can-reflect: can not unobserve value change"),getValueDependencies:a("can.getValueDependencies","can-reflect: can not determine dependencies"),valueHasDependencies:a("can.valueHasDependencies","can-reflect: can not determine if value has dependencies"),onEvent:function(e,t,n,i){if(e){var a=e[r.for("can.onEvent")];if(void 0!==a)return a.call(e,t,n,i);e.addEventListener&&e.addEventListener(t,n,i)}},offEvent:function(e,t,n,i){if(e){var a=e[r.for("can.offEvent")];if(void 0!==a)return a.call(e,t,n,i);e.removeEventListener&&e.removeEventListener(t,n,i)}},setPriority:function(e,t){if(e){var n=e[r.for("can.setPriority")];if(void 0!==n)return n.call(e,t),!0}return!1},getPriority:function(e){if(e){var t=e[r.for("can.getPriority")];if(void 0!==t)return t.call(e)}}}}),define("can-reflect/reflections/shape/shape",["require","exports","module","can-symbol","can-reflect/reflections/get-set/get-set","can-reflect/reflections/type/type","can-reflect/reflections/helpers"],function(e,t,n){function i(e){return!!d.isPrimitive(e)||!w(e)&&(d.isBuiltIn(e)&&!d.isPlainObject(e))}function a(e,t){return function(n,a){if(i(n))return n;var r;a&&!b&&(b={unwrap:new a,serialize:new a},r=!0);var o;if(d.isValueLike(n))o=this[e](u.getValue(n));else{var s=d.isIteratorLike(n)||d.isMoreListLikeThanMapLike(n);if(o=s?[]:{},b){if(b[e].has(n))return b[e].get(n);b[e].set(n,o)}for(var c=0,l=t.length;c<l;c++){var p=n[t[c]];if(p){var f=p.call(n,o);return r&&(b=null),f}}"function"==typeof obj?(b&&b[e].set(n,n),o=n):s?this.eachIndex(n,function(t,n){o[n]=this[e](t)},this):this.eachKey(n,function(t,n){o[n]=this[e](t)},this)}return r&&(b=null),o}}function r(e,t){var n=e[e.length-1];if(n&&n.deleteCount===n.insert.length&&t.index-n.index===n.deleteCount)return n.insert.push.apply(n.insert,t.insert),void(n.deleteCount+=t.deleteCount);e.push(t)}function o(e,t,n){var i=this.toArray(t),a=[],o=-1;this.eachIndex(e,function(e,t){if(o=t,t>=i.length)return n||r(a,{index:t,deleteCount:i.length-t+1,insert:[]}),!1;var s=i[t];d.isPrimitive(e)||d.isPrimitive(s)||!1===k(e)?r(a,{index:t,deleteCount:1,insert:[s]}):this.updateDeep(e,s)},this),i.length>o&&r(a,{index:o+1,deleteCount:0,insert:i.slice(o+1)});for(var s=0,c=a.length;s<c;s++){var l=a[s];u.splice(e,l.index,l.deleteCount,l.insert)}return e}var s,c,l=e("can-symbol"),u=e("can-reflect/reflections/get-set/get-set"),d=e("can-reflect/reflections/type/type"),p=e("can-reflect/reflections/helpers"),f=function(e){return function(){var t=[this];return t.push.apply(t,arguments),e.apply(null,t)}},h=l.for("can.getKeyValue"),v=f(u.getKeyValue),m=l.for("can.setKeyValue"),g=f(u.setKeyValue),y=l.for("can.size"),b=null,w=p.makeGetFirstSymbolValue(["can.updateDeep","can.assignDeep","can.setKeyValue"]),k=function(e){return d.isPlainObject(e)||Array.isArray(e)||!!w(e)};try{Object.keys(1),c=Object.keys}catch(e){c=function(e){return d.isPrimitive(e)?[]:Object.keys(e)}}var x;x="undefined"!=typeof Map?function(e){var t=new Map;return s.eachIndex(e,function(e){t.set(e,!0)}),t}:function(e){var t={};return e.forEach(function(e){t[e]=!0}),{get:function(e){return t[e]},set:function(e,n){t[e]=n},keys:function(){return e}}};var j=function(e){var t=e[l.for("can.hasOwnKey")];if(t)return t.bind(e);var n=x(s.getOwnEnumerableKeys(e));return function(e){return n.get(e)}};(s={each:function(e,t,n){return d.isIteratorLike(e)||d.isMoreListLikeThanMapLike(e)?this.eachIndex(e,t,n):this.eachKey(e,t,n)},eachIndex:function(e,t,n){if(Array.isArray(e))return this.eachListLike(e,t,n);var i,a=e[l.iterator];if(d.isIteratorLike(e)?i=e:a&&(i=a.call(e)),i)for(var r,o=0;!(r=i.next()).done&&!1!==t.call(n||e,r.value,o++,e););else this.eachListLike(e,t,n);return e},eachListLike:function(e,t,n){var i=-1,a=e.length;if(void 0===a){var r=e[y];if(!r)throw new Error("can-reflect: unable to iterate.");a=r.call(e)}for(;++i<a;){var o=e[i];if(!1===t.call(n||o,o,i,e))break}return e},toArray:function(e){var t=[];return this.each(e,function(e){t.push(e)}),t},eachKey:function(e,t,n){if(e){var i=this.getOwnEnumerableKeys(e),a=e[h]||v;return this.eachIndex(i,function(i){var r=a.call(e,i);return t.call(n||e,r,i,e)})}return e},hasOwnKey:function(e,t){var n=e[l.for("can.hasOwnKey")];if(n)return n.call(e,t);var i=e[l.for("can.getOwnKeys")];if(i){var a=!1;return this.eachIndex(i.call(e),function(e){if(e===t)return a=!0,!1}),a}return e.hasOwnProperty(t)},getOwnEnumerableKeys:function(e){var t=e[l.for("can.getOwnEnumerableKeys")];if(t)return t.call(e);if(e[l.for("can.getOwnKeys")]&&e[l.for("can.getOwnKeyDescriptor")]){var n=[];return this.eachIndex(this.getOwnKeys(e),function(t){this.getOwnKeyDescriptor(e,t).enumerable&&n.push(t)},this),n}return c(e)},getOwnKeys:function(e){var t=e[l.for("can.getOwnKeys")];return t?t.call(e):Object.getOwnPropertyNames(e)},getOwnKeyDescriptor:function(e,t){var n=e[l.for("can.getOwnKeyDescriptor")];return n?n.call(e,t):Object.getOwnPropertyDescriptor(e,t)},unwrap:a("unwrap",[l.for("can.unwrap")]),serialize:a("serialize",[l.for("can.serialize"),l.for("can.unwrap")]),assignMap:function(e,t){var n=j(e),i=e[h]||v,a=e[m]||g;return this.eachKey(t,function(t,r){n(r)&&i.call(e,r)===t||a.call(e,r,t)}),e},assignList:function(e,t){var n=this.toArray(t);return u.splice(e,0,n,n),e},assign:function(e,t){return d.isIteratorLike(t)||d.isMoreListLikeThanMapLike(t)?this.assignList(e,t):this.assignMap(e,t),e},assignDeepMap:function(e,t){var n=j(e),i=e[h]||v,a=e[m]||g;return this.eachKey(t,function(t,r){if(n(r)){var o=i.call(e,r);t===o||(d.isPrimitive(o)||d.isPrimitive(t)||!1===k(o)?a.call(e,r,t):this.assignDeep(o,t))}else u.setKeyValue(e,r,t)},this),e},assignDeepList:function(e,t){return o.call(this,e,t,!0)},assignDeep:function(e,t){var n=e[l.for("can.assignDeep")];return n?n.call(e,t):d.isMoreListLikeThanMapLike(t)?this.assignDeepList(e,t):this.assignDeepMap(e,t),e},updateMap:function(e,t){var n=x(this.getOwnEnumerableKeys(t)),i=t[h]||v,a=e[m]||g;return this.eachKey(e,function(r,o){if(n.get(o)){n.set(o,!1);var s=i.call(t,o);s!==r&&a.call(e,o,s)}else u.deleteKeyValue(e,o)},this),this.eachIndex(n.keys(),function(r){n.get(r)&&a.call(e,r,i.call(t,r))}),e},updateList:function(e,t){var n=this.toArray(t);return u.splice(e,0,e,n),e},update:function(e,t){return d.isIteratorLike(t)||d.isMoreListLikeThanMapLike(t)?this.updateList(e,t):this.updateMap(e,t),e},updateDeepMap:function(e,t){var n=x(this.getOwnEnumerableKeys(t)),i=t[h]||v,a=e[m]||g;return this.eachKey(e,function(r,o){if(n.get(o)){n.set(o,!1);var s=i.call(t,o);d.isPrimitive(r)||d.isPrimitive(s)||!1===k(r)?a.call(e,o,s):this.updateDeep(r,s)}else u.deleteKeyValue(e,o)},this),this.eachIndex(n.keys(),function(r){n.get(r)&&a.call(e,r,i.call(t,r))}),e},updateDeepList:function(e,t){return o.call(this,e,t)},updateDeep:function(e,t){var n=e[l.for("can.updateDeep")];return n?n.call(e,t):d.isMoreListLikeThanMapLike(t)?this.updateDeepList(e,t):this.updateDeepMap(e,t),e},in:function(){},getAllEnumerableKeys:function(){},getAllKeys:function(){},assignSymbols:function(e,t){return this.eachKey(t,function(t,n){var i=d.isSymbolLike(l[n])?l[n]:l.for(n);u.setKeyValue(e,i,t)}),e},isSerializable:i,size:function(e){var t=e[y],n=0;if(t)return t.call(e);if(p.hasLength(e))return e.length;if(d.isListLike(e))return this.each(e,function(){n++}),n;if(e){for(var i in e)e.hasOwnProperty(i)&&n++;return n}}}).keys=s.getOwnEnumerableKeys,n.exports=s}),define("can-reflect/reflections/get-name/get-name",["require","exports","module","can-symbol","can-reflect/reflections/type/type"],function(e,t,n){function i(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e)return e.name;if(e.constructor&&e!==e.constructor){var n=i(e.constructor);if(n){if(r.isValueLike(e))return n+"<>";if(r.isMoreListLikeThanMapLike(e))return n+"[]";if(r.isMapLike(e))return n+"{}"}}}var a=e("can-symbol"),r=e("can-reflect/reflections/type/type"),o=a.for("can.getName");n.exports={setName:function(e,t){if("function"!=typeof t){var n=t;t=function(){return n}}Object.defineProperty(e,o,{value:t})},getName:i}}),define("can-reflect/types/map",["require","exports","module","can-reflect/reflections/shape/shape","can-symbol"],function(e,t,n){var i=e("can-reflect/reflections/shape/shape"),a=e("can-symbol");"undefined"!=typeof Map&&(i.assignSymbols(Map.prototype,{"can.getOwnEnumerableKeys":Map.prototype.keys,"can.setKeyValue":Map.prototype.set,"can.getKeyValue":Map.prototype.get,"can.deleteKeyValue":Map.prototype.delete,"can.hasOwnKey":Map.prototype.has}),"function"!=typeof Map.prototype.keys&&(Map.prototype.keys=Map.prototype[a.for("can.getOwnEnumerableKeys")]=function(){var e=[],t=0;return this.forEach(function(t,n){e.push(n)}),{next:function(){return{value:e[t],done:t++===e.length}}}})),"undefined"!=typeof WeakMap&&i.assignSymbols(WeakMap.prototype,{"can.getOwnEnumerableKeys":function(){throw new Error("can-reflect: WeakMaps do not have enumerable keys.")},"can.setKeyValue":WeakMap.prototype.set,"can.getKeyValue":WeakMap.prototype.get,"can.deleteKeyValue":WeakMap.prototype.delete,"can.hasOwnKey":WeakMap.prototype.has})}),define("can-reflect/types/set",["require","exports","module","can-reflect/reflections/shape/shape","can-symbol"],function(e,t,n){var i=e("can-reflect/reflections/shape/shape"),a=e("can-symbol");"undefined"!=typeof Set&&(i.assignSymbols(Set.prototype,{"can.isMoreListLikeThanMapLike":!0,"can.updateValues":function(e,t,n){t!==n&&i.each(t,function(e){this.delete(e)},this),i.each(n,function(e){this.add(e)},this)},"can.size":function(){return this.size}}),"function"!=typeof Set.prototype[a.iterator]&&(Set.prototype[a.iterator]=function(){var e=[],t=0;return this.forEach(function(t){e.push(t)}),{next:function(){return{value:e[t],done:t++===e.length}}}})),"undefined"!=typeof WeakSet&&i.assignSymbols(WeakSet.prototype,{"can.isListLike":!0,"can.isMoreListLikeThanMapLike":!0,"can.updateValues":function(e,t,n){t!==n&&i.each(t,function(e){this.delete(e)},this),i.each(n,function(e){this.add(e)},this)},"can.size":function(){throw new Error("can-reflect: WeakSets do not have enumerable keys.")}})}),define("can-reflect",["require","exports","module","can-reflect/reflections/call/call","can-reflect/reflections/get-set/get-set","can-reflect/reflections/observe/observe","can-reflect/reflections/shape/shape","can-reflect/reflections/type/type","can-reflect/reflections/get-name/get-name","can-namespace","can-reflect/types/map","can-reflect/types/set"],function(e,t,n){var i=e("can-reflect/reflections/call/call"),a=e("can-reflect/reflections/get-set/get-set"),r=e("can-reflect/reflections/observe/observe"),o=e("can-reflect/reflections/shape/shape"),s=e("can-reflect/reflections/type/type"),c=e("can-reflect/reflections/get-name/get-name"),l=e("can-namespace"),u={};[i,a,r,o,s,c].forEach(function(e){for(var t in e)if(u[t]=e[t],"function"==typeof e[t]){var n=Object.getOwnPropertyDescriptor(e[t],"name");(!n||n.writable&&n.configurable)&&Object.defineProperty(e[t],"name",{value:"canReflect."+t})}}),e("can-reflect/types/map"),e("can-reflect/types/set"),n.exports=l.Reflect=u}),define("can-globals/can-globals-proto",["require","exports","module","can-reflect"],function(e,t,n){!function(e,t,n,i){"use strict";function a(e,t){var n=this.eventHandlers[e];if(n)for(var i=n.slice(),a=0;a<i.length;a++)i[a](t)}function r(){this.eventHandlers={},this.properties={}}var o=t("can-reflect");r.prototype.define=function(e,t,n){return void 0===n&&(n=!0),this.properties[e]||(this.properties[e]={default:t,value:t,enableCache:n}),this},r.prototype.getKeyValue=function(e){var t=this.properties[e];if(t)return"function"==typeof t.value?t.cachedValue?t.cachedValue:t.enableCache?(t.cachedValue=t.value(),t.cachedValue):t.value():t.value},r.prototype.makeExport=function(e){return function(t){return 0===arguments.length?this.getKeyValue(e):void 0!==t&&null!==t?("function"==typeof t?this.setKeyValue(e,function(){return t}):this.setKeyValue(e,t),t):void this.deleteKeyValue(e)}.bind(this)},r.prototype.offKeyValue=function(e,t){if(this.properties[e]){var n=this.eventHandlers[e];if(n){var i=n.indexOf(t);n.splice(i,1)}}return this},r.prototype.onKeyValue=function(e,t){return this.properties[e]&&(this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)),this},r.prototype.deleteKeyValue=function(e){var t=this.properties[e];return void 0!==t&&(t.value=t.default,t.cachedValue=void 0,a.call(this,e,t.value)),this},r.prototype.setKeyValue=function(e,t){if(!this.properties[e])return this.define(e,t);var n=this.properties[e];return n.value=t,n.cachedValue=void 0,a.call(this,e,t),this},r.prototype.reset=function(){for(var e in this.properties)this.properties.hasOwnProperty(e)&&(this.properties[e].cachedValue=void 0,a.call(this,e,this.getKeyValue(e)));return this},o.assignSymbols(r.prototype,{"can.getKeyValue":r.prototype.getKeyValue,"can.setKeyValue":r.prototype.setKeyValue,"can.deleteKeyValue":r.prototype.deleteKeyValue,"can.onKeyValue":r.prototype.onKeyValue,"can.offKeyValue":r.prototype.offKeyValue}),i.exports=r}(0,e,0,n)}),define("can-globals/can-globals-instance",["require","exports","module","can-namespace","can-globals/can-globals-proto"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-namespace"),r=new(t("can-globals/can-globals-proto"));if(a.globals)throw new Error("You can't have two versions of can-globals, check your dependencies");i.exports=a.globals=r}(0,e,0,n)}),define("can-globals/global/global",["require","exports","module","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals/can-globals-instance");a.define("global",function(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:"object"==typeof process&&"[object process]"==={}.toString.call(process)?e:window}),i.exports=a.makeExport("global")}(function(){return this}(),e,0,n)}),define("can-globals/document/document",["require","exports","module","can-globals/global/global","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,i){"use strict";t("can-globals/global/global");var a=t("can-globals/can-globals-instance");a.define("document",function(){return a.getKeyValue("global").document}),i.exports=a.makeExport("document")}(0,e,0,n)}),define("can-globals/mutation-observer/mutation-observer",["require","exports","module","can-globals/global/global","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,i){"use strict";t("can-globals/global/global");var a=t("can-globals/can-globals-instance");a.define("MutationObserver",function(){var e=a.getKeyValue("global");return e.MutationObserver||e.WebKitMutationObserver||e.MozMutationObserver}),i.exports=a.makeExport("MutationObserver")}(0,e,0,n)}),define("can-cid/helpers",function(e,t,n){n.exports={each:function(e,t,n){for(var i in e)t.call(n,e[i],i);return e}}}),define("can-cid/set/set",["require","exports","module","can-cid","can-cid/helpers"],function(e,t,n){"use strict";var i,a=e("can-cid").get,r=e("can-cid/helpers");"undefined"!=typeof Set?i=Set:((i=function(){this.values={}}).prototype.add=function(e){this.values[a(e)]=e},i.prototype.delete=function(e){var t=a(e)in this.values;return t&&delete this.values[a(e)],t},i.prototype.forEach=function(e,t){r.each(this.values,e,t)},i.prototype.has=function(e){return a(e)in this.values},i.prototype.clear=function(){return this.values={}},Object.defineProperty(i.prototype,"size",{get:function(){var e=0;return r.each(this.values,function(){e++}),e}})),n.exports=i}),define("can-util/dom/mutation-observer/document/document",["require","exports","module","can-globals/document/document","can-dom-data-state","can-globals/mutation-observer/mutation-observer","can-util/js/each/each","can-cid/set/set","can-util/js/make-array/make-array","can-util/js/string/string"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals/document/document"),r=t("can-dom-data-state"),o=t("can-globals/mutation-observer/mutation-observer"),s=t("can-util/js/each/each"),c=t("can-cid/set/set"),l=t("can-util/js/make-array/make-array"),u=t("can-util/js/string/string"),d=function(e,t,n){if(n.has(e))return!0;n.add(e),"removedNodes"===t.name&&a().documentElement.contains(e)||(t.handlers.forEach(function(t){t(e)}),t.afterHandlers.forEach(function(t){t(e)}))},p={add:function(e){var t=o();if(t){var n=a().documentElement,i=r.get.call(n,"globalObserverData");if(!i){var s=new t(function(e){i.handlers.forEach(function(t){t(e)})});s.observe(n,{childList:!0,subtree:!0}),i={observer:s,handlers:[]},r.set.call(n,"globalObserverData",i)}i.handlers.push(e)}},remove:function(e){var t=a().documentElement,n=r.get.call(t,"globalObserverData");if(n){var i=n.handlers.indexOf(e);i>=0&&n.handlers.splice(i,1),0===n.handlers.length&&(n.observer.disconnect(),r.clean.call(t,"globalObserverData"))}}},f=function(e){var t=e.toLowerCase()+"Nodes",n=function(){var e=a().documentElement,n=r.get.call(e,t+"MutationData");return n||(n={name:t,handlers:[],afterHandlers:[],hander:null},o()&&r.set.call(e,t+"MutationData",n)),n},i=function(){var e=n();return 0!==e.handlers.length&&0!==e.afterHandlers.length||(e.handler=function(n){var i=new c;n.forEach(function(n){s(n[t],function(t){var n=t.getElementsByTagName&&l(t.getElementsByTagName("*")),a=d(t,e,i);if(n&&!a)for(var r,o=0;void 0!==(r=n[o]);o++)d(r,e,i)})})},this.add(e.handler)),e},f=function(){var e=a().documentElement,i=n();0===i.handlers.length&&0===i.afterHandlers.length&&(this.remove(i.handler),r.clean.call(e,t+"MutationData"))},h=function(e,t){p["on"+e]=function(e){i.call(this)[t].push(e)},p["off"+e]=function(e){var i=n(),a=i[t].indexOf(e);a>=0&&i[t].splice(a,1),f.call(this)}};!function(e){h(e,"handlers"),h("After"+e,"afterHandlers")}(u.capitalize(t))};f("added"),f("removed"),i.exports=p}(0,e,0,n)}),define("can-util/dom/data/data",["require","exports","module","can-dom-data-state","can-util/dom/mutation-observer/document/document"],function(e,t,n){"use strict";var i=e("can-dom-data-state"),a=e("can-util/dom/mutation-observer/document/document"),r=function(){return i.delete.call(this)},o=0,s=function(e){0===(o-=r.call(e)?1:0)&&a.offAfterRemovedNodes(s)};n.exports={getCid:i.getCid,cid:i.cid,expando:i.expando,clean:i.clean,get:i.get,set:function(e,t){0===o&&a.onAfterRemovedNodes(s),o+=i.set.call(this,e,t)?1:0},delete:r}}),define("can-util/dom/class-name/class-name",function(e,t,n){"use strict";var i=function(e){return this.classList?this.classList.contains(e):!!this.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))};n.exports={has:i,add:function(e){this.classList?this.classList.add(e):i.call(this,e)||(this.className+=" "+e)},remove:function(e){if(this.classList)this.classList.remove(e);else if(i.call(this,e)){var t=new RegExp("(\\s|^)"+e+"(\\s|$)");this.className=this.className.replace(t," ")}}}}),define("can-globals/is-browser-window/is-browser-window",["require","exports","module","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals/can-globals-instance");a.define("isBrowserWindow",function(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"==typeof SimpleDOM}),i.exports=a.makeExport("isBrowserWindow")}(0,e,0,n)}),define("can-util/dom/events/events",["require","exports","module","can-globals/document/document","can-globals/is-browser-window/is-browser-window","can-util/js/is-plain-object/is-plain-object","can-log/dev/dev"],function(e,t,n){!function(e,t,n,i){"use strict";function a(e,t){var n=s(t)?"inserted"===t.type||"removed"===t.type:"inserted"===t||"removed"===t,i=!!e.disabled;return n&&i}var r=t("can-globals/document/document"),o=t("can-globals/is-browser-window/is-browser-window"),s=t("can-util/js/is-plain-object/is-plain-object"),c=!1,l=t("can-log/dev/dev");i.exports={addEventListener:function(){this.addEventListener.apply(this,arguments)},removeEventListener:function(){this.removeEventListener.apply(this,arguments)},canAddEventListener:function(){return this.nodeName&&(1===this.nodeType||9===this.nodeType)||this===window},dispatch:function(e,t,n){var i,o=c&&a(this,e),s=(this.ownerDocument||r()).createEvent("HTMLEvents"),u="string"==typeof e;if(s.initEvent(u?e:e.type,void 0===n||n,!1),!u)for(var d in e)void 0===s[d]&&(s[d]=e[d]);return!0===this.disabled&&"fix_synthetic_events_on_disabled_test"!==s.type&&l.warn("can-util/dom/events::dispatch: Dispatching a synthetic event on a disabled is problematic in FireFox and Internet Explorer. We recommend avoiding this if at all possible. see https://github.com/canjs/can-util/issues/294"),s.args=t,o&&(this.disabled=!1),i=this.dispatchEvent(s),o&&(this.disabled=!0),i}},function(){if(o()){var e="fix_synthetic_events_on_disabled_test",t=document.createElement("input");t.disabled=!0;var n=setTimeout(function(){c=!0},50),a=function a(){clearTimeout(n),i.exports.removeEventListener.call(t,e,a)};i.exports.addEventListener.call(t,e,a);try{i.exports.dispatch.call(t,e,[],!1)}catch(e){a(),c=!0}}}()}(0,e,0,n)}),define("can-queues/queue-state",function(e,t,n){n.exports={lastTask:null}}),define("can-queues/queue",["require","exports","module","can-queues/queue-state","can-util/js/dev/dev"],function(e,t,n){function i(){}var a=e("can-queues/queue-state"),r=e("can-util/js/dev/dev"),o=function(e,t){this.callbacks=Object.assign({onFirstTask:i,onComplete:function(){a.lastTask=null}},t||{}),this.name=e,this.index=0,this.tasks=[],this._log=!1};o.noop=i,o.prototype.enqueue=function(e,t,n,i){var a=this.tasks.push({fn:e,context:t,args:n,meta:i||{}});this._logEnqueue(this.tasks[a-1]),1===a&&this.callbacks.onFirstTask(this)},o.prototype._logEnqueue=function(e){if(e.meta.stack=this,e.meta.parentTask=a.lastTask,!0===this._log||"enqueue"===this._log){var t=e.meta.log?e.meta.log.concat(e):[e.fn.name,e];r.log.apply(r,[this.name+" enqueuing:"].concat(t))}},o.prototype._logFlush=function(e){if(!0===this._log||"flush"===this._log){var t=e.meta.log?e.meta.log.concat(e):[e.fn.name,e];r.log.apply(r,[this.name+" running :"].concat(t))}a.lastTask=e},o.prototype.flush=function(){for(;this.index<this.tasks.length;){var e=this.tasks[this.index++];this._logFlush(e),e.fn.apply(e.context,e.args)}this.index=0,this.tasks=[],this.callbacks.onComplete(this)},o.prototype.log=function(){this._log=!arguments.length||arguments[0]},n.exports=o}),define("can-queues/priority-queue",["require","exports","module","can-queues/queue"],function(e,t,n){var i=e("can-queues/queue"),a=function(){i.apply(this,arguments),this.taskMap=new Map,this.curPriorityIndex=1/0,this.curPriorityMax=0,this.taskContainersByPriority=[],this.isFlushing=!1,this.tasksRemaining=0};(a.prototype=Object.create(i.prototype)).enqueue=function(e,t,n,i){if(!this.taskMap.has(e)){this.tasksRemaining++;var a=0===this.taskContainersByPriority.length,r={fn:e,context:t,args:n,meta:i||{}};this.getTaskContainerAndUpdateRange(r).tasks.push(r),this.taskMap.set(e,r),this._logEnqueue(r),a&&this.callbacks.onFirstTask(this)}},a.prototype.isEnqueued=function(e){return this.taskMap.has(e)},a.prototype.flush=function(){if(!this.isFlushing)for(this.isFlushing=!0;;){if(!(this.curPriorityIndex<=this.curPriorityMax))return this.taskMap=new Map,this.curPriorityIndex=1/0,this.curPriorityMax=0,this.taskContainersByPriority=[],this.isFlushing=!1,void this.callbacks.onComplete(this);var e=this.taskContainersByPriority[this.curPriorityIndex];if(e&&e.tasks.length>e.index){var t=e.tasks[e.index++];this._logFlush(t),this.tasksRemaining--,this.taskMap.delete(t.fn),t.fn.apply(t.context,t.args)}else this.curPriorityIndex++}},a.prototype.flushQueuedTask=function(e){var t=this.taskMap.get(e);if(t){var n=t.meta.priority||0,i=this.taskContainersByPriority[n],a=i.tasks.indexOf(t,i.index);a>=0&&(i.tasks.splice(a,1),this._logFlush(t),this.tasksRemaining--,this.taskMap.delete(t.fn),t.fn.apply(t.context,t.args))}},a.prototype.getTaskContainerAndUpdateRange=function(e){var t=e.meta.priority||0;return t<this.curPriorityIndex&&(this.curPriorityIndex=t),t>this.curPriorityMax&&(this.curPriorityMax=t),this.taskContainersByPriority[t]||(this.taskContainersByPriority[t]={tasks:[],index:0})},a.prototype.tasksRemainingCount=function(){return this.tasksRemaining},n.exports=a}),define("can-queues/completion-queue",["require","exports","module","can-queues/queue"],function(e,t,n){var i=e("can-queues/queue"),a=function(){i.apply(this,arguments),this.flushCount=0};(a.prototype=Object.create(i.prototype)).flush=function(){if(this.flushCount>0);else{for(this.flushCount++;this.index<this.tasks.length;){var e=this.tasks[this.index++];this._logFlush(e),e.fn.apply(e.context,e.args)}this.index=0,this.tasks=[],this.flushCount--,this.callbacks.onComplete(this)}},n.exports=a}),define("can-queues",["require","exports","module","can-util/js/dev/dev","can-queues/queue","can-queues/priority-queue","can-queues/queue-state","can-queues/completion-queue","can-namespace"],function(e,t,n){var i,a,r,o,s,c=e("can-util/js/dev/dev"),l=e("can-queues/queue"),u=e("can-queues/priority-queue"),d=e("can-queues/queue-state"),p=e("can-queues/completion-queue"),f=e("can-namespace"),h=0,v=!1,m=!1,g=0,y=function(){return{}};a=new l("NOTIFY",{onComplete:function(){r.flush()},onFirstTask:function(){h?v=!0:a.flush()}}),r=new u("DERIVE",{onComplete:function(){o.flush()},onFirstTask:function(){v=!0}}),o=new p("DOM_UI",{onComplete:function(){s.flush()},onFirstTask:function(){v=!0}}),s=new l("MUTATE",{onComplete:function(){d.lastTask=null,m=!1},onFirstTask:function(){v=!0}});var b={Queue:l,PriorityQueue:u,notifyQueue:a,deriveQueue:r,domUIQueue:o,mutateQueue:s,batch:{start:function(){1===++h&&(i={number:++g})},stop:function(){0===--h&&v&&(v=!1,m=!0,a.flush())},isCollecting:function(){return h>0},number:function(){return g},data:function(){return i}},enqueueByQueue:function(e,t,n,i,a){e&&(i=i||y,b.batch.start(),["notify","derive","domUI","mutate"].forEach(function(r){var o=b[r+"Queue"],s=e[r];void 0!==s&&s.forEach(function(e){var r=i&&i(e,t,n);r.reasonLog=a,o.enqueue(e,t,n,r)})}),b.batch.stop())},stack:function(){for(var e=d.lastTask,t=[];e;)t.unshift(e),e=e.meta.parentTask;return t},logStack:function(){this.stack().forEach(function(e){var t=e.meta&&e.meta.log?e.meta.log:[e.fn.name,e];c.log.apply(c,[e.meta.stack.name+" ran task:"].concat(t))})},taskCount:function(){return a.tasks.length+r.tasks.length+o.tasks.length+s.tasks.length},flush:function(){a.flush()},log:function(){a.log.apply(a,arguments),r.log.apply(r,arguments),o.log.apply(o,arguments),s.log.apply(s,arguments)}};if(f.queues)throw new Error("You can't have two versions of can-queues, check your dependencies");n.exports=f.queues=b}),define("can-key-tree",["require","exports","module","can-reflect"],function(e,t,n){function i(e){return e===Object.prototype||"[object Object]"!==Object.prototype.toString.call(e)&&-1!==Object.prototype.toString.call(e).indexOf("[object ")}function a(e,t,n,i){if(e)if(i===n){if(!s.isMoreListLikeThanMapLike(e))throw new Error("can-key-tree: Map types are not supported yet.");s.addValues(t,s.toArray(e))}else s.each(e,function(e){a(e,t,n+1,i)})}function r(e,t,n){if(n===t){if(!s.isMoreListLikeThanMapLike(e))throw new Error("can-key-tree: Map types are not supported yet.");s.removeValues(e,s.toArray(e))}else s.each(e,function(i,a){r(i,t+1,n),s.deleteKeyValue(e,a)})}function o(e,t){if(0===t)return s.size(e);if(0===s.size(e))return 0;var n=0;return s.each(e,function(e){n+=o(e,t-1)}),n}var s=e("can-reflect"),c=function(e,t){this.callbacks=t||{},this.treeStructure=e;var n=e[0];s.isConstructorLike(n)?this.root=new n:this.root=n};c.prototype.add=function(e){if(e.length>this.treeStructure.length)throw new Error("can-key-tree: Can not add path deeper than tree.");for(var t=this.root,n=0===s.size(this.root),a=0;a<e.length-1;a++){var r=e[a],o=s.getKeyValue(t,r);if(!o){var c=this.treeStructure[a+1];o=i(c.prototype)?new c:new c(r),s.setKeyValue(t,r,o)}t=o}if(!s.isMoreListLikeThanMapLike(t))throw new Error("can-key-tree: Map types are not supported yet.");s.addValues(t,[e[e.length-1]]),n&&this.callbacks.onFirst&&this.callbacks.onFirst.call(this)},c.prototype.get=function(e){var t=this.getNode(e);if(this.treeStructure.length===e.length)return t;var n=new(0,this.treeStructure[this.treeStructure.length-1]);return a(t,n,e.length,this.treeStructure.length-1),n},c.prototype.getNode=function(e){for(var t=this.root,n=0;n<e.length;n++){var i=e[n],a=s.getKeyValue(t,i);if(!a)return;t=a}return t},c.prototype.delete=function(e){for(var t=this.root,n=[this.root],i=0;i<e.length-1;i++){var a=e[i],o=s.getKeyValue(t,a);if(void 0===o)return!1;n.push(o),t=o}var c=e[e.length-1];if(e.length===this.treeStructure.length){if(!s.isMoreListLikeThanMapLike(t))throw new Error("can-key-tree: Map types are not supported yet.");s.removeValues(t,[c])}else if(e.length){var l=s.getKeyValue(t,c);if(void 0===l)return!1;r(l,e.length,this.treeStructure.length-1),s.deleteKeyValue(t,c)}else r(t,0,this.treeStructure.length-1);for(i=n.length-2;i>=0&&0===s.size(t);i--)t=n[i],s.deleteKeyValue(t,e[i]);return this.callbacks.onEmpty&&0===s.size(this.root)&&this.callbacks.onEmpty.call(this),!0},c.prototype.size=function(){return o(this.root,this.treeStructure.length-1)},n.exports=c}),define("can-observation-recorder",["require","exports","module","can-namespace"],function(e,t,n){var i=e("can-namespace"),a=[],r={stack:a,makeDependenciesRecorder:function(){return{traps:null,keyDependencies:new Map,valueDependencies:new Set,ignore:0}},start:function(){a.push({traps:null,keyDependencies:new Map,valueDependencies:new Set,ignore:0})},stop:function(){return a.pop()},add:function(e,t){var n=a[a.length-1];if(n&&0===n.ignore)if(n.traps)n.traps.push([e,t]);else if(void 0===t)n.valueDependencies.add(e);else{var i=n.keyDependencies.get(e);i||(i=new Set,n.keyDependencies.set(e,i)),i.add(t)}},addMany:function(e){var t=a[a.length-1];if(t)if(t.traps)t.traps.push.apply(t.traps,e);else for(var n=0,i=e.length;n<i;n++)this.add(e[n][0],e[n][1])},ignore:function(e){return function(){if(a.length){var t=a[a.length-1];t.ignore++;var n=e.apply(this,arguments);return t.ignore--,n}return e.apply(this,arguments)}},trap:function(){if(a.length){var e=a[a.length-1],t=e.traps,n=e.traps=[];return function(){return e.traps=t,n}}return function(){return[]}},trapsCount:function(){return a.length?a[a.length-1].traps.length:0},isRecording:function(){var e=a.length,t=e&&a[e-1];return t&&0===t.ignore&&t}};if(i.observationRecorder)throw new Error("You can't have two versions of can-observation-recorder, check your dependencies");n.exports=i.observationRecorder=r}),define("can-observation/recorder-dependency-helpers",["require","exports","module","can-reflect"],function(e,t,n){function i(e){l.offKeyValue(this.observable,e,this.onDependencyChange,"notify")}function a(e,t){e.forEach(i,{onDependencyChange:this.onDependencyChange,observable:t})}function r(e){this.oldEventSet&&this.oldEventSet.delete(e)||l.onKeyValue(this.observable,e,this.onDependencyChange,"notify")}function o(e,t){e.forEach(r,{onDependencyChange:this.onDependencyChange,observable:t,oldEventSet:this.oldDependencies.keyDependencies.get(t)})}function s(e){this.oldDependencies.valueDependencies.delete(e)||l.onValue(e,this.onDependencyChange,"notify")}function c(e){l.offValue(e,this.onDependencyChange,"notify")}var l=e("can-reflect");n.exports={updateObservations:function(e){e.newDependencies.keyDependencies.forEach(o,e),e.oldDependencies.keyDependencies.forEach(a,e),e.newDependencies.valueDependencies.forEach(s,e),e.oldDependencies.valueDependencies.forEach(c,e)},stopObserving:function(e,t){e.keyDependencies.forEach(a,{onDependencyChange:t}),e.valueDependencies.forEach(c,{onDependencyChange:t})}}}),define("can-observation",["require","exports","module","can-util/js/assign/assign","can-namespace","can-reflect","can-queues","can-key-tree","can-observation-recorder","can-observation/recorder-dependency-helpers","can-symbol","can-log/dev/dev"],function(e,t,n){!function(e,t,n,i){function a(e,t,n){this.func=e,this.context=t,this.options=n||{priority:0,isObservable:!0},this.newDependencies=u.makeDependenciesRecorder(),this.oldDependencies=null,this.handlers=new l([Object,Array],{onFirst:this.start.bind(this),onEmpty:this.stop.bind(this)}),this.bound=!1;var i=this;this.onDependencyChange=function(e){i.dependencyChange(this,e)},this.update=this.update.bind(this),Object.defineProperty(this.onDependencyChange,"name",{value:s.getName(this)+".onDependencyChange"}),Object.defineProperty(this.update,"name",{value:s.getName(this)+".update"})}var r=t("can-util/js/assign/assign"),o=t("can-namespace"),s=t("can-reflect"),c=t("can-queues"),l=t("can-key-tree"),u=t("can-observation-recorder"),d=t("can-observation/recorder-dependency-helpers"),p=t("can-symbol"),f=t("can-log/dev/dev");r(a.prototype,{get:function(){return this.options.isObservable&&a.isRecording()&&(u.add(this),this.bound||a.temporarilyBind(this)),!0===this.bound?(c.deriveQueue.tasksRemainingCount()>0&&a.updateChildrenAndSelf(this),this.value):this.func.call(this.context)},dependencyChange:function(e,t){!0===this.bound&&c.deriveQueue.enqueue(this.update,this,[],{priority:this.options.priority,log:[s.getName(this.update)]},[s.getName(e),"changed"])},update:function(){if(!0===this.bound){var e=this.value;if(this.oldValue=null,this.start(),e!==this.value)return"function"==typeof this._log&&this._log(e,this.value),c.enqueueByQueue(this.handlers.getNode([]),this,[this.value,e],null,[s.getName(this),"changed to",this.value,"from",e]),!0}},start:function(){this.bound=!0,this.oldDependencies=this.newDependencies,u.start(),this.value=this.func.call(this.context),this.newDependencies=u.stop(),d.updateObservations(this)},stop:function(){this.bound=!1,d.stopObserving(this.newDependencies,this.onDependencyChange),this.newDependencies=u.makeDependenciesRecorder()},hasDependencies:function(){var e=this.newDependencies;return this.bound?e.valueDependencies.size+e.keyDependencies.size>0:void 0},log:function(){var e=function(e){return"string"==typeof e?JSON.stringify(e):e};this._log=function(t,n){f.log(s.getName(this),"\n is ",e(n),"\n was ",e(t))}}}),s.assignSymbols(a.prototype,{"can.onValue":function(e,t){this.handlers.add([t||"mutate",e])},"can.offValue":function(e,t){this.handlers.delete([t||"mutate",e])},"can.getValue":a.prototype.get,"can.isValueLike":!0,"can.isMapLike":!1,"can.isListLike":!1,"can.valueHasDependencies":a.prototype.hasDependencies,"can.getValueDependencies":function(){if(!0===this.bound)return this.newDependencies},"can.getPriority":function(){return this.options.priority},"can.setPriority":function(e){this.options.priority=e},"can.getName":function(){return s.getName(this.constructor)+"<"+s.getName(this.func)+">"}});var h=p.for("can.getValueDependencies");a.updateChildrenAndSelf=function(e){if(e.update&&!0===c.deriveQueue.isEnqueued(e.update))return c.deriveQueue.flushQueuedTask(e.update),!0;if(e[h]){var t=!1;return(e[h]().valueDependencies||[]).forEach(function(e){a.updateChildrenAndSelf(e)&&(t=!0)}),t}return!1},a.add=u.add,a.addAll=u.addMany,a.ignore=u.ignore,a.trap=u.trap,a.trapsCount=u.trapsCount,a.isRecording=u.isRecording;var v,m=function(){},g=function(){for(var e=0,t=v.length;e<t;e++)s.offValue(v[e],m);v=null};if(a.temporarilyBind=function(e){var t=e.computeInstance||e;s.onValue(t,m),v||(v=[],setTimeout(g,10)),v.push(t)},o.Observation)throw new Error("You can't have two versions of can-observation, check your dependencies");i.exports=o.Observation=a}(0,e,0,n)}),define("can-util/js/is-promise-like/is-promise-like",function(e,t,n){"use strict";n.exports=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}}),define("can-reflect-promise",["require","exports","module","can-reflect","can-symbol","can-observation-recorder","can-queues","can-key-tree","can-util/js/dev/dev"],function(e,t,n){function i(e,t,n){var i=e[f],a=i[t];i[t]=n,l.enqueueByQueue(i.handlers.getNode([t]),e,[n,a],function(){return{}},["Promise",e,"resolved with value",n,"and changed virtual property: "+t])}function a(e){var t=e[f];t||(Object.defineProperty(e,f,{enumerable:!1,configurable:!1,writable:!1,value:Object.create(h)}),(t=e[f]).handlers=new u([Object,Object,Array])),e.then(function(t){l.batch.start(),i(e,"isPending",!1),i(e,"isResolved",!0),i(e,"value",t),i(e,"state","resolved"),l.batch.stop()},function(t){l.batch.start(),i(e,"isPending",!1),i(e,"isRejected",!0),i(e,"reason",t),i(e,"state","rejected"),l.batch.stop(),d.error("Failed promise:",t)})}function r(e){var t,n="getPrototypeOf"in Object?Object.getPrototypeOf(e):e.__proto__;e[p]&&e[f]||(null!==n&&n!==Object.prototype||"function"==typeof(n=e).promise&&(t=n.promise,n.promise=function(){var e=t.call(n);return r(e),e}),o.assignSymbols(n,{"can.getKeyValue":function(e){switch(this[f]||a(this),c.add(this,e),e){case"state":case"isPending":case"isResolved":case"isRejected":case"value":case"reason":return this[f][e];default:return this[e]}},"can.getValue":function(){return this[p]("value")},"can.isValueLike":!1,"can.onKeyValue":function(e,t,n){this[f]||a(this),this[f].handlers.add([e,n||"mutate",t])},"can.offKeyValue":function(e,t,n){this[f]||a(this),this[f].handlers.delete([e,n||"mutate",t])}}))}var o=e("can-reflect"),s=e("can-symbol"),c=e("can-observation-recorder"),l=e("can-queues"),u=e("can-key-tree"),d=e("can-util/js/dev/dev"),p=s.for("can.getKeyValue"),f=s.for("can.meta"),h={isPending:!0,state:"pending",isResolved:!1,isRejected:!1,value:void 0,reason:void 0};n.exports=r}),define("can-stache-key",["require","exports","module","can-observation","can-util/js/dev/dev","can-util/js/each/each","can-symbol","can-reflect","can-util/js/is-promise-like/is-promise-like","can-reflect-promise"],function(e,t,n){var i,a=e("can-observation"),r=e("can-util/js/dev/dev"),o=e("can-util/js/each/each"),s=e("can-symbol"),c=e("can-reflect"),l=e("can-util/js/is-promise-like/is-promise-like"),u=e("can-reflect-promise"),d=s.for("can.getValue"),p=s.for("can.setValue"),f=s.for("can.isValueLike"),h=a.ignore(c.getKeyValue.bind(c)),v=Function.prototype.bind;v=function(e){var t=Function.prototype.bind.call(this,e);return Object.defineProperty(t,"name",{value:c.getName(e)+"."+c.getName(this)}),t};var m=function(e,t){var n=t[e-1];return n&&n.at},g=function(e,t,n,a,r,o){var s;do{s=!1;for(var c=0,l=i.valueReaders.length;c<l;c++)i.valueReaders[c].test(e,t,n,a)&&(e=i.valueReaders[c].read(e,t,n,a,r,o))}while(s);return e},y={index:!0,key:!0,event:!0,element:!0,viewModel:!0},b=function(e,t,n,i,r){e.foundObservable&&!t.foundObservable&&a.trapsCount()&&(a.addAll(n()),e.foundObservable(i,r),t.foundObservable=!0)};o((i={read:function(e,t,n){var r,o={foundObservable:!1};(n=n||{}).foundObservable&&(r=a.trap());var s,c=g(e,0,t,n,o),l=t.length,u=0;for(b(n,o,r,e,0);u<l;){s=c;for(var d=0,p=i.propertyReaders.length;d<p;d++){var f=i.propertyReaders[d];if(f.test(c)){c=f.read(c,t[u],u,n,o);break}}if(b(n,o,r,s,u),c,u+=1,c=g(c,u,t,n,o,s),b(n,o,r,s,u-1),typeof c,u<t.length&&(null===c||void 0===c))return n.earlyExit&&n.earlyExit(s,u-1,c),{value:void 0,parent:s}}return void 0===c&&n.earlyExit&&n.earlyExit(s,u-1),{value:c,parent:s}},get:function(e,t,n){return i.read(e,i.reads(t),n||{}).value},valueReadersMap:{},valueReaders:[{name:"function",test:function(e){return e&&c.isFunctionLike(e)&&!c.isConstructorLike(e)},read:function(e,t,n,i,a,r){return m(t,n)?t===n.length?v.call(e,r):e:i.callMethodsOnObservables&&c.isObservableLike(r)&&c.isMapLike(r)?e.apply(r,i.args||[]):i.isArgument&&t===n.length?!1!==i.proxyMethods?v.call(e,r):e:e.apply(r,i.args||[])}},{name:"isValueLike",test:function(e,t,n,i){return e&&e[d]&&!1!==e[f]&&(i.foundAt||!m(t,n))},read:function(e,t,n,i){return!1===i.readCompute&&t===n.length?e:c.getValue(e)},write:function(e,t){e[p]?e[p](t):e.set?e.set(t):e(t)}}],propertyReadersMap:{},propertyReaders:[{name:"map",test:function(e){return(l(e)||"object"==typeof e&&e&&"function"==typeof e.then)&&u(e),c.isObservableLike(e)&&c.isMapLike(e)},read:function(e,t){var n=c.getKeyValue(e,t.key);return void 0!==n?n:e[t.key]},write:c.setKeyValue},{name:"object",test:function(){return!0},read:function(e,t,n,i){if(null!=e)return"object"!=typeof e?e[t.key]:t.key in e?e[t.key]:t.at&&y[t.key]&&"@"+t.key in e?(i.foundAt=!0,r.warn("Use %"+t.key+" in place of @"+t.key+"."),e["@"+t.key]):void 0},write:function(e,t,n){var i=e[t];c.isMapLike(i)&&n&&"object"==typeof n?(r.warn('can-stache-key: Merging data into "'+t+'" because its parent is non-observable'),c.update(i,n)):c.isValueLike(i)&&c.isObservableLike(i)?c.setValue(i,n):e[t]=n}}],reads:function(e){var t=""+e,n=[],i=0,a=!1;"@"===t.charAt(0)&&(i=1,a=!0);for(var r="",o=i;o<t.length;o++){var s=t.charAt(o);"."===s||"@"===s?"\\"!==t.charAt(o-1)?(n.push({key:r,at:a}),a="@"===s,r=""):r=r.substr(0,r.length-1)+".":r+=s}return n.push({key:r,at:a}),n},write:function(e,t,n,a){var r,o="string"==typeof t?i.reads(t):t;a=a||{},o.length>1?(r=o.pop(),e=i.read(e,o,a).value,o.push(r)):r=o[0];var s=h(e,r.key);i.valueReadersMap.isValueLike.test(s,o.length-1,o,a)?i.valueReadersMap.isValueLike.write(s,n,a):(i.valueReadersMap.isValueLike.test(e,o.length-1,o,a)&&(e=e[d]()),i.propertyReadersMap.map.test(e)?i.propertyReadersMap.map.write(e,r.key,n,a):i.propertyReadersMap.object.test(e)&&(i.propertyReadersMap.object.write(e,r.key,n,a),a.observation&&a.observation.update()))}}).propertyReaders,function(e){i.propertyReadersMap[e.name]=e}),o(i.valueReaders,function(e){i.valueReadersMap[e.name]=e}),i.set=i.write,n.exports=i}),define("can-util/dom/dispatch/dispatch",["require","exports","module","can-util/dom/events/events"],function(e,t,n){"use strict";var i=e("can-util/dom/events/events");n.exports=function(){return i.dispatch.apply(this,arguments)}}),define("can-util/dom/matches/matches",function(e,t,n){"use strict";var i=function(e){return e.matches||e.webkitMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector};n.exports=function(){var e=i(this);return!!e&&e.apply(this,arguments)}}),define("can-util/js/is-empty-object/is-empty-object",function(e,t,n){"use strict";n.exports=function(e){for(var t in e)return!1;return!0}}),define("can-util/dom/events/delegate/delegate",["require","exports","module","can-util/dom/events/events","can-util/dom/data/data","can-util/dom/matches/matches","can-util/js/each/each","can-util/js/is-empty-object/is-empty-object"],function(e,t,n){"use strict";var i=e("can-util/dom/events/events"),a=e("can-util/dom/data/data"),r=e("can-util/dom/matches/matches"),o=e("can-util/js/each/each"),s=e("can-util/js/is-empty-object/is-empty-object"),c="delegateEvents",l=function(e){return"focus"===e||"blur"===e},u=function(e){var t=a.get.call(this,c)[e.type],n=[];if(t){var i=[];o(t,function(e){i.push(e)});var s=e.target;do{i.forEach(function(e){r.call(s,e[0].selector)&&n.push({target:s,delegates:e})}),s=s.parentNode}while(s&&s!==e.currentTarget)}var l=e.stopPropagation;e.stopPropagation=function(){l.apply(this,arguments),this.cancelBubble=!0};for(var u=0;u<n.length;u++)for(var d=n[u],p=d.delegates,f=0,h=p.length;f<h;f++){if(!1===p[f].handler.call(d.target,e))return!1;if(e.cancelBubble)return}};i.addDelegateListener=function(e,t,n){var r,o=a.get.call(this,c);o||a.set.call(this,c,o={}),(r=o[e])||(r=o[e]={},i.addEventListener.call(this,e,u,l(e))),r[t]||(r[t]=[]),r[t].push({handler:n,selector:t})},i.removeDelegateListener=function(e,t,n){var r=a.get.call(this,c);if(r&&r[e]&&r[e][t]){for(var o=r[e],d=o[t],p=0;p<d.length;)d[p].handler===n?d.splice(p,1):p++;0===d.length&&(delete o[t],s(o)&&(i.removeEventListener.call(this,e,u,l(e)),delete r[e],s(r)&&a.clean.call(this,c)))}}}),define("can-control",["require","exports","module","can-construct","can-namespace","can-util/js/string/string","can-util/js/assign/assign","can-util/js/is-function/is-function","can-util/js/each/each","can-util/js/dev/dev","can-util/js/get/get","can-util/dom/data/data","can-util/dom/class-name/class-name","can-util/dom/events/events","can-stache-key","can-reflect","can-observation","can-symbol","can-util/dom/dispatch/dispatch","can-util/dom/events/delegate/delegate"],function(e,t,n){var i,a=e("can-construct"),r=e("can-namespace"),o=e("can-util/js/string/string"),s=e("can-util/js/assign/assign"),c=e("can-util/js/is-function/is-function"),l=e("can-util/js/each/each"),u=e("can-util/js/dev/dev"),d=e("can-util/js/get/get"),p=e("can-util/dom/data/data"),f=e("can-util/dom/class-name/class-name"),h=e("can-util/dom/events/events"),v=e("can-stache-key"),m=e("can-reflect"),g=e("can-observation"),y=e("can-symbol");e("can-util/dom/dispatch/dispatch"),e("can-util/dom/events/delegate/delegate");var b,w=y.for("can.onKeyValue"),k=y.for("can.offKeyValue"),x=y.for("can.onEvent"),j=y.for("can.offEvent"),L=y.for("can.onValue"),E=y.for("can.offValue"),V={on:function(e,t,n){if(h.canAddEventListener.call(this))h["string"==typeof t?"addDelegateListener":"addEventListener"].call(this,e,t,n);else if(this[w])m.onKeyValue(this,e,t,n);else if(this[x])this[x](e,t,n);else if("addEventListener"in this)this.addEventListener(e,t,n);else{if(e||!this[L])throw new Error("can-control: Unable to bind "+e);m.onValue(this,t)}},off:function(e,t,n){if(h.canAddEventListener.call(this))h["string"==typeof t?"removeDelegateListener":"removeEventListener"].call(this,e,t,n);else if(this[k])m.offKeyValue(this,e,t,n);else if(this[j])this[j](e,t,n);else if("removeEventListener"in this)this.removeEventListener(e,t,n);else{if(e||!this[E])throw new Error("can-control: Unable to unbind "+e);m.offValue(this,t)}}},O=function(e,t,n,i){return V.on.call(e,t,n,i),function(){V.off.call(e,t,n,i)}},C=[].slice,_=/\{([^\}]+)\}/g,D=function(e,t,n,i){return V.on.call(e,n,t,i),function(){V.off.call(e,n,t,i)}},S=function(e,t,n,i){return i?D(e,i.trim(),t,n):O(e,t,n)},T=a.extend("Control",{setup:function(){if(a.setup.apply(this,arguments),T){var e,t=this;t.actions={};for(e in t.prototype)t._isAction(e)&&(t.actions[e]=t._action(e))}},_shifter:function(e,t){function n(){var n=a.wrapElement(this);return e.called=t,i.apply(e,[n].concat(C.call(arguments,0)))}var i="string"==typeof t?e[t]:t;c(i)||(i=e[i]);var a=this;return Object.defineProperty(n,"name",{value:m.getName(this)+"["+t+"]"}),n},_isAction:function(e){var t=this.prototype[e],n=typeof t;return"constructor"!==e&&("function"===n||"string"===n&&c(this.prototype[t]))&&!!(T.isSpecial(e)||i[e]||/[^\w]/.test(e))},_action:function(e,t,n){var i,a;if(_.lastIndex=0,t||!_.test(e)){var r=function(){var n,i=e.replace(_,function(e,i){var r,o;return this._isDelegate(t,i)?(n=this._getDelegate(t,i),""):(i=this._removeDelegateFromKey(i),o=this._lookup(t)[0],void 0===(r=v.read(o,v.reads(i),{readCompute:!1}).value)&&"undefined"!=typeof window&&(r=d(window,i)),o&&(m.isObservableLike(o)&&m.isMapLike(o)||r)?"string"==typeof r?r:(n=r,""):(a=!0,null))}.bind(this)),r=(i=i.trim()).split(/\s+/g),o=r.pop();return{processor:this.processors[o]||b,parts:[i,r.join(" "),o],delegate:n||void 0}};if(Object.defineProperty(r,"name",{value:m.getName(n||this.prototype)+"["+e+"].actionData"}),i=new g(r,this),n){var o=function(t){n._bindings.control[e](n.element),n._bindings.control[e]=t.processor(t.delegate||n.element,t.parts[2],t.parts[1],e,n)};Object.defineProperty(o,"name",{value:m.getName(n)+"["+e+"].handler"}),m.onValue(i,o,"mutate"),a&&u.log("can-control: No property found for handling "+e),n._bindings.readyComputes[e]={compute:i,handler:o}}return i.get()}},_lookup:function(e){return[e,window]},_removeDelegateFromKey:function(e){return e},_isDelegate:function(e,t){return"element"===t},_getDelegate:function(e,t){},processors:{},defaults:{},convertElement:function(e){return e="string"==typeof e?document.querySelector(e):e,this.wrapElement(e)},wrapElement:function(e){return e},unwrapElement:function(e){return e},isSpecial:function(e){return"inserted"===e||"removed"===e}},{setup:function(e,t){var n,i=this.constructor,a=i.pluginName||i.shortName;if(!e)throw new Error("Creating an instance of a named control without passing an element");if(this.element=i.convertElement(e),a&&"Control"!==a&&f.add.call(this.element,a),(n=p.get.call(this.element,"controls"))||(n=[],p.set.call(this.element,"controls",n)),n.push(this),m.isObservableLike(t)&&m.isMapLike(t)){for(var r in i.defaults)t.hasOwnProperty(r)||v.set(t,r,i.defaults[r]);this.options=t}else this.options=s(s({},i.defaults),t);return this.on(),[this.element,this.options]},on:function(e,t,n,i){if(!e){this.off();var a,r,o=this.constructor,s=this._bindings,c=o.actions,l=this.constructor.unwrapElement(this.element),u=T._shifter(this,"destroy");for(a in c)c.hasOwnProperty(a)&&(r=c[a]||o._action(a,this.options,this))&&(s.control[a]=r.processor(r.delegate||l,r.parts[2],r.parts[1],a,this));return h.addEventListener.call(l,"removed",u),s.user.push(function(e){h.removeEventListener.call(e,"removed",u)}),s.user.length}return"string"==typeof e&&(i=n,n=t,t=e,e=this.element),void 0===i&&(i=n,n=t,t=null),"string"==typeof i&&(i=T._shifter(this,i)),this._bindings.user.push(S(e,n,i,t)),this._bindings.user.length},off:function(){var e=this.constructor.unwrapElement(this.element),t=this._bindings;t&&(l(t.user||[],function(t){t(e)}),l(t.control||{},function(t){t(e)}),l(t.readyComputes||{},function(e){m.offValue(e.compute,e.handler,"mutate")})),this._bindings={user:[],control:{},readyComputes:{}}},destroy:function(){if(null!==this.element){var e,t=this.constructor,n=t.pluginName||t.shortName&&o.underscore(t.shortName);this.off(),n&&"can_control"!==n&&f.remove.call(this.element,n),(e=p.get.call(this.element,"controls"))&&e.splice(e.indexOf(this),1),this.element=null}else u.warn("can-control: Control already destroyed")}});i=T.processors,b=function(e,t,n,i,a){return S(e,t,T._shifter(a,i),n)},l(["beforeremove","change","click","contextmenu","dblclick","keydown","keyup","keypress","mousedown","mousemove","mouseout","mouseover","mouseup","reset","resize","scroll","select","submit","focusin","focusout","mouseenter","mouseleave","touchstart","touchmove","touchcancel","touchend","touchleave","inserted","removed","dragstart","dragenter","dragover","dragleave","drag","drop","dragend"],function(e){i[e]=b}),n.exports=r.Control=T}),define("can-component/control/control",["require","exports","module","can-control","can-util/js/each/each","can-reflect"],function(e,t,n){var i=e("can-control"),a=e("can-util/js/each/each"),r=e("can-reflect"),o=/\{([^\}]+)\}/g,s=i.extend({_lookup:function(e){return[e.scope,e,window]},_removeDelegateFromKey:function(e){return e.replace(/^(scope|^viewModel)\./,"")},_isDelegate:function(e,t){return"scope"===t||"viewModel"===t},_getDelegate:function(e,t){return e[t]},_action:function(e,t,n){var a;return o.lastIndex=0,a=o.test(e),!n&&a?void 0:i._action.apply(this,arguments)}},{setup:function(e,t){return this.scope=t.scope,this.viewModel=t.viewModel,i.prototype.setup.call(this,e,t)},off:function(){this._bindings&&a(this._bindings.readyComputes||{},function(e){r.offValue(e.compute,e.handler)}),i.prototype.off.apply(this,arguments),this._bindings.readyComputes={}},destroy:function(){i.prototype.destroy.apply(this,arguments),"function"==typeof this.options.destroy&&this.options.destroy.apply(this,arguments)}});n.exports=s}),define("can-event-queue",["require","exports","module","can-util/js/dev/dev","can-util/js/assign/assign","can-queues","can-reflect","can-symbol","can-key-tree","can-util/dom/events/events"],function(e,t,n){function i(e){var t=p(e),n=t.handlers;return n||(n=t.handlers=new u([Object,Object,Object,Array],{onFirst:function(){e._eventSetup&&e._eventSetup()},onEmpty:function(){e._eventTeardown&&e._eventTeardown()}})),n}function a(e,t,n){Object.defineProperty(e,t,{enumerable:!1,value:n})}var r=e("can-util/js/dev/dev"),o=e("can-util/js/assign/assign"),s=e("can-queues"),c=e("can-reflect"),l=e("can-symbol"),u=e("can-key-tree"),d=e("can-util/dom/events/events"),p=function(e){var t=l.for("can.meta"),n=e[t];return n||(n={},c.setKeyValue(e,t,n)),n},f={dispatch:function(e,t){if(arguments.length>2&&(r.warn("Arguments to dispatch should be an array, not multiple arguments."),t=Array.prototype.slice.call(arguments,1)),t&&!Array.isArray(t)&&(r.warn("Arguments to dispatch should be an array."),t=[t]),!this.__inSetup){"string"==typeof e&&(e={type:e}),e.reasonLog||(e.reasonLog=[c.getName(this),"dispatched",'"'+e+'"',"with"].concat(t)),e.makeMeta||(e.makeMeta=function(e){return{log:[c.getName(e)]}});var n=p(this);"function"==typeof n._log&&n._log.call(this,e,t);var a=i(this).getNode([e.type]);if(a){if(s.batch.start(),a.onKeyValue&&s.enqueueByQueue(a.onKeyValue,this,t,e.makeMeta,e.reasonLog),a.event){e.batchNum=s.batch.number();var o=[e].concat(t);s.enqueueByQueue(a.event,this,o,e.makeMeta,e.reasonLog)}s.batch.stop()}}},addEventListener:function(e,t,n){i(this).add([e,"event",n||"mutate",t])},removeEventListener:function(e,t,n){i(this).delete([e,"event",n||"mutate",t])}},h=l.for("can.onKeyValue"),v=l.for("can.offKeyValue"),m=l.for("can.onEvent"),g=l.for("can.offEvent"),y=l.for("can.onValue"),b=l.for("can.offValue");f.on=function(e,t,n){if(d.canAddEventListener.call(this))d["string"==typeof t?"addDelegateListener":"addEventListener"].call(this,e,t,n);else if("addEventListener"in this)this.addEventListener(e,t,n);else if(this[h])c.onKeyValue(this,e,t,n);else if(this[m])this[m](e,t,n);else{if(e||!this[y])throw new Error("can-control: Unable to bind "+e);c.onValue(this,t)}},f.off=function(e,t,n){if(d.canAddEventListener.call(this))d["string"==typeof t?"removeDelegateListener":"removeEventListener"].call(this,e,t,n);else if("removeEventListener"in this)this.removeEventListener(e,t,n);else if(this[v])c.offKeyValue(this,e,t,n);else if(this[g])this[g](e,t,n);else{if(e||!this[b])throw new Error("can-control: Unable to unbind "+e);c.offValue(this,t)}};var w={"can.onKeyValue":function(e,t,n){i(this).add([e,"onKeyValue",n||"mutate",t])},"can.offKeyValue":function(e,t,n){i(this).delete([e,"onKeyValue",n||"mutate",t])}},k=function(e){return o(e,f),c.assignSymbols(e,w),e};o(k,f),a(k,"start",function(){console.warn("use can-queues.batch.start()"),s.batch.start()}),a(k,"stop",function(){console.warn("use can-queues.batch.stop()"),s.batch.stop()}),a(k,"flush",function(){console.warn("use can-queues.flush()"),s.flush()}),a(k,"afterPreviousEvents",function(e){console.warn("don't use afterPreviousEvents"),s.mutateQueue.enqueue(function(){s.mutateQueue.enqueue(e)}),s.flush()}),a(k,"after",function(e){console.warn("don't use after"),s.mutateQueue.enqueue(e),s.flush()}),n.exports=k}),define("can-simple-map",["require","exports","module","can-construct","can-event-queue","can-queues","can-util/js/each/each","can-observation-recorder","can-reflect","can-log/dev/dev","can-symbol"],function(e,t,n){var i=e("can-construct"),a=e("can-event-queue"),r=e("can-queues"),o=e("can-util/js/each/each"),s=e("can-observation-recorder"),c=e("can-reflect"),l=e("can-log/dev/dev"),u=e("can-symbol"),d=function(e){var t=u.for("can.meta"),n=e[t];return n||(n={},c.setKeyValue(e,t,n)),n},p=i.extend("SimpleMap",{setup:function(e){this._data={},this.attr(e)},attr:function(e,t){var n=this;if(0===arguments.length){s.add(this,"__keys");var i={};return o(this._data,function(e,t){s.add(this,t),i[t]=e},this),i}if(arguments.length>1){var a=this._data.hasOwnProperty(e),l=this._data[e];this._data[e]=t,r.batch.start(),a||this.dispatch("__keys",[]),"function"==typeof this._log&&this._log(e,t,l),this.dispatch({type:e,reasonLog:[c.getName(this)+"'s",e,"changed to",t,"from",l]},[t,l]),r.batch.stop()}else{if("object"!=typeof e)return"constructor"!==e?(s.add(this,e),this._data[e]):this.constructor;r.batch.start(),c.eachKey(e,function(e,t){n.attr(t,e)}),r.batch.stop()}},serialize:function(){return c.serialize(this,Map)},get:function(){return this.attr.apply(this,arguments)},set:function(){return this.attr.apply(this,arguments)},log:function(e){var t=function(e){return"string"==typeof e?JSON.stringify(e):e},n=d(this);n.allowedLogKeysSet=n.allowedLogKeysSet||new Set,e&&n.allowedLogKeysSet.add(e),this._log=function(i,a,r,o){e&&!n.allowedLogKeysSet.has(i)||l.log(c.getName(this),"\n key ",t(i),"\n is ",t(a),"\n was ",t(r))}}});a(p.prototype),c.assignSymbols(p.prototype,{"can.isMapLike":!0,"can.isListLike":!1,"can.isValueLike":!1,"can.getKeyValue":p.prototype.get,"can.setKeyValue":p.prototype.set,"can.deleteKeyValue":function(e){return this.attr(e,void 0)},"can.getOwnEnumerableKeys":function(){return s.add(this,"__keys"),Object.keys(this._data)},"can.assignDeep":function(e){r.batch.start(),c.assignMap(this,e),r.batch.stop()},"can.updateDeep":function(e){r.batch.start(),c.updateMap(this,e),r.batch.stop()},"can.keyHasDependencies":function(e){return!1},"can.getKeyDependencies":function(e){},"can.getName":function(){return c.getName(this.constructor)+"{}"}}),n.exports=p}),define("can-view-scope/reference-map",["require","exports","module","can-simple-map"],function(e,t,n){var i=e("can-simple-map").extend({});n.exports=i}),define("can-util/js/single-reference/single-reference",["require","exports","module","can-cid"],function(e,t,n){!function(e,t,n,i){function a(e,t){return(t?o(e)+":"+t:o(e))||e}var r,o=t("can-cid");r={set:function(e,t,n,i){e[a(t,i)]=n},getAndDelete:function(e,t,n){var i=a(t,n),r=e[i];return delete e[i],r}},i.exports=r}(0,e,0,n)}),define("can-view-scope/make-compute-like",["require","exports","module","can-util/js/single-reference/single-reference","can-reflect"],function(e,t,n){var i=e("can-util/js/single-reference/single-reference"),a=e("can-reflect"),r=function(e){return arguments.length?a.setValue(this,e):a.getValue(this)};n.exports=function(e){var t=r.bind(e);return t.on=t.bind=t.addEventListener=function(n,a){var r=function(e,n){a.call(t,{type:"change"},e,n)};i.set(a,this,r),e.on(r)},t.off=t.unbind=t.removeEventListener=function(t,n){e.off(i.getAndDelete(n,this))},a.assignSymbols(t,{"can.getValue":function(){return a.getValue(e)},"can.setValue":function(t){return a.setValue(e,t)},"can.onValue":function(t,n){return a.onValue(e,t,n)},"can.offValue":function(t,n){return a.offValue(e,t,n)},"can.valueHasDependencies":function(){return a.valueHasDependencies(e)},"can.getPriority":function(){return a.getPriority(e)},"can.setPriority":function(t){a.setPriority(e,t)},"can.isValueLike":!0,"can.isFunctionLike":!1}),t.isComputed=!0,t}}),define("can-view-scope/compute_data",["require","exports","module","can-observation","can-stache-key","can-util/js/assign/assign","can-reflect","can-symbol","can-key-tree","can-queues","can-observation-recorder","can-cid/set/set","can-view-scope/make-compute-like"],function(e,t,n){"use strict";var i=e("can-observation"),a=e("can-stache-key"),r=e("can-util/js/assign/assign"),o=e("can-reflect"),s=e("can-symbol"),c=e("can-key-tree"),l=e("can-queues"),u=e("can-observation-recorder"),d=e("can-cid/set/set"),p=e("can-view-scope/make-compute-like"),f=u.ignore(o.getValue.bind(o)),h=u.ignore(function(e){if(e.reads&&1===e.reads.length){var t=e.root;return t&&t[s.for("can.getValue")]&&(t=o.getValue(t)),t&&o.isObservableLike(t)&&o.isMapLike(t)&&"function"!=typeof t[e.reads[0].key]&&t}}),v=function(e){return e&&"number"==typeof e.batchNum&&"string"==typeof e.type},m=function(e,t,n){this.startingScope=e,this.key=t,this.options=r({observation:this.observation},n);var a;this.read=this.read.bind(this),this.dispatch=this.dispatch.bind(this),Object.defineProperty(this.read,"name",{value:"{{"+this.key+"}}::ScopeKeyData.read"}),Object.defineProperty(this.dispatch,"name",{value:o.getName(this)+".dispatch"}),this.handlers=new c([Object,Array],{onFirst:this.setup.bind(this),onEmpty:this.teardown.bind(this)}),a=this.observation=new i(this.read,this),this.fastPath=void 0,this.root=void 0,this.initialValue=void 0,this.reads=void 0,this.setRoot=void 0;var s=new d;s.add(a),this.dependencies={valueDependencies:s}};m.prototype={constructor:m,dispatch:function(e){var t=this.value;this.value=e,l.enqueueByQueue(this.handlers.getNode([]),this,[e,t],null,[o.getName(this),"changed to",e,"from",t])},setup:function(){this.bound=!0,o.onValue(this.observation,this.dispatch,"notify");var e=h(this);e&&this.toFastPath(e),this.value=f(this.observation)},teardown:function(){this.bound=!1,o.offValue(this.observation,this.dispatch,"notify"),this.toSlowPath()},set:function(e){var t=this.root||this.setRoot;t?a.write(t,this.reads,e,this.options):this.startingScope.set(this.key,e,this.options)},get:function(){return u.isRecording()&&(u.add(this),this.bound||i.temporarilyBind(this)),!0===this.bound?this.value:this.observation.get()},on:function(e,t){this.handlers.add([t||"mutate",e])},off:function(e,t){this.handlers.delete([t||"mutate",e])},toFastPath:function(e){var t=this,n=this.observation;this.fastPath=!0,n.dependencyChange=function(n,a){if(v(a))throw"no event objects!";return n===e&&"function"!=typeof a?this.newVal=a:t.toSlowPath(),i.prototype.dependencyChange.apply(this,arguments)},n.start=function(){this.value=this.newVal}},toSlowPath:function(){this.observation.dependencyChange=i.prototype.dependencyChange,this.observation.start=i.prototype.start,this.fastPath=!1},read:function(){if(this.root)return a.read(this.root,this.reads,this.options).value;var e=this.startingScope.read(this.key,this.options);return this.scope=e.scope,this.reads=e.reads,this.root=e.rootObserve,this.setRoot=e.setRoot,this.initialValue=e.value},hasDependencies:function(){return o.valueHasDependencies(this.observation)}},o.assignSymbols(m.prototype,{"can.getValue":m.prototype.get,"can.setValue":m.prototype.set,"can.onValue":m.prototype.on,"can.offValue":m.prototype.off,"can.valueHasDependencies":m.prototype.hasDependencies,"can.getValueDependencies":function(){return this.dependencies},"can.getPriority":function(){return o.getPriority(this.observation)},"can.setPriority":function(e){o.setPriority(this.observation,e)},"can.getName":function(){return o.getName(this.constructor)+"{{"+this.key+"}}"}}),Object.defineProperty(m.prototype,"compute",{get:function(){var e=p(this);return Object.defineProperty(this,"compute",{value:e,writable:!1,configurable:!1}),e},configurable:!0}),n.exports=function(e,t,n){return new m(e,t,n||{args:[]})}}),define("can-util/js/log/log",["require","exports","module","can-log"],function(e,t,n){"use strict";n.exports=e("can-log")}),define("can-view-scope",["require","exports","module","can-stache-key","can-observation","can-view-scope/reference-map","can-view-scope/compute_data","can-util/js/assign/assign","can-util/js/each/each","can-namespace","can-util/js/dev/dev","can-reflect","can-util/js/log/log"],function(e,t,n){function i(e,t,n){this._context=e,this._parent=t,this._meta=n||{},this.__cache={}}function a(e,t,n){e.helpers||e.partials||e.tags||(e={helpers:e}),i.call(this,e,t,n)}var r=e("can-stache-key"),o=e("can-observation"),s=e("can-view-scope/reference-map"),c=e("can-view-scope/compute_data"),l=e("can-util/js/assign/assign"),u=e("can-util/js/each/each"),d=e("can-namespace"),p=e("can-util/js/dev/dev"),f=e("can-reflect"),h=e("can-util/js/log/log");l(i,{read:r.read,Refs:s,refsScope:function(){return new i(new this.Refs)},keyInfo:function(e){var t={};return t.isDotSlash="./"===e.substr(0,2),t.isThisDot="this."===e.substr(0,5),t.isThisAt="this@"===e.substr(0,5),t.isInCurrentContext=t.isDotSlash||t.isThisDot||t.isThisAt,t.isInParentContext="../"===e.substr(0,3),t.isCurrentContext="."===e||"this"===e,t.isParentContext=".."===e,t.isContextBased=t.isInCurrentContext||t.isInParentContext||t.isCurrentContext||t.isParentContext,t}}),l(i.prototype,{add:function(e,t){return e!==this._context?new this.constructor(e,this,t):this},read:function(e,t){if("%root"===e)return{value:this.getRoot()};if("%scope"===e)return{value:this};var n=i.keyInfo(e);if(n.isContextBased&&this._meta.notContext)return this._parent.read(e,t);var a;if(n.isInCurrentContext)a=!0,e=n.isDotSlash?e.substr(2):e.substr(5);else{if(n.isInParentContext||n.isParentContext){for(var o=this._parent;o._meta.notContext;)o=o._parent;return n.isParentContext?r.read(o._context,[],t):o.read(e.substr(3)||".",t)}if(n.isCurrentContext)return r.read(this._context,[],t)}var s=r.reads(e);return"*"===s[0].key.charAt(0)?this.getRefs()._read(s,t,!0):this._read(s,t,a)},_read:function(e,t,n){for(var i,a,s,c,u,d=this,p=[],f=-1,h=l({foundObservable:function(t,n){a=t,s=e.slice(n)},earlyExit:function(t,n){(n>f||n===f&&"object"==typeof t&&e[n].key in t)&&(u=a,c=s,f=n)}},t),v=o.isRecording();d;){if(null!==(i=d._context)&&("object"==typeof i||"function"==typeof i)){var m=o.trap(),g=r.read(i,e,h),y=m();if(void 0!==g.value)return!y.length&&v?(a=g.parent,s=e.slice(e.length-1)):o.addAll(y),{scope:d,rootObserve:a,value:g.value,reads:s};p.push.apply(p,y)}d=n?null:d._parent}return o.addAll(p),{setRoot:u,reads:c,value:void 0}},get:function(e,t){return t=l({isArgument:!0},t),this.read(e,t).value},peek:o.ignore(function(e,t){return this.get(e,t)}),peak:o.ignore(function(e,t){return p.warn("peak is deprecated, please use peek instead"),this.peek(e,t)}),getScope:function(e){for(var t=this;t;){if(e(t))return t;t=t._parent}},getContext:function(e){var t=this.getScope(e);return t&&t._context},getRefs:function(){var e,t=this.getScope(function(t){return e=t,t._context instanceof i.Refs});return t||(e._parent=i.refsScope(),t=e._parent),t},getRoot:function(){for(var e=this,t=this;e._parent;)t=e,e=e._parent;return e._context instanceof i.Refs&&(e=t),e._context},set:function(e,t,n){n=n||{};var a=i.keyInfo(e);if(a.isCurrentContext)return f.setValue(this._context,t);if(a.isInParentContext||a.isParentContext){for(var o=this._parent;o._meta.notContext;)o=o._parent;return a.isParentContext?f.setValue(o._context,t):o.set(e.substr(3)||".",t,n)}var s,c,l=e.lastIndexOf("."),u=e.lastIndexOf("/");if(u>l?(s=e.substring(0,u),c=e.substring(u+1,e.length)):-1!==l?(s=e.substring(0,l),c=e.substring(l+1,e.length)):(s=".",c=e),"*"===e.charAt(0))r.write(this.getRefs()._context,e,t,n);else{var d=this.read(s,n).value;if(void 0===d)return void p.error("Attempting to set a value at "+e+" where "+s+" is undefined.");r.write(d,c,t,n)}},attr:o.ignore(function(e,t,n){return h.warn("can-view-scope::attr is deprecated, please use peek, get or set"),n=l({isArgument:!0},n),2===arguments.length?this.set(e,t,n):this.get(e,n)}),computeData:function(e,t){return c(this,e,t)},compute:function(e,t){return this.computeData(e,t).compute},cloneFromRef:function(){for(var e,t,n=[],a=this;a;){if((e=a._context)instanceof i.Refs){t=a._parent;break}n.unshift(e),a=a._parent}return t?(u(n,function(e){t=t.add(e)}),t):this}}),(a.prototype=new i).constructor=a,i.Options=a,d.view=d.view||{},n.exports=d.view.Scope=i}),define("can-simple-observable/log",["require","exports","module","can-log/dev/dev","can-reflect"],function(e,t,n){function i(e){return"string"==typeof e?JSON.stringify(e):e}var a=e("can-log/dev/dev"),r=e("can-reflect");n.exports=function(){this._log=function(e,t){a.log(r.getName(this),"\n is ",i(t),"\n was ",i(e))}}}),define("can-simple-observable",["require","exports","module","can-reflect","can-observation-recorder","can-namespace","can-key-tree","can-queues","can-simple-observable/log"],function(e,t,n){function i(e){this.handlers=new s([Object,Array]),this.value=e}var a=e("can-reflect"),r=e("can-observation-recorder"),o=e("can-namespace"),s=e("can-key-tree"),c=e("can-queues");i.prototype={constructor:i,get:function(){return r.add(this),this.value},set:function(e){var t=this.value;this.value=e,c.enqueueByQueue(this.handlers.getNode([]),this,[e,t],null,[a.getName(this),"changed to",e,"from",t]),"function"==typeof this._log&&this._log(t,e)},on:function(e,t){this.handlers.add([t||"mutate",e])},off:function(e,t){this.handlers.delete([t||"mutate",e])},log:e("can-simple-observable/log")},a.assignSymbols(i.prototype,{"can.getValue":i.prototype.get,"can.setValue":i.prototype.set,"can.onValue":i.prototype.on,"can.offValue":i.prototype.off,"can.isMapLike":!1,"can.valueHasDependencies":function(){return!0},"can.getName":function(){var e=this.value;return e="object"!=typeof e||null===e?JSON.stringify(e):"",a.getName(this.constructor)+"<"+e+">"}}),n.exports=o.SimpleObservable=i}),define("can-simple-observable/settable/settable",["require","exports","module","can-reflect","can-observation-recorder","can-simple-observable","can-observation","can-key-tree","can-queues","can-simple-observable/log"],function(e,t,n){function i(e,t,n){function i(){return e.call(t,this.lastSetValue.get())}this.handlers=new c([Object,Array],{onFirst:this.setup.bind(this),onEmpty:this.teardown.bind(this)}),this.lastSetValue=new o(n),this.handler=this.handler.bind(this),a.assignSymbols(this,{"can.getName":function(){return a.getName(this.constructor)+"<"+a.getName(e)+">"}}),Object.defineProperty(this.handler,"name",{value:a.getName(this)+".handler"}),Object.defineProperty(i,"name",{value:a.getName(e)+"::"+a.getName(this.constructor)}),this.observation=new s(i,this)}var a=e("can-reflect"),r=e("can-observation-recorder"),o=e("can-simple-observable"),s=e("can-observation"),c=e("can-key-tree"),l=e("can-queues"),u=e("can-simple-observable/log"),d=r.ignore(a.getValue.bind(a));(i.prototype={handler:function(e){var t=this.value;this.value=e,"function"==typeof this._log&&this._log(t,e),l.enqueueByQueue(this.handlers.getNode([]),this,[e,t],function(){return{}})},setup:function(){this.bound=!0,a.onValue(this.observation,this.handler,"notify"),this.value=d(this.observation)},teardown:function(){this.bound=!1,a.offValue(this.observation,this.handler,"notify")},set:function(e){e!==this.lastSetValue.get()&&this.lastSetValue.set(e)},get:function(){return r.isRecording()&&(r.add(this),this.bound||s.temporarilyBind(this)),!0===this.bound?this.value:this.observation.get()},on:function(e,t){this.handlers.add([t||"mutate",e])},off:function(e,t){this.handlers.delete([t||"mutate",e])},hasDependencies:function(){return a.valueHasDependencies(this.observation)},getValueDependencies:function(){return a.getValueDependencies(this.observation)},log:u}).constructor=i,a.assignSymbols(i.prototype,{"can.getValue":i.prototype.get,"can.setValue":i.prototype.set,"can.onValue":i.prototype.on,"can.offValue":i.prototype.off,"can.isMapLike":!1,"can.getPriority":function(){return a.getPriority(this.observation)},"can.setPriority":function(e){a.setPriority(this.observation,e)},"can.valueHasDependencies":i.prototype.hasDependencies,"can.getValueDependencies":i.prototype.getValueDependencies}),n.exports=i}),define("can-stache/src/key-observable",["require","exports","module","can-simple-observable/settable/settable","can-stache-key"],function(e,t,n){function i(e,t){t=""+t,this.key=t,this.root=e,a.call(this,function(){return r.get(this,t)},e)}var a=e("can-simple-observable/settable/settable"),r=e("can-stache-key");(i.prototype=Object.create(a.prototype)).set=function(e){r.set(this.root,this.key,e)},n.exports=i}),define("can-stache/src/utils",["require","exports","module","can-view-scope","can-observation","can-stache-key","can-reflect","can-stache/src/key-observable","can-util/js/is-array-like/is-array-like"],function(e,t,n){var i=e("can-view-scope"),a=e("can-observation"),r=e("can-stache-key"),o=e("can-reflect"),s=e("can-stache/src/key-observable"),c=e("can-util/js/is-array-like/is-array-like"),l=i.Options,u=function(){};n.exports={isArrayLike:c,emptyHandler:function(){},jsonParse:function(e){return"'"===e[0]?e.substr(1,e.length-2):"undefined"===e?void 0:JSON.parse(e)},mixins:{last:function(){return this.stack[this.stack.length-1]},add:function(e){this.last().add(e)},subSectionDepth:function(){return this.stack.length-1}},convertToScopes:function(e,t,n,i,a,r,o){e.fn=a?this.makeRendererConvertScopes(a,t,n,i,o):u,e.inverse=r?this.makeRendererConvertScopes(r,t,n,i,o):u,e.isSection=!(!a&&!r)},makeRendererConvertScopes:function(e,t,n,r,o){var s=function(n,i,a){return e(n||t,i,a)},c=function(e,a,o){return void 0===e||e instanceof i||(e=t?t.add(e):i.refsScope().add(e||{})),void 0===a||a instanceof l||(a=n.add(a)),s(e,a||n,o||r)};return o?c:a.ignore(c)},getItemsStringContent:function(e,t,n,i){for(var a="",c=r.get(e,"length"),l=o.isObservableLike(e),u=0;u<c;u++){var d=l?new s(e,u):e[u];a+=n.fn(d,i)}return a},getItemsFragContent:function(e,t,n,i){for(var a=[],c=r.get(e,"length"),l=o.isObservableLike(e),u=0;u<c;u++){var d={"%index":u},p=l?new s(e,u):e[u];i&&(d[i]=p),a.push(t.fn(n.add(d,{notContext:!0}).add(p)))}return a},Options:l}}),define("can-attribute-encoder",["require","exports","module","can-namespace","can-log/dev/dev"],function(e,t,n){function i(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}function a(e,t,n){return t+"-"+n.toLowerCase()}function r(e,t){return 0===e.indexOf(t)}function o(e,t){return e.length-e.indexOf(t)===t.length}var s=e("can-namespace"),c=e("can-log/dev/dev"),l=function(e){var t={};return i(e.split(","),function(e){t[e]=!0}),t}("allowReorder,attributeName,attributeType,autoReverse,baseFrequency,baseProfile,calcMode,clipPathUnits,contentScriptType,contentStyleType,diffuseConstant,edgeMode,externalResourcesRequired,filterRes,filterUnits,glyphRef,gradientTransform,gradientUnits,kernelMatrix,kernelUnitLength,keyPoints,keySplines,keyTimes,lengthAdjust,limitingConeAngle,markerHeight,markerUnits,markerWidth,maskContentUnits,maskUnits,patternContentUnits,patternTransform,patternUnits,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,repeatCount,repeatDur,requiredExtensions,requiredFeatures,specularConstant,specularExponent,spreadMethod,startOffset,stdDeviation,stitchTiles,surfaceScale,systemLanguage,tableValues,textLength,viewBox,viewTarget,xChannelSelector,yChannelSelector"),u={leftParens:/\(/g,rightParens:/\)/g,leftBrace:/\{/g,rightBrace:/\}/g,camelCase:/([a-z])([A-Z])/g,forwardSlash:/\//g,space:/\s/g,uppercase:/[A-Z]/g,uppercaseDelimiterThenChar:/:u:([a-z])/g,caret:/\^/g,dollar:/\$/g,at:/@/g},d={prependUppercase:":u:",replaceSpace:":s:",replaceForwardSlash:":f:",replaceLeftParens:":lp:",replaceRightParens:":rp:",replaceLeftBrace:":lb:",replaceRightBrace:":rb:",replaceCaret:":c:",replaceDollar:":d:",replaceAt:":at:"},p={};if(p.encode=function(e){var t=e;return!l[t]&&t.match(u.camelCase)&&(r(t,"on:")||o(t,":to")||o(t,":from")||o(t,":bind")?t=t.replace(u.uppercase,function(e){return d.prependUppercase+e.toLowerCase()}):(t=t.replace(u.camelCase,a),c.warn("can-attribute-encoder: Found attribute with name: "+e+". Converting to: "+t+"."))),t=t.replace(u.space,d.replaceSpace).replace(u.forwardSlash,d.replaceForwardSlash).replace(u.leftParens,d.replaceLeftParens).replace(u.rightParens,d.replaceRightParens).replace(u.leftBrace,d.replaceLeftBrace).replace(u.rightBrace,d.replaceRightBrace).replace(u.caret,d.replaceCaret).replace(u.dollar,d.replaceDollar).replace(u.at,d.replaceAt)},p.decode=function(e){var t=e;return t=t.replace(d.replaceLeftParens,"(").replace(d.replaceRightParens,")").replace(d.replaceLeftBrace,"{").replace(d.replaceRightBrace,"}").replace(d.replaceForwardSlash,"/").replace(d.replaceSpace," ").replace(d.replaceCaret,"^").replace(d.replaceDollar,"$").replace(d.replaceAt,"@"),!l[t]&&t.match(u.uppercaseDelimiterThenChar)&&(r(t,"on:")||o(t,":to")||o(t,":from")||o(t,":bind"))&&(t=t.replace(u.uppercaseDelimiterThenChar,function(e,t){return t.toUpperCase()})),t},s.encoder)throw new Error("You can't have two versions of can-attribute-encoder, check your dependencies");n.exports=s.encoder=p}),define("can-view-parser",["require","exports","module","can-namespace","can-log/dev/dev","can-attribute-encoder"],function(e,t,n){function i(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}function a(e){var t={};return i(e.split(","),function(e){t[e]=!0}),t}function r(e,t){for(var n=0,i=e.length;n<i;n++){var a=e[n];t[a.tokenType].apply(t,a.args)}return e}function o(e){return e.split("\n").length-1}var s=e("can-namespace"),c=e("can-log/dev/dev"),l=e("can-attribute-encoder"),u=new RegExp("^<\\/([-:_A-Za-z0-9]+)[^>]*>"),d=new RegExp("\\{\\{(![\\s\\S]*?!|[\\s\\S]*?)\\}\\}\\}?","g"),p=/\s/,f=new RegExp("[A-Za-z0-9]"),h=a("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),v=a("altGlyph,altGlyphDef,altGlyphItem,animateColor,animateMotion,animateTransform,clipPath,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,foreignObject,glyphRef,linearGradient,radialGradient,textPath"),m=a("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),g=a("script"),y="start,end,close,attrStart,attrEnd,attrValue,chars,comment,special,done".split(","),b={"{":"}","(":")"},w=function(){},k=function(e,t,n){function a(e,n){var i;if(n)for(n=v[n]?n:n.toLowerCase(),i=V.length-1;i>=0&&V[i]!==n;i--);else i=0;if(void 0===e?V.length>0&&(t.filename?c.warn(t.filename+": expected closing tag </"+V[i]+">"):c.warn("expected closing tag </"+V[i]+">")):(i<0||i!==V.length-1)&&(V.length>0?t.filename?c.warn(t.filename+":"+b+": unexpected closing tag "+e+" expected </"+V[V.length-1]+">"):c.warn(b+": unexpected closing tag "+e+" expected </"+V[V.length-1]+">"):t.filename?c.warn(t.filename+":"+b+": unexpected closing tag "+e):c.warn(b+": unexpected closing tag "+e)),i>=0){for(var a=V.length-1;a>=i;a--)t.close&&t.close(V[a],b);V.length=i}}if("object"==typeof e)return r(e,t);var s=[];t=t||{},n&&i(y,function(e){var n=t[e]||w;t[e]=function(){if(!1!==n.apply(this,arguments)){var t=arguments.length;void 0===arguments[t-1]&&(t=arguments.length-1),t=arguments.length,s.push({tokenType:e,args:[].slice.call(arguments,0,t)})}}});var l,p,f,b,x=t.magicMatch||d,j=t.magicStart||"{{",E=function(){C&&(t.chars&&t.chars(C,b),b+=o(C)),C=""},V=[],O=e,C="";for(b=1,V.last=function(){return this[this.length-1]};e;){if(p=!0,V.last()&&g[V.last()])e=e.replace(new RegExp("([\\s\\S]*?)</"+V.last()+"[^>]*>"),function(e,n){return n=n.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,"$1$2"),t.chars&&t.chars(n,b),b+=o(n),""}),a("",V.last());else{if(0===e.indexOf("\x3c!--"))(l=e.indexOf("--\x3e"))>=0&&(E(),t.comment&&t.comment(e.substring(4,l),b),b+=o(e.substring(0,l+3)),e=e.substring(l+3),p=!1);else if(0===e.indexOf("</"))(f=e.match(u))&&(E(),f[0].replace(u,a),b+=o(e.substring(0,f[0].length)),e=e.substring(f[0].length),p=!1);else if(0===e.indexOf("<")){var _=k.searchStartTag(e);_&&(E(),function(e,n,i,r){n=v[n]?n:n.toLowerCase(),m[n]&&V.last()===n&&a("",n),r=h[n]||!!r,t.start(n,r,b),r||V.push(n),k.parseAttrs(i,t,b),b+=o(e),t.end(n,r,b)}.apply(null,_.match),e=_.html,p=!1)}else 0===e.indexOf(j)&&(f=e.match(x))&&(E(),f[0].replace(x,function(e,n){t.special&&t.special(n,b)}),b+=o(e.substring(0,f[0].length)),e=e.substring(f[0].length));if(p){0===(l=L(e,j))&&e===O&&(C+=e.charAt(0),e=e.substr(1),l=L(e,j));var D=l<0?e:e.substring(0,l);e=l<0?"":e.substring(l),D&&(C+=D)}}if(e===O)throw new Error("Parse Error: "+e);O=e}return E(),a(),t.done(b),s},x=function(e,t,n,i,a){var r=i.substring("number"==typeof e.nameStart?e.nameStart:t,t),o=l.encode(r);e.attrStart=o,n.attrStart(e.attrStart,a),e.inName=!1},j=function(e,t,n,i,a){if(void 0!==e.valueStart&&e.valueStart<t){var r,o,s=i.substring(e.valueStart,t);o=(r=(r=i.substring(e.valueStart-1,t+1)).trim()).charAt(r.length-1),e.inQuote!==o&&(n.filename?c.warn(n.filename+":"+a+": End quote is missing for "+s):c.warn(a+": End quote is missing for "+s)),n.attrValue(s,a)}n.attrEnd(e.attrStart,a),e.attrStart=void 0,e.valueStart=void 0,e.inValue=!1,e.inName=!1,e.lookingForEq=!1,e.inQuote=!1,e.lookingForName=!0},L=function(e,t){for(var n=t.length,i=0,a=e.length;i<a;i++)if("<"===e[i]||e.substr(i,n)===t)return i;return-1};k.parseAttrs=function(e,t,n){if(e){for(var i,a=t.magicMatch||d,r=t.magicStart||"{{",o=0,s={inName:!1,nameStart:void 0,inValue:!1,valueStart:void 0,inQuote:!1,attrStart:void 0,lookingForName:!0,lookingForValue:!1,lookingForEq:!1};o<e.length;){i=o;var c=e.charAt(o);if(o++,r===e.substr(i,r.length)){s.inValue&&i>s.valueStart?t.attrValue(e.substring(s.valueStart,i),n):s.inName&&s.nameStart<i?(x(s,i,t,e,n),j(s,i,t,e,n)):s.lookingForValue?s.inValue=!0:s.lookingForEq&&s.attrStart&&j(s,i,t,e,n),a.lastIndex=i;var l=a.exec(e);l&&(t.special(l[1],n),o=i+l[0].length,s.inValue&&(s.valueStart=i+l[0].length))}else if(s.inValue)s.inQuote?c===s.inQuote&&j(s,i,t,e,n):p.test(c)&&j(s,i,t,e,n);else if("="===c&&(s.lookingForEq||s.lookingForName||s.inName))s.attrStart||x(s,i,t,e,n),s.lookingForValue=!0,s.lookingForEq=!1,s.lookingForName=!1;else if(s.inName){var u,f=e[s.nameStart];b[f]===c?(u=b["{"===f?"(":"{"],e[i+1]===u?(x(s,i+2,t,e,n),o++):x(s,i+1,t,e,n),s.lookingForEq=!0):p.test(c)&&"{"!==f&&"("!==f&&(x(s,i,t,e,n),s.lookingForEq=!0)}else s.lookingForName?p.test(c)||(s.attrStart&&j(s,i,t,e,n),s.nameStart=i,s.inName=!0):s.lookingForValue&&(p.test(c)?o===e.length&&j(s,i,t,e,n):(s.lookingForValue=!1,s.inValue=!0,"'"===c||'"'===c?(s.inQuote=c,s.valueStart=i+1):s.valueStart=i))}s.inName?(x(s,i+1,t,e,n),j(s,i+1,t,e,n)):(s.lookingForEq||s.lookingForValue||s.inValue)&&j(s,i+1,t,e,n),a.lastIndex=0}},k.searchStartTag=function(e){var t=e.indexOf(">");if(-1===t||!f.test(e[1]))return null;var n,i,a,r="",o="",s=e.substring(0,t+1),c="/"===s[s.length-2],l=s.search(p);return c?(o="/",i=s.substring(1,s.length-2).trim()):i=s.substring(1,s.length-1).trim(),-1===l?n=i:(l--,n=i.substring(0,l),r=i.substring(l)),a=[s,n,r,o],{match:a,html:e.substring(s.length)}},n.exports=s.HTMLParser=k}),define("can-util/js/set-immediate/set-immediate",["require","exports","module","can-globals/global/global"],function(e,t,n){!function(e,t,n,i){"use strict";var e=t("can-globals/global/global")();i.exports=e.setImmediate||function(e){return setTimeout(e,0)}}(function(){return this}(),e,0,n)}),define("can-util/dom/child-nodes/child-nodes",function(e,t,n){"use strict";n.exports=function(e){var t=e.childNodes;if("length"in t)return t;for(var n=e.firstChild,i=[];n;)i.push(n),n=n.nextSibling;return i}}),define("can-util/dom/contains/contains",function(e,t,n){"use strict";n.exports=function(e){return this.contains(e)}}),define("can-util/dom/mutate/mutate",["require","exports","module","can-util/js/make-array/make-array","can-util/js/set-immediate/set-immediate","can-cid","can-globals/mutation-observer/mutation-observer","can-util/dom/child-nodes/child-nodes","can-util/dom/contains/contains","can-util/dom/dispatch/dispatch","can-globals/document/document","can-util/dom/data/data"],function(e,t,n){!function(e,t,n,i){"use strict";var a,r=t("can-util/js/make-array/make-array"),o=t("can-util/js/set-immediate/set-immediate"),s=t("can-cid"),c=t("can-globals/mutation-observer/mutation-observer"),l=t("can-util/dom/child-nodes/child-nodes"),u=t("can-util/dom/contains/contains"),d=t("can-util/dom/dispatch/dispatch"),p=t("can-globals/document/document"),f=t("can-util/dom/data/data"),h={inserted:function(e,t){return u.call(e,t)},removed:function(e,t){return!u.call(e,t)}},v=function(e,t,n,i,a){if(e.length)for(var o,c,l,u=0;void 0!==(l=e[u]);u++)if(c=s(l),l.getElementsByTagName&&n(t,l)&&!a[c]){a[c]=!0,o=r(l.getElementsByTagName("*")),d.call(l,i,[],!1),"removed"===i&&f.delete.call(l);for(var p,h=0;void 0!==(p=o[h]);h++)a[c=s(p)]||(d.call(p,i,[],!1),"removed"===i&&f.delete.call(p),a[c]=!0)}},m=function(){var e=a;a=null;var t=e[0][1][0],n=p()||t.ownerDocument||t,i=n.contains?n:n.documentElement,r={inserted:{},removed:{}};e.forEach(function(e){v(e[1],i,h[e[0]],e[0],r[e[0]])})},g=function(e,t){if(!c()&&e.length){var n=e[0],i=p()||n.ownerDocument||n,r=i.contains?i:i.documentElement;h.inserted(r,n)&&(a||(a=[],o(m)),a.push([t,e]))}};i.exports={appendChild:function(e){if(c())this.appendChild(e);else{var t;t=11===e.nodeType?r(l(e)):[e],this.appendChild(e),g(t,"inserted")}},insertBefore:function(e,t,n){if(c())this.insertBefore(e,t);else{var i;i=11===e.nodeType?r(l(e)):[e],this.insertBefore(e,t),g(i,"inserted")}},removeChild:function(e){c()?this.removeChild(e):(g([e],"removed"),this.removeChild(e))},replaceChild:function(e,t){if(c())this.replaceChild(e,t);else{var n;n=11===e.nodeType?r(l(e)):[e],g([t],"removed"),this.replaceChild(e,t),g(n,"inserted")}},inserted:function(e){g(e,"inserted")},removed:function(e){g(e,"removed")}}}(0,e,0,n)}),define("can-cid/map/map",["require","exports","module","can-cid","can-cid/helpers"],function(e,t,n){"use strict";var i,a=e("can-cid").get,r=e("can-cid/helpers");"undefined"!=typeof Map?i=Map:((i=function(){this.values={}}).prototype.set=function(e,t){this.values[a(e)]={key:e,value:t}},i.prototype.delete=function(e){var t=a(e)in this.values;return t&&delete this.values[a(e)],t},i.prototype.forEach=function(e,t){r.each(this.values,function(n){return e.call(t||this,n.value,n.key,this)},this)},i.prototype.has=function(e){return a(e)in this.values},i.prototype.get=function(e){var t=this.values[a(e)];return t&&t.value},i.prototype.clear=function(){return this.values={}},Object.defineProperty(i.prototype,"size",{get:function(){var e=0;return r.each(this.values,function(){e++}),e}})),n.exports=i}),define("can-util/js/cid-map/cid-map",["require","exports","module","can-cid/map/map"],function(e,t,n){!function(e,t,n,i){"use strict";i.exports=t("can-cid/map/map")}(0,e,0,n)}),define("can-view-nodelist",["require","exports","module","can-util/js/make-array/make-array","can-util/js/each/each","can-namespace","can-util/dom/mutate/mutate","can-util/js/cid-map/cid-map"],function(e,t,n){var i=e("can-util/js/make-array/make-array"),a=e("can-util/js/each/each"),r=e("can-namespace"),o=e("can-util/dom/mutate/mutate"),s=e("can-util/js/cid-map/cid-map"),c=new s,l=[].splice,u=[].push,d=function(e){for(var t=0,n=0,i=e.length;n<i;n++){var a=e[n];a.nodeType?t++:t+=d(a)}return t},p=function(e){for(var t=new s,n=0,i=e.length;n<i;n++){var a=h.first(e[n]);t.set(a,e[n])}return t},f=function(e,t){t.forEach(function(t){e.newDeepChildren.push(t)})},h={update:function(e,t){var n=h.unregisterChildren(e);t=i(t);var a=e.length;return l.apply(e,[0,a].concat(t)),e.replacements?(h.nestReplacements(e),e.deepChildren=e.newDeepChildren,e.newDeepChildren=[]):h.nestList(e),n},nestReplacements:function(e){for(var t=0,n=p(e.replacements),i=e.replacements.length;t<e.length&&i;){var a=e[t],r=n.get(a);r&&(n.delete(a),e.splice(t,d(r),r),i--),t++}i&&f(e,n),e.replacements=[]},nestList:function(e){for(var t=0;t<e.length;){var n=e[t],i=c.get(n);i?i!==e&&e.splice(t,d(i),i):c.set(n,e),t++}},last:function(e){var t=e[e.length-1];return t.nodeType?t:h.last(t)},first:function(e){var t=e[0];return t.nodeType?t:h.first(t)},flatten:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];i.nodeType?t.push(i):t.push.apply(t,h.flatten(i))}return t},register:function(e,t,n,i){return e.unregistered=t,e.parentList=n,e.nesting=n&&void 0!==n.nesting?n.nesting+1:0,n?(e.deepChildren=[],e.newDeepChildren=[],e.replacements=[],!0!==n&&(i?n.replacements.push(e):n.newDeepChildren.push(e))):h.nestList(e),e},unregisterChildren:function(e){var t=[];return a(e,function(n){n.nodeType?(e.replacements||c.delete(n),t.push(n)):u.apply(t,h.unregister(n,!0))}),a(e.deepChildren,function(e){h.unregister(e,!0)}),t},unregister:function(e,t){var n=h.unregisterChildren(e,!0);if(e.unregistered){var i=e.unregistered;if(e.replacements=e.unregistered=null,!t){var a=e.parentList&&e.parentList.deepChildren;if(a){var r=a.indexOf(e);-1!==r&&a.splice(r,1)}}i()}return n},after:function(e,t){var n=e[e.length-1];n.nextSibling?o.insertBefore.call(n.parentNode,t,n.nextSibling):o.appendChild.call(n.parentNode,t)},replace:function(e,t){var n,i=e[0].parentNode;"SELECT"===i.nodeName.toUpperCase()&&i.selectedIndex>=0&&(n=i.value),1===e.length?o.replaceChild.call(i,t,e[0]):(h.after(e,t),h.remove(e)),void 0!==n&&(i.value=n)},remove:function(e){var t=e[0]&&e[0].parentNode;a(e,function(e){o.removeChild.call(t,e)})},nodeMap:c};n.exports=r.nodeLists=h}),define("can-util/dom/fragment/fragment",["require","exports","module","can-globals/document/document","can-util/dom/child-nodes/child-nodes"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals/document/document"),r=t("can-util/dom/child-nodes/child-nodes"),o=/^\s*<(\w+)[^>]*>/,s={}.toString,c=function(e,t,n){void 0===t&&(t=o.test(e)&&RegExp.$1),e&&"[object Function]"===s.call(e.replace)&&(e=e.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>"));var i=n.createElement("div"),a=n.createElement("div");"tbody"===t||"tfoot"===t||"thead"===t||"colgroup"===t?(a.innerHTML="<table>"+e+"</table>",i=3===a.firstChild.nodeType?a.lastChild:a.firstChild):"col"===t?(a.innerHTML="<table><colgroup>"+e+"</colgroup></table>",i=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild):"tr"===t?(a.innerHTML="<table><tbody>"+e+"</tbody></table>",i=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild):"td"===t||"th"===t?(a.innerHTML="<table><tbody><tr>"+e+"</tr></tbody></table>",i=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild.firstChild):"option"===t?(a.innerHTML="<select>"+e+"</select>",i=3===a.firstChild.nodeType?a.lastChild:a.firstChild):i.innerHTML=""+e;var c={},l=r(i);c.length=l.length;for(var u=0;u<l.length;u++)c[u]=l[u];return[].slice.call(c)};i.exports=function(e,t){if(e&&11===e.nodeType)return e;t?t.length&&(t=t[0]):t=a();for(var n=c(e,void 0,t),i=(t||document).createDocumentFragment(),r=0,o=n.length;r<o;r++)i.appendChild(n[r]);return i}}(0,e,0,n)}),define("can-util/dom/frag/frag",["require","exports","module","can-globals/document/document","can-util/dom/fragment/fragment","can-util/js/each/each","can-util/dom/child-nodes/child-nodes"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals/document/document"),r=t("can-util/dom/fragment/fragment"),o=t("can-util/js/each/each"),s=t("can-util/dom/child-nodes/child-nodes"),c=function(e,t){var n,i=t||a();return e&&"string"!=typeof e?11===e.nodeType?e:"number"==typeof e.nodeType?((n=i.createDocumentFragment()).appendChild(e),n):"number"==typeof e.length?(n=i.createDocumentFragment(),o(e,function(e){n.appendChild(c(e))}),s(n).length||n.appendChild(i.createTextNode("")),n):(n=r(""+e,i),s(n).length||n.appendChild(i.createTextNode("")),n):((n=r(null==e?"":""+e,i)).childNodes.length||n.appendChild(i.createTextNode("")),n)};i.exports=c}(0,e,0,n)}),define("can-util/dom/is-of-global-document/is-of-global-document",["require","exports","module","can-globals/document/document"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals/document/document");i.exports=function(e){return(e.ownerDocument||e)===a()}}(0,e,0,n)}),define("can-util/dom/events/make-mutation-event/make-mutation-event",["require","exports","module","can-util/dom/events/events","can-util/dom/data/data","can-globals/mutation-observer/mutation-observer","can-util/dom/dispatch/dispatch","can-util/dom/mutation-observer/document/document","can-globals/document/document","can-cid/map/map","can-util/js/string/string","can-util/dom/is-of-global-document/is-of-global-document"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-util/dom/events/events"),r=t("can-util/dom/data/data"),o=t("can-globals/mutation-observer/mutation-observer"),s=t("can-util/dom/dispatch/dispatch"),c=t("can-util/dom/mutation-observer/document/document"),l=t("can-globals/document/document"),u=t("can-cid/map/map"),d=t("can-util/js/string/string");t("can-util/dom/is-of-global-document/is-of-global-document"),i.exports=function(e,t){var n=a.addEventListener,i=a.removeEventListener;a.addEventListener=function(i){if(i===e&&o()){var a=l().documentElement,p=r.get.call(a,e+"Data");if(p||(p={handler:function(t){p.nodeIdsRespondingToInsert.has(t)&&(s.call(t,e,[],!1),p.nodeIdsRespondingToInsert.delete(t))},nodeIdsRespondingToInsert:new u},c["on"+d.capitalize(t)](p.handler),r.set.call(a,e+"Data",p)),11!==this.nodeType){var f=p.nodeIdsRespondingToInsert.get(this)||0;p.nodeIdsRespondingToInsert.set(this,f+1)}}return n.apply(this,arguments)},a.removeEventListener=function(n){if(n===e&&o()){var a=l().documentElement,s=r.get.call(a,e+"Data");if(s){var u=s.nodeIdsRespondingToInsert.get(this)-1;u?s.nodeIdsRespondingToInsert.set(this,u):s.nodeIdsRespondingToInsert.delete(this),s.nodeIdsRespondingToInsert.size||(c["off"+d.capitalize(t)](s.handler),r.clean.call(a,e+"Data"))}}return i.apply(this,arguments)}}}(0,e,0,n)}),define("can-util/dom/events/removed/removed",["require","exports","module","can-util/dom/events/make-mutation-event/make-mutation-event"],function(e,t,n){"use strict";e("can-util/dom/events/make-mutation-event/make-mutation-event")("removed","removedNodes")}),define("can-view-live/lib/core",["require","exports","module","can-view-parser","can-util/dom/events/events","can-view-nodelist","can-util/dom/frag/frag","can-util/dom/child-nodes/child-nodes","can-reflect","can-util/dom/events/removed/removed","can-symbol"],function(e,t,n){var i=e("can-view-parser"),a=e("can-util/dom/events/events"),r=e("can-view-nodelist"),o=e("can-util/dom/frag/frag"),s=e("can-util/dom/child-nodes/child-nodes"),c=e("can-reflect");e("can-util/dom/events/removed/removed");var l=new WeakMap,u={setup:function(e,t,n){var i,r=!1,o=function(){return r||(r=!0,n(i),a.removeEventListener.call(e,"removed",o)),!0};return i={teardownCheck:function(e){return!e&&o()}},a.addEventListener.call(e,"removed",o),t(i),i},listen:function(e,t,n){return u.setup(e,function(){c.onValue(t,n,"notify"),u.addElementDependency(e,t)},function(i){c.offValue(t,n,"notify"),u.deleteElementDependency(e,t),i.nodeList&&r.unregister(i.nodeList)})},getAttributeParts:function(e){var t,n={};return i.parseAttrs(e,{attrStart:function(e){n[e]="",t=e},attrValue:function(e){n[t]+=e},attrEnd:function(){}}),n},isNode:function(e){return e&&e.nodeType},addTextNodeIfNoChildren:function(e){e.firstChild||e.appendChild(e.ownerDocument.createTextNode(""))},replace:function(e,t,n){var i=e.slice(0),a=o(t);return r.register(e,n),r.update(e,s(a)),r.replace(i,a),e},getParentNode:function(e,t){return t&&11===e.parentNode.nodeType?t:e.parentNode},makeString:function(e){return null==e?"":""+e},addElementDependency:function(e,t){var n=l.get(e);n?n.add(t):l.set(e,new Set([t]))},deleteElementDependency:function(e,t){var n=l.get(e);n&&(n.delete(t),n.size||l.delete(e))}},d=e("can-symbol").for("can.getValueDependencies");Element.prototype[d]=function(){var e=this;if(l.has(e))return{valueDependencies:l.get(e)}},n.exports=u}),define("can-types",["require","exports","module","can-namespace","can-reflect","can-symbol","can-log/dev/dev"],function(e,t,n){var i=e("can-namespace"),a=e("can-reflect"),r=e("can-symbol"),o=e("can-log/dev/dev"),s={isMapLike:function(e){return o.warn("can-types.isMapLike(obj) is deprecated, please use `canReflect.isObservableLike(obj) && canReflect.isMapLike(obj)` instead."),a.isObservableLike(e)&&a.isMapLike(e)},isListLike:function(e){return o.warn("can-types.isListLike(obj) is deprecated, please use `canReflect.isObservableLike(obj) && canReflect.isListLike(obj)` instead."),a.isObservableLike(e)&&a.isListLike(e)},isPromise:function(e){return o.warn("can-types.isPromise is deprecated, please use canReflect.isPromise instead."),a.isPromise(e)},isConstructor:function(e){return o.warn("can-types.isConstructor is deprecated, please use canReflect.isConstructorLike instead."),a.isConstructorLike(e)},isCallableForValue:function(e){return o.warn("can-types.isCallableForValue(obj) is deprecated, please use `canReflect.isFunctionLike(obj) && !canReflect.isConstructorLike(obj)` instead."),e&&a.isFunctionLike(e)&&!a.isConstructorLike(e)},isCompute:function(e){return o.warn("can-types.isCompute is deprecated."),e&&e.isComputed},get iterator(){return o.warn('can-types.iterator is deprecated, use `canSymbol.iterator || canSymbol.for("iterator")` instead.'),r.iterator||r.for("iterator")},DefaultMap:null,DefaultList:null,queueTask:function(e){var t=e[2]||[];e[0].apply(e[1],t)},wrapElement:function(e){return e},unwrapElement:function(e){return e}};if(i.types)throw new Error("You can't have two versions of can-types, check your dependencies");n.exports=i.types=s}),define("can-util/js/diff/diff",function(e,t,n){"use strict";function i(e,t,n,i,r){for(var o=n.length-1,s=i.length-1;o>e&&s>t;){if(!r(n[o],i[s]))return[{index:t,deleteCount:o-e+1,insert:a.call(i,t,s+1)}];o--,s--}return[{index:t,deleteCount:o-e+1,insert:a.call(i,t,s+1)}]}var a=[].slice,r=function(e,t){return e===t};n.exports=function(e,t,n){n=n||r;for(var o=0,s=0,c=e.length,l=t.length,u=[];o<c&&s<l;){var d=e[o],p=t[s];if(n(d,p))o++,s++;else if(s+1<l&&n(d,t[s+1]))u.push({index:s,deleteCount:0,insert:[t[s]]}),o++,s+=2;else{if(!(o+1<c&&n(e[o+1],p)))return u.push.apply(u,i(o,s,e,t,n)),u;u.push({index:s,deleteCount:1,insert:[]}),o+=2,s++}}return s===l&&o===c?u:(u.push({index:s,deleteCount:c-o,insert:a.call(t,s)}),u)}}),define("can-util/dom/events/attributes/attributes",["require","exports","module","can-util/dom/events/events","can-util/dom/is-of-global-document/is-of-global-document","can-util/dom/data/data","can-globals/mutation-observer/mutation-observer","can-assign","can-util/dom/dispatch/dispatch"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-util/dom/events/events"),r=t("can-util/dom/is-of-global-document/is-of-global-document"),o=t("can-util/dom/data/data"),s=t("can-globals/mutation-observer/mutation-observer"),c=t("can-assign"),l=t("can-util/dom/dispatch/dispatch"),u=a.addEventListener,d=a.removeEventListener;a.addEventListener=function(e){if("attributes"===e){var t=s();if(r(this)&&t){if(!o.get.call(this,"canAttributesObserver")){var n=this,i=new t(function(e){e.forEach(function(e){var t=c({},e);l.call(n,t,[],!1)})});i.observe(this,{attributes:!0,attributeOldValue:!0}),o.set.call(this,"canAttributesObserver",i)}}else o.set.call(this,"canHasAttributesBindings",!0)}return u.apply(this,arguments)},a.removeEventListener=function(e){if("attributes"===e){var t,n=s();r(this)&&n?(t=o.get.call(this,"canAttributesObserver"))&&t.disconnect&&(t.disconnect(),o.clean.call(this,"canAttributesObserver")):o.clean.call(this,"canHasAttributesBindings")}return d.apply(this,arguments)}}(0,e)}),define("can-util/dom/events/inserted/inserted",["require","exports","module","can-util/dom/events/make-mutation-event/make-mutation-event"],function(e,t,n){"use strict";e("can-util/dom/events/make-mutation-event/make-mutation-event")("inserted","addedNodes")}),define("can-util/dom/attr/attr",["require","exports","module","can-util/js/set-immediate/set-immediate","can-globals/document/document","can-globals/global/global","can-util/dom/is-of-global-document/is-of-global-document","can-util/dom/data/data","can-util/dom/contains/contains","can-util/dom/events/events","can-util/dom/dispatch/dispatch","can-globals/mutation-observer/mutation-observer","can-util/js/each/each","can-types","can-util/js/diff/diff","can-util/dom/events/attributes/attributes","can-util/dom/events/inserted/inserted"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-util/js/set-immediate/set-immediate"),r=t("can-globals/document/document"),e=t("can-globals/global/global")(),o=t("can-util/dom/is-of-global-document/is-of-global-document"),s=t("can-util/dom/data/data"),c=t("can-util/dom/contains/contains"),l=t("can-util/dom/events/events"),u=t("can-util/dom/dispatch/dispatch"),d=t("can-globals/mutation-observer/mutation-observer"),p=t("can-util/js/each/each"),f=t("can-types"),h=t("can-util/js/diff/diff");t("can-util/dom/events/attributes/attributes"),t("can-util/dom/events/inserted/inserted");var v={xlink:"http://www.w3.org/1999/xlink"},m={INPUT:!0,TEXTAREA:!0,SELECT:!0},g=function(e){return null==e?"":""+e},y=function(e){return"http://www.w3.org/2000/svg"===e.namespaceURI},b=function(){return!0},w=function(e){return e&&e.test||b},k=function(e,t){return t=t||{},t.get=function(){return this[e]},t.set=function(t){return this[e]!==t&&(this[e]=t),t},t},x=function(e){return{isBoolean:!0,set:function(t){e in this?this[e]=!1!==t:this.setAttribute(e,"")},remove:function(){this[e]=!1}}},j=function(e,t){if(!s.get.call(e,"attrMO")){var n=function(){t.call(e)},i=d();if(i){var a=new i(n);a.observe(e,{childList:!0,subtree:!0}),s.set.call(e,"attrMO",a)}else s.set.call(e,"attrMO",!0),s.set.call(e,"canBindingCallback",{onMutation:n})}},L=function(e,t){for(var n=e.firstChild;n;){if("OPTION"===n.nodeName&&t===n.value)return n;if("OPTGROUP"===n.nodeName){var i=L(n,t);if(i)return i}n=n.nextSibling}},E=function(e,t){var n;null!=t&&(n=L(e,t)),n?n.selected=!0:e.selectedIndex=-1},V=function(e,t){for(var n=e.firstChild;n;)"OPTION"===n.nodeName&&t(n),"OPTGROUP"===n.nodeName&&V(n,t),n=n.nextSibling},O=function(e){var t=[];return V(e,function(e){e.selected&&t.push(e.value)}),t},C=function(e,t){V(e,function(e){e.selected=-1!==t.indexOf(e.value)})},_=function(e,t){var n=s.get.call(e,"attrSetChildOptions");return n?Function.prototype:(n=function(){E(e,e.value)},s.set.call(e,"attrSetChildOptions",n),t.call(e,"change",n),function(t){s.clean.call(e,"attrSetChildOptions"),t.call(e,"change",n)})},D={special:{checked:{get:function(){return this.checked},set:function(e){var t=!!e||""===e||0===arguments.length;return this.checked=t,t&&"radio"===this.type&&(this.defaultChecked=!0),e},remove:function(){this.checked=!1},test:function(){return"INPUT"===this.nodeName}},class:{get:function(){return y(this)?this.getAttribute("class"):this.className},set:function(e){return e=e||"",y(this)?this.setAttribute("class",""+e):this.className=e,e}},disabled:x("disabled"),focused:{get:function(){return this===document.activeElement},set:function(e){function t(){e?a.focus():a.blur()}var n=D.get(this,"focused"),i=this.ownerDocument.documentElement,a=this;if(n!==e)if(c.call(i,a))f.queueTask([t,this,[]]);else{var r=function(){l.removeEventListener.call(a,"inserted",r),t()};l.addEventListener.call(a,"inserted",r)}return!!e},addEventListener:function(e,t,n){return n.call(this,"focus",t),n.call(this,"blur",t),function(e){e.call(this,"focus",t),e.call(this,"blur",t)}},test:function(){return"INPUT"===this.nodeName}},for:k("htmlFor"),innertext:k("innerText"),innerhtml:k("innerHTML"),innerHTML:k("innerHTML",{addEventListener:function(e,t,n){var i=[],a=this;return p(["change","blur"],function(e){var n=function(){t.apply(this,arguments)};l.addEventListener.call(a,e,n),i.push([e,n])}),function(e){p(i,function(t){e.call(a,t[0],t[1])})}}}),required:x("required"),readonly:x("readOnly"),selected:{get:function(){return this.selected},set:function(e){return e=!!e,s.set.call(this,"lastSetValue",e),this.selected=e},addEventListener:function(e,t,n){var i=this,a=this.parentNode,r=i.selected,o=function(t){var n=i.selected;n!==(r=s.get.call(i,"lastSetValue")||r)&&(r=n,u.call(i,e))},c=_(a,n);return l.addEventListener.call(a,"change",o),n.call(i,e,t),function(n){c(n),l.removeEventListener.call(a,"change",o),n.call(i,e,t)}},test:function(){return"OPTION"===this.nodeName&&this.parentNode&&"SELECT"===this.parentNode.nodeName}},src:{set:function(e){return null==e||""===e?(this.removeAttribute("src"),null):(this.setAttribute("src",e),e)}},style:{set:function(){var t=e.document&&r().createElement("div");return t&&t.style&&"cssText"in t.style?function(e){return this.style.cssText=e||""}:function(e){return this.setAttribute("style",e)}}()},textcontent:k("textContent"),value:{get:function(){var e=this.value;return"SELECT"===this.nodeName&&"selectedIndex"in this&&-1===this.selectedIndex&&(e=void 0),e},set:function(e){var t=this.nodeName.toLowerCase();if("input"===t&&(e=g(e)),this.value===e&&"option"!==t||(this.value=e),D.defaultValue[t]&&(this.defaultValue=e),"select"===t){s.set.call(this,"attrValueLastVal",e),E(this,null===e?e:this.value);var n=this.ownerDocument.documentElement;if(!c.call(n,this)){var i=this,a=function(){l.removeEventListener.call(i,"inserted",a),E(i,null===e?e:i.value)};l.addEventListener.call(this,"inserted",a)}j(this,function(){var e=s.get.call(this,"attrValueLastVal");D.set(this,"value",e),u.call(this,"change")})}return e},test:function(){return m[this.nodeName]}},values:{get:function(){return O(this)},set:function(e){return e=e||[],C(this,e),s.set.call(this,"stickyValues",D.get(this,"values")),j(this,function(){var e=s.get.call(this,"stickyValues");D.set(this,"values",e);var t=s.get.call(this,"stickyValues");h(e.slice().sort(),t.slice().sort()).length&&u.call(this,"values")}),e},addEventListener:function(e,t,n){var i=function(){u.call(this,"values")};return l.addEventListener.call(this,"change",i),n.call(this,e,t),function(n){l.removeEventListener.call(this,"change",i),n.call(this,e,t)}}}},defaultValue:{input:!0,textarea:!0},setAttrOrProp:function(e,t,n){t=t.toLowerCase();var i=D.special[t];i&&i.isBoolean&&!n?this.remove(e,t):this.set(e,t,n)},set:function(e,t,n){var i=o(e)&&d();t=t.toLowerCase();var a;i||(a=D.get(e,t));var r,s=D.special[t],c=s&&s.set,l=w(s);"function"==typeof c&&l.call(e)?r=2===arguments.length?c.call(e):c.call(e,n):D.setAttribute(e,t,n),i||r===a||D.trigger(e,t,a)},setSelectValue:function(e,t){D.set(e,"value",t)},setAttribute:function(){var e=r();if(e&&document.createAttribute)try{e.createAttribute("{}")}catch(e){var t={},n=document.createElement("div");return function(e,i,a){var r,o,s,c=i.charAt(0);"{"!==c&&"("!==c&&"*"!==c||!e.setAttributeNode?1!==(s=i.split(":")).length&&v[s[0]]?e.setAttributeNS(v[s[0]],i,a):e.setAttribute(i,a):((r=t[i])||(n.innerHTML="<div "+i+'=""></div>',r=t[i]=n.childNodes[0].attributes[0]),(o=r.cloneNode()).value=a,e.setAttributeNode(o))}}return function(e,t,n){e.setAttribute(t,n)}}(),trigger:function(e,t,n){if(s.get.call(e,"canHasAttributesBindings"))return t=t.toLowerCase(),a(function(){u.call(e,{type:"attributes",attributeName:t,target:e,oldValue:n,bubbles:!1},[])})},get:function(e,t){t=t.toLowerCase();var n=D.special[t],i=n&&n.get,a=w(n);return"function"==typeof i&&a.call(e)?i.call(e):e.getAttribute(t)},remove:function(e,t){t=t.toLowerCase();var n;d()||(n=D.get(e,t));var i=D.special[t],a=i&&i.set,r=i&&i.remove,o=w(i);"function"==typeof r&&o.call(e)?r.call(e):"function"==typeof a&&o.call(e)?a.call(e,void 0):e.removeAttribute(t),d()||null==n||D.trigger(e,t,n)},has:function(){var e=r()&&document.createElement("div");return e&&e.hasAttribute?function(e,t){return e.hasAttribute(t)}:function(e,t){return null!==e.getAttribute(t)}}()},S=l.addEventListener;l.addEventListener=function(e,t){var n=D.special[e];if(n&&n.addEventListener){var i=n.addEventListener.call(this,e,t,S),a=s.get.call(this,"attrTeardowns");return a||s.set.call(this,"attrTeardowns",a={}),a[e]||(a[e]=[]),void a[e].push({teardown:i,handler:t})}return S.apply(this,arguments)};var T=l.removeEventListener;l.removeEventListener=function(e,t){var n=D.special[e];{if(!n||!n.addEventListener)return T.apply(this,arguments);var i=s.get.call(this,"attrTeardowns");if(i&&i[e]){for(var a=i[e],r=0,o=a.length;r<o;r++)if(a[r].handler===t){a[r].teardown.call(this,T),a.splice(r,1);break}0===a.length&&delete i[e]}}},i.exports=D}(function(){return this}(),e,0,n)}),define("can-view-live/lib/attr",["require","exports","module","can-util/dom/attr/attr","can-view-live/lib/core","can-reflect"],function(e,t,n){var i=e("can-util/dom/attr/attr"),a=e("can-view-live/lib/core"),r=e("can-reflect");a.attr=function(e,t,n){function o(n){i.set(e,t,n)}Object.defineProperty(o,"name",{value:"live.attr update::"+r.getName(n)}),a.listen(e,n,o),o(r.getValue(n))}}),define("can-util/js/global/global",["require","exports","module","can-globals/global/global"],function(e,t,n){!function(e,t,n,i){"use strict";i.exports=t("can-globals/global/global")}(0,e,0,n)}),define("can-view-callbacks",["require","exports","module","can-observation-recorder","can-util/js/dev/dev","can-util/js/global/global","can-util/dom/mutate/mutate","can-namespace"],function(e,t,n){!function(e,t,n,i){var a=t("can-observation-recorder"),r=t("can-util/js/dev/dev"),o=t("can-util/js/global/global"),s=t("can-util/dom/mutate/mutate"),c=t("can-namespace"),l={},u={},d=[],p=/[-\:]/,f=function(){},h={},v={_tags:h,_attributes:u,_regExpAttributes:d,defaultCallback:f,tag:function(e,t){if(!t){var n;return null===t?delete h[e.toLowerCase()]:n=h[e.toLowerCase()],!n&&p.test(e)&&(n=f),n}void 0!==h[e.toLowerCase()]&&r.warn("Custom tag: "+e.toLowerCase()+" is already defined"),p.test(e)||"content"===e||r.warn("Custom tag: "+e.toLowerCase()+" hyphen missed"),o().html5&&(o().html5.elements+=" "+e,o().html5.shivDocument()),h[e.toLowerCase()]=t},attr:function(e,t){if(!t){var n=u[e];if(!n)for(var i=0,a=d.length;i<a;i++){var o=d[i];if(o.match.test(e))return o.handler}return l[e]=!0,n}"string"==typeof e?(u[e]=t,l[e]&&r.warn("can-view-callbacks: "+e+" custom attribute behavior requested before it was defined. Make sure "+e+" is defined before it is needed.")):(d.push({match:e,handler:t}),Object.keys(l).forEach(function(t){e.test(t)&&r.warn("can-view-callbacks: "+t+" custom attribute behavior requested before it was defined. Make sure "+e+" is defined before it is needed.")}))},tagHandler:function(e,t,n){var i,o=n.options.get("tags."+t,{proxyMethods:!1})||h[t],c=n.scope;if(i=o?a.ignore(o)(e,n):c,o||r.warn("can-view-callbacks: No custom element found for "+t),i&&n.subtemplate){c!==i&&(c=c.add(i));var l=n.subtemplate(c,n.options),u="string"==typeof l?can.view.frag(l):l;s.appendChild.call(e,u)}}};if(c.view=c.view||{},c.view.callbacks)throw new Error("You can't have two versions of can-view-callbacks, check your dependencies");i.exports=c.view.callbacks=v}(0,e,0,n)}),define("can-view-live/lib/attrs",["require","exports","module","can-view-live/lib/core","can-view-callbacks","can-util/dom/attr/attr","can-util/dom/events/events","can-reflect"],function(e,t,n){var i=e("can-view-live/lib/core"),a=e("can-view-callbacks"),r=e("can-util/dom/attr/attr"),o=e("can-util/dom/events/events"),s=e("can-reflect");i.attrs=function(e,t,n,c){function l(t){var o,s=i.getAttributeParts(t);for(o in s){var l=s[o];if(l!==u[o]){r.set(e,o,l);var d=a.attr(o);d&&d(e,{attributeName:o,scope:n,options:c})}delete u[o]}for(o in u)r.remove(e,o);u=s}if(s.isObservableLike(t)){var u={};Object.defineProperty(l,"name",{value:"live.attrs update::"+s.getName(t)}),i.addElementDependency(e,t),s.onValue(t,l);var d=function(){s.offValue(t,l),o.removeEventListener.call(e,"removed",d),i.deleteElementDependency(e,t)};o.addEventListener.call(e,"removed",d),l(s.getValue(t))}else{var p=i.getAttributeParts(t);for(var f in p)r.set(e,f,p[f])}}}),define("can-view-live/lib/html",["require","exports","module","can-view-live/lib/core","can-view-nodelist","can-util/dom/frag/frag","can-util/js/make-array/make-array","can-util/dom/child-nodes/child-nodes","can-reflect"],function(e,t,n){var i=e("can-view-live/lib/core"),a=e("can-view-nodelist"),r=e("can-util/dom/frag/frag"),o=e("can-util/js/make-array/make-array"),s=e("can-util/dom/child-nodes/child-nodes"),c=e("can-reflect");i.html=function(e,t,n,l){function u(e){a.first(f).parentNode&&p(e);var t=a.first(f).parentNode;d.teardownCheck(t)}var d,p,f;n=i.getParentNode(e,n),Object.defineProperty(u,"name",{value:"live.html update::"+c.getName(t)}),d=i.listen(n,t,u),f=l||[e],p=function(e){var t="function"==typeof e,n=r(t?"":e),c=o(f);i.addTextNodeIfNoChildren(n),c=a.update(f,s(n)),t&&e(n.firstChild),a.replace(c,n)},d.nodeList=f,l?l.unregistered=d.teardownCheck:a.register(f,d.teardownCheck),p(c.getValue(t))}}),define("can-view-live/lib/set-observable",["require","exports","module","can-simple-observable","can-reflect"],function(e,t,n){function i(e,t){this.setter=t,a.call(this,e)}var a=e("can-simple-observable"),r=e("can-reflect");(i.prototype=Object.create(a.prototype)).constructor=i,i.prototype.set=function(e){this.setter(e)},r.assignSymbols(i.prototype,{"can.setValue":i.prototype.set}),n.exports=i}),define("can-view-live/lib/patcher",["require","exports","module","can-reflect","can-key-tree","can-symbol","can-util/js/diff/diff","can-queues","can-symbol"],function(e,t,n){var i=e("can-reflect"),a=e("can-key-tree"),r=e("can-symbol"),o=e("can-util/js/diff/diff"),s=e("can-queues"),c=(r=e("can-symbol")).for("can.onValue"),l=r.for("can.offValue"),u=r.for("can.onPatches"),d=r.for("can.offPatches"),p=function(e,t){this.handlers=new a([Object,Array],{onFirst:this.setup.bind(this),onEmpty:this.teardown.bind(this)}),this.observableOrList=e,this.isObservableValue=i.isValueLike(this.observableOrList)||i.isObservableLike(this.observableOrList),this.isObservableValue?this.priority=i.getPriority(e):this.priority=t||0,this.onList=this.onList.bind(this),this.onPatchesNotify=this.onPatchesNotify.bind(this),this.onPatchesDerive=this.onPatchesDerive.bind(this),this.patches=[],Object.defineProperty(this.onList,"name",{value:"live.list new list::"+i.getName(e)}),Object.defineProperty(this.onPatchesNotify,"name",{value:"live.list notify::"+i.getName(e)}),Object.defineProperty(this.onPatchesDerive,"name",{value:"live.list derive::"+i.getName(e)})};p.prototype={constructor:p,setup:function(){this.observableOrList[c]?(i.onValue(this.observableOrList,this.onList,"notify"),this.setupList(i.getValue(this.observableOrList))):this.setupList(this.observableOrList||[])},teardown:function(){this.observableOrList[l]&&i.offValue(this.observableOrList,this.onList,"notify")},setupList:function(e){this.currentList=e,e[u]&&e[u](this.onPatchesNotify,"notify")},onList:function(e){var t=this.currentList||[];e=e||[],t[d]&&t[d](this.onPatchesNotify,"notify");var n=o(t,e);this.currentList=e,this.onPatchesNotify(n),e[u]&&e[u](this.onPatchesNotify,"notify")},onPatchesNotify:function(e){this.patches.push.apply(this.patches,e),s.deriveQueue.enqueue(this.onPatchesDerive,this,[],{priority:this.priority})},onPatchesDerive:function(){var e=this.patches;this.patches=[],s.enqueueByQueue(this.handlers.getNode([]),this.currentList,[e,this.currentList],null,["Apply patches",e])}},i.assignSymbols(p.prototype,{"can.onPatches":function(e,t){this.handlers.add([t||"mutate",e])},"can.offPatches":function(e,t){this.handlers.delete([t||"mutate",e])}}),n.exports=p}),define("can-view-live/lib/list",["require","exports","module","can-view-live/lib/core","can-view-nodelist","can-util/dom/frag/frag","can-util/dom/mutate/mutate","can-util/dom/child-nodes/child-nodes","can-util/js/make-array/make-array","can-util/js/each/each","can-reflect","can-symbol","can-simple-observable","can-view-live/lib/set-observable","can-view-live/lib/patcher"],function(e,t,n){function i(e,t,n,i,o,s,c){this.patcher=new v(t),o=a.getParentNode(e,o),this.value=t,this.render=n,this.context=i,this.parentNode=o,this.falseyRender=c,this.masterNodeList=s||r.register([e],null,!0),this.placeholder=e,this.indexMap=[],this.isValueLike=d.isValueLike(this.value),this.isObservableLike=d.isObservableLike(this.value),this.onPatches=this.onPatches.bind(this);var l=this.data=a.setup(o,this.setupValueBinding.bind(this),this.teardownValueBinding.bind(this));this.masterNodeList.unregistered=function(){l.teardownCheck()},Object.defineProperty(this.onPatches,"name",{value:"live.list update::"+d.getName(t)})}var a=e("can-view-live/lib/core"),r=e("can-view-nodelist"),o=e("can-util/dom/frag/frag"),s=e("can-util/dom/mutate/mutate"),c=e("can-util/dom/child-nodes/child-nodes"),l=e("can-util/js/make-array/make-array"),u=e("can-util/js/each/each"),d=e("can-reflect"),p=e("can-symbol"),f=e("can-simple-observable"),h=e("can-view-live/lib/set-observable"),v=e("can-view-live/lib/patcher"),m=[].splice,g=function(e,t,n,i,a){var s=[];t&&(r.register(s,null,t,!0),s.parentList=t,s.expression="#each SUBEXPRESSION");var u=n.apply(i,a.concat([s])),d=o(u),p=l(c(d));return t?(r.update(s,p),e.push(s)):e.push(r.register(p)),d},y=function(e,t,n){var i=e.splice(t+1,n),a=[];return u(i,function(e){var t=r.unregister(e);[].push.apply(a,t)}),a},b=p.for("can.onPatches"),w=p.for("can.offPatches"),b=p.for("can.onPatches"),w=p.for("can.offPatches");i.prototype={setupValueBinding:function(){this.patcher[b](this.onPatches,"domUI"),this.patcher.currentList&&this.patcher.currentList.length?this.onPatches([{insert:this.patcher.currentList,index:0,deleteCount:0}]):this.addFalseyIfEmpty(),a.addElementDependency(this.parentNode,this.patcher.observableOrList)},teardownValueBinding:function(){this.patcher[w](this.onPatches,"domUI"),this.exit=!0,this.remove({length:this.patcher.currentList.length},0,!0),a.deleteElementDependency(this.parentNode,this.patcher.observableOrList)},onPatches:function(e){if(!this.exit)for(var t=0,n=e.length;t<n;t++){var i=e[t];"move"===i.type?this.move(i.toIndex,i.fromIndex):(i.deleteCount&&this.remove({length:i.deleteCount},i.index,!0),i.insert&&i.insert.length&&this.add(i.insert,i.index))}},add:function(e,t){var n=this.placeholder.ownerDocument.createDocumentFragment(),i=[],a=[],o=this.masterNodeList,c=this.render,l=this.context;u(e,function(e,r){var s=new f(r+t),u=new h(e,function(e){d.setKeyValue(this.patcher.currentList,s.get(),e)}.bind(this)),p=g(i,o,c,l,[u,s]);n.appendChild(p),a.push(s)},this);var p=t+1;if(!this.indexMap.length){var v=y(o,0,o.length-1);r.remove(v)}if(o[p]){var b=r.first(o[p]);s.insertBefore.call(b.parentNode,n,b)}else r.after(1===p?[this.placeholder]:[r.last(this.masterNodeList[p-1])],n);m.apply(this.masterNodeList,[p,0].concat(i)),m.apply(this.indexMap,[t,0].concat(a));for(var w=t+a.length,k=this.indexMap.length;w<k;w++)this.indexMap[w].set(w)},remove:function(e,t){t<0&&(t=this.indexMap.length+t);var n=y(this.masterNodeList,t,e.length),i=this.indexMap;i.splice(t,e.length);for(var a=t,o=i.length;a<o;a++)i[a].set(a);this.exit?r.unregister(this.masterNodeList):(this.addFalseyIfEmpty(),r.remove(n))},addFalseyIfEmpty:function(){if(this.falseyRender&&0===this.indexMap.length){var e=[],t=g(e,this.masterNodeList,this.falseyRender,this.currentList,[this.currentList]);r.after([this.masterNodeList[0]],t),this.masterNodeList.push(e[0])}},move:function(e,t){e+=1,t+=1;var n,i=this.masterNodeList,a=this.indexMap,s=i[e],c=o(r.flatten(i[t]));n=t<e?r.last(s).nextSibling:r.first(s),i[0].parentNode.insertBefore(c,n);var l=i[t];[].splice.apply(i,[t,1]),[].splice.apply(i,[e,0,l]),e-=1;var u=a[t-=1];[].splice.apply(a,[t,1]),[].splice.apply(a,[e,0,u]);var d=Math.min(t,e),p=a.length;for(p;d<p;d++)a[d].set(d)},set:function(e,t){this.remove({length:1},t,!0),this.add([e],t)}},a.list=function(e,t,n,a,o,s,c){if(e.nodeType!==Node.TEXT_NODE){var l;s?(l=document.createTextNode(""),r.replace(s,l),r.update(s,[l]),e=l):(l=document.createTextNode(""),e.replaceWith(l),e=l)}new i(e,t,n,a,o,s,c)}}),define("can-view-live/lib/text",["require","exports","module","can-view-live/lib/core","can-view-nodelist","can-reflect"],function(e,t,n){var i=e("can-view-live/lib/core"),a=e("can-view-nodelist"),r=e("can-reflect");i.text=function(e,t,n,o){function s(t){e.nodeValue=i.makeString(t)}if(e.nodeType!==Node.TEXT_NODE){var c;o?(c=document.createTextNode(""),a.replace(o,c),a.update(o,[c]),e=c):(c=document.createTextNode(""),e.replaceWith(c),e=c)}var l=i.getParentNode(e,n);e.nodeValue=i.makeString(r.getValue(t)),Object.defineProperty(s,"name",{value:"live.text update::"+r.getName(t)});var u=i.listen(l,t,s);o||(o=a.register([e],null,!0)),o.unregistered=u.teardownCheck,u.nodeList=o}}),define("can-view-live",["require","exports","module","can-view-live/lib/core","can-view-live/lib/attr","can-view-live/lib/attrs","can-view-live/lib/html","can-view-live/lib/list","can-view-live/lib/text"],function(e,t,n){var i=e("can-view-live/lib/core");e("can-view-live/lib/attr"),e("can-view-live/lib/attrs"),e("can-view-live/lib/html"),e("can-view-live/lib/list"),e("can-view-live/lib/text"),n.exports=i}),define("can-util/js/base-url/base-url",["require","exports","module","can-globals/global/global","can-globals/document/document"],function(e,t,n){!function(e,t,n,i){"use strict";var a,r=t("can-globals/global/global"),o=t("can-globals/document/document");i.exports=function(e){if(void 0!==e&&(a=e),void 0!==a)return a;var t=r(),n=o();if(n&&"baseURI"in n)return n.baseURI;if(t.location){var i=t.location.href,s=i.lastIndexOf("/");return-1!==s?i.substr(0,s):i}return"undefined"!=typeof process?process.cwd():void 0}}(0,e,0,n)}),define("can-parse-uri",function(e,t,n){n.exports=function(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}}),define("can-util/js/join-uris/join-uris",["require","exports","module","can-parse-uri"],function(e,t,n){"use strict";var i=e("can-parse-uri");n.exports=function(e,t){return t=i(t||""),e=i(e||""),t&&e?(t.protocol||e.protocol)+(t.protocol||t.authority?t.authority:e.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(t.protocol||t.authority||"/"===t.pathname.charAt(0)?t.pathname:t.pathname?(e.authority&&!e.pathname?"/":"")+e.pathname.slice(0,e.pathname.lastIndexOf("/")+1)+t.pathname:e.pathname)+(t.protocol||t.authority||t.pathname?t.search:t.search||e.search)+t.hash:null}}),define("can-stache/helpers/-debugger",["require","exports","module","can-util/js/log/log","can-reflect","can-symbol"],function(e,t,n){function i(){}var a=e("can-util/js/log/log"),r=i,o=i,s={},c=e("can-reflect"),l=e("can-symbol");s={allowDebugger:!0},r=function(e){return e&&e[l.for("can.getValue")]?c.getValue(e):e},o=function(e,t){switch(arguments.length){case 0:return!0;case 1:return!!r(e);case 2:return r(e)===r(t);default:throw a.log(["Usage:"," {{debugger}}: break any time this helper is evaluated"," {{debugger condition}}: break when `condition` is truthy"," {{debugger left right}}: break when `left` === `right`"].join("\n")),new Error("{{debugger}} must have less than three arguments")}},n.exports={helper:function(e,t){o.apply(null,Array.prototype.slice.call(arguments,0,-1))&&(arguments[arguments.length-1],a.log("Use `get(<path>)` to debug this template"),s.allowDebugger||a.warn("Forgotten {{debugger}} helper"))},evaluateArgs:o,resolveValue:r,__testing:s}}),define("can-stache/src/truthy-observable",["require","exports","module","can-observation","can-reflect"],function(e,t,n){var i=e("can-observation"),a=e("can-reflect");n.exports=function(e){return new i(function(){return!!a.getValue(e)})}}),define("can-stache/helpers/core",["require","exports","module","can-view-live","can-view-nodelist","can-stache/src/utils","can-util/js/is-function/is-function","can-util/js/base-url/base-url","can-util/js/join-uris/join-uris","can-util/js/each/each","can-util/js/assign/assign","can-util/js/is-iterable/is-iterable","can-util/js/dev/dev","can-symbol","can-reflect","can-util/js/is-empty-object/is-empty-object","can-stache/helpers/-debugger","can-stache/src/key-observable","can-observation","can-stache/src/truthy-observable","can-util/dom/data/data"],function(e,t,n){var i=e("can-view-live"),a=e("can-view-nodelist"),r=e("can-stache/src/utils"),o=e("can-util/js/is-function/is-function"),s=e("can-util/js/base-url/base-url"),c=e("can-util/js/join-uris/join-uris"),l=e("can-util/js/each/each"),u=e("can-util/js/assign/assign"),d=e("can-util/js/is-iterable/is-iterable"),p=e("can-util/js/dev/dev"),f=e("can-symbol"),h=e("can-reflect"),v=e("can-util/js/is-empty-object/is-empty-object"),m=e("can-stache/helpers/-debugger").helper,g=e("can-stache/src/key-observable"),y=e("can-observation"),b=e("can-stache/src/truthy-observable"),w=e("can-util/dom/data/data"),k=function(e){return e&&"function"==typeof e.fn&&"function"==typeof e.inverse},x=f.for("can.getValue"),j=f.for("can.isValueLike"),L=function(e){return e&&e[j]&&e[x]?e[x]():e},E={each:function(e){var t,n,o,s,c=[].slice.call(arguments),u=c.pop(),f=c.length,m=u.exprData.argExprs,y=u.exprData.hashExprs,b=L(e);if((2===f||3===f&&"as"===m[1].key)&&("string"!=typeof(t=c[f-1])&&(t=m[f-1].key),p.warn("can-stache: Using the `as` keyword is deprecated in favor of hash expressions. https://canjs.com/doc/can-stache.helpers.each.html"),p.warn("can-stache: Do not use `{{#"+u.nodeList.expression+"}}`, instead use `{{#"+u.nodeList.expression.split(" ")[0]+" "+u.nodeList.expression.split(" ")[1]+" "+t+"=value}}`")),v(y)||(n={},l(y,function(e,t){n[e.key]=t})),(h.isObservableLike(b)&&h.isListLike(b)||r.isArrayLike(b)&&e.isComputed)&&!u.stringOnly)return function(r){var o=[r];o.expression="live.list",a.register(o,null,u.nodeList,!0),a.update(u.nodeList,[r]);i.list(r,e,function(e,i,a){var r={"%index":i};return t&&(r[t]=e),v(n)||(n.value&&(r[n.value]=e),n.index&&(r[n.index]=i)),u.fn(u.scope.add(r,{notContext:!0}).add(e),u.options,a)},u.context,r.parentNode,o,function(e,t){return u.inverse(u.scope.add(e),u.options,t)})};var w,k=b;if(k&&r.isArrayLike(k))return w=r.getItemsFragContent(k,u,u.scope,t),u.stringOnly?w.join(""):w;if(d(k))return w=[],l(k,function(e,i){o={"%key":i},t&&(o[t]=e),v(n)||(n.value&&(o[n.value]=e),n.key&&(o[n.key]=i)),w.push(u.fn(u.scope.add(o,{notContext:!0}).add(e)))}),u.stringOnly?w.join(""):w;if(h.isObservableLike(k)&&h.isMapLike(k))return w=[],h.each(k,function(e,n){var i=new g(k,n);o={"%key":n},t&&(o[t]=k[n]),w.push(u.fn(u.scope.add(o,{notContext:!0}).add(i)))}),u.stringOnly?w.join(""):w;if(k instanceof Object){w=[];for(s in k)o={"%key":s},t&&(o[t]=k[s]),w.push(u.fn(u.scope.add(o,{notContext:!0}).add(k[s])));return u.stringOnly?w.join(""):w}},"%index":function(e,t){t||(t=e,e=0);var n=t.scope.peek("%index");return""+((o(n)?n():n)+e)},if:function(e,t){return(e&&e.isComputed?h.getValue(new b(e)):!!L(e))?t.fn(t.scope||this):t.inverse(t.scope||this)},is:function(){var e,t,n=arguments[arguments.length-1];if(arguments.length-2<=0)return n.inverse();var i=arguments;return new y(function(){for(var n=0;n<i.length-1;n++){if(t=L(i[n]),t=o(t)?t():t,n>0&&t!==e)return!1;e=t}return!0}).get()?n.fn():n.inverse()},eq:function(){return E.is.apply(this,arguments)},unless:function(e,t){return E.if.apply(this,[e,u(u({},t),{fn:t.inverse,inverse:t.fn})])},with:function(e,t){var n=e;return t?(e=L(e),t.hash&&!v(t.hash)&&(n=t.scope.add(t.hash).add(n))):(t=e,e=!0,n=t.hash),t.fn(n||{})},log:function(e){var t=[];l(arguments,function(e){k(e)||t.push(e)}),"undefined"!=typeof console&&console.log&&(t.length?console.log.apply(console,t):console.log(e.context))},data:function(e){var t=2===arguments.length?this:arguments[1];return function(n){w.set.call(n,e,t||this.context)}},switch:function(e,t){L(e);var n=!1,i=t.helpers.add({case:function(t,i){if(!n&&L(e)===L(t))return n=!0,i.fn(i.scope||this)},default:function(e){if(!n)return e.fn(e.scope||this)}});return t.fn(t.scope,i)},joinBase:function(e){var t=[].slice.call(arguments),n=t.pop(),i=t.map(function(e){var t=L(e);return o(t)?t():t}).join(""),a=n.helpers.peek("helpers.module"),r=a?a.uri:void 0;if("."===i[0]&&r)return c(r,i);var l="undefined"!=typeof System&&(System.renderingBaseURL||System.baseURL)||s();return"/"!==i[0]&&"/"!==l[l.length-1]&&(l+="/"),c(l,i)}};E.eachOf=E.each,E.debugger=m;var V=function(e,t){E[e]&&p.warn("The helper "+e+" has already been registered."),E[e]=t},O=function(e){return function(){var t=[];return l(arguments,function(e){for(;e&&e.isComputed;)e=e();t.push(e)}),e.apply(this,t)}};n.exports={registerHelper:V,registerSimpleHelper:function(e,t){V(e,O(t))},getHelper:function(e,t){var n=t&&t.get&&t.get("helpers."+e,{proxyMethods:!1});if(n||(n=E[e]),n)return{fn:n}},resolve:L,resolveHash:function(e){var t={};for(var n in e)t[n]=L(e[n]);return t},looksLikeOptions:k}}),define("can-util/js/last/last",function(e,t,n){"use strict";n.exports=function(e){return e&&e[e.length-1]}}),define("can-simple-observable/setter/setter",["require","exports","module","can-reflect","can-observation","can-key-tree","can-simple-observable/settable/settable"],function(e,t,n){function i(e,t){this.handlers=new o([Object,Array],{onFirst:this.setup.bind(this),onEmpty:this.teardown.bind(this)}),this.setter=t,this.observation=new r(e),this.handler=this.handler.bind(this),a.assignSymbols(this,{"can.getName":function(){return a.getName(this.constructor)+"<"+a.getName(e)+">"}}),Object.defineProperty(this.handler,"name",{value:a.getName(this)+".handler"})}var a=e("can-reflect"),r=e("can-observation"),o=e("can-key-tree"),s=e("can-simple-observable/settable/settable");(i.prototype=Object.create(s.prototype)).constructor=i,i.prototype.set=function(e){this.setter(e)},i.prototype.hasDependencies=function(){return a.valueHasDependencies(this.observation)},a.assignSymbols(i.prototype,{"can.setValue":i.prototype.set,"can.valueHasDependencies":i.prototype.hasDependencies}),n.exports=i}),define("can-stache/src/expression",["require","exports","module","can-stache-key","can-stache/src/utils","can-stache/helpers/core","can-util/js/each/each","can-util/js/is-empty-object/is-empty-object","can-util/js/dev/dev","can-util/js/assign/assign","can-util/js/last/last","can-reflect","can-symbol","can-observation","can-simple-observable/setter/setter","can-view-scope/make-compute-like"],function(e,t,n){var i=e("can-stache-key"),a=e("can-stache/src/utils"),r=e("can-stache/helpers/core"),o=e("can-util/js/each/each"),s=e("can-util/js/is-empty-object/is-empty-object"),c=e("can-util/js/dev/dev"),l=e("can-util/js/assign/assign"),u=e("can-util/js/last/last"),d=e("can-reflect"),p=e("can-symbol"),f=e("can-observation"),h=e("can-simple-observable/setter/setter"),v=e("can-view-scope/make-compute-like"),m=p.for("can-stache.sourceText"),g=function(e,t,n){var i=t.computeData(e,n);return f.temporarilyBind(i),i},y=function(e){return e[p.for("can.valueHasDependencies")]?d.valueHasDependencies(e):e.computeInstance.hasDependencies},b=function(e,t,n,i){var a=g(e,t,i),o={value:a};if(void 0===a.initialValue){"@"===e.charAt(0)&&(e=e.substr(1));var s=r.getHelper(e,n);o.helper=s&&s.fn}return o},w=function(e,t,n,a){var r=function(){return(""+d.getValue(e)).replace(".","\\.")},o=new h(function(){return i.get(d.getValue(t),r())},function(e){i.write(d.getValue(t),i.reads(r()),e)});return f.temporarilyBind(o),o},k=function(e){return e instanceof C||e instanceof E?e:new C(e)},x=function(e){return d.isObservableLike(e)?!1===d.valueHasDependencies(e)?d.getValue(e):e.compute?e.compute:v(e):e},j=function(e){return e?e.isComputed?e:e.compute?e.compute:v(e):e},L=function(e,t){this.root=t,this.key=e};L.prototype.value=function(e,t){var n=this.root?this.root.value(e,t):e.peek(".");return w(this.key.value(e,t),n,0,0)},L.prototype.sourceText=function(){return this.rootExpr?this.rootExpr.sourceText()+"["+this.key+"]":"["+this.key+"]"};var E=function(e){this._value=e};E.prototype.value=function(){return this._value},E.prototype.sourceText=function(){return JSON.stringify(this._value)};var V=function(e,t,n){this.key=e,this.rootExpr=t,d.setKeyValue(this,m,n)};V.prototype.value=function(e,t){if(this.rootExpr)return w(this.key,this.rootExpr.value(e,t),0,0);var n=b(this.key,e,t);return this.isHelper=n.helper&&!n.helper.callAsMethod,n.helper||n.value},V.prototype.sourceText=function(){return this[m]?this[m]:this.rootExpr?this.rootExpr.sourceText()+"."+this.key:this.key};var O=function(e,t){V.apply(this,arguments)};O.prototype.value=function(e,t){return this.rootExpr?w(this.key,this.rootExpr.value(e,t),0,0):g(this.key,e,t)},O.prototype.sourceText=V.prototype.sourceText;var C=function(e,t){this.expr=e,this.modifiers=t||{},this.isCompute=!1};C.prototype.value=function(){return this.expr.value.apply(this.expr,arguments)},C.prototype.sourceText=function(){return(this.modifiers.compute?"~":"")+this.expr.sourceText()};var _=function(e){this.hashExprs=e};_.prototype.value=function(e,t){var n={};for(var i in this.hashExprs){var a=k(this.hashExprs[i]),r=a.value.apply(a,arguments);n[i]={call:!a.modifiers||!a.modifiers.compute,value:r}}return new f(function(){var e={};for(var t in n)e[t]=n[t].call?d.getValue(n[t].value):x(n[t].value);return e})},_.prototype.sourceText=function(){var e=[];return o(this.hashExprs,function(t,n){e.push(n+"="+t.sourceText())}),e.join(" ")};var D=function(e,t){this.methodExpr=e,this.argExprs=t.map(k)};D.prototype.args=function(e,t){for(var n=[],i=0,a=this.argExprs.length;i<a;i++){var r=this.argExprs[i],o=r.value.apply(r,arguments);n.push({call:!r.modifiers||!r.modifiers.compute,value:o})}return function(){for(var e=[],t=0,i=n.length;t<i;t++)e[t]=n[t].call?d.getValue(n[t].value):j(n[t].value);return e}},D.prototype.value=function(e,t,n){var i=this.methodExpr.value(e,t),a=this.isHelper=this.methodExpr.isHelper,r=this.args(e,t),o=function(e){var t=d.getValue(i);if("function"==typeof t){var o=r();return a&&n&&o.push(n),arguments.length&&o.unshift(new W.SetIdentifier(e)),t.apply(null,o)}};Object.defineProperty(o,"name",{value:"{{"+this.sourceText()+"}}"});var s=new h(o,o);return f.temporarilyBind(s),s},D.prototype.sourceText=function(){var e=this.argExprs.map(function(e){return e.sourceText()});return this.methodExpr.sourceText()+"("+e.join(",")+")"},D.prototype.closingTag=function(){return this.methodExpr[m]?this.methodExpr[m]:this.methodExpr.key};var S=function(){V.apply(this,arguments)};S.prototype.value=function(e,t){var n=b(this.key,e,t,{isArgument:!0,args:[e.peek("."),e]});return n.helper||n.value},S.prototype.sourceText=V.prototype.sourceText;var T=function(){V.apply(this,arguments)};T.prototype.value=function(e,t){return g(this.key,e,{callMethodsOnObservables:!0,isArgument:!0,args:[e.peek("."),e]})},T.prototype.sourceText=V.prototype.sourceText;var N=function(e,t,n){this.methodExpr=e,this.argExprs=t,this.hashExprs=n,this.mode=null};N.prototype.args=function(e,t){for(var n=[],i=0,a=this.argExprs.length;i<a;i++){var r=this.argExprs[i];n.push(x(r.value.apply(r,arguments)))}return n},N.prototype.hash=function(e,t){var n={};for(var i in this.hashExprs){var a=this.hashExprs[i];n[i]=x(a.value.apply(a,arguments))}return n},N.prototype.helperAndValue=function(e,t){function n(){return a.initialValue.apply(null,o)}var i,a,o,l=this.argExprs.length||!s(this.hashExprs),u=this.methodExpr instanceof E?""+this.methodExpr._value:this.methodExpr.key;if(l&&(i=r.getHelper(u,t)),!i){if("function"==typeof(a=g(u,e,{isArgument:!0})).initialValue){o=this.args(e,t).map(x),Object.defineProperty(n,"name",{value:d.getName(this)});var p=new f(n);return f.temporarilyBind(p),{value:p}}if(void 0!==a.initialValue)return{value:a};l||(i=r.getHelper(u,t))}return i||(l?c.warn('can-stache/src/expression.js: Unable to find helper "'+u+'".'):c.warn('can-stache/src/expression.js: Unable to find key or helper "'+u+'".')),{value:a,args:o,helper:i&&i.fn}},N.prototype.evaluator=function(e,t,n,i,r,o,s,c){var u={stringOnly:c},d=t.peek("."),p=this.args(t,n,r,o,s,c),f=this.hash(t,n,r,o,s,c);return a.convertToScopes(u,t,n,r,o,s,c),l(u,{context:d,scope:t,contexts:t,hash:f,nodeList:r,exprData:this,helperOptions:n,helpers:n}),p.push(u),function(){return e.apply(d,p)}},N.prototype.value=function(e,t,n,i,a,r){var o=this.helperAndValue(e,t),s=o.helper;if(!s)return o.value;var c=this.evaluator(s,e,t,n,i,a,r),l=new f(c);return f.temporarilyBind(l),y(l)?l:l()},N.prototype.closingTag=function(){return this.methodExpr.key},N.prototype.sourceText=function(){var e=[this.methodExpr.sourceText()];return this.argExprs.length&&e.push(this.argExprs.map(function(e){return e.sourceText()}).join(" ")),s(this.hashExprs)||e.push(_.prototype.sourceText.call(this)),e.join(" ")},d.assignSymbols(N.prototype,{"can.getName":function(){return d.getName(this.constructor)+"{{"+this.sourceText()+"}}"}});var P=/[\w\.\\\-_@\/\&%]+/,M=/('.*?'|".*?"|=|[\w\.\\\-_@\/*%\$]+|[\(\)]|,|\~|\[|\]\s*|\s*(?=\[))/g,A=/\]\s+/,q=/^('.*?'|".*?"|[0-9]+\.?[0-9]*|true|false|null|undefined)$/,K=function(e){return P.test(e)},R=/^[\.@]\w/,I=function(e){return K(e)&&R.test(e)},H=function(e){return e.children||(e.children=[]),e},B=function(){this.root={children:[],type:"Root"},this.current=this.root,this.stack=[this.root]};l(B.prototype,{top:function(){return u(this.stack)},isRootTop:function(){return this.top()===this.root},popTo:function(e){this.popUntil(e),this.pop()},pop:function(){this.isRootTop()||this.stack.pop()},first:function(e){for(var t=this.stack.length-1;t>0&&-1===e.indexOf(this.stack[t].type);)t--;return this.stack[t]},firstParent:function(e){for(var t=this.stack.length-2;t>0&&-1===e.indexOf(this.stack[t].type);)t--;return this.stack[t]},popUntil:function(e){for(;-1===e.indexOf(this.top().type)&&!this.isRootTop();)this.stack.pop();return this.top()},addTo:function(e,t){var n=this.popUntil(e);H(n).children.push(t)},addToAndPush:function(e,t){this.addTo(e,t),this.stack.push(t)},push:function(e){this.stack.push(e)},topLastChild:function(){return u(this.top().children)},replaceTopLastChild:function(e){var t=H(this.top()).children;return t.pop(),t.push(e),e},replaceTopLastChildAndPush:function(e){this.replaceTopLastChild(e),this.stack.push(e)},replaceTopAndPush:function(e){var t;return this.top()===this.root?t=H(this.top()).children:(this.stack.pop(),t=H(this.top()).children),t.pop(),t.push(e),this.stack.push(e),e}});var F=function(e){var t=e.lastIndexOf("./"),n=e.lastIndexOf(".");if(n>t)return e.substr(0,n)+"@"+e.substr(n+1);var i=-1===t?0:t+2,a=e.charAt(i);return"."===a||"@"===a?e.substr(0,i)+"@"+e.substr(i+1):e.substr(0,i)+"@"+e.substr(i)},z=function(e){return"Lookup"===e.type&&(d.setKeyValue(e,m,e.key),e.key=F(e.key)),e},U=function(e){var t=e.top();if(t&&"Lookup"===t.type){var n=e.stack[e.stack.length-2];"Helper"!==n.type&&n&&e.replaceTopAndPush({type:"Helper",method:t})}},W={toComputeOrValue:x,convertKeyToLookup:F,Literal:E,Lookup:V,ScopeLookup:O,Arg:C,Hash:function(){},Hashes:_,Call:D,Helper:N,HelperLookup:S,HelperScopeLookup:T,Bracket:L,SetIdentifier:function(e){this.value=e},tokenize:function(e){var t=[];return(e.trim()+" ").replace(M,function(e,n){A.test(n)?(t.push(n[0]),t.push(n.slice(1))):t.push(n)}),t},lookupRules:{default:function(e,t,n){var i=("Helper"!==t||e.root?"":"Helper")+(n?"Scope":"")+"Lookup";return W[i]},method:function(e,t,n){return O}},methodRules:{default:function(e){return"Call"===e.type?D:N},call:function(e){return D}},parse:function(e,t){t=t||{};var n=this.ast(e);return t.lookupRule||(t.lookupRule="default"),"string"==typeof t.lookupRule&&(t.lookupRule=W.lookupRules[t.lookupRule]),t.methodRule||(t.methodRule="default"),"string"==typeof t.methodRule&&(t.methodRule=W.methodRules[t.methodRule]),this.hydrateAst(n,t,t.baseMethodType||"Helper")},hydrateAst:function(e,t,n,i){var a;if("Lookup"===e.type)return new(t.lookupRule(e,n,i))(e.key,e.root&&this.hydrateAst(e.root,t,n),e[m]);if("Literal"===e.type)return new E(e.value);if("Arg"===e.type)return new C(this.hydrateAst(e.children[0],t,n,i),{compute:!0});if("Hash"===e.type)throw new Error("");if("Hashes"===e.type)return a={},o(e.children,function(e){a[e.prop]=this.hydrateAst(e.children[0],t,n,!0)},this),new _(a);if("Call"===e.type||"Helper"===e.type){a={};var r=[],s=e.children,c=t.methodRule(e);if(s)for(var l=0;l<s.length;l++){var u=s[l];"Hashes"===u.type&&"Helper"===e.type&&c!==D?o(u.children,function(n){a[n.prop]=this.hydrateAst(n.children[0],t,e.type,!0)},this):r.push(this.hydrateAst(u,t,e.type,!0))}return new c(this.hydrateAst(e.method,t,e.type),r,a)}return"Bracket"===e.type?new L(this.hydrateAst(e.children[0],t),e.root?this.hydrateAst(e.root,t):void 0):void 0},ast:function(e){var t=this.tokenize(e);return this.parseAst(t,{index:0})},parseAst:function(e,t){for(var n,i,r,o=new B;t.index<e.length;){var s=e[t.index],c=e[t.index+1];if(t.index++,"="===c){(n=o.top())&&"Lookup"===n.type&&("Call"!==(i=o.firstParent(["Call","Helper","Hash"])).type&&"Root"!==i.type||(o.popUntil(["Call"]),n=o.top(),o.replaceTopAndPush({type:"Helper",method:"Root"===n.type?u(n.children):n})));var l={type:"Hash",prop:s};"Hashes"===(i=o.firstParent(["Call","Helper","Hashes"])).type?o.addToAndPush(["Hashes"],l):(o.addToAndPush(["Helper","Call"],{type:"Hashes",children:[l]}),o.push(l)),t.index++}else if(q.test(s))U(o),"Hash"===(i=o.first(["Helper","Call","Hash","Bracket"])).type&&i.children&&i.children.length>0?o.addTo(["Helper","Call","Bracket"],{type:"Literal",value:a.jsonParse(s)}):"Bracket"===i.type&&i.children&&i.children.length>0?o.addTo(["Helper","Call","Hash"],{type:"Literal",value:a.jsonParse(s)}):o.addTo(["Helper","Call","Hash","Bracket"],{type:"Literal",value:a.jsonParse(s)});else if(P.test(s))r=o.topLastChild(),i=o.first(["Helper","Call","Hash","Bracket"]),r&&("Call"===r.type||"Bracket"===r.type)&&I(s)?o.replaceTopLastChildAndPush({type:"Lookup",root:r,key:s.slice(1)}):"Bracket"===i.type?i.children&&i.children.length>0?"Helper"===o.first(["Helper","Call","Hash","Arg"]).type&&"."!==s[0]?o.addToAndPush(["Helper"],{type:"Lookup",key:s}):o.replaceTopAndPush({type:"Lookup",key:s.slice(1),root:i}):o.addToAndPush(["Bracket"],{type:"Lookup",key:s}):(U(o),o.addToAndPush(["Helper","Call","Hash","Arg","Bracket"],{type:"Lookup",key:s}));else if("~"===s)U(o),o.addToAndPush(["Helper","Call","Hash"],{type:"Arg",key:s});else if("("===s){if("Lookup"!==(n=o.top()).type)throw new Error("Unable to understand expression "+e.join(""));o.replaceTopAndPush({type:"Call",method:z(n)})}else")"===s?o.popTo(["Call"]):","===s?o.popUntil(["Call"]):"["===s?(n=o.top(),!(r=o.topLastChild())||"Call"!==r.type&&"Bracket"!==r.type?"Lookup"===n.type||"Bracket"===n.type?o.replaceTopAndPush({type:"Bracket",root:n}):"Call"===n.type?o.addToAndPush(["Call"],{type:"Bracket"}):" "===n?(o.popUntil(["Lookup"]),U(o),o.addToAndPush(["Helper","Call","Hash"],{type:"Bracket"})):o.replaceTopAndPush({type:"Bracket"}):o.replaceTopAndPush({type:"Bracket",root:r})):"]"===s?o.pop():" "===s&&o.push(s)}return o.root.children[0]}};n.exports=W}),define("can-util/dom/document/document",["require","exports","module","can-globals/document/document"],function(e,t,n){!function(e,t,n,i){"use strict";i.exports=t("can-globals/document/document")}(0,e,0,n)}),define("can-view-model",["require","exports","module","can-util/dom/data/data","can-simple-map","can-namespace","can-util/dom/document/document","can-util/js/is-array-like/is-array-like","can-reflect"],function(e,t,n){"use strict";var i=e("can-util/dom/data/data"),a=e("can-simple-map"),r=e("can-namespace"),o=e("can-util/dom/document/document"),s=e("can-util/js/is-array-like/is-array-like"),c=e("can-reflect");n.exports=r.viewModel=function(e,t,n){var r;if("string"==typeof e?e=o().querySelector(e):s(e)&&!e.nodeType&&(e=e[0]),c.isObservableLike(t)&&c.isMapLike(t))return i.set.call(e,"viewModel",t);switch((r=i.get.call(e,"viewModel"))||(r=new a,i.set.call(e,"viewModel",r)),arguments.length){case 0:case 1:return r;case 2:return c.getKeyValue(r,t);default:return c.setKeyValue(r,t,n),e}}}),define("can-dom-events/helpers/util",["require","exports","module","can-globals/document/document","can-globals/is-browser-window/is-browser-window"],function(e,t,n){!function(e,t,n,i){"use strict";function a(e){return e.ownerDocument||s()}function r(e){if(!e||!e.nodeName)return e===window;var t=e.nodeType;return t===Node.DOCUMENT_NODE||t===Node.ELEMENT_NODE}function o(e,t){var n=t.type,i="inserted"===n||"removed"===n,a=!!e.disabled;return i&&a}var s=t("can-globals/document/document"),c=t("can-globals/is-browser-window/is-browser-window"),l=!1;!function(){if(c()){var e="fix_synthetic_events_on_disabled_test",t=document.createElement("input");t.disabled=!0;var n=setTimeout(function(){l=!0},50),i=function i(){clearTimeout(n),t.removeEventListener(e,i)};t.addEventListener(e,i);try{var a=document.create("HTMLEvents");a.initEvent(e,!1),t.dispatchEvent(a)}catch(e){i(),l=!0}}}(),i.exports={createEvent:function(e,t,n,i){var r,o=a(e).createEvent("HTMLEvents");if("string"==typeof t)r=t;else{r=t.type;for(var s in t)void 0===o[s]&&(o[s]=t[s])}return void 0===n&&(n=!0),o.initEvent(r,n,i),o},addDomContext:function(e,t){return r(e)&&(t=Array.prototype.slice.call(t,0)).unshift(e),t},removeDomContext:function(e,t){return r(e)||(e=(t=Array.prototype.slice.call(t,0)).shift()),{context:e,args:t}},isDomEventTarget:r,getTargetDocument:a,forceEnabledForDispatch:function(e,t){return l&&o(e,t)}}}(0,e,0,n)}),define("can-dom-events/helpers/add-event-compat",["require","exports","module","can-dom-events/helpers/util"],function(e,t,n){"use strict";function i(e){return!!(e&&e.addEventListener&&e.removeEventListener&&e.dispatch)}function a(e){return"function"==typeof e.addEvent}var r=e("can-dom-events/helpers/util"),o=r.addDomContext,s=r.removeDomContext;n.exports=function(e,t,n){if(!i(e))throw new Error("addEventCompat() must be passed can-dom-events or can-util/dom/events/events");if(n=n||t.defaultEventType,a(e))return e.addEvent(t,n);var r=e._compatRegistry;if(r||(r=e._compatRegistry={}),r[n])return function(){};r[n]=t;var c={addEventListener:function(){var t=s(this,arguments);return e.addEventListener.apply(t.context,t.args)},removeEventListener:function(){var t=s(this,arguments);return e.removeEventListener.apply(t.context,t.args)},dispatch:function(){var t=s(this,arguments),n=t.args[0],i="object"==typeof n?n.args:[];return t.args.splice(1,0,i),e.dispatch.apply(t.context,t.args)}},l=!0,u=e.addEventListener,d=e.addEventListener=function(e){if(l&&e===n){var i=o(this,arguments);t.addEventListener.apply(c,i)}return u.apply(this,arguments)},p=e.removeEventListener,f=e.removeEventListener=function(e){if(l&&e===n){var i=o(this,arguments);t.removeEventListener.apply(c,i)}return p.apply(this,arguments)};return function(){l=!1,r[n]=null,e.addEventListener===d&&(e.addEventListener=u),e.removeEventListener===f&&(e.removeEventListener=p)}}}),define("can-event-dom-enter",["require","exports","module","can-dom-data-state","can-cid"],function(e,t,n){"use strict";function i(e){var t="Enter"===e.key,n=13===e.keyCode;return t||n}function a(e,t){return e+":"+c(t)}function r(e,t,n,i){var r=a(t,n);s.set.call(e,r,i)}function o(e,t,n){var i=a(t,n),r=s.get.call(e,i);return r&&s.clean.call(e,i),r}var s=e("can-dom-data-state"),c=e("can-cid");n.exports={defaultEventType:"enter",addEventListener:function(e,t,n){var a=function(e){if(i(e))return n.apply(this,arguments)};r(e,t,n,a),this.addEventListener(e,"keyup",a)},removeEventListener:function(e,t,n){var i=o(e,t,n);i&&this.removeEventListener(e,"keyup",i)}}}),define("can-event-dom-enter/compat",["require","exports","module","can-dom-events/helpers/add-event-compat","can-event-dom-enter"],function(e,t,n){var i=e("can-dom-events/helpers/add-event-compat"),a=e("can-event-dom-enter");n.exports=function(e,t){return i(e,a,t)}}),define("can-dom-events/helpers/make-event-registry",function(e,t,n){"use strict";function i(){this._registry={}}n.exports=function(){return new i},i.prototype.has=function(e){return!!this._registry[e]},i.prototype.get=function(e){return this._registry[e]},i.prototype.add=function(e,t){if(!e)throw new Error("An EventDefinition must be provided");if("function"!=typeof e.addEventListener)throw new TypeError("EventDefinition addEventListener must be a function");if("function"!=typeof e.removeEventListener)throw new TypeError("EventDefinition removeEventListener must be a function");if("string"!=typeof(t=t||e.defaultEventType))throw new TypeError("Event type must be a string, not "+t);if(this.has(t))throw new Error('Event "'+t+'" is already registered');this._registry[t]=e;var n=this;return function(){n._registry[t]=void 0}}}),define("can-dom-events",["require","exports","module","can-namespace","can-dom-events/helpers/util","can-dom-events/helpers/make-event-registry"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-namespace"),r=t("can-dom-events/helpers/util"),o={_eventRegistry:t("can-dom-events/helpers/make-event-registry")(),addEvent:function(e,t){return this._eventRegistry.add(e,t)},addEventListener:function(e,t){if(o._eventRegistry.has(t))return o._eventRegistry.get(t).addEventListener.apply(o,arguments);var n=Array.prototype.slice.call(arguments,1);return e.addEventListener.apply(e,n)},removeEventListener:function(e,t){if(o._eventRegistry.has(t))return o._eventRegistry.get(t).removeEventListener.apply(o,arguments);var n=Array.prototype.slice.call(arguments,1);return e.removeEventListener.apply(e,n)},dispatch:function(e,t,n,i){var a=r.createEvent(e,t,n,i),o=r.forceEnabledForDispatch(e,a);o&&(e.disabled=!1);var s=e.dispatchEvent(a);return o&&(e.disabled=!0),s}};i.exports=a.domEvents=o}(0,e,0,n)}),define("can-event-dom-radiochange",["require","exports","module","can-dom-data-state","can-globals/document/document","can-dom-events","can-cid/map/map"],function(e,t,n){!function(e,t,n,i){"use strict";function a(e){return e.ownerDocument||g().documentElement}function r(e){return"can-event-radiochange:"+e+":registry"}function o(e){return"can-event-radiochange:"+e+":listener"}function s(e,t){var n=r(t),i=m.get.call(e,n);return i||(i=new b,m.set.call(e,n,i)),i}function c(e){for(;e&&"FORM"!==e.nodeName;)e=e.parentNode;return e}function l(e,t){var n=e.getAttribute("name");return n&&n===t.getAttribute("name")&&c(e)===c(t)}function u(e){return"INPUT"===e.nodeName&&"radio"===e.type}function d(e,t){s(a(t),e).forEach(function(n){l(t,n)&&y.dispatch(n,e)})}function p(e,t,n){var i=o(t);if(!m.get.call(e,i)){var a=function(e){var n=e.target;u(n)&&d(t,n)};n.addEventListener(e,"change",a),m.set.call(e,i,a)}}function f(e,t,n){var i=o(t),a=m.get.call(e,i);a&&(s(e,t).size>0||(n.removeEventListener(e,"change",a),m.clean.call(e,i)))}function h(e,t,n){if(!u(t))throw new Error("Listeners for "+e+" must be radio inputs");var i=a(t);s(i,e).set(t,t),p(i,e,n)}function v(e,t,n){var i=a(t);s(i,e).delete(t),f(i,e,n)}var m=t("can-dom-data-state"),g=t("can-globals/document/document"),y=t("can-dom-events"),b=t("can-cid/map/map");i.exports={defaultEventType:"radiochange",addEventListener:function(e,t,n){h(t,e,this),e.addEventListener(t,n)},removeEventListener:function(e,t,n){v(t,e,this),e.removeEventListener(t,n)}}}(0,e,0,n)}),define("can-event-dom-radiochange/compat",["require","exports","module","can-dom-events/helpers/add-event-compat","can-event-dom-radiochange"],function(e,t,n){var i=e("can-dom-events/helpers/add-event-compat"),a=e("can-event-dom-radiochange");n.exports=function(e,t){return i(e,a,t)}}),define("can-stache-bindings",["require","exports","module","can-stache/src/expression","can-view-callbacks","can-view-scope","can-view-model","can-stache-key","can-observation","can-simple-observable","can-util/js/assign/assign","can-util/js/make-array/make-array","can-util/js/each/each","can-util/js/dev/dev","can-util/dom/events/events","can-util/dom/events/removed/removed","can-util/dom/data/data","can-util/dom/attr/attr","can-stache/helpers/core","can-symbol","can-reflect","can-util/js/single-reference/single-reference","can-attribute-encoder","can-queues","can-simple-observable/setter/setter","can-view-scope/make-compute-like","can-event-dom-enter/compat","can-event-dom-radiochange/compat"],function(e,t,n){function i(e){if(void 0!==e.special.on)return e.tokens[e.special.on+1]}function a(e){var t={tokens:[],special:{}};return e.split(":").forEach(function(e){H[e]?t.special[e]=t.tokens.push(e)-1:t.tokens.push(e)}),t}var r=e("can-stache/src/expression"),o=e("can-view-callbacks"),s=e("can-view-scope"),c=e("can-view-model"),l=e("can-stache-key"),u=e("can-observation"),d=e("can-simple-observable"),p=e("can-util/js/assign/assign"),f=e("can-util/js/make-array/make-array"),h=e("can-util/js/each/each"),v=e("can-util/js/dev/dev"),m=e("can-util/dom/events/events");e("can-util/dom/events/removed/removed");var g=e("can-util/dom/data/data"),y=e("can-util/dom/attr/attr"),b=e("can-stache/helpers/core"),w=e("can-symbol"),k=e("can-reflect"),x=e("can-util/js/single-reference/single-reference"),j=e("can-attribute-encoder"),L=e("can-queues"),E=e("can-simple-observable/setter/setter"),V=e("can-view-scope/make-compute-like");e("can-event-dom-enter/compat")(m),e("can-event-dom-radiochange/compat")(m);var O={on:function(e,t,n){m.canAddEventListener.call(this)?m.addEventListener.call(this,e,t,n):k.onKeyValue(this,e,t,n)},off:function(e,t,n){m.canAddEventListener.call(this)?m.removeEventListener.call(this,e,t,n):k.offKeyValue(this,e,t,n)},one:function(e,t,n){var i=function(){return O.off.call(this,e,i,n),t.apply(this,arguments)};return O.on.call(this,e,i,n),this}},C=function(){},_=w.for("can.getValue"),D=w.for("can.setValue"),S=w.for("can.onValue"),T=w.for("can.offValue"),N=function(){throw new Error("can-stache-bindings - you can not have contextual bindings ( this:from='value' ) and key bindings ( prop:from='value' ) on one element.")},P=function(e,t){var n=t.bindingInfo.parentToChild&&"viewModel"===t.bindingInfo.child;if(!n)return e;var i=t.bindingInfo.childName;if(n&&("this"===i||"."===i)){if(!e.isSettingViewModel&&!e.isSettingOnViewModel)return{isSettingViewModel:!0,initialViewModelData:void 0};N()}else{if(!e.isSettingViewModel)return{isSettingOnViewModel:!0,initialViewModelData:e.initialViewModelData};N()}},M={viewModel:function(e,t,n,i,a){var r,o={},s=[],c={},l={},u=p({},i),d={isSettingOnViewModel:!1,isSettingViewModel:!1,initialViewModelData:i||{}},v=!1;if(h(f(e.attributes),function(n){var i=z(n,e,{templateType:t.templateType,scope:t.scope,semaphore:o,getViewModel:function(){return r},attributeViewModelBindings:u,alreadyUpdatedChild:!0,nodeList:t.parentNodeList,favorViewModel:!0});i&&(d=P(d,i),v=!0,i.onCompleteBinding&&(i.bindingInfo.parentToChild&&void 0!==i.value&&(d.isSettingViewModel?d.initialViewModelData=i.value:d.initialViewModelData[Q(i.bindingInfo.childName)]=i.value),s.push(i.onCompleteBinding)),c[n.name]=i.onTeardown)}),!a||v){r=n(d.initialViewModelData,v);for(var g=0,y=s.length;g<y;g++)s[g]();return d.isSettingViewModel||m.addEventListener.call(e,"attributes",function(n){var i=n.attributeName,a=e.getAttribute(i);c[i]&&c[i]();var o=l[i]&&"attribute"===l[i].parent;if(null!==a||o){var s=z({name:i,value:a},e,{templateType:t.templateType,scope:t.scope,semaphore:{},getViewModel:function(){return r},attributeViewModelBindings:u,initializeValues:!0,nodeList:t.parentNodeList});s&&(s.onCompleteBinding&&s.onCompleteBinding(),l[i]=s.bindingInfo,c[i]=s.onTeardown)}}),function(){for(var e in c)c[e]()}}},data:function(e,t){if(!g.get.call(e,"preventDataBindings")){var n,i,a=u.ignore(function(){return n||(n=c(e))}),r={},o=z({name:t.attributeName,value:e.getAttribute(t.attributeName),nodeList:t.nodeList},e,{templateType:t.templateType,scope:t.scope,semaphore:r,getViewModel:a,syncChildWithParent:!1});"viewModel"!==o.bindingInfo.child||g.get(e,"viewModel")||v.warn("This element does not have a viewModel. (Attempting to bind `"+o.bindingInfo.bindingAttributeName+'="'+o.bindingInfo.parentName+'"`)'),o.onCompleteBinding&&o.onCompleteBinding(),i=o.onTeardown,O.one.call(e,"removed",function(){i()}),m.addEventListener.call(e,"attributes",function(n){var o=n.attributeName,s=e.getAttribute(o);if(o===t.attributeName&&(i&&i(),null!==s)){var c=z({name:o,value:s},e,{templateType:t.templateType,scope:t.scope,semaphore:r,getViewModel:a,initializeValues:!0,nodeList:t.nodeList,syncChildWithParent:!1});c&&(c.onCompleteBinding&&c.onCompleteBinding(),i=c.onTeardown)}})}},event:function(e,t){var n,i,a=j.decode(t.attributeName);if(-1!==a.indexOf(":to:")||-1!==a.indexOf(":from:")||-1!==a.indexOf(":bind:"))return this.data(e,t);if(!K.call(a,"on:"))throw new Error("can-stache-bindings - unsupported event bindings "+a);n=a.substr("on:".length);var o=g.get.call(e,"viewModel"),s=t.scope;if(K.call(n,"el:"))n=n.substr("el:".length),i=e;else{K.call(n,"vm:")?(n=n.substr("vm:".length),i=o,s=o):i=o||e;var u=n.indexOf(":by:");u>=0&&(i=s.get(n.substr(u+":by:".length)),n=n.substr(0,u))}var d=function(n){var i=e.getAttribute(j.encode(a));if(i){var o=c(e),s=r.parse(i,{lookupRule:function(){return r.Lookup},methodRule:"call"});if(!(s instanceof r.Call))throw new Error("can-stache-bindings: Event bindings must be a call expression. Make sure you have a () in "+t.attributeName+"="+JSON.stringify(i));var u,d,p,f=t.scope.add({"%element":this,"%event":n,"%viewModel":o,"%scope":t.scope,"%context":t.scope._context,"%arguments":arguments},{notContext:!0}),h=f.read(s.methodExpr.key,{isArgument:!0});if(!h.value){var m=l.reads(s.methodExpr.key).map(function(e){return e.key}).join(".");return(d=b.getHelper(m))?(u=s.args(f,null)(),"function"==typeof(p=d.fn.apply(f.peek("."),u))&&p(e),p):(v.warn("can-stache-bindings: "+a+" couldn't find method named "+s.methodExpr.key,{element:e,scope:t.scope}),null)}u=s.args(f,null)(),L.batch.start(),L.notifyQueue.enqueue(h.value,h.parent,u,{reasonLog:[e,n,a+"="+i]}),L.batch.stop()}},p=function(e){var t=e.attributeName===a,n=!this.getAttribute(a);t&&n&&h()},f=function(e){h()},h=function(){O.off.call(i,n,d),O.off.call(e,"attributes",p),O.off.call(e,"removed",f)};O.on.call(i,n,d),O.on.call(e,"attributes",p),O.on.call(e,"removed",f)}};o.attr(/[\w\.:]+:to$/,M.data),o.attr(/[\w\.:]+:from$/,M.data),o.attr(/[\w\.:]+:bind$/,M.data),o.attr(/[\w\.:]+:to:on:[\w\.:]+/,M.data),o.attr(/[\w\.:]+:from:on:[\w\.:]+/,M.data),o.attr(/[\w\.:]+:bind:on:[\w\.:]+/,M.data),o.attr(/on:[\w\.:]+/,M.event);var A={viewModelOrAttribute:function(e,t,n,i,a,r,o){return g.get.call(e,"viewModel")?this.viewModel.apply(this,arguments):this.attribute.apply(this,arguments)},scope:function(e,t,n,i,a,o){if(n){if(a)return r.parse(n,{baseMethodType:"Call"}).value(t,new s.Options({}));var c=new u(function(){});return c[D]=function(e){t.set(Q(n),e)},c}return new d},viewModel:function(e,t,n,i,a,r,o){function s(){var e=i.getViewModel();return l.read(e,p,{}).value}var c=Q(n),u="."===n||"this"===n,p=u?[]:l.reads(n);return Object.defineProperty(s,"name",{value:"viewModel."+n}),new E(s,function(e){var t=i.getViewModel();if(r){var n=k.getKeyValue(t,c);k.isObservableLike(n)?k.setValue(n,e):k.setKeyValue(t,c,new d(k.getValue(r)))}else u?k.setValue(t,e):k.setKeyValue(t,c,e)})},attribute:function(e,t,n,i,a,r,o){if(!o){o="change";var s="INPUT"===e.nodeName&&"radio"===e.type,c="checked"===n&&!i.legacyBindings;s&&c&&(o="radiochange"),y.special[n]&&y.special[n].addEventListener&&(o=n)}var l="select"===e.nodeName.toLowerCase(),d=function(){return y.get(e,n)};"value"===n&&l&&e.multiple&&(n="values");var p=new u(d);return p[D]=function(t){return i.legacyBindings&&l&&"selectedIndex"in e&&"value"===n?y.setAttrOrProp(e,n,null==t?"":t):y.setAttrOrProp(e,n,t),t},p[_]=d,p[S]=function(t){var n=function(){t(d())};x.set(t,this,n),"radiochange"===o&&O.on.call(e,"change",n),O.on.call(e,o,n)},p[T]=function(t){var n=x.getAndDelete(t,this);"radiochange"===o&&O.off.call(e,"change",n),O.off.call(e,o,n)},p}},q={childToParent:function(e,t,n,i,a,r,o){function s(o){if(!i[a])if(t&&t[_]){var s=k.valueHasDependencies(t);s&&k.getValue(t)===o||k.setValue(t,o),r&&s&&k.getValue(t)!==k.getValue(n)&&(i[a]=(i[a]||0)+1,L.batch.start(),k.setValue(n,k.getValue(t)),L.mutateQueue.enqueue(function(){--i[a]},null,[],{}),L.batch.stop())}else if(k.isMapLike(t)){var c=e.getAttribute(a);v.warn("can-stache-bindings: Merging "+a+" into "+c+" because its parent is non-observable"),k.eachKey(t,function(e){k.deleteKeyValue(t,e)}),k.setValue(t,o&&o.serialize?o.serialize():o,!0)}}return Object.defineProperty(s,"name",{value:"update "+o.parent+"."+o.parentName+" of <"+e.nodeName.toLowerCase()+">"}),n&&n[_]&&k.onValue(n,s,"mutate"),s},parentToChild:function(e,t,n,i,a,r){var o=function(e){i[a]=(i[a]||0)+1,L.batch.start(),k.setValue(n,e),L.mutateQueue.enqueue(function(){--i[a]},null,[],{}),L.batch.stop()};return Object.defineProperty(o,"name",{value:"update "+r.child+"."+r.childName+" of <"+e.nodeName.toLowerCase()+">"}),t&&t[_]&&k.onValue(t,o,"mutate"),o}},K=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},R={to:{childToParent:!0,parentToChild:!1,syncChildWithParent:!1},from:{childToParent:!1,parentToChild:!0,syncChildWithParent:!1},bind:{childToParent:!0,parentToChild:!0,syncChildWithParent:!0}},I=[],H={vm:!0,on:!0};h(R,function(e,t){I.push(t),H[t]=!0});var B=function(e,t){return e.indexOf("vm")>=0?"viewModel":e.indexOf("el")>=0?"attribute":t?"viewModel":"viewModelOrAttribute"},F=function(e,t,n,r,o){var s,c,l,u=j.decode(e.name),d=e.value||"",f=a(u);if(I.forEach(function(e){if(void 0!==f.special[e]&&f.special[e]>0)return c=e,l=f.special[e],!1}),c){var h=i(f),v=!h;return s=p({parent:"scope",child:B(f.tokens,o),childName:f.tokens[l-1],childEvent:h,bindingAttributeName:u,parentName:d,initializeValues:v},R[c]),"~"===d.trim().charAt(0)&&(s.stickyParentToChild=!0),s}},z=function(e,t,n){var i=F(e,n.attributeViewModelBindings,n.templateType,t.nodeName.toLowerCase(),n.favorViewModel);if(i){i.alreadyUpdatedChild=n.alreadyUpdatedChild,n.initializeValues&&(i.initializeValues=!0);var a,r,o=A[i.parent](t,n.scope,i.parentName,n,i.parentToChild,void 0,void 0,i),s=A[i.child](t,n.scope,i.childName,n,i.childToParent,i.stickyParentToChild&&o,i.childEvent,i);n.nodeList&&(o&&k.setPriority(o,n.nodeList.nesting+1),s&&k.setPriority(s,n.nodeList.nesting+1)),i.parentToChild&&(r=q.parentToChild(t,o,s,n.semaphore,i.bindingAttributeName,i));var c=function(){i.childToParent?a=q.childToParent(t,o,s,n.semaphore,i.bindingAttributeName,i.syncChildWithParent,i):i.stickyParentToChild&&s[S]&&k.onValue(s,C,"mutate"),i.initializeValues&&U(i,s,o,r,a)},l=function(){W(o,r),W(s,a),W(s,C)};return"viewModel"===i.child?{value:i.stickyParentToChild?V(o):k.getValue(o),onCompleteBinding:c,bindingInfo:i,onTeardown:l}:(c(),{bindingInfo:i,onTeardown:l})}},U=function(e,t,n,i,a){var r=!1;e.parentToChild&&!e.childToParent||(!e.parentToChild&&e.childToParent?r=!0:void 0===k.getValue(t)||void 0===k.getValue(n)&&(r=!0)),r?a(k.getValue(t)):e.alreadyUpdatedChild||i(k.getValue(n))},W=function(e,t){e&&e[_]&&"function"==typeof t&&k.offValue(e,t,"mutate")},Q=function(e){return e.replace(/@/g,"")};n.exports={behaviors:M,getBindingInfo:F}}),define("can-component",["require","exports","module","can-component/control/control","can-namespace","can-construct","can-stache-bindings","can-view-scope","can-view-callbacks","can-view-nodelist","can-util/dom/data/data","can-util/dom/mutate/mutate","can-util/dom/child-nodes/child-nodes","can-util/dom/dispatch/dispatch","can-util/js/string/string","can-reflect","can-util/js/each/each","can-util/js/assign/assign","can-util/js/is-function/is-function","can-util/js/log/log","can-util/js/dev/dev","can-util/js/make-array/make-array","can-util/js/is-empty-object/is-empty-object","can-simple-observable","can-simple-map","can-util/dom/events/inserted/inserted","can-util/dom/events/removed/removed","can-view-model","can-globals/document/document"],function(e,t,n){!function(e,t,n,i){function a(e,t,n){var i;f.set.call(e,"preventDataBindings",!0);var a=l.behaviors.viewModel(e,n,function(e){return i=new V(e)},void 0,!0);return a?w(w({},t),{teardown:a,scope:t.scope.add(i)}):t}function r(e,t,n,i,r){var o=n.options._context;return function n(s,c){var l=r(s)||c.subtemplate,u=l!==c.subtemplate;if(l){delete o.tags[e];var d;d=u?i.toLightContent?a(s,{scope:c.scope.cloneFromRef(),options:c.options},c):a(s,t,c):a(s,c,c);var f=p.register([s],function(){d.teardown&&d.teardown()},c.parentNodeList||!0,!1);f.expression="<can-slot name='"+s.getAttribute("name")+"'/>";var h=l(d.scope,d.options,f),m=L(v(h));p.replace(f,h),p.update(f,m),o.tags[e]=n}}}var o=t("can-component/control/control"),s=t("can-namespace"),c=t("can-construct"),l=t("can-stache-bindings"),u=t("can-view-scope"),d=t("can-view-callbacks"),p=t("can-view-nodelist"),f=t("can-util/dom/data/data"),h=t("can-util/dom/mutate/mutate"),v=t("can-util/dom/child-nodes/child-nodes"),m=t("can-util/dom/dispatch/dispatch"),g=t("can-util/js/string/string"),y=t("can-reflect"),b=t("can-util/js/each/each"),w=t("can-util/js/assign/assign"),k=t("can-util/js/is-function/is-function"),x=t("can-util/js/log/log"),j=t("can-util/js/dev/dev"),L=t("can-util/js/make-array/make-array"),E=t("can-util/js/is-empty-object/is-empty-object"),V=t("can-simple-observable"),O=t("can-simple-map");t("can-util/dom/events/inserted/inserted"),t("can-util/dom/events/removed/removed"),t("can-view-model");var C=t("can-globals/document/document"),_=c.extend({setup:function(){if(c.setup.apply(this,arguments),_){var e=this;E(this.prototype.events)||(this.Control=o.extend(this.prototype.events)),this.prototype.viewModel&&y.isConstructorLike(this.prototype.viewModel)&&j.warn("can-component: Assigning a DefineMap or constructor type to the viewModel property may not be what you intended. Did you mean ViewModel instead? More info: https://canjs.com/doc/can-component.prototype.ViewModel.html");var t=this.prototype.viewModel||this.prototype.scope;if(t&&this.prototype.ViewModel)throw new Error("Cannot provide both a ViewModel and a viewModel property");var n=g.capitalize(g.camelize(this.prototype.tag))+"VM";this.prototype.ViewModel?"function"==typeof this.prototype.ViewModel?this.ViewModel=this.prototype.ViewModel:this.ViewModel=O.extend(n,this.prototype.ViewModel):t?"function"==typeof t?y.isObservableLike(t.prototype)&&y.isMapLike(t.prototype)?this.ViewModel=t:this.viewModelHandler=t:y.isObservableLike(t)&&y.isMapLike(t)?(x.warn("can-component: "+this.prototype.tag+" is sharing a single map across all component instances"),this.viewModelInstance=t):this.ViewModel=O.extend(n,t):this.ViewModel=O.extend(n,{}),this.prototype.template&&(x.warn("can-component.prototype.template: is deprecated and will be removed in a future release. Use can-component.prototype.view"),this.renderer=this.prototype.template),this.prototype.view&&(this.renderer=this.prototype.view),d.tag(this.prototype.tag,function(t,n){new e(t,n)}),this.prototype.autoMount&&b(C().getElementsByTagName(this.prototype.tag),function(t){f.get.call(t,"viewModel")||new e(t,{scope:new u,options:new u.Options({}),templates:{},subtemplate:null})})}}},{setup:function(e,t){var n,i,a,o=this,s=[];if(!f.get.call(e,"preventDataBindings")){var c=t.setupBindings||function(e,n,i){return l.behaviors.viewModel(e,t,n,i)};a=c(e,function(i){var a=o.constructor.ViewModel,r=o.constructor.viewModelHandler,s=o.constructor.viewModelInstance;if(r){var c=r.call(o,i,t.scope,e);y.isObservableLike(c)&&y.isMapLike(c)?s=c:a=y.isObservableLike(c.prototype)&&y.isMapLike(c.prototype)?c:O.extend(c)}return a&&(s=new o.constructor.ViewModel(i)),n=s,s},{})}this.viewModel=n,f.set.call(e,"viewModel",n),f.set.call(e,"preventDataBindings",!0);var d={helpers:{},tags:{}};b(this.helpers||{},function(e,t){k(e)&&(d.helpers[t]=e.bind(n))}),this.constructor.Control&&(this._control=new this.constructor.Control(e,{scope:this.viewModel,viewModel:this.viewModel,destroy:function(){for(var e=0,t=s.length;e<t;e++)s[e]()}}));var g,w,x={toLightContent:!0===this.leakScope,intoShadowContent:!0===this.leakScope};if(!!this.constructor.renderer){var j;j=x.intoShadowContent?{scope:t.scope.add(new u.Refs).add(this.viewModel,{viewModel:!0}),options:t.options.add(d)}:{scope:u.refsScope().add(this.viewModel,{viewModel:!0}),options:new u.Options(d)},d.tags["can-slot"]=r("can-slot",t,j,x,function(e){return t.templates[e.getAttribute("name")]}),d.tags.content=r("content",t,j,x,function(){return t.subtemplate}),g=this.constructor.renderer,w=j}else w={scope:t.scope.add(this.viewModel,{viewModel:!0}),options:t.options.add(d)},g=t.subtemplate||e.ownerDocument.createDocumentFragment.bind(e.ownerDocument);var L=p.register([],function(){m.call(e,"beforeremove",[],!1),a&&a()},t.parentNodeList||!0,!1);L.expression="<"+this.tag+">",s.push(function(){p.unregister(L)}),i=g(w.scope,w.options,L),h.appendChild.call(e,i),p.update(L,v(e))}});i.exports=s.Component=_}(0,e,0,n)}),define("can-simple-observable/async/async",["require","exports","module","can-simple-observable","can-observation","can-key-tree","can-queues","can-simple-observable/settable/settable","can-reflect","can-observation-recorder"],function(e,t,n){function i(e,t,n){function i(){return this.resolveCalled=!1,e.call(t,this.lastSetValue.get(),!0===this.bound?this.resolve:void 0)}this.handlers=new o([Object,Array],{onFirst:this.setup.bind(this),onEmpty:this.teardown.bind(this)}),this.resolve=this.resolve.bind(this),this.lastSetValue=new a(n),this.handler=this.handler.bind(this),l.assignSymbols(this,{"can.getName":function(){return l.getName(this.constructor)+"<"+l.getName(e)+">"}}),Object.defineProperty(this.handler,"name",{value:l.getName(this)+".handler"}),Object.defineProperty(i,"name",{value:l.getName(e)+"::"+l.getName(this.constructor)}),this.observation=new r(i,this)}var a=e("can-simple-observable"),r=e("can-observation"),o=e("can-key-tree"),s=e("can-queues"),c=e("can-simple-observable/settable/settable"),l=e("can-reflect"),u=e("can-observation-recorder");(i.prototype=Object.create(c.prototype)).constructor=i,i.prototype.handler=function(e){void 0!==e&&c.prototype.handler.apply(this,arguments)};var d=u.ignore(l.getValue.bind(l));i.prototype.setup=function(){this.bound=!0,l.onValue(this.observation,this.handler,"notify"),this.resolveCalled||(this.value=d(this.observation))},i.prototype.resolve=function(e){this.resolveCalled=!0;var t=this.value;this.value=e,"function"==typeof this._log&&this._log(t,e),s.enqueueByQueue(this.handlers.getNode([]),this,[e,t],function(){return{}})},n.exports=i}),define("can-util/js/defaults/defaults",function(e,t,n){"use strict";n.exports=function(e){for(var t=arguments.length,n=1;n<t;n++)for(var i in arguments[n])void 0===e[i]&&(e[i]=arguments[n][i]);return e}}),define("can-util/js/string-to-any/string-to-any",function(e,t,n){"use strict";n.exports=function(e){switch(e){case"NaN":case"Infinity":return+e;case"null":return null;case"undefined":return;case"true":case"false":return"true"===e;default:var t=+e;return isNaN(t)?e:t}}}),define("can-define-lazy-value",function(e,t,n){n.exports=function(e,t,n,i){Object.defineProperty(e,t,{configurable:!0,get:function(){Object.defineProperty(this,t,{value:void 0,writable:!0});var a=n.call(this,e,t);return Object.defineProperty(this,t,{value:a,writable:!!i}),a},set:function(e){return Object.defineProperty(this,t,{value:e,writable:!!i}),e}})}}),define("can-define",["require","exports","module","can-namespace","can-symbol","can-reflect","can-observation","can-simple-observable/async/async","can-simple-observable/settable/settable","can-cid","can-event-queue","can-queues","can-util/js/is-empty-object/is-empty-object","can-util/js/assign/assign","can-util/js/dev/dev","can-util/js/is-plain-object/is-plain-object","can-util/js/each/each","can-util/js/defaults/defaults","can-util/js/string-to-any/string-to-any","can-define-lazy-value"],function(e,t,n){"use strict";"format cjs";function i(e){return f.isValueLike(e)&&f.isObservableLike(e)}var a,r,o,s,c,l,u,d=e("can-namespace"),p=e("can-symbol"),f=e("can-reflect"),h=e("can-observation"),v=e("can-simple-observable/async/async"),m=e("can-simple-observable/settable/settable"),g=e("can-cid"),y=e("can-event-queue"),b=e("can-queues"),w=e("can-util/js/is-empty-object/is-empty-object"),k=e("can-util/js/assign/assign"),x=e("can-util/js/dev/dev"),j=e("can-util/js/is-plain-object/is-plain-object"),L=e("can-util/js/each/each"),E=e("can-util/js/defaults/defaults"),V=e("can-util/js/string-to-any/string-to-any"),O=e("can-define-lazy-value"),C=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})},_=function(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,Object.getOwnPropertyDescriptor(e,n))};n.exports=r=d.define=function(e,t,n){var i,o=Object.create(n?n.dataInitializers:null),s=Object.create(n?n.computedInitializers:null),l=c(t,n);if(l.dataInitializers=o,l.computedInitializers=s,L(l.definitions,function(t,n){r.property(e,n,t,o,s)}),e.hasOwnProperty("_data"))for(i in o)O(e._data,i,o[i].bind(e),!0);else O(e,"_data",function(){var e=this,t={};for(var n in o)O(t,n,o[n].bind(e),!0);return t});if(e.hasOwnProperty("_computed"))for(i in s)O(e._computed,i,s[i].bind(e));else O(e,"_computed",function(){var e=this,t=Object.create(null);for(var n in s)O(t,n,s[n].bind(e));return t});e.hasOwnProperty("_cid")||O(e,"_cid",function(){return g({})});for(i in a)Object.defineProperty(e,i,{enumerable:!1,value:a[i],configurable:!0,writable:!0});Object.defineProperty(e,"_define",{enumerable:!1,value:l,configurable:!0,writable:!0});var u=p.iterator||p.for("iterator");return e[u]||C(e,u,function(){return new r.Iterator(this)}),l},r.extensions=function(){};var D=function(e){for(var t in e)if("type"!==t)return!1;return!0};r.property=function(e,t,n,i,a){var s=r.extensions.apply(this,arguments);s&&(n=s);var c=n.type;if(c&&f.isConstructorLike(c)&&x.warn("can-define: the definition for "+t+(e.constructor.shortName?" on "+e.constructor.shortName:"")+' uses a constructor for "type". Did you mean "Type"?'),c&&D(n)&&c===r.types["*"])Object.defineProperty(e,t,{get:o.get.data(t),set:o.set.events(t,o.get.data(t),o.set.data(t),o.eventType.data(t)),enumerable:!0,configurable:!0});else{n.type=c;var l,u=n.get?"computed":"data",d=o.read[u](t),p=o.get[u](t),v=o.set[u](t);n.get&&Object.defineProperty(n.get,"name",{value:f.getName(e)+"'s "+t+" getter"}),n.set&&Object.defineProperty(n.set,"name",{value:f.getName(e)+"'s "+t+" setter"});var m=function(e){return e};n.Type&&(m=o.set.Type(t,n.Type,m)),c&&(m=o.set.type(t,c,m));var g=o.set.events(t,d,v,o.eventType[u](t));void 0===n.value&&void 0===n.Value||(null!==n.value&&"object"==typeof n.value&&x.warn("can-define: The value for "+t+" is set to an object. This will be shared by all instances of the DefineMap. Use a function that returns the object instead."),n.value&&f.isConstructorLike(n.value)&&x.warn('can-define: The "value" for '+t+' is set to a constructor. Did you mean "Value" instead?'),l=h.ignore(o.get.defaultValue(t,n,m,g))),n.get?a[t]=o.compute(t,n.get,l):l&&(i[t]=l),n.get&&n.set?v=o.set.setter(t,n.set,o.read.lastSet(t),v,!0):n.set?v=o.set.setter(t,n.set,d,g,!1):n.get?n.get.length<1&&(v=function(){x.warn("can-define: Set value for property "+t+(e.constructor.shortName?" on "+e.constructor.shortName:"")+" ignored, as its definition has a zero-argument getter and no setter")}):v=g,c&&(v=o.set.type(t,c,v)),n.Type&&(v=o.set.Type(t,n.Type,v)),Object.defineProperty(e,t,{get:p,set:v,enumerable:"serialize"in n?!!n.serialize:!n.get,configurable:!0})}},r.Constructor=function(e){var t=function(e){r.setup.call(this,e)};return r(t.prototype,e),t},o={compute:function(e,t,n){return function(){var i,a,r=this,o=n&&n.call(this);return i=0===t.length?new h(t,r):1===t.length?new m(t,r,o):new v(t,r,o),a={oldValue:void 0,compute:i,count:0,handler:function(t){var n=a.oldValue;a.oldValue=t,r.dispatch({type:e,target:r},[t,n])}},Object.defineProperty(a.handler,"name",{value:f.getName(t).replace("getter","event emitter")}),a}},set:{data:function(e){return function(t){this._data[e]=t}},computed:function(e){return function(t){f.setValue(this._computed[e].compute,t)}},events:function(e,t,n,i){return function(i){if(this.__inSetup)n.call(this,i);else{var a=t.call(this);i!==a&&(n.call(this,i),this.dispatch({type:e,target:this,reasonLog:[f.getName(this)+"'s",e,"changed to",i,"from",a]},[i,a]))}}},setter:function(e,t,n,i,a){return function(r){var o,s=this;b.batch.start();var c=!1,l=n.call(this),u=t.call(this,r,function(e){i.call(s,e),c=!0,clearTimeout(o)},l);if(c)b.batch.stop();else if(a)if(void 0!==u)l!==u&&i.call(this,u),b.batch.stop();else{if(0===t.length)return i.call(this,r),void b.batch.stop();if(1!==t.length)return o=setTimeout(function(){x.warn('can/map/setter.js: Setter "'+e+'" did not return a value or call the setter callback.')},x.warnTimeout),void b.batch.stop();b.batch.stop()}else if(void 0!==u)i.call(this,u),b.batch.stop();else{if(0===t.length)return i.call(this,r),void b.batch.stop();if(1!==t.length)return o=setTimeout(function(){x.warn('can/map/setter.js: Setter "'+e+'" did not return a value or call the setter callback.')},x.warnTimeout),void b.batch.stop();i.call(this,void 0),b.batch.stop()}}},type:function(e,t,n){return"object"==typeof t?o.set.Type(e,t,n):function(i){return n.call(this,t.call(this,i,e))}},Type:function(e,t,n){return Array.isArray(t)&&r.DefineList?t=r.DefineList.extend({"#":t[0]}):"object"==typeof t&&(t=r.DefineMap?r.DefineMap.extend(t):r.Constructor(t)),function(e){return e instanceof t||null==e?n.call(this,e):n.call(this,new t(e))}}},eventType:{data:function(e){return function(t,n){return void 0!==n||this._data.hasOwnProperty(e)?"set":"add"}},computed:function(){return function(){return"set"}}},read:{data:function(e){return function(){return this._data[e]}},computed:function(e){return function(){return f.getValue(this._computed[e].compute)}},lastSet:function(e){return function(){var t=this._computed[e].compute;if(t.lastSetValue)return f.getValue(t.lastSetValue)}}},get:{defaultValue:function(e,t,n,i){return function(){var a=t.value;if(void 0!==a)"function"==typeof a&&(a=a.call(this)),a=n(a);else{var r=t.Value;r&&(a=n(new r))}if(t.set){var s,c=!0;return o.set.setter(e,t.set,function(){},function(e){c?s=e:i.call(this,e)},t.get).call(this,a),c=!1,s}return a}},data:function(e){return function(){return this.__inSetup||h.add(this,e),this._data[e]}},computed:function(e){return function(){return f.getValue(this._computed[e].compute)}}}},r.behaviors=["get","set","value","Value","type","Type","serialize"];var S=function(e,t,n){if("type"===t){var i=n;"string"==typeof i&&"object"==typeof(i=r.types[i])&&(k(e,i),i=i[t]),e[t]=i}else e[t]=n};s=function(e,t,n){var i={};return L(t,function(e,t){S(i,t,e)}),L(n,function(e,t){void 0===i[t]&&"type"!==t&&"Type"!==t&&(i[t]=e)}),i.type||i.Type||E(i,n),w(i)&&(i.type=r.types["*"]),i},u=function(e,t,n){var i;return"string"==typeof t?i={type:t}:"function"==typeof t?f.isConstructorLike(t)?i={Type:t}:l(t)&&(i={type:t}):Array.isArray(t)?i={Type:t}:j(t)&&(i=t),i?s(0,i,n):t},c=function(e,t){var n,i=Object.create(t?t.definitions:null),a={},r=e["*"];return r?(delete e["*"],n=u(0,r,{})):n=Object.create(null),_(e,function(e,t){var r;if(r=t.get||t.set?{get:t.get,set:t.set}:t.value,"constructor"!==e){var o=u(0,r,n);o&&"object"==typeof o?i[e]=o:a[e]=o}else a[e]=r}),r&&(e["*"]=r),{definitions:i,methods:a,defaultDefinition:n}},a=y({});var T=p.for("can.meta");k(a,{_eventSetup:function(){},_eventTeardown:function(){},addEventListener:function(e,t,n){var i=this._computed&&this._computed[e];return i&&i.compute&&(i.count?i.count++:(i.count=1,f.onValue(i.compute,i.handler,"notify"),i.oldValue=f.getValue(i.compute))),y.addEventListener.apply(this,arguments)},removeEventListener:function(e,t){var n=this._computed&&this._computed[e];return n&&(1===n.count?(n.count=0,f.offValue(n.compute,n.handler,"notify")):n.count--),y.removeEventListener.apply(this,arguments)}}),a.on=a.bind=a.addEventListener,a.off=a.unbind=a.removeEventListener,delete a.one,r.setup=function(e,t){g(this),Object.defineProperty(this,"_cid",{value:this._cid,enumerable:!1,writable:!1}),Object.defineProperty(this,"constructor",{value:this.constructor,enumerable:!1,writable:!1}),Object.defineProperty(this,T,{value:Object.create(null),enumerable:!1,writable:!1});var n=this._define.definitions,i=Object.create(null),a=this;f.eachKey(e,function(e,t){if(void 0!==n[t])a[t]=e;else{var o=r.makeSimpleGetterSetter(t);i[t]={},Object.defineProperty(a,t,o),a[t]=r.types.observable(e)}}),w(i)||C(this,"_instanceDefinitions",i),this._data,this._computed,!1!==t&&Object.seal(this)},r.replaceWith=O,r.eventsProto=a,r.defineConfigurableAndNotEnumerable=C,r.make=o,r.getDefinitionOrMethod=u;var N={};r.makeSimpleGetterSetter=function(e){if(!N[e]){var t=o.set.events(e,o.get.data(e),o.set.data(e),o.eventType.data(e));N[e]={get:o.get.data(e),set:function(e){return t.call(this,r.types.observable(e))},enumerable:!0}}return N[e]},r.Iterator=function(e){this.obj=e,this.definitions=Object.keys(e._define.definitions),this.instanceDefinitions=e._instanceDefinitions?Object.keys(e._instanceDefinitions):Object.keys(e),this.hasGet="function"==typeof e.get},r.Iterator.prototype.next=function(){var e;if(this.definitions.length){if(e=this.definitions.shift(),this.obj._define.definitions[e].get)return this.next()}else{if(!this.instanceDefinitions.length)return{value:void 0,done:!0};e=this.instanceDefinitions.shift()}return{value:[e,this.hasGet?this.obj.get(e):this.obj[e]],done:!1}},l=function(e){return e&&!0===e.canDefineType},r.types={date:function(e){var t=typeof e;return"string"===t?(e=Date.parse(e),isNaN(e)?null:new Date(e)):"number"===t?new Date(e):e},number:function(e){return null==e?e:+e},boolean:function(e){return null==e?e:!("false"===e||"0"===e||!e)},observable:function(e){return Array.isArray(e)&&r.DefineList?e=new r.DefineList(e):j(e)&&r.DefineMap&&(e=new r.DefineMap(e)),e},stringOrObservable:function(e){return Array.isArray(e)?new r.DefaultList(e):j(e)?new r.DefaultMap(e):r.types.string(e)},htmlbool:function(e){return""===e||!!V(e)},"*":function(e){return e},any:function(e){return e},string:function(e){return null==e?e:""+e},compute:{set:function(e,t,n,a){return i(e)?e:i(a)?(f.setValue(a,e),a):e},get:function(e){return i(e)?f.getValue(e):e}}}}),define("can-define/define-helpers/define-helpers",["require","exports","module","can-define","can-reflect","can-queues"],function(e,t,n){var i=e("can-define"),a=e("can-reflect"),r=e("can-queues"),o={defineExpando:function(e,t,n){var a=e._define.definitions;if(!a||!a[t]){var o=e._instanceDefinitions;if(o||(Object.defineProperty(e,"_instanceDefinitions",{configurable:!0,enumerable:!1,value:{}}),o=e._instanceDefinitions),!o[t]){var s=e._define.defaultDefinition||{type:i.types.observable};return i.property(e,t,s,{},{}),e._data[t]=s.type?s.type(n):i.types.observable(n),o[t]=s,r.batch.start(),e.dispatch({type:"__keys",target:e}),void 0!==e._data[t]&&e.dispatch({type:t,target:e},[e._data[t],void 0]),r.batch.stop(),!0}}},reflectSerialize:function(e){var t=this._define.definitions,n=this._define.defaultDefinition;return this.each(function(i,r){var o=t[r];void 0!==(i=o&&"function"==typeof o.serialize?o.serialize.call(this,i,r):n&&"function"==typeof n.serialize?n.serialize.call(this,i,r):a.serialize(i))&&(e[r]=i)},this),e},reflectUnwrap:function(e){return this.forEach(function(t,n){void 0!==t&&(e[n]=a.unwrap(t))}),e}};n.exports=o}),define("can-util/js/cid-set/cid-set",["require","exports","module","can-cid/set/set"],function(e,t,n){!function(e,t,n,i){"use strict";i.exports=t("can-cid/set/set")}(0,e,0,n)}),define("can-define/ensure-meta",["require","exports","module","can-symbol","can-reflect"],function(e,t,n){var i=e("can-symbol"),a=e("can-reflect");n.exports=function(e){var t=i.for("can.meta"),n=e[t];return n||(n={},a.setKeyValue(e,t,n)),n}}),define("can-define/map/map",["require","exports","module","can-construct","can-define","can-define/define-helpers/define-helpers","can-observation","can-namespace","can-util/js/log/log","can-reflect","can-symbol","can-util/js/cid-set/cid-set","can-util/js/cid-map/cid-map","can-util/js/dev/dev","can-queues","can-define/ensure-meta","can-log/dev/dev"],function(e,t,n){function i(e){w.batch.start(),v.assignMap(this,e||{}),w.batch.stop()}function a(e){w.batch.start(),v.updateMap(this,e||{}),w.batch.stop()}function r(e){w.batch.start(),v.assignDeepMap(this,e||{}),w.batch.stop()}function o(e){w.batch.start(),v.updateDeepMap(this,e||{}),w.batch.stop()}function s(e,t){d.defineExpando(this,e,t)||(this[e]=t)}function c(e){var t=this[e];return void 0!==t||e in this||Object.isSealed(this)?t:(p.add(this,e),this[e])}var l=e("can-construct"),u=e("can-define"),d=e("can-define/define-helpers/define-helpers"),p=e("can-observation"),f=e("can-namespace"),h=e("can-util/js/log/log"),v=e("can-reflect"),m=e("can-symbol"),g=e("can-util/js/cid-set/cid-set"),y=e("can-util/js/cid-map/cid-map"),b=e("can-util/js/dev/dev"),w=e("can-queues"),k=e("can-define/ensure-meta"),x=e("can-log/dev/dev"),j=function(e){var t=[];for(var n in e){var i=e[n];"object"==typeof i&&("serialize"in i?!i.serialize:i.get)||t.push(n)}return t},L=l.extend("DefineMap",{setup:function(e){var t,n=this.prototype;if(L){u(n,n,e.prototype._define);for(t in L.prototype)u.defineConfigurableAndNotEnumerable(n,t,n[t]);this.prototype.setup=function(e){u.setup.call(this,e||{},this.constructor.seal)}}else for(t in n)u.defineConfigurableAndNotEnumerable(n,t,n[t]);u.defineConfigurableAndNotEnumerable(n,"constructor",this)}},{setup:function(e,t){this._define||(Object.defineProperty(this,"_define",{enumerable:!1,value:{definitions:{}}}),Object.defineProperty(this,"_data",{enumerable:!1,value:{}})),u.setup.call(this,e||{},!0===t)},get:function(e){return e?c.call(this,e):v.unwrap(this,y)},set:function(e,t){return"object"==typeof e?(b.warn("can-define/map/map.prototype.set is deprecated; please use can-define/map/map.prototype.assign or can-define/map/map.prototype.update instead"),!0===t?o.call(this,e):r.call(this,e)):s.call(this,e,t),this},assignDeep:function(e){return r.call(this,e),this},updateDeep:function(e){return o.call(this,e),this},assign:function(e){return i.call(this,e),this},update:function(e){return a.call(this,e),this},serialize:function(){return v.serialize(this,y)},forEach:function(){var e=function(e,t,n){return v.eachKey(e,t,n)},t=p.ignore(e);return function(n,i,a){return!1===a?t(this,n,i):e(this,n,i)}}(),"*":{type:u.types.observable},log:function(e){var t=this,n=function(e){return"string"==typeof e?JSON.stringify(e):e},i=k(t),a=i.allowedLogKeysSet||new Set;i.allowedLogKeysSet=a,e&&a.add(e),i._log=function(i,r){var o=i.type;"__keys"===o||e&&!a.has(o)||x.log(v.getName(t),"\n key ",n(o),"\n is ",n(r[0]),"\n was ",n(r[1]))}}});v.assignSymbols(L.prototype,{"can.isMapLike":!0,"can.isListLike":!1,"can.isValueLike":!1,"can.getKeyValue":c,"can.setKeyValue":s,"can.deleteKeyValue":function(e){return this.set(e,void 0),this},"can.getOwnEnumerableKeys":function(){return p.add(this,"__keys"),j(this._define.definitions).concat(j(this._instanceDefinitions))},"can.assignDeep":r,"can.updateDeep":o,"can.unwrap":d.reflectUnwrap,"can.serialize":d.reflectSerialize,"can.keyHasDependencies":function(e){return!!(this._computed&&this._computed[e]&&this._computed[e].compute)},"can.getKeyDependencies":function(e){var t;return this._computed&&this._computed[e]&&this._computed[e].compute&&((t={}).valueDependencies=new g,t.valueDependencies.add(this._computed[e].compute)),t},"can.getName":function(){return v.getName(this.constructor)+"{}"}}),v.setKeyValue(L.prototype,m.iterator,function(){return new u.Iterator(this)});for(var E in u.eventsProto)L[E]=u.eventsProto[E],Object.defineProperty(L.prototype,E,{enumerable:!1,value:u.eventsProto[E],writable:!0});("getOwnPropertySymbols"in Object?Object.getOwnPropertySymbols(u.eventsProto):[m.for("can.onKeyValue"),m.for("can.offKeyValue")]).forEach(function(e){Object.defineProperty(L.prototype,e,{enumerable:!1,value:u.eventsProto[e],writable:!0})}),u.DefineMap=L,Object.defineProperty(L.prototype,"toObject",{enumerable:!1,writable:!0,value:function(){return h.warn("Use DefineMap::get instead of DefineMap::toObject"),this.get()}}),Object.defineProperty(L.prototype,"each",{enumerable:!1,writable:!0,value:L.prototype.forEach}),n.exports=f.DefineMap=L}),define("can-define/list/list",["require","exports","module","can-construct","can-define","can-queues","can-observation","can-util/js/log/log","can-util/js/dev/dev","can-define/define-helpers/define-helpers","can-log/dev/dev","can-define/ensure-meta","can-util/js/assign/assign","can-util/js/diff/diff","can-util/js/each/each","can-util/js/make-array/make-array","can-namespace","can-reflect","can-symbol","can-util/js/cid-set/cid-set","can-util/js/cid-map/cid-map","can-util/js/single-reference/single-reference"],function(e,t,n){var i=e("can-construct"),a=e("can-define"),r=a.make,o=e("can-queues"),s=e("can-observation"),c=e("can-util/js/log/log"),l=e("can-util/js/dev/dev"),u=e("can-define/define-helpers/define-helpers"),d=e("can-log/dev/dev"),p=e("can-define/ensure-meta"),f=e("can-util/js/assign/assign"),h=e("can-util/js/diff/diff"),v=e("can-util/js/each/each"),m=e("can-util/js/make-array/make-array"),g=e("can-namespace"),y=e("can-reflect"),b=e("can-symbol"),w=e("can-util/js/cid-set/cid-set"),k=e("can-util/js/cid-map/cid-map"),x=e("can-util/js/single-reference/single-reference"),j=[].splice,L=!1,E=function(e){return e},V=function(e){return function(t){for(var n in e)if(t[n]!==e[n])return!1;return!0}},O=a.eventsProto[b.for("can.onKeyValue")],C=a.eventsProto[b.for("can.offKeyValue")],_=i.extend("DefineList",{setup:function(e){if(_){var t=this.prototype,n=a(t,t,e.prototype._define),i=n.definitions["#"]||n.defaultDefinition;i&&(i.Type?this.prototype.__type=r.set.Type("*",i.Type,E):i.type&&(this.prototype.__type=r.set.type("*",i.type,E)))}}},{setup:function(e){this._define||(Object.defineProperty(this,"_define",{enumerable:!1,value:{definitions:{length:{type:"number"},_length:{type:"number"}}}}),Object.defineProperty(this,"_data",{enumerable:!1,value:{}})),a.setup.call(this,{},!1),Object.defineProperty(this,"_length",{enumerable:!1,configurable:!0,writable:!0,value:0}),e&&this.splice.apply(this,[0,0].concat(y.toArray(e)))},__type:a.types.observable,_triggerChange:function(e,t,n,i){var a=+e;if(isNaN(a))this.dispatch({type:""+e,target:this},[n,i]);else{var r=this._define.definitions["#"];"add"===t?(r&&"function"==typeof r.added&&s.ignore(r.added).call(this,n,a),o.batch.start(),this.dispatch({type:t,reasonLog:[y.getName(this),"added",JSON.stringify(n),"at",a]},[n,a]),this.dispatch("can.onPatches",[[{insert:n,index:a,deleteCount:0}]]),o.batch.stop()):"remove"===t?(r&&"function"==typeof r.removed&&s.ignore(r.removed).call(this,i,a),o.batch.start(),this.dispatch({type:t,reasonLog:[y.getName(this),"remove",JSON.stringify(i),"at",a]},[i,a]),this.dispatch("can.onPatches",[[{index:a,deleteCount:i.length}]]),o.batch.stop()):this.dispatch(t,[n,a])}},get:function(e){return arguments.length?(isNaN(e)?s.add(this,e):s.add(this,"length"),this[e]):y.unwrap(this,k)},set:function(e,t){if("object"!=typeof e)if("number"==typeof(e=isNaN(+e)||e%1?e:+e)){if("number"==typeof e&&e>this._length-1){var n=new Array(e+1-this._length);return n[n.length-1]=t,this.push.apply(this,n),n}this.splice(e,1,t)}else u.defineExpando(this,e,t)||(this[e]=t);else l.warn("can-define/list/list.prototype.set is deprecated; please use can-define/list/list.prototype.assign or can-define/list/list.prototype.update instead"),y.isListLike(e)?t?this.replace(e):y.assignList(this,e):y.assignMap(this,e);return this},assign:function(e){return y.isListLike(e)?y.assignList(this,e):y.assignMap(this,e),this},update:function(e){return y.isListLike(e)?y.updateList(this,e):y.updateMap(this,e),this},assignDeep:function(e){return y.isListLike(e)?y.assignDeepList(this,e):y.assignDeepMap(this,e),this},updateDeep:function(e){return y.isListLike(e)?y.updateDeepList(this,e):y.updateDeepMap(this,e),this},_items:function(){var e=[];return this._each(function(t){e.push(t)}),e},_each:function(e){for(var t=0,n=this._length;t<n;t++)e(this[t],t)},splice:function(e,t){var n,i,a,r=m(arguments),s=[],c=r.length>2,l=this._length;for(e=e||0,n=0,i=r.length-2;n<i;n++)r[a=n+2]=this.__type(r[a],a),s.push(r[a]),this[n+e]!==r[a]&&(c=!1);if(c&&this._length<=s.length)return s;void 0===t&&(t=r[1]=this._length-e),L=!0;var u=j.apply(this,r);return L=!1,o.batch.start(),t>0&&this._triggerChange(""+e,"remove",void 0,u),r.length>2&&this._triggerChange(""+e,"add",s,u),this.dispatch("length",[this._length,l]),o.batch.stop(),u},serialize:function(){return y.serialize(this,k)},log:function(e){var t=this,n=function(e){return"string"==typeof e?JSON.stringify(e):e},i=p(t),a=i.allowedLogKeysSet||new Set;i.allowedLogKeysSet=a,e&&a.add(e),i._log=function(i,r){var o=i.type;"can.onPatches"===o||e&&!a.has(o)||("add"===o||"remove"===o?d.log(y.getName(t),"\n how ",n(o),"\n what ",n(r[0]),"\n index ",n(r[1])):d.log(y.getName(t),"\n key ",n(o),"\n is ",n(r[0]),"\n was ",n(r[1])))}}}),D=function(e){return e[0]&&Array.isArray(e[0])?e[0]:m(e)};v({push:"length",unshift:0},function(e,t){var n=[][t];_.prototype[t]=function(){for(var t,i,a=[],r=e?this._length:0,s=arguments.length;s--;)i=arguments[s],a[s]=this.__type(i,s);return L=!0,t=n.apply(this,a),L=!1,this.comparator&&!a.length||(o.batch.start(),this._triggerChange(""+r,"add",a,void 0),this.dispatch("length",[this._length,r]),o.batch.stop()),t}}),v({pop:"length",shift:0},function(e,t){var n=[][t];_.prototype[t]=function(){if(this._length){var t,i=D(arguments),a=e&&this._length?this._length-1:0,r=this._length?this._length:0;return L=!0,t=n.apply(this,i),L=!1,o.batch.start(),this._triggerChange(""+a,"remove",void 0,[t]),this.dispatch("length",[this._length,r]),o.batch.stop(),t}}}),v({map:3,filter:3,reduce:4,reduceRight:4,every:3,some:3},function(e,t){_.prototype[t]=function(){var n=this,i=[].slice.call(arguments,0),a=i[0],r=i[e-1]||n;"object"==typeof a&&(a=V(a)),i[0]=function(){var t=[].slice.call(arguments,0);return t[e-3]=n.get(t[e-2]),a.apply(r,t)};var o=Array.prototype[t].apply(this,i);return"map"===t?new _(o):"filter"===t?new n.constructor(o):o}}),f(_.prototype,{indexOf:function(e,t){for(var n=t||0,i=this.length;n<i;n++)if(this.get(n)===e)return n;return-1},lastIndexOf:function(e,t){for(var n=t=void 0===t?this.length-1:t;n>=0;n--)if(this.get(n)===e)return n;return-1},join:function(){return s.add(this,"length"),[].join.apply(this,arguments)},reverse:function(){var e=[].reverse.call(this._items());return this.replace(e)},slice:function(){s.add(this,"length");var e=Array.prototype.slice.apply(this,arguments);return new this.constructor(e)},concat:function(){var e=[];return v(arguments,function(t){y.isListLike(t)?(Array.isArray(t)?t:m(t)).forEach(function(t){e.push(this.__type(t))},this):e.push(this.__type(t))},this),new this.constructor(Array.prototype.concat.apply(m(this),e))},forEach:function(e,t){for(var n,i=0,a=this.length;i<a&&(n=this.get(i),!1!==e.call(t||n,n,i,this));i++);return this},replace:function(e){var t=h(this,e);o.batch.start();for(var n=0,i=t.length;n<i;n++)this.splice.apply(this,[t[n].index,t[n].deleteCount].concat(t[n].insert));return o.batch.stop(),this},sort:function(e){var t=Array.prototype.slice.call(this);Array.prototype.sort.call(this,e);var n=Array.prototype.slice.call(this);return o.batch.start(),this.dispatch("remove",[t,0]),this.dispatch("add",[n,0]),this.dispatch("length",[this._length,this._length]),o.batch.stop(),this}});for(var S in a.eventsProto)_[S]=a.eventsProto[S],Object.defineProperty(_.prototype,S,{enumerable:!1,value:a.eventsProto[S],writable:!0});Object.defineProperty(_.prototype,"length",{get:function(){return this.__inSetup||s.add(this,"length"),this._length},set:function(e){if(L)this._length=e;else if(null!=e&&!isNaN(+e)&&e!==this._length)if(e>this._length-1){var t=new Array(e-this._length);this.push.apply(this,t)}else this.splice(e)},enumerable:!0}),Object.defineProperty(_.prototype,"each",{enumerable:!1,writable:!0,value:_.prototype.forEach}),_.prototype.attr=function(e,t){return c.warn("DefineMap::attr shouldn't be called"),0===arguments.length?this.get():e&&"object"==typeof e?this.set.apply(this,arguments):1===arguments.length?this.get(e):this.set(e,t)},_.prototype.item=function(e,t){return 1===arguments.length?this.get(e):this.set(e,t)},_.prototype.items=function(){return c.warn("DefineList::get should should be used instead of DefineList::items"),this.get()},y.assignSymbols(_.prototype,{"can.isMoreListLikeThanMapLike":!0,"can.isMapLike":!0,"can.isListLike":!0,"can.isValueLike":!1,"can.getKeyValue":_.prototype.get,"can.setKeyValue":_.prototype.set,"can.onKeyValue":function(e,t,n){var i;return isNaN(e)?O.apply(this,arguments):(i=function(){t(this[e])},Object.defineProperty(i,"name",{value:"translationHandler("+e+")::"+y.getName(this)+".onKeyValue('length',"+y.getName(t)+")"}),x.set(t,this,i,e),O.call(this,"length",i,n))},"can.offKeyValue":function(e,t,n){var i;return isNaN(e)?C.apply(this,arguments):(i=x.getAndDelete(t,this,e),C.call(this,"length",i,n))},"can.deleteKeyValue":function(e){if("number"==typeof(e=isNaN(+e)||e%1?e:+e))this.splice(e,1);else{if("length"===e||"_length"===e)return;this.set(e,void 0)}return this},"can.assignDeep":function(e){o.batch.start(),y.assignList(this,e),o.batch.stop()},"can.updateDeep":function(e){o.batch.start(),this.replace(e),o.batch.stop()},"can.keyHasDependencies":function(e){return!!(this._computed&&this._computed[e]&&this._computed[e].compute)},"can.getKeyDependencies":function(e){var t;return this._computed&&this._computed[e]&&this._computed[e].compute&&((t={}).valueDependencies=new w,t.valueDependencies.add(this._computed[e].compute)),t},"can.splice":function(e,t,n){this.splice.apply(this,[e,t].concat(n))},"can.onPatches":function(e,t){this[b.for("can.onKeyValue")]("can.onPatches",e,t)},"can.offPatches":function(e,t){this[b.for("can.offKeyValue")]("can.onPatches",e,t)},"can.getName":function(){return y.getName(this.constructor)+"[]"}}),y.setKeyValue(_.prototype,b.iterator,function(){var e=-1;return"number"!=typeof this._length&&(this._length=0),{next:function(){return e++,{value:this[e],done:e>=this._length}}.bind(this)}}),a.DefineList=_,n.exports=g.DefineList=_}),define("can-view-target",["require","exports","module","can-util/dom/child-nodes/child-nodes","can-util/dom/attr/attr","can-util/js/each/each","can-util/js/make-array/make-array","can-util/dom/document/document","can-util/dom/mutate/mutate","can-namespace","can-globals/mutation-observer/mutation-observer"],function(e,t,n){!function(e,t,n,i){function a(e,t,n,i){var a,r,o,s,c,u=n,d=typeof e,p=function(){return a||(a={path:n,callbacks:[]},t.push(a),u=[]),a};if("object"===d){if(e.tag){if(r=b&&e.namespace?i.createElementNS(e.namespace,e.tag):i.createElement(e.tag),e.attrs)for(var h in e.attrs){var v=e.attrs[h];"function"==typeof v?p().callbacks.push({callback:v}):l.setAttribute(r,h,v)}if(e.attributes)for(s=0,c=e.attributes.length;s<c;s++)p().callbacks.push({callback:e.attributes[s]});e.children&&e.children.length&&(o=a?a.paths=[]:t,r.appendChild(m(e.children,o,u,i)))}else if(e.comment&&(r=i.createComment(e.comment),e.callbacks))for(s=0,c=e.attributes.length;s<c;s++)p().callbacks.push({callback:e.callbacks[s]})}else"string"===d?r=i.createTextNode(e):"function"===d&&(g?(r=i.createTextNode(""),p().callbacks.push({callback:e})):(r=i.createComment("~"),p().callbacks.push({callback:function(){var t=i.createTextNode("");return f.replaceChild.call(this.parentNode,t,this),e.apply(t,arguments)}})));return r}function r(e,t,n){for(var i=t.path,a=t.callbacks,o=t.paths,s=e,c=i?i.length:0,l=o?o.length:0,u=0;u<c;u++)s=s.childNodes.item(i[u]);for(u=0;u<l;u++)r(s,o[u],n);n.push({element:s,callbacks:a})}function o(e,t){for(var n,i,a,r=e.length,o=0;o<r;o++){n=(a=e[o]).callbacks.length,i=a.element;for(var s=0;s<n;s++)a.callbacks[s].callback.apply(i,t)}}function s(e,t){var n=[],i=m(e,n,[],t||p());return{paths:n,clone:i,hydrate:function(){for(var e=w(this.clone),t=d(arguments),i=[],a=0;a<n.length;a++)r(e,n[a],i);return o(i,t),e}}}var c=t("can-util/dom/child-nodes/child-nodes"),l=t("can-util/dom/attr/attr"),u=t("can-util/js/each/each"),d=t("can-util/js/make-array/make-array"),p=t("can-util/dom/document/document"),f=t("can-util/dom/mutate/mutate"),h=t("can-namespace"),v=t("can-globals/mutation-observer/mutation-observer"),m=function(e,t,n,i){for(var r=i.createDocumentFragment(),o=0,s=e.length;o<s;o++){var c=e[o];r.appendChild(a(c,t,n.concat(o),i))}return r},g="undefined"!=typeof document&&function(){var e=document.createDocumentFragment(),t=document.createElement("div");t.appendChild(document.createTextNode("")),t.appendChild(document.createTextNode("")),e.appendChild(t);var n=e.cloneNode(!0);return 2===c(n.firstChild).length}(),y="undefined"!=typeof document&&function(){var e=document.createElement("a");e.innerHTML="<xyz></xyz>";var t,n,i=e.cloneNode(!0),a="<xyz></xyz>"===i.innerHTML;return a?((e=document.createDocumentFragment()).appendChild(document.createTextNode("foo-bar")),(t=v())?((n=new t(function(){})).observe(document.documentElement,{childList:!0,subtree:!0}),i=e.cloneNode(!0),n.disconnect()):i=e.cloneNode(!0),1===i.childNodes.length):a}(),b="undefined"!=typeof document&&!!document.createElementNS,w=y?function(e){return e.cloneNode(!0)}:function(e){var t,n=e.ownerDocument;if(1===e.nodeType?t="http://www.w3.org/1999/xhtml"!==e.namespaceURI&&b&&n.createElementNS?n.createElementNS(e.namespaceURI,e.nodeName):n.createElement(e.nodeName):3===e.nodeType?t=n.createTextNode(e.nodeValue):8===e.nodeType?t=n.createComment(e.nodeValue):11===e.nodeType&&(t=n.createDocumentFragment()),e.attributes){var i=d(e.attributes);u(i,function(e){e&&e.specified&&l.setAttribute(t,e.nodeName||e.name,e.nodeValue||e.value)})}if(e&&e.firstChild)for(var a=e.firstChild;a;)t.appendChild(w(a)),a=a.nextSibling;return t};s.keepsTextNodes=g,s.cloneNode=w,h.view=h.view||{},i.exports=h.view.target=s}(0,e,0,n)}),define("can-stache/src/mustache_core",["require","exports","module","can-view-live","can-view-nodelist","can-observation","can-stache/src/utils","can-stache/src/expression","can-util/dom/frag/frag","can-util/dom/attr/attr","can-symbol","can-reflect"],function(e,t,n){var i=e("can-view-live"),a=e("can-view-nodelist"),r=e("can-observation"),o=e("can-stache/src/utils"),s=e("can-stache/src/expression"),c=e("can-util/dom/frag/frag"),l=e("can-util/dom/attr/attr"),u=e("can-symbol"),d=e("can-reflect"),p=/(?:(^|\r?\n)(\s*)(\{\{([\s\S]*)\}\}\}?)([^\S\n\r]*)($|\r?\n))|(\{\{([\s\S]*)\}\}\}?)/g,f=/(\s*)(\{\{\{?)(-?)([\s\S]*?)(-?)(\}\}\}?)(\s*)/g,h=function(){},v={expression:s,makeEvaluator:function(e,t,n,i,a,r,l,u){if("^"===i){var p=r;r=l,l=p}var f,h;if(a instanceof s.Call){if(h={context:e.peek("."),scope:e,nodeList:n,exprData:a,helpersScope:t},o.convertToScopes(h,e,t,n,r,l,u),f=a.value(e,t,h),a.isHelper)return f}else if(a instanceof s.Bracket){if(f=a.value(e),a.isHelper)return f}else if(a instanceof s.Lookup){if(f=a.value(e),a.isHelper)return f}else if(a instanceof s.Helper&&a.methodExpr instanceof s.Bracket){if(f=a.methodExpr.value(e),a.isHelper)return f}else{var v={isArgument:!0,args:[e.peek("."),e],asCompute:!0},m=a.helperAndValue(e,t,v,n,r,l,u),g=m.helper;if(f=m.value,g)return a.evaluator(g,e,t,v,n,r,l,u)}return i?"#"===i||"^"===i?(h={},o.convertToScopes(h,e,t,n,r,l,u),function(){var n=d.getValue(f);if("function"==typeof n)return n;if("string"!=typeof n&&o.isArrayLike(n)){var i=d.isObservableLike(n)&&d.isListLike(n);return(i?n.attr("length"):n.length)?u?o.getItemsStringContent(n,i,h,t):c(o.getItemsFragContent(n,h,e)):h.inverse(e,t)}return n?h.fn(n||e,t):h.inverse(e,t)}):void 0:f},makeLiveBindingPartialRenderer:function(e,t){var n,o=(e=e.trim()).split(/\s+/).shift();return o!==e&&(n=v.expression.parse(e)),function(e,s,l){var u=[this];u.expression=">"+o,a.register(u,null,l||!0,t.directlyNested);var p=new r(function(){var t=o;if(n&&1===n.argExprs.length){var i=d.getValue(n.argExprs[0].value(e,s));void 0===i?dev.warn("The context ("+n.argExprs[0].key+") you passed into thepartial ("+o+") is not defined in the scope!"):e=e.add(i)}var a,l=s.peek("partials."+t);if(l=l||s.inlinePartials&&s.inlinePartials[t])a=function(){return l.render?l.render(e,s,u):l(e,s)};else{var p=e.read(t,{isArgument:!0}).value;if(null===p||!p&&"*"===t[0])return c("");p&&(t=p),a=function(){return"function"==typeof t?t(e,s,u):v.getTemplateById(t)(e,s,u)}}var f=r.ignore(a)();return c(f)});d.setPriority(p,u.nesting),i.html(this,p,this.parentNode,u)}},makeStringBranchRenderer:function(e,t){var n=v.expression.parse(t),i=e+t;n instanceof s.Helper||n instanceof s.Call||(n=new s.Helper(n,[],{}));var a=function(t,a,r,o){var s=t.__cache[i];!e&&s||(s=m(t,a,null,e,n,r,o,!0),e||(t.__cache[i]=s));var c;return null==(c=s[u.for("can.onValue")]?d.getValue(s):s())?"":""+c};return a.exprData=n,a},makeLiveBindingBranchRenderer:function(e,t,n){var o=v.expression.parse(t);o instanceof s.Helper||o instanceof s.Call||o instanceof s.Bracket||o instanceof s.Lookup||(o=new s.Helper(o,[],{}));var p=function(s,p,f,v,g){var y=[this];y.expression=t,a.register(y,null,f||!0,n.directlyNested);var b,w=m(s,p,y,e,o,v,g,n.tag);if(w[u.for("can.onValue")]?b=w:(Object.defineProperty(w,"name",{value:"{{"+t+"}}"}),b=new r(w,null,{isObservable:!1})),!1===d.setPriority(b,y.nesting))throw new Error("can-stache unable to set priority on observable");d.onValue(b,h);var k=d.getValue(b);"function"==typeof k?r.ignore(k)(this):d.valueHasDependencies(b)?n.attr?i.attr(this,n.attr,b):n.tag?i.attrs(this,b):n.text&&"object"!=typeof k?i.text(this,b,this.parentNode,y):i.html(this,b,this.parentNode,y):n.attr?l.set(this,n.attr,k):n.tag?i.attrs(this,k):n.text&&"string"==typeof k?this.nodeValue=k:null!=k&&a.replace([this],c(k,this.ownerDocument)),d.offValue(b,h)};return p.exprData=o,p},splitModeFromExpression:function(e,t){var n=(e=e.trim()).charAt(0);return"#/{&^>!<".indexOf(n)>=0?e=e.substr(1).trim():n=null,"{"===n&&t.node&&(n=null),{mode:n,expression:e}},cleanLineEndings:function(e){return e.replace(p,function(e,t,n,i,a,r,o,s,c,l){r=r||"",t=t||"",n=n||"";var u=g(a||c,{});return s||">{".indexOf(u.mode)>=0?e:"^#!/".indexOf(u.mode)>=0?(n=t+n&&" ")+i+(0!==l&&o.length?t+"\n":""):n+i+r+(n.length||0!==l?t+"\n":"")})},cleanWhitespaceControl:function(e){return e.replace(f,function(e,t,n,i,a,r,o,s,c){return"-"===i&&(t=""),"-"===r&&(s=""),t+n+a+o+s})},Options:o.Options,getTemplateById:function(){}},m=v.makeEvaluator,g=v.splitModeFromExpression;n.exports=v}),define("can-stache/src/html_section",["require","exports","module","can-view-target","can-view-scope","can-observation","can-stache/src/utils","can-stache/src/mustache_core","can-util/dom/document/document","can-util/js/assign/assign","can-util/js/last/last"],function(e,t,n){var i=e("can-view-target"),a=e("can-view-scope"),r=e("can-observation"),o=e("can-stache/src/utils"),s=e("can-stache/src/mustache_core"),c=e("can-util/dom/document/document"),l=e("can-util/js/assign/assign"),u=e("can-util/js/last/last"),d="undefined"!=typeof document&&function(){var e=c().createElement("div");return function(t){return-1===t.indexOf("&")?t.replace(/\r\n/g,"\n"):(e.innerHTML=t,0===e.childNodes.length?"":e.childNodes.item(0).nodeValue)}}(),p=function(){this.stack=[new f]};p.scopify=function(e){return r.ignore(function(t,n,i){return t instanceof a||(t=a.refsScope().add(t||{})),n instanceof s.Options||(n=new s.Options(n||{})),e(t,n,i)})},l(p.prototype,o.mixins),l(p.prototype,{startSubSection:function(e){var t=new f(e);return this.stack.push(t),t},endSubSectionAndReturnRenderer:function(){if(this.last().isEmpty())return this.stack.pop(),null;var e=this.endSection();return e.compiled.hydrate.bind(e.compiled)},startSection:function(e){var t=new f(e);this.last().add(t.targetCallback),this.stack.push(t)},endSection:function(){return this.last().compile(),this.stack.pop()},inverse:function(){this.last().inverse()},compile:function(){var e=this.stack.pop().compile();return r.ignore(function(t,n,i){return t instanceof a||(t=a.refsScope().add(t||{})),n instanceof s.Options||(n=new s.Options(n||{})),e.hydrate(t,n,i)})},push:function(e){this.last().push(e)},pop:function(){return this.last().pop()},removeCurrentNode:function(){this.last().removeCurrentNode()}});var f=function(e){this.data="targetData",this.targetData=[],this.targetStack=[];var t=this;this.targetCallback=function(n,i,a){e.call(this,n,i,a,t.compiled.hydrate.bind(t.compiled),t.inverseCompiled&&t.inverseCompiled.hydrate.bind(t.inverseCompiled))}};l(f.prototype,{inverse:function(){this.inverseData=[],this.data="inverseData"},push:function(e){this.add(e),this.targetStack.push(e)},pop:function(){return this.targetStack.pop()},add:function(e){"string"==typeof e&&(e=d(e)),this.targetStack.length?u(this.targetStack).children.push(e):this[this.data].push(e)},compile:function(){return this.compiled=i(this.targetData,c()),this.inverseData&&(this.inverseCompiled=i(this.inverseData,c()),delete this.inverseData),this.targetStack=this.targetData=null,this.compiled},removeCurrentNode:function(){return this.children().pop()},children:function(){return this.targetStack.length?u(this.targetStack).children:this[this.data]},isEmpty:function(){return!this.targetData.length}}),p.HTMLSection=f,n.exports=p}),define("can-stache/src/text_section",["require","exports","module","can-view-live","can-stache/src/utils","can-util/dom/attr/attr","can-util/js/assign/assign","can-reflect","can-observation"],function(e,t,n){var i=e("can-view-live"),a=e("can-stache/src/utils"),r=e("can-util/dom/attr/attr"),o=e("can-util/js/assign/assign"),s=e("can-reflect"),c=e("can-observation"),l=function(){},u=function(){this.stack=[new p]};o(u.prototype,a.mixins),o(u.prototype,{startSection:function(e){var t=new p;this.last().add({process:e,truthy:t}),this.stack.push(t)},endSection:function(){this.stack.pop()},inverse:function(){this.stack.pop();var e=new p;this.last().last().falsey=e,this.stack.push(e)},compile:function(e){var t=this.stack[0].compile();return Object.defineProperty(t,"name",{value:"textSectionRenderer<"+e.tag+"."+e.attr+">"}),function(n,a){function o(){return t(n,a)}Object.defineProperty(o,"name",{value:"textSectionRender<"+e.tag+"."+e.attr+">"});var u=new c(o,null,{isObservable:!1});s.onValue(u,l);var d=s.getValue(u);s.valueHasDependencies(u)?(e.textContentOnly?i.text(this,u):e.attr?i.attr(this,e.attr,u):i.attrs(this,u,n,a),s.offValue(u,l)):e.textContentOnly?this.nodeValue=d:e.attr?r.set(this,e.attr,d):i.attrs(this,d)}}});var d=function(e,t,n){return function(i,a){return e.call(this,i,a,t,n)}},p=function(){this.values=[]};o(p.prototype,{add:function(e){this.values.push(e)},last:function(){return this.values[this.values.length-1]},compile:function(){for(var e=this.values,t=e.length,n=0;n<t;n++){var i=this.values[n];"object"==typeof i&&(e[n]=d(i.process,i.truthy&&i.truthy.compile(),i.falsey&&i.falsey.compile()))}return function(n,i){for(var a,r="",o=0;o<t;o++)r+="string"==typeof(a=e[o])?a:a.call(this,n,i);return r}}}),n.exports=u}),define("can-stache/helpers/converter",["require","exports","module","can-stache/helpers/core","can-stache/src/expression","can-util/js/make-array/make-array"],function(e,t,n){var i=e("can-stache/helpers/core"),a=e("can-stache/src/expression"),r=e("can-util/js/make-array/make-array");i.registerConverter=function(e,t){t=t||{},i.registerHelper(e,function(e,n){var i=r(arguments);return e instanceof a.SetIdentifier?"function"==typeof t.set?t.set.apply(this,[e.value].concat(i.slice(1))):n(e.value):"function"==typeof t.get?t.get.apply(this,i):i[0]})},n.exports=i}),define("can-stache/src/intermediate_and_imports",["require","exports","module","can-stache/src/mustache_core","can-view-parser"],function(e,t,n){var i=e("can-stache/src/mustache_core"),a=e("can-view-parser");n.exports=function(e){function t(){f&&(s[f]=h,f=""),p?o.push(h):r.push(h)}var n=e;n=i.cleanWhitespaceControl(n),n=i.cleanLineEndings(n);var r=[],o=[],s={},c=!1,l=!1,u=!1,d=!1,p=!1,f="",h="";return{intermediate:a(n,{start:function(e,t){"can-import"===e?(d=t,p=!1,c=!0):"can-dynamic-import"===e?(d=t,p=!0,c=!0):c&&(p=!0,c=!1)},attrStart:function(e){"from"===e?l=!0:"as"!==e&&"export-as"!==e||(u=!0)},attrEnd:function(e){"from"===e?l=!1:"as"!==e&&"export-as"!==e||(u=!1)},attrValue:function(e){l&&c?h=e:u&&c&&(f=e)},end:function(e){"can-import"!==e&&"can-dymamic-import"!==e||!d||t()},close:function(e){"can-import"!==e&&"can-dymamic-import"!==e||t()},chars:function(e){e.trim().length>0&&(p=!0)},special:function(e){p=!0}},!0),imports:r,dynamicImports:o,ases:s,exports:s}}}),define("can-util/js/import/import",["require","exports","module","can-util/js/is-function/is-function","can-globals/global/global"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-util/js/is-function/is-function"),e=t("can-globals/global/global")();i.exports=function(t,n){return new Promise(function(i,r){try{"object"==typeof e.System&&a(e.System.import)?e.System.import(t,{name:n}).then(i,r):e.define&&e.define.amd?e.require([t],function(e){i(e)}):e.require?i(e.require(t)):i()}catch(e){r(e)}})}}(function(){return this}(),e,0,n)}),define("can-stache",["require","exports","module","can-view-parser","can-view-callbacks","can-stache/src/html_section","can-stache/src/text_section","can-stache/src/mustache_core","can-stache/helpers/core","can-stache/helpers/converter","can-stache/src/intermediate_and_imports","can-stache/src/utils","can-attribute-encoder","can-util/js/dev/dev","can-namespace","can-util/dom/document/document","can-util/js/assign/assign","can-util/js/last/last","can-util/js/import/import","can-view-target","can-view-nodelist"],function(e,t,n){function i(e){var t={};"string"==typeof e&&(e=c.cleanWhitespaceControl(e),e=c.cleanLineEndings(e));var n=new o,i={node:null,attr:null,sectionElementStack:[],text:!1,namespaceStack:[],textContentOnly:null},l=function(e,n,a){if(">"===n)e.add(c.makeLiveBindingPartialRenderer(a,u()));else if("/"===n){if("<"===e.last().startedWith?(t[a]=e.endSubSectionAndReturnRenderer(),e.removeCurrentNode()):e.endSection(),e instanceof o){var r=i.sectionElementStack[i.sectionElementStack.length-1].tag;""!==a&&a!==r&&f.warn("unexpected closing tag {{/"+a+"}} expected {{/"+r+"}}"),i.sectionElementStack.pop()}}else if("else"===n)e.inverse();else{var s=e instanceof o?c.makeLiveBindingBranchRenderer:c.makeStringBranchRenderer;if("{"===n||"&"===n)e.add(s(null,a,u()));else if("#"===n||"^"===n||"<"===n){var l=s(n,a,u());if(e.startSection(l),e.last().startedWith=n,e instanceof o){var d="function"==typeof l.exprData.closingTag?l.exprData.closingTag():"";i.sectionElementStack.push({type:"section",tag:d})}}else e.add(s(null,a,u({text:!0})))}},u=function(e){var t=i.sectionElementStack[i.sectionElementStack.length-1],n={tag:i.node&&i.node.tag,attr:i.attr&&i.attr.name,directlyNested:!i.sectionElementStack.length||("section"===t.type||"custom"===t.type),textContentOnly:!!i.textContentOnly};return e?m(n,e):n},h=function(e,t){e.attributes||(e.attributes=[]),e.attributes.unshift(t)};a(e,{start:function(e,t){var n=k[e];n&&!t&&i.namespaceStack.push(n),i.node={tag:e,children:[],namespace:n||g(i.namespaceStack)}},end:function(e,t){var a=r.tag(e);t?(n.add(i.node),a&&h(i.node,function(t,n,i){r.tagHandler(this,e,{scope:t,options:n,subtemplate:null,templateType:"stache",parentNodeList:i})})):(n.push(i.node),i.sectionElementStack.push({type:a?"custom":null,tag:a?null:e,templates:{}}),a?n.startSubSection():x[e]&&(i.textContentOnly=new s)),i.node=null},close:function(e){k[e]&&i.namespaceStack.pop();var t,a=r.tag(e);a&&(t=n.endSubSectionAndReturnRenderer()),x[e]&&(n.last().add(i.textContentOnly.compile(u())),i.textContentOnly=null);var o=n.pop();if(a)if("can-template"===e)i.sectionElementStack[i.sectionElementStack.length-2].templates[o.attrs.name]=d(t),n.removeCurrentNode();else{var s=i.sectionElementStack[i.sectionElementStack.length-1];h(o,function(n,i,a){r.tagHandler(this,e,{scope:n,options:i,subtemplate:t?d(t):t,templateType:"stache",parentNodeList:a,templates:s.templates})})}i.sectionElementStack.pop()},attrStart:function(e){i.node.section?i.node.section.add(e+'="'):i.attr={name:e,value:""}},attrEnd:function(e){if(i.node.section)i.node.section.add('" ');else{i.node.attrs||(i.node.attrs={}),i.node.attrs[i.attr.name]=i.attr.section?i.attr.section.compile(u()):i.attr.value;var t=r.attr(e),n=p.decode(e);weirdAttribute=!!b.test(n)||!!w.test(n),weirdAttribute&&!t&&f.warn("unknown attribute binding "+n+". Is can-stache-bindings imported?"),t&&(i.node.attributes||(i.node.attributes=[]),i.node.attributes.push(function(n,i,a){t(this,{attributeName:e,scope:n,options:i,nodeList:a})})),i.attr=null}},attrValue:function(e){var t=i.node.section||i.attr.section;t?t.add(e):i.attr.value+=e},chars:function(e){(i.textContentOnly||n).add(e)},special:function(e){var t=c.splitModeFromExpression(e,i),a=t.mode,r=t.expression;if("else"!==r){if("!"!==a)if(i.node&&i.node.section)l(i.node.section,a,r),0===i.node.section.subSectionDepth()&&(i.node.attributes.push(i.node.section.compile(u())),delete i.node.section);else if(i.attr)i.attr.section||(i.attr.section=new s,i.attr.value&&i.attr.section.add(i.attr.value)),l(i.attr.section,a,r);else if(i.node)if(i.node.attributes||(i.node.attributes=[]),a){if("#"!==a&&"^"!==a)throw new Error(a+" is currently not supported within a tag.");i.node.section||(i.node.section=new s),l(i.node.section,a,r)}else i.node.attributes.push(c.makeLiveBindingBranchRenderer(null,r,u()));else l(i.textContentOnly||n,a,r)}else{(i.attr&&i.attr.section?i.attr.section:i.node&&i.node.section?i.node.section:i.textContentOnly||n).inverse()}},comment:function(e){n.add({comment:e})},done:function(){}});var v=n.compile(),y=o.scopify(function(e,n,i){return Object.keys(t).length&&(n.inlinePartials=n.inlinePartials||{},m(n.inlinePartials,t)),e.set("*self",y),v.apply(this,arguments)});return y}var a=e("can-view-parser"),r=e("can-view-callbacks"),o=e("can-stache/src/html_section"),s=e("can-stache/src/text_section"),c=e("can-stache/src/mustache_core"),l=e("can-stache/helpers/core");e("can-stache/helpers/converter");var u=e("can-stache/src/intermediate_and_imports"),d=e("can-stache/src/utils").makeRendererConvertScopes,p=e("can-attribute-encoder"),f=e("can-util/js/dev/dev"),h=e("can-namespace"),v=e("can-util/dom/document/document"),m=e("can-util/js/assign/assign"),g=e("can-util/js/last/last"),y=e("can-util/js/import/import");e("can-view-target"),e("can-view-nodelist"),r.tag("content",function(e,t){return t.scope});var b=/[{(].*[)}]/,w=/^on:|(:to|:from|:bind)$|.*:to:on:.*/,k={svg:"http://www.w3.org/2000/svg",g:"http://www.w3.org/2000/svg"},x={style:!0,script:!0};m(i,l),i.safeString=function(e){return{toString:function(){return e}}},i.async=function(e){var t=u(e),n=t.imports.map(function(e){return y(e)});return Promise.all(n).then(function(){return i(t.intermediate)})};var j={};i.from=c.getTemplateById=function(e){if(!j[e]){var t=v().getElementById(e);j[e]=i(t.innerHTML)}return j[e]},i.registerPartial=function(e,t){j[e]="string"==typeof t?i(t):t},n.exports=h.stache=i}),define("can-debug",["require","exports","module","can-namespace","can-symbol","can-reflect"],function(e,t,n){function i(e,t){var n=2===arguments.length,o={obj:e,key:t,keyDependencies:{},valueDependencies:[],name:c.getName(e),value:n?c.getKeyValue(e,t):c.getValue(e)},s=n?a(e,t):r(e);return s?(s.keyDependencies&&c.each(s.keyDependencies,function(e,t){c.each(e,function(e){o.keyDependencies[e]=i(t,e)})}),s.valueDependencies&&c.each(s.valueDependencies,function(e){o.valueDependencies.push(i(e))}),o):o}function a(e,t){if(e[l])return c.getKeyDependencies(e,t)}function r(e){if(e[u])return c.getValueDependencies(e)}var o=e("can-namespace"),s=e("can-symbol"),c=e("can-reflect"),l=s.for("can.getKeyDependencies"),u=s.for("can.getValueDependencies");i.logWhatChangesMe=function(e,t){var n=function(e){return"string"==typeof e?JSON.stringify(e):e},a=function e(t){var i=[t.name,null!=t.key?"."+t.key:""];console.group(i.join("")),console.log("value ",n(t.value)),console.log("object ",t.obj),c.each(t.keyDependencies,e),c.each(t.valueDependencies,e),console.groupEnd()};return a(2===arguments.length?i(e,t):i(e))},n.exports=o.debug=i}),define("can",["require","exports","module","can-util/namespace","can-component","can-define/map/map","can-define/list/list","can-stache","can-stache-bindings","can-debug"],function(e,t,n){!function(e,t,n,i){var a=t("can-util/namespace");t("can-component"),t("can-define/map/map"),t("can-define/list/list"),t("can-stache"),t("can-stache-bindings"),t("can-debug"),i.exports=a}(0,e,0,n)}),define("can-util/js/omit/omit",function(e,t,n){"use strict";n.exports=function(e,t){var n={};for(var i in e)t.indexOf(i)<0&&(n[i]=e[i]);return n}}),define("can-param",["require","exports","module","can-namespace"],function(e,t,n){function i(e,t,n){if(Array.isArray(t))for(var a=0,r=t.length;a<r;++a)n(e+"[]",t[a]);else if(t&&"object"==typeof t)for(var o in t)i(e+"["+o+"]",t[o],n);else n(e,t)}var a=e("can-namespace");n.exports=a.param=function(e){var t=[];for(var n in e)i(n,e[n],function(e,n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))});return t.join("&").replace(/%20/g,"+")}}),define("can-ajax",["require","exports","module","can-globals/global/global","can-assign","can-namespace","can-parse-uri","can-param"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals/global/global"),r=t("can-assign"),o=t("can-namespace"),s=t("can-parse-uri"),c=t("can-param"),l=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new ActiveXObject("MSXML2.XMLHTTP.3.0")},function(){return new ActiveXObject("MSXML2.XMLHTTP")}],u=null,d=s(a().location.href),p=function(){if(null!=u)return u();for(var e=0,t=l.length;e<t;e++)try{var n=l[e],i=n();if(null!=i)return u=n,i}catch(e){continue}return function(){}},f={json:"application/json",form:"application/x-www-form-urlencoded"},h=function(e,t){switch(t.dataType||e.getResponseHeader("Content-Type").split(";")[0]){case"text/xml":case"xml":return e.responseXML;case"text/json":case"application/json":case"text/javascript":case"application/javascript":case"application/x-javascript":case"json":return JSON.parse(e.responseText);default:return e.responseText}};i.exports=o.ajax=function(e){var t,n,i=p(),a=0,o={},l=new Promise(function(e,t){o.resolve=e,o.reject=t});if(l.abort=function(){i.abort()},(e=r({userAgent:"XMLHttpRequest",lang:"en",type:"GET",data:null,dataType:"json"},e)).contentType||(e.contentType="GET"===e.type.toUpperCase()?f.form:f.json),null==e.crossDomain)try{n=s(e.url),e.crossDomain=!!(n.protocol&&n.protocol!==d.protocol||n.host&&n.host!==d.host)}catch(t){e.crossDomain=!0}e.timeout&&(t=setTimeout(function(){i.abort(),e.timeoutFn&&e.timeoutFn(e.url)},e.timeout)),i.onreadystatechange=function(){try{4===i.readyState?(t&&clearTimeout(t),i.status<300?e.success&&e.success(h(i,e)):e.error&&e.error(i,i.status,i.statusText),e.complete&&e.complete(i,i.statusText),i.status>=200&&i.status<300?o.resolve(h(i,e)):o.reject(i)):e.progress&&e.progress(++a)}catch(e){o.reject(e)}};var u=e.url,v=null,m=e.type.toUpperCase(),g=e.contentType===f.json,y="POST"===m||"PUT"===m;!y&&e.data&&(u+="?"+(g?JSON.stringify(e.data):c(e.data))),i.open(m,u);var b=e.crossDomain&&-1!==["GET","POST","HEAD"].indexOf(m);if(y){v=g&&!b?"object"==typeof e.data?JSON.stringify(e.data):e.data:c(e.data);var w=g&&!b?"application/json":"application/x-www-form-urlencoded";i.setRequestHeader("Content-Type",w)}else i.setRequestHeader("Content-Type",e.contentType);return b||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(v),l}}(0,e,0,n)}),define("can-util/dom/ajax/ajax",["require","exports","module","can-log/dev/dev","can-ajax"],function(e,t,n){"use strict";e("can-log/dev/dev").warn("js/ajax/ajax is deprecated; please use can-ajax instead: https://github.com/canjs/can-ajax"),n.exports=e("can-ajax")}),define("can-globals/location/location",["require","exports","module","can-globals/global/global","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,i){"use strict";t("can-globals/global/global");var a=t("can-globals/can-globals-instance");a.define("location",function(){return a.getKeyValue("global").location}),i.exports=a.makeExport("location")}(0,e,0,n)}),define("can-globals",["require","exports","module","can-globals/can-globals-instance","can-globals/global/global","can-globals/document/document","can-globals/location/location","can-globals/mutation-observer/mutation-observer","can-globals/is-browser-window/is-browser-window"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals/can-globals-instance");t("can-globals/global/global"),t("can-globals/document/document"),t("can-globals/location/location"),t("can-globals/mutation-observer/mutation-observer"),t("can-globals/is-browser-window/is-browser-window"),i.exports=a}(0,e,0,n)}),define("can-util/dom/mutation-observer/mutation-observer",["require","exports","module","can-globals"],function(e,t,n){!function(e,t,n,i){"use strict";var a=t("can-globals");i.exports=function(e){return void 0!==e&&a.setKeyValue("MutationObserver",function(){return e}),a.getKeyValue("MutationObserver")}}(0,e,0,n)}),define("can-util/dom/dom",["require","exports","module","can-util/dom/ajax/ajax","can-util/dom/attr/attr","can-util/dom/child-nodes/child-nodes","can-util/dom/class-name/class-name","can-util/dom/contains/contains","can-util/dom/data/data","can-util/dom/dispatch/dispatch","can-util/dom/document/document","can-util/dom/events/events","can-util/dom/frag/frag","can-util/dom/fragment/fragment","can-util/dom/is-of-global-document/is-of-global-document","can-util/dom/matches/matches","can-util/dom/mutate/mutate","can-util/dom/mutation-observer/mutation-observer"],function(e,t,n){!function(e,t,n,i){"use strict";i.exports={ajax:t("can-util/dom/ajax/ajax"),attr:t("can-util/dom/attr/attr"),childNodes:t("can-util/dom/child-nodes/child-nodes"),className:t("can-util/dom/class-name/class-name"),contains:t("can-util/dom/contains/contains"),data:t("can-util/dom/data/data"),dispatch:t("can-util/dom/dispatch/dispatch"),document:t("can-util/dom/document/document"),events:t("can-util/dom/events/events"),frag:t("can-util/dom/frag/frag"),fragment:t("can-util/dom/fragment/fragment"),isOfGlobalDocument:t("can-util/dom/is-of-global-document/is-of-global-document"),matches:t("can-util/dom/matches/matches"),mutate:t("can-util/dom/mutate/mutate"),mutationObserver:t("can-util/dom/mutation-observer/mutation-observer")}}(0,e,0,n)}),define("can-util/js/is-browser-window/is-browser-window",["require","exports","module","can-globals/is-browser-window/is-browser-window"],function(e,t,n){!function(e,t,n,i){"use strict";i.exports=t("can-globals/is-browser-window/is-browser-window")}(0,e,0,n)}),define("can-util/js/is-node/is-node",function(e,t,n){!function(e,t,n,i){"use strict";i.exports=function(){return"object"==typeof process&&"[object process]"==={}.toString.call(process)}}(0,0,0,n)}),define("can-util/js/is-promise/is-promise",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var i=e("can-reflect");n.exports=function(e){return i.isPromise(e)}}),define("can-util/js/is-string/is-string",["require","exports","module","can-log/dev/dev"],function(e,t,n){"use strict";var i=e("can-log/dev/dev"),a=!1;n.exports=function(e){return a||(i.warn('js/is-string/is-string is deprecated; use typeof x === "string"'),a=!0),"string"==typeof e}}),define("can-util/js/is-web-worker/is-web-worker",function(e,t,n){!function(e,t,n,i){"use strict";i.exports=function(){return"undefined"!=typeof WorkerGlobalScope&&this instanceof WorkerGlobalScope}}(0,0,0,n)}),define("can-util/js/js",["require","exports","module","can-assign","can-cid","can-util/js/deep-assign/deep-assign","can-util/js/dev/dev","can-util/js/diff/diff","can-util/js/each/each","can-util/js/global/global","can-util/js/import/import","can-util/js/is-array/is-array","can-util/js/is-array-like/is-array-like","can-util/js/is-browser-window/is-browser-window","can-util/js/is-empty-object/is-empty-object","can-util/js/is-function/is-function","can-util/js/is-node/is-node","can-util/js/is-plain-object/is-plain-object","can-util/js/is-promise/is-promise","can-util/js/is-string/is-string","can-util/js/is-web-worker/is-web-worker","can-util/js/join-uris/join-uris","can-util/js/last/last","can-util/js/make-array/make-array","can-util/js/omit/omit","can-util/js/set-immediate/set-immediate","can-util/js/string/string","can-types"],function(e,t,n){!function(e,t,n,i){"use strict";i.exports={assign:t("can-assign"),cid:t("can-cid"),deepAssign:t("can-util/js/deep-assign/deep-assign"),dev:t("can-util/js/dev/dev"),diff:t("can-util/js/diff/diff"),each:t("can-util/js/each/each"),global:t("can-util/js/global/global"),import:t("can-util/js/import/import"),isArray:t("can-util/js/is-array/is-array"),isArrayLike:t("can-util/js/is-array-like/is-array-like"),isBrowserWindow:t("can-util/js/is-browser-window/is-browser-window"),isEmptyObject:t("can-util/js/is-empty-object/is-empty-object"),isFunction:t("can-util/js/is-function/is-function"),isNode:t("can-util/js/is-node/is-node"),isPlainObject:t("can-util/js/is-plain-object/is-plain-object"),isPromise:t("can-util/js/is-promise/is-promise"),isString:t("can-util/js/is-string/is-string"),isWebWorker:t("can-util/js/is-web-worker/is-web-worker"),joinURIs:t("can-util/js/join-uris/join-uris"),last:t("can-util/js/last/last"),makeArray:t("can-util/js/make-array/make-array"),omit:t("can-util/js/omit/omit"),setImmediate:t("can-util/js/set-immediate/set-immediate"),string:t("can-util/js/string/string"),types:t("can-types")}}(0,e,0,n)}),define("can-util",["require","exports","module","can-util/js/deep-assign/deep-assign","can-util/js/omit/omit","can-namespace","can-util/dom/dom","can-util/js/js"],function(e,t,n){var i=e("can-util/js/deep-assign/deep-assign"),a=e("can-util/js/omit/omit"),r=e("can-namespace");n.exports=i(r,e("can-util/dom/dom"),a(e("can-util/js/js"),["cid","types"]))}),define("can-construct-super",["require","exports","module","can-util","can-construct"],function(e,t,n){!function(e,t,n,i){var a=t("can-util"),r=t("can-construct"),o=Object.prototype.hasOwnProperty,s=a.isFunction,c=/xyz/.test(function(){return this.xyz})?/\b_super\b/:/.*/,l=["get","set"],u=function(e,t,n){return function(){var i,a=!1,r=d(this),s=r._super;o.call(this,"_super")&&(a=!0,i=this._super,delete this._super),r._super=e[t];var c=n.apply(this,arguments);return r._super=s,a&&(this._super=i),c}};r._defineProperty=function(e,t,n,i){var r=Object.getOwnPropertyDescriptor(t,n);r&&a.each(l,function(e){s(r[e])&&s(i[e])?i[e]=u(r,e,i[e]):s(i[e])||(i[e]=r[e])}),Object.defineProperty(e,n,i)};var d=Object.getPrototypeOf||function(e){return e.__proto__},p=Object.getPropertyDescriptor||function(e,t){if(t in e){for(var n=Object.getOwnPropertyDescriptor(e,t),i=d(e);void 0===n&&null!==i;)n=Object.getOwnPropertyDescriptor(i,t),i=d(i);return n}};r._overwrite=function(e,t,n,i){var a=p(t,n),r=a&&a.value;Object.defineProperty(e,n,{value:s(i)&&s(r)&&c.test(i)?u(t,n,i):i,configurable:!0,enumerable:!0,writable:!0})},i.exports=r}(0,e,0,n)}),define("can/ecosystem",["require","exports","module","can-util/namespace","can-construct-super"],function(e,t,n){var i=e("can-util/namespace");e("can-construct-super"),n.exports=i}),define("can/legacy",["require","exports","module","can-util/namespace","can-view-model"],function(e,t,n){var i=e("can-util/namespace");e("can-view-model"),n.exports=i}),define("can/all",["require","exports","module","can-util/namespace","can","can/ecosystem","can/legacy"],function(e,t,n){var i=e("can-util/namespace");e("can"),e("can/ecosystem"),e("can/legacy"),n.exports=i}),function(e){e._define=e.define,e.define=e.define.orig}("object"==typeof self&&self.Object==Object?self:window);
ajax/libs/openlayers/2.11/lib/OpenLayers/Control/Panel.js
Rich-Harris/cdnjs
/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the Clear BSD license. * See http://svn.openlayers.org/trunk/openlayers/license.txt for the * full text of the license. */ /** * @requires OpenLayers/Control.js */ /** * Class: OpenLayers.Control.Panel * The Panel control is a container for other controls. With it toolbars * may be composed. * * Inherits from: * - <OpenLayers.Control> */ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, { /** * Property: controls * {Array(<OpenLayers.Control>)} */ controls: null, /** * APIProperty: autoActivate * {Boolean} Activate the control when it is added to a map. Default is * true. */ autoActivate: true, /** * APIProperty: defaultControl * {<OpenLayers.Control>} The control which is activated when the control is * activated (turned on), which also happens at instantiation. * If <saveState> is true, <defaultControl> will be nullified after the * first activation of the panel. */ defaultControl: null, /** * APIProperty: saveState * {Boolean} If set to true, the active state of this panel's controls will * be stored on panel deactivation, and restored on reactivation. Default * is false. */ saveState: false, /** * APIProperty: allowDepress * {Boolean} If is true the <OpenLayers.Control.TYPE_TOOL> controls can * be deactivated by clicking the icon that represents them. Default * is false. */ allowDepress: false, /** * Property: activeState * {Object} stores the active state of this panel's controls. */ activeState: null, /** * Constructor: OpenLayers.Control.Panel * Create a new control panel. * * Each control in the panel is represented by an icon. When clicking * on an icon, the <activateControl> method is called. * * Specific properties for controls on a panel: * type - {Number} One of <OpenLayers.Control.TYPE_TOOL>, * <OpenLayers.Control.TYPE_TOGGLE>, <OpenLayers.Control.TYPE_BUTTON>. * If not provided, <OpenLayers.Control.TYPE_TOOL> is assumed. * title - {string} Text displayed when mouse is over the icon that * represents the control. * * The <OpenLayers.Control.type> of a control determines the behavior when * clicking its icon: * <OpenLayers.Control.TYPE_TOOL> - The control is activated and other * controls of this type in the same panel are deactivated. This is * the default type. * <OpenLayers.Control.TYPE_TOGGLE> - The active state of the control is * toggled. * <OpenLayers.Control.TYPE_BUTTON> - The * <OpenLayers.Control.Button.trigger> method of the control is called, * but its active state is not changed. * * If a control is <OpenLayers.Control.active>, it will be drawn with the * olControl[Name]ItemActive class, otherwise with the * olControl[Name]ItemInactive class. * * Parameters: * options - {Object} An optional object whose properties will be used * to extend the control. */ initialize: function(options) { OpenLayers.Control.prototype.initialize.apply(this, [options]); this.controls = []; this.activeState = {}; }, /** * APIMethod: destroy */ destroy: function() { OpenLayers.Control.prototype.destroy.apply(this, arguments); for (var ctl, i = this.controls.length - 1; i >= 0; i--) { ctl = this.controls[i]; if (ctl.events) { ctl.events.un({ activate: this.iconOn, deactivate: this.iconOff }); } OpenLayers.Event.stopObservingElement(ctl.panel_div); ctl.panel_div = null; } this.activeState = null; }, /** * APIMethod: activate */ activate: function() { if (OpenLayers.Control.prototype.activate.apply(this, arguments)) { var control; for (var i=0, len=this.controls.length; i<len; i++) { control = this.controls[i]; if (control === this.defaultControl || (this.saveState && this.activeState[control.id])) { control.activate(); } } if (this.saveState === true) { this.defaultControl = null; } this.redraw(); return true; } else { return false; } }, /** * APIMethod: deactivate */ deactivate: function() { if (OpenLayers.Control.prototype.deactivate.apply(this, arguments)) { var control; for (var i=0, len=this.controls.length; i<len; i++) { control = this.controls[i]; this.activeState[control.id] = control.deactivate(); } this.redraw(); return true; } else { return false; } }, /** * Method: draw * * Returns: * {DOMElement} */ draw: function() { OpenLayers.Control.prototype.draw.apply(this, arguments); this.addControlsToMap(this.controls); return this.div; }, /** * Method: redraw */ redraw: function() { for (var l=this.div.childNodes.length, i=l-1; i>=0; i--) { this.div.removeChild(this.div.childNodes[i]); } this.div.innerHTML = ""; if (this.active) { for (var i=0, len=this.controls.length; i<len; i++) { this.div.appendChild(this.controls[i].panel_div); } } }, /** * APIMethod: activateControl * This method is called when the user click on the icon representing a * control in the panel. * * Parameters: * control - {<OpenLayers.Control>} */ activateControl: function (control) { if (!this.active) { return false; } if (control.type == OpenLayers.Control.TYPE_BUTTON) { control.trigger(); return; } if (control.type == OpenLayers.Control.TYPE_TOGGLE) { if (control.active) { control.deactivate(); } else { control.activate(); } return; } if (this.allowDepress && control.active) { control.deactivate(); } else { var c; for (var i=0, len=this.controls.length; i<len; i++) { c = this.controls[i]; if (c != control && (c.type === OpenLayers.Control.TYPE_TOOL || c.type == null)) { c.deactivate(); } } control.activate(); } }, /** * APIMethod: addControls * To build a toolbar, you add a set of controls to it. addControls * lets you add a single control or a list of controls to the * Control Panel. * * Parameters: * controls - {<OpenLayers.Control>} Controls to add in the panel. */ addControls: function(controls) { if (!(OpenLayers.Util.isArray(controls))) { controls = [controls]; } this.controls = this.controls.concat(controls); // Give each control a panel_div which will be used later. // Access to this div is via the panel_div attribute of the // control added to the panel. // Also, stop mousedowns and clicks, but don't stop mouseup, // since they need to pass through. for (var i=0, len=controls.length; i<len; i++) { var element = document.createElement("div"); element.className = controls[i].displayClass + "ItemInactive"; controls[i].panel_div = element; if (controls[i].title != "") { controls[i].panel_div.title = controls[i].title; } OpenLayers.Event.observe(controls[i].panel_div, "click", OpenLayers.Function.bind(this.onClick, this, controls[i])); OpenLayers.Event.observe(controls[i].panel_div, "dblclick", OpenLayers.Function.bind(this.onDoubleClick, this, controls[i])); OpenLayers.Event.observe(controls[i].panel_div, "mousedown", OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop)); } if (this.map) { // map.addControl() has already been called on the panel this.addControlsToMap(controls); this.redraw(); } }, /** * Method: addControlsToMap * Only for internal use in draw() and addControls() methods. * * Parameters: * controls - {Array(<OpenLayers.Control>)} Controls to add into map. */ addControlsToMap: function (controls) { var control; for (var i=0, len=controls.length; i<len; i++) { control = controls[i]; if (control.autoActivate === true) { control.autoActivate = false; this.map.addControl(control); control.autoActivate = true; } else { this.map.addControl(control); control.deactivate(); } control.events.on({ activate: this.iconOn, deactivate: this.iconOff }); } }, /** * Method: iconOn * Internal use, for use only with "controls[i].events.on/un". */ iconOn: function() { var d = this.panel_div; // "this" refers to a control on panel! d.className = d.className.replace(/ItemInactive$/, "ItemActive"); }, /** * Method: iconOff * Internal use, for use only with "controls[i].events.on/un". */ iconOff: function() { var d = this.panel_div; // "this" refers to a control on panel! d.className = d.className.replace(/ItemActive$/, "ItemInactive"); }, /** * Method: onClick */ onClick: function (ctrl, evt) { OpenLayers.Event.stop(evt ? evt : window.event); this.activateControl(ctrl); }, /** * Method: onDoubleClick */ onDoubleClick: function(ctrl, evt) { OpenLayers.Event.stop(evt ? evt : window.event); }, /** * APIMethod: getControlsBy * Get a list of controls with properties matching the given criteria. * * Parameter: * property - {String} A control property to be matched. * match - {String | Object} A string to match. Can also be a regular * expression literal or object. In addition, it can be any object * with a method named test. For reqular expressions or other, if * match.test(control[property]) evaluates to true, the control will be * included in the array returned. If no controls are found, an empty * array is returned. * * Returns: * {Array(<OpenLayers.Control>)} A list of controls matching the given criteria. * An empty array is returned if no matches are found. */ getControlsBy: function(property, match) { var test = (typeof match.test == "function"); var found = OpenLayers.Array.filter(this.controls, function(item) { return item[property] == match || (test && match.test(item[property])); }); return found; }, /** * APIMethod: getControlsByName * Get a list of contorls with names matching the given name. * * Parameter: * match - {String | Object} A control name. The name can also be a regular * expression literal or object. In addition, it can be any object * with a method named test. For reqular expressions or other, if * name.test(control.name) evaluates to true, the control will be included * in the list of controls returned. If no controls are found, an empty * array is returned. * * Returns: * {Array(<OpenLayers.Control>)} A list of controls matching the given name. * An empty array is returned if no matches are found. */ getControlsByName: function(match) { return this.getControlsBy("name", match); }, /** * APIMethod: getControlsByClass * Get a list of controls of a given type (CLASS_NAME). * * Parameter: * match - {String | Object} A control class name. The type can also be a * regular expression literal or object. In addition, it can be any * object with a method named test. For reqular expressions or other, * if type.test(control.CLASS_NAME) evaluates to true, the control will * be included in the list of controls returned. If no controls are * found, an empty array is returned. * * Returns: * {Array(<OpenLayers.Control>)} A list of controls matching the given type. * An empty array is returned if no matches are found. */ getControlsByClass: function(match) { return this.getControlsBy("CLASS_NAME", match); }, CLASS_NAME: "OpenLayers.Control.Panel" });
test/test_helper.js
Sashkan/ft_youtube
import _$ from 'jquery'; import React from 'react'; import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; import jsdom from 'jsdom'; import chai, { expect } from 'chai'; import chaiJquery from 'chai-jquery'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import reducers from '../src/reducers'; global.document = jsdom.jsdom('<!doctype html><html><body></body></html>'); global.window = global.document.defaultView; global.navigator = global.window.navigator; const $ = _$(window); chaiJquery(chai, chai.util, $); function renderComponent(ComponentClass, props = {}, state = {}) { const componentInstance = TestUtils.renderIntoDocument( <Provider store={createStore(reducers, state)}> <ComponentClass {...props} /> </Provider> ); return $(ReactDOM.findDOMNode(componentInstance)); } $.fn.simulate = function(eventName, value) { if (value) { this.val(value); } TestUtils.Simulate[eventName](this[0]); }; export {renderComponent, expect};
components/list-view/__tests__/index.test.native.js
77ircloud/yymobile2
import React from 'react'; import renderer from 'react-test-renderer'; // import { shallow } from 'enzyme'; import { Text } from 'react-native'; import ListView from '../index'; describe('ListView', () => { it('renders correctly', () => { class Minimal extends React.Component { constructor() { super(); const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); this.state = { dataSource: ds.cloneWithRows(['row 1', 'row 2']), }; } render() { return ( <ListView dataSource={this.state.dataSource} renderRow={rowData => <Text>{rowData}</Text>} /> ); } } const wrapper = renderer.create(<Minimal />); expect(wrapper.toJSON()).toMatchSnapshot(); }); });
test/integration/fixtures/inject-theme.js
IsenrichO/mui-with-arrows
import stubContext from './react-stub-context'; import getMuiTheme from 'src/styles/getMuiTheme'; function injectTheme(Component, theme) { const injectedTheme = theme || getMuiTheme(); return stubContext(Component, {muiTheme: injectedTheme}); } module.exports = injectTheme;
src/parser/warlock/destruction/modules/features/RainOfFire.js
ronaldpereira/WoWAnalyzer
import React from 'react'; import Analyzer, { SELECTED_PLAYER } from 'parser/core/Analyzer'; import Events from 'parser/core/Events'; import { encodeTargetString } from 'parser/shared/modules/EnemyInstances'; import Haste from 'parser/shared/modules/Haste'; import SPELLS from 'common/SPELLS'; import Statistic from 'interface/statistics/Statistic'; import BoringSpellValueText from 'interface/statistics/components/BoringSpellValueText'; import STATISTIC_ORDER from 'interface/others/STATISTIC_ORDER'; const BUFFER = 100; const BASE_ROF_DURATION = 8000; const debug = false; // Tries to estimate "effectiveness" of Rain of Fires - counting average targets hit by each RoF (unique targets hit) class RainOfFire extends Analyzer { static dependencies = { haste: Haste, }; casts = [ /* { timestamp: number, expectedEnd: number, targetsHit: [string...], periods: [number...], lastTickTimestamp: number, } */ ]; constructor(...args) { super(...args); this.addEventListener(Events.cast.by(SELECTED_PLAYER).spell(SPELLS.RAIN_OF_FIRE_CAST), this.onRainCast); this.addEventListener(Events.damage.by(SELECTED_PLAYER).spell(SPELLS.RAIN_OF_FIRE_DAMAGE), this.onRainDamage); } onRainCast(event) { this.casts.push({ timestamp: event.timestamp, expectedEnd: event.timestamp + this._expectedRoFduration, targetsHit: [], periods: [], lastTickTimestamp: null, }); } onRainDamage(event) { // filter ROF that should be still active const filtered = this.casts.filter(cast => event.timestamp <= cast.expectedEnd + BUFFER); const target = encodeTargetString(event.targetID, event.targetInstance); if (filtered.length === 0) { debug && this.log('Something weird happened, ROF damage without any ongoing casts', event); } else if (filtered.length === 1) { // single active ROF, attribute the targets hit to it const cast = filtered[0]; const timeSinceLastTick = event.timestamp - (cast.lastTickTimestamp || cast.timestamp); // damage events usually arrive at the same timestamp but there is a small window for lag if (timeSinceLastTick > BUFFER) { cast.periods.push(timeSinceLastTick); cast.lastTickTimestamp = event.timestamp; } // mark target as hit by this ROF if (!cast.targetsHit.includes(target)) { cast.targetsHit.push(target); } } else { // multiple ROFs active // if any cast's last tick is within 100ms of current timestamp, it's probably still the same tick const possibleCurrentTickCast = filtered.find(cast => event.timestamp <= cast.lastTickTimestamp + BUFFER); if (possibleCurrentTickCast) { if (!possibleCurrentTickCast.targetsHit.includes(target)) { possibleCurrentTickCast.targetsHit.push(target); } } else { // it's a "fresh" damage tick (first of them) // need to find out which cast in `filtered` it "belongs to" const sortedByDelta = filtered.map(cast => { // for each filtered ROF, get timestamp of next expected tick and get time difference from it and current timestamp const expectedTick = (cast.lastTickTimestamp || cast.timestamp) + this._getAveragePeriod(cast); const delta = Math.abs(expectedTick - event.timestamp); return { cast, delta, expectedTick, }; }).sort((cast1, cast2) => cast1.delta - cast2.delta); // sort ascending, cast with lowest difference is in [0] const closest = sortedByDelta[0].cast; const timeSinceLastTick = event.timestamp - (closest.lastTickTimestamp || closest.timestamp); closest.periods.push(timeSinceLastTick); closest.lastTickTimestamp = event.timestamp; if (!closest.targetsHit.includes(target)) { closest.targetsHit.push(target); } } } } _getAveragePeriod(cast) { // gets average period of cast of Rain of Fire, or estimates one from the duration of Rain of Fire (it should always tick 8 times) if (cast.periods.length > 0) { return (cast.periods.reduce((total, current) => total + current, 0) / cast.periods.length) || 0; } return (cast.expectedEnd - cast.timestamp) / 8; } get _expectedRoFduration() { return BASE_ROF_DURATION / (1 + this.haste.current); } get averageTargetsHit() { // first, maps the casts to the targets hit, resulting in array of array of strings // [].concat(...array) just flattens it into single array of strings const allTargetsHit = [].concat(...this.casts.map(cast => cast.targetsHit)); return (allTargetsHit.length / this.casts.length) || 0; } statistic() { // there's no point in showing the statistic on single target fight with no ROF casts if (this.casts.length === 0) { return null; } return ( <Statistic position={STATISTIC_ORDER.CORE(6)} size="small" tooltip="There's a possibility of a mistake in assigning targets hit to individual casts, when there are multiple Rains of Fire overlapping." > <BoringSpellValueText spell={SPELLS.RAIN_OF_FIRE_CAST}> {this.averageTargetsHit.toFixed(2)} <small>average targets hit</small> </BoringSpellValueText> </Statistic> ); } } export default RainOfFire;
ajax/libs/react-highcharts/8.4.2/ReactHighcharts.js
seogi1004/cdnjs
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("highcharts")):"function"==typeof define&&define.amd?define(["react","highcharts"],t):"object"==typeof exports?exports.ReactHighcharts=t(require("react"),require("highcharts")):r.ReactHighcharts=t(r.React,r.Highcharts)}(this,function(r,t){return function(r){function t(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return r[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t,e){r.exports=e(3)},function(t,e){t.exports=r},function(r,t,e){(function(t){"use strict";function o(r,t){var e={};for(var o in r)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}var n=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},i=e(1),c="undefined"==typeof t?window:t;r.exports=function(t,e){var a="Highcharts"+t,s=i.createClass({displayName:a,propTypes:{config:i.PropTypes.object.isRequired,isPureConfig:i.PropTypes.bool,neverReflow:i.PropTypes.bool,callback:i.PropTypes.func},defaultProps:{callback:function(){}},renderChart:function(r){var o=this;if(!r)throw new Error("Config must be specified for the "+a+" component");var i=r.chart;this.chart=new e[t](n({},r,{chart:n({},i,{renderTo:this.refs.chart})}),this.props.callback),this.props.neverReflow||c.requestAnimationFrame&&requestAnimationFrame(function(){o.chart&&o.chart.options&&o.chart.reflow()})},shouldComponentUpdate:function(r){return r.neverReflow||r.isPureConfig&&this.props.config===r.config?!0:(this.renderChart(r.config),!1)},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},componentWillUnmount:function(){this.chart.destroy()},render:function(){var r=this.props,t=(r.callback,r.config,r.isPureConfig,r.neverReflow,o(r,["callback","config","isPureConfig","neverReflow"]));return t=n({},t,{ref:"chart"}),i.createElement("div",t)}});return s.Highcharts=e,s.withHighcharts=function(e){return r.exports(t,e)},s}}).call(t,function(){return this}())},function(r,t,e){"use strict";r.exports=e(2)("Chart",e(4))},function(r,e){r.exports=t}])});
Examples/UIExplorer/js/UIExplorerButton.js
Purii/react-native
/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * The examples provided by Facebook are for non-commercial testing and * evaluation purposes only. * * Facebook reserves all rights not expressly granted. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * @flow */ 'use strict'; var React = require('react'); var ReactNative = require('react-native'); var { StyleSheet, Text, TouchableHighlight, } = ReactNative; class UIExplorerButton extends React.Component { props: {onPress?: Function}; static propTypes = { onPress: React.PropTypes.func, }; render() { return ( <TouchableHighlight onPress={this.props.onPress} style={styles.button} underlayColor="grey"> <Text> { // $FlowFixMe found when converting React.createClass to ES6 this.props.children} </Text> </TouchableHighlight> ); } } var styles = StyleSheet.create({ button: { borderColor: '#696969', borderRadius: 8, borderWidth: 1, padding: 10, margin: 5, alignItems: 'center', justifyContent: 'center', backgroundColor: '#d3d3d3', }, }); module.exports = UIExplorerButton;
ajax/libs/primereact/8.1.0/radiobutton/radiobutton.min.js
cdnjs/cdnjs
this.primereact=this.primereact||{},this.primereact.radiobutton=function(e,t,n,r){"use strict";function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var l=a(t);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function o(e){if(Array.isArray(e))return e}function c(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l=[],i=!0,o=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(o)throw a}}return l}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f=l.memo(l.forwardRef((function(e,t){var a,u,p=l.useState(!1),b=(u=2,o(a=p)||c(a,u)||d(a,u)||s()),m=b[0],h=b[1],y=l.useRef(null),v=l.useRef(e.inputRef),g=function(e){v.current.checked=!0,k(e)},k=function(t){!e.disabled&&e.onChange&&(e.onChange({originalEvent:t,value:e.value,checked:!e.checked,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:e.value,checked:!e.checked}}),v.current.checked=!e.checked,v.current.focus())};l.useEffect((function(){v.current&&(v.current.checked=e.checked)}),[e.checked]),l.useEffect((function(){r.ObjectUtils.combinedRefs(v,e.inputRef)}),[v,e.inputRef]),l.useImperativeHandle(t,(function(){return{select:g}}));var O=r.ObjectUtils.isNotEmpty(e.tooltip),j=r.ObjectUtils.findDiffKeys(e,f.defaultProps),E=r.classNames("p-radiobutton p-component",{"p-radiobutton-checked":e.checked,"p-radiobutton-disabled":e.disabled,"p-radiobutton-focused":m},e.className),R=r.classNames("p-radiobutton-box",{"p-highlight":e.checked,"p-disabled":e.disabled,"p-focus":m});return l.createElement(l.Fragment,null,l.createElement("div",i({ref:y,id:e.id,className:E,style:e.style},j,{onClick:k}),l.createElement("div",{className:"p-hidden-accessible"},l.createElement("input",{ref:v,id:e.inputId,type:"radio",name:e.name,defaultChecked:e.checked,"aria-labelledby":e["aria-labelledby"],"aria-label":e["aria-label"],onFocus:function(){h(!0)},onBlur:function(){h(!1)},disabled:e.disabled,required:e.required,tabIndex:e.tabIndex})),l.createElement("div",{className:R},l.createElement("div",{className:"p-radiobutton-icon"}))),O&&l.createElement(n.Tooltip,i({target:y,content:e.tooltip},e.tooltipOptions)))})));return f.displayName="RadioButton",f.defaultProps={__TYPE:"RadioButton",id:null,inputRef:null,inputId:null,name:null,value:null,checked:!1,style:null,className:null,disabled:!1,required:!1,tabIndex:null,tooltip:null,tooltipOptions:null,"aria-label":null,"aria-labelledby":null,onChange:null},e.RadioButton=f,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.tooltip,primereact.utils);
src/imports/ReactDocumentation/Basics/Testing/Testing.js
ManuelDeLeon/viewmodel-react-docs
Testing({ render(){ <div class="ui segment"> <h2 class="ui header">Testing</h2> <a class="anchor active" id="BasicsTesting"></a> <p>With ViewModel you test 2 things:</p> <ol> <li>The component's properties and methods work correctly.</li> <li>The bindings map to the right properties and methods.</li> </ol> <p>Here's what you don't have to do:</p> <ul> <li>Make brittle snapshots that need to be approved whenever you make small changes to the markup.</li> <li>Test all permutations of your UI. (Fill A then click button, fill A and B then click button, etc.)</li> <li>Trigger events to test that something happens after an event.</li> <li>Add ids to elements for testing purposes.</li> </ul> <p>Let's say you have the following component:</p> <hr/> <Person /> <hr/> <pre><code>Person({ firstName: ViewModel.property.string.notBlank, lastName: ViewModel.property.string.notBlank, fullName() { return this.firstName() + ' ' + this.lastName(); }, render() { <form class="ui form" style="width: 40%"> <div class="field"> <label>First Name:</label> <input type="text" b="value: firstName"/> </div> <div class="field"> <label>Last Name:</label> <input type="text" b="value: lastName"/> </div> <div class="field"> <label b="text: 'Hello ' + fullName"/> </div> <button class="ui blue button" b="click: reset, enable: valid">Reset Fields</button> </form> } })</code></pre> <p>Let's use <a href="https://facebook.github.io/jest/">Jest</a> and <a href="http://airbnb.io/enzyme/">Enzyme</a> to test that component.</p> <p>First let's install Jest and Enzyme:</p> <pre><code>npm install --save-dev jest-cli babel-jest babel-polyfill react-addons-test-utils react-test-renderer enzyme</code></pre> <p>For convenience let's add jest as a test script in package.json:</p> <pre><code> "scripts": { "test": "jest" },</code></pre> <p>And now create the test file:</p> <pre><code>import React from 'react'; import { shallow } from 'enzyme'; import { Person } from './Person'; describe('Person', () => { describe('view model', () => { let person; beforeEach(() => { person = new Person(); }); describe('firstName', () => { it('defaults to empty', () => { expect(person.firstName()).toBe(''); }); it("is invalid with ''", () => { expect(person.firstName.valid()).toBe(false); }); it("is valid with 'A'", () => { person.firstName('A'); expect(person.firstName.valid()).toBe(true); }); }); describe('lastName', () => { it('defaults to empty', () => { expect(person.lastName()).toBe(''); }); it("is invalid with ''", () => { expect(person.lastName.valid()).toBe(false); }); it("is valid with 'A'", () => { person.lastName('A'); expect(person.lastName.valid()).toBe(true); }); }); describe('fullName', () => { it('returns first + last', () => { person.firstName('A'); person.lastName('B'); expect(person.fullName()).toBe('A B'); }); }); }); describe('bindings', ()=>{ const rendered = shallow(<Person />); it('binds first name', ()=>{ const elements = rendered.find('input[data-bind="value: firstName"]'); expect(elements.length).toBe(1); }); it('binds last name', ()=>{ const elements = rendered.find('input[data-bind="value: lastName"]'); expect(elements.length).toBe(1); }); it('binds reset button', ()=>{ const elements = rendered.find('button[data-bind="click: reset, enable: valid"]'); expect(elements.length).toBe(1); }) }) });</code></pre> <p>I use Jest because it's simple but of course you can use any other testing framework. I use the following Jest configuration (in package.json):</p> <pre><code> "jest": { "testPathDirs": [ "src/" ] }</code></pre> <p>That allows me to co-locate the tests with their components:</p> <pre><code>./Person/Person.js ./Person/Person.test.js</code></pre> </div> } });
Realization/frontend/czechidm-acc/src/content/system/SystemProvisioningBreakConfigRecipientTable.js
bcvsolutions/CzechIdMng
import PropTypes from 'prop-types'; import React from 'react'; import { connect } from 'react-redux'; import _ from 'lodash'; // import { Basic, Advanced, Utils, Managers, Domain } from 'czechidm-core'; const ROLE_TYPE = 'roleType'; const IDENTITY_TYPE = 'identityType'; /** * Table of provisioning break recipient * * @author Ondrej Kopr * @author Radek Tomiška */ export class SystemProvisioningBreakConfigRecipientTable extends Advanced.AbstractTableContent { constructor(props, context) { super(props, context); this.state = { filterOpened: this.props.filterOpened, detail: { show: false, entity: { type: ROLE_TYPE } } }; } getContentKey() { return 'acc:content.provisioningBreakConfigRecipient'; } getManager() { const { manager } = this.props; // return manager; } useFilter(event) { if (event) { event.preventDefault(); } this.refs.table.useFilterForm(this.refs.filterForm); } cancelFilter(event) { if (event) { event.preventDefault(); } this.refs.table.cancelFilter(this.refs.filterForm); } showDetail(entity, event) { if (event) { event.preventDefault(); } const detail = _.merge({}, this.state.detail); detail.show = true; if (entity) { detail.entity = entity; if (entity.role != null) { detail.entity.type = ROLE_TYPE; } else { detail.entity.type = IDENTITY_TYPE; } } else { detail.entity = { type: ROLE_TYPE // role type }; } this.setState({ detail }); } saveDetail(event) { if (event) { event.preventDefault(); } const detail = _.merge({}, this.state.detail); const { provisioningBreakConfigId, uiKey, manager } = this.props; // if (!this.refs.form.isFormValid()) { return; } // const formEntity = this.refs.form.getData(); detail.showLoading = true; this.setState({ detail }, () => { // const savedEntity = { ...formEntity, breakConfig: provisioningBreakConfigId }; // // null unused value if (formEntity.type === ROLE_TYPE) { formEntity.identity = null; } else { formEntity.role = null; } // if (savedEntity.id === undefined) { this.context.store.dispatch(manager.createEntity(savedEntity, `${uiKey}-detail`, (createdEntity, error) => { this.afterSave(createdEntity, error, true); })); } else { this.context.store.dispatch(manager.updateEntity(savedEntity, `${uiKey}-detail`, this.afterSave.bind(this))); } }); } afterSave(entity, error, newEntity) { if (!error) { if (newEntity) { this.addMessage({ message: this.i18n('create.success', { entityType: entity.entityType, operationType: entity.operationType}) }); } else { this.addMessage({ message: this.i18n('save.success', {entityType: entity.entityType, operationType: entity.operationType}) }); } } else { this.addError(error); } const detail = _.merge({}, this.state.detail); // detail.show = false; detail.showLoading = false; this.setState({ detail }, () => { this.refs.table.reload(); super.afterSave(); }); } _closeModal(event) { if (event) { event.preventDefault(); } const detail = _.merge({}, this.state.detail); detail.show = false; this.setState({ detail }); } changeRecipientType(value, event) { if (event) { event.preventDefault(); } const detail = _.merge({}, this.state.detail); // clear identity and role after type was changed if (detail && detail.entity) { detail.entity.type = value.value; detail.entity.identity = null; detail.entity.role = null; if (detail.entity_embedded) { detail.entity._embedded.identity = null; detail.entity._embedded.role = null; } } this.setState({ detail }); } _getRecipientType(entity) { if (!entity) { return null; } if (entity.role) { return (<Basic.Label level="info" text={this.i18n('acc:entity.ProvisioningBreakConfigRecipient.type.role')}/>); } if (entity.identity) { return (<Basic.Label level="success" text={this.i18n('acc:entity.ProvisioningBreakConfigRecipient.type.identity')}/>); } return null; } _getRecipientName(entity) { if (entity && entity.role) { if (entity._embedded) { return ( <Advanced.EntityInfo entityType="role" entityIdentifier={ entity.role } entity={ entity._embedded.role } face="popover" showIcon/> ); } return entity.role; } if (entity && entity.identity) { if (entity._embedded) { return ( <Advanced.EntityInfo entityType="identity" entityIdentifier={ entity.identity } entity={ entity._embedded.identity } face="popover" showIcon/> ); } return entity.identity; } return null; } getTableButtons(showAddButton) { return ( [ <Basic.Button level="success" key="add_button" className="btn-xs" onClick={ this.showDetail.bind(this, null) } rendered={ Managers.SecurityManager.hasAuthority('SYSTEM_UPDATE') && showAddButton } icon="fa:plus"> { this.i18n('button.add') } </Basic.Button> ]); } render() { const { uiKey, manager, columns, forceSearchParameters, showAddButton, showRowSelection, rendered, className } = this.props; const { filterOpened, detail } = this.state; const isNew = detail.entity.id === undefined || detail.entity.id === null; if (!rendered) { return null; } // return ( <Basic.Div> <Basic.Confirm ref="confirm-delete" level="danger"/> <Basic.Modal show={ detail.show } showLoading={ detail.showLoading } onHide={ this._closeModal.bind(this) }> <form onSubmit={ this.saveDetail.bind(this) }> <Basic.Modal.Header text={ this.i18n('acc:content.provisioningBreakConfigRecipient.new') } rendered={ isNew } /> <Basic.Modal.Header text={ this.i18n('acc:content.provisioningBreakConfigRecipient.edit') } rendered={ !isNew } /> <Basic.Modal.Body> <Basic.AbstractForm ref="form" data={ detail.entity }> <Basic.EnumSelectBox ref="type" label={ this.i18n('acc:entity.ProvisioningBreakConfigRecipient.type.label') } value={ detail.type } clearable={ false } options={[ { value: ROLE_TYPE, niceLabel: this.i18n('acc:entity.ProvisioningBreakConfigRecipient.type.role') }, { value: IDENTITY_TYPE, niceLabel: this.i18n('acc:entity.ProvisioningBreakConfigRecipient.type.identity') } ]} onChange={ this.changeRecipientType.bind(this)} required/> <Advanced.IdentitySelect ref="identity" label={ this.i18n('acc:entity.ProvisioningBreakConfigRecipient.identity') } hidden={ detail.entity.type === ROLE_TYPE } required={ detail.entity.type === IDENTITY_TYPE } clearable={ false }/> <Advanced.RoleSelect ref="role" label={ this.i18n('acc:entity.ProvisioningBreakConfigRecipient.role') } hidden={ detail.entity.type === IDENTITY_TYPE } required={ detail.entity.type === ROLE_TYPE } clearable={ false }/> </Basic.AbstractForm> </Basic.Modal.Body> <Basic.Modal.Footer> <Basic.Button level="link" onClick={ this._closeModal.bind(this) }>{ this.i18n('button.cancel') }</Basic.Button> <Basic.Button ref="yesButton" level="success" onClick={ this.saveDetail.bind(this) } rendered={ isNew }> { this.i18n('button.create') } </Basic.Button> <Basic.Button ref="yesButton" level="success" onClick={ this.saveDetail.bind(this) } rendered={ !isNew }> {this.i18n('button.save')} </Basic.Button> </Basic.Modal.Footer> </form> </Basic.Modal> <Advanced.Table ref="table" uiKey={ uiKey } manager={ manager } filterOpened={ filterOpened } forceSearchParameters={ forceSearchParameters } showRowSelection={ Managers.SecurityManager.hasAuthority('SYSTEM_DELETE') && showRowSelection } className={ className } filter={ <Advanced.Filter onSubmit={ this.useFilter.bind(this) }> <Basic.AbstractForm ref="filterForm"> <Basic.Row className="last"> <Basic.Col lg={ 4 }> <Advanced.Filter.IdentitySelect label={ null } placeholder={ this.i18n('entity.Identity._type') } ref="identityId"/> </Basic.Col> <Basic.Col lg={ 4 }> <Advanced.Filter.RoleSelect label={ null } placeholder={ this.i18n('entity.Role._type') } ref="roleId"/> </Basic.Col> <Basic.Col lg={ 4 } className="text-right"> <Advanced.Filter.FilterButtons cancelFilter={ this.cancelFilter.bind(this) }/> </Basic.Col> </Basic.Row> </Basic.AbstractForm> </Advanced.Filter> } actions={ [ { value: 'delete', niceLabel: this.i18n('action.delete.action'), action: this.onDelete.bind(this), disabled: false } ] } buttons={ this.getTableButtons(showAddButton) } _searchParameters={ this.getSearchParameters() }> <Advanced.Column header="" className="detail-button" rendered={ Managers.SecurityManager.hasAnyAuthority(['SYSTEM_UPDATE']) } cell={ ({ rowIndex, data }) => { return ( <Advanced.DetailButton title={this.i18n('button.detail')} onClick={ this.showDetail.bind(this, data[rowIndex]) }/> ); } } sort={false}/> <Advanced.Column property="type" rendered={_.includes(columns, 'type')} header={this.i18n('acc:entity.ProvisioningBreakConfigRecipient.type.label')} width={ 130 } cell={({ rowIndex, data }) => { return ( this._getRecipientType(data[rowIndex]) ); }}/> <Advanced.Column property="name" sort face="text" rendered={_.includes(columns, 'name')} header={this.i18n('acc:entity.ProvisioningBreakConfigRecipient.name')} cell={({ rowIndex, data }) => { return ( this._getRecipientName(data[rowIndex]) ); }}/> </Advanced.Table> </Basic.Div> ); } } SystemProvisioningBreakConfigRecipientTable.propTypes = { uiKey: PropTypes.string.isRequired, manager: PropTypes.object.isRequired, columns: PropTypes.arrayOf(PropTypes.string), filterOpened: PropTypes.bool, forceSearchParameters: PropTypes.object, showAddButton: PropTypes.bool, showRowSelection: PropTypes.bool, rendered: PropTypes.bool, provisioningBreakConfigId: PropTypes.string }; SystemProvisioningBreakConfigRecipientTable.defaultProps = { columns: ['name', 'type'], filterOpened: false, _showLoading: false, forceSearchParameters: new Domain.SearchParameters(), showAddButton: true, showRowSelection: true, rendered: true }; function select(state, component) { return { _searchParameters: Utils.Ui.getSearchParameters(state, component.uiKey), _showLoading: component.manager.isShowLoading(state, `${component.uiKey}-detail`) }; } export default connect(select)(SystemProvisioningBreakConfigRecipientTable);
src/shared/Avatar/Avatar.js
velesin/retroinator
import React from 'react'; import './Avatar.css'; import { Icon, ICONS } from '../../shared'; export function Avatar({photoUrl, icon}) { return photoUrl ? <img className="Avatar" src={photoUrl} alt=""/> : <Icon className="Avatar">{icon || ICONS.AVATAR_PLACEHOLDER}</Icon>; }