text
stringlengths 2
1.05M
|
|---|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// @flow
import type {GlobalState} from 'types/store';
const state: GlobalState = {
entities: {
general: {
appState: false,
credentials: {},
config: {},
dataRetentionPolicy: {},
deviceToken: '',
license: {},
serverVersion: '',
timezones: [],
},
users: {
currentUserId: '',
myAcceptedTermsOfServiceData: {
id: '',
time: 0,
},
mySessions: [],
myAudits: [],
profiles: {},
profilesInTeam: {},
profilesNotInTeam: {},
profilesWithoutTeam: new Set(),
profilesInChannel: {},
profilesNotInChannel: {},
statuses: {},
stats: {},
},
teams: {
currentTeamId: '',
teams: {},
myMembers: {},
membersInTeam: {},
stats: {},
},
channels: {
currentChannelId: '',
channels: {},
channelsInTeam: {},
myMembers: {},
membersInChannel: {},
stats: {},
},
posts: {
posts: {},
postsInChannel: {},
postsInThread: {},
selectedPostId: '',
currentFocusedPostId: '',
messagesHistory: {
messages: [],
index: {
post: -1,
comment: -1,
},
},
},
preferences: {
myPreferences: {},
},
admin: {
logs: [],
audits: {},
config: {},
environmentConfig: {},
complianceReports: {},
},
jobs: {
jobs: {},
jobsByTypeList: {},
},
alerts: {
alertStack: [],
},
integrations: {
incomingHooks: {},
outgoingHooks: {},
oauthApps: {},
systemCommands: {},
commands: {},
},
files: {
files: {},
fileIdsByPostId: {},
},
emojis: {
customEmoji: {},
nonExistentEmoji: new Set(),
},
search: {
results: [],
recent: {},
},
typing: {},
roles: {
roles: {},
pending: new Set(),
},
gifs: {
categories: {
tagsList: [],
tagsDict: {},
},
cache: {
gifs: {},
updating: false,
},
search: {
searchText: '',
searchBarText: '',
resultsByTerm: {},
scrollPosition: 0,
priorLocation: null,
},
},
schemes: {schemes: {}},
},
errors: [],
requests: {
channels: {
getChannels: {
status: 'not_started',
error: null,
},
myChannels: {
status: 'not_started',
error: null,
},
createChannel: {
status: 'not_started',
error: null,
},
updateChannel: {
status: 'not_started',
error: null,
},
},
general: {
server: {
status: 'not_started',
error: null,
},
config: {
status: 'not_started',
error: null,
},
dataRetentionPolicy: {
status: 'not_started',
error: null,
},
license: {
status: 'not_started',
error: null,
},
websocket: {
status: 'not_started',
error: null,
},
redirectLocation: {
status: 'not_started',
error: null,
},
},
posts: {
createPost: {
status: 'not_started',
error: null,
},
editPost: {
status: 'not_started',
error: null,
},
getPostThread: {
status: 'not_started',
error: null,
},
},
teams: {
getMyTeams: {
status: 'not_started',
error: null,
},
getTeams: {
status: 'not_started',
error: null,
},
joinTeam: {
status: 'not_started',
error: null,
},
},
users: {
checkMfa: {
status: 'not_started',
error: null,
},
login: {
status: 'not_started',
error: null,
},
logout: {
status: 'not_started',
error: null,
},
autocompleteUsers: {
status: 'not_started',
error: null,
},
updateMe: {
status: 'not_started',
error: null,
},
},
preferences: {
getMyPreferences: {
status: 'not_started',
error: null,
},
savePreferences: {
status: 'not_started',
error: null,
},
deletePreferences: {
status: 'not_started',
error: null,
},
},
admin: {
getLogs: {
status: 'not_started',
error: null,
},
getAudits: {
status: 'not_started',
error: null,
},
getConfig: {
status: 'not_started',
error: null,
},
updateConfig: {
status: 'not_started',
error: null,
},
reloadConfig: {
status: 'not_started',
error: null,
},
testEmail: {
status: 'not_started',
error: null,
},
testS3Connection: {
status: 'not_started',
error: null,
},
invalidateCaches: {
status: 'not_started',
error: null,
},
recycleDatabase: {
status: 'not_started',
error: null,
},
createCompliance: {
status: 'not_started',
error: null,
},
getCompliance: {
status: 'not_started',
error: null,
},
deleteBrandImage: {
status: 'not_started',
error: null,
},
disablePlugin: {
status: 'not_started',
error: null,
},
enablePlugin: {
status: 'not_started',
error: null,
},
getAnalytics: {
status: 'not_started',
error: null,
},
getClusterStatus: {
status: 'not_started',
error: null,
},
getEnvironmentConfig: {
status: 'not_started',
error: null,
},
getPluginStatuses: {
status: 'not_started',
error: null,
},
getPlugins: {
status: 'not_started',
error: null,
},
getSamlCertificateStatus: {
status: 'not_started',
error: null,
},
purgeElasticsearchIndexes: {
status: 'not_started',
error: null,
},
removeIdpSamlCertificate: {
status: 'not_started',
error: null,
},
removeLicense: {
status: 'not_started',
error: null,
},
removePlugin: {
status: 'not_started',
error: null,
},
removePrivateSamlCertificate: {
status: 'not_started',
error: null,
},
removePublicSamlCertificate: {
status: 'not_started',
error: null,
},
syncLdap: {
status: 'not_started',
error: null,
},
testElasticsearch: {
status: 'not_started',
error: null,
},
testLdap: {
status: 'not_started',
error: null,
},
uploadBrandImage: {
status: 'not_started',
error: null,
},
uploadIdpSamlCertificate: {
status: 'not_started',
error: null,
},
uploadLicense: {
status: 'not_started',
error: null,
},
uploadPlugin: {
status: 'not_started',
error: null,
},
uploadPrivateSamlCertificate: {
status: 'not_started',
error: null,
},
uploadPublicSamlCertificate: {
status: 'not_started',
error: null,
},
},
files: {
uploadFiles: {
status: 'not_started',
error: null,
},
},
integrations: {
createIncomingHook: {
status: 'not_started',
error: null,
},
getIncomingHooks: {
status: 'not_started',
error: null,
},
deleteIncomingHook: {
status: 'not_started',
error: null,
},
updateIncomingHook: {
status: 'not_started',
error: null,
},
createOutgoingHook: {
status: 'not_started',
error: null,
},
getOutgoingHooks: {
status: 'not_started',
error: null,
},
deleteOutgoingHook: {
status: 'not_started',
error: null,
},
updateOutgoingHook: {
status: 'not_started',
error: null,
},
getCommands: {
status: 'not_started',
error: null,
},
getAutocompleteCommands: {
status: 'not_started',
error: null,
},
getCustomTeamCommands: {
status: 'not_started',
error: null,
},
addCommand: {
status: 'not_started',
error: null,
},
regenCommandToken: {
status: 'not_started',
error: null,
},
editCommand: {
status: 'not_started',
error: null,
},
deleteCommand: {
status: 'not_started',
error: null,
},
addOAuthApp: {
status: 'not_started',
error: null,
},
updateOAuthApp: {
status: 'not_started',
error: null,
},
getOAuthApp: {
status: 'not_started',
error: null,
},
getOAuthApps: {
status: 'not_started',
error: null,
},
deleteOAuthApp: {
status: 'not_started',
error: null,
},
executeCommand: {
status: 'not_started',
error: null,
},
submitInteractiveDialog: {
status: 'not_started',
error: null,
},
},
roles: {
getRolesByNames: {
status: 'not_started',
error: null,
},
getRoleByName: {
status: 'not_started',
error: null,
},
getRole: {
status: 'not_started',
error: null,
},
editRole: {
status: 'not_started',
error: null,
},
},
schemes: {
getSchemes: {
status: 'not_started',
error: null,
},
getScheme: {
status: 'not_started',
error: null,
},
createScheme: {
status: 'not_started',
error: null,
},
deleteScheme: {
status: 'not_started',
error: null,
},
patchScheme: {
status: 'not_started',
error: null,
},
getSchemeTeams: {
status: 'not_started',
error: null,
},
getSchemeChannels: {
status: 'not_started',
error: null,
},
},
jobs: {
createJob: {
status: 'not_started',
error: null,
},
getJob: {
status: 'not_started',
error: null,
},
getJobs: {
status: 'not_started',
error: null,
},
cancelJob: {
status: 'not_started',
error: null,
},
},
search: {
flaggedPosts: {
status: 'not_started',
error: null,
},
pinnedPosts: {
status: 'not_started',
error: null,
},
recentMentions: {
status: 'not_started',
error: null,
},
searchPosts: {
status: 'not_started',
error: null,
},
},
},
};
export default state;
|
var http = require('http');
var fs = require('fs');
http.createServer(function(req, res){
res.writeHead(200, { 'Content-Type': 'text/html' });
var html = fs.readFileSync(__dirname + '/Index.htm','utf8');
var message = 'Hello world...'
html = html.replace('{Message}', message);
res.end(html);
}).listen(1337, '127.0.0.1');
|
const RelayMock = artifacts.require("RelayMock");
module.exports = async function(deployer) {
await deployer.deploy(RelayMock);
};
|
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import withStyles from '../styles/withStyles';
import Tablelvl2Context from '../Table/Tablelvl2Context';
export const styles = {
/* Styles applied to the root element. */
root: {
display: 'table-row-group'
}
};
const tablelvl2 = {
variant: 'body'
};
const TableBody = React.forwardRef(function TableBody(props, ref) {
const {
classes,
className,
component: Component = 'tbody'
} = props,
other = _objectWithoutPropertiesLoose(props, ["classes", "className", "component"]);
return React.createElement(Tablelvl2Context.Provider, {
value: tablelvl2
}, React.createElement(Component, _extends({
className: clsx(classes.root, className),
ref: ref
}, other)));
});
process.env.NODE_ENV !== "production" ? TableBody.propTypes = {
/**
* The content of the component, normally `TableRow`.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The component used for the root node.
* Either a string to use a DOM element or a component.
*/
component: PropTypes.elementType
} : void 0;
export default withStyles(styles, {
name: 'MuiTableBody'
})(TableBody);
|
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux';
import { clearDataErr } from "../actions/post";
import { createComment } from "../actions/comment"
import { Link } from 'react-router-dom';
import history from '../history';
import { Button, Icon } from 'antd';
class CommentNewForm extends Component{
constructor(){
super();
this.renderField = this.renderField.bind(this);
}
componentWillMount(){
this.props.clearDataErr();
}
onSubmit(values){
if(values){
this.props.createComment({content: values.content}, this.props.postId);
}
}
onLoginClick(){
history.push('/login');
}
onSignupClick(){
history.push('/signup');
}
renderField(field){
const {meta: {touched, error}} = field;
const className = `form-group ${touched && error ? "has-error" : ""}`;
return (
<div className={className}>
<textarea className="form-control" type={field.type} {...field.input}/>
<div className="input-helper">
{touched ? error : ""}
</div>
</div>
);
}
renderDataMessage(){
if(this.props.postErrorMessage){
return (
<div className="alert alert-danger">
<strong>{this.props.postErrorMessage}</strong>
</div>
)
}
}
renderButton(){
const { handleSubmit } = this.props;
return(
<div style={{textAlign: 'center'}}>
<Button onClick={handleSubmit(this.onSubmit.bind(this))}>
Submit
</Button>
</div>
)
}
render(){
if(this.props.user && this.props.user.id){
return(
<div>
<div style={{padding: "0 0 2% 0"}}>
Leave your comment
<Icon type="message"/>
</div>
<form style={{fontSize: "1em"}}>
<Field
name="content"
type="text"
component={this.renderField}
/>
{this.renderDataMessage()}
{this.renderButton()}
</form>
</div>
);
}else{
return(
<div style={{fontSize: ".8em", padding: "5% 5%", textAlign: "center"}}>
Please
<Button onClick={this.onLoginClick.bind(this)}>
Log in
</Button>
Or
<Button onClick={this.onSignupClick.bind(this)}>
Sign up
</Button>
to leave a comment
</div>
);
}
}
}
function validateForm(values){
const errors={};
return errors;
}
function mapStateToProps(state){
return {
postErrorMessage: state.data.error,
user: state.auth.user
};
}
function mapDispatchToProps(dispatch){
return bindActionCreators({
createComment: createComment,
clearDataErr: clearDataErr
},dispatch);
}
export default reduxForm({
validate: validateForm,
form: 'commentNew',
})(connect(mapStateToProps, mapDispatchToProps)(CommentNewForm))
|
export const source = '<svg viewBox="0 0 266 150" fill="none" width="266" height="150" ><path fill="#FFFFFF" d="M0 0h266v150H0z"></path><rect x="142" y="32" width="104.391" height="4" rx="2" fill="#A0AEC0"></rect><rect x="20" y="32" width="74" height="5" rx="2.5" fill="#4A5568"></rect><rect x="142" y="40" width="77" height="4" rx="2" fill="#A0AEC0"></rect><path fill="#E2E8F0" d="M20 61h55v27H20zM20 91h111v39H20z"></path><path d="M70.556 118h10.888c.86 0 1.556-.696 1.556-1.556v-10.888c0-.86-.696-1.556-1.556-1.556H70.556c-.86 0-1.556.696-1.556 1.556v10.888c0 .86.696 1.556 1.556 1.556zm0 0l8.555-8.556L83 113.333m-8.556-5.055a1.166 1.166 0 11-2.332 0 1.166 1.166 0 012.332 0z" stroke="#A0AEC0" stroke-width="1.2px" stroke-linecap="round" stroke-linejoin="round" fill="none"></path><path fill="#E2E8F0" d="M78 61h53v27H78z"></path><path d="M101.111 79h7.778A1.11 1.11 0 00110 77.889V70.11a1.11 1.11 0 00-1.111-1.11h-7.778A1.11 1.11 0 00100 70.111v7.778A1.11 1.11 0 00101.111 79zm0 0l6.111-6.111L110 75.667m-6.111-3.611a.833.833 0 11-1.666 0 .833.833 0 011.666 0zM44.111 79h7.778c.613 0 1.111-.498 1.111-1.111V70.11c0-.614-.498-1.111-1.111-1.111H44.11c-.613 0-1.111.498-1.111 1.111v7.778c0 .614.498 1.111 1.111 1.111zm0 0l6.111-6.111L53 75.667m-6.111-3.611a.833.833 0 11-1.667 0 .833.833 0 011.667 0z" stroke="#A0AEC0" stroke-linecap="round" stroke-linejoin="round" fill="none"></path><path fill="#E2E8F0" d="M134 103h56v27h-56z"></path><path d="M158.111 122h7.778a1.11 1.11 0 001.111-1.111v-7.778a1.11 1.11 0 00-1.111-1.111h-7.778a1.11 1.11 0 00-1.111 1.111v7.778a1.11 1.11 0 001.111 1.111zm0 0l6.111-6.111 2.778 2.778m-6.111-3.611a.833.833 0 11-1.666 0 .833.833 0 011.666 0z" stroke="#A0AEC0" stroke-linecap="round" stroke-linejoin="round" fill="none"></path><path fill="#E2E8F0" d="M134 61h112v39H134zM193 103h53v27h-53z"></path><path d="M215.111 122h7.778a1.11 1.11 0 001.111-1.111v-7.778a1.11 1.11 0 00-1.111-1.111h-7.778a1.11 1.11 0 00-1.111 1.111v7.778a1.11 1.11 0 001.111 1.111zm0 0l6.111-6.111 2.778 2.778m-6.111-3.611a.833.833 0 11-1.666 0 .833.833 0 011.666 0z" stroke="#A0AEC0" stroke-linecap="round" stroke-linejoin="round" fill="none"></path><path d="M184.556 87h10.888c.86 0 1.556-.696 1.556-1.556V74.556c0-.86-.696-1.556-1.556-1.556h-10.888c-.86 0-1.556.696-1.556 1.556v10.888c0 .86.696 1.556 1.556 1.556zm0 0l8.555-8.556 3.889 3.89m-8.556-5.056a1.166 1.166 0 11-2.333 0 1.166 1.166 0 012.333 0z" stroke="#A0AEC0" stroke-width="1.2px" stroke-linecap="round" stroke-linejoin="round" fill="none"></path></svg>'
|
const matchers = require('../helpers/matchers');
const DEFAULT_VALIDATOR = function defaultValidator() {
return true;
};
function validateProperty(
aValueObjectInstance,
aPropertyDescriptor
) {
let propertyName = aPropertyDescriptor.name;
let propertyValue = aPropertyDescriptor.value;
let propertyValidator = getValidatorForProperty(
aValueObjectInstance,
propertyName
);
if (propertyValidator(propertyValue) !== true) {
throw new TypeError(`ValueObject was provided an invalid value for property "${propertyName}",\
value: "${propertyValue}" did not pass the property validation`);
}
}
function getValidatorForProperty(
aValueObjectInstance,
aPropertyName
) {
let validators = getValidatorsMapForInstance(aValueObjectInstance);
let validator = validators[aPropertyName];
if (matchers.isFunction(validator)) {
return validator;
}
return DEFAULT_VALIDATOR;
}
function getValidatorsMapForInstance(aValueObjectInstance) {
return aValueObjectInstance
.constructor.validators();
}
module.exports = validateProperty;
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
/* eslint no-undef: 'error' */
/* eslint no-param-reassign: ["error", { "props": false }] */
import moment from 'moment';
import { t, SupersetClient } from '@superset-ui/core';
import { getControlsState } from 'src/explore/store';
import { isFeatureEnabled, FeatureFlag } from '../featureFlags';
import {
getAnnotationJsonUrl,
getExploreUrl,
getLegacyEndpointType,
buildV1ChartDataPayload,
postForm,
shouldUseLegacyApi,
getChartDataUri,
} from '../explore/exploreUtils';
import {
requiresQuery,
ANNOTATION_SOURCE_TYPES,
} from '../modules/AnnotationTypes';
import { addDangerToast } from '../messageToasts/actions';
import { logEvent } from '../logger/actions';
import { Logger, LOG_ACTIONS_LOAD_CHART } from '../logger/LogUtils';
import { getClientErrorObject } from '../utils/getClientErrorObject';
import { allowCrossDomain as domainShardingEnabled } from '../utils/hostNamesConfig';
import { updateDataMask } from '../dataMask/actions';
export const CHART_UPDATE_STARTED = 'CHART_UPDATE_STARTED';
export function chartUpdateStarted(queryController, latestQueryFormData, key) {
return {
type: CHART_UPDATE_STARTED,
queryController,
latestQueryFormData,
key,
};
}
export const CHART_UPDATE_SUCCEEDED = 'CHART_UPDATE_SUCCEEDED';
export function chartUpdateSucceeded(queriesResponse, key) {
return { type: CHART_UPDATE_SUCCEEDED, queriesResponse, key };
}
export const CHART_UPDATE_STOPPED = 'CHART_UPDATE_STOPPED';
export function chartUpdateStopped(key) {
return { type: CHART_UPDATE_STOPPED, key };
}
export const CHART_UPDATE_FAILED = 'CHART_UPDATE_FAILED';
export function chartUpdateFailed(queriesResponse, key) {
return { type: CHART_UPDATE_FAILED, queriesResponse, key };
}
export const CHART_UPDATE_QUEUED = 'CHART_UPDATE_QUEUED';
export function chartUpdateQueued(asyncJobMeta, key) {
return { type: CHART_UPDATE_QUEUED, asyncJobMeta, key };
}
export const CHART_RENDERING_FAILED = 'CHART_RENDERING_FAILED';
export function chartRenderingFailed(error, key, stackTrace) {
return { type: CHART_RENDERING_FAILED, error, key, stackTrace };
}
export const CHART_RENDERING_SUCCEEDED = 'CHART_RENDERING_SUCCEEDED';
export function chartRenderingSucceeded(key) {
return { type: CHART_RENDERING_SUCCEEDED, key };
}
export const REMOVE_CHART = 'REMOVE_CHART';
export function removeChart(key) {
return { type: REMOVE_CHART, key };
}
export const ANNOTATION_QUERY_SUCCESS = 'ANNOTATION_QUERY_SUCCESS';
export function annotationQuerySuccess(annotation, queryResponse, key) {
return { type: ANNOTATION_QUERY_SUCCESS, annotation, queryResponse, key };
}
export const ANNOTATION_QUERY_STARTED = 'ANNOTATION_QUERY_STARTED';
export function annotationQueryStarted(annotation, queryController, key) {
return { type: ANNOTATION_QUERY_STARTED, annotation, queryController, key };
}
export const ANNOTATION_QUERY_FAILED = 'ANNOTATION_QUERY_FAILED';
export function annotationQueryFailed(annotation, queryResponse, key) {
return { type: ANNOTATION_QUERY_FAILED, annotation, queryResponse, key };
}
export const DYNAMIC_PLUGIN_CONTROLS_READY = 'DYNAMIC_PLUGIN_CONTROLS_READY';
export const dynamicPluginControlsReady = () => (dispatch, getState) => {
const state = getState();
const controlsState = getControlsState(
state.explore,
state.explore.form_data,
);
dispatch({
type: DYNAMIC_PLUGIN_CONTROLS_READY,
key: controlsState.slice_id.value,
controlsState,
});
};
const legacyChartDataRequest = async (
formData,
resultFormat,
resultType,
force,
method = 'POST',
requestParams = {},
) => {
const endpointType = getLegacyEndpointType({ resultFormat, resultType });
const allowDomainSharding =
// eslint-disable-next-line camelcase
domainShardingEnabled && requestParams?.dashboard_id;
const url = getExploreUrl({
formData,
endpointType,
force,
allowDomainSharding,
method,
requestParams: requestParams.dashboard_id
? { dashboard_id: requestParams.dashboard_id }
: {},
});
const querySettings = {
...requestParams,
url,
postPayload: { form_data: formData },
};
const clientMethod =
'GET' && isFeatureEnabled(FeatureFlag.CLIENT_CACHE)
? SupersetClient.get
: SupersetClient.post;
return clientMethod(querySettings).then(({ json }) =>
// Make the legacy endpoint return a payload that corresponds to the
// V1 chart data endpoint response signature.
({
result: [json],
}),
);
};
const v1ChartDataRequest = async (
formData,
resultFormat,
resultType,
force,
requestParams,
setDataMask,
) => {
const payload = buildV1ChartDataPayload({
formData,
resultType,
resultFormat,
force,
setDataMask,
});
// The dashboard id is added to query params for tracking purposes
const { slice_id: sliceId } = formData;
const { dashboard_id: dashboardId } = requestParams;
const qs = {};
if (sliceId !== undefined) qs.form_data = `{"slice_id":${sliceId}}`;
if (dashboardId !== undefined) qs.dashboard_id = dashboardId;
if (force !== false) qs.force = force;
const allowDomainSharding =
// eslint-disable-next-line camelcase
domainShardingEnabled && requestParams?.dashboard_id;
const url = getChartDataUri({
path: '/api/v1/chart/data',
qs,
allowDomainSharding,
}).toString();
const querySettings = {
...requestParams,
url,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
};
return SupersetClient.post(querySettings).then(({ json }) => json);
};
export async function getChartDataRequest({
formData,
setDataMask = () => {},
resultFormat = 'json',
resultType = 'full',
force = false,
method = 'POST',
requestParams = {},
}) {
let querySettings = {
...requestParams,
};
if (domainShardingEnabled) {
querySettings = {
...querySettings,
mode: 'cors',
credentials: 'include',
};
}
if (shouldUseLegacyApi(formData)) {
return legacyChartDataRequest(
formData,
resultFormat,
resultType,
force,
method,
querySettings,
);
}
return v1ChartDataRequest(
formData,
resultFormat,
resultType,
force,
querySettings,
setDataMask,
);
}
export function runAnnotationQuery(
annotation,
timeout = 60,
formData = null,
key,
isDashboardRequest = false,
) {
return function (dispatch, getState) {
const sliceKey = key || Object.keys(getState().charts)[0];
// make a copy of formData, not modifying original formData
const fd = {
...(formData || getState().charts[sliceKey].latestQueryFormData),
};
if (!requiresQuery(annotation.sourceType)) {
return Promise.resolve();
}
const granularity = fd.time_grain_sqla || fd.granularity;
fd.time_grain_sqla = granularity;
fd.granularity = granularity;
const overridesKeys = Object.keys(annotation.overrides);
if (overridesKeys.includes('since') || overridesKeys.includes('until')) {
annotation.overrides = {
...annotation.overrides,
time_range: null,
};
}
const sliceFormData = Object.keys(annotation.overrides).reduce(
(d, k) => ({
...d,
[k]: annotation.overrides[k] || fd[k],
}),
{},
);
if (!isDashboardRequest && fd) {
const hasExtraFilters = fd.extra_filters && fd.extra_filters.length > 0;
sliceFormData.extra_filters = hasExtraFilters
? fd.extra_filters
: undefined;
}
const isNative = annotation.sourceType === ANNOTATION_SOURCE_TYPES.NATIVE;
const url = getAnnotationJsonUrl(annotation.value, sliceFormData, isNative);
const controller = new AbortController();
const { signal } = controller;
dispatch(annotationQueryStarted(annotation, controller, sliceKey));
return SupersetClient.get({
url,
signal,
timeout: timeout * 1000,
})
.then(({ json }) =>
dispatch(annotationQuerySuccess(annotation, json, sliceKey)),
)
.catch(response =>
getClientErrorObject(response).then(err => {
if (err.statusText === 'timeout') {
dispatch(
annotationQueryFailed(
annotation,
{ error: 'Query timeout' },
sliceKey,
),
);
} else if ((err.error || '').toLowerCase().includes('no data')) {
dispatch(annotationQuerySuccess(annotation, err, sliceKey));
} else if (err.statusText !== 'abort') {
dispatch(annotationQueryFailed(annotation, err, sliceKey));
}
}),
);
};
}
export const TRIGGER_QUERY = 'TRIGGER_QUERY';
export function triggerQuery(value = true, key) {
return { type: TRIGGER_QUERY, value, key };
}
// this action is used for forced re-render without fetch data
export const RENDER_TRIGGERED = 'RENDER_TRIGGERED';
export function renderTriggered(value, key) {
return { type: RENDER_TRIGGERED, value, key };
}
export const UPDATE_QUERY_FORM_DATA = 'UPDATE_QUERY_FORM_DATA';
export function updateQueryFormData(value, key) {
return { type: UPDATE_QUERY_FORM_DATA, value, key };
}
// in the sql lab -> explore flow, user can inline edit chart title,
// then the chart will be assigned a new slice_id
export const UPDATE_CHART_ID = 'UPDATE_CHART_ID';
export function updateChartId(newId, key = 0) {
return { type: UPDATE_CHART_ID, newId, key };
}
export const ADD_CHART = 'ADD_CHART';
export function addChart(chart, key) {
return { type: ADD_CHART, chart, key };
}
export function exploreJSON(
formData,
force = false,
timeout = 60,
key,
method,
dashboardId,
) {
return async dispatch => {
const logStart = Logger.getTimestamp();
const controller = new AbortController();
const requestParams = {
signal: controller.signal,
timeout: timeout * 1000,
};
if (dashboardId) requestParams.dashboard_id = dashboardId;
const setDataMask = dataMask => {
dispatch(updateDataMask(formData.slice_id, dataMask));
};
const chartDataRequest = getChartDataRequest({
setDataMask,
formData,
resultFormat: 'json',
resultType: 'full',
force,
method,
requestParams,
});
dispatch(chartUpdateStarted(controller, formData, key));
const chartDataRequestCaught = chartDataRequest
.then(response => {
const queriesResponse = response.result;
if (isFeatureEnabled(FeatureFlag.GLOBAL_ASYNC_QUERIES)) {
// deal with getChartDataRequest transforming the response data
const result = 'result' in response ? response.result[0] : response;
return dispatch(chartUpdateQueued(result, key));
}
queriesResponse.forEach(resultItem =>
dispatch(
logEvent(LOG_ACTIONS_LOAD_CHART, {
slice_id: key,
applied_filters: resultItem.applied_filters,
is_cached: resultItem.is_cached,
force_refresh: force,
row_count: resultItem.rowcount,
datasource: formData.datasource,
start_offset: logStart,
ts: new Date().getTime(),
duration: Logger.getTimestamp() - logStart,
has_extra_filters:
formData.extra_filters && formData.extra_filters.length > 0,
viz_type: formData.viz_type,
data_age: resultItem.is_cached
? moment(new Date()).diff(moment.utc(resultItem.cached_dttm))
: null,
}),
),
);
return dispatch(chartUpdateSucceeded(queriesResponse, key));
})
.catch(response => {
const appendErrorLog = (errorDetails, isCached) => {
dispatch(
logEvent(LOG_ACTIONS_LOAD_CHART, {
slice_id: key,
has_err: true,
is_cached: isCached,
error_details: errorDetails,
datasource: formData.datasource,
start_offset: logStart,
ts: new Date().getTime(),
duration: Logger.getTimestamp() - logStart,
}),
);
};
if (response.name === 'AbortError') {
appendErrorLog('abort');
return dispatch(chartUpdateStopped(key));
}
return getClientErrorObject(response).then(parsedResponse => {
if (response.statusText === 'timeout') {
appendErrorLog('timeout');
} else {
appendErrorLog(parsedResponse.error, parsedResponse.is_cached);
}
return dispatch(chartUpdateFailed([parsedResponse], key));
});
});
// only retrieve annotations when calling the legacy API
const annotationLayers = shouldUseLegacyApi(formData)
? formData.annotation_layers || []
: [];
const isDashboardRequest = dashboardId > 0;
return Promise.all([
chartDataRequestCaught,
dispatch(triggerQuery(false, key)),
dispatch(updateQueryFormData(formData, key)),
...annotationLayers.map(x =>
dispatch(
runAnnotationQuery(x, timeout, formData, key, isDashboardRequest),
),
),
]);
};
}
export const GET_SAVED_CHART = 'GET_SAVED_CHART';
export function getSavedChart(
formData,
force = false,
timeout = 60,
key,
dashboardId,
) {
/*
* Perform a GET request to `/explore_json`.
*
* This will return the payload of a saved chart, optionally filtered by
* ad-hoc or extra filters from dashboards. Eg:
*
* GET /explore_json?{"chart_id":1}
* GET /explore_json?{"chart_id":1,"extra_filters":"..."}
*
*/
return exploreJSON(formData, force, timeout, key, 'GET', dashboardId);
}
export const POST_CHART_FORM_DATA = 'POST_CHART_FORM_DATA';
export function postChartFormData(
formData,
force = false,
timeout = 60,
key,
dashboardId,
) {
/*
* Perform a POST request to `/explore_json`.
*
* This will post the form data to the endpoint, returning a new chart.
*
*/
return exploreJSON(formData, force, timeout, key, 'POST', dashboardId);
}
export function redirectSQLLab(formData) {
return dispatch => {
getChartDataRequest({ formData, resultFormat: 'json', resultType: 'query' })
.then(({ result }) => {
const redirectUrl = '/superset/sqllab';
const payload = {
datasourceKey: formData.datasource,
sql: result[0].query,
};
postForm(redirectUrl, payload);
})
.catch(() =>
dispatch(addDangerToast(t('An error occurred while loading the SQL'))),
);
};
}
export function refreshChart(chartKey, force, dashboardId) {
return (dispatch, getState) => {
const chart = (getState().charts || {})[chartKey];
const timeout = getState().dashboardInfo.common.conf
.SUPERSET_WEBSERVER_TIMEOUT;
if (
!chart.latestQueryFormData ||
Object.keys(chart.latestQueryFormData).length === 0
) {
return;
}
dispatch(
postChartFormData(
chart.latestQueryFormData,
force,
timeout,
chart.id,
dashboardId,
),
);
};
}
|
Clazz.declarePackage ("J.jvxl.readers");
Clazz.load (["J.jvxl.readers.MapFileReader"], "J.jvxl.readers.XplorReader", ["JU.SB", "J.util.Logger", "J.viewer.Viewer"], function () {
c$ = Clazz.decorateAsClass (function () {
this.nBlock = 0;
this.linePt = 2147483647;
this.nRead = 0;
Clazz.instantialize (this, arguments);
}, J.jvxl.readers, "XplorReader", J.jvxl.readers.MapFileReader);
Clazz.makeConstructor (c$,
function () {
Clazz.superConstructor (this, J.jvxl.readers.XplorReader, []);
});
$_V(c$, "init2",
function (sg, br) {
this.init2MFR (sg, br);
if (this.params.thePlane == null) this.params.insideOut = !this.params.insideOut;
this.nSurfaces = 1;
}, "J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");
$_V(c$, "readParameters",
function () {
this.jvxlFileHeaderBuffer = new JU.SB ();
var nLines = this.parseIntStr (this.getLine ());
for (var i = nLines; --i >= 0; ) {
this.line = this.br.readLine ().trim ();
J.util.Logger.info ("XplorReader: " + this.line);
this.jvxlFileHeaderBuffer.append ("# ").append (this.line).appendC ('\n');
}
this.jvxlFileHeaderBuffer.append ("Xplor data\nJmol " + J.viewer.Viewer.getJmolVersion () + '\n');
this.na = this.parseIntStr (this.getLine ());
this.nxyzStart[0] = this.parseInt ();
this.nx = this.parseInt () - this.nxyzStart[0] + 1;
this.nb = this.parseInt ();
this.nxyzStart[1] = this.parseInt ();
this.ny = this.parseInt () - this.nxyzStart[1] + 1;
this.nc = this.parseInt ();
this.nxyzStart[2] = this.parseInt ();
this.nz = this.parseInt () - this.nxyzStart[2] + 1;
this.a = this.parseFloatStr (this.getLine ());
this.b = this.parseFloat ();
this.c = this.parseFloat ();
this.alpha = this.parseFloat ();
this.beta = this.parseFloat ();
this.gamma = this.parseFloat ();
this.getLine ();
this.maps = 3;
this.mapr = 2;
this.mapc = 1;
this.getVectorsAndOrigin ();
this.setCutoffAutomatic ();
this.nBlock = this.voxelCounts[2] * this.voxelCounts[1];
});
$_M(c$, "getLine",
($fz = function () {
this.readLine ();
while (this.line != null && (this.line.length == 0 || this.line.indexOf ("REMARKS") >= 0 || this.line.indexOf ("XPLOR:") >= 0)) this.readLine ();
return this.line;
}, $fz.isPrivate = true, $fz));
$_V(c$, "nextVoxel",
function () {
if (this.linePt >= this.line.length) {
this.readLine ();
this.linePt = 0;
if ((this.nRead % this.nBlock) == 0) {
this.readLine ();
}}if (this.line == null) return 0;
var val = this.parseFloatRange (this.line, this.linePt, this.linePt + 12);
this.linePt += 12;
this.nRead++;
return val;
});
});
|
import React from 'react';
import { graphql } from 'gatsby';
import { FormattedMessage, FormattedHTMLMessage } from 'react-intl';
import FormattedMetaTags from '../components/FormattedMetaTags';
import FormattedOpenGraph from '../components/FormattedOpenGraph';
import { Page } from '../components/Page/Page';
import { Container } from '../components/Container/Container';
import { PageHeader } from '../components/PageHeader/PageHeader';
import { Section } from '../components/Section/Section';
import { Heading } from '../components/Heading/Heading';
import { Offer } from '../components/Offer/Offer';
export default ({
pageContext: {
intl: { language, originalPath },
},
data: {
site: {
siteMetadata: { siteUrl },
},
},
}) => {
return (
<Page>
<FormattedMetaTags
titleId="meta_title_pricing"
descriptionId="meta_description_pricing"
/>
<FormattedOpenGraph
idOgTitle="meta_title_pricing"
url={siteUrl}
path={`/${language}${originalPath}`}
/>
<Container>
<div className="price__header">
<PageHeader>
<FormattedMessage id="prices_pageheader" />
</PageHeader>
</div>
<div className="price__subtitle">
<FormattedHTMLMessage id="prices_go_to_form" />
</div>
<Section className="prices">
<div className="prices__description">
<FormattedMessage id="prices__description" />
</div>
<div className="item">
<Heading level="3" className="item__title">
<FormattedMessage id="prices_item_title" />
</Heading>
<ul className="list list--secondary">
<li>
<FormattedMessage id="prices_personal_chats" />
</li>
<li>
<FormattedMessage id="prices_group_open_closed_chats" />
</li>
<li>
<FormattedMessage id="prices_open_closed_channels" />
</li>
<li>
<FormattedMessage id="prices_stickers_smiles_reactions" />
</li>
<li>
<FormattedMessage id="prices_statuses" />
</li>
<li>
<FormattedMessage id="prices_voice_messages" />
</li>
<li>
<FormattedMessage id="prices_starred_chats_and_contacts" />
</li>
<li>
<FormattedMessage id="prices_address_book" />
</li>
<li>
<FormattedMessage id="prices_search" />
</li>
<li>
<FormattedMessage id="prices_mentions" />
</li>
<li>
<FormattedMessage id="prices_view_all_media" />
</li>
<li>
<FormattedMessage id="prices_cites" />
</li>
<li>
<FormattedMessage id="prices_geolocation" />
</li>
<li>
<FormattedMessage id="prices_contact_in_chat" />
</li>
<li>
<FormattedMessage id="prices_disable_notification" />
</li>
</ul>
</div>
<div className="item">
<Heading level="3" className="item__title">
<FormattedMessage id="prices_corporate_fuctions" />
</Heading>
<ul className="list list--secondary">
<li>
<FormattedMessage id="prices_exchange_documents" />
</li>
<li>
<FormattedMessage id="prices_chatbots" />
</li>
<li>
<FormattedMessage id="prices_audio_video_conference" />
</li>
<li>
<FormattedMessage id="prices_discovery" />
</li>
<li>
<FormattedMessage id="prices_policy_management" />
</li>
<li>
<FormattedMessage id="prices_admin_panel" />
</li>
<li>
<FormattedMessage id="prices_custom_data_in_profile" />
</li>
<li>
<FormattedMessage id="prices_screensahring" />
</li>
<li>
<FormattedMessage id="prices_interface_customization" />
</li>
</ul>
</div>
<div className="item">
<Heading level="3" className="item__title">
<FormattedMessage id="prices_integrations" />
</Heading>
<ul className="list list--secondary">
<li>
<FormattedMessage id="prices_video_conference_integrations" />
</li>
<li>
<FormattedMessage id="prices_ats" />
</li>
<li>
<FormattedMessage id="prices_open_api" />
</li>
<li>
<FormattedMessage id="prices_ad_ldap" />
</li>
<li>
<FormattedMessage id="prices_security_infrastructure" />
</li>
<li>
<FormattedMessage id="prices_bot_sdk" />
</li>
</ul>
</div>
</Section>
<div id="prices_offer_form">
<Offer />
</div>
</Container>
</Page>
);
};
export const pageQuery = graphql`
{
site {
siteMetadata {
siteUrl
}
}
}
`;
|
'use strict';
import {renderer} from '../../src/js/core/renderer';
import {expect} from 'chai';
describe('Renderers', () => {
let
renderers,
mockRenderer = {
name: 'mock',
options: {
prefix: 'mock'
},
canPlayType: (type) => {
let validMedia = ['video/mime-3'];
return validMedia.indexOf(type) > -1;
}
},
empty = null
;
describe('#order', () => {
it('returns the order', () => {
expect(renderer.order).to.deep.equal([]);
});
it('can be changed', () => {
renderer.order = ['html5', 'flash_hls', 'flash_video', 'native_hls'];
expect(renderer.order).to.deep.equal(['html5', 'flash_hls', 'flash_video', 'native_hls']);
});
it('only accepts an array of strings', () => {
let a = () => {
renderer.order = 'foo';
};
expect(a).to.throw(Error);
});
});
describe('#renderers', () => {
it('returns the renderers', () => {
expect(renderer.renderers).to.deep.equal({});
});
it('can be changed', () => {
renderer.renderers = mockRenderer;
expect(renderer.renderers).to.deep.equal(mockRenderer);
expect(() => {
renderer.renderers = 'dummy';
}).to.throw(Error);
});
it('only accepts an array of objects', () => {
expect(() => {
renderer.renderers = 'foo';
}).to.throw(Error);
expect(() => {
renderer.renderers = undefined;
}).to.throw(TypeError);
expect(() => {
renderer.renderers = mockRenderer;
}).to.not.throw(Error);
});
});
describe('#add', () => {
it('can add a renderer as an object with at least `name` property', () => {
// Proper structure of renderer
const a = () => {
renderer.add(mockRenderer);
};
expect(a).to.not.throw(Error);
});
it('cannot add a renderer as an object without at least `name` property', () => {
// Incorrect structure
const b = () => {
renderer.add({});
};
expect(b).to.throw(Error);
});
});
describe('#select', () => {
const mediaFiles = [
{type: 'video/mime-1', src: '/path/to/media/1'},
{type: 'video/mime-2', src: '/path/to/media/2'},
{type: 'video/mime-3', src: '/path/to/media/3'},
];
beforeEach(() => {
// renderers = new Renderer();
renderer.add(mockRenderer);
});
it('selects a renderer based on media files', () => {
const a = renderer.select(mediaFiles);
expect(a).to.deep.equal({rendererName: 'mock', src: '/path/to/media/3'});
});
it('selects a renderer based on media files from argument `renderers`', () => {
const a = renderer.select(mediaFiles, ['mock', 'dummy']);
expect(a).to.deep.equal({rendererName: 'mock', src: '/path/to/media/3'});
});
it('returns null if no renderer was selected', () => {
const b = renderer.select([{type: 'video/mime-4', src: '/path/to/media/4'}]);
expect(b === null).to.be.true;
});
it('returns null if no renderer was selected from argument `renderers`', () => {
const a = renderer.select(mediaFiles, ['dummy']);
expect(a === null).to.be.true;
});
});
});
|
import React, { PureComponent } from 'react'
import { Link } from 'react-router-dom';
import './index.css'
class Button extends PureComponent {
render() {
const Linkobject = (this.props.link.indexOf('http://') === 0 || this.props.link.indexOf('https://') === 0)
? 'a'
: Link;
return (
this.props.link ?
<Linkobject
to={this.props.link}
href={this.props.link}
className={this.props.className ? `btn ${this.props.className}` : 'btn'}
>
{this.props.children}
</Linkobject> :
this.props.children
)
}
}
export default Button
|
import Ember from 'ember';
var EmberOrderedSet = Ember.OrderedSet;
var guidFor = Ember.guidFor;
export default function OrderedSet() {
this._super$constructor();
}
OrderedSet.create = function () {
var Constructor = this;
return new Constructor();
};
OrderedSet.prototype = Object.create(EmberOrderedSet.prototype);
OrderedSet.prototype.constructor = OrderedSet;
OrderedSet.prototype._super$constructor = EmberOrderedSet;
OrderedSet.prototype.addWithIndex = function (obj, idx) {
var guid = guidFor(obj);
var presenceSet = this.presenceSet;
var list = this.list;
if (presenceSet[guid] === true) {
return;
}
presenceSet[guid] = true;
if (idx === undefined || idx === null) {
list.push(obj);
} else {
list.splice(idx, 0, obj);
}
this.size += 1;
return this;
};
|
'use strict'
const hapiJwt = require('hapi-auth-jwt2')
const JWT_SECRET_KEY = '12345'
const register = function register (server, options, next) {
server.register(hapiJwt)
server.auth.strategy('jwt', 'jwt',
{ key: JWT_SECRET_KEY,
validateFunc: (decoded, request, callback) => callback(null, true), // This should be replaced with a more robust function
verifyOptions: { algorithms: [ 'HS256' ] }
})
server.auth.default('jwt')
next()
}
register.attributes = {
name: 'auth-wrapper',
version: '0.0.1'
}
module.exports = register
|
'use strict';
var reducer = require('./reducer-b4f65523.js');
var redux = require('redux');
var initialize = require('./initialize-608b1c6b.js');
var base = require('./base-bdd9c13b.js');
/*
* Copyright 2018 The boardgame.io Authors
*
* Use of this source code is governed by a MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
const getPlayerMetadata = (gameMetadata, playerID) => {
if (gameMetadata && gameMetadata.players) {
return gameMetadata.players[playerID];
}
};
function IsSynchronous(storageAPI) {
return storageAPI.type() === base.Type.SYNC;
}
/**
* Redact the log.
*
* @param {Array} log - The game log (or deltalog).
* @param {String} playerID - The playerID that this log is
* to be sent to.
*/
function redactLog(log, playerID) {
if (log === undefined) {
return log;
}
return log.map(logEvent => {
// filter for all other players and spectators.
if (playerID !== null && +playerID === +logEvent.action.payload.playerID) {
return logEvent;
}
if (logEvent.redact !== true) {
return logEvent;
}
const payload = {
...logEvent.action.payload,
args: null,
};
const filteredEvent = {
...logEvent,
action: { ...logEvent.action, payload },
};
/* eslint-disable-next-line no-unused-vars */
const { redact, ...remaining } = filteredEvent;
return remaining;
});
}
/**
* Verifies that the game has metadata and is using credentials.
*/
const doesGameRequireAuthentication = (gameMetadata) => {
if (!gameMetadata)
return false;
const { players } = gameMetadata;
const hasCredentials = Object.keys(players).some(key => {
return !!(players[key] && players[key].credentials);
});
return hasCredentials;
};
/**
* Verifies that the move came from a player with the correct credentials.
*/
const isActionFromAuthenticPlayer = (actionCredentials, playerMetadata) => {
if (!actionCredentials)
return false;
if (!playerMetadata)
return false;
return actionCredentials === playerMetadata.credentials;
};
/**
* Remove player credentials from action payload
*/
const stripCredentialsFromAction = (action) => {
// eslint-disable-next-line no-unused-vars
const { credentials, ...payload } = action.payload;
return { ...action, payload };
};
const getCtxPlayers = (gameMetadata, gameID, clientInfo) => {
// console.log("[getCtxPlayers] gameID", gameID, "clientInfo", clientInfo)
let allPlayers = Object.values(gameMetadata.players).reduce((allPlayers, player) => {
if (player.name) {
let isConnected = false;
clientInfo.forEach((client) => {
if (client.gameID == gameID && client.playerID == player.id) {
isConnected = client.socket.connected;
}
});
// console.log("[getCtxPlayers]", player.id, player.name, isConnected)
allPlayers.push({
id: player.id,
name: player.name,
isConnected,
isHost: false,
});
}
return allPlayers;
}, []);
for (let player of allPlayers) {
if (player.name) {
player.isHost = true;
break;
}
}
return allPlayers;
};
/**
* Master
*
* Class that runs the game and maintains the authoritative state.
* It uses the transportAPI to communicate with clients and the
* storageAPI to communicate with the database.
*/
class Master {
constructor(game, storageAPI, transportAPI, clientInfo, auth) {
this.game = reducer.ProcessGameConfig(game);
this.storageAPI = storageAPI;
this.transportAPI = transportAPI;
this.clientInfo = clientInfo;
this.auth = null;
this.subscribeCallback = () => { };
this.shouldAuth = () => false;
if (auth === true) {
this.auth = isActionFromAuthenticPlayer;
this.shouldAuth = doesGameRequireAuthentication;
}
else if (typeof auth === 'function') {
this.auth = auth;
this.shouldAuth = () => true;
}
}
subscribe(fn) {
this.subscribeCallback = fn;
}
/**
* Called on each move / event made by the client.
* Computes the new value of the game state and returns it
* along with a deltalog.
*/
async onUpdate(credAction, stateID, gameID, playerID) {
let isActionAuthentic;
let metadata;
const credentials = credAction.payload.credentials;
if (IsSynchronous(this.storageAPI)) {
({ metadata } = this.storageAPI.fetch(gameID, { metadata: true }));
const playerMetadata = getPlayerMetadata(metadata, playerID);
isActionAuthentic = this.shouldAuth(metadata)
? this.auth(credentials, playerMetadata)
: true;
}
else {
({ metadata } = await this.storageAPI.fetch(gameID, {
metadata: true,
}));
const playerMetadata = getPlayerMetadata(metadata, playerID);
isActionAuthentic = this.shouldAuth(metadata)
? await this.auth(credentials, playerMetadata)
: true;
}
if (!isActionAuthentic) {
return { error: 'unauthorized action' };
}
let action = stripCredentialsFromAction(credAction);
const key = gameID;
let state;
let result;
if (IsSynchronous(this.storageAPI)) {
result = this.storageAPI.fetch(key, { state: true });
}
else {
result = await this.storageAPI.fetch(key, { state: true });
}
state = result.state;
if (state === undefined) {
reducer.error(`game not found, gameID=[${key}]`);
return { error: 'game not found' };
}
if (state.ctx.gameover !== undefined) {
reducer.error(`game over - gameID=[${key}]`);
return;
}
const reducer$1 = reducer.CreateGameReducer({
game: this.game,
});
const store = redux.createStore(reducer$1, state);
// Only allow UNDO / REDO if there is exactly one player
// that can make moves right now and the person doing the
// action is that player.
if (action.type == reducer.UNDO || action.type == reducer.REDO) {
if (state.ctx.currentPlayer !== playerID ||
state.ctx.activePlayers !== null) {
reducer.error(`playerID=[${playerID}] cannot undo / redo right now`);
return;
}
}
// Check whether the player is active.
if (!this.game.flow.isPlayerActive(state.G, state.ctx, playerID)) {
reducer.error(`player not active - playerID=[${playerID}]`);
return;
}
// Check whether the player is allowed to make the move.
if (action.type == reducer.MAKE_MOVE &&
!this.game.flow.getMove(state.ctx, action.payload.type, playerID)) {
reducer.error(`move not processed - canPlayerMakeMove=false, playerID=[${playerID}]`);
return;
}
if (state._stateID !== stateID) {
reducer.error(`invalid stateID, was=[${stateID}], expected=[${state._stateID}]`);
console.log("Resync? client gameID", gameID, "playerID", playerID);
// resync?
// this.onSync(gameID, playerID, Object.keys(metadata.players).length)
this.transportAPI.send({
playerID,
type: 'resync',
args: [gameID],
});
return;
}
// Update server's version of the store.
store.dispatch(action);
state = store.getState();
state.ctx.players = getCtxPlayers(metadata, gameID, this.clientInfo);
this.subscribeCallback({
state,
action,
gameID,
});
this.transportAPI.sendAll((playerID) => {
const filteredState = {
...state,
G: this.game.playerView(state.G, state.ctx, playerID),
deltalog: undefined,
_undo: [],
_redo: [],
};
const log = redactLog(state.deltalog, playerID);
return {
type: 'update',
args: [gameID, filteredState, log],
};
});
const { deltalog, ...stateWithoutDeltalog } = state;
let newMetadata;
if (metadata &&
!('gameover' in metadata) &&
state.ctx.gameover !== undefined) {
newMetadata = {
...metadata,
gameover: state.ctx.gameover,
};
}
if (IsSynchronous(this.storageAPI)) {
this.storageAPI.setState(key, stateWithoutDeltalog, deltalog);
if (newMetadata)
this.storageAPI.setMetadata(key, newMetadata);
}
else {
const writes = [
this.storageAPI.setState(key, stateWithoutDeltalog, deltalog),
];
if (newMetadata) {
writes.push(this.storageAPI.setMetadata(key, newMetadata));
}
await Promise.all(writes);
}
}
/**
* Called when the client connects / reconnects.
* Returns the latest game state and the entire log.
*/
async onSync(gameID, playerID, numPlayers) {
console.log("onSync client gameID", gameID, "playerID", playerID);
const key = gameID;
let state;
let initialState;
let log;
let gameMetadata;
let filteredMetadata;
let result;
if (IsSynchronous(this.storageAPI)) {
result = this.storageAPI.fetch(key, {
state: true,
metadata: true,
log: true,
initialState: true,
});
}
else {
result = await this.storageAPI.fetch(key, {
state: true,
metadata: true,
log: true,
initialState: true,
});
}
state = result.state;
initialState = result.initialState;
log = result.log;
gameMetadata = result.metadata;
if (gameMetadata) {
filteredMetadata = Object.values(gameMetadata.players).map(player => {
const { credentials, ...filteredData } = player;
return filteredData;
});
}
// If the game doesn't exist, then create one on demand.
// TODO: Move this out of the sync call.
if (state === undefined) {
initialState = state = initialize.InitializeGame({ game: this.game, numPlayers });
this.subscribeCallback({
state,
gameID,
});
if (IsSynchronous(this.storageAPI)) {
this.storageAPI.setState(key, state);
}
else {
await this.storageAPI.setState(key, state);
}
}
state.ctx.players = getCtxPlayers(gameMetadata, gameID, this.clientInfo);
const filteredState = {
...state,
G: this.game.playerView(state.G, state.ctx, playerID),
deltalog: undefined,
_undo: [],
_redo: [],
};
log = redactLog(log, playerID);
const syncInfo = {
state: filteredState,
log,
filteredMetadata,
initialState,
};
this.transportAPI.send({
playerID,
type: 'sync',
args: [gameID, syncInfo],
});
return;
}
/**
* Called when the client disconnects.
* Returns the latest game state and the entire log.
*/
async onDisconnect(gameID, numPlayers) {
const key = gameID;
let state;
let initialState;
let log;
let gameMetadata;
let filteredMetadata;
let result;
if (IsSynchronous(this.storageAPI)) {
result = this.storageAPI.fetch(key, {
state: true,
metadata: true,
log: true,
initialState: true,
});
}
else {
result = await this.storageAPI.fetch(key, {
state: true,
metadata: true,
log: true,
initialState: true,
});
}
state = result.state;
initialState = result.initialState;
log = result.log;
gameMetadata = result.metadata;
if (gameMetadata) {
filteredMetadata = Object.values(gameMetadata.players).map(player => {
const { credentials, ...filteredData } = player;
return filteredData;
});
}
// If the game doesn't exist, then create one on demand.
// TODO: Move this out of the sync call.
if (state === undefined) {
initialState = state = initialize.InitializeGame({ game: this.game, numPlayers });
this.subscribeCallback({
state,
gameID,
});
if (IsSynchronous(this.storageAPI)) {
this.storageAPI.setState(key, state);
}
else {
await this.storageAPI.setState(key, state);
}
}
state.ctx.players = getCtxPlayers(gameMetadata, gameID, this.clientInfo);
this.transportAPI.sendAll((playerID) => {
const filteredState = {
...state,
G: this.game.playerView(state.G, state.ctx, playerID),
deltalog: undefined,
_undo: [],
_redo: [],
};
const log = redactLog(state.deltalog, playerID);
return {
type: 'update',
args: [gameID, filteredState, log],
};
});
return;
}
}
exports.Master = Master;
|
import { all, call, fork, put, takeEvery } from 'redux-saga/effects';
import {
appendNewsItemsFailure,
appendNewsItemsSuccess,
APPEND_NEWS_ITEMS,
LOAD_NEWS,
loadNewsItemsFailure,
loadNewsItemsSuccess,
} from './../actions';
import getInstance from './services/httpService';
function* loadDrinkNewsSaga({ offset }) {
try {
const client = yield call(getInstance);
const news = yield call(client.get, `/api/news?offset=${offset}`);
yield put(loadNewsItemsSuccess(news.data));
} catch (e) {
yield put(loadNewsItemsFailure(e.message));
}
}
function* appendNewsSaga({ offset }) {
try {
const client = yield call(getInstance);
const news = yield call(client.get, `/api/news?offset=${offset}`);
yield put(appendNewsItemsSuccess(news.data));
} catch (e) {
yield put(appendNewsItemsFailure(e.message));
}
}
export default function* () {
yield all([
fork(function* () {
yield takeEvery(LOAD_NEWS, loadDrinkNewsSaga);
}), fork(function* () {
yield takeEvery(APPEND_NEWS_ITEMS, appendNewsSaga);
}),
]);
}
|
/*
* HomePage Messages
*
* This contains all the text for the HomePage container.
*/
import { defineMessages } from 'react-intl';
export const scope = 'app.containers.NewFile';
export default defineMessages({
header: {
id: `${scope}.header`,
},
});
|
/*
* Fuel UX Wizard
* https://github.com/ExactTarget/fuelux
*
* Copyright (c) 2014 ExactTarget
* Licensed under the BSD New license.
*/
// -- BEGIN UMD WRAPPER PREFACE --
// For more information on UMD visit:
// https://github.com/umdjs/umd/blob/master/jqueryPlugin.js
(function (factory) {
if (typeof define === 'function' && define.amd) {
// if AMD loader is available, register as an anonymous module.
define(['jquery'], factory);
} else {
// OR use browser globals if AMD is not present
factory(jQuery);
}
}(function ($) {
// -- END UMD WRAPPER PREFACE --
// -- BEGIN MODULE CODE HERE --
var old = $.fn.wizard;
// WIZARD CONSTRUCTOR AND PROTOTYPE
var Wizard = function (element, options) {
var kids;
this.$element = $(element);
this.options = $.extend({}, $.fn.wizard.defaults, options);
this.options.disablePreviousStep = ( this.$element.attr('data-restrict') === "previous" ) ? true : this.options.disablePreviousStep;
this.currentStep = this.options.selectedItem.step;
this.numSteps = this.$element.find('.steps li').length;
this.$prevBtn = this.$element.find('button.btn-prev');
this.$nextBtn = this.$element.find('button.btn-next');
kids = this.$nextBtn.children().detach();
this.nextText = $.trim(this.$nextBtn.text());
this.$nextBtn.append(kids);
// handle events
this.$prevBtn.on('click.fu.wizard', $.proxy(this.previous, this));
this.$nextBtn.on('click.fu.wizard', $.proxy(this.next, this));
this.$element.on('click.fu.wizard', 'li.complete', $.proxy(this.stepclicked, this));
this.selectedItem(this.options.selectedItem);
if( this.options.disablePreviousStep ) {
this.$prevBtn.attr( 'disabled', true );
this.$element.find( '.steps' ).addClass( 'previous-disabled' );
}
};
Wizard.prototype = {
constructor: Wizard,
destroy: function() {
this.$element.remove();
// any external bindings [none]
// empty elements to return to original markup [none]
// returns string of markup
return this.$element[0].outerHTML;
},
//index is 1 based
//second parameter can be array of objects [{ ... }, { ... }] or you can pass n additional objects as args
//object structure is as follows (all params are optional): { badge: '', label: '', pane: '' }
addSteps: function(index){
var items = [].slice.call(arguments).slice(1);
var $steps = this.$element.find('.steps');
var $stepContent = this.$element.find('.step-content');
var i, l, $pane, $startPane, $startStep, $step;
index = (index===-1 || (index>(this.numSteps+1))) ? this.numSteps+1 : index;
if(items[0] instanceof Array){
items = items[0];
}
$startStep = $steps.find('li:nth-child(' + index + ')');
$startPane = $stepContent.find('.step-pane:nth-child(' + index + ')');
if($startStep.length<1){
$startStep = null;
}
for(i=0, l=items.length; i<l; i++){
$step = $('<li data-step="' + index + '"><span class="badge badge-info"></span></li>');
$step.append(items[i].label || '').append('<span class="chevron"></span>');
$step.find('.badge').append(items[i].badge || index);
$pane = $('<div class="step-pane" data-step="' + index + '"></div>');
$pane.append(items[i].pane || '');
if(!$startStep){
$steps.append($step);
$stepContent.append($pane);
}else{
$startStep.before($step);
$startPane.before($pane);
}
index++;
}
this.syncSteps();
this.numSteps = $steps.find('li').length;
this.setState();
},
//index is 1 based, howMany is number to remove
removeSteps: function(index, howMany){
var action = 'nextAll';
var i = 0;
var $steps = this.$element.find('.steps');
var $stepContent = this.$element.find('.step-content');
var $start;
howMany = (howMany!==undefined) ? howMany : 1;
if(index>$steps.find('li').length){
$start = $steps.find('li:last');
}else{
$start = $steps.find('li:nth-child(' + index + ')').prev();
if($start.length<1){
action = 'children';
$start = $steps;
}
}
$start[action]().each(function(){
var item = $(this);
var step = item.attr('data-step');
if(i<howMany){
item.remove();
$stepContent.find('.step-pane[data-step="' + step + '"]:first').remove();
}else{
return false;
}
i++;
});
this.syncSteps();
this.numSteps = $steps.find('li').length;
this.setState();
},
setState: function () {
var canMovePrev = (this.currentStep > 1);
var firstStep = (this.currentStep === 1);
var lastStep = (this.currentStep === this.numSteps);
// disable buttons based on current step
if( !this.options.disablePreviousStep ) {
this.$prevBtn.attr('disabled', (firstStep === true || canMovePrev === false));
}
// change button text of last step, if specified
var last = this.$nextBtn.attr('data-last');
if (last) {
this.lastText = last;
// replace text
var text = this.nextText;
if ( lastStep === true ) {
text = this.lastText;
// add status class to wizard
this.$element.addClass('complete');
}
else {
this.$element.removeClass('complete');
}
var kids = this.$nextBtn.children().detach();
this.$nextBtn.text(text).append(kids);
}
// reset classes for all steps
var $steps = this.$element.find('.steps li');
$steps.removeClass('active').removeClass('complete');
$steps.find('span.badge').removeClass('badge-info').removeClass('badge-success');
// set class for all previous steps
var prevSelector = '.steps li:lt(' + (this.currentStep - 1) + ')';
var $prevSteps = this.$element.find(prevSelector);
$prevSteps.addClass('complete');
$prevSteps.find('span.badge').addClass('badge-success');
// set class for current step
var currentSelector = '.steps li:eq(' + (this.currentStep - 1) + ')';
var $currentStep = this.$element.find(currentSelector);
$currentStep.addClass('active');
$currentStep.find('span.badge').addClass('badge-info');
// set display of target element
var $stepContent = this.$element.find('.step-content');
var target = $currentStep.attr('data-step');
$stepContent.find('.step-pane').removeClass('active');
$stepContent.find('.step-pane[data-step="' + target + '"]:first').addClass('active');
// reset the wizard position to the left
this.$element.find('.steps').first().attr('style','margin-left: 0');
// check if the steps are wider than the container div
var totalWidth = 0;
this.$element.find('.steps > li').each(function () {
totalWidth += $(this).outerWidth();
});
var containerWidth = 0;
if (this.$element.find('.actions').length) {
containerWidth = this.$element.width() - this.$element.find('.actions').first().outerWidth();
} else {
containerWidth = this.$element.width();
}
if (totalWidth > containerWidth) {
// set the position so that the last step is on the right
var newMargin = totalWidth - containerWidth;
this.$element.find('.steps').first().attr('style','margin-left: -' + newMargin + 'px');
// set the position so that the active step is in a good
// position if it has been moved out of view
if (this.$element.find('li.active').first().position().left < 200) {
newMargin += this.$element.find('li.active').first().position().left - 200;
if (newMargin < 1) {
this.$element.find('.steps').first().attr('style','margin-left: 0');
} else {
this.$element.find('.steps').first().attr('style','margin-left: -' + newMargin + 'px');
}
}
}
// only fire changed event after initializing
if(typeof(this.initialized) !== 'undefined' ) {
var e = $.Event('changed.fu.wizard');
this.$element.trigger(e, {step: this.currentStep});
}
this.initialized = true;
},
stepclicked: function (e) {
var li = $(e.currentTarget);
var index = this.$element.find('.steps li').index(li);
var canMovePrev = true;
if( this.options.disablePreviousStep ) {
if( index < this.currentStep ) {
canMovePrev = false;
}
}
if( canMovePrev ) {
var evt = $.Event('stepclicked.fu.wizard');
this.$element.trigger(evt, {step: index + 1});
if (evt.isDefaultPrevented()) { return; }
this.currentStep = (index + 1);
this.setState();
}
},
syncSteps: function(){
var i = 1;
var $steps = this.$element.find('.steps');
var $stepContent = this.$element.find('.step-content');
$steps.children().each(function(){
var item = $(this);
var badge = item.find('.badge');
var step = item.attr('data-step');
if(!isNaN(parseInt(badge.html(), 10))){
badge.html(i);
}
item.attr('data-step', i);
$stepContent.find('.step-pane[data-step="' + step + '"]:last').attr('data-step', i);
i++;
});
},
previous: function () {
var canMovePrev = (this.currentStep > 1);
if( this.options.disablePreviousStep ) {
canMovePrev = false;
}
if (canMovePrev) {
var e = $.Event('actionclicked.fu.wizard');
this.$element.trigger(e, {step: this.currentStep, direction: 'previous'});
if (e.isDefaultPrevented()) { return; } // don't increment
this.currentStep -= 1;
this.setState();
}
// return focus to control after selecting an option
if( this.$prevBtn.is(':disabled') ) {
this.$nextBtn.focus();
}
else {
this.$prevBtn.focus();
}
},
next: function () {
var canMoveNext = (this.currentStep + 1 <= this.numSteps);
var lastStep = (this.currentStep === this.numSteps);
if (canMoveNext) {
var e = $.Event('actionclicked.fu.wizard');
this.$element.trigger(e, {step: this.currentStep, direction: 'next'});
if (e.isDefaultPrevented()) { return; } // don't increment
this.currentStep += 1;
this.setState();
}
else if (lastStep) {
this.$element.trigger('finished.fu.wizard');
}
// return focus to control after selecting an option
if( this.$nextBtn.is(':disabled') ) {
this.$prevBtn.focus();
}
else {
this.$nextBtn.focus();
}
},
selectedItem: function (selectedItem) {
var retVal, step;
if(selectedItem) {
step = selectedItem.step || -1;
if(step >= 1 && step <= this.numSteps) {
this.currentStep = step;
this.setState();
}else{
step = this.$element.find('.steps li.active:first').attr('data-step');
if(!isNaN(step)){
this.currentStep = parseInt(step, 10);
this.setState();
}
}
retVal = this;
}
else {
retVal = { step: this.currentStep };
}
return retVal;
}
};
// WIZARD PLUGIN DEFINITION
$.fn.wizard = function (option) {
var args = Array.prototype.slice.call( arguments, 1 );
var methodReturn;
var $set = this.each(function () {
var $this = $( this );
var data = $this.data('fu.wizard');
var options = typeof option === 'object' && option;
if( !data ) $this.data('fu.wizard', (data = new Wizard( this, options ) ) );
if( typeof option === 'string' ) methodReturn = data[ option ].apply( data, args );
});
return ( methodReturn === undefined ) ? $set : methodReturn;
};
$.fn.wizard.defaults = {
disablePreviousStep: false,
selectedItem: { step: -1 } //-1 means it will attempt to look for "active" class in order to set the step
};
$.fn.wizard.Constructor = Wizard;
$.fn.wizard.noConflict = function () {
$.fn.wizard = old;
return this;
};
// DATA-API
$(document).on('mouseover.fu.wizard.data-api', '[data-initialize=wizard]', function (e) {
var $control = $(e.target).closest('.wizard');
if ( !$control.data('fu.wizard') ) {
$control.wizard($control.data());
}
});
// Must be domReady for AMD compatibility
$(function () {
$('[data-initialize=wizard]').each(function () {
var $this = $(this);
if ($this.data('fu.wizard')) return;
$this.wizard($this.data());
});
});
// -- BEGIN UMD WRAPPER AFTERWORD --
}));
// -- END UMD WRAPPER AFTERWORD --
|
// Gatsby supports TypeScript natively!
import React from "react"
import { PageProps, Link } from "gatsby"
import Layout from "../components/layout"
import SEO from "../components/seo"
const Register = () => (
<Layout>
<SEO title="Register" />
<style>
@import
url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;600&display=swap');
</style>
<iframe
src="https://docs.google.com/forms/d/e/1FAIpQLScCK1T7vNnN62HaRiHF_IeXsJqucONeR_JbGztJSenWY6cXSQ/viewform?embedded=true"
frameBorder="0"
width="100%"
height="520"
style={{ marginTop: "160px" }}
>
Loading…
</iframe>
<div class="reginfo" style={{ background: "#a13545", padding: "15px" }}>
<p class="title">INDUCTION PROCESS</p>
<p class="filler" style={{ lineHeight: "40px" }}>
STEP 1: Fill out the form. <br></br>
STEP 2: Once we let you know that you have been accepted, contact
Savitha Setlur to obtain your manuals.<br></br>
STEP 3: Contact the Vice President of Membership (Sohum Tiwary:
sohum.tiwary@gmail.com) to get added to the Google Group and WhatsApp
group chat for communication.<br></br>
STEP 4: Once you are added to the google group, please send an email
listing your name, grade, professional picture, and goals for the Gavel
Club to the Google Group. Under the recipients section, type “Gavel
Club” and press enter. <br></br>
ON OUR END: You will be added to the Google Group and WhatsApp chat for
club communications and access to the Roles Sign Up Sheet. You will have
received your manuals and will be added to the active members list so
that you may receive points.
</p>
</div>
<p>
<br></br>
</p>
<p
style={{
color: "black",
fontFamily:
"SFMono-Regular,Consolas,Roboto Mono,Droid Sans Mono,Liberation Mono,Menlo,Courier,monospace",
}}
>
created by anusri saraf {new Date().getFullYear()}
</p>
</Layout>
)
export default Register
|
importScripts('ejohn.Class.js');
var HistoryWorker = Class.extend({
init: function() {
this._MAX_UNDO = 10;
this._history = [];
this._lastdata = [];
},
_addState: function(state) {
this._history.push(state);
if (this._history.length > this._MAX_UNDO) {
this._history.shift();
}
},
getNextUndoType: function() {
if (this._history.length > 0) {
return this._history[this._history.length - 1].type;
} else {
return null;
}
},
getLength: function() {
return this._history.length;
},
clear: function() {
this._history = [];
this._lastdata = [];
},
parseState: function(data) {
var isnew = false;
if (this._lastdata[data.index] == null) {
this._lastdata[data.index] = data;
isnew = true;
}
// We don't handle canvas movement or resizing correctly right now, so
// clear the history.
if (this._lastdata[data.index].x != data.x ||
this._lastdata[data.index].y != data.y ||
this._lastdata[data.index].w != data.w ||
this._lastdata[data.index].h != data.h) {
this.clear();
this._lastdata[data.index] = data;
return;
}
var image_diff = this.diffImageData(
this._lastdata[data.index].imagedata,
data.imagedata,
isnew);
if (image_diff != null) {
this._addState({
'type': 'paint',
'diff': image_diff,
'index': data.index
});
}
this._lastdata[data.index] = data;
},
diffImageData: function(last, curr, isnew) {
var minW = Math.min(last.width, curr.width);
var minH = Math.min(last.height, curr.height);
var changed = false;
var diff = {
'data': new Array(minW * minH * 4),
'width': minW,
'height': minH
};
for (var i = 0; i < minW * minH * 4; i++) {
if (last.data[i] != curr.data[i] || isnew == true) {
if (isnew) {
diff.data[i] = -curr.data[i];
} else {
diff.data[i] = last.data[i] - curr.data[i];
}
if (changed == false) {
changed = true;
}
} else {
diff.data[i] = 0;
}
}
return (changed) ? diff : null;
},
mergeImageData: function(last, diff) {
for (var i = 0; i < diff.width * diff.height * 4; i++) {
last.data[i] += diff.data[i];
}
return last;
},
undo: function(data) {
this.parseState(data);
var diff = this._history.pop();
if (diff == null) {
return null;
}
var data = this._lastdata[diff.index];
switch (diff.type) {
case 'translate':
data.x += diff.x;
data.y += diff.y;
break;
case 'paint':
data.imagedata = this.mergeImageData(data.imagedata, diff.diff);
break;
}
return data;
}
});
var history = new HistoryWorker();
onmessage = function (evt) {
switch (evt.data.action) {
case 'sethistory':
history.parseState(evt.data);
postMessage({
'status': 'ready',
'length': history.getLength(),
'type': history.getNextUndoType()
});
break;
case 'clearhistory':
history.clear();
postMessage({
'status': 'ready',
'length': history.getLength(),
'type': history.getNextUndoType()
});
break;
case 'undo':
var data = history.undo(evt.data);
if (data) {
data.status = 'undo';
data.length = history.getLength();
data.type = history.getNextUndoType();
postMessage(data);
}
break;
}
};
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"014b":function(t,e,n){"use strict";var r=n("e53d"),i=n("07e3"),o=n("8e60"),a=n("63b6"),d=n("9138"),u=n("ebfd").KEY,c=n("294c"),s=n("dbdb"),f=n("45f2"),l=n("62a0"),$=n("5168"),h=n("ccb9"),p=n("6718"),v=n("47ee"),y=n("9003"),m=n("e4ae"),g=n("f772"),b=n("241e"),_=n("36c3"),C=n("1bc3"),x=n("aebd"),w=n("a159"),N=n("0395"),O=n("bf0b"),S=n("9aa9"),P=n("d9f6"),A=n("c3a1"),k=O.f,E=P.f,T=N.f,I=r.Symbol,j=r.JSON,F=j&&j.stringify,L="prototype",M=$("_hidden"),D=$("toPrimitive"),R={}.propertyIsEnumerable,G=s("symbol-registry"),B=s("symbols"),U=s("op-symbols"),V=Object[L],H="function"==typeof I&&!!S.f,W=r.QObject,K=!W||!W[L]||!W[L].findChild,Z=o&&c((function(){return 7!=w(E({},"a",{get:function(){return E(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=k(V,e);r&&delete V[e],E(t,e,n),r&&t!==V&&E(V,e,r)}:E,Y=function(t){var e=B[t]=w(I[L]);return e._k=t,e},J=H&&"symbol"==typeof I.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof I},X=function(t,e,n){return t===V&&X(U,e,n),m(t),e=C(e,!0),m(n),i(B,e)?(n.enumerable?(i(t,M)&&t[M][e]&&(t[M][e]=!1),n=w(n,{enumerable:x(0,!1)})):(i(t,M)||E(t,M,x(1,{})),t[M][e]=!0),Z(t,e,n)):E(t,e,n)},z=function(t,e){m(t);var n,r=v(e=_(e)),i=0,o=r.length;while(o>i)X(t,n=r[i++],e[n]);return t},q=function(t,e){return void 0===e?w(t):z(w(t),e)},Q=function(t){var e=R.call(this,t=C(t,!0));return!(this===V&&i(B,t)&&!i(U,t))&&(!(e||!i(this,t)||!i(B,t)||i(this,M)&&this[M][t])||e)},tt=function(t,e){if(t=_(t),e=C(e,!0),t!==V||!i(B,e)||i(U,e)){var n=k(t,e);return!n||!i(B,e)||i(t,M)&&t[M][e]||(n.enumerable=!0),n}},et=function(t){var e,n=T(_(t)),r=[],o=0;while(n.length>o)i(B,e=n[o++])||e==M||e==u||r.push(e);return r},nt=function(t){var e,n=t===V,r=T(n?U:_(t)),o=[],a=0;while(r.length>a)!i(B,e=r[a++])||n&&!i(V,e)||o.push(B[e]);return o};H||(I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var t=l(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(U,n),i(this,M)&&i(this[M],t)&&(this[M][t]=!1),Z(this,t,x(1,n))};return o&&K&&Z(V,t,{configurable:!0,set:e}),Y(t)},d(I[L],"toString",(function(){return this._k})),O.f=tt,P.f=X,n("6abf").f=N.f=et,n("355d").f=Q,S.f=nt,o&&!n("b8e3")&&d(V,"propertyIsEnumerable",Q,!0),h.f=function(t){return Y($(t))}),a(a.G+a.W+a.F*!H,{Symbol:I});for(var rt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;rt.length>it;)$(rt[it++]);for(var ot=A($.store),at=0;ot.length>at;)p(ot[at++]);a(a.S+a.F*!H,"Symbol",{for:function(t){return i(G,t+="")?G[t]:G[t]=I(t)},keyFor:function(t){if(!J(t))throw TypeError(t+" is not a symbol!");for(var e in G)if(G[e]===t)return e},useSetter:function(){K=!0},useSimple:function(){K=!1}}),a(a.S+a.F*!H,"Object",{create:q,defineProperty:X,defineProperties:z,getOwnPropertyDescriptor:tt,getOwnPropertyNames:et,getOwnPropertySymbols:nt});var dt=c((function(){S.f(1)}));a(a.S+a.F*dt,"Object",{getOwnPropertySymbols:function(t){return S.f(b(t))}}),j&&a(a.S+a.F*(!H||c((function(){var t=I();return"[null]"!=F([t])||"{}"!=F({a:t})||"{}"!=F(Object(t))}))),"JSON",{stringify:function(t){var e,n,r=[t],i=1;while(arguments.length>i)r.push(arguments[i++]);if(n=e=r[1],(g(e)||void 0!==t)&&!J(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!J(e))return e}),r[1]=e,F.apply(j,r)}}),I[L][D]||n("35e8")(I[L],D,I[L].valueOf),f(I,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},"01f9":function(t,e,n){"use strict";var r=n("2d00"),i=n("5ca1"),o=n("2aba"),a=n("32e9"),d=n("84f2"),u=n("41a0"),c=n("7f20"),s=n("38fd"),f=n("2b4c")("iterator"),l=!([].keys&&"next"in[].keys()),$="@@iterator",h="keys",p="values",v=function(){return this};t.exports=function(t,e,n,y,m,g,b){u(n,e,y);var _,C,x,w=function(t){if(!l&&t in P)return P[t];switch(t){case h:return function(){return new n(this,t)};case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},N=e+" Iterator",O=m==p,S=!1,P=t.prototype,A=P[f]||P[$]||m&&P[m],k=A||w(m),E=m?O?w("entries"):k:void 0,T="Array"==e&&P.entries||A;if(T&&(x=s(T.call(new t)),x!==Object.prototype&&x.next&&(c(x,N,!0),r||"function"==typeof x[f]||a(x,f,v))),O&&A&&A.name!==p&&(S=!0,k=function(){return A.call(this)}),r&&!b||!l&&!S&&P[f]||a(P,f,k),d[e]=k,d[N]=v,m)if(_={values:O?k:w(p),keys:g?k:w(h),entries:E},b)for(C in _)C in P||o(P,C,_[C]);else i(i.P+i.F*(l||S),e,_);return _}},"0395":function(t,e,n){var r=n("36c3"),i=n("6abf").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],d=function(t){try{return i(t)}catch(e){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?d(t):i(r(t))}},"07e3":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"07f3":function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return _})),n.d(e,"c",(function(){return C}));var r=function(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),i=0;i<3;i++){var o=Number(n[i]),a=Number(r[i]);if(o>a)return 1;if(a>o)return-1;if(!isNaN(o)&&isNaN(a))return 1;if(isNaN(o)&&!isNaN(a))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0};function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}var u="1.2.0",c="1.7.35",s=" ext. ",f=/^\d+$/,l=function(){function t(e){o(this,t),m(e),this.metadata=e,x.call(this,e)}return d(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(t){return"001"!==t}))}},{key:"getCountryMetadata",value:function(t){return this.metadata.countries[t]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(t){return void 0!==this.getCountryMetadata(t)}},{key:"hasCallingCode",value:function(t){if(this.getCountryCodesForCallingCode(t))return!0;if(this.nonGeographic()){if(this.nonGeographic()[t])return!0}else{var e=this.countryCallingCodes()[t];if(e&&1===e.length&&"001"===e[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(t){return this.nonGeographic()?!!this.nonGeographic()[t]:!this.getCountryCodesForCallingCode(t)}},{key:"country",value:function(t){return this.selectNumberingPlan(t)}},{key:"selectNumberingPlan",value:function(t,e){if(t&&f.test(t)&&(e=t,t=null),t&&"001"!==t){if(!this.hasCountry(t))throw new Error("Unknown country: ".concat(t));this.numberingPlan=new $(this.getCountryMetadata(t),this)}else if(e){if(!this.hasCallingCode(e))throw new Error("Unknown calling code: ".concat(e));this.numberingPlan=new $(this.getNumberingPlanMetadata(e),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(t){var e=this.countryCallingCodes()[t];if(e){if(1===e.length&&3===e[0].length)return;return e}}},{key:"getCountryCodeForCallingCode",value:function(t){var e=this.getCountryCodesForCallingCode(t);if(e)return e[0]}},{key:"getNumberingPlanMetadata",value:function(t){var e=this.getCountryCodeForCallingCode(t);if(e)return this.getCountryMetadata(e);if(this.nonGeographic()){var n=this.nonGeographic()[t];if(n)return n}else{var r=this.countryCallingCodes()[t];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(t){return this.numberingPlan.type(t)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(t){return this.selectNumberingPlan(t)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),t}(),$=function(){function t(e,n){o(this,t),this.globalMetadataObject=n,this.metadata=e,x.call(this,n.metadata)}return d(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(t){return t[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var t=this,e=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return e.map((function(e){return new h(e,t)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(t){return t[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(t){if(this.hasTypes()&&y(this.types(),t))return new v(y(this.types(),t),this)}},{key:"ext",value:function(){return this.v1||this.v2?s:this.metadata[13]||s}}]),t}(),h=function(){function t(e,n){o(this,t),this._format=e,this.metadata=n}return d(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||p.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),t}(),p=/^\(?\$1\)?$/,v=function(){function t(e,n){o(this,t),this.type=e,this.metadata=n}return d(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),t}();function y(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function m(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!g(t)||!g(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(g(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+b(t)+": "+t,"."))}var g=function(t){return"object"===i(t)},b=function(t){return i(t)};function _(t,e){if(e=new l(e),e.hasCountry(t))return e.country(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function C(t,e){return void 0!==e.countries[t]}function x(t){var e=t.version;"number"===typeof e?(this.v1=1===e,this.v2=2===e,this.v3=3===e,this.v4=4===e):e?-1===r(e,u)?this.v2=!0:-1===r(e,c)?this.v3=!0:this.v4=!0:this.v1=!0}},"097d":function(t,e,n){"use strict";var r=n("5ca1"),i=n("8378"),o=n("7726"),a=n("ebd6"),d=n("bcaa");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return d(e,t()).then((function(){return n}))}:t,n?function(n){return d(e,t()).then((function(){throw n}))}:t)}})},"0a49":function(t,e,n){var r=n("9b43"),i=n("626a"),o=n("4bf8"),a=n("9def"),d=n("cd1c");t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,s=4==t,f=6==t,l=5==t||f,$=e||d;return function(e,d,h){for(var p,v,y=o(e),m=i(y),g=r(d,h,3),b=a(m.length),_=0,C=n?$(e,b):u?$(e,0):void 0;b>_;_++)if((l||_ in m)&&(p=m[_],v=g(p,_,y),t))if(n)C[_]=v;else if(v)switch(t){case 3:return!0;case 5:return p;case 6:return _;case 2:C.push(p)}else if(s)return!1;return f?-1:c||s?s:C}}},"0bfb":function(t,e,n){"use strict";var r=n("cb7c");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0d58":function(t,e,n){var r=n("ce10"),i=n("e11e");t.exports=Object.keys||function(t){return r(t,i)}},"0fc9":function(t,e,n){var r=n("3a38"),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},1169:function(t,e,n){var r=n("2d95");t.exports=Array.isArray||function(t){return"Array"==r(t)}},1173:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"11e9":function(t,e,n){var r=n("52a7"),i=n("4630"),o=n("6821"),a=n("6a99"),d=n("69a8"),u=n("c69a"),c=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?c:function(t,e){if(t=o(t),e=a(e,!0),u)try{return c(t,e)}catch(n){}if(d(t,e))return i(!r.f.call(t,e),t[e])}},1414:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n("3157"),i=/(\$\d)/;function o(t,e,n){var o=n.useInternationalFormat,a=n.withNationalPrefix,d=(n.carrierCode,n.metadata,t.replace(new RegExp(e.pattern()),o?e.internationalFormat():a&&e.nationalPrefixFormattingRule()?e.format().replace(i,e.nationalPrefixFormattingRule()):e.format()));return o?Object(r["a"])(d):d}},1495:function(t,e,n){var r=n("86cc"),i=n("cb7c"),o=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){i(t);var n,a=o(e),d=a.length,u=0;while(d>u)r.f(t,n=a[u++],e[n]);return t}},1654:function(t,e,n){"use strict";var r=n("71c1")(!0);n("30f1")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},1691:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},1991:function(t,e,n){var r,i,o,a=n("9b43"),d=n("31f4"),u=n("fab2"),c=n("230e"),s=n("7726"),f=s.process,l=s.setImmediate,$=s.clearImmediate,h=s.MessageChannel,p=s.Dispatch,v=0,y={},m="onreadystatechange",g=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){g.call(t.data)};l&&$||(l=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return y[++v]=function(){d("function"==typeof t?t:Function(t),e)},r(v),v},$=function(t){delete y[t]},"process"==n("2d95")(f)?r=function(t){f.nextTick(a(g,t,1))}:p&&p.now?r=function(t){p.now(a(g,t,1))}:h?(i=new h,o=i.port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(r=function(t){s.postMessage(t+"","*")},s.addEventListener("message",b,!1)):r=m in c("script")?function(t){u.appendChild(c("script"))[m]=function(){u.removeChild(this),g.call(t)}}:function(t){setTimeout(a(g,t,1),0)}),t.exports={set:l,clear:$}},"1af6":function(t,e,n){var r=n("63b6");r(r.S,"Array",{isArray:n("9003")})},"1bc3":function(t,e,n){var r=n("f772");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},"1ec9":function(t,e,n){var r=n("f772"),i=n("e53d").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},"1fa8":function(t,e,n){var r=n("cb7c");t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(a){var o=t["return"];throw void 0!==o&&r(o.call(t)),a}}},"20d6":function(t,e,n){"use strict";var r=n("5ca1"),i=n("0a49")(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")(o)},"20fd":function(t,e,n){"use strict";var r=n("d9f6"),i=n("aebd");t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},"230e":function(t,e,n){var r=n("d3f4"),i=n("7726").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},"23c6":function(t,e,n){var r=n("2d95"),i=n("2b4c")("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,d;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),i))?n:o?r(e):"Object"==(d=r(e))&&"function"==typeof e.callee?"Arguments":d}},"241e":function(t,e,n){var r=n("25eb");t.exports=function(t){return Object(r(t))}},"24c5":function(t,e,n){"use strict";var r,i,o,a,d=n("b8e3"),u=n("e53d"),c=n("d864"),s=n("40c3"),f=n("63b6"),l=n("f772"),$=n("79aa"),h=n("1173"),p=n("a22a"),v=n("f201"),y=n("4178").set,m=n("aba2")(),g=n("656e"),b=n("4439"),_=n("bc13"),C=n("cd78"),x="Promise",w=u.TypeError,N=u.process,O=N&&N.versions,S=O&&O.v8||"",P=u[x],A="process"==s(N),k=function(){},E=i=g.f,T=!!function(){try{var t=P.resolve(1),e=(t.constructor={})[n("5168")("species")]=function(t){t(k,k)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof e&&0!==S.indexOf("6.6")&&-1===_.indexOf("Chrome/66")}catch(r){}}(),I=function(t){var e;return!(!l(t)||"function"!=typeof(e=t.then))&&e},j=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,d=i?e.ok:e.fail,u=e.resolve,c=e.reject,s=e.domain;try{d?(i||(2==t._h&&M(t),t._h=1),!0===d?n=r:(s&&s.enter(),n=d(r),s&&(s.exit(),a=!0)),n===e.promise?c(w("Promise-chain cycle")):(o=I(n))?o.call(n,u,c):u(n)):c(r)}catch(f){s&&!a&&s.exit(),c(f)}};while(n.length>o)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&F(t)}))}},F=function(t){y.call(u,(function(){var e,n,r,i=t._v,o=L(t);if(o&&(e=b((function(){A?N.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=A||L(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},L=function(t){return 1!==t._h&&0===(t._a||t._c).length},M=function(t){y.call(u,(function(){var e;A?N.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})}))},D=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),j(e,!0))},R=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw w("Promise can't be resolved itself");(e=I(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,c(R,r,1),c(D,r,1))}catch(i){D.call(r,i)}})):(n._v=t,n._s=1,j(n,!1))}catch(r){D.call({_w:n,_d:!1},r)}}};T||(P=function(t){h(this,P,x,"_h"),$(t),r.call(this);try{t(c(R,this,1),c(D,this,1))}catch(e){D.call(this,e)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("5c95")(P.prototype,{then:function(t,e){var n=E(v(this,P));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=A?N.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&j(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(R,t,1),this.reject=c(D,t,1)},g.f=E=function(t){return t===P||t===a?new o(t):i(t)}),f(f.G+f.W+f.F*!T,{Promise:P}),n("45f2")(P,x),n("4c95")(x),a=n("584a")[x],f(f.S+f.F*!T,x,{reject:function(t){var e=E(this),n=e.reject;return n(t),e.promise}}),f(f.S+f.F*(d||!T),x,{resolve:function(t){return C(d&&this===a?P:this,t)}}),f(f.S+f.F*!(T&&n("4ee1")((function(t){P.all(t)["catch"](k)}))),x,{all:function(t){var e=this,n=E(e),r=n.resolve,i=n.reject,o=b((function(){var n=[],o=0,a=1;p(t,!1,(function(t){var d=o++,u=!1;n.push(void 0),a++,e.resolve(t).then((function(t){u||(u=!0,n[d]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=E(e),r=n.reject,i=b((function(){p(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},"25eb":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},2621:function(t,e){e.f=Object.getOwnPropertySymbols},"27ee":function(t,e,n){var r=n("23c6"),i=n("2b4c")("iterator"),o=n("84f2");t.exports=n("8378").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},2877:function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,d){var u,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):i&&(u=d?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var s=c.render;c.render=function(t,e){return u.call(e),s(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:c}}n.d(e,"a",(function(){return r}))},"294c":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"2aba":function(t,e,n){var r=n("7726"),i=n("32e9"),o=n("69a8"),a=n("ca5a")("src"),d=n("fa5b"),u="toString",c=(""+d).split(u);n("8378").inspectSource=function(t){return d.call(t)},(t.exports=function(t,e,n,d){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:d?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,u,(function(){return"function"==typeof this&&this[a]||d.call(this)}))},"2aeb":function(t,e,n){var r=n("cb7c"),i=n("1495"),o=n("e11e"),a=n("613b")("IE_PROTO"),d=function(){},u="prototype",c=function(){var t,e=n("230e")("iframe"),r=o.length,i="<",a=">";e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+a+"document.F=Object"+i+"/script"+a),t.close(),c=t.F;while(r--)delete c[u][o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(d[u]=r(t),n=new d,d[u]=null,n[a]=t):n=c(),void 0===e?n:i(n,e)}},"2b0e":function(t,e,n){"use strict";(function(t){
/*!
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
var n=Object.freeze({});function r(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function a(t){return!1===t}function d(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function u(t){return null!==t&&"object"===typeof t}var c=Object.prototype.toString;function s(t){return"[object Object]"===c.call(t)}function f(t){return"[object RegExp]"===c.call(t)}function l(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function $(t){return i(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||s(t)&&t.toString===c?JSON.stringify(t,null,2):String(t)}function p(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}v("slot,component",!0);var y=v("key,ref,slot,slot-scope,is");function m(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}var g=Object.prototype.hasOwnProperty;function b(t,e){return g.call(t,e)}function _(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}var C=/-(\w)/g,x=_((function(t){return t.replace(C,(function(t,e){return e?e.toUpperCase():""}))})),w=_((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),N=/\B([A-Z])/g,O=_((function(t){return t.replace(N,"-$1").toLowerCase()}));function S(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function P(t,e){return t.bind(e)}var A=Function.prototype.bind?P:S;function k(t,e){e=e||0;var n=t.length-e,r=new Array(n);while(n--)r[n]=t[n+e];return r}function E(t,e){for(var n in e)t[n]=e[n];return t}function T(t){for(var e={},n=0;n<t.length;n++)t[n]&&E(e,t[n]);return e}function I(t,e,n){}var j=function(t,e,n){return!1},F=function(t){return t};function L(t,e){if(t===e)return!0;var n=u(t),r=u(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var i=Array.isArray(t),o=Array.isArray(e);if(i&&o)return t.length===e.length&&t.every((function(t,n){return L(t,e[n])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(i||o)return!1;var a=Object.keys(t),d=Object.keys(e);return a.length===d.length&&a.every((function(n){return L(t[n],e[n])}))}catch(c){return!1}}function M(t,e){for(var n=0;n<t.length;n++)if(L(t[n],e))return n;return-1}function D(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}var R="data-server-rendered",G=["component","directive","filter"],B=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],U={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:j,isReservedAttr:j,isUnknownElement:j,getTagNamespace:I,parsePlatformTagName:F,mustUseProp:j,async:!0,_lifecycleHooks:B},V=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function H(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function W(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var K=new RegExp("[^"+V.source+".$_\\d]");function Z(t){if(!K.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}var Y,J="__proto__"in{},X="undefined"!==typeof window,z="undefined"!==typeof WXEnvironment&&!!WXEnvironment.platform,q=z&&WXEnvironment.platform.toLowerCase(),Q=X&&window.navigator.userAgent.toLowerCase(),tt=Q&&/msie|trident/.test(Q),et=Q&&Q.indexOf("msie 9.0")>0,nt=Q&&Q.indexOf("edge/")>0,rt=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===q),it=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),ot={}.watch,at=!1;if(X)try{var dt={};Object.defineProperty(dt,"passive",{get:function(){at=!0}}),window.addEventListener("test-passive",null,dt)}catch(wa){}var ut=function(){return void 0===Y&&(Y=!X&&!z&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),Y},ct=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function st(t){return"function"===typeof t&&/native code/.test(t.toString())}var ft,lt="undefined"!==typeof Symbol&&st(Symbol)&&"undefined"!==typeof Reflect&&st(Reflect.ownKeys);ft="undefined"!==typeof Set&&st(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var $t=I,ht=0,pt=function(){this.id=ht++,this.subs=[]};pt.prototype.addSub=function(t){this.subs.push(t)},pt.prototype.removeSub=function(t){m(this.subs,t)},pt.prototype.depend=function(){pt.target&&pt.target.addDep(this)},pt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e<n;e++)t[e].update()},pt.target=null;var vt=[];function yt(t){vt.push(t),pt.target=t}function mt(){vt.pop(),pt.target=vt[vt.length-1]}var gt=function(t,e,n,r,i,o,a,d){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=d,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},bt={child:{configurable:!0}};bt.child.get=function(){return this.componentInstance},Object.defineProperties(gt.prototype,bt);var _t=function(t){void 0===t&&(t="");var e=new gt;return e.text=t,e.isComment=!0,e};function Ct(t){return new gt(void 0,void 0,void 0,String(t))}function xt(t){var e=new gt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var wt=Array.prototype,Nt=Object.create(wt),Ot=["push","pop","shift","unshift","splice","sort","reverse"];Ot.forEach((function(t){var e=wt[t];W(Nt,t,(function(){var n=[],r=arguments.length;while(r--)n[r]=arguments[r];var i,o=e.apply(this,n),a=this.__ob__;switch(t){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2);break}return i&&a.observeArray(i),a.dep.notify(),o}))}));var St=Object.getOwnPropertyNames(Nt),Pt=!0;function At(t){Pt=t}var kt=function(t){this.value=t,this.dep=new pt,this.vmCount=0,W(t,"__ob__",this),Array.isArray(t)?(J?Et(t,Nt):Tt(t,Nt,St),this.observeArray(t)):this.walk(t)};function Et(t,e){t.__proto__=e}function Tt(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];W(t,o,e[o])}}function It(t,e){var n;if(u(t)&&!(t instanceof gt))return b(t,"__ob__")&&t.__ob__ instanceof kt?n=t.__ob__:Pt&&!ut()&&(Array.isArray(t)||s(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new kt(t)),e&&n&&n.vmCount++,n}function jt(t,e,n,r,i){var o=new pt,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var d=a&&a.get,u=a&&a.set;d&&!u||2!==arguments.length||(n=t[e]);var c=!i&&It(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=d?d.call(t):n;return pt.target&&(o.depend(),c&&(c.dep.depend(),Array.isArray(e)&&Mt(e))),e},set:function(e){var r=d?d.call(t):n;e===r||e!==e&&r!==r||d&&!u||(u?u.call(t,e):n=e,c=!i&&It(e),o.notify())}})}}function Ft(t,e,n){if(Array.isArray(t)&&l(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(e in t&&!(e in Object.prototype))return t[e]=n,n;var r=t.__ob__;return t._isVue||r&&r.vmCount?n:r?(jt(r.value,e,n),r.dep.notify(),n):(t[e]=n,n)}function Lt(t,e){if(Array.isArray(t)&&l(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount||b(t,e)&&(delete t[e],n&&n.dep.notify())}}function Mt(t){for(var e=void 0,n=0,r=t.length;n<r;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&Mt(e)}kt.prototype.walk=function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)jt(t,e[n])},kt.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)It(t[e])};var Dt=U.optionMergeStrategies;function Rt(t,e){if(!e)return t;for(var n,r,i,o=lt?Reflect.ownKeys(e):Object.keys(e),a=0;a<o.length;a++)n=o[a],"__ob__"!==n&&(r=t[n],i=e[n],b(t,n)?r!==i&&s(r)&&s(i)&&Rt(r,i):Ft(t,n,i));return t}function Gt(t,e,n){return n?function(){var r="function"===typeof e?e.call(n,n):e,i="function"===typeof t?t.call(n,n):t;return r?Rt(r,i):i}:e?t?function(){return Rt("function"===typeof e?e.call(this,this):e,"function"===typeof t?t.call(this,this):t)}:e:t}function Bt(t,e){var n=e?t?t.concat(e):Array.isArray(e)?e:[e]:t;return n?Ut(n):n}function Ut(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}function Vt(t,e,n,r){var i=Object.create(t||null);return e?E(i,e):i}Dt.data=function(t,e,n){return n?Gt(t,e,n):e&&"function"!==typeof e?t:Gt(t,e)},B.forEach((function(t){Dt[t]=Bt})),G.forEach((function(t){Dt[t+"s"]=Vt})),Dt.watch=function(t,e,n,r){if(t===ot&&(t=void 0),e===ot&&(e=void 0),!e)return Object.create(t||null);if(!t)return e;var i={};for(var o in E(i,t),e){var a=i[o],d=e[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(d):Array.isArray(d)?d:[d]}return i},Dt.props=Dt.methods=Dt.inject=Dt.computed=function(t,e,n,r){if(!t)return e;var i=Object.create(null);return E(i,t),e&&E(i,e),i},Dt.provide=Gt;var Ht=function(t,e){return void 0===e?t:e};function Wt(t,e){var n=t.props;if(n){var r,i,o,a={};if(Array.isArray(n)){r=n.length;while(r--)i=n[r],"string"===typeof i&&(o=x(i),a[o]={type:null})}else if(s(n))for(var d in n)i=n[d],o=x(d),a[o]=s(i)?i:{type:i};else 0;t.props=a}}function Kt(t,e){var n=t.inject;if(n){var r=t.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(s(n))for(var o in n){var a=n[o];r[o]=s(a)?E({from:o},a):{from:a}}else 0}}function Zt(t){var e=t.directives;if(e)for(var n in e){var r=e[n];"function"===typeof r&&(e[n]={bind:r,update:r})}}function Yt(t,e,n){if("function"===typeof e&&(e=e.options),Wt(e,n),Kt(e,n),Zt(e),!e._base&&(e.extends&&(t=Yt(t,e.extends,n)),e.mixins))for(var r=0,i=e.mixins.length;r<i;r++)t=Yt(t,e.mixins[r],n);var o,a={};for(o in t)d(o);for(o in e)b(t,o)||d(o);function d(r){var i=Dt[r]||Ht;a[r]=i(t[r],e[r],n,r)}return a}function Jt(t,e,n,r){if("string"===typeof n){var i=t[e];if(b(i,n))return i[n];var o=x(n);if(b(i,o))return i[o];var a=w(o);if(b(i,a))return i[a];var d=i[n]||i[o]||i[a];return d}}function Xt(t,e,n,r){var i=e[t],o=!b(n,t),a=n[t],d=ee(Boolean,i.type);if(d>-1)if(o&&!b(i,"default"))a=!1;else if(""===a||a===O(t)){var u=ee(String,i.type);(u<0||d<u)&&(a=!0)}if(void 0===a){a=zt(r,i,t);var c=Pt;At(!0),It(a),At(c)}return a}function zt(t,e,n){if(b(e,"default")){var r=e.default;return t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n]?t._props[n]:"function"===typeof r&&"Function"!==Qt(e.type)?r.call(t):r}}var qt=/^\s*function (\w+)/;function Qt(t){var e=t&&t.toString().match(qt);return e?e[1]:""}function te(t,e){return Qt(t)===Qt(e)}function ee(t,e){if(!Array.isArray(e))return te(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(te(e[n],t))return n;return-1}function ne(t,e,n){yt();try{if(e){var r=e;while(r=r.$parent){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{var a=!1===i[o].call(r,t,e,n);if(a)return}catch(wa){ie(wa,r,"errorCaptured hook")}}}ie(t,e,n)}finally{mt()}}function re(t,e,n,r,i){var o;try{o=n?t.apply(e,n):t.call(e),o&&!o._isVue&&$(o)&&!o._handled&&(o.catch((function(t){return ne(t,r,i+" (Promise/async)")})),o._handled=!0)}catch(wa){ne(wa,r,i)}return o}function ie(t,e,n){if(U.errorHandler)try{return U.errorHandler.call(null,t,e,n)}catch(wa){wa!==t&&oe(wa,null,"config.errorHandler")}oe(t,e,n)}function oe(t,e,n){if(!X&&!z||"undefined"===typeof console)throw t;console.error(t)}var ae,de=!1,ue=[],ce=!1;function se(){ce=!1;var t=ue.slice(0);ue.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!==typeof Promise&&st(Promise)){var fe=Promise.resolve();ae=function(){fe.then(se),rt&&setTimeout(I)},de=!0}else if(tt||"undefined"===typeof MutationObserver||!st(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())ae="undefined"!==typeof setImmediate&&st(setImmediate)?function(){setImmediate(se)}:function(){setTimeout(se,0)};else{var le=1,$e=new MutationObserver(se),he=document.createTextNode(String(le));$e.observe(he,{characterData:!0}),ae=function(){le=(le+1)%2,he.data=String(le)},de=!0}function pe(t,e){var n;if(ue.push((function(){if(t)try{t.call(e)}catch(wa){ne(wa,e,"nextTick")}else n&&n(e)})),ce||(ce=!0,ae()),!t&&"undefined"!==typeof Promise)return new Promise((function(t){n=t}))}var ve=new ft;function ye(t){me(t,ve),ve.clear()}function me(t,e){var n,r,i=Array.isArray(t);if(!(!i&&!u(t)||Object.isFrozen(t)||t instanceof gt)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(i){n=t.length;while(n--)me(t[n],e)}else{r=Object.keys(t),n=r.length;while(n--)me(t[r[n]],e)}}}var ge=_((function(t){var e="&"===t.charAt(0);t=e?t.slice(1):t;var n="~"===t.charAt(0);t=n?t.slice(1):t;var r="!"===t.charAt(0);return t=r?t.slice(1):t,{name:t,once:n,capture:r,passive:e}}));function be(t,e){function n(){var t=arguments,r=n.fns;if(!Array.isArray(r))return re(r,null,arguments,e,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)re(i[o],null,t,e,"v-on handler")}return n.fns=t,n}function _e(t,e,n,i,a,d){var u,c,s,f;for(u in t)c=t[u],s=e[u],f=ge(u),r(c)||(r(s)?(r(c.fns)&&(c=t[u]=be(c,d)),o(f.once)&&(c=t[u]=a(f.name,c,f.capture)),n(f.name,c,f.capture,f.passive,f.params)):c!==s&&(s.fns=c,t[u]=s));for(u in e)r(t[u])&&(f=ge(u),i(f.name,e[u],f.capture))}function Ce(t,e,n){var a;t instanceof gt&&(t=t.data.hook||(t.data.hook={}));var d=t[e];function u(){n.apply(this,arguments),m(a.fns,u)}r(d)?a=be([u]):i(d.fns)&&o(d.merged)?(a=d,a.fns.push(u)):a=be([d,u]),a.merged=!0,t[e]=a}function xe(t,e,n){var o=e.options.props;if(!r(o)){var a={},d=t.attrs,u=t.props;if(i(d)||i(u))for(var c in o){var s=O(c);we(a,u,c,s,!0)||we(a,d,c,s,!1)}return a}}function we(t,e,n,r,o){if(i(e)){if(b(e,n))return t[n]=e[n],o||delete e[n],!0;if(b(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function Ne(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}function Oe(t){return d(t)?[Ct(t)]:Array.isArray(t)?Pe(t):void 0}function Se(t){return i(t)&&i(t.text)&&a(t.isComment)}function Pe(t,e){var n,a,u,c,s=[];for(n=0;n<t.length;n++)a=t[n],r(a)||"boolean"===typeof a||(u=s.length-1,c=s[u],Array.isArray(a)?a.length>0&&(a=Pe(a,(e||"")+"_"+n),Se(a[0])&&Se(c)&&(s[u]=Ct(c.text+a[0].text),a.shift()),s.push.apply(s,a)):d(a)?Se(c)?s[u]=Ct(c.text+a):""!==a&&s.push(Ct(a)):Se(a)&&Se(c)?s[u]=Ct(c.text+a.text):(o(t._isVList)&&i(a.tag)&&r(a.key)&&i(e)&&(a.key="__vlist"+e+"_"+n+"__"),s.push(a)));return s}function Ae(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function ke(t){var e=Ee(t.$options.inject,t);e&&(At(!1),Object.keys(e).forEach((function(n){jt(t,n,e[n])})),At(!0))}function Ee(t,e){if(t){for(var n=Object.create(null),r=lt?Reflect.ownKeys(t):Object.keys(t),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){var a=t[o].from,d=e;while(d){if(d._provided&&b(d._provided,a)){n[o]=d._provided[a];break}d=d.$parent}if(!d)if("default"in t[o]){var u=t[o].default;n[o]="function"===typeof u?u.call(e):u}else 0}}return n}}function Te(t,e){if(!t||!t.length)return{};for(var n={},r=0,i=t.length;r<i;r++){var o=t[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==e&&o.fnContext!==e||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var d=a.slot,u=n[d]||(n[d]=[]);"template"===o.tag?u.push.apply(u,o.children||[]):u.push(o)}}for(var c in n)n[c].every(Ie)&&delete n[c];return n}function Ie(t){return t.isComment&&!t.asyncFactory||" "===t.text}function je(t){return t.isComment&&t.asyncFactory}function Fe(t,e,r){var i,o=Object.keys(e).length>0,a=t?!!t.$stable:!o,d=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==n&&d===r.$key&&!o&&!r.$hasNormal)return r;for(var u in i={},t)t[u]&&"$"!==u[0]&&(i[u]=Le(e,u,t[u]))}else i={};for(var c in e)c in i||(i[c]=Me(e,c));return t&&Object.isExtensible(t)&&(t._normalized=i),W(i,"$stable",a),W(i,"$key",d),W(i,"$hasNormal",o),i}function Le(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Oe(t);var e=t&&t[0];return t&&(!e||1===t.length&&e.isComment&&!je(e))?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function Me(t,e){return function(){return t[e]}}function De(t,e){var n,r,o,a,d;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),r=0,o=t.length;r<o;r++)n[r]=e(t[r],r);else if("number"===typeof t)for(n=new Array(t),r=0;r<t;r++)n[r]=e(r+1,r);else if(u(t))if(lt&&t[Symbol.iterator]){n=[];var c=t[Symbol.iterator](),s=c.next();while(!s.done)n.push(e(s.value,n.length)),s=c.next()}else for(a=Object.keys(t),n=new Array(a.length),r=0,o=a.length;r<o;r++)d=a[r],n[r]=e(t[d],d,r);return i(n)||(n=[]),n._isVList=!0,n}function Re(t,e,n,r){var i,o=this.$scopedSlots[t];o?(n=n||{},r&&(n=E(E({},r),n)),i=o(n)||("function"===typeof e?e():e)):i=this.$slots[t]||("function"===typeof e?e():e);var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function Ge(t){return Jt(this.$options,"filters",t,!0)||F}function Be(t,e){return Array.isArray(t)?-1===t.indexOf(e):t!==e}function Ue(t,e,n,r,i){var o=U.keyCodes[e]||n;return i&&r&&!U.keyCodes[e]?Be(i,r):o?Be(o,t):r?O(r)!==e:void 0===t}function Ve(t,e,n,r,i){if(n)if(u(n)){var o;Array.isArray(n)&&(n=T(n));var a=function(a){if("class"===a||"style"===a||y(a))o=t;else{var d=t.attrs&&t.attrs.type;o=r||U.mustUseProp(e,d,a)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var u=x(a),c=O(a);if(!(u in o)&&!(c in o)&&(o[a]=n[a],i)){var s=t.on||(t.on={});s["update:"+a]=function(t){n[a]=t}}};for(var d in n)a(d)}else;return t}function He(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,null,this),Ke(r,"__static__"+t,!1)),r}function We(t,e,n){return Ke(t,"__once__"+e+(n?"_"+n:""),!0),t}function Ke(t,e,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&"string"!==typeof t[r]&&Ze(t[r],e+"_"+r,n);else Ze(t,e,n)}function Ze(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function Ye(t,e){if(e)if(s(e)){var n=t.on=t.on?E({},t.on):{};for(var r in e){var i=n[r],o=e[r];n[r]=i?[].concat(i,o):o}}else;return t}function Je(t,e,n,r){e=e||{$stable:!n};for(var i=0;i<t.length;i++){var o=t[i];Array.isArray(o)?Je(o,e,n):o&&(o.proxy&&(o.fn.proxy=!0),e[o.key]=o.fn)}return r&&(e.$key=r),e}function Xe(t,e){for(var n=0;n<e.length;n+=2){var r=e[n];"string"===typeof r&&r&&(t[e[n]]=e[n+1])}return t}function ze(t,e){return"string"===typeof t?e+t:t}function qe(t){t._o=We,t._n=p,t._s=h,t._l=De,t._t=Re,t._q=L,t._i=M,t._m=He,t._f=Ge,t._k=Ue,t._b=Ve,t._v=Ct,t._e=_t,t._u=Je,t._g=Ye,t._d=Xe,t._p=ze}function Qe(t,e,r,i,a){var d,u=this,c=a.options;b(i,"_uid")?(d=Object.create(i),d._original=i):(d=i,i=i._original);var s=o(c._compiled),f=!s;this.data=t,this.props=e,this.children=r,this.parent=i,this.listeners=t.on||n,this.injections=Ee(c.inject,i),this.slots=function(){return u.$slots||Fe(t.scopedSlots,u.$slots=Te(r,i)),u.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return Fe(t.scopedSlots,this.slots())}}),s&&(this.$options=c,this.$slots=this.slots(),this.$scopedSlots=Fe(t.scopedSlots,this.$slots)),c._scopeId?this._c=function(t,e,n,r){var o=$n(d,t,e,n,r,f);return o&&!Array.isArray(o)&&(o.fnScopeId=c._scopeId,o.fnContext=i),o}:this._c=function(t,e,n,r){return $n(d,t,e,n,r,f)}}function tn(t,e,r,o,a){var d=t.options,u={},c=d.props;if(i(c))for(var s in c)u[s]=Xt(s,c,e||n);else i(r.attrs)&&nn(u,r.attrs),i(r.props)&&nn(u,r.props);var f=new Qe(r,u,a,o,t),l=d.render.call(null,f._c,f);if(l instanceof gt)return en(l,r,f.parent,d,f);if(Array.isArray(l)){for(var $=Oe(l)||[],h=new Array($.length),p=0;p<$.length;p++)h[p]=en($[p],r,f.parent,d,f);return h}}function en(t,e,n,r,i){var o=xt(t);return o.fnContext=n,o.fnOptions=r,e.slot&&((o.data||(o.data={})).slot=e.slot),o}function nn(t,e){for(var n in e)t[x(n)]=e[n]}qe(Qe.prototype);var rn={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;rn.prepatch(n,n)}else{var r=t.componentInstance=dn(t,En);r.$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var n=e.componentOptions,r=e.componentInstance=t.componentInstance;Ln(r,n.propsData,n.listeners,e,n.children)},insert:function(t){var e=t.context,n=t.componentInstance;n._isMounted||(n._isMounted=!0,Gn(n,"mounted")),t.data.keepAlive&&(e._isMounted?Qn(n):Dn(n,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?Rn(e,!0):e.$destroy())}},on=Object.keys(rn);function an(t,e,n,a,d){if(!r(t)){var c=n.$options._base;if(u(t)&&(t=c.extend(t)),"function"===typeof t){var s;if(r(t.cid)&&(s=t,t=xn(s,c),void 0===t))return Cn(s,e,n,a,d);e=e||{},Cr(t),i(e.model)&&sn(t.options,e);var f=xe(e,t,d);if(o(t.options.functional))return tn(t,f,e,n,a);var l=e.on;if(e.on=e.nativeOn,o(t.options.abstract)){var $=e.slot;e={},$&&(e.slot=$)}un(e);var h=t.options.name||d,p=new gt("vue-component-"+t.cid+(h?"-"+h:""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:f,listeners:l,tag:d,children:a},s);return p}}}function dn(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;return i(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns),new t.componentOptions.Ctor(n)}function un(t){for(var e=t.hook||(t.hook={}),n=0;n<on.length;n++){var r=on[n],i=e[r],o=rn[r];i===o||i&&i._merged||(e[r]=i?cn(o,i):o)}}function cn(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}function sn(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[n]=e.model.value;var o=e.on||(e.on={}),a=o[r],d=e.model.callback;i(a)?(Array.isArray(a)?-1===a.indexOf(d):a!==d)&&(o[r]=[d].concat(a)):o[r]=d}var fn=1,ln=2;function $n(t,e,n,r,i,a){return(Array.isArray(n)||d(n))&&(i=r,r=n,n=void 0),o(a)&&(i=ln),hn(t,e,n,r,i)}function hn(t,e,n,r,o){if(i(n)&&i(n.__ob__))return _t();if(i(n)&&i(n.is)&&(e=n.is),!e)return _t();var a,d,u;(Array.isArray(r)&&"function"===typeof r[0]&&(n=n||{},n.scopedSlots={default:r[0]},r.length=0),o===ln?r=Oe(r):o===fn&&(r=Ne(r)),"string"===typeof e)?(d=t.$vnode&&t.$vnode.ns||U.getTagNamespace(e),a=U.isReservedTag(e)?new gt(U.parsePlatformTagName(e),n,r,void 0,void 0,t):n&&n.pre||!i(u=Jt(t.$options,"components",e))?new gt(e,n,r,void 0,void 0,t):an(u,n,t,r,e)):a=an(e,n,t,r);return Array.isArray(a)?a:i(a)?(i(d)&&pn(a,d),i(n)&&vn(n),a):_t()}function pn(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),i(t.children))for(var a=0,d=t.children.length;a<d;a++){var u=t.children[a];i(u.tag)&&(r(u.ns)||o(n)&&"svg"!==u.tag)&&pn(u,e,n)}}function vn(t){u(t.style)&&ye(t.style),u(t.class)&&ye(t.class)}function yn(t){t._vnode=null,t._staticTrees=null;var e=t.$options,r=t.$vnode=e._parentVnode,i=r&&r.context;t.$slots=Te(e._renderChildren,i),t.$scopedSlots=n,t._c=function(e,n,r,i){return $n(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return $n(t,e,n,r,i,!0)};var o=r&&r.data;jt(t,"$attrs",o&&o.attrs||n,null,!0),jt(t,"$listeners",e._parentListeners||n,null,!0)}var mn,gn=null;function bn(t){qe(t.prototype),t.prototype.$nextTick=function(t){return pe(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,r=n.render,i=n._parentVnode;i&&(e.$scopedSlots=Fe(i.data.scopedSlots,e.$slots,e.$scopedSlots)),e.$vnode=i;try{gn=e,t=r.call(e._renderProxy,e.$createElement)}catch(wa){ne(wa,e,"render"),t=e._vnode}finally{gn=null}return Array.isArray(t)&&1===t.length&&(t=t[0]),t instanceof gt||(t=_t()),t.parent=i,t}}function _n(t,e){return(t.__esModule||lt&&"Module"===t[Symbol.toStringTag])&&(t=t.default),u(t)?e.extend(t):t}function Cn(t,e,n,r,i){var o=_t();return o.asyncFactory=t,o.asyncMeta={data:e,context:n,children:r,tag:i},o}function xn(t,e){if(o(t.error)&&i(t.errorComp))return t.errorComp;if(i(t.resolved))return t.resolved;var n=gn;if(n&&i(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n),o(t.loading)&&i(t.loadingComp))return t.loadingComp;if(n&&!i(t.owners)){var a=t.owners=[n],d=!0,c=null,s=null;n.$on("hook:destroyed",(function(){return m(a,n)}));var f=function(t){for(var e=0,n=a.length;e<n;e++)a[e].$forceUpdate();t&&(a.length=0,null!==c&&(clearTimeout(c),c=null),null!==s&&(clearTimeout(s),s=null))},l=D((function(n){t.resolved=_n(n,e),d?a.length=0:f(!0)})),h=D((function(e){i(t.errorComp)&&(t.error=!0,f(!0))})),p=t(l,h);return u(p)&&($(p)?r(t.resolved)&&p.then(l,h):$(p.component)&&(p.component.then(l,h),i(p.error)&&(t.errorComp=_n(p.error,e)),i(p.loading)&&(t.loadingComp=_n(p.loading,e),0===p.delay?t.loading=!0:c=setTimeout((function(){c=null,r(t.resolved)&&r(t.error)&&(t.loading=!0,f(!1))}),p.delay||200)),i(p.timeout)&&(s=setTimeout((function(){s=null,r(t.resolved)&&h(null)}),p.timeout)))),d=!1,t.loading?t.loadingComp:t.resolved}}function wn(t){if(Array.isArray(t))for(var e=0;e<t.length;e++){var n=t[e];if(i(n)&&(i(n.componentOptions)||je(n)))return n}}function Nn(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&An(t,e)}function On(t,e){mn.$on(t,e)}function Sn(t,e){mn.$off(t,e)}function Pn(t,e){var n=mn;return function r(){var i=e.apply(null,arguments);null!==i&&n.$off(t,r)}}function An(t,e,n){mn=t,_e(e,n||{},On,Sn,Pn,t),mn=void 0}function kn(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var i=0,o=t.length;i<o;i++)r.$on(t[i],n);else(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){var n=this;function r(){n.$off(t,r),e.apply(n,arguments)}return r.fn=e,n.$on(t,r),n},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)n.$off(t[r],e);return n}var o,a=n._events[t];if(!a)return n;if(!e)return n._events[t]=null,n;var d=a.length;while(d--)if(o=a[d],o===e||o.fn===e){a.splice(d,1);break}return n},t.prototype.$emit=function(t){var e=this,n=e._events[t];if(n){n=n.length>1?k(n):n;for(var r=k(arguments,1),i='event handler for "'+t+'"',o=0,a=n.length;o<a;o++)re(n[o],e,r,e,i)}return e}}var En=null;function Tn(t){var e=En;return En=t,function(){En=e}}function In(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){while(n.$options.abstract&&n.$parent)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function jn(t){t.prototype._update=function(t,e){var n=this,r=n.$el,i=n._vnode,o=Tn(n);n._vnode=t,n.$el=i?n.__patch__(i,t):n.__patch__(n.$el,t,e,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},t.prototype.$forceUpdate=function(){var t=this;t._watcher&&t._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){Gn(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||m(e.$children,t),t._watcher&&t._watcher.teardown();var n=t._watchers.length;while(n--)t._watchers[n].teardown();t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),Gn(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}function Fn(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=_t),Gn(t,"beforeMount"),r=function(){t._update(t._render(),n)},new rr(t,r,I,{before:function(){t._isMounted&&!t._isDestroyed&&Gn(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Gn(t,"mounted")),t}function Ln(t,e,r,i,o){var a=i.data.scopedSlots,d=t.$scopedSlots,u=!!(a&&!a.$stable||d!==n&&!d.$stable||a&&t.$scopedSlots.$key!==a.$key||!a&&t.$scopedSlots.$key),c=!!(o||t.$options._renderChildren||u);if(t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i),t.$options._renderChildren=o,t.$attrs=i.data.attrs||n,t.$listeners=r||n,e&&t.$options.props){At(!1);for(var s=t._props,f=t.$options._propKeys||[],l=0;l<f.length;l++){var $=f[l],h=t.$options.props;s[$]=Xt($,h,e,t)}At(!0),t.$options.propsData=e}r=r||n;var p=t.$options._parentListeners;t.$options._parentListeners=r,An(t,r,p),c&&(t.$slots=Te(o,i.context),t.$forceUpdate())}function Mn(t){while(t&&(t=t.$parent))if(t._inactive)return!0;return!1}function Dn(t,e){if(e){if(t._directInactive=!1,Mn(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)Dn(t.$children[n]);Gn(t,"activated")}}function Rn(t,e){if((!e||(t._directInactive=!0,!Mn(t)))&&!t._inactive){t._inactive=!0;for(var n=0;n<t.$children.length;n++)Rn(t.$children[n]);Gn(t,"deactivated")}}function Gn(t,e){yt();var n=t.$options[e],r=e+" hook";if(n)for(var i=0,o=n.length;i<o;i++)re(n[i],t,null,t,r);t._hasHookEvent&&t.$emit("hook:"+e),mt()}var Bn=[],Un=[],Vn={},Hn=!1,Wn=!1,Kn=0;function Zn(){Kn=Bn.length=Un.length=0,Vn={},Hn=Wn=!1}var Yn=0,Jn=Date.now;if(X&&!tt){var Xn=window.performance;Xn&&"function"===typeof Xn.now&&Jn()>document.createEvent("Event").timeStamp&&(Jn=function(){return Xn.now()})}function zn(){var t,e;for(Yn=Jn(),Wn=!0,Bn.sort((function(t,e){return t.id-e.id})),Kn=0;Kn<Bn.length;Kn++)t=Bn[Kn],t.before&&t.before(),e=t.id,Vn[e]=null,t.run();var n=Un.slice(),r=Bn.slice();Zn(),tr(n),qn(r),ct&&U.devtools&&ct.emit("flush")}function qn(t){var e=t.length;while(e--){var n=t[e],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Gn(r,"updated")}}function Qn(t){t._inactive=!1,Un.push(t)}function tr(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,Dn(t[e],!0)}function er(t){var e=t.id;if(null==Vn[e]){if(Vn[e]=!0,Wn){var n=Bn.length-1;while(n>Kn&&Bn[n].id>t.id)n--;Bn.splice(n+1,0,t)}else Bn.push(t);Hn||(Hn=!0,pe(zn))}}var nr=0,rr=function(t,e,n,r,i){this.vm=t,i&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++nr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ft,this.newDepIds=new ft,this.expression="","function"===typeof e?this.getter=e:(this.getter=Z(e),this.getter||(this.getter=I)),this.value=this.lazy?void 0:this.get()};rr.prototype.get=function(){var t;yt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(wa){if(!this.user)throw wa;ne(wa,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&ye(t),mt(),this.cleanupDeps()}return t},rr.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},rr.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},rr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():er(this)},rr.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||u(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'+this.expression+'"';re(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},rr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},rr.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},rr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||m(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var ir={enumerable:!0,configurable:!0,get:I,set:I};function or(t,e,n){ir.get=function(){return this[e][n]},ir.set=function(t){this[e][n]=t},Object.defineProperty(t,n,ir)}function ar(t){t._watchers=[];var e=t.$options;e.props&&dr(t,e.props),e.methods&&pr(t,e.methods),e.data?ur(t):It(t._data={},!0),e.computed&&fr(t,e.computed),e.watch&&e.watch!==ot&&vr(t,e.watch)}function dr(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;o||At(!1);var a=function(o){i.push(o);var a=Xt(o,e,n,t);jt(r,o,a),o in t||or(t,"_props",o)};for(var d in e)a(d);At(!0)}function ur(t){var e=t.$options.data;e=t._data="function"===typeof e?cr(e,t):e||{},s(e)||(e={});var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);while(i--){var o=n[i];0,r&&b(r,o)||H(o)||or(t,"_data",o)}It(e,!0)}function cr(t,e){yt();try{return t.call(e,e)}catch(wa){return ne(wa,e,"data()"),{}}finally{mt()}}var sr={lazy:!0};function fr(t,e){var n=t._computedWatchers=Object.create(null),r=ut();for(var i in e){var o=e[i],a="function"===typeof o?o:o.get;0,r||(n[i]=new rr(t,a||I,I,sr)),i in t||lr(t,i,o)}}function lr(t,e,n){var r=!ut();"function"===typeof n?(ir.get=r?$r(e):hr(n),ir.set=I):(ir.get=n.get?r&&!1!==n.cache?$r(e):hr(n.get):I,ir.set=n.set||I),Object.defineProperty(t,e,ir)}function $r(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),pt.target&&e.depend(),e.value}}function hr(t){return function(){return t.call(this,this)}}function pr(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?I:A(e[n],t)}function vr(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)yr(t,n,r[i]);else yr(t,n,r)}}function yr(t,e,n,r){return s(n)&&(r=n,n=n.handler),"string"===typeof n&&(n=t[n]),t.$watch(e,n,r)}function mr(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Ft,t.prototype.$delete=Lt,t.prototype.$watch=function(t,e,n){var r=this;if(s(e))return yr(r,t,e,n);n=n||{},n.user=!0;var i=new rr(r,t,e,n);if(n.immediate){var o='callback for immediate watcher "'+i.expression+'"';yt(),re(e,r,[i.value],r,o),mt()}return function(){i.teardown()}}}var gr=0;function br(t){t.prototype._init=function(t){var e=this;e._uid=gr++,e._isVue=!0,t&&t._isComponent?_r(e,t):e.$options=Yt(Cr(e.constructor),t||{},e),e._renderProxy=e,e._self=e,In(e),Nn(e),yn(e),Gn(e,"beforeCreate"),ke(e),ar(e),Ae(e),Gn(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}function _r(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}function Cr(t){var e=t.options;if(t.super){var n=Cr(t.super),r=t.superOptions;if(n!==r){t.superOptions=n;var i=xr(t);i&&E(t.extendOptions,i),e=t.options=Yt(n,t.extendOptions),e.name&&(e.components[e.name]=t)}}return e}function xr(t){var e,n=t.options,r=t.sealedOptions;for(var i in n)n[i]!==r[i]&&(e||(e={}),e[i]=n[i]);return e}function wr(t){this._init(t)}function Nr(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=k(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function Or(t){t.mixin=function(t){return this.options=Yt(this.options,t),this}}function Sr(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name;var a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=Yt(n.options,t),a["super"]=n,a.options.props&&Pr(a),a.options.computed&&Ar(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,G.forEach((function(t){a[t]=n[t]})),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=E({},a.options),i[r]=a,a}}function Pr(t){var e=t.options.props;for(var n in e)or(t.prototype,"_props",n)}function Ar(t){var e=t.options.computed;for(var n in e)lr(t.prototype,n,e[n])}function kr(t){G.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&s(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}function Er(t){return t&&(t.Ctor.options.name||t.tag)}function Tr(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function Ir(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var d=a.name;d&&!e(d)&&jr(n,o,r,i)}}}function jr(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,m(n,e)}br(wr),mr(wr),kn(wr),jn(wr),bn(wr);var Fr=[String,RegExp,Array],Lr={name:"keep-alive",abstract:!0,props:{include:Fr,exclude:Fr,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,n=t.keys,r=t.vnodeToCache,i=t.keyToCache;if(r){var o=r.tag,a=r.componentInstance,d=r.componentOptions;e[i]={name:Er(d),tag:o,componentInstance:a},n.push(i),this.max&&n.length>parseInt(this.max)&&jr(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)jr(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Ir(t,(function(t){return Tr(e,t)}))})),this.$watch("exclude",(function(e){Ir(t,(function(t){return!Tr(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=wn(t),n=e&&e.componentOptions;if(n){var r=Er(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!Tr(o,r))||a&&r&&Tr(a,r))return e;var d=this,u=d.cache,c=d.keys,s=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;u[s]?(e.componentInstance=u[s].componentInstance,m(c,s),c.push(s)):(this.vnodeToCache=e,this.keyToCache=s),e.data.keepAlive=!0}return e||t&&t[0]}},Mr={KeepAlive:Lr};function Dr(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:$t,extend:E,mergeOptions:Yt,defineReactive:jt},t.set=Ft,t.delete=Lt,t.nextTick=pe,t.observable=function(t){return It(t),t},t.options=Object.create(null),G.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,E(t.options.components,Mr),Nr(t),Or(t),Sr(t),kr(t)}Dr(wr),Object.defineProperty(wr.prototype,"$isServer",{get:ut}),Object.defineProperty(wr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wr,"FunctionalRenderContext",{value:Qe}),wr.version="2.6.14";var Rr=v("style,class"),Gr=v("input,textarea,option,select,progress"),Br=function(t,e,n){return"value"===n&&Gr(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Ur=v("contenteditable,draggable,spellcheck"),Vr=v("events,caret,typing,plaintext-only"),Hr=function(t,e){return Jr(e)||"false"===e?"false":"contenteditable"===t&&Vr(e)?e:"true"},Wr=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Kr="http://www.w3.org/1999/xlink",Zr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Yr=function(t){return Zr(t)?t.slice(6,t.length):""},Jr=function(t){return null==t||!1===t};function Xr(t){var e=t.data,n=t,r=t;while(i(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(e=zr(r.data,e));while(i(n=n.parent))n&&n.data&&(e=zr(e,n.data));return qr(e.staticClass,e.class)}function zr(t,e){return{staticClass:Qr(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function qr(t,e){return i(t)||i(e)?Qr(t,ti(e)):""}function Qr(t,e){return t?e?t+" "+e:t:e||""}function ti(t){return Array.isArray(t)?ei(t):u(t)?ni(t):"string"===typeof t?t:""}function ei(t){for(var e,n="",r=0,o=t.length;r<o;r++)i(e=ti(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}function ni(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}var ri={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},ii=v("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),oi=v("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),ai=function(t){return ii(t)||oi(t)};function di(t){return oi(t)?"svg":"math"===t?"math":void 0}var ui=Object.create(null);function ci(t){if(!X)return!0;if(ai(t))return!1;if(t=t.toLowerCase(),null!=ui[t])return ui[t];var e=document.createElement(t);return t.indexOf("-")>-1?ui[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ui[t]=/HTMLUnknownElement/.test(e.toString())}var si=v("text,number,password,search,email,tel,url");function fi(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function li(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function $i(t,e){return document.createElementNS(ri[t],e)}function hi(t){return document.createTextNode(t)}function pi(t){return document.createComment(t)}function vi(t,e,n){t.insertBefore(e,n)}function yi(t,e){t.removeChild(e)}function mi(t,e){t.appendChild(e)}function gi(t){return t.parentNode}function bi(t){return t.nextSibling}function _i(t){return t.tagName}function Ci(t,e){t.textContent=e}function xi(t,e){t.setAttribute(e,"")}var wi=Object.freeze({createElement:li,createElementNS:$i,createTextNode:hi,createComment:pi,insertBefore:vi,removeChild:yi,appendChild:mi,parentNode:gi,nextSibling:bi,tagName:_i,setTextContent:Ci,setStyleScope:xi}),Ni={create:function(t,e){Oi(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Oi(t,!0),Oi(e))},destroy:function(t){Oi(t,!0)}};function Oi(t,e){var n=t.data.ref;if(i(n)){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?m(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var Si=new gt("",{},[]),Pi=["create","activate","update","remove","destroy"];function Ai(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&ki(t,e)||o(t.isAsyncPlaceholder)&&r(e.asyncFactory.error))}function ki(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||si(r)&&si(o)}function Ei(t,e,n){var r,o,a={};for(r=e;r<=n;++r)o=t[r].key,i(o)&&(a[o]=r);return a}function Ti(t){var e,n,a={},u=t.modules,c=t.nodeOps;for(e=0;e<Pi.length;++e)for(a[Pi[e]]=[],n=0;n<u.length;++n)i(u[n][Pi[e]])&&a[Pi[e]].push(u[n][Pi[e]]);function s(t){return new gt(c.tagName(t).toLowerCase(),{},[],void 0,t)}function f(t,e){function n(){0===--n.listeners&&l(t)}return n.listeners=e,n}function l(t){var e=c.parentNode(t);i(e)&&c.removeChild(e,t)}function $(t,e,n,r,a,d,u){if(i(t.elm)&&i(d)&&(t=d[u]=xt(t)),t.isRootInsert=!a,!h(t,e,n,r)){var s=t.data,f=t.children,l=t.tag;i(l)?(t.elm=t.ns?c.createElementNS(t.ns,l):c.createElement(l,t),C(t),g(t,f,e),i(s)&&_(t,e),m(n,t.elm,r)):o(t.isComment)?(t.elm=c.createComment(t.text),m(n,t.elm,r)):(t.elm=c.createTextNode(t.text),m(n,t.elm,r))}}function h(t,e,n,r){var a=t.data;if(i(a)){var d=i(t.componentInstance)&&a.keepAlive;if(i(a=a.hook)&&i(a=a.init)&&a(t,!1),i(t.componentInstance))return p(t,e),m(n,t.elm,r),o(d)&&y(t,e,n,r),!0}}function p(t,e){i(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,b(t)?(_(t,e),C(t)):(Oi(t),e.push(t))}function y(t,e,n,r){var o,d=t;while(d.componentInstance)if(d=d.componentInstance._vnode,i(o=d.data)&&i(o=o.transition)){for(o=0;o<a.activate.length;++o)a.activate[o](Si,d);e.push(d);break}m(n,t.elm,r)}function m(t,e,n){i(t)&&(i(n)?c.parentNode(n)===t&&c.insertBefore(t,e,n):c.appendChild(t,e))}function g(t,e,n){if(Array.isArray(e)){0;for(var r=0;r<e.length;++r)$(e[r],n,t.elm,null,!0,e,r)}else d(t.text)&&c.appendChild(t.elm,c.createTextNode(String(t.text)))}function b(t){while(t.componentInstance)t=t.componentInstance._vnode;return i(t.tag)}function _(t,n){for(var r=0;r<a.create.length;++r)a.create[r](Si,t);e=t.data.hook,i(e)&&(i(e.create)&&e.create(Si,t),i(e.insert)&&n.push(t))}function C(t){var e;if(i(e=t.fnScopeId))c.setStyleScope(t.elm,e);else{var n=t;while(n)i(e=n.context)&&i(e=e.$options._scopeId)&&c.setStyleScope(t.elm,e),n=n.parent}i(e=En)&&e!==t.context&&e!==t.fnContext&&i(e=e.$options._scopeId)&&c.setStyleScope(t.elm,e)}function x(t,e,n,r,i,o){for(;r<=i;++r)$(n[r],o,t,e,!1,n,r)}function w(t){var e,n,r=t.data;if(i(r))for(i(e=r.hook)&&i(e=e.destroy)&&e(t),e=0;e<a.destroy.length;++e)a.destroy[e](t);if(i(e=t.children))for(n=0;n<t.children.length;++n)w(t.children[n])}function N(t,e,n){for(;e<=n;++e){var r=t[e];i(r)&&(i(r.tag)?(O(r),w(r)):l(r.elm))}}function O(t,e){if(i(e)||i(t.data)){var n,r=a.remove.length+1;for(i(e)?e.listeners+=r:e=f(t.elm,r),i(n=t.componentInstance)&&i(n=n._vnode)&&i(n.data)&&O(n,e),n=0;n<a.remove.length;++n)a.remove[n](t,e);i(n=t.data.hook)&&i(n=n.remove)?n(t,e):e()}else l(t.elm)}function S(t,e,n,o,a){var d,u,s,f,l=0,h=0,p=e.length-1,v=e[0],y=e[p],m=n.length-1,g=n[0],b=n[m],_=!a;while(l<=p&&h<=m)r(v)?v=e[++l]:r(y)?y=e[--p]:Ai(v,g)?(A(v,g,o,n,h),v=e[++l],g=n[++h]):Ai(y,b)?(A(y,b,o,n,m),y=e[--p],b=n[--m]):Ai(v,b)?(A(v,b,o,n,m),_&&c.insertBefore(t,v.elm,c.nextSibling(y.elm)),v=e[++l],b=n[--m]):Ai(y,g)?(A(y,g,o,n,h),_&&c.insertBefore(t,y.elm,v.elm),y=e[--p],g=n[++h]):(r(d)&&(d=Ei(e,l,p)),u=i(g.key)?d[g.key]:P(g,e,l,p),r(u)?$(g,o,t,v.elm,!1,n,h):(s=e[u],Ai(s,g)?(A(s,g,o,n,h),e[u]=void 0,_&&c.insertBefore(t,s.elm,v.elm)):$(g,o,t,v.elm,!1,n,h)),g=n[++h]);l>p?(f=r(n[m+1])?null:n[m+1].elm,x(t,f,n,h,m,o)):h>m&&N(e,l,p)}function P(t,e,n,r){for(var o=n;o<r;o++){var a=e[o];if(i(a)&&Ai(t,a))return o}}function A(t,e,n,d,u,s){if(t!==e){i(e.elm)&&i(d)&&(e=d[u]=xt(e));var f=e.elm=t.elm;if(o(t.isAsyncPlaceholder))i(e.asyncFactory.resolved)?T(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(o(e.isStatic)&&o(t.isStatic)&&e.key===t.key&&(o(e.isCloned)||o(e.isOnce)))e.componentInstance=t.componentInstance;else{var l,$=e.data;i($)&&i(l=$.hook)&&i(l=l.prepatch)&&l(t,e);var h=t.children,p=e.children;if(i($)&&b(e)){for(l=0;l<a.update.length;++l)a.update[l](t,e);i(l=$.hook)&&i(l=l.update)&&l(t,e)}r(e.text)?i(h)&&i(p)?h!==p&&S(f,h,p,n,s):i(p)?(i(t.text)&&c.setTextContent(f,""),x(f,null,p,0,p.length-1,n)):i(h)?N(h,0,h.length-1):i(t.text)&&c.setTextContent(f,""):t.text!==e.text&&c.setTextContent(f,e.text),i($)&&i(l=$.hook)&&i(l=l.postpatch)&&l(t,e)}}}function k(t,e,n){if(o(n)&&i(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}var E=v("attrs,class,staticClass,staticStyle,key");function T(t,e,n,r){var a,d=e.tag,u=e.data,c=e.children;if(r=r||u&&u.pre,e.elm=t,o(e.isComment)&&i(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if(i(u)&&(i(a=u.hook)&&i(a=a.init)&&a(e,!0),i(a=e.componentInstance)))return p(e,n),!0;if(i(d)){if(i(c))if(t.hasChildNodes())if(i(a=u)&&i(a=a.domProps)&&i(a=a.innerHTML)){if(a!==t.innerHTML)return!1}else{for(var s=!0,f=t.firstChild,l=0;l<c.length;l++){if(!f||!T(f,c[l],n,r)){s=!1;break}f=f.nextSibling}if(!s||f)return!1}else g(e,c,n);if(i(u)){var $=!1;for(var h in u)if(!E(h)){$=!0,_(e,n);break}!$&&u["class"]&&ye(u["class"])}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,d){if(!r(e)){var u=!1,f=[];if(r(t))u=!0,$(e,f);else{var l=i(t.nodeType);if(!l&&Ai(t,e))A(t,e,f,null,null,d);else{if(l){if(1===t.nodeType&&t.hasAttribute(R)&&(t.removeAttribute(R),n=!0),o(n)&&T(t,e,f))return k(e,f,!0),t;t=s(t)}var h=t.elm,p=c.parentNode(h);if($(e,f,h._leaveCb?null:p,c.nextSibling(h)),i(e.parent)){var v=e.parent,y=b(e);while(v){for(var m=0;m<a.destroy.length;++m)a.destroy[m](v);if(v.elm=e.elm,y){for(var g=0;g<a.create.length;++g)a.create[g](Si,v);var _=v.data.hook.insert;if(_.merged)for(var C=1;C<_.fns.length;C++)_.fns[C]()}else Oi(v);v=v.parent}}i(p)?N([t],0,0):i(t.tag)&&w(t)}}return k(e,f,u),e.elm}i(t)&&w(t)}}var Ii={create:ji,update:ji,destroy:function(t){ji(t,Si)}};function ji(t,e){(t.data.directives||e.data.directives)&&Fi(t,e)}function Fi(t,e){var n,r,i,o=t===Si,a=e===Si,d=Mi(t.data.directives,t.context),u=Mi(e.data.directives,e.context),c=[],s=[];for(n in u)r=d[n],i=u[n],r?(i.oldValue=r.value,i.oldArg=r.arg,Ri(i,"update",e,t),i.def&&i.def.componentUpdated&&s.push(i)):(Ri(i,"bind",e,t),i.def&&i.def.inserted&&c.push(i));if(c.length){var f=function(){for(var n=0;n<c.length;n++)Ri(c[n],"inserted",e,t)};o?Ce(e,"insert",f):f()}if(s.length&&Ce(e,"postpatch",(function(){for(var n=0;n<s.length;n++)Ri(s[n],"componentUpdated",e,t)})),!o)for(n in d)u[n]||Ri(d[n],"unbind",t,t,a)}var Li=Object.create(null);function Mi(t,e){var n,r,i=Object.create(null);if(!t)return i;for(n=0;n<t.length;n++)r=t[n],r.modifiers||(r.modifiers=Li),i[Di(r)]=r,r.def=Jt(e.$options,"directives",r.name,!0);return i}function Di(t){return t.rawName||t.name+"."+Object.keys(t.modifiers||{}).join(".")}function Ri(t,e,n,r,i){var o=t.def&&t.def[e];if(o)try{o(n.elm,t,n,r,i)}catch(wa){ne(wa,n.context,"directive "+t.name+" "+e+" hook")}}var Gi=[Ni,Ii];function Bi(t,e){var n=e.componentOptions;if((!i(n)||!1!==n.Ctor.options.inheritAttrs)&&(!r(t.data.attrs)||!r(e.data.attrs))){var o,a,d,u=e.elm,c=t.data.attrs||{},s=e.data.attrs||{};for(o in i(s.__ob__)&&(s=e.data.attrs=E({},s)),s)a=s[o],d=c[o],d!==a&&Ui(u,o,a,e.data.pre);for(o in(tt||nt)&&s.value!==c.value&&Ui(u,"value",s.value),c)r(s[o])&&(Zr(o)?u.removeAttributeNS(Kr,Yr(o)):Ur(o)||u.removeAttribute(o))}}function Ui(t,e,n,r){r||t.tagName.indexOf("-")>-1?Vi(t,e,n):Wr(e)?Jr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Ur(e)?t.setAttribute(e,Hr(e,n)):Zr(e)?Jr(n)?t.removeAttributeNS(Kr,Yr(e)):t.setAttributeNS(Kr,e,n):Vi(t,e,n)}function Vi(t,e,n){if(Jr(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Hi={create:Bi,update:Bi};function Wi(t,e){var n=e.elm,o=e.data,a=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var d=Xr(e),u=n._transitionClasses;i(u)&&(d=Qr(d,ti(u))),d!==n._prevClass&&(n.setAttribute("class",d),n._prevClass=d)}}var Ki,Zi={create:Wi,update:Wi},Yi="__r",Ji="__c";function Xi(t){if(i(t[Yi])){var e=tt?"change":"input";t[e]=[].concat(t[Yi],t[e]||[]),delete t[Yi]}i(t[Ji])&&(t.change=[].concat(t[Ji],t.change||[]),delete t[Ji])}function zi(t,e,n){var r=Ki;return function i(){var o=e.apply(null,arguments);null!==o&&to(t,i,n,r)}}var qi=de&&!(it&&Number(it[1])<=53);function Qi(t,e,n,r){if(qi){var i=Yn,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}Ki.addEventListener(t,e,at?{capture:n,passive:r}:n)}function to(t,e,n,r){(r||Ki).removeEventListener(t,e._wrapper||e,n)}function eo(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};Ki=e.elm,Xi(n),_e(n,i,Qi,to,zi,e.context),Ki=void 0}}var no,ro={create:eo,update:eo};function io(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,a=e.elm,d=t.data.domProps||{},u=e.data.domProps||{};for(n in i(u.__ob__)&&(u=e.data.domProps=E({},u)),d)n in u||(a[n]="");for(n in u){if(o=u[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===d[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=o;var c=r(o)?"":String(o);oo(a,c)&&(a.value=c)}else if("innerHTML"===n&&oi(a.tagName)&&r(a.innerHTML)){no=no||document.createElement("div"),no.innerHTML="<svg>"+o+"</svg>";var s=no.firstChild;while(a.firstChild)a.removeChild(a.firstChild);while(s.firstChild)a.appendChild(s.firstChild)}else if(o!==d[n])try{a[n]=o}catch(wa){}}}}function oo(t,e){return!t.composing&&("OPTION"===t.tagName||ao(t,e)||uo(t,e))}function ao(t,e){var n=!0;try{n=document.activeElement!==t}catch(wa){}return n&&t.value!==e}function uo(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.number)return p(n)!==p(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}var co={create:io,update:io},so=_((function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach((function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function fo(t){var e=lo(t.style);return t.staticStyle?E(t.staticStyle,e):e}function lo(t){return Array.isArray(t)?T(t):"string"===typeof t?so(t):t}function $o(t,e){var n,r={};if(e){var i=t;while(i.componentInstance)i=i.componentInstance._vnode,i&&i.data&&(n=fo(i.data))&&E(r,n)}(n=fo(t.data))&&E(r,n);var o=t;while(o=o.parent)o.data&&(n=fo(o.data))&&E(r,n);return r}var ho,po=/^--/,vo=/\s*!important$/,yo=function(t,e,n){if(po.test(e))t.style.setProperty(e,n);else if(vo.test(n))t.style.setProperty(O(e),n.replace(vo,""),"important");else{var r=go(e);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)t.style[r]=n[i];else t.style[r]=n}},mo=["Webkit","Moz","ms"],go=_((function(t){if(ho=ho||document.createElement("div").style,t=x(t),"filter"!==t&&t in ho)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<mo.length;n++){var r=mo[n]+e;if(r in ho)return r}}));function bo(t,e){var n=e.data,o=t.data;if(!(r(n.staticStyle)&&r(n.style)&&r(o.staticStyle)&&r(o.style))){var a,d,u=e.elm,c=o.staticStyle,s=o.normalizedStyle||o.style||{},f=c||s,l=lo(e.data.style)||{};e.data.normalizedStyle=i(l.__ob__)?E({},l):l;var $=$o(e,!0);for(d in f)r($[d])&&yo(u,d,"");for(d in $)a=$[d],a!==f[d]&&yo(u,d,null==a?"":a)}}var _o={create:bo,update:bo},Co=/\s+/;function xo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Co).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function wo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Co).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function No(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&E(e,Oo(t.name||"v")),E(e,t),e}return"string"===typeof t?Oo(t):void 0}}var Oo=_((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),So=X&&!et,Po="transition",Ao="animation",ko="transition",Eo="transitionend",To="animation",Io="animationend";So&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ko="WebkitTransition",Eo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(To="WebkitAnimation",Io="webkitAnimationEnd"));var jo=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Fo(t){jo((function(){jo(t)}))}function Lo(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),xo(t,e))}function Mo(t,e){t._transitionClasses&&m(t._transitionClasses,e),wo(t,e)}function Do(t,e,n){var r=Go(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var d=i===Po?Eo:Io,u=0,c=function(){t.removeEventListener(d,s),n()},s=function(e){e.target===t&&++u>=a&&c()};setTimeout((function(){u<a&&c()}),o+1),t.addEventListener(d,s)}var Ro=/\b(transform|all)(,|$)/;function Go(t,e){var n,r=window.getComputedStyle(t),i=(r[ko+"Delay"]||"").split(", "),o=(r[ko+"Duration"]||"").split(", "),a=Bo(i,o),d=(r[To+"Delay"]||"").split(", "),u=(r[To+"Duration"]||"").split(", "),c=Bo(d,u),s=0,f=0;e===Po?a>0&&(n=Po,s=a,f=o.length):e===Ao?c>0&&(n=Ao,s=c,f=u.length):(s=Math.max(a,c),n=s>0?a>c?Po:Ao:null,f=n?n===Po?o.length:u.length:0);var l=n===Po&&Ro.test(r[ko+"Property"]);return{type:n,timeout:s,propCount:f,hasTransform:l}}function Bo(t,e){while(t.length<e.length)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return Uo(e)+Uo(t[n])})))}function Uo(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function Vo(t,e){var n=t.elm;i(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var o=No(t.data.transition);if(!r(o)&&!i(n._enterCb)&&1===n.nodeType){var a=o.css,d=o.type,c=o.enterClass,s=o.enterToClass,f=o.enterActiveClass,l=o.appearClass,$=o.appearToClass,h=o.appearActiveClass,v=o.beforeEnter,y=o.enter,m=o.afterEnter,g=o.enterCancelled,b=o.beforeAppear,_=o.appear,C=o.afterAppear,x=o.appearCancelled,w=o.duration,N=En,O=En.$vnode;while(O&&O.parent)N=O.context,O=O.parent;var S=!N._isMounted||!t.isRootInsert;if(!S||_||""===_){var P=S&&l?l:c,A=S&&h?h:f,k=S&&$?$:s,E=S&&b||v,T=S&&"function"===typeof _?_:y,I=S&&C||m,j=S&&x||g,F=p(u(w)?w.enter:w);0;var L=!1!==a&&!et,M=Ko(T),R=n._enterCb=D((function(){L&&(Mo(n,k),Mo(n,A)),R.cancelled?(L&&Mo(n,P),j&&j(n)):I&&I(n),n._enterCb=null}));t.data.show||Ce(t,"insert",(function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),T&&T(n,R)})),E&&E(n),L&&(Lo(n,P),Lo(n,A),Fo((function(){Mo(n,P),R.cancelled||(Lo(n,k),M||(Wo(F)?setTimeout(R,F):Do(n,d,R)))}))),t.data.show&&(e&&e(),T&&T(n,R)),L||M||R()}}}function Ho(t,e){var n=t.elm;i(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var o=No(t.data.transition);if(r(o)||1!==n.nodeType)return e();if(!i(n._leaveCb)){var a=o.css,d=o.type,c=o.leaveClass,s=o.leaveToClass,f=o.leaveActiveClass,l=o.beforeLeave,$=o.leave,h=o.afterLeave,v=o.leaveCancelled,y=o.delayLeave,m=o.duration,g=!1!==a&&!et,b=Ko($),_=p(u(m)?m.leave:m);0;var C=n._leaveCb=D((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),g&&(Mo(n,s),Mo(n,f)),C.cancelled?(g&&Mo(n,c),v&&v(n)):(e(),h&&h(n)),n._leaveCb=null}));y?y(x):x()}function x(){C.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),l&&l(n),g&&(Lo(n,c),Lo(n,f),Fo((function(){Mo(n,c),C.cancelled||(Lo(n,s),b||(Wo(_)?setTimeout(C,_):Do(n,d,C)))}))),$&&$(n,C),g||b||C())}}function Wo(t){return"number"===typeof t&&!isNaN(t)}function Ko(t){if(r(t))return!1;var e=t.fns;return i(e)?Ko(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function Zo(t,e){!0!==e.data.show&&Vo(e)}var Yo=X?{create:Zo,activate:Zo,remove:function(t,e){!0!==t.data.show?Ho(t,e):e()}}:{},Jo=[Hi,Zi,ro,co,_o,Yo],Xo=Jo.concat(Gi),zo=Ti({nodeOps:wi,modules:Xo});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&oa(t,"input")}));var qo={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?Ce(n,"postpatch",(function(){qo.componentUpdated(t,e,n)})):Qo(t,e,n.context),t._vOptions=[].map.call(t.options,na)):("textarea"===n.tag||si(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",ra),t.addEventListener("compositionend",ia),t.addEventListener("change",ia),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Qo(t,e,n.context);var r=t._vOptions,i=t._vOptions=[].map.call(t.options,na);if(i.some((function(t,e){return!L(t,r[e])}))){var o=t.multiple?e.value.some((function(t){return ea(t,i)})):e.value!==e.oldValue&&ea(e.value,i);o&&oa(t,"change")}}}};function Qo(t,e,n){ta(t,e,n),(tt||nt)&&setTimeout((function(){ta(t,e,n)}),0)}function ta(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,d=0,u=t.options.length;d<u;d++)if(a=t.options[d],i)o=M(r,na(a))>-1,a.selected!==o&&(a.selected=o);else if(L(na(a),r))return void(t.selectedIndex!==d&&(t.selectedIndex=d));i||(t.selectedIndex=-1)}}function ea(t,e){return e.every((function(e){return!L(e,t)}))}function na(t){return"_value"in t?t._value:t.value}function ra(t){t.target.composing=!0}function ia(t){t.target.composing&&(t.target.composing=!1,oa(t.target,"input"))}function oa(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function aa(t){return!t.componentInstance||t.data&&t.data.transition?t:aa(t.componentInstance._vnode)}var da={bind:function(t,e,n){var r=e.value;n=aa(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,Vo(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value,i=e.oldValue;if(!r!==!i){n=aa(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,r?Vo(n,(function(){t.style.display=t.__vOriginalDisplay})):Ho(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},ua={model:qo,show:da},ca={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function sa(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?sa(wn(e.children)):t}function fa(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[x(o)]=i[o];return e}function la(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function $a(t){while(t=t.parent)if(t.data.transition)return!0}function ha(t,e){return e.key===t.key&&e.tag===t.tag}var pa=function(t){return t.tag||je(t)},va=function(t){return"show"===t.name},ya={name:"transition",props:ca,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(pa),n.length)){0;var r=this.mode;0;var i=n[0];if($a(this.$vnode))return i;var o=sa(i);if(!o)return i;if(this._leaving)return la(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:d(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var u=(o.data||(o.data={})).transition=fa(this),c=this._vnode,s=sa(c);if(o.data.directives&&o.data.directives.some(va)&&(o.data.show=!0),s&&s.data&&!ha(o,s)&&!je(s)&&(!s.componentInstance||!s.componentInstance._vnode.isComment)){var f=s.data.transition=E({},u);if("out-in"===r)return this._leaving=!0,Ce(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),la(t,i);if("in-out"===r){if(je(o))return c;var l,$=function(){l()};Ce(u,"afterEnter",$),Ce(u,"enterCancelled",$),Ce(f,"delayLeave",(function(t){l=t}))}}return i}}},ma=E({tag:String,moveClass:String},ca);delete ma.mode;var ga={props:ma,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Tn(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=fa(this),d=0;d<i.length;d++){var u=i[d];if(u.tag)if(null!=u.key&&0!==String(u.key).indexOf("__vlist"))o.push(u),n[u.key]=u,(u.data||(u.data={})).transition=a;else;}if(r){for(var c=[],s=[],f=0;f<r.length;f++){var l=r[f];l.data.transition=a,l.data.pos=l.elm.getBoundingClientRect(),n[l.key]?c.push(l):s.push(l)}this.kept=t(e,null,c),this.removed=s}return t(e,null,o)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(ba),t.forEach(_a),t.forEach(Ca),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,r=n.style;Lo(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Eo,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Eo,t),n._moveCb=null,Mo(n,e))})}})))},methods:{hasMove:function(t,e){if(!So)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){wo(n,t)})),xo(n,e),n.style.display="none",this.$el.appendChild(n);var r=Go(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function ba(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function _a(t){t.data.newPos=t.elm.getBoundingClientRect()}function Ca(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}var xa={Transition:ya,TransitionGroup:ga};wr.config.mustUseProp=Br,wr.config.isReservedTag=ai,wr.config.isReservedAttr=Rr,wr.config.getTagNamespace=di,wr.config.isUnknownElement=ci,E(wr.options.directives,ua),E(wr.options.components,xa),wr.prototype.__patch__=X?zo:I,wr.prototype.$mount=function(t,e){return t=t&&X?fi(t):void 0,Fn(this,t,e)},X&&setTimeout((function(){U.devtools&&ct&&ct.emit("init",wr)}),0),e["a"]=wr}).call(this,n("c8ba"))},"2b4c":function(t,e,n){var r=n("5537")("wks"),i=n("ca5a"),o=n("7726").Symbol,a="function"==typeof o,d=t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))};d.store=r},"2c3f":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function i(t){return r[t]}function o(t){var e="",n=t.split(""),r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var d=a,u=i(d);u&&(e+=u)}return e}},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"2fdb":function(t,e,n){"use strict";var r=n("5ca1"),i=n("d2c8"),o="includes";r(r.P+r.F*n("5147")(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},3024:function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},"30f1":function(t,e,n){"use strict";var r=n("b8e3"),i=n("63b6"),o=n("9138"),a=n("35e8"),d=n("481b"),u=n("8f60"),c=n("45f2"),s=n("53e2"),f=n("5168")("iterator"),l=!([].keys&&"next"in[].keys()),$="@@iterator",h="keys",p="values",v=function(){return this};t.exports=function(t,e,n,y,m,g,b){u(n,e,y);var _,C,x,w=function(t){if(!l&&t in P)return P[t];switch(t){case h:return function(){return new n(this,t)};case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},N=e+" Iterator",O=m==p,S=!1,P=t.prototype,A=P[f]||P[$]||m&&P[m],k=A||w(m),E=m?O?w("entries"):k:void 0,T="Array"==e&&P.entries||A;if(T&&(x=s(T.call(new t)),x!==Object.prototype&&x.next&&(c(x,N,!0),r||"function"==typeof x[f]||a(x,f,v))),O&&A&&A.name!==p&&(S=!0,k=function(){return A.call(this)}),r&&!b||!l&&!S&&P[f]||a(P,f,k),d[e]=k,d[N]=v,m)if(_={values:O?k:w(p),keys:g?k:w(h),entries:E},b)for(C in _)C in P||o(P,C,_[C]);else i(i.P+i.F*(l||S),e,_);return _}},3157:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("f573");function i(t){return t.replace(new RegExp("[".concat(r["f"],"]+"),"g")," ").trim()}},"31f4":function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},"32e9":function(t,e,n){var r=n("86cc"),i=n("4630");t.exports=n("9e1e")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"32fc":function(t,e,n){var r=n("e53d").document;t.exports=r&&r.documentElement},"335c":function(t,e,n){var r=n("6b4c");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"33a4":function(t,e,n){var r=n("84f2"),i=n("2b4c")("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},"355d":function(t,e){e.f={}.propertyIsEnumerable},"35e8":function(t,e,n){var r=n("d9f6"),i=n("aebd");t.exports=n("8e60")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"36c3":function(t,e,n){var r=n("335c"),i=n("25eb");t.exports=function(t){return r(i(t))}},3702:function(t,e,n){var r=n("481b"),i=n("5168")("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},3846:function(t,e,n){n("9e1e")&&"g"!=/./g.flags&&n("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:n("0bfb")})},"38fd":function(t,e,n){var r=n("69a8"),i=n("4bf8"),o=n("613b")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},"3a38":function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},"3b8d":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("795b"),i=n.n(r);function o(t,e,n,r,o,a,d){try{var u=t[a](d),c=u.value}catch(s){return void n(s)}u.done?e(c):i.a.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new i.a((function(r,i){var a=t.apply(e,n);function d(t){o(a,r,i,d,u,"next",t)}function u(t){o(a,r,i,d,u,"throw",t)}d(void 0)}))}}},"3c11":function(t,e,n){"use strict";var r=n("63b6"),i=n("584a"),o=n("e53d"),a=n("f201"),d=n("cd78");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return d(e,t()).then((function(){return n}))}:t,n?function(n){return d(e,t()).then((function(){throw n}))}:t)}})},"3d4a":function(t,e,n){"use strict";n.d(e,"b",(function(){return i}));var r={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([457]\\d{6})$","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2457]\\d{6})$","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"1|([267]\\d{6})$","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7,8}|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"0|(183[12])",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365|46","1[28]|2|365(?:[0-46-9]|5[0-35-9])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","246$1",0,"246"],BD:["880","00","1\\d{9}|2\\d{7,8}|88\\d{4,6}|(?:8[0-79]|9\\d)\\d{4,8}|(?:[346]\\d|[57])\\d{5,8}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[25689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[25689]"]]]],BL:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([3-8]\\d{6})$","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}",[10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|74)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}"],0,0,0,["600[2-9]\\d{6}"]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d|8[0-24-9])\\d{7}|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","(?:0\\d\\d|222|800)\\d{6}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-3]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","(?:10|2[0-57-9])(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"0|(1(?:[12]\\d|79)\\d\\d)",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:(?:1\\d|[36])\\d{3}|9101)\\d{6}|[124-8]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1 $2",["[146][2-9]|[2578]"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["[39]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d|8[0-24-9])\\d{7}|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:[12]\\d|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[05]\\d|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-59]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-59]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]]],0,0,"0(11\\d{6}|6[256]\\d{6}|7[47]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0359])|(?:5[0-26-9]|[78][0-49])\\d\\d|6(?:[0-4]\\d\\d|50[02459]))|2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d\\d|1(?:[0-7]\\d\\d|8(?:[02]\\d|1[0-278])))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94|80\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"0|([25-9]\\d{5})$","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d\\d|606)\\d{5}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|1[0-2]|2[0-68]|3[1289]|4[0-24-9]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"1|([3-9]\\d{6})$","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:862\\d|9008)\\d{3}|(?:[2-46]\\d|77)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4}(?:\\d(?:\\d(?:\\d{4})?)?)?|(?:[235-79]\\d|46)\\d{6}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-489]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-489]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([25-8]\\d{5})$","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[245])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1[4679]|[38]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d\\d|89(?:2|4[5-9]\\d))\\d{3}|89[45][0-4]\\d\\d|(?:1(?:44|6[346])|89(?:5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([0-24-8]\\d{5})$","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","(?:18|[2569]\\d\\d)\\d{5}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[25]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","758$1",0,"758"],LI:["423","00","90\\d{5}|(?:[2378]|6\\d\\d)\\d{6}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[237-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"0|(1001)"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:2|33|5\\d|77|88)\\d{7}|[4-6]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29|38)[89]","5(?:29|38)[89]0"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:29(?:[189][05]|2[29]|3[01])|38[89][05])\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|90)|3(?:[0-47]\\d|5[02-9]|6[02-8]|80|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0\\d|1[0-3]|6[1267]|7[0-57]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"0|([24-9]\\d{6})$","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[57-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[57-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","670$1",0,"670"],MQ:["596","00","(?:69|80)\\d{7}|(?:59|97)6\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"1|([34]\\d{6})$","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:5|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["5"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[3467]|9[13-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[19]\\d|[23]1|77|88)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:65[0-689]|99[1-9])\\d{7}|(?:1(?:[0147]\\d|[235][1-9]|6[0-46-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9])|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","[2-57-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[04]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|[89]\\d{6,9}|1\\d{4,5}",[5,6,7,8,9,10],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[489]|59"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-579]|6[2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,0," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","6\\d{5}(?:\\d{2})?|8\\d{9}|[1-9]\\d{6}(?:\\d{2})?",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","(?:[45]|80\\d\\d)\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","[2-7]\\d{7}|800\\d{4}(?:\\d{2})?|2\\d{6}",[7,8,9],[["(\\d{3})(\\d{4})","$1 $2",["2[126]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]]]],RE:["262","00","9769\\d{5}|(?:26|[68]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,"26[23]|69|[89]"],RO:["40","00","(?:[237]\\d|[89]0)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","8000\\d{3}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-4]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["24|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6(?:0[5-7]|[1-35-9])|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|(5\\d{6})$","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"1|([2-479]\\d{6})$","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:00|11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"],0,1],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"],0,1],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"],0,1],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02-57-9]|11"],0,1]],"8",0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-46-8]\\d{6})$","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[26-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]","4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["[3-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}",[10],[["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-2]|[28]2)|3(?:0[02]|33)|4(?:00|4[24]|65|82)|5(?:00|29|83)|6(?:00|66|82)|777|8(?:00|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","4\\d{9}|[249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[24]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:33|55|[679]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-578]\\d{6})$","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","80\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,"269|63"],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","(?:63|80)0\\d{6}|(?:21|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:005|[1-9]\\d\\d)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:005|[1-9]\\d\\d)\\d{5}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|285\\d{9}|(?:[19]\\d|49)\\d{6}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["4"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[19]"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-3]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|3(?:2|47|7\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:(?:285\\d\\d|3(?:45|[69]\\d{3}))\\d|9[89])\\d{6}"]]],883:["883",0,"210\\d{7}|51\\d{7}(?:\\d{3})?",[9,10,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["510"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["5"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:210|51[013]0\\d)\\d{7}|5100\\d{5}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};e["a"]=r;function i(t,e){var n=Array.prototype.slice.call(e);return n.push(r),t.apply(this,n)}},4037:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("3d4a"),i=n("07f3");function o(){return Object(r["b"])(i["b"],arguments)}},"40c3":function(t,e,n){var r=n("6b4c"),i=n("5168")("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,d;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),i))?n:o?r(e):"Object"==(d=r(e))&&"function"==typeof e.callee?"Arguments":d}},4178:function(t,e,n){var r,i,o,a=n("d864"),d=n("3024"),u=n("32fc"),c=n("1ec9"),s=n("e53d"),f=s.process,l=s.setImmediate,$=s.clearImmediate,h=s.MessageChannel,p=s.Dispatch,v=0,y={},m="onreadystatechange",g=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){g.call(t.data)};l&&$||(l=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return y[++v]=function(){d("function"==typeof t?t:Function(t),e)},r(v),v},$=function(t){delete y[t]},"process"==n("6b4c")(f)?r=function(t){f.nextTick(a(g,t,1))}:p&&p.now?r=function(t){p.now(a(g,t,1))}:h?(i=new h,o=i.port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(r=function(t){s.postMessage(t+"","*")},s.addEventListener("message",b,!1)):r=m in c("script")?function(t){u.appendChild(c("script"))[m]=function(){u.removeChild(this),g.call(t)}}:function(t){setTimeout(a(g,t,1),0)}),t.exports={set:l,clear:$}},"41a0":function(t,e,n){"use strict";var r=n("2aeb"),i=n("4630"),o=n("7f20"),a={};n("32e9")(a,n("2b4c")("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},"43fc":function(t,e,n){"use strict";var r=n("63b6"),i=n("656e"),o=n("4439");r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},4439:function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(e){return{e:!0,v:e}}}},"454f":function(t,e,n){n("46a7");var r=n("584a").Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},"456d":function(t,e,n){var r=n("4bf8"),i=n("0d58");n("5eda")("keys",(function(){return function(t){return i(r(t))}}))},4588:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},"45f2":function(t,e,n){var r=n("d9f6").f,i=n("07e3"),o=n("5168")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"46a7":function(t,e,n){var r=n("63b6");r(r.S+r.F*!n("8e60"),"Object",{defineProperty:n("d9f6").f})},"46bb":function(t,e,n){"use strict";n.d(e,"a",(function(){return Z}));var r=n("3d4a"),i=n("f573");function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function t(e){o(this,t),this.name=this.constructor.name,this.message=e,this.stack=new Error(e).stack};a.prototype=Object.create(Error.prototype),a.prototype.constructor=a;var d=n("07f3"),u=n("a1de"),c=n("f3ad"),s=new RegExp("(?:"+Object(c["a"])()+")$","i");function f(t){var e=t.search(s);if(e<0)return{};var n=t.slice(0,e),r=t.match(s),i=1;while(i<r.length){if(r[i])return{number:n,ext:r[i]};i++}}var l=n("2c3f");function $(t){var e="",n=t.split(""),r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if(i=n.next(),i.done)break;o=i.value}var a=o;e+=h(a,e)||""}return e}function h(t,e){if("+"===t){if(e)return;return"+"}return Object(l["b"])(t)}var p=n("aa6f"),v=n("efcc"),y=n("6562"),m=n("c5ff"),g=n("62b0"),b=n("4bc9"),_=n("715d"),C=250,x=new RegExp("["+i["d"]+i["e"]+"]"),w=new RegExp("[^"+i["e"]+"#]+$"),N=!1;function O(t,e,n){if(e=e||{},n=new d["a"](n),e.defaultCountry&&!n.hasCountry(e.defaultCountry)){if(e.v2)throw new a("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(e.defaultCountry))}var r=P(t,e.v2,e.extract),o=r.number,u=r.ext,c=r.error;if(!o){if(e.v2){if("TOO_SHORT"===c)throw new a("TOO_SHORT");throw new a("NOT_A_NUMBER")}return{}}var s=k(o,e.defaultCountry,e.defaultCallingCode,n),f=s.country,l=s.nationalNumber,$=s.countryCallingCode,h=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(e.v2)throw new a("INVALID_COUNTRY");return{}}if(!l||l.length<i["c"]){if(e.v2)throw new a("TOO_SHORT");return{}}if(l.length>i["b"]){if(e.v2)throw new a("TOO_LONG");return{}}if(e.v2){var v=new y["a"]($,l,n.metadata);return f&&(v.country=f),h&&(v.carrierCode=h),u&&(v.ext=u),v}var g=!!(e.extended?n.hasSelectedNumberingPlan():f)&&Object(m["a"])(l,n.nationalNumberPattern());return e.extended?{country:f,countryCallingCode:$,carrierCode:h,valid:g,possible:!!g||!(!0!==e.extended||!n.possibleLengths()||!Object(p["b"])(l,n)),phone:l,ext:u}:g?A(f,l,u):{}}function S(t,e,n){if(t)if(t.length>C){if(n)throw new a("TOO_LONG")}else{if(!1===e)return t;var r=t.search(x);if(!(r<0))return t.slice(r).replace(w,"")}}function P(t,e,n){if(t&&0===t.indexOf("tel:"))return Object(v["b"])(t);var r=S(t,n,e);if(!r)return{};if(!Object(u["a"])(r))return Object(u["b"])(r)?{error:"TOO_SHORT"}:{};var i=f(r);return i.ext?i:{number:r}}function A(t,e,n){var r={country:t,phone:e};return n&&(r.ext=n),r}function k(t,e,n,r){var i,o=Object(g["a"])($(t),e,n,r.metadata),a=o.countryCallingCode,u=o.number;if(a)r.selectNumberingPlan(a);else{if(!u||!e&&!n)return{};r.selectNumberingPlan(e,n),e?i=e:N&&r.isNonGeographicCallingCode(n)&&(i="001"),a=n||Object(d["b"])(e,r.metadata)}if(!u)return{countryCallingCode:a};var c=Object(b["a"])($(u),r),s=c.nationalNumber,f=c.carrierCode,l=Object(_["a"])(a,s,r);return l&&(i=l,"001"===l||r.country(i)),{country:i,countryCallingCode:a,nationalNumber:s,carrierCode:f}}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){T(t,e,n[e])}))}return t}function T(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I(t,e,n){return O(t,E({},e,{v2:!0}),n)}function j(t){return j="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function F(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){L(t,e,n[e])}))}return t}function L(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M(t,e){return G(t)||R(t,e)||D()}function D(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function R(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,d=t[Symbol.iterator]();!(r=(a=d.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(u){i=!0,o=u}finally{try{r||null==d["return"]||d["return"]()}finally{if(i)throw o}}return n}function G(t){if(Array.isArray(t))return t}function B(t){var e,n,r,i=Array.prototype.slice.call(t),o=M(i,4),a=o[0],d=o[1],u=o[2],c=o[3];if("string"!==typeof a)throw new TypeError("A text for parsing must be a string.");if(e=a,d&&"string"!==typeof d){if(!U(d))throw new Error("Invalid second argument: ".concat(d));u?(n=d,r=u):r=d}else c?(n=u,r=c):(n=void 0,r=u),d&&(n=F({defaultCountry:d},n));return{text:e,options:n,metadata:r}}var U=function(t){return"object"===j(t)};function V(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){H(t,e,n[e])}))}return t}function H(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W(t,e,n){e&&e.defaultCountry&&!Object(d["c"])(e.defaultCountry,n)&&(e=V({},e,{defaultCountry:void 0}));try{return I(t,e,n)}catch(r){if(!(r instanceof a))throw r}}function K(){var t=B(arguments),e=t.text,n=t.options,r=t.metadata;return W(e,n,r)}function Z(){return Object(r["b"])(K,arguments)}},"47ee":function(t,e,n){var r=n("c3a1"),i=n("9aa9"),o=n("355d");t.exports=function(t){var e=r(t),n=i.f;if(n){var a,d=n(t),u=o.f,c=0;while(d.length>c)u.call(t,a=d[c++])&&e.push(a)}return e}},"481b":function(t,e){t.exports={}},4883:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.colorNameToHex=e.isColorName=e.HexToRgba=e.ShadeColor=void 0;var r=function(t,e){var n=parseInt(t.substring(1,3),16),r=parseInt(t.substring(3,5),16),i=parseInt(t.substring(5,7),16);return n=parseInt(n*(100+e)/100),r=parseInt(r*(100+e)/100),i=parseInt(i*(100+e)/100),n=n<255?n:255,r=r<255?r:255,i=i<255?i:255,"#"+(1===n.toString(16).length?"0"+n.toString(16):n.toString(16))+(1===r.toString(16).length?"0"+r.toString(16):r.toString(16))+(1===i.toString(16).length?"0"+i.toString(16):i.toString(16))};e.ShadeColor=r;var i=function(t,e){var n;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(t))return 3===(n=t.substring(1).split("")).length&&(n=[n[0],n[0],n[1],n[1],n[2],n[2]]),n="0x".concat(n.join("")),"rgba(".concat([n>>16&255,n>>8&255,255&n].join(", "),", ").concat(e,")");throw new Error("Bad Hex")};e.HexToRgba=i;var o=function(t){if(!t)throw new Error("isColorName: No color");return!t.includes("#")};e.isColorName=o;var a=function(t){if(!t)throw new Error("colorNameToHex: No color");var e={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return void 0!==e[t.toLowerCase()]&&e[t.toLowerCase()]};e.colorNameToHex=a},"4a59":function(t,e,n){var r=n("9b43"),i=n("1fa8"),o=n("33a4"),a=n("cb7c"),d=n("9def"),u=n("27ee"),c={},s={};e=t.exports=function(t,e,n,f,l){var $,h,p,v,y=l?function(){return t}:u(t),m=r(n,f,e?2:1),g=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for($=d(t.length);$>g;g++)if(v=e?m(a(h=t[g])[0],h[1]):m(t[g]),v===c||v===s)return v}else for(p=y.call(t);!(h=p.next()).done;)if(v=i(p,m,h.value,e),v===c||v===s)return v};e.BREAK=c,e.RETURN=s},"4bc9":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("bc8e"),i=n("c5ff"),o=n("ec22");function a(t,e){var n=Object(r["a"])(t,e),i=n.nationalNumber,a=n.carrierCode;if(!d(t,i,e))return{nationalNumber:t};if(t.length!==i.length+(a?a.length:0)&&e.possibleLengths())switch(Object(o["a"])(i,e)){case"TOO_SHORT":case"INVALID_LENGTH":return{nationalNumber:t}}return{nationalNumber:i,carrierCode:a}}function d(t,e,n){return!(Object(i["a"])(t,n.nationalNumberPattern())&&!Object(i["a"])(e,n.nationalNumberPattern()))}},"4bf8":function(t,e,n){var r=n("be13");t.exports=function(t){return Object(r(t))}},"4c95":function(t,e,n){"use strict";var r=n("e53d"),i=n("584a"),o=n("d9f6"),a=n("8e60"),d=n("5168")("species");t.exports=function(t){var e="function"==typeof i[t]?i[t]:r[t];a&&e&&!e[d]&&o.f(e,d,{configurable:!0,get:function(){return this}})}},"4ee1":function(t,e,n){var r=n("5168")("iterator"),i=!1;try{var o=[7][r]();o["return"]=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(a){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],d=o[r]();d.next=function(){return{done:n=!0}},o[r]=function(){return d},t(o)}catch(a){}return n}},"50ed":function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},5147:function(t,e,n){var r=n("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(i){}}return!0}},5168:function(t,e,n){var r=n("dbdb")("wks"),i=n("62a0"),o=n("e53d").Symbol,a="function"==typeof o,d=t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))};d.store=r},"52a7":function(t,e){e.f={}.propertyIsEnumerable},"53e2":function(t,e,n){var r=n("07e3"),i=n("241e"),o=n("5559")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},"549b":function(t,e,n){"use strict";var r=n("d864"),i=n("63b6"),o=n("241e"),a=n("b0dc"),d=n("3702"),u=n("b447"),c=n("20fd"),s=n("7cd6");i(i.S+i.F*!n("4ee1")((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,f,l=o(t),$="function"==typeof this?this:Array,h=arguments.length,p=h>1?arguments[1]:void 0,v=void 0!==p,y=0,m=s(l);if(v&&(p=r(p,h>2?arguments[2]:void 0,2)),void 0==m||$==Array&&d(m))for(e=u(l.length),n=new $(e);e>y;y++)c(n,y,v?p(l[y],y):l[y]);else for(f=m.call(l),n=new $;!(i=f.next()).done;y++)c(n,y,v?a(f,p,[i.value,y],!0):i.value);return n.length=y,n}})},"551c":function(t,e,n){"use strict";var r,i,o,a,d=n("2d00"),u=n("7726"),c=n("9b43"),s=n("23c6"),f=n("5ca1"),l=n("d3f4"),$=n("d8e8"),h=n("f605"),p=n("4a59"),v=n("ebd6"),y=n("1991").set,m=n("8079")(),g=n("a5b8"),b=n("9c80"),_=n("a25f"),C=n("bcaa"),x="Promise",w=u.TypeError,N=u.process,O=N&&N.versions,S=O&&O.v8||"",P=u[x],A="process"==s(N),k=function(){},E=i=g.f,T=!!function(){try{var t=P.resolve(1),e=(t.constructor={})[n("2b4c")("species")]=function(t){t(k,k)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof e&&0!==S.indexOf("6.6")&&-1===_.indexOf("Chrome/66")}catch(r){}}(),I=function(t){var e;return!(!l(t)||"function"!=typeof(e=t.then))&&e},j=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,d=i?e.ok:e.fail,u=e.resolve,c=e.reject,s=e.domain;try{d?(i||(2==t._h&&M(t),t._h=1),!0===d?n=r:(s&&s.enter(),n=d(r),s&&(s.exit(),a=!0)),n===e.promise?c(w("Promise-chain cycle")):(o=I(n))?o.call(n,u,c):u(n)):c(r)}catch(f){s&&!a&&s.exit(),c(f)}};while(n.length>o)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&F(t)}))}},F=function(t){y.call(u,(function(){var e,n,r,i=t._v,o=L(t);if(o&&(e=b((function(){A?N.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=A||L(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},L=function(t){return 1!==t._h&&0===(t._a||t._c).length},M=function(t){y.call(u,(function(){var e;A?N.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})}))},D=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),j(e,!0))},R=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw w("Promise can't be resolved itself");(e=I(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,c(R,r,1),c(D,r,1))}catch(i){D.call(r,i)}})):(n._v=t,n._s=1,j(n,!1))}catch(r){D.call({_w:n,_d:!1},r)}}};T||(P=function(t){h(this,P,x,"_h"),$(t),r.call(this);try{t(c(R,this,1),c(D,this,1))}catch(e){D.call(this,e)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("dcbc")(P.prototype,{then:function(t,e){var n=E(v(this,P));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=A?N.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&j(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(R,t,1),this.reject=c(D,t,1)},g.f=E=function(t){return t===P||t===a?new o(t):i(t)}),f(f.G+f.W+f.F*!T,{Promise:P}),n("7f20")(P,x),n("7a56")(x),a=n("8378")[x],f(f.S+f.F*!T,x,{reject:function(t){var e=E(this),n=e.reject;return n(t),e.promise}}),f(f.S+f.F*(d||!T),x,{resolve:function(t){return C(d&&this===a?P:this,t)}}),f(f.S+f.F*!(T&&n("5cc5")((function(t){P.all(t)["catch"](k)}))),x,{all:function(t){var e=this,n=E(e),r=n.resolve,i=n.reject,o=b((function(){var n=[],o=0,a=1;p(t,!1,(function(t){var d=o++,u=!1;n.push(void 0),a++,e.resolve(t).then((function(t){u||(u=!0,n[d]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=E(e),r=n.reject,i=b((function(){p(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},5537:function(t,e,n){var r=n("8378"),i=n("7726"),o="__core-js_shared__",a=i[o]||(i[o]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},5559:function(t,e,n){var r=n("dbdb")("keys"),i=n("62a0");t.exports=function(t){return r[t]||(r[t]=i(t))}},"584a":function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},"5b4e":function(t,e,n){var r=n("36c3"),i=n("b447"),o=n("0fc9");t.exports=function(t){return function(e,n,a){var d,u=r(e),c=i(u.length),s=o(a,c);if(t&&n!=n){while(c>s)if(d=u[s++],d!=d)return!0}else for(;c>s;s++)if((t||s in u)&&u[s]===n)return t||s||0;return!t&&-1}}},"5c95":function(t,e,n){var r=n("35e8");t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},"5ca1":function(t,e,n){var r=n("7726"),i=n("8378"),o=n("32e9"),a=n("2aba"),d=n("9b43"),u="prototype",c=function(t,e,n){var s,f,l,$,h=t&c.F,p=t&c.G,v=t&c.S,y=t&c.P,m=t&c.B,g=p?r:v?r[e]||(r[e]={}):(r[e]||{})[u],b=p?i:i[e]||(i[e]={}),_=b[u]||(b[u]={});for(s in p&&(n=e),n)f=!h&&g&&void 0!==g[s],l=(f?g:n)[s],$=m&&f?d(l,r):y&&"function"==typeof l?d(Function.call,l):l,g&&a(g,s,l,t&c.U),b[s]!=l&&o(b,s,$),y&&_[s]!=l&&(_[s]=l)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},"5cc5":function(t,e,n){var r=n("2b4c")("iterator"),i=!1;try{var o=[7][r]();o["return"]=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(a){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],d=o[r]();d.next=function(){return{done:n=!0}},o[r]=function(){return d},t(o)}catch(a){}return n}},"5d58":function(t,e,n){t.exports=n("d8d6")},"5dbc":function(t,e,n){var r=n("d3f4"),i=n("8b97").set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},"5eda":function(t,e,n){var r=n("5ca1"),i=n("8378"),o=n("79e5");t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},"613b":function(t,e,n){var r=n("5537")("keys"),i=n("ca5a");t.exports=function(t){return r[t]||(r[t]=i(t))}},"626a":function(t,e,n){var r=n("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"62a0":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},"62b0":function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n("aa50"),i=n("f9be"),o=n("07f3"),a=n("f573");function d(t,e,n,d){if(!t)return{};if("+"!==t[0]){var u=Object(r["a"])(t,e,n,d);if(!u||u===t){if(e||n){var c=Object(i["a"])(t,e,n,d),s=c.countryCallingCode,f=c.number;if(s)return{countryCallingCode:s,number:f}}return{number:t}}t="+"+u}if("0"===t[1])return{};d=new o["a"](d);var l=2;while(l-1<=a["a"]&&l<=t.length){var $=t.slice(1,l);if(d.hasCallingCode($))return d.selectNumberingPlan($),{countryCallingCode:$,number:t.slice(l)};l++}return{}}},"63b6":function(t,e,n){var r=n("e53d"),i=n("584a"),o=n("d864"),a=n("35e8"),d=n("07e3"),u="prototype",c=function(t,e,n){var s,f,l,$=t&c.F,h=t&c.G,p=t&c.S,v=t&c.P,y=t&c.B,m=t&c.W,g=h?i:i[e]||(i[e]={}),b=g[u],_=h?r:p?r[e]:(r[e]||{})[u];for(s in h&&(n=e),n)f=!$&&_&&void 0!==_[s],f&&d(g,s)||(l=f?_[s]:n[s],g[s]=h&&"function"!=typeof _[s]?n[s]:y&&f?o(l,r):m&&_[s]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[u]=t[u],e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((g.virtual||(g.virtual={}))[s]=l,t&c.R&&b&&!b[s]&&a(b,s,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},6562:function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n("07f3"),i=n("aa6f"),o=n("c5ff"),a=n("da54");function d(t,e,n){if(e=e||{},n=new r["a"](n),!t.country)return!1;if(n.selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes())return void 0!==Object(a["a"])(t,e,n.metadata);var i=e.v2?t.nationalNumber:t.phone;return Object(o["a"])(i,n.nationalNumberPattern())}var u=n("1414"),c=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function s(t,e,n){var i=new r["a"](n);return i.selectNumberingPlan(t,e),i.defaultIDDPrefix()?i.defaultIDDPrefix():c.test(i.IDDPrefix())?i.IDDPrefix():void 0}var f=n("efcc");function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){$(t,e,n[e])}))}return t}function $(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h={formatExtension:function(t,e,n){return"".concat(t).concat(n.ext()).concat(e)}};function p(t,e,n,i){if(n=n?l({},h,n):h,i=new r["a"](i),t.country&&"001"!==t.country){if(!i.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));i.country(t.country)}else{if(!t.countryCallingCode)return t.phone||"";i.selectNumberingPlan(t.countryCallingCode)}var o,a=i.countryCallingCode(),d=n.v2?t.nationalNumber:t.phone;switch(e){case"NATIONAL":return d?(o=v(d,t.carrierCode,"NATIONAL",i,n),m(o,t.ext,i,n.formatExtension)):"";case"INTERNATIONAL":return d?(o=v(d,null,"INTERNATIONAL",i,n),o="+".concat(a," ").concat(o),m(o,t.ext,i,n.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(d);case"RFC3966":return Object(f["a"])({number:"+".concat(a).concat(d),ext:t.ext});case"IDD":if(!n.fromCountry)return;var u=g(d,t.carrierCode,a,n.fromCountry,i);return m(u,t.ext,i,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function v(t,e,n,r,i){var o=y(r.formats(),t);return o?Object(u["b"])(t,o,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!o.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix,carrierCode:e,metadata:r}):t}function y(t,e){var n=t,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var d=a;if(d.leadingDigitsPatterns().length>0){var u=d.leadingDigitsPatterns()[d.leadingDigitsPatterns().length-1];if(0!==e.search(u))continue}if(Object(o["a"])(e,d.pattern()))return d}}function m(t,e,n,r){return e?r(t,e,n):t}function g(t,e,n,i,o){var a=Object(r["b"])(i,o.metadata);if(a===n){var d=v(t,e,"NATIONAL",o);return"1"===n?n+" "+d:d}var u=s(i,void 0,o.metadata);if(u)return"".concat(u," ").concat(n," ").concat(v(t,null,"INTERNATIONAL",o))}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){_(t,e,n[e])}))}return t}function _(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function w(t,e,n){return e&&x(t.prototype,e),n&&x(t,n),t}var N=!1,O=function(){function t(e,n,i){if(C(this,t),!e)throw new TypeError("`country` or `countryCallingCode` not passed");if(!n)throw new TypeError("`nationalNumber` not passed");if(!i)throw new TypeError("`metadata` not passed");var o=new r["a"](i);S(e)?(this.country=e,o.country(e),e=o.countryCallingCode()):N&&o.isNonGeographicCallingCode(e)&&(this.country="001"),this.countryCallingCode=e,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.metadata=i}return w(t,[{key:"setExt",value:function(t){this.ext=t}},{key:"isPossible",value:function(){return Object(i["a"])(this,{v2:!0},this.metadata)}},{key:"isValid",value:function(){return d(this,{v2:!0},this.metadata)}},{key:"isNonGeographic",value:function(){var t=new r["a"](this.metadata);return t.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return Object(a["a"])(this,{v2:!0},this.metadata)}},{key:"format",value:function(t,e){return p(this,t,e?b({},e,{v2:!0}):{v2:!0},this.metadata)}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}]),t}(),S=function(t){return/^[A-Z]{2}$/.test(t)}},"656e":function(t,e,n){"use strict";var r=n("79aa");function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},6718:function(t,e,n){var r=n("e53d"),i=n("584a"),o=n("b8e3"),a=n("ccb9"),d=n("d9f6").f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||d(e,t,{value:a.f(t)})}},6762:function(t,e,n){"use strict";var r=n("5ca1"),i=n("c366")(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")("includes")},"67bb":function(t,e,n){t.exports=n("f921")},6821:function(t,e,n){var r=n("626a"),i=n("be13");t.exports=function(t){return r(i(t))}},"696e":function(t,e,n){n("c207"),n("1654"),n("6c1c"),n("24c5"),n("3c11"),n("43fc"),t.exports=n("584a").Promise},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"69d3":function(t,e,n){n("6718")("asyncIterator")},"6a99":function(t,e,n){var r=n("d3f4");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},"6abf":function(t,e,n){var r=n("e6f3"),i=n("1691").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},"6b4c":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"6b54":function(t,e,n){"use strict";n("3846");var r=n("cb7c"),i=n("0bfb"),o=n("9e1e"),a="toString",d=/./[a],u=function(t){n("2aba")(RegExp.prototype,a,t,!0)};n("79e5")((function(){return"/a/b"!=d.call({source:"a",flags:"b"})}))?u((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):d.name!=a&&u((function(){return d.call(this)}))},"6c1c":function(t,e,n){n("c367");for(var r=n("e53d"),i=n("35e8"),o=n("481b"),a=n("5168")("toStringTag"),d="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<d.length;u++){var c=d[u],s=r[c],f=s&&s.prototype;f&&!f[a]&&i(f,a,c),o[c]=o.Array}},"715d":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("07f3"),i=n("da54"),o=!1;function a(t,e,n){if(o&&n.isNonGeographicCallingCode(t))return"001";var r=n.getCountryCodesForCallingCode(t);return r?1===r.length?r[0]:d(r,e,n.metadata):void 0}function d(t,e,n){n=new r["a"](n);var o=t,a=Array.isArray(o),d=0;for(o=a?o:o[Symbol.iterator]();;){var u;if(a){if(d>=o.length)break;u=o[d++]}else{if(d=o.next(),d.done)break;u=d.value}var c=u;if(n.country(c),n.leadingDigits()){if(e&&0===e.search(n.leadingDigits()))return c}else if(Object(i["a"])({phone:e,country:c},void 0,n.metadata))return c}}},"71c1":function(t,e,n){var r=n("3a38"),i=n("25eb");t.exports=function(t){return function(e,n){var o,a,d=String(i(e)),u=r(n),c=d.length;return u<0||u>=c?t?"":void 0:(o=d.charCodeAt(u),o<55296||o>56319||u+1===c||(a=d.charCodeAt(u+1))<56320||a>57343?t?d.charAt(u):o:t?d.slice(u,u+2):a-56320+(o-55296<<10)+65536)}}},7333:function(t,e,n){"use strict";var r=n("9e1e"),i=n("0d58"),o=n("2621"),a=n("52a7"),d=n("4bf8"),u=n("626a"),c=Object.assign;t.exports=!c||n("79e5")((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){var n=d(t),c=arguments.length,s=1,f=o.f,l=a.f;while(c>s){var $,h=u(arguments[s++]),p=f?i(h).concat(f(h)):i(h),v=p.length,y=0;while(v>y)$=p[y++],r&&!l.call(h,$)||(n[$]=h[$])}return n}:c},7514:function(t,e,n){"use strict";var r=n("5ca1"),i=n("0a49")(5),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")(o)},"75fc":function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n("a745"),i=n.n(r);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t){if(i()(t))return o(t)}var d=n("67bb"),u=n.n(d),c=n("5d58"),s=n.n(c),f=n("774e"),l=n.n(f);function $(t){if("undefined"!==typeof u.a&&null!=t[s.a]||null!=t["@@iterator"])return l()(t)}function h(t,e){if(t){if("string"===typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?l()(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t){return a(t)||$(t)||h(t)||p()}},"765d":function(t,e,n){n("6718")("observable")},7726:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"774e":function(t,e,n){t.exports=n("d2d5")},"77f1":function(t,e,n){var r=n("4588"),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},"794b":function(t,e,n){t.exports=!n("8e60")&&!n("294c")((function(){return 7!=Object.defineProperty(n("1ec9")("div"),"a",{get:function(){return 7}}).a}))},"795b":function(t,e,n){t.exports=n("696e")},"79aa":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"7a56":function(t,e,n){"use strict";var r=n("7726"),i=n("86cc"),o=n("9e1e"),a=n("2b4c")("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},"7cd6":function(t,e,n){var r=n("40c3"),i=n("5168")("iterator"),o=n("481b");t.exports=n("584a").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},"7e81":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("3d4a"),i=n("6562");function o(t,e,n){if(e[t])return new i["a"](t,e[t],n)}function a(){return Object(r["b"])(o,arguments)}},"7e90":function(t,e,n){var r=n("d9f6"),i=n("e4ae"),o=n("c3a1");t.exports=n("8e60")?Object.defineProperties:function(t,e){i(t);var n,a=o(e),d=a.length,u=0;while(d>u)r.f(t,n=a[u++],e[n]);return t}},"7f20":function(t,e,n){var r=n("86cc").f,i=n("69a8"),o=n("2b4c")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},"7f7f":function(t,e,n){var r=n("86cc").f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n("9e1e")&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},8079:function(t,e,n){var r=n("7726"),i=n("1991").set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,d=r.Promise,u="process"==n("2d95")(a);t.exports=function(){var t,e,n,c=function(){var r,i;u&&(r=a.domain)&&r.exit();while(t){i=t.fn,t=t.next;try{i()}catch(o){throw t?n():e=void 0,o}}e=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(d&&d.resolve){var s=d.resolve(void 0);n=function(){s.then(c)}}else n=function(){i.call(r,c)};else{var f=!0,l=document.createTextNode("");new o(c).observe(l,{characterData:!0}),n=function(){l.data=f=!f}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},8378:function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},8436:function(t,e){t.exports=function(){}},"84f2":function(t,e){t.exports={}},"85f2":function(t,e,n){t.exports=n("454f")},"86cc":function(t,e,n){var r=n("cb7c"),i=n("c69a"),o=n("6a99"),a=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(d){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"8b97":function(t,e,n){var r=n("d3f4"),i=n("cb7c"),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n("9b43")(Function.call,n("11e9").f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(i){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},"8e60":function(t,e,n){t.exports=!n("294c")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"8e6e":function(t,e,n){var r=n("5ca1"),i=n("990b"),o=n("6821"),a=n("11e9"),d=n("f1ae");r(r.S,"Object",{getOwnPropertyDescriptors:function(t){var e,n,r=o(t),u=a.f,c=i(r),s={},f=0;while(c.length>f)n=u(r,e=c[f++]),void 0!==n&&d(s,e,n);return s}})},"8f60":function(t,e,n){"use strict";var r=n("a159"),i=n("aebd"),o=n("45f2"),a={};n("35e8")(a,n("5168")("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},9003:function(t,e,n){var r=n("6b4c");t.exports=Array.isArray||function(t){return"Array"==r(t)}},9093:function(t,e,n){var r=n("ce10"),i=n("e11e").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},9138:function(t,e,n){t.exports=n("35e8")},"96cf":function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",d=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(T){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),a=new A(r||[]);return o._invoke=N(t,n,a),o}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(T){return{type:"throw",arg:T}}}t.wrap=c;var f="suspendedStart",l="suspendedYield",$="executing",h="completed",p={};function v(){}function y(){}function m(){}var g={};u(g,o,(function(){return this}));var b=Object.getPrototypeOf,_=b&&b(b(k([])));_&&_!==n&&r.call(_,o)&&(g=_);var C=m.prototype=v.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(i,o,a,d){var u=s(t[i],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"===typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,d)}),(function(t){n("throw",t,a,d)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,d)}))}d(u.arg)}var i;function o(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}this._invoke=o}function N(t,e,n){var r=f;return function(i,o){if(r===$)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return E()}n.method=i,n.arg=o;while(1){var a=n.delegate;if(a){var d=O(a,n);if(d){if(d===p)continue;return d}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=$;var u=s(t,e,n);if("normal"===u.type){if(r=n.done?h:l,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}function O(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=s(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var n=t[o];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){while(++i<t.length)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:E}}function E(){return{value:e,done:!0}}return y.prototype=m,u(C,"constructor",m),u(m,"constructor",y),y.displayName=u(m,d,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,d,"GeneratorFunction")),t.prototype=Object.create(C),t},t.awrap=function(t){return{__await:t}},x(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new w(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(C),u(C,d,"Generator"),u(C,o,(function(){return this})),u(C,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){while(e.length){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return d.type="throw",d.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],d=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=r}catch(i){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},"990b":function(t,e,n){var r=n("9093"),i=n("2621"),o=n("cb7c"),a=n("7726").Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},"9aa9":function(t,e){e.f=Object.getOwnPropertySymbols},"9b43":function(t,e,n){var r=n("d8e8");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"9c6c":function(t,e,n){var r=n("2b4c")("unscopables"),i=Array.prototype;void 0==i[r]&&n("32e9")(i,r,{}),t.exports=function(t){i[r][t]=!0}},"9c80":function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(e){return{e:!0,v:e}}}},"9def":function(t,e,n){var r=n("4588"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},a159:function(t,e,n){var r=n("e4ae"),i=n("7e90"),o=n("1691"),a=n("5559")("IE_PROTO"),d=function(){},u="prototype",c=function(){var t,e=n("1ec9")("iframe"),r=o.length,i="<",a=">";e.style.display="none",n("32fc").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+a+"document.F=Object"+i+"/script"+a),t.close(),c=t.F;while(r--)delete c[u][o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(d[u]=r(t),n=new d,d[u]=null,n[a]=t):n=c(),void 0===e?n:i(n,e)}},a1de:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return f}));var r=n("f573"),i=n("f3ad"),o="["+r["e"]+"]{"+r["c"]+"}",a="["+r["d"]+"]{0,1}(?:["+r["f"]+"]*["+r["e"]+"]){3,}["+r["f"]+r["e"]+"]*",d=new RegExp("^["+r["d"]+"]{0,1}(?:["+r["f"]+"]*["+r["e"]+"]){1,2}$","i"),u=a+"(?:"+Object(i["a"])()+")?",c=new RegExp("^"+o+"$|^"+u+"$","i");function s(t){return t.length>=r["c"]&&c.test(t)}function f(t){return d.test(t)}},a22a:function(t,e,n){var r=n("d864"),i=n("b0dc"),o=n("3702"),a=n("e4ae"),d=n("b447"),u=n("7cd6"),c={},s={};e=t.exports=function(t,e,n,f,l){var $,h,p,v,y=l?function(){return t}:u(t),m=r(n,f,e?2:1),g=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for($=d(t.length);$>g;g++)if(v=e?m(a(h=t[g])[0],h[1]):m(t[g]),v===c||v===s)return v}else for(p=y.call(t);!(h=p.next()).done;)if(v=i(p,m,h.value,e),v===c||v===s)return v};e.BREAK=c,e.RETURN=s},a25f:function(t,e,n){var r=n("7726"),i=r.navigator;t.exports=i&&i.userAgent||""},a5b8:function(t,e,n){"use strict";var r=n("d8e8");function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},a745:function(t,e,n){t.exports=n("f410")},aa50:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("07f3"),i=n("f573"),o=new RegExp("(["+i["e"]+"])");function a(t,e,n,i){if(e){var a=new r["a"](i);a.selectNumberingPlan(e,n);var d=new RegExp(a.IDDPrefix());if(0===t.search(d)){t=t.slice(t.match(d)[0].length);var u=t.match(o);if(!(u&&null!=u[1]&&u[1].length>0&&"0"===u[1]))return t}}}},aa6f:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n("07f3"),i=n("ec22");function o(t,e,n){if(void 0===e&&(e={}),n=new r["a"](n),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}}if(n.possibleLengths())return a(t.phone||t.nationalNumber,n);if(t.countryCallingCode&&n.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function a(t,e){switch(Object(i["a"])(t,e)){case"IS_POSSIBLE":return!0;default:return!1}}},aa77:function(t,e,n){var r=n("5ca1"),i=n("be13"),o=n("79e5"),a=n("fdef"),d="["+a+"]",u="
",c=RegExp("^"+d+d+"*"),s=RegExp(d+d+"*$"),f=function(t,e,n){var i={},d=o((function(){return!!a[t]()||u[t]()!=u})),c=i[t]=d?e(l):a[t];n&&(i[n]=c),r(r.P+r.F*d,"String",i)},l=f.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(c,"")),2&e&&(t=t.replace(s,"")),t};t.exports=f},aae3:function(t,e,n){var r=n("d3f4"),i=n("2d95"),o=n("2b4c")("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},aba2:function(t,e,n){var r=n("e53d"),i=n("4178").set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,d=r.Promise,u="process"==n("6b4c")(a);t.exports=function(){var t,e,n,c=function(){var r,i;u&&(r=a.domain)&&r.exit();while(t){i=t.fn,t=t.next;try{i()}catch(o){throw t?n():e=void 0,o}}e=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(d&&d.resolve){var s=d.resolve(void 0);n=function(){s.then(c)}}else n=function(){i.call(r,c)};else{var f=!0,l=document.createTextNode("");new o(c).observe(l,{characterData:!0}),n=function(){l.data=f=!f}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},ac6a:function(t,e,n){for(var r=n("cadf"),i=n("0d58"),o=n("2aba"),a=n("7726"),d=n("32e9"),u=n("84f2"),c=n("2b4c"),s=c("iterator"),f=c("toStringTag"),l=u.Array,$={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i($),p=0;p<h.length;p++){var v,y=h[p],m=$[y],g=a[y],b=g&&g.prototype;if(b&&(b[s]||d(b,s,l),b[f]||d(b,f,y),u[y]=l,m))for(v in r)b[v]||o(b,v,r[v],!0)}},aebd:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},b0dc:function(t,e,n){var r=n("e4ae");t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(a){var o=t["return"];throw void 0!==o&&r(o.call(t)),a}}},b447:function(t,e,n){var r=n("3a38"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},b8e3:function(t,e){t.exports=!0},bc13:function(t,e,n){var r=n("e53d"),i=r.navigator;t.exports=i&&i.userAgent||""},bc8e:function(t,e,n){"use strict";function r(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var i,o,a,d=r.length-1,u=d>0&&r[d];if(e.nationalPrefixTransformRule()&&u)i=t.replace(n,e.nationalPrefixTransformRule()),d>1&&(o=r[1]);else{var c=r[0];i=t.slice(c.length),u&&(o=r[1])}if(u){var s=t.indexOf(r[1]),f=t.slice(0,s);f===e.numberingPlan.nationalPrefix()&&(a=e.numberingPlan.nationalPrefix())}else a=r[0];return{nationalNumber:i,nationalPrefix:a,carrierCode:o}}}return{nationalNumber:t}}n.d(e,"a",(function(){return r}))},bcaa:function(t,e,n){var r=n("cb7c"),i=n("d3f4"),o=n("a5b8");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t),a=n.resolve;return a(e),n.promise}},bd86:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("85f2"),i=n.n(r);function o(t,e,n){return e in t?i()(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},bf0b:function(t,e,n){var r=n("355d"),i=n("aebd"),o=n("36c3"),a=n("1bc3"),d=n("07e3"),u=n("794b"),c=Object.getOwnPropertyDescriptor;e.f=n("8e60")?c:function(t,e){if(t=o(t),e=a(e,!0),u)try{return c(t,e)}catch(n){}if(d(t,e))return i(!r.f.call(t,e),t[e])}},c207:function(t,e){},c366:function(t,e,n){var r=n("6821"),i=n("9def"),o=n("77f1");t.exports=function(t){return function(e,n,a){var d,u=r(e),c=i(u.length),s=o(a,c);if(t&&n!=n){while(c>s)if(d=u[s++],d!=d)return!0}else for(;c>s;s++)if((t||s in u)&&u[s]===n)return t||s||0;return!t&&-1}}},c367:function(t,e,n){"use strict";var r=n("8436"),i=n("50ed"),o=n("481b"),a=n("36c3");t.exports=n("30f1")(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},c3a1:function(t,e,n){var r=n("e6f3"),i=n("1691");t.exports=Object.keys||function(t){return r(t,i)}},c5f6:function(t,e,n){"use strict";var r=n("7726"),i=n("69a8"),o=n("2d95"),a=n("5dbc"),d=n("6a99"),u=n("79e5"),c=n("9093").f,s=n("11e9").f,f=n("86cc").f,l=n("aa77").trim,$="Number",h=r[$],p=h,v=h.prototype,y=o(n("2aeb")(v))==$,m="trim"in String.prototype,g=function(t){var e=d(t,!1);if("string"==typeof e&&e.length>2){e=m?e.trim():l(e,3);var n,r,i,o=e.charCodeAt(0);if(43===o||45===o){if(n=e.charCodeAt(2),88===n||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,u=e.slice(2),c=0,s=u.length;c<s;c++)if(a=u.charCodeAt(c),a<48||a>i)return NaN;return parseInt(u,r)}}return+e};if(!h(" 0o1")||!h("0b1")||h("+0x1")){h=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof h&&(y?u((function(){v.valueOf.call(n)})):o(n)!=$)?a(new p(g(e)),n,h):g(e)};for(var b,_=n("9e1e")?c(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),C=0;_.length>C;C++)i(p,b=_[C])&&!i(h,b)&&f(h,b,s(p,b));h.prototype=v,v.constructor=h,n("2aba")(r,$,h)}},c5ff:function(t,e,n){"use strict";function r(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}n.d(e,"a",(function(){return r}))},c69a:function(t,e,n){t.exports=!n("9e1e")&&!n("79e5")((function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a}))},c8a1:function(t,e,n){"use strict";n.d(e,"a",(function(){return mt}));var r=n("3d4a"),i=n("07f3"),o=n("6562");function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(){function t(e){var n=this,r=e.onCountryChange,i=e.onCallingCodeChange;a(this,t),c(this,"update",(function(t){for(var e=0,r=Object.keys(t);e<r.length;e++){var i=r[e];n[i]=t[i]}})),this.onCountryChange=r,this.onCallingCodeChange=i}return u(t,[{key:"reset",value:function(t,e){this.international=!1,this.IDDPrefix=void 0,this.missingPlus=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,e)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"initCountryAndCallingCode",value:function(t,e){this.setCountry(t),this.setCallingCode(e)}},{key:"setCountry",value:function(t){this.country=t,this.onCountryChange(t)}},{key:"setCallingCode",value:function(t){return this.callingCode=t,this.onCallingCodeChange(this.country,t)}},{key:"startInternationalNumber",value:function(){this.international=!0,this.initCountryAndCallingCode()}},{key:"appendDigits",value:function(t){this.digits+=t}},{key:"appendNationalSignificantNumberDigits",value:function(t){this.nationalSignificantNumber+=t}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}]),t}(),f="x",l=new RegExp(f);function $(t,e){if(e<1)return"";var n="";while(e>1)1&e&&(n+=t),e>>=1,t+=t;return n+t}function h(t,e){return")"===t[e]&&e++,p(t.slice(0,e))}function p(t){var e=[],n=0;while(n<t.length)"("===t[n]?e.push(n):")"===t[n]&&e.pop(),n++;var r=0,i="";e.push(t.length);for(var o=0,a=e;o<a.length;o++){var d=a[o];i+=t.slice(r,d),r=d+1}return i}function v(t,e,n){var r=n.split(""),i=Array.isArray(r),o=0;for(r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}var d=a;if(t.slice(e+1).search(l)<0)return;e=t.search(l),t=t.replace(l,d)}return[t,e]}var y=n("ec22"),m=n("2c3f"),g=n("1414");function b(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix,a=new RegExp("^(?:".concat(e.pattern(),")$"));if(a.test(t.nationalSignificantNumber))return C(t,e,{metadata:r,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:o})}function _(t,e){return"IS_POSSIBLE"===Object(y["a"])(t,e)}function C(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix;t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode;if(i(e)){var a=x(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:o,metadata:r});if(a)return a}return x(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:o,metadata:r})}function x(t,e,n){var r=n.metadata,i=n.useNationalPrefixFormattingRule,o=n.getSeparatorAfterNationalPrefix,a=Object(g["b"])(t.nationalSignificantNumber,e,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:i,metadata:r});if(i||(t.nationalPrefix?a=t.nationalPrefix+o(e)+a:t.complexPrefixBeforeNationalSignificantNumber&&(a=t.complexPrefixBeforeNationalSignificantNumber+" "+a)),w(a,t))return a}function w(t,e){return Object(m["a"])(t)===e.getNationalDigits()}var N=n("f573"),O=n("3157");function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function A(t,e,n){return e&&P(t.prototype,e),n&&P(t,n),t}function k(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var E="9",T=15,I=$(E,T),j=/[- ]/,F=!0,L=F&&function(){return/\[([^\[\]])*\]/g},M=F&&function(){return/\d(?=[^,}][^,}])/g},D=new RegExp("^["+N["f"]+"]*(\\$\\d["+N["f"]+"]*)+$"),R=3,G=function(){function t(e){var n=this,r=(e.state,e.metadata);S(this,t),k(this,"getSeparatorAfterNationalPrefix",(function(t){return n.isNANP||t&&t.nationalPrefixFormattingRule()&&j.test(t.nationalPrefixFormattingRule())?" ":""})),k(this,"shouldTryNationalPrefixFormattingRule",(function(t,e){var n=e.international,r=e.nationalPrefix;if(t.nationalPrefixFormattingRule()){var i=t.usesNationalPrefix();if(i&&r||!i&&!n)return!0}})),this.metadata=r,this.resetFormat()}return A(t,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(t,e){this.resetFormat(),t?(this.isNANP="1"===t.callingCode(),this.matchingFormats=t.formats(),e.nationalSignificantNumber&&this.narrowDownMatchingFormats(e)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(t,e){var n=this;if(_(e.nationalSignificantNumber,this.metadata)){var r=this.matchingFormats,i=Array.isArray(r),o=0;for(r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}var d=a,u=b(e,d,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(t){return n.shouldTryNationalPrefixFormattingRule(t,{international:e.international,nationalPrefix:e.nationalPrefix})},getSeparatorAfterNationalPrefix:this.getSeparatorAfterNationalPrefix});if(u)return this.resetFormat(),this.chosenFormat=d,this.setNationalNumberTemplate(u.replace(/\d/g,f),e),this.populatedNationalNumberTemplate=u,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(f),u}}return this.formatNationalNumberWithNextDigits(t,e)}},{key:"formatNationalNumberWithNextDigits",value:function(t,e){var n=this.chosenFormat,r=this.chooseFormat(e);if(r)return r===n?this.formatNextNationalNumberDigits(t):this.formatNextNationalNumberDigits(e.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(t){var e=this,n=t.nationalSignificantNumber,r=t.nationalPrefix,i=t.international,o=n,a=o.length-R;a<0&&(a=0),this.matchingFormats=this.matchingFormats.filter((function(t){return e.formatSuits(t,i,r)&&e.formatMatches(t,o,a)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(t,e,n){return!(n&&!t.usesNationalPrefix()&&!t.nationalPrefixIsOptionalWhenFormattingInNationalFormat())&&!(!e&&!n&&t.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(t,e,n){var r=t.leadingDigitsPatterns().length;if(0===r)return!0;if(e.length<R)return!0;n=Math.min(n,r-1);var i=t.leadingDigitsPatterns()[n];return new RegExp("^(".concat(i,")")).test(e)}},{key:"getFormatFormat",value:function(t,e){return e?t.internationalFormat():t.format()}},{key:"chooseFormat",value:function(t){var e=this,n=function(){if(i){if(o>=r.length)return"break";a=r[o++]}else{if(o=r.next(),o.done)return"break";a=o.value}var n=a;return e.chosenFormat===n?"break":D.test(e.getFormatFormat(n,t.international))?e.createTemplateForFormat(n,t)?(e.chosenFormat=n,"break"):(e.matchingFormats=e.matchingFormats.filter((function(t){return t!==n})),"continue"):"continue"};var r=this.matchingFormats.slice(),i=Array.isArray(r),o=0;t:for(r=i?r:r[Symbol.iterator]();;){var a,d=n();switch(d){case"break":break t;case"continue":continue}}return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(t,e){if(!(F&&t.pattern().indexOf("|")>=0)){var n=this.getTemplateForFormat(t,e);return n?(this.setNationalNumberTemplate(n,e),!0):void 0}}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(t,e){var n=t.IDDPrefix,r=t.missingPlus;return n?e&&!1===e.spacing?n:n+" ":r?"":"+"}},{key:"getTemplate",value:function(t){if(this.template){var e=-1,n=0,r=t.international?this.getInternationalPrefixBeforeCountryCallingCode(t,{spacing:!1}):"";while(n<r.length+t.getDigitsWithoutInternationalPrefix().length)e=this.template.indexOf(f,e+1),n++;return h(this.template,e+1)}}},{key:"setNationalNumberTemplate",value:function(t,e){this.nationalNumberTemplate=t,this.populatedNationalNumberTemplate=t,this.populatedNationalNumberTemplatePosition=-1,e.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(e).replace(/[\d\+]/g,f)+$(f,e.callingCode.length)+" "+t:this.template=t}},{key:"getTemplateForFormat",value:function(t,e){var n=e.nationalSignificantNumber,r=e.international,i=e.nationalPrefix,o=e.complexPrefixBeforeNationalSignificantNumber,a=t.pattern();F&&(a=a.replace(L(),"\\d").replace(M(),"\\d"));var d=I.match(a)[0];if(!(n.length>d.length)){var u=new RegExp("^"+a+"$"),c=n.replace(/\d/g,E);u.test(c)&&(d=c);var s,l=this.getFormatFormat(t,r);if(this.shouldTryNationalPrefixFormattingRule(t,{international:r,nationalPrefix:i})){var h=l.replace(g["a"],t.nationalPrefixFormattingRule());if(Object(m["a"])(t.nationalPrefixFormattingRule())===(i||"")+Object(m["a"])("$1")&&(l=h,s=!0,i)){var p=i.length;while(p>0)l=l.replace(/\d/,f),p--}}var v=d.replace(new RegExp(a),l).replace(new RegExp(E,"g"),f);return s||(o?v=$(f,o.length)+" "+v:i&&(v=$(f,i.length)+this.getSeparatorAfterNationalPrefix(t)+v)),r&&(v=Object(O["a"])(v)),v}}},{key:"formatNextNationalNumberDigits",value:function(t){var e=v(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(e)return this.populatedNationalNumberTemplate=e[0],this.populatedNationalNumberTemplatePosition=e[1],h(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}}]),t}(),B=n("62b0"),U=n("f9be"),V=n("bc8e"),H=n("aa50");function W(t,e){return Y(t)||Z(t,e)||K()}function K(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Z(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,d=t[Symbol.iterator]();!(r=(a=d.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(u){i=!0,o=u}finally{try{r||null==d["return"]||d["return"]()}finally{if(i)throw o}}return n}function Y(t){if(Array.isArray(t))return t}function J(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function X(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function z(t,e,n){return e&&X(t.prototype,e),n&&X(t,n),t}var q="["+N["f"]+N["e"]+"]+",Q=new RegExp("^"+q+"$","i"),tt="(?:["+N["d"]+"]["+N["f"]+N["e"]+"]*|["+N["f"]+N["e"]+"]+)",et=new RegExp("[^"+N["f"]+N["e"]+"]+.*$"),nt=/[^\d\[\]]/,rt=function(){function t(e){var n=e.defaultCountry,r=e.defaultCallingCode,i=e.metadata,o=e.onNationalSignificantNumberChange;J(this,t),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=i,this.onNationalSignificantNumberChange=o}return z(t,[{key:"input",value:function(t,e){var n,r=at(t),i=W(r,2),o=i[0],a=i[1],d=Object(m["a"])(o);return a&&(e.digits||(e.startInternationalNumber(),d||(n=!0))),d&&this.inputDigits(d,e),{digits:d,justLeadingPlus:n}}},{key:"inputDigits",value:function(t,e){var n=e.digits,r=n.length<3&&n.length+t.length>=3;if(e.appendDigits(t),r&&this.extractIddPrefix(e),this.isWaitingForCountryCallingCode(e)){if(!this.extractCountryCallingCode(e))return}else e.appendNationalSignificantNumberDigits(t);e.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(e.getNationalDigits(),e.update)}},{key:"isWaitingForCountryCallingCode",value:function(t){var e=t.international,n=t.callingCode;return e&&!n}},{key:"extractCountryCallingCode",value:function(t){var e=Object(B["a"])("+"+t.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=e.countryCallingCode,r=e.number;if(n)return t.setCallingCode(n),t.update({nationalSignificantNumber:r}),!0}},{key:"reset",value:function(t){if(t){this.hasSelectedNumberingPlan=!0;var e=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=e&&nt.test(e)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(t,e){if(this.hasSelectedNumberingPlan){var n=Object(V["a"])(t,this.metadata),r=n.nationalPrefix,i=n.nationalNumber,o=n.carrierCode;if(i!==t)return this.onExtractedNationalNumber(r,o,i,t,e),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(t,e,n){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(t,n);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var r=Object(V["a"])(t,this.metadata),i=r.nationalPrefix,o=r.nationalNumber,a=r.carrierCode;if(o!==e)return this.onExtractedNationalNumber(i,a,o,t,n),!0}}},{key:"onExtractedNationalNumber",value:function(t,e,n,r,i){var o,a,d=r.lastIndexOf(n);if(d>=0&&d===r.length-n.length){a=!0;var u=r.slice(0,d);u!==t&&(o=u)}i({nationalPrefix:t,carrierCode:e,nationalSignificantNumber:n,nationalSignificantNumberMatchesInput:a,complexPrefixBeforeNationalSignificantNumber:o}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(t){return!!this.extractAnotherNationalSignificantNumber(t.getNationalDigits(),t.nationalSignificantNumber,t.update)||(this.extractIddPrefix(t)||this.fixMissingPlus(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):void 0)}},{key:"extractIddPrefix",value:function(t){var e=t.international,n=t.IDDPrefix,r=t.digits;t.nationalSignificantNumber;if(!e&&!n){var i=Object(H["a"])(r,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==i&&i!==r?(t.update({IDDPrefix:r.slice(0,r.length-i.length)}),this.startInternationalNumber(t),!0):void 0}}},{key:"fixMissingPlus",value:function(t){if(!t.international){var e=Object(U["a"])(t.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=e.countryCallingCode;e.number;if(n)return t.update({missingPlus:!0}),this.startInternationalNumber(t),!0}}},{key:"startInternationalNumber",value:function(t){t.startInternationalNumber(),t.nationalSignificantNumber&&(t.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(t){this.extractCountryCallingCode(t)&&this.extractNationalSignificantNumber(t.getNationalDigits(),t.update)}}]),t}();function it(t){var e,n=t.search(tt);if(!(n<0))return t=t.slice(n),"+"===t[0]&&(e=!0,t=t.slice("+".length)),t=t.replace(et,""),e&&(t="+"+t),t}function ot(t){var e=it(t)||"";return"+"===e[0]?[e.slice("+".length),!0]:[e]}function at(t){var e=ot(t),n=W(e,2),r=n[0],i=n[1];return Q.test(r)||(r=""),[r,i]}var dt=n("715d");function ut(t){return ut="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function ct(t,e){return lt(t)||ft(t,e)||st()}function st(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function ft(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,d=t[Symbol.iterator]();!(r=(a=d.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(u){i=!0,o=u}finally{try{r||null==d["return"]||d["return"]()}finally{if(i)throw o}}return n}function lt(t){if(Array.isArray(t))return t}function $t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pt(t,e,n){return e&&ht(t.prototype,e),n&&ht(t,n),t}var vt=!1,yt=function(){function t(e,n){$t(this,t),this.metadata=new i["a"](n);var r=this.getCountryAndCallingCode(e),o=ct(r,2),a=o[0],d=o[1];this.defaultCountry=a,this.defaultCallingCode=d,this.reset()}return pt(t,[{key:"getCountryAndCallingCode",value:function(t){var e,n;return t&&("object"===ut(t)?(e=t.defaultCountry,n=t.defaultCallingCode):e=t),e&&!this.metadata.hasCountry(e)&&(e=void 0),n&&vt&&this.metadata.isNonGeographicCallingCode(n)&&(e="001"),[e,n]}},{key:"input",value:function(t){var e=this.parser.input(t,this.state),n=e.digits,r=e.justLeadingPlus;if(r)this.formattedOutput="+";else if(n){var i;if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(i=this.formatter.format(n,this.state)),void 0===i&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var o=this.state.getNationalDigits();o&&(i=this.formatter.format(o,this.state))}this.formattedOutput=i?this.getFullNumber(i):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var t=this;return this.state=new s({onCountryChange:function(e){t.country=e},onCallingCodeChange:function(e,n){t.metadata.selectNumberingPlan(e,n),t.formatter.reset(t.metadata.numberingPlan,t.state),t.parser.reset(t.metadata.numberingPlan)}}),this.formatter=new G({state:this.state,metadata:this.metadata}),this.parser=new rt({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){t.determineTheCountryIfNeeded(),t.formatter.reset(t.metadata.numberingPlan,t.state)}}),this.state.reset(this.defaultCountry,this.defaultCallingCode),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var t=this.state,e=t.digits,n=t.country;if(e){var r=n;return vt&&"001"===r&&(r=void 0),r}}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(t){var e=this;if(this.isInternational()){var n=function(t){return e.formatter.getInternationalPrefixBeforeCountryCallingCode(e.state,{spacing:!!t})+t},r=this.state.callingCode;return n(r?t?"".concat(r," ").concat(t):r:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return t}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var t=this.state,e=t.nationalSignificantNumber,n=t.complexPrefixBeforeNationalSignificantNumber,r=t.nationalPrefix,i=e,o=n||r;return o&&(i=o+i),i}},{key:"getNonFormattedNumber",value:function(){var t=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(t?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var t=this.getNonFormattedNumber();if(t)return t.replace(/[\+\d]/g,f)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var t=this.state.callingCode,e=this.metadata.getCountryCodesForCallingCode(t);return e&&e.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(Object(dt["a"])(this.isInternational()?this.state.callingCode:this.defaultCallingCode,this.state.nationalSignificantNumber,this.metadata))}},{key:"getNumber",value:function(){var t=this.state,e=t.nationalSignificantNumber,n=t.carrierCode;if(this.isInternational()){if(!this.state.callingCode)return}else if(!this.state.country&&!this.defaultCallingCode)return;if(e){var r=this.getCountry(),i=this.getCountryCallingCode()||this.defaultCallingCode,a=new o["a"](r||i,e,this.metadata.metadata);return n&&(a.carrierCode=n),a}}},{key:"isPossible",value:function(){var t=this.getNumber();return!!t&&t.isPossible()}},{key:"isValid",value:function(){var t=this.getNumber();return!!t&&t.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),t}();function mt(t){return yt.call(this,t,r["a"])}mt.prototype=Object.create(yt.prototype,{}),mt.prototype.constructor=mt},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},ca5a:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},cadf:function(t,e,n){"use strict";var r=n("9c6c"),i=n("d53b"),o=n("84f2"),a=n("6821");t.exports=n("01f9")(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},cb7c:function(t,e,n){var r=n("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},ccb9:function(t,e,n){e.f=n("5168")},cd1c:function(t,e,n){var r=n("e853");t.exports=function(t,e){return new(r(t))(e)}},cd78:function(t,e,n){var r=n("e4ae"),i=n("f772"),o=n("656e");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t),a=n.resolve;return a(e),n.promise}},ce10:function(t,e,n){var r=n("69a8"),i=n("6821"),o=n("c366")(!1),a=n("613b")("IE_PROTO");t.exports=function(t,e){var n,d=i(t),u=0,c=[];for(n in d)n!=a&&r(d,n)&&c.push(n);while(e.length>u)r(d,n=e[u++])&&(~o(c,n)||c.push(n));return c}},d2c8:function(t,e,n){var r=n("aae3"),i=n("be13");t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},d2d5:function(t,e,n){n("1654"),n("549b"),t.exports=n("584a").Array.from},d391:function(t){t.exports=JSON.parse('{"AC":"40123","AD":"312345","AE":"501234567","AF":"701234567","AG":"2684641234","AI":"2642351234","AL":"672123456","AM":"77123456","AO":"923123456","AR":"91123456789","AS":"6847331234","AT":"664123456","AU":"412345678","AW":"5601234","AX":"412345678","AZ":"401234567","BA":"61123456","BB":"2462501234","BD":"1812345678","BE":"470123456","BF":"70123456","BG":"48123456","BH":"36001234","BI":"79561234","BJ":"90011234","BL":"690001234","BM":"4413701234","BN":"7123456","BO":"71234567","BQ":"3181234","BR":"11961234567","BS":"2423591234","BT":"17123456","BW":"71123456","BY":"294911911","BZ":"6221234","CA":"5062345678","CC":"412345678","CD":"991234567","CF":"70012345","CG":"061234567","CH":"781234567","CI":"0123456789","CK":"71234","CL":"221234567","CM":"671234567","CN":"13123456789","CO":"3211234567","CR":"83123456","CU":"51234567","CV":"9911234","CW":"95181234","CX":"412345678","CY":"96123456","CZ":"601123456","DE":"15123456789","DJ":"77831001","DK":"32123456","DM":"7672251234","DO":"8092345678","DZ":"551234567","EC":"991234567","EE":"51234567","EG":"1001234567","EH":"650123456","ER":"7123456","ES":"612345678","ET":"911234567","FI":"412345678","FJ":"7012345","FK":"51234","FM":"3501234","FO":"211234","FR":"612345678","GA":"06031234","GB":"7400123456","GD":"4734031234","GE":"555123456","GF":"694201234","GG":"7781123456","GH":"231234567","GI":"57123456","GL":"221234","GM":"3012345","GN":"601123456","GP":"690001234","GQ":"222123456","GR":"6912345678","GT":"51234567","GU":"6713001234","GW":"955012345","GY":"6091234","HK":"51234567","HN":"91234567","HR":"921234567","HT":"34101234","HU":"201234567","ID":"812345678","IE":"850123456","IL":"502345678","IM":"7924123456","IN":"8123456789","IO":"3801234","IQ":"7912345678","IR":"9123456789","IS":"6111234","IT":"3123456789","JE":"7797712345","JM":"8762101234","JO":"790123456","JP":"9012345678","KE":"712123456","KG":"700123456","KH":"91234567","KI":"72001234","KM":"3212345","KN":"8697652917","KP":"1921234567","KR":"1020000000","KW":"50012345","KY":"3453231234","KZ":"7710009998","LA":"2023123456","LB":"71123456","LC":"7582845678","LI":"660234567","LK":"712345678","LR":"770123456","LS":"50123456","LT":"61234567","LU":"628123456","LV":"21234567","LY":"912345678","MA":"650123456","MC":"612345678","MD":"62112345","ME":"67622901","MF":"690001234","MG":"321234567","MH":"2351234","MK":"72345678","ML":"65012345","MM":"92123456","MN":"88123456","MO":"66123456","MP":"6702345678","MQ":"696201234","MR":"22123456","MS":"6644923456","MT":"96961234","MU":"52512345","MV":"7712345","MW":"991234567","MX":"12221234567","MY":"123456789","MZ":"821234567","NA":"811234567","NC":"751234","NE":"93123456","NF":"381234","NG":"8021234567","NI":"81234567","NL":"612345678","NO":"40612345","NP":"9841234567","NR":"5551234","NU":"8884012","NZ":"211234567","OM":"92123456","PA":"61234567","PE":"912345678","PF":"87123456","PG":"70123456","PH":"9051234567","PK":"3012345678","PL":"512345678","PM":"551234","PR":"7872345678","PS":"599123456","PT":"912345678","PW":"6201234","PY":"961456789","QA":"33123456","RE":"692123456","RO":"712034567","RS":"601234567","RU":"9123456789","RW":"720123456","SA":"512345678","SB":"7421234","SC":"2510123","SD":"911231234","SE":"701234567","SG":"81234567","SH":"51234","SI":"31234567","SJ":"41234567","SK":"912123456","SL":"25123456","SM":"66661212","SN":"701234567","SO":"71123456","SR":"7412345","SS":"977123456","ST":"9812345","SV":"70123456","SX":"7215205678","SY":"944567890","SZ":"76123456","TA":"8999","TC":"6492311234","TD":"63012345","TG":"90112345","TH":"812345678","TJ":"917123456","TK":"7290","TL":"77212345","TM":"66123456","TN":"20123456","TO":"7715123","TR":"5012345678","TT":"8682911234","TV":"901234","TW":"912345678","TZ":"621234567","UA":"501234567","UG":"712345678","US":"2015550123","UY":"94231234","UZ":"912345678","VA":"3123456789","VC":"7844301234","VE":"4121234567","VG":"2843001234","VI":"3406421234","VN":"912345678","VU":"5912345","WF":"821234","WS":"7212345","XK":"43201234","YE":"712345678","YT":"639012345","ZA":"711234567","ZM":"955123456","ZW":"712345678"}')},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d53b:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},d864:function(t,e,n){var r=n("79aa");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},d8d6:function(t,e,n){n("1654"),n("6c1c"),t.exports=n("ccb9").f("iterator")},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},d9f6:function(t,e,n){var r=n("e4ae"),i=n("794b"),o=n("1bc3"),a=Object.defineProperty;e.f=n("8e60")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(d){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},da54:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("07f3"),i=n("c5ff"),o=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function a(t,e,n){if(e=e||{},t.country){n=new r["a"](n),n.selectNumberingPlan(t.country,t.countryCallingCode);var a=e.v2?t.nationalNumber:t.phone;if(Object(i["a"])(a,n.nationalNumberPattern())){if(d(a,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?d(a,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var u=0,c=o;u<c.length;u++){var s=c[u];if(d(a,s,n))return s}}}}function d(t,e,n){return e=n.type(e),!(!e||!e.pattern())&&(!(e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0)&&Object(i["a"])(t,e.pattern()))}},dbdb:function(t,e,n){var r=n("584a"),i=n("e53d"),o="__core-js_shared__",a=i[o]||(i[o]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("b8e3")?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},dcbc:function(t,e,n){var r=n("2aba");t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},e11e:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},e4ae:function(t,e,n){var r=n("f772");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},e53d:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},e6f3:function(t,e,n){var r=n("07e3"),i=n("36c3"),o=n("5b4e")(!1),a=n("5559")("IE_PROTO");t.exports=function(t,e){var n,d=i(t),u=0,c=[];for(n in d)n!=a&&r(d,n)&&c.push(n);while(e.length>u)r(d,n=e[u++])&&(~o(c,n)||c.push(n));return c}},e853:function(t,e,n){var r=n("d3f4"),i=n("1169"),o=n("2b4c")("species");t.exports=function(t){var e;return i(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&(e=e[o],null===e&&(e=void 0))),void 0===e?Array:e}},ebd6:function(t,e,n){var r=n("cb7c"),i=n("d8e8"),o=n("2b4c")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},ebfd:function(t,e,n){var r=n("62a0")("meta"),i=n("f772"),o=n("07e3"),a=n("d9f6").f,d=0,u=Object.isExtensible||function(){return!0},c=!n("294c")((function(){return u(Object.preventExtensions({}))})),s=function(t){a(t,r,{value:{i:"O"+ ++d,w:{}}})},f=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!u(t))return"F";if(!e)return"E";s(t)}return t[r].i},l=function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;s(t)}return t[r].w},$=function(t){return c&&h.NEED&&u(t)&&!o(t,r)&&s(t),t},h=t.exports={KEY:r,NEED:!1,fastKey:f,getWeak:l,onFreeze:$}},ec22:function(t,e,n){"use strict";function r(t,e){var n=t.slice(),r=e,i=Array.isArray(r),o=0;for(r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}var d=a;t.indexOf(d)<0&&n.push(d)}return n.sort((function(t,e){return t-e}))}function i(t,e){return o(t,void 0,e)}function o(t,e,n){var i=n.type(e),a=i&&i.possibleLengths()||n.possibleLengths();if(!a)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===e){if(!n.type("FIXED_LINE"))return o(t,"MOBILE",n);var d=n.type("MOBILE");d&&(a=r(a,d.possibleLengths()))}else if(e&&!i)return"INVALID_LENGTH";var u=t.length,c=a[0];return c===u?"IS_POSSIBLE":c>u?"TOO_SHORT":a[a.length-1]<u?"TOO_LONG":a.indexOf(u,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}n.d(e,"a",(function(){return i}))},efcc:function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return c}));var r=n("a1de");function i(t,e){return d(t)||a(t,e)||o()}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function a(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,d=t[Symbol.iterator]();!(r=(a=d.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(u){i=!0,o=u}finally{try{r||null==d["return"]||d["return"]()}finally{if(i)throw o}}return n}function d(t){if(Array.isArray(t))return t}function u(t){var e,n;t=t.replace(/^tel:/,"tel=");var o=t.split(";"),a=Array.isArray(o),d=0;for(o=a?o:o[Symbol.iterator]();;){var u;if(a){if(d>=o.length)break;u=o[d++]}else{if(d=o.next(),d.done)break;u=d.value}var c=u,s=c.split("="),f=i(s,2),l=f[0],$=f[1];switch(l){case"tel":e=$;break;case"ext":n=$;break;case"phone-context":"+"===$[0]&&(e=$+e);break}}if(!Object(r["a"])(e))return{};var h={number:e};return n&&(h.ext=n),h}function c(t){var e=t.number,n=t.ext;if(!e)return"";if("+"!==e[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}},f1ae:function(t,e,n){"use strict";var r=n("86cc"),i=n("4630");t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},f201:function(t,e,n){var r=n("e4ae"),i=n("79aa"),o=n("5168")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},f3ad:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("f573"),i=";ext=",o=function(t){return"([".concat(r["e"],"]{1,").concat(t,"})")};function a(t){var e="20",n="15",r="9",a="6",d="[ \\t,]*",u="[:\\..]?[ \\t,-]*",c="#?",s="(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)",f="(?:[xx##~~]|int|int)",l="[- ]+",$="[ \\t]*",h="(?:,{2}|;)",p=i+o(e),v=d+s+u+o(e)+c,y=d+f+u+o(r)+c,m=l+o(a)+"#",g=$+h+u+o(n)+c,b=$+"(?:,)+"+u+o(r)+c;return p+"|"+v+"|"+y+"|"+m+"|"+g+"|"+b}},f410:function(t,e,n){n("1af6"),t.exports=n("584a").Array.isArray},f559:function(t,e,n){"use strict";var r=n("5ca1"),i=n("9def"),o=n("d2c8"),a="startsWith",d=""[a];r(r.P+r.F*n("5147")(a),"String",{startsWith:function(t){var e=o(this,t,a),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return d?d.call(e,r,n):e.slice(n,n+r.length)===r}})},f573:function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"f",(function(){return $})),n.d(e,"d",(function(){return h}));var r=2,i=17,o=3,a="0-90-9٠-٩۰-۹",d="-‐-―−ー-",u="//",c="..",s=" ",f="()()[]\\[\\]",l="~⁓∼~",$="".concat(d).concat(u).concat(c).concat(s).concat(f).concat(l),h="++"},f605:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},f751:function(t,e,n){var r=n("5ca1");r(r.S+r.F,"Object",{assign:n("7333")})},f772:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},f921:function(t,e,n){n("014b"),n("c207"),n("69d3"),n("765d"),t.exports=n("584a").Symbol},f9be:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n("07f3"),i=n("c5ff"),o=n("4bc9"),a=n("ec22");function d(t,e,n,d){var u=e?Object(r["b"])(e,d):n;if(0===t.indexOf(u)){d=new r["a"](d),d.selectNumberingPlan(e,n);var c=t.slice(u.length),s=Object(o["a"])(c,d),f=s.nationalNumber,l=Object(o["a"])(t,d),$=l.nationalNumber;if(!Object(i["a"])($,d.nationalNumberPattern())&&Object(i["a"])(f,d.nationalNumberPattern())||"TOO_LONG"===Object(a["a"])($,d))return{countryCallingCode:u,number:c}}return{number:t}}},fa5b:function(t,e,n){t.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(t,e,n){var r=n("7726").document;t.exports=r&&r.documentElement},fdef:function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"}}]);
//# sourceMappingURL=chunk-vendors.87ec3995.js.map
|
// Currently selected document or discussion
var current;
// All private discussions for this user
var discussions = [ ];
// All private documents for this user
var documents = [ ];
// Currently logged in user
var user;
// A set of users we can select as collaborators on a private discussion
var users = [ ];
// Create a new (empty) discussion and display it.
function createDiscussion() {
current = {
html : "",
subject : ""
};
console.log("createDiscussion() = " + JSON.stringify(current));
showNewDiscussion();
}
// Create a new (empty) document and display it.
function createDocument() {
current = {
html : "",
subject : "",
userURI : [ "foo" ]
};
console.log("createDocument() = " + JSON.stringify(current));
showNewDocument();
}
// Delete current discussion
function deleteDiscussion() {
console.log("deleteDiscussion() started");
var isDeleteSupported = current.resources.self && $.inArray('DELETE', current.resources.self.allowed) != -1;
if (!isDeleteSupported) {
alert("You are not allowed to delete this discussion");
return;
}
if (confirm("Really delete discussion '" + current.message.subject + "'?")) {
showMessage("Deleting discussion '" + current.message.subject + "' ...");
current.destroy().execute(function(response) {
console.log("deleteDiscussion() response = " + JSON.stringify(response));
loadDiscussions();
});
}
else {
loadDiscussions();
}
}
// Delete current document
function deleteDocument() {
console.log("deleteDocument() started");
var isDeleteSupported = current.resources.self && $.inArray('DELETE', current.resources.self.allowed) != -1;
if (!isDeleteSupported) {
alert("You are not allowed to delete this document");
return;
}
if (confirm("Really delete document '" + current.subject + "'?")) {
showMessage("Deleting document '" + current.subject + "' ...");
current.destroy().execute(function(response) {
console.log("deleteDocument() response = " + JSON.stringify(response));
loadDocuments();
});
}
else {
loadDocuments();
}
}
// On-view-load initialization
function init() {
registerHandlers();
loadUser();
}
// Return true if we are on the canvas view
function isCanvas() {
return !isHome();
}
// Return true if we are on the home view
function isHome() {
return "home" == gadgets.views.getCurrentView().name_;
}
// Load the private discussions for this user
function loadDiscussions() {
console.log("loadDiscussions() started");
showMessage("Loading private discussions for '" + user.name + "' ...");
user.privateDiscussions.get({
limit : 1000
}).execute(function(response) {
console.log("loadDiscussions() response = " + JSON.stringify(response));
var html = '<ul>';
discussions = response.data;
$.each(discussions, function(index, disc) {
html += '<li>';
html += '<a href="#" class="discussion-select" data-index="' + index + '">' + disc.message.subject + '</a>';
html += ' (' + disc.viewCount + ' views)';
html += '</li>';
});
html += '</ul>';
$("#discussions-list").html("").html(html);
$(".discussion-select").click(function() {
var index = $(this).attr("data-index");
current = discussions[index];
$(".discussion-subject").html("").html(current.message.subject);
showDiscussion();
});
showOnly("discussions-div");
});
}
// Load the private documents for this user
function loadDocuments() {
console.log("loadDocuments() started");
showMessage("Loading private documents for '" + user.name + "' ...");
user.privateDocuments.get({
limit : 1000
}).execute(function(response) {
console.log("loadDocuments() response = " + JSON.stringify(response));
var html = '<ul>';
documents = response.data;
$.each(documents, function(index, doc) {
html += '<li>';
html += '<a href="#" class="document-select" data-index="' + index + '">' + doc.subject + '</a>';
html += ' (' + doc.viewCount + ' views)';
html += '</li>';
});
html += '</ul>';
$("#documents-list").html("").html(html);
$(".document-select").click(function () {
var index = $(this).attr("data-index");
current = documents[index];
$(".document-subject").html("").html(current.subject);
showDocument();
});
showOnly("documents-div");
});
}
// Load the currently logged in user
function loadUser() {
console.log("loadUser() started");
showMessage("Loading the currently logged in user ...");
osapi.jive.core.users.get({
id : '@viewer'
}).execute(function(response) {
console.log("loadUser() response = " + JSON.stringify(response));
user = response.data;
$(".user-name").html(user.name);
loadUsers();
});
}
function loadUsers() {
console.log("loadUsers() started");
showMessage("Loading users available for collaboration ...");
osapi.jive.core.users.get({
limit : 25
}).execute(function(response) {
console.log("loadUsers() response = " + JSON.stringify(response));
users = response.data;
loadDocuments();
});
}
// Register UI event handlers
function registerHandlers() {
$(".back-to-discussions").click(function() {
loadDiscussions();
});
$(".back-to-documents").click(function() {
loadDocuments();
});
$(".discussion-cancel").click(function() {
loadDiscussions();
});
$(".discussion-create").click(function() {
createDiscussion();
});
$(".discussion-delete").click(function() {
deleteDiscussion();
});
$(".discussion-save").click(function() {
saveDiscussion();
});
$(".document-cancel").click(function() {
loadDocuments();
});
$(".document-create").click(function() {
createDocument();
});
$(".document-delete").click(function() {
deleteDocument();
});
$(".document-save").click(function() {
saveDocument();
});
$(".document-upload").click(function() {
uploadDocumentAttachment();
});
}
// Save current (new or existing) discussion
function saveDiscussion() {
if (current.id) {
console.log("saveDiscussion(old) started");
showMessage("Updating existing discussion ...");
console.log("Get the root message, which should be " + JSON.stringify(current.messages.root));
current.messages.root.get().execute(function(response) {
console.log("Root message response is " + JSON.stringify(response));
var message = response.data;
var isUpdateSupported = message.resources.self && $.inArray('PUT', message.resources.self.allowed) != -1;
if (!isUpdateSupported) {
alert("You are not allowed to update this discussion");
loadDiscussions();
return;
}
message.subject = $("#discussion-subject").val();
message.content.text = $("#discussion-text").val();
console.log("Update the root message");
message.update().execute(function(response) {
console.log("Update response = " + JSON.stringify(response));
loadDiscussions();
});
});
}
else {
console.log("saveDiscussion(new) started");
showMessage("Saving new discussion ...");
var options = {
subject : $("#new-discussion-subject").val(),
html : $("#new-discussion-html").val(),
userURI : [ ]
}
$.each($("#new-discussion-collaborators").val(), function(i, index) {
var user = users[index];
options.userURI.push(user.resources.self.ref);
});
console.log("Sending = " + JSON.stringify(options));
user.privateDiscussions.create(options).execute(function(response) {
console.log("saveDiscussion(new) response = " + JSON.stringify(response));
loadDiscussions();
});
}
}
// Save current (new or existing) document
function saveDocument() {
if (current.id) {
console.log("saveDocument(old) started");
var isUpdateSupported = current.resources.self && $.inArray('PUT', current.resources.self.allowed) != -1;
if (!isUpdateSupported) {
alert("You are not allowed to update this document");
return;
}
showMessage("Updating existing document ...");
current.subject = $("#document-subject").val();
current.content.text = $("#document-text").val();
current.update().execute(function(response) {
console.log("Update response = " + JSON.stringify(response));
loadDocuments();
});
}
else {
console.log("saveDocument(new) started");
showMessage("Saving new document ...");
current.subject = $("#new-document-subject").val();
current.html = $("#new-document-html").val();
user.privateDocuments.create(current).execute(function(response) {
console.log("saveDocument(new) response = " + JSON.stringify(response));
loadDocuments();
});
}
}
// Show the existing document in "current"
function showDocument() {
console.log("showDocument() started");
var name = current.author ? current.author.name : "(Yourself)";
$("#document-author").html("").html(name);
$("#document-creationDate").html("").html(current.creationDate);
$("#document-likeCount").html("").html(current.likeCount);
$("#document-modificationDate").html("").html(current.modificationDate);
$("#document-replyCount").html("").html(current.replyCount);
$("#document-status").html("").html(current.status);
$("#document-subject").attr("value", current.subject);
$("#document-text").html("").html(current.content.text);
$("#document-viewCount").html("").html(current.viewCount);
var html = "";
if (current.attachments) {
$.each(current.attachments, function(index, attachment) {
html += '<li>';
html += attachment.name;
if (attachment.type) {
html += ', contentType=';
html += attachment.contentType;
}
if (attachment.size) {
html += ', size=';
html += attachment.size;
}
html += '</li>';
});
}
$("#document-attachments-list").html(html);
showOnly("document-div");
}
// Show the existing discussion in "current"
function showDiscussion() {
console.log("showDiscussion() started");
var name = current.author ? current.author.name : "(Yourself)";
$("#discussion-author").html("").html(name);
$("#discussion-creationDate").html("").html(current.message.creationDate);
$("#discussion-likeCount").html("").html(current.message.likeCount);
$("#discussion-modificationDate").html("").html(current.message.modificationDate);
$("#discussion-replyCount").html("").html(current.message.replyCount);
$("#discussion-status").html("").html(current.message.status);
$("#discussion-subject").attr("value", current.message.subject);
$("#discussion-text").html("").html(current.message.content.text);
$("#discussion-viewCount").html("").html(current.viewCount);
showOnly("discussion-div");
}
// Show the specified status message
function showMessage(message) {
$("#status-message").html("").html(message);
showOnly("status-div");
}
// Show the new discussion in "current"
function showNewDiscussion() {
console.log("showNewDiscussion() started");
$("#new-discussion-subject").val(current.subject);
$("#new-discussion-html").html("").html(current.html);
var html = "";
$.each(users, function(index, collaborator) {
if (user.id != collaborator.id) {
html += '<option value="' + index + '">' + collaborator.name + '</option>';
}
});
$("#new-discussion-collaborators").html("").html(html);
showOnly("new-discussion-div");
}
// Show the new document in "current"
function showNewDocument() {
console.log("showNewDocument() started");
$("#new-document-subject").attr("value", current.subject);
$("#new-document-html").html("").html(current.html);
showOnly("new-document-div");
}
// Show only the specified top level div
function showOnly(id) {
$(".top-level-div").hide();
$("#" + id).show();
gadgets.window.adjustHeight();
}
// Trigger a document attachment upload
function uploadDocumentAttachment() {
console.log("uploadDocumentAttachment() started");
current.requestAttachmentUpload(function(response) {
console.log("uploadDocumentAttachment() response is " + JSON.stringify(response));
loadDocuments();
})
}
// Register our on-view-load handler
gadgets.util.registerOnLoadHandler(init);
|
module.exports = serialize
const convert = require('./convert')
const Serializer = require('./serializer')
/**
* Serialize to the appropriate format
* @@ Currently NQuads and JSON/LD are deal with extrelemently inefficiently
* through mutiple conversions.
*/
function serialize (target, kb, base, contentType, callback) {
base = base || target.uri
contentType = contentType || 'text/turtle' // text/n3 if complex?
var documentString = null
try {
var sz = Serializer(kb)
var newSts = kb.statementsMatching(undefined, undefined, undefined, target)
var n3String
sz.suggestNamespaces(kb.namespaces)
sz.setBase(base)
switch (contentType) {
case 'application/rdf+xml':
documentString = sz.statementsToXML(newSts)
return executeCallback(null, documentString)
case 'text/n3':
case 'application/n3': // Legacy
documentString = sz.statementsToN3(newSts)
return executeCallback(null, documentString)
case 'text/turtle':
case 'application/x-turtle': // Legacy
sz.setFlags('si') // Suppress = for sameAs and => for implies
documentString = sz.statementsToN3(newSts)
return executeCallback(null, documentString)
case 'application/n-triples':
sz.setFlags('deinprstux') // Suppress nice parts of N3 to make ntriples
documentString = sz.statementsToNTriples(newSts)
return executeCallback(null, documentString)
case 'application/ld+json':
sz.setFlags('deinprstux') // Use adapters to connect to incmpatible parser
n3String = sz.statementsToNTriples(newSts)
// n3String = sz.statementsToN3(newSts)
convert.convertToJson(n3String, callback)
break
case 'application/n-quads':
case 'application/nquads': // @@@ just outpout the quads? Does not work for collections
sz.setFlags('deinprstux q') // Suppress nice parts of N3 to make ntriples
documentString = sz.statementsToNTriples(newSts) // q in flag means actually quads
return executeCallback(null, documentString)
// n3String = sz.statementsToN3(newSts)
// documentString = convert.convertToNQuads(n3String, callback)
break
default:
throw new Error('Serialize: Content-type ' + contentType + ' not supported for data write.')
}
} catch (err) {
if (callback) {
return callback(err)
}
throw err // Don't hide problems from caller in sync mode
}
function executeCallback (err, result) {
if (callback) {
callback(err, result)
return
} else {
return result
}
}
}
|
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-example-database
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
var app = require('../../server/server')
module.exports = function(Report) {
//create path
Report.remoteMethod(
'getById',
{
description: 'get id like -> Number',
accepts: [
{arg: 'Id', type: 'string'}
],
returns: {
arg: 'res',type: 'object', root: true
},
http: { path: '/getById', verb: 'get'}
}
);
//promise untuk menghilangkan asyncronus
//reject, resolve adalah annotation
Report.getById = function(id, callback){
new Promise(function(resolve, reject){
var filter = {
where : {
id : {
like : id
}
}
}
Report.find(filter, function(err, result){
if (err) reject (err)
if (result === null) {
err = new Error('Cannot find that name')
err.statusCode = 404
reject(err)
}
resolve(result)
})
}).then(function(res){
var client = app.models.Client
var clientId = res[0].clientId
var filter = {
where : {
id : clientId
}
}
// console.log(filter)
client.find(filter, function(err, resclient){
if (err) return (err)
if (resclient === null) {
err = new Error('Cannot find that name')
err.statusCode = 404
return(err)
}
// console.log('2', resclient
res[0].client = resclient[0]
return callback(null,res)
})
}).catch(function(err){
callback (err);
})
}
Report.remoteMethod(
'getNameDindin',
{
description: 'get name like -> Dindin',
accepts: [
{ arg: 'firstname', type: 'string'}
],
returns:{
arg: 'res', type:'object', root: true
},
http: { path: '/getNameDindin', verb: 'get' }
}
);
Report.getNameDindin = function(firstname, callback){
new Promise(function(resolve, reject){
var filter = {
where: {
nama_pelanggan : {
like : firstname
}
}
}
Report.find(filter, function(err, result){
if(err) reject (err)
if(result === null){
err = new Error ("Nama Tidak Dapat Ditemukan")
err.statusCode = 404
reject (err)
}
resolve(result)
})
}).then(function(res){
if (!res) callback (err)
return callback (null, res)
}).catch(function(err){
callback(err);
});
}
Report.remoteMethod(
'getKodePesanan',
{
description: 'get kode like -> T123',
accepts: [
{ arg: 'kodepesanan', type: 'string'}
],
returns:{
arg: 'res', type:'object', root: true
},
http: { path: '/getKodePesanan', verb: 'get' }
}
);
Report.getKodePesanan = function(kodepesanan, callback){
new Promise(function(resolve, reject){
var filter = {
where: {
kode_pesanan : {
like : kodepesanan
}
}
}
Report.find(filter, function(err, result){
if(err) reject (err)
if(result === null){
err = new Error ("Kode Tidak Dapat Ditemukan")
err.statusCode = 404
reject (err)
}
resolve(result)
})
}).then(function(res){
if (!res) callback (err)
return callback (null, res)
}).catch(function(err){
callback(err);
});
}
Report.remoteMethod(
'getNamaBarang',
{
description: 'get nama barang like -> Antimo',
accepts: [
{ arg: 'namabarang', type: 'string'}
],
returns:{
arg: 'res', type:'object', root: true
},
http: { path: '/getNamaBarang', verb: 'get' }
}
);
Report.getNamaBarang = function(namabarang, callback){
new Promise(function(resolve, reject){
var filter = {
where: {
nama_barang : {
like : namabarang
}
}
}
Report.find(filter, function(err, result){
if(err) reject (err)
if(result === null){
err = new Error ("Kode Tidak Dapat Ditemukan")
err.statusCode = 404
reject (err)
}
resolve(result)
})
}).then(function(res){
if (!res) callback (err)
return callback (null, res)
}).catch(function(err){
callback(err);
});
}
Report.remoteMethod(
'getHargaBarang',
{
description: 'get harga barang like -> Harga',
accepts: [
{ arg: 'harga', type: 'string'}
],
returns:{
arg: 'res', type:'object', root: true
},
http: { path: '/getHargaBarang', verb: 'get' }
}
);
Report.getHargaBarang = function(hargabarang, callback){
new Promise(function(resolve, reject){
var filter = {
where: {
harga : {
like : hargabarang
}
}
}
Report.find(filter, function(err, result){
if(err) reject (err)
if(result === null){
err = new Error ("Kode Tidak Dapat Ditemukan")
err.statusCode = 404
reject (err)
}
resolve(result)
})
}).then(function(res){
if (!res) callback (err)
return callback (null, res)
}).catch(function(err){
callback(err);
});
}
}
|
/// <reference types="Cypress" />
import MediaPageObject from '../../../support/pages/module/sw-media.page-object';
import ProductPageObject from "../../../support/pages/module/sw-product.page-object";
describe('Media: Visual tests', () => {
beforeEach(() => {
cy.setToInitialState()
.then(() => {
cy.loginViaApi();
})
.then(() => {
return cy.createProductFixture();
})
.then(() => {
cy.openInitialPage(`${Cypress.env('admin')}#/sw/media/index`);
});
});
it('@visual: check appearance of basic media workflow', () => {
const page = new MediaPageObject();
// Request we want to wait for later
cy.server();
cy.route({
url: `${Cypress.env('apiPath')}/_action/media/**/upload?extension=png&fileName=sw-login-background`,
method: 'post'
}).as('saveDataFileUpload');
cy.route({
url: `${Cypress.env('apiPath')}/_action/media/**/upload?extension=png&fileName=sw_logo_white`,
method: 'post'
}).as('saveDataUrlUpload');
if (Cypress.isBrowser({ family: 'chromium' })) {
page.uploadImageUsingFileUpload('img/sw-login-background.png', 'sw-login-background.png');
cy.wait('@saveDataFileUpload').then((xhr) => {
cy.awaitAndCheckNotification('File has been saved.');
expect(xhr).to.have.property('status', 204);
});
cy.get('.sw-media-base-item__name[title="sw-login-background.png"]')
.should('be.visible');
}
if (Cypress.isBrowser('firefox')) {
// Upload medium
cy.clickContextMenuItem(
'.sw-media-upload-v2__button-url-upload',
'.sw-media-upload-v2__button-context-menu'
);
page.uploadImageUsingUrl('http://assets.shopware.com/sw_logo_white.png');
cy.wait('@saveDataUrlUpload').then((xhr) => {
cy.awaitAndCheckNotification('File has been saved.');
expect(xhr).to.have.property('status', 204);
});
cy.get('.sw-media-base-item__name[title="sw_logo_white.png"]')
.should('be.visible');
}
// Take snapshot for visual testing
cy.takeSnapshot('Media listing', '.sw-media-library');
});
it('@visual: check appearance of basic product media workflow', () => {
const page = new ProductPageObject();
cy.visit(`${Cypress.env('admin')}#/sw/product/index`);
// Request we want to wait for later
cy.server();
cy.route({
url: `${Cypress.env('apiPath')}/product/*`,
method: 'patch'
}).as('saveProduct');
// Open product
cy.clickContextMenuItem(
'.sw-entity-listing__context-menu-edit-action',
page.elements.contextMenuButton,
`${page.elements.dataGridRow}--0`
);
// Add first image to product
cy.get('.sw-product-media-form__previews').scrollIntoView();
cy.fixture('img/sw-login-background.png').then(fileContent => {
cy.get('#files').upload(
{
fileContent,
fileName: 'sw-login-background.png',
mimeType: 'image/png'
}, {
subjectType: 'input'
}
);
});
cy.get('.sw-product-image__image img')
.should('have.attr', 'src')
.and('match', /sw-login-background/);
cy.awaitAndCheckNotification('File has been saved.');
// Take snapshot for visual testing
cy.takeSnapshot('Product with image', '.sw-product-image__image');
// Save product
cy.get(page.elements.productSaveAction).click();
cy.wait('@saveProduct').then((xhr) => {
expect(xhr).to.have.property('status', 204);
});
// Verify in storefront
cy.visit('/');
cy.get('.product-name').click();
cy.get('.gallery-slider-single-image > .img-fluid').should('be.visible');
cy.get('.gallery-slider-single-image > .img-fluid')
.should('have.attr', 'src')
.and('match', /sw-login-background/);
// Take snapshot for visual testing
cy.takeSnapshot('Product in Storefront with image', '.gallery-slider-single-image > .img-fluid');
});
});
|
var table= jQuery('.expenses-table').DataTable({
responsive: true,
processing: true,
serverSide: true,
ajax: $('#base_url').val()+'expense/getdata',
columns: [
{ data: 'id', name: 'id'},
{ data: 'expense_name', name: 'expense_name'},
{ data: 'block_name', name: 'block_name'},
{ data: 'payment_name', name: 'payment_name'},
{ data: 'vender_name', name: 'vender_name'},
{ data: 'ammount', name: 'ammount'},
{ data: 'payment_date', name: 'payment_date'},
{ data: 'description', name: 'description'},
{data: 'action', name: 'action', orderable: false, searchable: false},
],
initComplete: function(settings, json) {
refreshJsexpense();
}
});
$(document).ready(function() {
$("#datepicker").datepicker({
autoclose: true,
todayHighlight: true
}).datepicker('update', new Date());
table.ajax.reload();
$(".add-expense").click(function(e){
e.preventDefault();
var block = document.getElementById("block_list");
var ex = document.getElementById("expense_type");
var pa = document.getElementById("payment_type");
var block_id = block.options[block.selectedIndex].value;
var expense_type_id = ex.options[ex.selectedIndex].value;
var payment_type_id = pa.options[pa.selectedIndex].value;
var _token = $("input[name='_token']").val();
var txt_vname = $("input[name='txt_vname']").val();
var txt_amount = $("input[name='txt_amount']").val();
var txt_payment_date = $("input[name='txt_payment_date']").val();
var txt_description = $("textarea[name='txt_description']").val();
var count_error = 0;
if (block_id == 0) {
$("select[name='block_list']").addClass('has-error');
count_error++;
} else{
$("select[name='block_list']").removeClass('has-error');
}
if (expense_type_id == 0) {
$("select[name='expense_type']").addClass('has-error');
count_error++;
} else{
$("select[name='expense_type']").removeClass('has-error');
}
if (payment_type_id == 0) {
$("select[name='payment_type']").addClass('has-error');
count_error++;
} else{
$("select[name='payment_type']").removeClass('has-error');
}
if (txt_vname.trim() == '') {
$("input[name='txt_vname']").addClass('has-error');
count_error++;
} else{
$("input[name='txt_vname']").removeClass('has-error');
}
if (txt_amount.trim() == '') {
$("input[name='txt_amount']").addClass('has-error');
count_error++;
} else{
$("input[name='txt_amount']").removeClass('has-error');
}
if (txt_payment_date.trim() == '') {
$("input[name='txt_payment_date']").addClass('has-error');
count_error++;
} else{
$("input[name='txt_payment_date']").removeClass('has-error');
}
if (txt_description.trim() == '') {
$("textarea[name='txt_description']").addClass('has-error');
count_error++;
} else{
$("textarea[name='txt_description']").removeClass('has-error');
}
if(count_error == 0){
$.ajax({
url: $('#base_url').val()+"expense",
type:'POST',
data: {_token:_token, block_id:block_id, expense_type_id:expense_type_id, payment_type_id:payment_type_id, txt_vname:txt_vname, txt_amount:txt_amount, txt_payment_date:txt_payment_date,txt_description:txt_description},
success: function(data) {
if($.isEmptyObject(data.error)){
printSuccessMsg(data.success);
table.ajax.reload();
$('#myForm')[0].reset();
}else{
printErrorMsg(data.error);
}
}
});
}
else{
return false;
}
});
$(".add-expanse-type").click(function(e){
e.preventDefault();
var count_error = 0;
var _token = $("input[name='_token']").val();
var txt_expense_name = $("input[name='txt_expense_name']").val();
if (txt_expense_name.trim() == '') {
$("input[name='txt_expense_name']").addClass('has-error');
count_error++;
} else{
$("input[name='txt_expense_name']").removeClass('has-error');
}
if(count_error == 0){
$.ajax({
url: $('#base_url').val()+"expensestype",
type:'POST',
data: {_token:_token, txt_expense_name:txt_expense_name},
success: function(data) {
if($.isEmptyObject(data.error)){
printSuccessMsg(data.success);
table.ajax.reload();
$('#myForm')[0].reset();
}else{
printErrorMsg(data.error);
}
}
});
}
else{
return false;
}
});
$(".update-expense").click(function (e){
e.preventDefault();
var block = document.getElementById("block_list");
var ex = document.getElementById("expense_type");
var pa = document.getElementById("payment_type");
var expenses_id=$("#expenses_id").val();
var block_id = block.options[block.selectedIndex].value;
var expense_type_id = ex.options[ex.selectedIndex].value;
var payment_type_id = pa.options[pa.selectedIndex].value;
var _token = $("input[name='_token']").val();
var txt_vname = $("input[name='txt_vname']").val();
var txt_amount = $("input[name='txt_amount']").val();
var txt_payment_date = $("input[name='txt_payment_date']").val();
var txt_description = $("textarea[name='txt_description']").val();
var count_error = 0;
if (block_id == 0) {
$("select[name='block_list']").addClass('has-error');
count_error++;
} else{
$("select[name='block_list']").removeClass('has-error');
}
if (expense_type_id == 0) {
$("select[name='expense_type']").addClass('has-error');
count_error++;
} else{
$("select[name='expense_type']").removeClass('has-error');
}
if (payment_type_id == 0) {
$("select[name='payment_type']").addClass('has-error');
count_error++;
} else{
$("select[name='payment_type']").removeClass('has-error');
}
if (txt_vname.trim() == '') {
$("input[name='txt_vname']").addClass('has-error');
count_error++;
} else{
$("input[name='txt_vname']").removeClass('has-error');
}
if (txt_amount.trim() == '') {
$("input[name='txt_amount']").addClass('has-error');
count_error++;
} else{
$("input[name='txt_amount']").removeClass('has-error');
}
if (txt_payment_date.trim() == '') {
$("input[name='txt_payment_date']").addClass('has-error');
count_error++;
} else{
$("input[name='txt_payment_date']").removeClass('has-error');
}
if (txt_description.trim() == '') {
$("textarea[name='txt_description']").addClass('has-error');
count_error++;
} else{
$("textarea[name='txt_description']").removeClass('has-error');
}
if(count_error == 0){
$.ajax({
url: $('#base_url').val()+"expense/update",
type:'POST',
data: {_token:_token,expenses_id:expenses_id, block_id:block_id, expense_type_id:expense_type_id, payment_type_id:payment_type_id, txt_vname:txt_vname, txt_amount:txt_amount, txt_payment_date:txt_payment_date,txt_description:txt_description},
success: function(data) {
if($.isEmptyObject(data.error)){
printSuccessMsg(data.success);
table.ajax.reload();
$('#myForm')[0].reset();
}else{
printErrorMsg(data.error);
}
}
});
}
else{
return false;
}
});
});
function delete_expense(id){
if (confirm('Are You Sure For Delete The House..!! ')) {
var _token = $("input[name='_token']").val();
$.ajax({
url: $('#base_url').val()+"expense/delete",
type:'POST',
data: {_token:_token, id:id},
success: function(data) {
if(data.status==1){
alert(data.msg);
table.ajax.reload();
}
}
});
}
else {
return false;
}
}
function refreshJsexpense(){
$('.btnEditExpense').on('click', function () {
var expense_id = $(this).data('id');
var _token = $("input[name='_token']").val();
$.ajax({
url: $('#base_url').val()+"expense/edit",
type:'POST',
data: {_token:_token, expense_id:expense_id},
success: function(data) {
if(data.status==1){
var expense_type = $("#expense_type").val(data.content.expense_type_id);
expense_type.attr("selected","selected");
$('select[name^="expense_type"] option[value=]').attr("selected","selected");
var datablock = $("#block_list").val(data.content.block_id);
datablock.attr("selected","selected");
$('select[name^="block_list"] option[value=]').attr("selected","selected");
$("#txt_vname").val(data.content.vender_name);
$("#txt_amount").val(data.content.ammount);
var payment_type = $("#payment_type").val(data.content.payment_type_id);
payment_type.attr("selected","selected");
$('select[name^="payment_type"] option[value=]').attr("selected","selected");
$("#txt_payment_date").val(data.content.payment_date);
$("#txt_description").val(data.content.description);
$("#expenses_id").val(data.content.id);
$(".add-expense").css('display','none');
$(".update-expense").css('display','block');
$("#myexpenseModal").modal("show");
}
}
});
});
}
function printErrorMsg (msg) {
$(".print-error-msg").find("ul").html('');
$(".print-error-msg").css('display','block');
$.each( msg, function( key, value ) {
$(".print-error-msg").find("ul").append('<li>'+value+'</li>');
});
}
function printSuccessMsg (msg) {
$(".print-error-msg").find("ul").html('');
$(".print-error-msg").css('display','block');
$(".print-error-msg").find("ul").append('<li>'+msg+'</li>');
}
|
import _ from 'lodash'
import React, { PropTypes, Component } from 'react'
import cx from 'classnames'
import ModalHeader from './ModalHeader'
import ModalContent from './ModalContent'
import ModalActions from './ModalActions'
import ModalDescription from './ModalDescription'
import Portal from './../../addons/Portal/Portal'
import {
customPropTypes,
getElementType,
getUnhandledProps,
makeDebugger,
META,
useKeyOnly,
} from '../../lib'
const debug = makeDebugger('modal')
const _meta = {
name: 'Modal',
type: META.TYPES.MODULE,
props: {
size: ['fullscreen', 'large', 'small'],
dimmer: ['inverted', 'blurring'],
},
}
/**
* A modal displays content that temporarily blocks interactions with the main view of a site
* @see Confirm
* @see Portal
*/
class Modal extends Component {
static propTypes = {
/** An element type to render as (string or function). */
as: customPropTypes.as,
/** Primary content of the modal. Consider using ModalHeader, ModalContent or ModalActions here */
children: PropTypes.node,
/** Classes to add to the modal className */
className: PropTypes.string,
/** A modal can reduce its complexity */
basic: PropTypes.bool,
/** A modal can appear in a dimmer */
dimmer: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.oneOf(_meta.props.dimmer),
]),
/** The node where the modal should mount.. */
mountNode: PropTypes.any,
/** A modal can vary in size */
size: PropTypes.oneOf(_meta.props.size),
/**
* NOTE: Any unhandled props that are defined in Portal are passed-through
* to the wrapping Portal.
*/
}
static defaultProps = {
dimmer: true,
}
static _meta = _meta
static Header = ModalHeader
static Content = ModalContent
static Description = ModalDescription
static Actions = ModalActions
state = {}
componentDidMount() {
debug('componentDidMount()')
this.setPosition()
}
componentWillUnmount() {
debug('componentWillUnmount()')
this.handleUnmount()
}
handleMount = () => {
debug('handleOpen()')
const { dimmer } = this.props
const mountNode = this.getMountNode()
if (dimmer) {
debug('adding dimmer')
mountNode.classList.add('dimmable', 'dimmed')
if (dimmer === 'blurring') {
debug('adding blurred dimmer')
mountNode.classList.add('blurring')
}
}
}
handleUnmount = () => {
debug('handleUnmount()')
const mountNode = this.getMountNode()
// Always remove all dimmer classes.
// If the dimmer value changes while the modal is open,
// then removing its current value could leave cruft classes previously added.
mountNode.classList.remove('blurring', 'dimmable', 'dimmed', 'scrollable')
}
getMountNode = () => {
return this.props.mountNode || document.body
}
setPosition = () => {
if (this._modalNode) {
const mountNode = this.getMountNode()
const { height } = this._modalNode.getBoundingClientRect()
const scrolling = height >= window.innerHeight
const newState = {
marginTop: -Math.round(height / 2),
scrolling,
}
// add/remove scrolling class on body
if (!this.state.scrolling && scrolling) {
mountNode.classList.add('scrolling')
} else if (this.state.scrolling && !scrolling) {
mountNode.classList.remove('scrolling')
}
if (!_.isEqual(newState, this.state)) {
this.setState(newState)
}
}
requestAnimationFrame(this.setPosition)
}
render() {
const { basic, children, className, dimmer, size } = this.props
const { marginTop, scrolling } = this.state
const classes = cx(
'ui',
size,
useKeyOnly(basic, 'basic'),
useKeyOnly(scrolling, 'scrolling'),
'modal transition visible active',
className,
)
const rest = getUnhandledProps(Modal, this.props)
const ElementType = getElementType(Modal, this.props)
const portalProps = _.pick(rest, _.keys(Portal.propTypes))
const modalJSX = (
<ElementType {...rest} className={classes} style={{ marginTop }} ref={c => (this._modalNode = c)}>
{children}
</ElementType>
)
// wrap dimmer modals
const dimmerClasses = !dimmer ? null : cx(
'ui',
dimmer === 'inverted' && 'inverted',
'page modals dimmer transition visible active',
)
// Heads up!
//
// The SUI CSS selector to prevent the modal itself from blurring requires an immediate .dimmer child:
// .blurring.dimmed.dimmable>:not(.dimmer) { ... }
//
// The .blurring.dimmed.dimmable is the body, so that all body content inside is blurred.
// We need the immediate child to be the dimmer to :not() blur the modal itself!
// Otherwise, the portal div is also blurred, blurring the modal.
//
// We cannot them wrap the modalJSX in an actual <Dimmer /> instead, we apply the dimmer classes to the <Portal />.
return (
<Portal
{...portalProps}
className={dimmerClasses}
mountNode={this.getMountNode()}
onMount={this.handleMount}
onUnmount={this.handleUnmount}
>
{modalJSX}
</Portal>
)
}
}
export default Modal
|
const { isFailAssertionLine } = require('./fns')
const error = function (message) {
return {
type: 'error',
message: message,
}
}
const firstAssertion = function (first, assert) {
return assert.number < first.number ? assert : first
}
const lastAssertion = function (last, assert) {
return assert.number > last.number ? assert : last
}
const handleEnd = function () {
let plan = this.results.plans.length ? this.results.plans[0] : null
let count = this.results.asserts.length
let first = count && this.results.asserts.reduce(firstAssertion)
let last = count && this.results.asserts.reduce(lastAssertion)
// Emit fail when error on previous line had no diagnostics
if (this.previousLine && isFailAssertionLine(this.previousLine)) {
let lastAssert = this.results.fail[this.results.fail.length - 1]
this.emit('fail', lastAssert)
}
if (!plan) {
if (count > 0) {
this.results.errors.push(error('no plan provided'))
}
return
}
if (this.results.fail.length > 0) {
return
}
if (count !== plan.to - plan.from + 1) {
this.results.errors.push(error('incorrect number of assertions made'))
} else if (first && first.number !== plan.from) {
this.results.errors.push(error('first assertion number does not equal the plan start'))
} else if (last && last.number !== plan.to) {
this.results.errors.push(error('last assertion number does not equal the plan end'))
}
}
module.exports = handleEnd
|
const API_URL = 'http://localhost:8000/'
const LOGIN_URL = API_URL + 'rest-auth/login/'
const LOGOUT_URL = API_URL + 'rest-auth/logout/'
// const REGISTRATION_URL = API_URL + 'registration/'
export default {
user: {
authenticated: false
},
login (context, data) {
console.log(this.user)
context.$http.post(LOGIN_URL, data)
.then(response => {
console.log(response.data)
window.localStorage.setItem('id_token', response.data.token)
this.user.authenticated = true
})
.catch(function (error) {
console.log(error)
})
},
logout (context) {
context.$http.post(LOGOUT_URL)
.then(function (response) {
console.log(response.data)
})
.catch(function (error) {
console.log(error)
})
window.localStorage.removeItem('id_token')
this.user.authenticated = false
},
checkAuth () {
var jwt = window.localStorage.getItem('id_token')
if (jwt) {
this.user.authenticated = true
} else {
this.user.authenticated = false
}
},
getAuthHeader () {
return {
'Authorization': 'Bearer ' + window.localStorage.getItem('id_token')
}
}
}
|
/*
npm outdated [pkg]
Does the following:
1. check for a new version of pkg
If no packages are specified, then run for all installed
packages.
--parseable creates output like this:
<fullpath>:<name@wanted>:<name@installed>:<name@latest>
*/
module.exports = outdated
outdated.usage = 'npm outdated [[<@scope>/]<pkg> ...]'
outdated.completion = require('./utils/completion/installed-deep.js')
const os = require('os')
const url = require('url')
const path = require('path')
const readPackageTree = require('read-package-tree')
const asyncMap = require('slide').asyncMap
const color = require('ansicolors')
const styles = require('ansistyles')
const table = require('text-table')
const semver = require('semver')
const npa = require('libnpm/parse-arg')
const pickManifest = require('npm-pick-manifest')
const fetchPackageMetadata = require('./fetch-package-metadata.js')
const mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js')
const npm = require('./npm.js')
const npmConfig = require('./config/figgy-config.js')
const figgyPudding = require('figgy-pudding')
const packument = require('libnpm/packument')
const long = npm.config.get('long')
const isExtraneous = require('./install/is-extraneous.js')
const computeMetadata = require('./install/deps.js').computeMetadata
const computeVersionSpec = require('./install/deps.js').computeVersionSpec
const moduleName = require('./utils/module-name.js')
const output = require('./utils/output.js')
const ansiTrim = require('./utils/ansi-trim')
const OutdatedConfig = figgyPudding({
also: {},
color: {},
depth: {},
dev: 'development',
development: {},
global: {},
json: {},
only: {},
parseable: {},
prod: 'production',
production: {},
save: {},
'save-dev': {},
'save-optional': {}
})
function uniq (list) {
// we maintain the array because we need an array, not iterator, return
// value.
var uniqed = []
var seen = new Set()
list.forEach(function (item) {
if (seen.has(item)) return
seen.add(item)
uniqed.push(item)
})
return uniqed
}
function andComputeMetadata (next) {
return function (er, tree) {
if (er) return next(er)
next(null, computeMetadata(tree))
}
}
function outdated (args, silent, cb) {
if (typeof cb !== 'function') {
cb = silent
silent = false
}
let opts = OutdatedConfig(npmConfig())
var dir = path.resolve(npm.dir, '..')
// default depth for `outdated` is 0 (cf. `ls`)
if (opts.depth) opts = opts.concat({depth: 0})
readPackageTree(dir, andComputeMetadata(function (er, tree) {
if (!tree) return cb(er)
mutateIntoLogicalTree(tree)
outdated_(args, '', tree, {}, 0, opts, function (er, list) {
list = uniq(list || []).sort(function (aa, bb) {
return aa[0].path.localeCompare(bb[0].path) ||
aa[1].localeCompare(bb[1])
})
if (er || silent ||
(list.length === 0 && !opts.json)) {
return cb(er, list)
}
if (opts.json) {
output(makeJSON(list, opts))
} else if (opts.parseable) {
output(makeParseable(list, opts))
} else {
var outList = list.map(x => makePretty(x, opts))
var outHead = [ 'Package',
'Current',
'Wanted',
'Latest',
'Location'
]
if (long) outHead.push('Package Type', 'Homepage')
var outTable = [outHead].concat(outList)
if (opts.color) {
outTable[0] = outTable[0].map(function (heading) {
return styles.underline(heading)
})
}
var tableOpts = {
align: ['l', 'r', 'r', 'r', 'l'],
stringLength: function (s) { return ansiTrim(s).length }
}
output(table(outTable, tableOpts))
}
process.exitCode = list.length ? 1 : 0
cb(null, list.map(function (item) { return [item[0].parent.path].concat(item.slice(1, 7)) }))
})
}))
}
// [[ dir, dep, has, want, latest, type ]]
function makePretty (p, opts) {
var depname = p[1]
var has = p[2]
var want = p[3]
var latest = p[4]
var type = p[6]
var deppath = p[7]
var homepage = p[0].package.homepage || ''
var columns = [ depname,
has || 'MISSING',
want,
latest,
deppath || 'global'
]
if (long) {
columns[5] = type
columns[6] = homepage
}
if (opts.color) {
columns[0] = color[has === want ? 'yellow' : 'red'](columns[0]) // dep
columns[2] = color.green(columns[2]) // want
columns[3] = color.magenta(columns[3]) // latest
}
return columns
}
function makeParseable (list) {
return list.map(function (p) {
var dep = p[0]
var depname = p[1]
var dir = dep.path
var has = p[2]
var want = p[3]
var latest = p[4]
var type = p[6]
var out = [
dir,
depname + '@' + want,
(has ? (depname + '@' + has) : 'MISSING'),
depname + '@' + latest
]
if (long) out.push(type, dep.package.homepage)
return out.join(':')
}).join(os.EOL)
}
function makeJSON (list, opts) {
var out = {}
list.forEach(function (p) {
var dep = p[0]
var depname = p[1]
var dir = dep.path
var has = p[2]
var want = p[3]
var latest = p[4]
var type = p[6]
if (!opts.global) {
dir = path.relative(process.cwd(), dir)
}
out[depname] = { current: has,
wanted: want,
latest: latest,
location: dir
}
if (long) {
out[depname].type = type
out[depname].homepage = dep.package.homepage
}
})
return JSON.stringify(out, null, 2)
}
function outdated_ (args, path, tree, parentHas, depth, opts, cb) {
if (!tree.package) tree.package = {}
if (path && moduleName(tree)) path += ' > ' + tree.package.name
if (!path && moduleName(tree)) path = tree.package.name
if (depth > opts.depth) {
return cb(null, [])
}
var types = {}
var pkg = tree.package
if (!tree.children) tree.children = []
var deps = tree.error ? tree.children : tree.children.filter((child) => !isExtraneous(child))
deps.forEach(function (dep) {
types[moduleName(dep)] = 'dependencies'
})
Object.keys(tree.missingDeps || {}).forEach(function (name) {
deps.push({
package: { name: name },
path: tree.path,
parent: tree,
isMissing: true
})
types[name] = 'dependencies'
})
// If we explicitly asked for dev deps OR we didn't ask for production deps
// AND we asked to save dev-deps OR we didn't ask to save anything that's NOT
// dev deps then…
// (All the save checking here is because this gets called from npm-update currently
// and that requires this logic around dev deps.)
// FIXME: Refactor npm update to not be in terms of outdated.
var dev = opts.dev || /^dev(elopment)?$/.test(opts.also)
var prod = opts.production || /^prod(uction)?$/.test(opts.only)
if (
(dev || !prod) &&
(
opts['save-dev'] || (!opts.save && !opts['save-optional'])
)
) {
Object.keys(tree.missingDevDeps).forEach(function (name) {
deps.push({
package: { name: name },
path: tree.path,
parent: tree,
isMissing: true
})
if (!types[name]) {
types[name] = 'devDependencies'
}
})
}
if (opts['save-dev']) {
deps = deps.filter(function (dep) { return pkg.devDependencies[moduleName(dep)] })
deps.forEach(function (dep) {
types[moduleName(dep)] = 'devDependencies'
})
} else if (opts.save) {
// remove optional dependencies from dependencies during --save.
deps = deps.filter(function (dep) { return !pkg.optionalDependencies[moduleName(dep)] })
} else if (opts['save-optional']) {
deps = deps.filter(function (dep) { return pkg.optionalDependencies[moduleName(dep)] })
deps.forEach(function (dep) {
types[moduleName(dep)] = 'optionalDependencies'
})
}
var doUpdate = dev || (
!prod &&
!Object.keys(parentHas).length &&
!opts.global
)
if (doUpdate) {
Object.keys(pkg.devDependencies || {}).forEach(function (k) {
if (!(k in parentHas)) {
deps[k] = pkg.devDependencies[k]
types[k] = 'devDependencies'
}
})
}
var has = Object.create(parentHas)
tree.children.forEach(function (child) {
if (moduleName(child) && child.package.private) {
deps = deps.filter(function (dep) { return dep !== child })
}
has[moduleName(child)] = {
version: child.isLink ? 'linked' : child.package.version,
from: child.isLink ? 'file:' + child.path : child.package._from
}
})
// now get what we should have, based on the dep.
// if has[dep] !== shouldHave[dep], then cb with the data
// otherwise dive into the folder
asyncMap(deps, function (dep, cb) {
var name = moduleName(dep)
var required
if (tree.package.dependencies && name in tree.package.dependencies) {
required = tree.package.dependencies[name]
} else if (tree.package.optionalDependencies && name in tree.package.optionalDependencies) {
required = tree.package.optionalDependencies[name]
} else if (tree.package.devDependencies && name in tree.package.devDependencies) {
required = tree.package.devDependencies[name]
} else if (has[name]) {
required = computeVersionSpec(tree, dep)
}
if (!long) return shouldUpdate(args, dep, name, has, required, depth, path, opts, cb)
shouldUpdate(args, dep, name, has, required, depth, path, opts, cb, types[name])
}, cb)
}
function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, opts, cb, type) {
// look up the most recent version.
// if that's what we already have, or if it's not on the args list,
// then dive into it. Otherwise, cb() with the data.
// { version: , from: }
var curr = has[dep]
function skip (er) {
// show user that no viable version can be found
if (er) return cb(er)
outdated_(args,
pkgpath,
tree,
has,
depth + 1,
opts,
cb)
}
if (args.length && args.indexOf(dep) === -1) return skip()
if (tree.isLink && req == null) return skip()
if (req == null || req === '') req = '*'
var parsed = npa.resolve(dep, req)
if (parsed.type === 'directory') {
if (tree.isLink) {
return skip()
} else {
return doIt('linked', 'linked')
}
} else if (parsed.type === 'git') {
return doIt('git', 'git')
} else if (parsed.type === 'file') {
return updateLocalDeps()
} else if (parsed.type === 'remote') {
return doIt('remote', 'remote')
} else {
return packument(parsed, opts.concat({
'prefer-online': true
})).nodeify(updateDeps)
}
function doIt (wanted, latest) {
let c = curr && curr.version
if (parsed.type === 'alias') {
c = `npm:${parsed.subSpec.name}@${c}`
}
if (!long) {
return cb(null, [[tree, dep, c, wanted, latest, req, null, pkgpath]])
}
cb(null, [[tree, dep, c, wanted, latest, req, type, pkgpath]])
}
function updateLocalDeps (latestRegistryVersion) {
fetchPackageMetadata('file:' + parsed.fetchSpec, '.', (er, localDependency) => {
if (er) return cb()
var wanted = localDependency.version
var latest = localDependency.version
if (latestRegistryVersion) {
latest = latestRegistryVersion
if (semver.lt(wanted, latestRegistryVersion)) {
wanted = latestRegistryVersion
req = dep + '@' + latest
}
}
if (!curr || curr.version !== wanted) {
doIt(wanted, latest)
} else {
skip()
}
})
}
function updateDeps (er, d) {
if (er) return cb(er)
if (parsed.type === 'alias') {
req = parsed.subSpec.rawSpec
}
try {
var l = pickManifest(d, 'latest')
var m = pickManifest(d, req)
} catch (er) {
if (er.code === 'ETARGET' || er.code === 'E403') {
return skip(er)
} else {
return skip()
}
}
// check that the url origin hasn't changed (#1727) and that
// there is no newer version available
var dFromUrl = m._from && url.parse(m._from).protocol
var cFromUrl = curr && curr.from && url.parse(curr.from).protocol
if (
!curr ||
(dFromUrl && cFromUrl && m._from !== curr.from) ||
m.version !== curr.version ||
m.version !== l.version
) {
if (parsed.type === 'alias') {
doIt(
`npm:${parsed.subSpec.name}@${m.version}`,
`npm:${parsed.subSpec.name}@${l.version}`
)
} else {
doIt(m.version, l.version)
}
} else {
skip()
}
}
}
|
'use strict';
const Input = require('postcss/lib/input');
const Root = require('postcss/lib/root');
const htmlParser = require('./html-parser');
const mdParser = require('./markdown-parser');
const BlockFixer = require('./block-fixer');
function parser (source, opts) {
// Skip known style sheet files
if (opts.from && /\.(?:css|(?:wx|le|sa|sc|s)ss|styl(?:us)?)(?:\?.+)?$/i.test(opts.from)) {
return;
}
source = source && source.toString();
const styleTag = htmlParser(source);
const stylesMd = mdParser(source);
if (!styleTag && !stylesMd) {
return;
}
const document = new Root();
const documentLocalFixer = new BlockFixer(source);
let index = 0;
[].concat(styleTag).concat(stylesMd).filter(style => {
return style && style.content.trim();
}).sort(function (a, b) {
return a.startIndex - b.startIndex;
}).forEach(style => {
const localFixer = documentLocalFixer.block(style);
const root = localFixer.parse(opts);
root.raws.beforeStart = source.slice(index, style.startIndex);
index = style.startIndex + style.content.length;
document.nodes.push(root);
});
document.raws.afterEnd = source.slice(index);
document.source = {
input: new Input(source, opts),
start: {
line: 1,
column: 1,
},
};
document.each = callback => {
let wasBreak, lastResult;
document.nodes.forEach(node => {
const result = node.each(callback);
if ( result === false ) {
wasBreak = true;
} else {
lastResult = result;
}
});
if (wasBreak) {
return false;
} else {
return lastResult;
}
};
return document;
}
module.exports = parser;
|
/**
* @author: Emmanuel SMITH <hey@emmanuel-smith.me>
* project: ets2-dashboard-skin
* file: _app.js
* Date: 08/04/2020
* Time: 18:36
*/
import store from '@/store';
import { history } from '@/utils/utils';
import countryList from 'country-list';
import emojiFlags from 'emoji-flags';
import momentjs from 'moment-timezone';
import packageJson from '../../package.json';
// --- Variables
const DATE_FORMAT_NONE = null;
const DATE_FORMAT_SHORT = 'MM/DD';
const DATE_FORMAT_LONG = 'ddd';
const DATE_FORMAT_FULL = 'dddd';
const TIME_FORMAT_NONE = null;
const TIME_FORMAT_SHORT = 'LT';
const TIME_FORMAT_FULL = 'LTS';
const GAME_ID_ETS2 = 1;
const GAME_ID_ATS = 2;
// --- Methods
export const version = packageJson.version;
export const isOnDevEnvironment = process.env.NODE_ENV.startsWith('dev');
export const useFakeData = process.env.VUE_APP_USE_FAKE_DATA === 'true';
export const basePathHost = () =>
`http://${window.location.hostname}:${store.getters['config/app'].general_port}`;
export const moment = () => {
momentjs.locale(store.getters['config/get']('general_skin_locale'));
return momentjs;
};
export const flag = (countryName, gameID) => {
let flag = undefined;
if (countryName.length !== 0) {
countryName =
countryName === 'uk'
? 'United Kingdom of Great Britain and Northern Ireland'
: countryName;
const countryCode = countryList.getCode(countryName);
if (countryCode !== undefined) flag = emojiFlags.countryCode(countryCode);
if (gameIsATS(gameID)) flag = emojiFlags.countryCode('US');
}
return flag !== undefined ? flag.emoji : '🏳️';
};
export const numberDigit = (input) => {
return input < 10 ? `0${input}` : input;
};
export const jsonReadable = (dataIn) => {
return JSON.parse(JSON.stringify(dataIn));
};
export const dateTimeLocalized = (input, formatDate, formatTime) => {
const format = formatDate + ' ' + formatTime;
const momentData = moment()(input, 'x');
return momentData.tz('Africa/Abidjan').format(format);
};
export const diffDateTimeLocalized = (dFrom, dTo, withDay = true) => {
const momentFrom = moment()(dFrom, 'x');
const momentTo = moment()(dTo, 'x');
const diff = momentTo.diff(momentFrom);
const format = withDay ? 'DD[d] HH[h] mm[m]' : 'HH[h] mm[m]';
return moment()(diff, 'x').tz('Africa/Abidjan').format(format);
};
export const displayDuration = (duration, withDay = true) => {
const d = Math.trunc(duration / 60 / 24);
const h = Math.trunc(((duration / 60 / 24) % 1) * 24);
const m = Math.trunc(((duration / 60) % 1) * 60);
return withDay ? d + 'd ' + h + 'h ' + m + 'm' : h + d * 24 + 'h ' + m + 'm';
};
export const sleep = (milliseconds) => {
const date = Date.now();
let currentDate = null;
do {
currentDate = Date.now();
} while (currentDate - date < milliseconds);
};
export const gameIsATS = (gameID) => gameID === GAME_ID_ATS;
export const gameIsETS2 = (gameID) => gameID === GAME_ID_ETS2;
export const betweenFloat = (data, a, b) => {
return parseFloat(data) >= a && parseFloat(data) <= b;
};
export const pushLog = (message, zone, level = history.HTY_LEVEL.INFO) => {
store.dispatch('debug/addLog', {
message,
zone,
level
});
};
export const formatConstants = {
DATE_FORMAT_NONE,
DATE_FORMAT_SHORT,
DATE_FORMAT_LONG,
DATE_FORMAT_FULL,
TIME_FORMAT_NONE,
TIME_FORMAT_SHORT,
TIME_FORMAT_FULL,
GAME_ID_ATS,
GAME_ID_ETS2
};
|
import { GRID_PREFIX } from '../definition';
export class DragService {
constructor() {
}
static get mimeType() {
return `application/x-${GRID_PREFIX}+json`;
}
static decode(source) {
return JSON.parse(source);
}
static encode(source) {
return JSON.stringify(source);
}
}
DragService.element = null;
DragService.data = null;
DragService.area = null;
DragService.startPosition = null;
|
/**
* React v0.12.0
*/
!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.React=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.
*
* @providesModule React
*/
"use strict";
var DOMPropertyOperations = _dereq_("./DOMPropertyOperations");
var EventPluginUtils = _dereq_("./EventPluginUtils");
var ReactChildren = _dereq_("./ReactChildren");
var ReactComponent = _dereq_("./ReactComponent");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactContext = _dereq_("./ReactContext");
var ReactCurrentOwner = _dereq_("./ReactCurrentOwner");
var ReactElement = _dereq_("./ReactElement");
var ReactElementValidator = _dereq_("./ReactElementValidator");
var ReactDOM = _dereq_("./ReactDOM");
var ReactDOMComponent = _dereq_("./ReactDOMComponent");
var ReactDefaultInjection = _dereq_("./ReactDefaultInjection");
var ReactInstanceHandles = _dereq_("./ReactInstanceHandles");
var ReactLegacyElement = _dereq_("./ReactLegacyElement");
var ReactMount = _dereq_("./ReactMount");
var ReactMultiChild = _dereq_("./ReactMultiChild");
var ReactPerf = _dereq_("./ReactPerf");
var ReactPropTypes = _dereq_("./ReactPropTypes");
var ReactServerRendering = _dereq_("./ReactServerRendering");
var ReactTextComponent = _dereq_("./ReactTextComponent");
var assign = _dereq_("./Object.assign");
var deprecated = _dereq_("./deprecated");
var onlyChild = _dereq_("./onlyChild");
ReactDefaultInjection.inject();
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
if ("production" !== "development") {
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
}
// TODO: Drop legacy elements once classes no longer export these factories
createElement = ReactLegacyElement.wrapCreateElement(
createElement
);
createFactory = ReactLegacyElement.wrapCreateFactory(
createFactory
);
var render = ReactPerf.measure('React', 'render', ReactMount.render);
var React = {
Children: {
map: ReactChildren.map,
forEach: ReactChildren.forEach,
count: ReactChildren.count,
only: onlyChild
},
DOM: ReactDOM,
PropTypes: ReactPropTypes,
initializeTouchEvents: function(shouldUseTouch) {
EventPluginUtils.useTouchEvents = shouldUseTouch;
},
createClass: ReactCompositeComponent.createClass,
createElement: createElement,
createFactory: createFactory,
constructAndRenderComponent: ReactMount.constructAndRenderComponent,
constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
render: render,
renderToString: ReactServerRendering.renderToString,
renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
isValidClass: ReactLegacyElement.isValidClass,
isValidElement: ReactElement.isValidElement,
withContext: ReactContext.withContext,
// Hook for JSX spread, don't use this for anything else.
__spread: assign,
// Deprecations (remove for 0.13)
renderComponent: deprecated(
'React',
'renderComponent',
'render',
this,
render
),
renderComponentToString: deprecated(
'React',
'renderComponentToString',
'renderToString',
this,
ReactServerRendering.renderToString
),
renderComponentToStaticMarkup: deprecated(
'React',
'renderComponentToStaticMarkup',
'renderToStaticMarkup',
this,
ReactServerRendering.renderToStaticMarkup
),
isValidComponent: deprecated(
'React',
'isValidComponent',
'isValidElement',
this,
ReactElement.isValidElement
)
};
// Inject the runtime into a devtools global hook regardless of browser.
// Allows for debugging when the hook is injected on the page.
if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
Component: ReactComponent,
CurrentOwner: ReactCurrentOwner,
DOMComponent: ReactDOMComponent,
DOMPropertyOperations: DOMPropertyOperations,
InstanceHandles: ReactInstanceHandles,
Mount: ReactMount,
MultiChild: ReactMultiChild,
TextComponent: ReactTextComponent
});
}
if ("production" !== "development") {
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
// If we're in Chrome, look for the devtools marker and provide a download
// link if not installed.
if (navigator.userAgent.indexOf('Chrome') > -1) {
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
console.debug(
'Download the React DevTools for a better development experience: ' +
'http://fb.me/react-devtools'
);
}
}
var expectedFeatures = [
// shims
Array.isArray,
Array.prototype.every,
Array.prototype.forEach,
Array.prototype.indexOf,
Array.prototype.map,
Date.now,
Function.prototype.bind,
Object.keys,
String.prototype.split,
String.prototype.trim,
// shams
Object.create,
Object.freeze
];
for (var i = 0; i < expectedFeatures.length; i++) {
if (!expectedFeatures[i]) {
console.error(
'One or more ES5 shim/shams expected by React are not available: ' +
'http://fb.me/react-warning-polyfills'
);
break;
}
}
}
}
// Version exists only in the open-source version of React, not in Facebook's
// internal version.
React.version = '0.12.0';
module.exports = React;
},{"./DOMPropertyOperations":12,"./EventPluginUtils":20,"./ExecutionEnvironment":22,"./Object.assign":27,"./ReactChildren":31,"./ReactComponent":32,"./ReactCompositeComponent":34,"./ReactContext":35,"./ReactCurrentOwner":36,"./ReactDOM":37,"./ReactDOMComponent":39,"./ReactDefaultInjection":49,"./ReactElement":52,"./ReactElementValidator":53,"./ReactInstanceHandles":60,"./ReactLegacyElement":61,"./ReactMount":63,"./ReactMultiChild":64,"./ReactPerf":68,"./ReactPropTypes":72,"./ReactServerRendering":76,"./ReactTextComponent":78,"./deprecated":106,"./onlyChild":137}],2:[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.
*
* @providesModule AutoFocusMixin
* @typechecks static-only
*/
"use strict";
var focusNode = _dereq_("./focusNode");
var AutoFocusMixin = {
componentDidMount: function() {
if (this.props.autoFocus) {
focusNode(this.getDOMNode());
}
}
};
module.exports = AutoFocusMixin;
},{"./focusNode":111}],3:[function(_dereq_,module,exports){
/**
* Copyright 2013 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 BeforeInputEventPlugin
* @typechecks static-only
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var EventPropagators = _dereq_("./EventPropagators");
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var SyntheticInputEvent = _dereq_("./SyntheticInputEvent");
var keyOf = _dereq_("./keyOf");
var canUseTextInputEvent = (
ExecutionEnvironment.canUseDOM &&
'TextEvent' in window &&
!('documentMode' in document || isPresto())
);
/**
* Opera <= 12 includes TextEvent in window, but does not fire
* text input events. Rely on keypress instead.
*/
function isPresto() {
var opera = window.opera;
return (
typeof opera === 'object' &&
typeof opera.version === 'function' &&
parseInt(opera.version(), 10) <= 12
);
}
var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
var topLevelTypes = EventConstants.topLevelTypes;
// Events and their corresponding property names.
var eventTypes = {
beforeInput: {
phasedRegistrationNames: {
bubbled: keyOf({onBeforeInput: null}),
captured: keyOf({onBeforeInputCapture: null})
},
dependencies: [
topLevelTypes.topCompositionEnd,
topLevelTypes.topKeyPress,
topLevelTypes.topTextInput,
topLevelTypes.topPaste
]
}
};
// Track characters inserted via keypress and composition events.
var fallbackChars = null;
// Track whether we've ever handled a keypress on the space key.
var hasSpaceKeypress = false;
/**
* Return whether a native keypress event is assumed to be a command.
* This is required because Firefox fires `keypress` events for key commands
* (cut, copy, select-all, etc.) even though no character is inserted.
*/
function isKeypressCommand(nativeEvent) {
return (
(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
// ctrlKey && altKey is equivalent to AltGr, and is not a command.
!(nativeEvent.ctrlKey && nativeEvent.altKey)
);
}
/**
* Create an `onBeforeInput` event to match
* http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
*
* This event plugin is based on the native `textInput` event
* available in Chrome, Safari, Opera, and IE. This event fires after
* `onKeyPress` and `onCompositionEnd`, but before `onInput`.
*
* `beforeInput` is spec'd but not implemented in any browsers, and
* the `input` event does not provide any useful information about what has
* actually been added, contrary to the spec. Thus, `textInput` is the best
* available event to identify the characters that have actually been inserted
* into the target node.
*/
var BeforeInputEventPlugin = {
eventTypes: eventTypes,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
var chars;
if (canUseTextInputEvent) {
switch (topLevelType) {
case topLevelTypes.topKeyPress:
/**
* If native `textInput` events are available, our goal is to make
* use of them. However, there is a special case: the spacebar key.
* In Webkit, preventing default on a spacebar `textInput` event
* cancels character insertion, but it *also* causes the browser
* to fall back to its default spacebar behavior of scrolling the
* page.
*
* Tracking at:
* https://code.google.com/p/chromium/issues/detail?id=355103
*
* To avoid this issue, use the keypress event as if no `textInput`
* event is available.
*/
var which = nativeEvent.which;
if (which !== SPACEBAR_CODE) {
return;
}
hasSpaceKeypress = true;
chars = SPACEBAR_CHAR;
break;
case topLevelTypes.topTextInput:
// Record the characters to be added to the DOM.
chars = nativeEvent.data;
// If it's a spacebar character, assume that we have already handled
// it at the keypress level and bail immediately. Android Chrome
// doesn't give us keycodes, so we need to blacklist it.
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
return;
}
// Otherwise, carry on.
break;
default:
// For other native event types, do nothing.
return;
}
} else {
switch (topLevelType) {
case topLevelTypes.topPaste:
// If a paste event occurs after a keypress, throw out the input
// chars. Paste events should not lead to BeforeInput events.
fallbackChars = null;
break;
case topLevelTypes.topKeyPress:
/**
* As of v27, Firefox may fire keypress events even when no character
* will be inserted. A few possibilities:
*
* - `which` is `0`. Arrow keys, Esc key, etc.
*
* - `which` is the pressed key code, but no char is available.
* Ex: 'AltGr + d` in Polish. There is no modified character for
* this key combination and no character is inserted into the
* document, but FF fires the keypress for char code `100` anyway.
* No `input` event will occur.
*
* - `which` is the pressed key code, but a command combination is
* being used. Ex: `Cmd+C`. No character is inserted, and no
* `input` event will occur.
*/
if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
fallbackChars = String.fromCharCode(nativeEvent.which);
}
break;
case topLevelTypes.topCompositionEnd:
fallbackChars = nativeEvent.data;
break;
}
// If no changes have occurred to the fallback string, no relevant
// event has fired and we're done.
if (fallbackChars === null) {
return;
}
chars = fallbackChars;
}
// If no characters are being inserted, no BeforeInput event should
// be fired.
if (!chars) {
return;
}
var event = SyntheticInputEvent.getPooled(
eventTypes.beforeInput,
topLevelTargetID,
nativeEvent
);
event.data = chars;
fallbackChars = null;
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
};
module.exports = BeforeInputEventPlugin;
},{"./EventConstants":16,"./EventPropagators":21,"./ExecutionEnvironment":22,"./SyntheticInputEvent":89,"./keyOf":133}],4:[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.
*
* @providesModule CSSProperty
*/
"use strict";
/**
* CSS properties which accept numbers but are not in units of "px".
*/
var isUnitlessNumber = {
columnCount: true,
fillOpacity: true,
flex: true,
flexGrow: true,
flexShrink: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
opacity: true,
order: true,
orphans: true,
widows: true,
zIndex: true,
zoom: true
};
/**
* @param {string} prefix vendor-specific prefix, eg: Webkit
* @param {string} key style name, eg: transitionDuration
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
* WebkitTransitionDuration
*/
function prefixKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
/**
* Support style names that may come passed in prefixed by adding permutations
* of vendor prefixes.
*/
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.
Object.keys(isUnitlessNumber).forEach(function(prop) {
prefixes.forEach(function(prefix) {
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
});
});
/**
* Most style properties can be unset by doing .style[prop] = '' but IE8
* doesn't like doing that with shorthand properties so for the properties that
* IE8 breaks on, which are listed here, we instead unset each of the
* individual properties. See http://bugs.jquery.com/ticket/12385.
* The 4-value 'clock' properties like margin, padding, border-width seem to
* behave without any problems. Curiously, list-style works too without any
* special prodding.
*/
var shorthandPropertyExpansions = {
background: {
backgroundImage: true,
backgroundPosition: true,
backgroundRepeat: true,
backgroundColor: true
},
border: {
borderWidth: true,
borderStyle: true,
borderColor: true
},
borderBottom: {
borderBottomWidth: true,
borderBottomStyle: true,
borderBottomColor: true
},
borderLeft: {
borderLeftWidth: true,
borderLeftStyle: true,
borderLeftColor: true
},
borderRight: {
borderRightWidth: true,
borderRightStyle: true,
borderRightColor: true
},
borderTop: {
borderTopWidth: true,
borderTopStyle: true,
borderTopColor: true
},
font: {
fontStyle: true,
fontVariant: true,
fontWeight: true,
fontSize: true,
lineHeight: true,
fontFamily: true
}
};
var CSSProperty = {
isUnitlessNumber: isUnitlessNumber,
shorthandPropertyExpansions: shorthandPropertyExpansions
};
module.exports = CSSProperty;
},{}],5:[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.
*
* @providesModule CSSPropertyOperations
* @typechecks static-only
*/
"use strict";
var CSSProperty = _dereq_("./CSSProperty");
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var camelizeStyleName = _dereq_("./camelizeStyleName");
var dangerousStyleValue = _dereq_("./dangerousStyleValue");
var hyphenateStyleName = _dereq_("./hyphenateStyleName");
var memoizeStringOnly = _dereq_("./memoizeStringOnly");
var warning = _dereq_("./warning");
var processStyleName = memoizeStringOnly(function(styleName) {
return hyphenateStyleName(styleName);
});
var styleFloatAccessor = 'cssFloat';
if (ExecutionEnvironment.canUseDOM) {
// IE8 only supports accessing cssFloat (standard) as styleFloat
if (document.documentElement.style.cssFloat === undefined) {
styleFloatAccessor = 'styleFloat';
}
}
if ("production" !== "development") {
var warnedStyleNames = {};
var warnHyphenatedStyleName = function(name) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
return;
}
warnedStyleNames[name] = true;
("production" !== "development" ? warning(
false,
'Unsupported style property ' + name + '. Did you mean ' +
camelizeStyleName(name) + '?'
) : null);
};
}
/**
* Operations for dealing with CSS properties.
*/
var CSSPropertyOperations = {
/**
* Serializes a mapping of style properties for use as inline styles:
*
* > createMarkupForStyles({width: '200px', height: 0})
* "width:200px;height:0;"
*
* Undefined values are ignored so that declarative programming is easier.
* The result should be HTML-escaped before insertion into the DOM.
*
* @param {object} styles
* @return {?string}
*/
createMarkupForStyles: function(styles) {
var serialized = '';
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
if ("production" !== "development") {
if (styleName.indexOf('-') > -1) {
warnHyphenatedStyleName(styleName);
}
}
var styleValue = styles[styleName];
if (styleValue != null) {
serialized += processStyleName(styleName) + ':';
serialized += dangerousStyleValue(styleName, styleValue) + ';';
}
}
return serialized || null;
},
/**
* Sets the value for multiple styles on a node. If a value is specified as
* '' (empty string), the corresponding style property will be unset.
*
* @param {DOMElement} node
* @param {object} styles
*/
setValueForStyles: function(node, styles) {
var style = node.style;
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
if ("production" !== "development") {
if (styleName.indexOf('-') > -1) {
warnHyphenatedStyleName(styleName);
}
}
var styleValue = dangerousStyleValue(styleName, styles[styleName]);
if (styleName === 'float') {
styleName = styleFloatAccessor;
}
if (styleValue) {
style[styleName] = styleValue;
} else {
var expansion = CSSProperty.shorthandPropertyExpansions[styleName];
if (expansion) {
// Shorthand property that IE8 won't like unsetting, so unset each
// component to placate it
for (var individualStyleName in expansion) {
style[individualStyleName] = '';
}
} else {
style[styleName] = '';
}
}
}
}
};
module.exports = CSSPropertyOperations;
},{"./CSSProperty":4,"./ExecutionEnvironment":22,"./camelizeStyleName":100,"./dangerousStyleValue":105,"./hyphenateStyleName":124,"./memoizeStringOnly":135,"./warning":145}],6:[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.
*
* @providesModule CallbackQueue
*/
"use strict";
var PooledClass = _dereq_("./PooledClass");
var assign = _dereq_("./Object.assign");
var invariant = _dereq_("./invariant");
/**
* A specialized pseudo-event module to help keep track of components waiting to
* be notified when their DOM representations are available for use.
*
* This implements `PooledClass`, so you should never need to instantiate this.
* Instead, use `CallbackQueue.getPooled()`.
*
* @class ReactMountReady
* @implements PooledClass
* @internal
*/
function CallbackQueue() {
this._callbacks = null;
this._contexts = null;
}
assign(CallbackQueue.prototype, {
/**
* Enqueues a callback to be invoked when `notifyAll` is invoked.
*
* @param {function} callback Invoked when `notifyAll` is invoked.
* @param {?object} context Context to call `callback` with.
* @internal
*/
enqueue: function(callback, context) {
this._callbacks = this._callbacks || [];
this._contexts = this._contexts || [];
this._callbacks.push(callback);
this._contexts.push(context);
},
/**
* Invokes all enqueued callbacks and clears the queue. This is invoked after
* the DOM representation of a component has been created or updated.
*
* @internal
*/
notifyAll: function() {
var callbacks = this._callbacks;
var contexts = this._contexts;
if (callbacks) {
("production" !== "development" ? invariant(
callbacks.length === contexts.length,
"Mismatched list of contexts in callback queue"
) : invariant(callbacks.length === contexts.length));
this._callbacks = null;
this._contexts = null;
for (var i = 0, l = callbacks.length; i < l; i++) {
callbacks[i].call(contexts[i]);
}
callbacks.length = 0;
contexts.length = 0;
}
},
/**
* Resets the internal queue.
*
* @internal
*/
reset: function() {
this._callbacks = null;
this._contexts = null;
},
/**
* `PooledClass` looks for this.
*/
destructor: function() {
this.reset();
}
});
PooledClass.addPoolingTo(CallbackQueue);
module.exports = CallbackQueue;
},{"./Object.assign":27,"./PooledClass":28,"./invariant":126}],7:[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.
*
* @providesModule ChangeEventPlugin
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var EventPluginHub = _dereq_("./EventPluginHub");
var EventPropagators = _dereq_("./EventPropagators");
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var ReactUpdates = _dereq_("./ReactUpdates");
var SyntheticEvent = _dereq_("./SyntheticEvent");
var isEventSupported = _dereq_("./isEventSupported");
var isTextInputElement = _dereq_("./isTextInputElement");
var keyOf = _dereq_("./keyOf");
var topLevelTypes = EventConstants.topLevelTypes;
var eventTypes = {
change: {
phasedRegistrationNames: {
bubbled: keyOf({onChange: null}),
captured: keyOf({onChangeCapture: null})
},
dependencies: [
topLevelTypes.topBlur,
topLevelTypes.topChange,
topLevelTypes.topClick,
topLevelTypes.topFocus,
topLevelTypes.topInput,
topLevelTypes.topKeyDown,
topLevelTypes.topKeyUp,
topLevelTypes.topSelectionChange
]
}
};
/**
* For IE shims
*/
var activeElement = null;
var activeElementID = null;
var activeElementValue = null;
var activeElementValueProp = null;
/**
* SECTION: handle `change` event
*/
function shouldUseChangeEvent(elem) {
return (
elem.nodeName === 'SELECT' ||
(elem.nodeName === 'INPUT' && elem.type === 'file')
);
}
var doesChangeEventBubble = false;
if (ExecutionEnvironment.canUseDOM) {
// See `handleChange` comment below
doesChangeEventBubble = isEventSupported('change') && (
!('documentMode' in document) || document.documentMode > 8
);
}
function manualDispatchChangeEvent(nativeEvent) {
var event = SyntheticEvent.getPooled(
eventTypes.change,
activeElementID,
nativeEvent
);
EventPropagators.accumulateTwoPhaseDispatches(event);
// If change and propertychange bubbled, we'd just bind to it like all the
// other events and have it go through ReactBrowserEventEmitter. Since it
// doesn't, we manually listen for the events and so we have to enqueue and
// process the abstract event manually.
//
// Batching is necessary here in order to ensure that all event handlers run
// before the next rerender (including event handlers attached to ancestor
// elements instead of directly on the input). Without this, controlled
// components don't work properly in conjunction with event bubbling because
// the component is rerendered and the value reverted before all the event
// handlers can run. See https://github.com/facebook/react/issues/708.
ReactUpdates.batchedUpdates(runEventInBatch, event);
}
function runEventInBatch(event) {
EventPluginHub.enqueueEvents(event);
EventPluginHub.processEventQueue();
}
function startWatchingForChangeEventIE8(target, targetID) {
activeElement = target;
activeElementID = targetID;
activeElement.attachEvent('onchange', manualDispatchChangeEvent);
}
function stopWatchingForChangeEventIE8() {
if (!activeElement) {
return;
}
activeElement.detachEvent('onchange', manualDispatchChangeEvent);
activeElement = null;
activeElementID = null;
}
function getTargetIDForChangeEvent(
topLevelType,
topLevelTarget,
topLevelTargetID) {
if (topLevelType === topLevelTypes.topChange) {
return topLevelTargetID;
}
}
function handleEventsForChangeEventIE8(
topLevelType,
topLevelTarget,
topLevelTargetID) {
if (topLevelType === topLevelTypes.topFocus) {
// stopWatching() should be a noop here but we call it just in case we
// missed a blur event somehow.
stopWatchingForChangeEventIE8();
startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
} else if (topLevelType === topLevelTypes.topBlur) {
stopWatchingForChangeEventIE8();
}
}
/**
* SECTION: handle `input` event
*/
var isInputEventSupported = false;
if (ExecutionEnvironment.canUseDOM) {
// IE9 claims to support the input event but fails to trigger it when
// deleting text, so we ignore its input events
isInputEventSupported = isEventSupported('input') && (
!('documentMode' in document) || document.documentMode > 9
);
}
/**
* (For old IE.) Replacement getter/setter for the `value` property that gets
* set on the active element.
*/
var newValueProp = {
get: function() {
return activeElementValueProp.get.call(this);
},
set: function(val) {
// Cast to a string so we can do equality checks.
activeElementValue = '' + val;
activeElementValueProp.set.call(this, val);
}
};
/**
* (For old IE.) Starts tracking propertychange events on the passed-in element
* and override the value property so that we can distinguish user events from
* value changes in JS.
*/
function startWatchingForValueChange(target, targetID) {
activeElement = target;
activeElementID = targetID;
activeElementValue = target.value;
activeElementValueProp = Object.getOwnPropertyDescriptor(
target.constructor.prototype,
'value'
);
Object.defineProperty(activeElement, 'value', newValueProp);
activeElement.attachEvent('onpropertychange', handlePropertyChange);
}
/**
* (For old IE.) Removes the event listeners from the currently-tracked element,
* if any exists.
*/
function stopWatchingForValueChange() {
if (!activeElement) {
return;
}
// delete restores the original property definition
delete activeElement.value;
activeElement.detachEvent('onpropertychange', handlePropertyChange);
activeElement = null;
activeElementID = null;
activeElementValue = null;
activeElementValueProp = null;
}
/**
* (For old IE.) Handles a propertychange event, sending a `change` event if
* the value of the active element has changed.
*/
function handlePropertyChange(nativeEvent) {
if (nativeEvent.propertyName !== 'value') {
return;
}
var value = nativeEvent.srcElement.value;
if (value === activeElementValue) {
return;
}
activeElementValue = value;
manualDispatchChangeEvent(nativeEvent);
}
/**
* If a `change` event should be fired, returns the target's ID.
*/
function getTargetIDForInputEvent(
topLevelType,
topLevelTarget,
topLevelTargetID) {
if (topLevelType === topLevelTypes.topInput) {
// In modern browsers (i.e., not IE8 or IE9), the input event is exactly
// what we want so fall through here and trigger an abstract event
return topLevelTargetID;
}
}
// For IE8 and IE9.
function handleEventsForInputEventIE(
topLevelType,
topLevelTarget,
topLevelTargetID) {
if (topLevelType === topLevelTypes.topFocus) {
// In IE8, we can capture almost all .value changes by adding a
// propertychange handler and looking for events with propertyName
// equal to 'value'
// In IE9, propertychange fires for most input events but is buggy and
// doesn't fire when text is deleted, but conveniently, selectionchange
// appears to fire in all of the remaining cases so we catch those and
// forward the event if the value has changed
// In either case, we don't want to call the event handler if the value
// is changed from JS so we redefine a setter for `.value` that updates
// our activeElementValue variable, allowing us to ignore those changes
//
// stopWatching() should be a noop here but we call it just in case we
// missed a blur event somehow.
stopWatchingForValueChange();
startWatchingForValueChange(topLevelTarget, topLevelTargetID);
} else if (topLevelType === topLevelTypes.topBlur) {
stopWatchingForValueChange();
}
}
// For IE8 and IE9.
function getTargetIDForInputEventIE(
topLevelType,
topLevelTarget,
topLevelTargetID) {
if (topLevelType === topLevelTypes.topSelectionChange ||
topLevelType === topLevelTypes.topKeyUp ||
topLevelType === topLevelTypes.topKeyDown) {
// On the selectionchange event, the target is just document which isn't
// helpful for us so just check activeElement instead.
//
// 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
// propertychange on the first input event after setting `value` from a
// script and fires only keydown, keypress, keyup. Catching keyup usually
// gets it and catching keydown lets us fire an event for the first
// keystroke if user does a key repeat (it'll be a little delayed: right
// before the second keystroke). Other input methods (e.g., paste) seem to
// fire selectionchange normally.
if (activeElement && activeElement.value !== activeElementValue) {
activeElementValue = activeElement.value;
return activeElementID;
}
}
}
/**
* SECTION: handle `click` event
*/
function shouldUseClickEvent(elem) {
// Use the `click` event to detect changes to checkbox and radio inputs.
// This approach works across all browsers, whereas `change` does not fire
// until `blur` in IE8.
return (
elem.nodeName === 'INPUT' &&
(elem.type === 'checkbox' || elem.type === 'radio')
);
}
function getTargetIDForClickEvent(
topLevelType,
topLevelTarget,
topLevelTargetID) {
if (topLevelType === topLevelTypes.topClick) {
return topLevelTargetID;
}
}
/**
* This plugin creates an `onChange` event that normalizes change events
* across form elements. This event fires at a time when it's possible to
* change the element's value without seeing a flicker.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - select
*/
var ChangeEventPlugin = {
eventTypes: eventTypes,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
var getTargetIDFunc, handleEventFunc;
if (shouldUseChangeEvent(topLevelTarget)) {
if (doesChangeEventBubble) {
getTargetIDFunc = getTargetIDForChangeEvent;
} else {
handleEventFunc = handleEventsForChangeEventIE8;
}
} else if (isTextInputElement(topLevelTarget)) {
if (isInputEventSupported) {
getTargetIDFunc = getTargetIDForInputEvent;
} else {
getTargetIDFunc = getTargetIDForInputEventIE;
handleEventFunc = handleEventsForInputEventIE;
}
} else if (shouldUseClickEvent(topLevelTarget)) {
getTargetIDFunc = getTargetIDForClickEvent;
}
if (getTargetIDFunc) {
var targetID = getTargetIDFunc(
topLevelType,
topLevelTarget,
topLevelTargetID
);
if (targetID) {
var event = SyntheticEvent.getPooled(
eventTypes.change,
targetID,
nativeEvent
);
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
}
if (handleEventFunc) {
handleEventFunc(
topLevelType,
topLevelTarget,
topLevelTargetID
);
}
}
};
module.exports = ChangeEventPlugin;
},{"./EventConstants":16,"./EventPluginHub":18,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactUpdates":79,"./SyntheticEvent":87,"./isEventSupported":127,"./isTextInputElement":129,"./keyOf":133}],8:[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.
*
* @providesModule ClientReactRootIndex
* @typechecks
*/
"use strict";
var nextReactRootIndex = 0;
var ClientReactRootIndex = {
createReactRootIndex: function() {
return nextReactRootIndex++;
}
};
module.exports = ClientReactRootIndex;
},{}],9:[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.
*
* @providesModule CompositionEventPlugin
* @typechecks static-only
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var EventPropagators = _dereq_("./EventPropagators");
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var ReactInputSelection = _dereq_("./ReactInputSelection");
var SyntheticCompositionEvent = _dereq_("./SyntheticCompositionEvent");
var getTextContentAccessor = _dereq_("./getTextContentAccessor");
var keyOf = _dereq_("./keyOf");
var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
var START_KEYCODE = 229;
var useCompositionEvent = (
ExecutionEnvironment.canUseDOM &&
'CompositionEvent' in window
);
// In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. In Korean, for example,
// the compositionend event contains only one character regardless of
// how many characters have been composed since compositionstart.
// We therefore use the fallback data while still using the native
// events as triggers.
var useFallbackData = (
!useCompositionEvent ||
(
'documentMode' in document &&
document.documentMode > 8 &&
document.documentMode <= 11
)
);
var topLevelTypes = EventConstants.topLevelTypes;
var currentComposition = null;
// Events and their corresponding property names.
var eventTypes = {
compositionEnd: {
phasedRegistrationNames: {
bubbled: keyOf({onCompositionEnd: null}),
captured: keyOf({onCompositionEndCapture: null})
},
dependencies: [
topLevelTypes.topBlur,
topLevelTypes.topCompositionEnd,
topLevelTypes.topKeyDown,
topLevelTypes.topKeyPress,
topLevelTypes.topKeyUp,
topLevelTypes.topMouseDown
]
},
compositionStart: {
phasedRegistrationNames: {
bubbled: keyOf({onCompositionStart: null}),
captured: keyOf({onCompositionStartCapture: null})
},
dependencies: [
topLevelTypes.topBlur,
topLevelTypes.topCompositionStart,
topLevelTypes.topKeyDown,
topLevelTypes.topKeyPress,
topLevelTypes.topKeyUp,
topLevelTypes.topMouseDown
]
},
compositionUpdate: {
phasedRegistrationNames: {
bubbled: keyOf({onCompositionUpdate: null}),
captured: keyOf({onCompositionUpdateCapture: null})
},
dependencies: [
topLevelTypes.topBlur,
topLevelTypes.topCompositionUpdate,
topLevelTypes.topKeyDown,
topLevelTypes.topKeyPress,
topLevelTypes.topKeyUp,
topLevelTypes.topMouseDown
]
}
};
/**
* Translate native top level events into event types.
*
* @param {string} topLevelType
* @return {object}
*/
function getCompositionEventType(topLevelType) {
switch (topLevelType) {
case topLevelTypes.topCompositionStart:
return eventTypes.compositionStart;
case topLevelTypes.topCompositionEnd:
return eventTypes.compositionEnd;
case topLevelTypes.topCompositionUpdate:
return eventTypes.compositionUpdate;
}
}
/**
* Does our fallback best-guess model think this event signifies that
* composition has begun?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackStart(topLevelType, nativeEvent) {
return (
topLevelType === topLevelTypes.topKeyDown &&
nativeEvent.keyCode === START_KEYCODE
);
}
/**
* Does our fallback mode think that this event is the end of composition?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackEnd(topLevelType, nativeEvent) {
switch (topLevelType) {
case topLevelTypes.topKeyUp:
// Command keys insert or clear IME input.
return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1);
case topLevelTypes.topKeyDown:
// Expect IME keyCode on each keydown. If we get any other
// code we must have exited earlier.
return (nativeEvent.keyCode !== START_KEYCODE);
case topLevelTypes.topKeyPress:
case topLevelTypes.topMouseDown:
case topLevelTypes.topBlur:
// Events are not possible without cancelling IME.
return true;
default:
return false;
}
}
/**
* Helper class stores information about selection and document state
* so we can figure out what changed at a later date.
*
* @param {DOMEventTarget} root
*/
function FallbackCompositionState(root) {
this.root = root;
this.startSelection = ReactInputSelection.getSelection(root);
this.startValue = this.getText();
}
/**
* Get current text of input.
*
* @return {string}
*/
FallbackCompositionState.prototype.getText = function() {
return this.root.value || this.root[getTextContentAccessor()];
};
/**
* Text that has changed since the start of composition.
*
* @return {string}
*/
FallbackCompositionState.prototype.getData = function() {
var endValue = this.getText();
var prefixLength = this.startSelection.start;
var suffixLength = this.startValue.length - this.startSelection.end;
return endValue.substr(
prefixLength,
endValue.length - suffixLength - prefixLength
);
};
/**
* This plugin creates `onCompositionStart`, `onCompositionUpdate` and
* `onCompositionEnd` events on inputs, textareas and contentEditable
* nodes.
*/
var CompositionEventPlugin = {
eventTypes: eventTypes,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
var eventType;
var data;
if (useCompositionEvent) {
eventType = getCompositionEventType(topLevelType);
} else if (!currentComposition) {
if (isFallbackStart(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionStart;
}
} else if (isFallbackEnd(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionEnd;
}
if (useFallbackData) {
// The current composition is stored statically and must not be
// overwritten while composition continues.
if (!currentComposition && eventType === eventTypes.compositionStart) {
currentComposition = new FallbackCompositionState(topLevelTarget);
} else if (eventType === eventTypes.compositionEnd) {
if (currentComposition) {
data = currentComposition.getData();
currentComposition = null;
}
}
}
if (eventType) {
var event = SyntheticCompositionEvent.getPooled(
eventType,
topLevelTargetID,
nativeEvent
);
if (data) {
// Inject data generated from fallback path into the synthetic event.
// This matches the property of native CompositionEventInterface.
event.data = data;
}
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
}
};
module.exports = CompositionEventPlugin;
},{"./EventConstants":16,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactInputSelection":59,"./SyntheticCompositionEvent":85,"./getTextContentAccessor":121,"./keyOf":133}],10:[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.
*
* @providesModule DOMChildrenOperations
* @typechecks static-only
*/
"use strict";
var Danger = _dereq_("./Danger");
var ReactMultiChildUpdateTypes = _dereq_("./ReactMultiChildUpdateTypes");
var getTextContentAccessor = _dereq_("./getTextContentAccessor");
var invariant = _dereq_("./invariant");
/**
* The DOM property to use when setting text content.
*
* @type {string}
* @private
*/
var textContentAccessor = getTextContentAccessor();
/**
* Inserts `childNode` as a child of `parentNode` at the `index`.
*
* @param {DOMElement} parentNode Parent node in which to insert.
* @param {DOMElement} childNode Child node to insert.
* @param {number} index Index at which to insert the child.
* @internal
*/
function insertChildAt(parentNode, childNode, index) {
// By exploiting arrays returning `undefined` for an undefined index, we can
// rely exclusively on `insertBefore(node, null)` instead of also using
// `appendChild(node)`. However, using `undefined` is not allowed by all
// browsers so we must replace it with `null`.
parentNode.insertBefore(
childNode,
parentNode.childNodes[index] || null
);
}
var updateTextContent;
if (textContentAccessor === 'textContent') {
/**
* Sets the text content of `node` to `text`.
*
* @param {DOMElement} node Node to change
* @param {string} text New text content
*/
updateTextContent = function(node, text) {
node.textContent = text;
};
} else {
/**
* Sets the text content of `node` to `text`.
*
* @param {DOMElement} node Node to change
* @param {string} text New text content
*/
updateTextContent = function(node, text) {
// In order to preserve newlines correctly, we can't use .innerText to set
// the contents (see #1080), so we empty the element then append a text node
while (node.firstChild) {
node.removeChild(node.firstChild);
}
if (text) {
var doc = node.ownerDocument || document;
node.appendChild(doc.createTextNode(text));
}
};
}
/**
* Operations for updating with DOM children.
*/
var DOMChildrenOperations = {
dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
updateTextContent: updateTextContent,
/**
* Updates a component's children by processing a series of updates. The
* update configurations are each expected to have a `parentNode` property.
*
* @param {array<object>} updates List of update configurations.
* @param {array<string>} markupList List of markup strings.
* @internal
*/
processUpdates: function(updates, markupList) {
var update;
// Mapping from parent IDs to initial child orderings.
var initialChildren = null;
// List of children that will be moved or removed.
var updatedChildren = null;
for (var i = 0; update = updates[i]; i++) {
if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING ||
update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
var updatedIndex = update.fromIndex;
var updatedChild = update.parentNode.childNodes[updatedIndex];
var parentID = update.parentID;
("production" !== "development" ? invariant(
updatedChild,
'processUpdates(): Unable to find child %s of element. This ' +
'probably means the DOM was unexpectedly mutated (e.g., by the ' +
'browser), usually due to forgetting a <tbody> when using tables, ' +
'nesting tags like <form>, <p>, or <a>, or using non-SVG elements '+
'in an <svg> parent. Try inspecting the child nodes of the element ' +
'with React ID `%s`.',
updatedIndex,
parentID
) : invariant(updatedChild));
initialChildren = initialChildren || {};
initialChildren[parentID] = initialChildren[parentID] || [];
initialChildren[parentID][updatedIndex] = updatedChild;
updatedChildren = updatedChildren || [];
updatedChildren.push(updatedChild);
}
}
var renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);
// Remove updated children first so that `toIndex` is consistent.
if (updatedChildren) {
for (var j = 0; j < updatedChildren.length; j++) {
updatedChildren[j].parentNode.removeChild(updatedChildren[j]);
}
}
for (var k = 0; update = updates[k]; k++) {
switch (update.type) {
case ReactMultiChildUpdateTypes.INSERT_MARKUP:
insertChildAt(
update.parentNode,
renderedMarkup[update.markupIndex],
update.toIndex
);
break;
case ReactMultiChildUpdateTypes.MOVE_EXISTING:
insertChildAt(
update.parentNode,
initialChildren[update.parentID][update.fromIndex],
update.toIndex
);
break;
case ReactMultiChildUpdateTypes.TEXT_CONTENT:
updateTextContent(
update.parentNode,
update.textContent
);
break;
case ReactMultiChildUpdateTypes.REMOVE_NODE:
// Already removed by the for-loop above.
break;
}
}
}
};
module.exports = DOMChildrenOperations;
},{"./Danger":13,"./ReactMultiChildUpdateTypes":65,"./getTextContentAccessor":121,"./invariant":126}],11:[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.
*
* @providesModule DOMProperty
* @typechecks static-only
*/
/*jslint bitwise: true */
"use strict";
var invariant = _dereq_("./invariant");
function checkMask(value, bitmask) {
return (value & bitmask) === bitmask;
}
var DOMPropertyInjection = {
/**
* Mapping from normalized, camelcased property names to a configuration that
* specifies how the associated DOM property should be accessed or rendered.
*/
MUST_USE_ATTRIBUTE: 0x1,
MUST_USE_PROPERTY: 0x2,
HAS_SIDE_EFFECTS: 0x4,
HAS_BOOLEAN_VALUE: 0x8,
HAS_NUMERIC_VALUE: 0x10,
HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
/**
* Inject some specialized knowledge about the DOM. This takes a config object
* with the following properties:
*
* isCustomAttribute: function that given an attribute name will return true
* if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
* attributes where it's impossible to enumerate all of the possible
* attribute names,
*
* Properties: object mapping DOM property name to one of the
* DOMPropertyInjection constants or null. If your attribute isn't in here,
* it won't get written to the DOM.
*
* DOMAttributeNames: object mapping React attribute name to the DOM
* attribute name. Attribute names not specified use the **lowercase**
* normalized name.
*
* DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
* Property names not specified use the normalized name.
*
* DOMMutationMethods: Properties that require special mutation methods. If
* `value` is undefined, the mutation method should unset the property.
*
* @param {object} domPropertyConfig the config as described above.
*/
injectDOMPropertyConfig: function(domPropertyConfig) {
var Properties = domPropertyConfig.Properties || {};
var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
if (domPropertyConfig.isCustomAttribute) {
DOMProperty._isCustomAttributeFunctions.push(
domPropertyConfig.isCustomAttribute
);
}
for (var propName in Properties) {
("production" !== "development" ? invariant(
!DOMProperty.isStandardName.hasOwnProperty(propName),
'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' +
'\'%s\' which has already been injected. You may be accidentally ' +
'injecting the same DOM property config twice, or you may be ' +
'injecting two configs that have conflicting property names.',
propName
) : invariant(!DOMProperty.isStandardName.hasOwnProperty(propName)));
DOMProperty.isStandardName[propName] = true;
var lowerCased = propName.toLowerCase();
DOMProperty.getPossibleStandardName[lowerCased] = propName;
if (DOMAttributeNames.hasOwnProperty(propName)) {
var attributeName = DOMAttributeNames[propName];
DOMProperty.getPossibleStandardName[attributeName] = propName;
DOMProperty.getAttributeName[propName] = attributeName;
} else {
DOMProperty.getAttributeName[propName] = lowerCased;
}
DOMProperty.getPropertyName[propName] =
DOMPropertyNames.hasOwnProperty(propName) ?
DOMPropertyNames[propName] :
propName;
if (DOMMutationMethods.hasOwnProperty(propName)) {
DOMProperty.getMutationMethod[propName] = DOMMutationMethods[propName];
} else {
DOMProperty.getMutationMethod[propName] = null;
}
var propConfig = Properties[propName];
DOMProperty.mustUseAttribute[propName] =
checkMask(propConfig, DOMPropertyInjection.MUST_USE_ATTRIBUTE);
DOMProperty.mustUseProperty[propName] =
checkMask(propConfig, DOMPropertyInjection.MUST_USE_PROPERTY);
DOMProperty.hasSideEffects[propName] =
checkMask(propConfig, DOMPropertyInjection.HAS_SIDE_EFFECTS);
DOMProperty.hasBooleanValue[propName] =
checkMask(propConfig, DOMPropertyInjection.HAS_BOOLEAN_VALUE);
DOMProperty.hasNumericValue[propName] =
checkMask(propConfig, DOMPropertyInjection.HAS_NUMERIC_VALUE);
DOMProperty.hasPositiveNumericValue[propName] =
checkMask(propConfig, DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE);
DOMProperty.hasOverloadedBooleanValue[propName] =
checkMask(propConfig, DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE);
("production" !== "development" ? invariant(
!DOMProperty.mustUseAttribute[propName] ||
!DOMProperty.mustUseProperty[propName],
'DOMProperty: Cannot require using both attribute and property: %s',
propName
) : invariant(!DOMProperty.mustUseAttribute[propName] ||
!DOMProperty.mustUseProperty[propName]));
("production" !== "development" ? invariant(
DOMProperty.mustUseProperty[propName] ||
!DOMProperty.hasSideEffects[propName],
'DOMProperty: Properties that have side effects must use property: %s',
propName
) : invariant(DOMProperty.mustUseProperty[propName] ||
!DOMProperty.hasSideEffects[propName]));
("production" !== "development" ? invariant(
!!DOMProperty.hasBooleanValue[propName] +
!!DOMProperty.hasNumericValue[propName] +
!!DOMProperty.hasOverloadedBooleanValue[propName] <= 1,
'DOMProperty: Value can be one of boolean, overloaded boolean, or ' +
'numeric value, but not a combination: %s',
propName
) : invariant(!!DOMProperty.hasBooleanValue[propName] +
!!DOMProperty.hasNumericValue[propName] +
!!DOMProperty.hasOverloadedBooleanValue[propName] <= 1));
}
}
};
var defaultValueCache = {};
/**
* DOMProperty exports lookup objects that can be used like functions:
*
* > DOMProperty.isValid['id']
* true
* > DOMProperty.isValid['foobar']
* undefined
*
* Although this may be confusing, it performs better in general.
*
* @see http://jsperf.com/key-exists
* @see http://jsperf.com/key-missing
*/
var DOMProperty = {
ID_ATTRIBUTE_NAME: 'data-reactid',
/**
* Checks whether a property name is a standard property.
* @type {Object}
*/
isStandardName: {},
/**
* Mapping from lowercase property names to the properly cased version, used
* to warn in the case of missing properties.
* @type {Object}
*/
getPossibleStandardName: {},
/**
* Mapping from normalized names to attribute names that differ. Attribute
* names are used when rendering markup or with `*Attribute()`.
* @type {Object}
*/
getAttributeName: {},
/**
* Mapping from normalized names to properties on DOM node instances.
* (This includes properties that mutate due to external factors.)
* @type {Object}
*/
getPropertyName: {},
/**
* Mapping from normalized names to mutation methods. This will only exist if
* mutation cannot be set simply by the property or `setAttribute()`.
* @type {Object}
*/
getMutationMethod: {},
/**
* Whether the property must be accessed and mutated as an object property.
* @type {Object}
*/
mustUseAttribute: {},
/**
* Whether the property must be accessed and mutated using `*Attribute()`.
* (This includes anything that fails `<propName> in <element>`.)
* @type {Object}
*/
mustUseProperty: {},
/**
* Whether or not setting a value causes side effects such as triggering
* resources to be loaded or text selection changes. We must ensure that
* the value is only set if it has changed.
* @type {Object}
*/
hasSideEffects: {},
/**
* Whether the property should be removed when set to a falsey value.
* @type {Object}
*/
hasBooleanValue: {},
/**
* Whether the property must be numeric or parse as a
* numeric and should be removed when set to a falsey value.
* @type {Object}
*/
hasNumericValue: {},
/**
* Whether the property must be positive numeric or parse as a positive
* numeric and should be removed when set to a falsey value.
* @type {Object}
*/
hasPositiveNumericValue: {},
/**
* Whether the property can be used as a flag as well as with a value. Removed
* when strictly equal to false; present without a value when strictly equal
* to true; present with a value otherwise.
* @type {Object}
*/
hasOverloadedBooleanValue: {},
/**
* All of the isCustomAttribute() functions that have been injected.
*/
_isCustomAttributeFunctions: [],
/**
* Checks whether a property name is a custom attribute.
* @method
*/
isCustomAttribute: function(attributeName) {
for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
if (isCustomAttributeFn(attributeName)) {
return true;
}
}
return false;
},
/**
* Returns the default property value for a DOM property (i.e., not an
* attribute). Most default values are '' or false, but not all. Worse yet,
* some (in particular, `type`) vary depending on the type of element.
*
* TODO: Is it better to grab all the possible properties when creating an
* element to avoid having to create the same element twice?
*/
getDefaultValueForProperty: function(nodeName, prop) {
var nodeDefaults = defaultValueCache[nodeName];
var testElement;
if (!nodeDefaults) {
defaultValueCache[nodeName] = nodeDefaults = {};
}
if (!(prop in nodeDefaults)) {
testElement = document.createElement(nodeName);
nodeDefaults[prop] = testElement[prop];
}
return nodeDefaults[prop];
},
injection: DOMPropertyInjection
};
module.exports = DOMProperty;
},{"./invariant":126}],12:[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.
*
* @providesModule DOMPropertyOperations
* @typechecks static-only
*/
"use strict";
var DOMProperty = _dereq_("./DOMProperty");
var escapeTextForBrowser = _dereq_("./escapeTextForBrowser");
var memoizeStringOnly = _dereq_("./memoizeStringOnly");
var warning = _dereq_("./warning");
function shouldIgnoreValue(name, value) {
return value == null ||
(DOMProperty.hasBooleanValue[name] && !value) ||
(DOMProperty.hasNumericValue[name] && isNaN(value)) ||
(DOMProperty.hasPositiveNumericValue[name] && (value < 1)) ||
(DOMProperty.hasOverloadedBooleanValue[name] && value === false);
}
var processAttributeNameAndPrefix = memoizeStringOnly(function(name) {
return escapeTextForBrowser(name) + '="';
});
if ("production" !== "development") {
var reactProps = {
children: true,
dangerouslySetInnerHTML: true,
key: true,
ref: true
};
var warnedProperties = {};
var warnUnknownProperty = function(name) {
if (reactProps.hasOwnProperty(name) && reactProps[name] ||
warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
return;
}
warnedProperties[name] = true;
var lowerCasedName = name.toLowerCase();
// data-* attributes should be lowercase; suggest the lowercase version
var standardName = (
DOMProperty.isCustomAttribute(lowerCasedName) ?
lowerCasedName :
DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ?
DOMProperty.getPossibleStandardName[lowerCasedName] :
null
);
// For now, only warn when we have a suggested correction. This prevents
// logging too much when using transferPropsTo.
("production" !== "development" ? warning(
standardName == null,
'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'
) : null);
};
}
/**
* Operations for dealing with DOM properties.
*/
var DOMPropertyOperations = {
/**
* Creates markup for the ID property.
*
* @param {string} id Unescaped ID.
* @return {string} Markup string.
*/
createMarkupForID: function(id) {
return processAttributeNameAndPrefix(DOMProperty.ID_ATTRIBUTE_NAME) +
escapeTextForBrowser(id) + '"';
},
/**
* Creates markup for a property.
*
* @param {string} name
* @param {*} value
* @return {?string} Markup string, or null if the property was invalid.
*/
createMarkupForProperty: function(name, value) {
if (DOMProperty.isStandardName.hasOwnProperty(name) &&
DOMProperty.isStandardName[name]) {
if (shouldIgnoreValue(name, value)) {
return '';
}
var attributeName = DOMProperty.getAttributeName[name];
if (DOMProperty.hasBooleanValue[name] ||
(DOMProperty.hasOverloadedBooleanValue[name] && value === true)) {
return escapeTextForBrowser(attributeName);
}
return processAttributeNameAndPrefix(attributeName) +
escapeTextForBrowser(value) + '"';
} else if (DOMProperty.isCustomAttribute(name)) {
if (value == null) {
return '';
}
return processAttributeNameAndPrefix(name) +
escapeTextForBrowser(value) + '"';
} else if ("production" !== "development") {
warnUnknownProperty(name);
}
return null;
},
/**
* Sets the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
* @param {*} value
*/
setValueForProperty: function(node, name, value) {
if (DOMProperty.isStandardName.hasOwnProperty(name) &&
DOMProperty.isStandardName[name]) {
var mutationMethod = DOMProperty.getMutationMethod[name];
if (mutationMethod) {
mutationMethod(node, value);
} else if (shouldIgnoreValue(name, value)) {
this.deleteValueForProperty(node, name);
} else if (DOMProperty.mustUseAttribute[name]) {
// `setAttribute` with objects becomes only `[object]` in IE8/9,
// ('' + value) makes it output the correct toString()-value.
node.setAttribute(DOMProperty.getAttributeName[name], '' + value);
} else {
var propName = DOMProperty.getPropertyName[name];
// Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
// property type before comparing; only `value` does and is string.
if (!DOMProperty.hasSideEffects[name] ||
('' + node[propName]) !== ('' + value)) {
// Contrary to `setAttribute`, object properties are properly
// `toString`ed by IE8/9.
node[propName] = value;
}
}
} else if (DOMProperty.isCustomAttribute(name)) {
if (value == null) {
node.removeAttribute(name);
} else {
node.setAttribute(name, '' + value);
}
} else if ("production" !== "development") {
warnUnknownProperty(name);
}
},
/**
* Deletes the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
*/
deleteValueForProperty: function(node, name) {
if (DOMProperty.isStandardName.hasOwnProperty(name) &&
DOMProperty.isStandardName[name]) {
var mutationMethod = DOMProperty.getMutationMethod[name];
if (mutationMethod) {
mutationMethod(node, undefined);
} else if (DOMProperty.mustUseAttribute[name]) {
node.removeAttribute(DOMProperty.getAttributeName[name]);
} else {
var propName = DOMProperty.getPropertyName[name];
var defaultValue = DOMProperty.getDefaultValueForProperty(
node.nodeName,
propName
);
if (!DOMProperty.hasSideEffects[name] ||
('' + node[propName]) !== defaultValue) {
node[propName] = defaultValue;
}
}
} else if (DOMProperty.isCustomAttribute(name)) {
node.removeAttribute(name);
} else if ("production" !== "development") {
warnUnknownProperty(name);
}
}
};
module.exports = DOMPropertyOperations;
},{"./DOMProperty":11,"./escapeTextForBrowser":109,"./memoizeStringOnly":135,"./warning":145}],13:[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.
*
* @providesModule Danger
* @typechecks static-only
*/
/*jslint evil: true, sub: true */
"use strict";
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var createNodesFromMarkup = _dereq_("./createNodesFromMarkup");
var emptyFunction = _dereq_("./emptyFunction");
var getMarkupWrap = _dereq_("./getMarkupWrap");
var invariant = _dereq_("./invariant");
var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
var RESULT_INDEX_ATTR = 'data-danger-index';
/**
* Extracts the `nodeName` from a string of markup.
*
* NOTE: Extracting the `nodeName` does not require a regular expression match
* because we make assumptions about React-generated markup (i.e. there are no
* spaces surrounding the opening tag and there is at least one attribute).
*
* @param {string} markup String of markup.
* @return {string} Node name of the supplied markup.
* @see http://jsperf.com/extract-nodename
*/
function getNodeName(markup) {
return markup.substring(1, markup.indexOf(' '));
}
var Danger = {
/**
* Renders markup into an array of nodes. The markup is expected to render
* into a list of root nodes. Also, the length of `resultList` and
* `markupList` should be the same.
*
* @param {array<string>} markupList List of markup strings to render.
* @return {array<DOMElement>} List of rendered nodes.
* @internal
*/
dangerouslyRenderMarkup: function(markupList) {
("production" !== "development" ? invariant(
ExecutionEnvironment.canUseDOM,
'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' +
'thread. Make sure `window` and `document` are available globally ' +
'before requiring React when unit testing or use ' +
'React.renderToString for server rendering.'
) : invariant(ExecutionEnvironment.canUseDOM));
var nodeName;
var markupByNodeName = {};
// Group markup by `nodeName` if a wrap is necessary, else by '*'.
for (var i = 0; i < markupList.length; i++) {
("production" !== "development" ? invariant(
markupList[i],
'dangerouslyRenderMarkup(...): Missing markup.'
) : invariant(markupList[i]));
nodeName = getNodeName(markupList[i]);
nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
markupByNodeName[nodeName][i] = markupList[i];
}
var resultList = [];
var resultListAssignmentCount = 0;
for (nodeName in markupByNodeName) {
if (!markupByNodeName.hasOwnProperty(nodeName)) {
continue;
}
var markupListByNodeName = markupByNodeName[nodeName];
// This for-in loop skips the holes of the sparse array. The order of
// iteration should follow the order of assignment, which happens to match
// numerical index order, but we don't rely on that.
for (var resultIndex in markupListByNodeName) {
if (markupListByNodeName.hasOwnProperty(resultIndex)) {
var markup = markupListByNodeName[resultIndex];
// Push the requested markup with an additional RESULT_INDEX_ATTR
// attribute. If the markup does not start with a < character, it
// will be discarded below (with an appropriate console.error).
markupListByNodeName[resultIndex] = markup.replace(
OPEN_TAG_NAME_EXP,
// This index will be parsed back out below.
'$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" '
);
}
}
// Render each group of markup with similar wrapping `nodeName`.
var renderNodes = createNodesFromMarkup(
markupListByNodeName.join(''),
emptyFunction // Do nothing special with <script> tags.
);
for (i = 0; i < renderNodes.length; ++i) {
var renderNode = renderNodes[i];
if (renderNode.hasAttribute &&
renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
renderNode.removeAttribute(RESULT_INDEX_ATTR);
("production" !== "development" ? invariant(
!resultList.hasOwnProperty(resultIndex),
'Danger: Assigning to an already-occupied result index.'
) : invariant(!resultList.hasOwnProperty(resultIndex)));
resultList[resultIndex] = renderNode;
// This should match resultList.length and markupList.length when
// we're done.
resultListAssignmentCount += 1;
} else if ("production" !== "development") {
console.error(
"Danger: Discarding unexpected node:",
renderNode
);
}
}
}
// Although resultList was populated out of order, it should now be a dense
// array.
("production" !== "development" ? invariant(
resultListAssignmentCount === resultList.length,
'Danger: Did not assign to every index of resultList.'
) : invariant(resultListAssignmentCount === resultList.length));
("production" !== "development" ? invariant(
resultList.length === markupList.length,
'Danger: Expected markup to render %s nodes, but rendered %s.',
markupList.length,
resultList.length
) : invariant(resultList.length === markupList.length));
return resultList;
},
/**
* Replaces a node with a string of markup at its current position within its
* parent. The markup must render into a single root node.
*
* @param {DOMElement} oldChild Child node to replace.
* @param {string} markup Markup to render in place of the child node.
* @internal
*/
dangerouslyReplaceNodeWithMarkup: function(oldChild, markup) {
("production" !== "development" ? invariant(
ExecutionEnvironment.canUseDOM,
'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' +
'worker thread. Make sure `window` and `document` are available ' +
'globally before requiring React when unit testing or use ' +
'React.renderToString for server rendering.'
) : invariant(ExecutionEnvironment.canUseDOM));
("production" !== "development" ? invariant(markup, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(markup));
("production" !== "development" ? invariant(
oldChild.tagName.toLowerCase() !== 'html',
'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' +
'<html> node. This is because browser quirks make this unreliable ' +
'and/or slow. If you want to render to the root you must use ' +
'server rendering. See renderComponentToString().'
) : invariant(oldChild.tagName.toLowerCase() !== 'html'));
var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
oldChild.parentNode.replaceChild(newChild, oldChild);
}
};
module.exports = Danger;
},{"./ExecutionEnvironment":22,"./createNodesFromMarkup":104,"./emptyFunction":107,"./getMarkupWrap":118,"./invariant":126}],14:[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.
*
* @providesModule DefaultEventPluginOrder
*/
"use strict";
var keyOf = _dereq_("./keyOf");
/**
* Module that is injectable into `EventPluginHub`, that specifies a
* deterministic ordering of `EventPlugin`s. A convenient way to reason about
* plugins, without having to package every one of them. This is better than
* having plugins be ordered in the same order that they are injected because
* that ordering would be influenced by the packaging order.
* `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
* preventing default on events is convenient in `SimpleEventPlugin` handlers.
*/
var DefaultEventPluginOrder = [
keyOf({ResponderEventPlugin: null}),
keyOf({SimpleEventPlugin: null}),
keyOf({TapEventPlugin: null}),
keyOf({EnterLeaveEventPlugin: null}),
keyOf({ChangeEventPlugin: null}),
keyOf({SelectEventPlugin: null}),
keyOf({CompositionEventPlugin: null}),
keyOf({BeforeInputEventPlugin: null}),
keyOf({AnalyticsEventPlugin: null}),
keyOf({MobileSafariClickEventPlugin: null})
];
module.exports = DefaultEventPluginOrder;
},{"./keyOf":133}],15:[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.
*
* @providesModule EnterLeaveEventPlugin
* @typechecks static-only
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var EventPropagators = _dereq_("./EventPropagators");
var SyntheticMouseEvent = _dereq_("./SyntheticMouseEvent");
var ReactMount = _dereq_("./ReactMount");
var keyOf = _dereq_("./keyOf");
var topLevelTypes = EventConstants.topLevelTypes;
var getFirstReactDOM = ReactMount.getFirstReactDOM;
var eventTypes = {
mouseEnter: {
registrationName: keyOf({onMouseEnter: null}),
dependencies: [
topLevelTypes.topMouseOut,
topLevelTypes.topMouseOver
]
},
mouseLeave: {
registrationName: keyOf({onMouseLeave: null}),
dependencies: [
topLevelTypes.topMouseOut,
topLevelTypes.topMouseOver
]
}
};
var extractedEvents = [null, null];
var EnterLeaveEventPlugin = {
eventTypes: eventTypes,
/**
* For almost every interaction we care about, there will be both a top-level
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
* we do not extract duplicate events. However, moving the mouse into the
* browser from outside will not fire a `mouseout` event. In this case, we use
* the `mouseover` top-level event.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
if (topLevelType === topLevelTypes.topMouseOver &&
(nativeEvent.relatedTarget || nativeEvent.fromElement)) {
return null;
}
if (topLevelType !== topLevelTypes.topMouseOut &&
topLevelType !== topLevelTypes.topMouseOver) {
// Must not be a mouse in or mouse out - ignoring.
return null;
}
var win;
if (topLevelTarget.window === topLevelTarget) {
// `topLevelTarget` is probably a window object.
win = topLevelTarget;
} else {
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
var doc = topLevelTarget.ownerDocument;
if (doc) {
win = doc.defaultView || doc.parentWindow;
} else {
win = window;
}
}
var from, to;
if (topLevelType === topLevelTypes.topMouseOut) {
from = topLevelTarget;
to =
getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement) ||
win;
} else {
from = win;
to = topLevelTarget;
}
if (from === to) {
// Nothing pertains to our managed components.
return null;
}
var fromID = from ? ReactMount.getID(from) : '';
var toID = to ? ReactMount.getID(to) : '';
var leave = SyntheticMouseEvent.getPooled(
eventTypes.mouseLeave,
fromID,
nativeEvent
);
leave.type = 'mouseleave';
leave.target = from;
leave.relatedTarget = to;
var enter = SyntheticMouseEvent.getPooled(
eventTypes.mouseEnter,
toID,
nativeEvent
);
enter.type = 'mouseenter';
enter.target = to;
enter.relatedTarget = from;
EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID);
extractedEvents[0] = leave;
extractedEvents[1] = enter;
return extractedEvents;
}
};
module.exports = EnterLeaveEventPlugin;
},{"./EventConstants":16,"./EventPropagators":21,"./ReactMount":63,"./SyntheticMouseEvent":91,"./keyOf":133}],16:[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.
*
* @providesModule EventConstants
*/
"use strict";
var keyMirror = _dereq_("./keyMirror");
var PropagationPhases = keyMirror({bubbled: null, captured: null});
/**
* Types of raw signals from the browser caught at the top level.
*/
var topLevelTypes = keyMirror({
topBlur: null,
topChange: null,
topClick: null,
topCompositionEnd: null,
topCompositionStart: null,
topCompositionUpdate: null,
topContextMenu: null,
topCopy: null,
topCut: null,
topDoubleClick: null,
topDrag: null,
topDragEnd: null,
topDragEnter: null,
topDragExit: null,
topDragLeave: null,
topDragOver: null,
topDragStart: null,
topDrop: null,
topError: null,
topFocus: null,
topInput: null,
topKeyDown: null,
topKeyPress: null,
topKeyUp: null,
topLoad: null,
topMouseDown: null,
topMouseMove: null,
topMouseOut: null,
topMouseOver: null,
topMouseUp: null,
topPaste: null,
topReset: null,
topScroll: null,
topSelectionChange: null,
topSubmit: null,
topTextInput: null,
topTouchCancel: null,
topTouchEnd: null,
topTouchMove: null,
topTouchStart: null,
topWheel: null
});
var EventConstants = {
topLevelTypes: topLevelTypes,
PropagationPhases: PropagationPhases
};
module.exports = EventConstants;
},{"./keyMirror":132}],17:[function(_dereq_,module,exports){
/**
* Copyright 2013-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.
*
* @providesModule EventListener
* @typechecks
*/
var emptyFunction = _dereq_("./emptyFunction");
/**
* Upstream version of event listener. Does not take into account specific
* nature of platform.
*/
var EventListener = {
/**
* Listen to DOM events during the bubble phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
listen: function(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
return {
remove: function() {
target.removeEventListener(eventType, callback, false);
}
};
} else if (target.attachEvent) {
target.attachEvent('on' + eventType, callback);
return {
remove: function() {
target.detachEvent('on' + eventType, callback);
}
};
}
},
/**
* Listen to DOM events during the capture phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
capture: function(target, eventType, callback) {
if (!target.addEventListener) {
if ("production" !== "development") {
console.error(
'Attempted to listen to events during the capture phase on a ' +
'browser that does not support the capture phase. Your application ' +
'will not receive some events.'
);
}
return {
remove: emptyFunction
};
} else {
target.addEventListener(eventType, callback, true);
return {
remove: function() {
target.removeEventListener(eventType, callback, true);
}
};
}
},
registerDefault: function() {}
};
module.exports = EventListener;
},{"./emptyFunction":107}],18:[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.
*
* @providesModule EventPluginHub
*/
"use strict";
var EventPluginRegistry = _dereq_("./EventPluginRegistry");
var EventPluginUtils = _dereq_("./EventPluginUtils");
var accumulateInto = _dereq_("./accumulateInto");
var forEachAccumulated = _dereq_("./forEachAccumulated");
var invariant = _dereq_("./invariant");
/**
* Internal store for event listeners
*/
var listenerBank = {};
/**
* Internal queue of events that have accumulated their dispatches and are
* waiting to have their dispatches executed.
*/
var eventQueue = null;
/**
* Dispatches an event and releases it back into the pool, unless persistent.
*
* @param {?object} event Synthetic event to be dispatched.
* @private
*/
var executeDispatchesAndRelease = function(event) {
if (event) {
var executeDispatch = EventPluginUtils.executeDispatch;
// Plugins can provide custom behavior when dispatching events.
var PluginModule = EventPluginRegistry.getPluginModuleForEvent(event);
if (PluginModule && PluginModule.executeDispatch) {
executeDispatch = PluginModule.executeDispatch;
}
EventPluginUtils.executeDispatchesInOrder(event, executeDispatch);
if (!event.isPersistent()) {
event.constructor.release(event);
}
}
};
/**
* - `InstanceHandle`: [required] Module that performs logical traversals of DOM
* hierarchy given ids of the logical DOM elements involved.
*/
var InstanceHandle = null;
function validateInstanceHandle() {
var invalid = !InstanceHandle||
!InstanceHandle.traverseTwoPhase ||
!InstanceHandle.traverseEnterLeave;
if (invalid) {
throw new Error('InstanceHandle not injected before use!');
}
}
/**
* This is a unified interface for event plugins to be installed and configured.
*
* Event plugins can implement the following properties:
*
* `extractEvents` {function(string, DOMEventTarget, string, object): *}
* Required. When a top-level event is fired, this method is expected to
* extract synthetic events that will in turn be queued and dispatched.
*
* `eventTypes` {object}
* Optional, plugins that fire events must publish a mapping of registration
* names that are used to register listeners. Values of this mapping must
* be objects that contain `registrationName` or `phasedRegistrationNames`.
*
* `executeDispatch` {function(object, function, string)}
* Optional, allows plugins to override how an event gets dispatched. By
* default, the listener is simply invoked.
*
* Each plugin that is injected into `EventsPluginHub` is immediately operable.
*
* @public
*/
var EventPluginHub = {
/**
* Methods for injecting dependencies.
*/
injection: {
/**
* @param {object} InjectedMount
* @public
*/
injectMount: EventPluginUtils.injection.injectMount,
/**
* @param {object} InjectedInstanceHandle
* @public
*/
injectInstanceHandle: function(InjectedInstanceHandle) {
InstanceHandle = InjectedInstanceHandle;
if ("production" !== "development") {
validateInstanceHandle();
}
},
getInstanceHandle: function() {
if ("production" !== "development") {
validateInstanceHandle();
}
return InstanceHandle;
},
/**
* @param {array} InjectedEventPluginOrder
* @public
*/
injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
/**
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
*/
injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
},
eventNameDispatchConfigs: EventPluginRegistry.eventNameDispatchConfigs,
registrationNameModules: EventPluginRegistry.registrationNameModules,
/**
* Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
*
* @param {string} id ID of the DOM element.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @param {?function} listener The callback to store.
*/
putListener: function(id, registrationName, listener) {
("production" !== "development" ? invariant(
!listener || typeof listener === 'function',
'Expected %s listener to be a function, instead got type %s',
registrationName, typeof listener
) : invariant(!listener || typeof listener === 'function'));
var bankForRegistrationName =
listenerBank[registrationName] || (listenerBank[registrationName] = {});
bankForRegistrationName[id] = listener;
},
/**
* @param {string} id ID of the DOM element.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @return {?function} The stored callback.
*/
getListener: function(id, registrationName) {
var bankForRegistrationName = listenerBank[registrationName];
return bankForRegistrationName && bankForRegistrationName[id];
},
/**
* Deletes a listener from the registration bank.
*
* @param {string} id ID of the DOM element.
* @param {string} registrationName Name of listener (e.g. `onClick`).
*/
deleteListener: function(id, registrationName) {
var bankForRegistrationName = listenerBank[registrationName];
if (bankForRegistrationName) {
delete bankForRegistrationName[id];
}
},
/**
* Deletes all listeners for the DOM element with the supplied ID.
*
* @param {string} id ID of the DOM element.
*/
deleteAllListeners: function(id) {
for (var registrationName in listenerBank) {
delete listenerBank[registrationName][id];
}
},
/**
* Allows registered plugins an opportunity to extract events from top-level
* native browser events.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @internal
*/
extractEvents: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
var events;
var plugins = EventPluginRegistry.plugins;
for (var i = 0, l = plugins.length; i < l; i++) {
// Not every plugin in the ordering may be loaded at runtime.
var possiblePlugin = plugins[i];
if (possiblePlugin) {
var extractedEvents = possiblePlugin.extractEvents(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent
);
if (extractedEvents) {
events = accumulateInto(events, extractedEvents);
}
}
}
return events;
},
/**
* Enqueues a synthetic event that should be dispatched when
* `processEventQueue` is invoked.
*
* @param {*} events An accumulation of synthetic events.
* @internal
*/
enqueueEvents: function(events) {
if (events) {
eventQueue = accumulateInto(eventQueue, events);
}
},
/**
* Dispatches all synthetic events on the event queue.
*
* @internal
*/
processEventQueue: function() {
// Set `eventQueue` to null before processing it so that we can tell if more
// events get enqueued while processing.
var processingEventQueue = eventQueue;
eventQueue = null;
forEachAccumulated(processingEventQueue, executeDispatchesAndRelease);
("production" !== "development" ? invariant(
!eventQueue,
'processEventQueue(): Additional events were enqueued while processing ' +
'an event queue. Support for this has not yet been implemented.'
) : invariant(!eventQueue));
},
/**
* These are needed for tests only. Do not use!
*/
__purge: function() {
listenerBank = {};
},
__getListenerBank: function() {
return listenerBank;
}
};
module.exports = EventPluginHub;
},{"./EventPluginRegistry":19,"./EventPluginUtils":20,"./accumulateInto":97,"./forEachAccumulated":112,"./invariant":126}],19:[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.
*
* @providesModule EventPluginRegistry
* @typechecks static-only
*/
"use strict";
var invariant = _dereq_("./invariant");
/**
* Injectable ordering of event plugins.
*/
var EventPluginOrder = null;
/**
* Injectable mapping from names to event plugin modules.
*/
var namesToPlugins = {};
/**
* Recomputes the plugin list using the injected plugins and plugin ordering.
*
* @private
*/
function recomputePluginOrdering() {
if (!EventPluginOrder) {
// Wait until an `EventPluginOrder` is injected.
return;
}
for (var pluginName in namesToPlugins) {
var PluginModule = namesToPlugins[pluginName];
var pluginIndex = EventPluginOrder.indexOf(pluginName);
("production" !== "development" ? invariant(
pluginIndex > -1,
'EventPluginRegistry: Cannot inject event plugins that do not exist in ' +
'the plugin ordering, `%s`.',
pluginName
) : invariant(pluginIndex > -1));
if (EventPluginRegistry.plugins[pluginIndex]) {
continue;
}
("production" !== "development" ? invariant(
PluginModule.extractEvents,
'EventPluginRegistry: Event plugins must implement an `extractEvents` ' +
'method, but `%s` does not.',
pluginName
) : invariant(PluginModule.extractEvents));
EventPluginRegistry.plugins[pluginIndex] = PluginModule;
var publishedEvents = PluginModule.eventTypes;
for (var eventName in publishedEvents) {
("production" !== "development" ? invariant(
publishEventForPlugin(
publishedEvents[eventName],
PluginModule,
eventName
),
'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',
eventName,
pluginName
) : invariant(publishEventForPlugin(
publishedEvents[eventName],
PluginModule,
eventName
)));
}
}
}
/**
* Publishes an event so that it can be dispatched by the supplied plugin.
*
* @param {object} dispatchConfig Dispatch configuration for the event.
* @param {object} PluginModule Plugin publishing the event.
* @return {boolean} True if the event was successfully published.
* @private
*/
function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
("production" !== "development" ? invariant(
!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName),
'EventPluginHub: More than one plugin attempted to publish the same ' +
'event name, `%s`.',
eventName
) : invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName)));
EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
if (phasedRegistrationNames) {
for (var phaseName in phasedRegistrationNames) {
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
var phasedRegistrationName = phasedRegistrationNames[phaseName];
publishRegistrationName(
phasedRegistrationName,
PluginModule,
eventName
);
}
}
return true;
} else if (dispatchConfig.registrationName) {
publishRegistrationName(
dispatchConfig.registrationName,
PluginModule,
eventName
);
return true;
}
return false;
}
/**
* Publishes a registration name that is used to identify dispatched events and
* can be used with `EventPluginHub.putListener` to register listeners.
*
* @param {string} registrationName Registration name to add.
* @param {object} PluginModule Plugin publishing the event.
* @private
*/
function publishRegistrationName(registrationName, PluginModule, eventName) {
("production" !== "development" ? invariant(
!EventPluginRegistry.registrationNameModules[registrationName],
'EventPluginHub: More than one plugin attempted to publish the same ' +
'registration name, `%s`.',
registrationName
) : invariant(!EventPluginRegistry.registrationNameModules[registrationName]));
EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
EventPluginRegistry.registrationNameDependencies[registrationName] =
PluginModule.eventTypes[eventName].dependencies;
}
/**
* Registers plugins so that they can extract and dispatch events.
*
* @see {EventPluginHub}
*/
var EventPluginRegistry = {
/**
* Ordered list of injected plugins.
*/
plugins: [],
/**
* Mapping from event name to dispatch config
*/
eventNameDispatchConfigs: {},
/**
* Mapping from registration name to plugin module
*/
registrationNameModules: {},
/**
* Mapping from registration name to event name
*/
registrationNameDependencies: {},
/**
* Injects an ordering of plugins (by plugin name). This allows the ordering
* to be decoupled from injection of the actual plugins so that ordering is
* always deterministic regardless of packaging, on-the-fly injection, etc.
*
* @param {array} InjectedEventPluginOrder
* @internal
* @see {EventPluginHub.injection.injectEventPluginOrder}
*/
injectEventPluginOrder: function(InjectedEventPluginOrder) {
("production" !== "development" ? invariant(
!EventPluginOrder,
'EventPluginRegistry: Cannot inject event plugin ordering more than ' +
'once. You are likely trying to load more than one copy of React.'
) : invariant(!EventPluginOrder));
// Clone the ordering so it cannot be dynamically mutated.
EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
recomputePluginOrdering();
},
/**
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
* in the ordering injected by `injectEventPluginOrder`.
*
* Plugins can be injected as part of page initialization or on-the-fly.
*
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
* @internal
* @see {EventPluginHub.injection.injectEventPluginsByName}
*/
injectEventPluginsByName: function(injectedNamesToPlugins) {
var isOrderingDirty = false;
for (var pluginName in injectedNamesToPlugins) {
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
continue;
}
var PluginModule = injectedNamesToPlugins[pluginName];
if (!namesToPlugins.hasOwnProperty(pluginName) ||
namesToPlugins[pluginName] !== PluginModule) {
("production" !== "development" ? invariant(
!namesToPlugins[pluginName],
'EventPluginRegistry: Cannot inject two different event plugins ' +
'using the same name, `%s`.',
pluginName
) : invariant(!namesToPlugins[pluginName]));
namesToPlugins[pluginName] = PluginModule;
isOrderingDirty = true;
}
}
if (isOrderingDirty) {
recomputePluginOrdering();
}
},
/**
* Looks up the plugin for the supplied event.
*
* @param {object} event A synthetic event.
* @return {?object} The plugin that created the supplied event.
* @internal
*/
getPluginModuleForEvent: function(event) {
var dispatchConfig = event.dispatchConfig;
if (dispatchConfig.registrationName) {
return EventPluginRegistry.registrationNameModules[
dispatchConfig.registrationName
] || null;
}
for (var phase in dispatchConfig.phasedRegistrationNames) {
if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
continue;
}
var PluginModule = EventPluginRegistry.registrationNameModules[
dispatchConfig.phasedRegistrationNames[phase]
];
if (PluginModule) {
return PluginModule;
}
}
return null;
},
/**
* Exposed for unit testing.
* @private
*/
_resetEventPlugins: function() {
EventPluginOrder = null;
for (var pluginName in namesToPlugins) {
if (namesToPlugins.hasOwnProperty(pluginName)) {
delete namesToPlugins[pluginName];
}
}
EventPluginRegistry.plugins.length = 0;
var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
for (var eventName in eventNameDispatchConfigs) {
if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
delete eventNameDispatchConfigs[eventName];
}
}
var registrationNameModules = EventPluginRegistry.registrationNameModules;
for (var registrationName in registrationNameModules) {
if (registrationNameModules.hasOwnProperty(registrationName)) {
delete registrationNameModules[registrationName];
}
}
}
};
module.exports = EventPluginRegistry;
},{"./invariant":126}],20:[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.
*
* @providesModule EventPluginUtils
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var invariant = _dereq_("./invariant");
/**
* Injected dependencies:
*/
/**
* - `Mount`: [required] Module that can convert between React dom IDs and
* actual node references.
*/
var injection = {
Mount: null,
injectMount: function(InjectedMount) {
injection.Mount = InjectedMount;
if ("production" !== "development") {
("production" !== "development" ? invariant(
InjectedMount && InjectedMount.getNode,
'EventPluginUtils.injection.injectMount(...): Injected Mount module ' +
'is missing getNode.'
) : invariant(InjectedMount && InjectedMount.getNode));
}
}
};
var topLevelTypes = EventConstants.topLevelTypes;
function isEndish(topLevelType) {
return topLevelType === topLevelTypes.topMouseUp ||
topLevelType === topLevelTypes.topTouchEnd ||
topLevelType === topLevelTypes.topTouchCancel;
}
function isMoveish(topLevelType) {
return topLevelType === topLevelTypes.topMouseMove ||
topLevelType === topLevelTypes.topTouchMove;
}
function isStartish(topLevelType) {
return topLevelType === topLevelTypes.topMouseDown ||
topLevelType === topLevelTypes.topTouchStart;
}
var validateEventDispatches;
if ("production" !== "development") {
validateEventDispatches = function(event) {
var dispatchListeners = event._dispatchListeners;
var dispatchIDs = event._dispatchIDs;
var listenersIsArr = Array.isArray(dispatchListeners);
var idsIsArr = Array.isArray(dispatchIDs);
var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
var listenersLen = listenersIsArr ?
dispatchListeners.length :
dispatchListeners ? 1 : 0;
("production" !== "development" ? invariant(
idsIsArr === listenersIsArr && IDsLen === listenersLen,
'EventPluginUtils: Invalid `event`.'
) : invariant(idsIsArr === listenersIsArr && IDsLen === listenersLen));
};
}
/**
* Invokes `cb(event, listener, id)`. Avoids using call if no scope is
* provided. The `(listener,id)` pair effectively forms the "dispatch" but are
* kept separate to conserve memory.
*/
function forEachEventDispatch(event, cb) {
var dispatchListeners = event._dispatchListeners;
var dispatchIDs = event._dispatchIDs;
if ("production" !== "development") {
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and IDs are two parallel arrays that are always in sync.
cb(event, dispatchListeners[i], dispatchIDs[i]);
}
} else if (dispatchListeners) {
cb(event, dispatchListeners, dispatchIDs);
}
}
/**
* Default implementation of PluginModule.executeDispatch().
* @param {SyntheticEvent} SyntheticEvent to handle
* @param {function} Application-level callback
* @param {string} domID DOM id to pass to the callback.
*/
function executeDispatch(event, listener, domID) {
event.currentTarget = injection.Mount.getNode(domID);
var returnValue = listener(event, domID);
event.currentTarget = null;
return returnValue;
}
/**
* Standard/simple iteration through an event's collected dispatches.
*/
function executeDispatchesInOrder(event, executeDispatch) {
forEachEventDispatch(event, executeDispatch);
event._dispatchListeners = null;
event._dispatchIDs = null;
}
/**
* Standard/simple iteration through an event's collected dispatches, but stops
* at the first dispatch execution returning true, and returns that id.
*
* @return id of the first dispatch execution who's listener returns true, or
* null if no listener returned true.
*/
function executeDispatchesInOrderStopAtTrueImpl(event) {
var dispatchListeners = event._dispatchListeners;
var dispatchIDs = event._dispatchIDs;
if ("production" !== "development") {
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and IDs are two parallel arrays that are always in sync.
if (dispatchListeners[i](event, dispatchIDs[i])) {
return dispatchIDs[i];
}
}
} else if (dispatchListeners) {
if (dispatchListeners(event, dispatchIDs)) {
return dispatchIDs;
}
}
return null;
}
/**
* @see executeDispatchesInOrderStopAtTrueImpl
*/
function executeDispatchesInOrderStopAtTrue(event) {
var ret = executeDispatchesInOrderStopAtTrueImpl(event);
event._dispatchIDs = null;
event._dispatchListeners = null;
return ret;
}
/**
* Execution of a "direct" dispatch - there must be at most one dispatch
* accumulated on the event or it is considered an error. It doesn't really make
* sense for an event with multiple dispatches (bubbled) to keep track of the
* return values at each dispatch execution, but it does tend to make sense when
* dealing with "direct" dispatches.
*
* @return The return value of executing the single dispatch.
*/
function executeDirectDispatch(event) {
if ("production" !== "development") {
validateEventDispatches(event);
}
var dispatchListener = event._dispatchListeners;
var dispatchID = event._dispatchIDs;
("production" !== "development" ? invariant(
!Array.isArray(dispatchListener),
'executeDirectDispatch(...): Invalid `event`.'
) : invariant(!Array.isArray(dispatchListener)));
var res = dispatchListener ?
dispatchListener(event, dispatchID) :
null;
event._dispatchListeners = null;
event._dispatchIDs = null;
return res;
}
/**
* @param {SyntheticEvent} event
* @return {bool} True iff number of dispatches accumulated is greater than 0.
*/
function hasDispatches(event) {
return !!event._dispatchListeners;
}
/**
* General utilities that are useful in creating custom Event Plugins.
*/
var EventPluginUtils = {
isEndish: isEndish,
isMoveish: isMoveish,
isStartish: isStartish,
executeDirectDispatch: executeDirectDispatch,
executeDispatch: executeDispatch,
executeDispatchesInOrder: executeDispatchesInOrder,
executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
hasDispatches: hasDispatches,
injection: injection,
useTouchEvents: false
};
module.exports = EventPluginUtils;
},{"./EventConstants":16,"./invariant":126}],21:[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.
*
* @providesModule EventPropagators
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var EventPluginHub = _dereq_("./EventPluginHub");
var accumulateInto = _dereq_("./accumulateInto");
var forEachAccumulated = _dereq_("./forEachAccumulated");
var PropagationPhases = EventConstants.PropagationPhases;
var getListener = EventPluginHub.getListener;
/**
* Some event types have a notion of different registration names for different
* "phases" of propagation. This finds listeners by a given phase.
*/
function listenerAtPhase(id, event, propagationPhase) {
var registrationName =
event.dispatchConfig.phasedRegistrationNames[propagationPhase];
return getListener(id, registrationName);
}
/**
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function
* here, allows us to not have to bind or create functions for each event.
* Mutating the event's members allows us to not have to create a wrapping
* "dispatch" object that pairs the event with the listener.
*/
function accumulateDirectionalDispatches(domID, upwards, event) {
if ("production" !== "development") {
if (!domID) {
throw new Error('Dispatching id must not be null');
}
}
var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
var listener = listenerAtPhase(domID, event, phase);
if (listener) {
event._dispatchListeners =
accumulateInto(event._dispatchListeners, listener);
event._dispatchIDs = accumulateInto(event._dispatchIDs, domID);
}
}
/**
* Collect dispatches (must be entirely collected before dispatching - see unit
* tests). Lazily allocate the array to conserve memory. We must loop through
* each event and perform the traversal for each one. We can not perform a
* single traversal for the entire collection of events because each event may
* have a different target.
*/
function accumulateTwoPhaseDispatchesSingle(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(
event.dispatchMarker,
accumulateDirectionalDispatches,
event
);
}
}
/**
* Accumulates without regard to direction, does not look for phased
* registration names. Same as `accumulateDirectDispatchesSingle` but without
* requiring that the `dispatchMarker` be the same as the dispatched ID.
*/
function accumulateDispatches(id, ignoredDirection, event) {
if (event && event.dispatchConfig.registrationName) {
var registrationName = event.dispatchConfig.registrationName;
var listener = getListener(id, registrationName);
if (listener) {
event._dispatchListeners =
accumulateInto(event._dispatchListeners, listener);
event._dispatchIDs = accumulateInto(event._dispatchIDs, id);
}
}
}
/**
* Accumulates dispatches on an `SyntheticEvent`, but only for the
* `dispatchMarker`.
* @param {SyntheticEvent} event
*/
function accumulateDirectDispatchesSingle(event) {
if (event && event.dispatchConfig.registrationName) {
accumulateDispatches(event.dispatchMarker, null, event);
}
}
function accumulateTwoPhaseDispatches(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
}
function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) {
EventPluginHub.injection.getInstanceHandle().traverseEnterLeave(
fromID,
toID,
accumulateDispatches,
leave,
enter
);
}
function accumulateDirectDispatches(events) {
forEachAccumulated(events, accumulateDirectDispatchesSingle);
}
/**
* A small set of propagation patterns, each of which will accept a small amount
* of information, and generate a set of "dispatch ready event objects" - which
* are sets of events that have already been annotated with a set of dispatched
* listener functions/ids. The API is designed this way to discourage these
* propagation strategies from actually executing the dispatches, since we
* always want to collect the entire set of dispatches before executing event a
* single one.
*
* @constructor EventPropagators
*/
var EventPropagators = {
accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
accumulateDirectDispatches: accumulateDirectDispatches,
accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
};
module.exports = EventPropagators;
},{"./EventConstants":16,"./EventPluginHub":18,"./accumulateInto":97,"./forEachAccumulated":112}],22:[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.
*
* @providesModule ExecutionEnvironment
*/
/*jslint evil: true */
"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;
},{}],23:[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.
*
* @providesModule HTMLDOMPropertyConfig
*/
/*jslint bitwise: true*/
"use strict";
var DOMProperty = _dereq_("./DOMProperty");
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
var HAS_POSITIVE_NUMERIC_VALUE =
DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
var HAS_OVERLOADED_BOOLEAN_VALUE =
DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
var hasSVG;
if (ExecutionEnvironment.canUseDOM) {
var implementation = document.implementation;
hasSVG = (
implementation &&
implementation.hasFeature &&
implementation.hasFeature(
'http://www.w3.org/TR/SVG11/feature#BasicStructure',
'1.1'
)
);
}
var HTMLDOMPropertyConfig = {
isCustomAttribute: RegExp.prototype.test.bind(
/^(data|aria)-[a-z_][a-z\d_.\-]*$/
),
Properties: {
/**
* Standard Properties
*/
accept: null,
acceptCharset: null,
accessKey: null,
action: null,
allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
allowTransparency: MUST_USE_ATTRIBUTE,
alt: null,
async: HAS_BOOLEAN_VALUE,
autoComplete: null,
// autoFocus is polyfilled/normalized by AutoFocusMixin
// autoFocus: HAS_BOOLEAN_VALUE,
autoPlay: HAS_BOOLEAN_VALUE,
cellPadding: null,
cellSpacing: null,
charSet: MUST_USE_ATTRIBUTE,
checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
classID: MUST_USE_ATTRIBUTE,
// To set className on SVG elements, it's necessary to use .setAttribute;
// this works on HTML elements too in all browsers except IE8. Conveniently,
// IE8 doesn't support SVG and so we can simply use the attribute in
// browsers that support SVG and the property in browsers that don't,
// regardless of whether the element is HTML or SVG.
className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY,
cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
colSpan: null,
content: null,
contentEditable: null,
contextMenu: MUST_USE_ATTRIBUTE,
controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
coords: null,
crossOrigin: null,
data: null, // For `<object />` acts as `src`.
dateTime: MUST_USE_ATTRIBUTE,
defer: HAS_BOOLEAN_VALUE,
dir: null,
disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
download: HAS_OVERLOADED_BOOLEAN_VALUE,
draggable: null,
encType: null,
form: MUST_USE_ATTRIBUTE,
formNoValidate: HAS_BOOLEAN_VALUE,
frameBorder: MUST_USE_ATTRIBUTE,
height: MUST_USE_ATTRIBUTE,
hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
href: null,
hrefLang: null,
htmlFor: null,
httpEquiv: null,
icon: null,
id: MUST_USE_PROPERTY,
label: null,
lang: null,
list: MUST_USE_ATTRIBUTE,
loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
manifest: MUST_USE_ATTRIBUTE,
max: null,
maxLength: MUST_USE_ATTRIBUTE,
media: MUST_USE_ATTRIBUTE,
mediaGroup: null,
method: null,
min: null,
multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
name: null,
noValidate: HAS_BOOLEAN_VALUE,
open: null,
pattern: null,
placeholder: null,
poster: null,
preload: null,
radioGroup: null,
readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
rel: null,
required: HAS_BOOLEAN_VALUE,
role: MUST_USE_ATTRIBUTE,
rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
rowSpan: null,
sandbox: null,
scope: null,
scrolling: null,
seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
shape: null,
size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
sizes: MUST_USE_ATTRIBUTE,
span: HAS_POSITIVE_NUMERIC_VALUE,
spellCheck: null,
src: null,
srcDoc: MUST_USE_PROPERTY,
srcSet: MUST_USE_ATTRIBUTE,
start: HAS_NUMERIC_VALUE,
step: null,
style: null,
tabIndex: null,
target: null,
title: null,
type: null,
useMap: null,
value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
width: MUST_USE_ATTRIBUTE,
wmode: MUST_USE_ATTRIBUTE,
/**
* Non-standard Properties
*/
autoCapitalize: null, // Supported in Mobile Safari for keyboard hints
autoCorrect: null, // Supported in Mobile Safari for keyboard hints
itemProp: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, // Microdata: http://schema.org/docs/gs.html
itemType: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
property: null // Supports OG in meta tags
},
DOMAttributeNames: {
acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
httpEquiv: 'http-equiv'
},
DOMPropertyNames: {
autoCapitalize: 'autocapitalize',
autoComplete: 'autocomplete',
autoCorrect: 'autocorrect',
autoFocus: 'autofocus',
autoPlay: 'autoplay',
encType: 'enctype',
hrefLang: 'hreflang',
radioGroup: 'radiogroup',
spellCheck: 'spellcheck',
srcDoc: 'srcdoc',
srcSet: 'srcset'
}
};
module.exports = HTMLDOMPropertyConfig;
},{"./DOMProperty":11,"./ExecutionEnvironment":22}],24:[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.
*
* @providesModule LinkedValueUtils
* @typechecks static-only
*/
"use strict";
var ReactPropTypes = _dereq_("./ReactPropTypes");
var invariant = _dereq_("./invariant");
var hasReadOnlyValue = {
'button': true,
'checkbox': true,
'image': true,
'hidden': true,
'radio': true,
'reset': true,
'submit': true
};
function _assertSingleLink(input) {
("production" !== "development" ? invariant(
input.props.checkedLink == null || input.props.valueLink == null,
'Cannot provide a checkedLink and a valueLink. If you want to use ' +
'checkedLink, you probably don\'t want to use valueLink and vice versa.'
) : invariant(input.props.checkedLink == null || input.props.valueLink == null));
}
function _assertValueLink(input) {
_assertSingleLink(input);
("production" !== "development" ? invariant(
input.props.value == null && input.props.onChange == null,
'Cannot provide a valueLink and a value or onChange event. If you want ' +
'to use value or onChange, you probably don\'t want to use valueLink.'
) : invariant(input.props.value == null && input.props.onChange == null));
}
function _assertCheckedLink(input) {
_assertSingleLink(input);
("production" !== "development" ? invariant(
input.props.checked == null && input.props.onChange == null,
'Cannot provide a checkedLink and a checked property or onChange event. ' +
'If you want to use checked or onChange, you probably don\'t want to ' +
'use checkedLink'
) : invariant(input.props.checked == null && input.props.onChange == null));
}
/**
* @param {SyntheticEvent} e change event to handle
*/
function _handleLinkedValueChange(e) {
/*jshint validthis:true */
this.props.valueLink.requestChange(e.target.value);
}
/**
* @param {SyntheticEvent} e change event to handle
*/
function _handleLinkedCheckChange(e) {
/*jshint validthis:true */
this.props.checkedLink.requestChange(e.target.checked);
}
/**
* Provide a linked `value` attribute for controlled forms. You should not use
* this outside of the ReactDOM controlled form components.
*/
var LinkedValueUtils = {
Mixin: {
propTypes: {
value: function(props, propName, componentName) {
if (!props[propName] ||
hasReadOnlyValue[props.type] ||
props.onChange ||
props.readOnly ||
props.disabled) {
return;
}
return 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(props, propName, componentName) {
if (!props[propName] ||
props.onChange ||
props.readOnly ||
props.disabled) {
return;
}
return 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: ReactPropTypes.func
}
},
/**
* @param {ReactComponent} input Form component
* @return {*} current value of the input either from value prop or link.
*/
getValue: function(input) {
if (input.props.valueLink) {
_assertValueLink(input);
return input.props.valueLink.value;
}
return input.props.value;
},
/**
* @param {ReactComponent} input Form component
* @return {*} current checked status of the input either from checked prop
* or link.
*/
getChecked: function(input) {
if (input.props.checkedLink) {
_assertCheckedLink(input);
return input.props.checkedLink.value;
}
return input.props.checked;
},
/**
* @param {ReactComponent} input Form component
* @return {function} change callback either from onChange prop or link.
*/
getOnChange: function(input) {
if (input.props.valueLink) {
_assertValueLink(input);
return _handleLinkedValueChange;
} else if (input.props.checkedLink) {
_assertCheckedLink(input);
return _handleLinkedCheckChange;
}
return input.props.onChange;
}
};
module.exports = LinkedValueUtils;
},{"./ReactPropTypes":72,"./invariant":126}],25:[function(_dereq_,module,exports){
/**
* 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 LocalEventTrapMixin
*/
"use strict";
var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter");
var accumulateInto = _dereq_("./accumulateInto");
var forEachAccumulated = _dereq_("./forEachAccumulated");
var invariant = _dereq_("./invariant");
function remove(event) {
event.remove();
}
var LocalEventTrapMixin = {
trapBubbledEvent:function(topLevelType, handlerBaseName) {
("production" !== "development" ? invariant(this.isMounted(), 'Must be mounted to trap events') : invariant(this.isMounted()));
var listener = ReactBrowserEventEmitter.trapBubbledEvent(
topLevelType,
handlerBaseName,
this.getDOMNode()
);
this._localEventListeners =
accumulateInto(this._localEventListeners, listener);
},
// trapCapturedEvent would look nearly identical. We don't implement that
// method because it isn't currently needed.
componentWillUnmount:function() {
if (this._localEventListeners) {
forEachAccumulated(this._localEventListeners, remove);
}
}
};
module.exports = LocalEventTrapMixin;
},{"./ReactBrowserEventEmitter":30,"./accumulateInto":97,"./forEachAccumulated":112,"./invariant":126}],26:[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.
*
* @providesModule MobileSafariClickEventPlugin
* @typechecks static-only
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var emptyFunction = _dereq_("./emptyFunction");
var topLevelTypes = EventConstants.topLevelTypes;
/**
* Mobile Safari does not fire properly bubble click events on non-interactive
* elements, which means delegated click listeners do not fire. The workaround
* for this bug involves attaching an empty click listener on the target node.
*
* This particular plugin works around the bug by attaching an empty click
* listener on `touchstart` (which does fire on every element).
*/
var MobileSafariClickEventPlugin = {
eventTypes: null,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
if (topLevelType === topLevelTypes.topTouchStart) {
var target = nativeEvent.target;
if (target && !target.onclick) {
target.onclick = emptyFunction;
}
}
}
};
module.exports = MobileSafariClickEventPlugin;
},{"./EventConstants":16,"./emptyFunction":107}],27:[function(_dereq_,module,exports){
/**
* 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;
},{}],28:[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.
*
* @providesModule PooledClass
*/
"use strict";
var invariant = _dereq_("./invariant");
/**
* Static poolers. Several custom versions for each potential number of
* arguments. A completely generic pooler is easy to implement, but would
* require accessing the `arguments` object. In each of these, `this` refers to
* the Class itself, not an instance. If any others are needed, simply add them
* here, or in their own files.
*/
var oneArgumentPooler = function(copyFieldsFrom) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, copyFieldsFrom);
return instance;
} else {
return new Klass(copyFieldsFrom);
}
};
var twoArgumentPooler = function(a1, a2) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2);
return instance;
} else {
return new Klass(a1, a2);
}
};
var threeArgumentPooler = function(a1, a2, a3) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3);
return instance;
} else {
return new Klass(a1, a2, a3);
}
};
var fiveArgumentPooler = function(a1, a2, a3, a4, a5) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3, a4, a5);
return instance;
} else {
return new Klass(a1, a2, a3, a4, a5);
}
};
var standardReleaser = function(instance) {
var Klass = this;
("production" !== "development" ? invariant(
instance instanceof Klass,
'Trying to release an instance into a pool of a different type.'
) : invariant(instance instanceof Klass));
if (instance.destructor) {
instance.destructor();
}
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = oneArgumentPooler;
/**
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
* itself (statically) not adding any prototypical fields. Any CopyConstructor
* you give this may have a `poolSize` property, and will look for a
* prototypical `destructor` on instances (optional).
*
* @param {Function} CopyConstructor Constructor that can be used to reset.
* @param {Function} pooler Customizable pooler.
*/
var addPoolingTo = function(CopyConstructor, pooler) {
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo: addPoolingTo,
oneArgumentPooler: oneArgumentPooler,
twoArgumentPooler: twoArgumentPooler,
threeArgumentPooler: threeArgumentPooler,
fiveArgumentPooler: fiveArgumentPooler
};
module.exports = PooledClass;
},{"./invariant":126}],29:[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.
*
* @providesModule ReactBrowserComponentMixin
*/
"use strict";
var ReactEmptyComponent = _dereq_("./ReactEmptyComponent");
var ReactMount = _dereq_("./ReactMount");
var invariant = _dereq_("./invariant");
var ReactBrowserComponentMixin = {
/**
* Returns the DOM node rendered by this component.
*
* @return {DOMElement} The root node of this component.
* @final
* @protected
*/
getDOMNode: function() {
("production" !== "development" ? invariant(
this.isMounted(),
'getDOMNode(): A component must be mounted to have a DOM node.'
) : invariant(this.isMounted()));
if (ReactEmptyComponent.isNullComponentID(this._rootNodeID)) {
return null;
}
return ReactMount.getNode(this._rootNodeID);
}
};
module.exports = ReactBrowserComponentMixin;
},{"./ReactEmptyComponent":54,"./ReactMount":63,"./invariant":126}],30:[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.
*
* @providesModule ReactBrowserEventEmitter
* @typechecks static-only
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var EventPluginHub = _dereq_("./EventPluginHub");
var EventPluginRegistry = _dereq_("./EventPluginRegistry");
var ReactEventEmitterMixin = _dereq_("./ReactEventEmitterMixin");
var ViewportMetrics = _dereq_("./ViewportMetrics");
var assign = _dereq_("./Object.assign");
var isEventSupported = _dereq_("./isEventSupported");
/**
* Summary of `ReactBrowserEventEmitter` event handling:
*
* - Top-level delegation is used to trap most native browser events. This
* may only occur in the main thread and is the responsibility of
* ReactEventListener, which is injected and can therefore support pluggable
* event sources. This is the only work that occurs in the main thread.
*
* - We normalize and de-duplicate events to account for browser quirks. This
* may be done in the worker thread.
*
* - Forward these native events (with the associated top-level type used to
* trap it) to `EventPluginHub`, which in turn will ask plugins if they want
* to extract any synthetic events.
*
* - The `EventPluginHub` will then process each event by annotating them with
* "dispatches", a sequence of listeners and IDs that care about that event.
*
* - The `EventPluginHub` then dispatches the events.
*
* Overview of React and the event system:
*
* +------------+ .
* | DOM | .
* +------------+ .
* | .
* v .
* +------------+ .
* | ReactEvent | .
* | Listener | .
* +------------+ . +-----------+
* | . +--------+|SimpleEvent|
* | . | |Plugin |
* +-----|------+ . v +-----------+
* | | | . +--------------+ +------------+
* | +-----------.--->|EventPluginHub| | Event |
* | | . | | +-----------+ | Propagators|
* | ReactEvent | . | | |TapEvent | |------------|
* | Emitter | . | |<---+|Plugin | |other plugin|
* | | . | | +-----------+ | utilities |
* | +-----------.--->| | +------------+
* | | | . +--------------+
* +-----|------+ . ^ +-----------+
* | . | |Enter/Leave|
* + . +-------+|Plugin |
* +-------------+ . +-----------+
* | application | .
* |-------------| .
* | | .
* | | .
* +-------------+ .
* .
* React Core . General Purpose Event Plugin System
*/
var alreadyListeningTo = {};
var isMonitoringScrollValue = false;
var reactTopListenersCounter = 0;
// For events like 'submit' which don't consistently bubble (which we trap at a
// lower node than `document`), binding at `document` would cause duplicate
// events so we don't include them here
var topEventMapping = {
topBlur: 'blur',
topChange: 'change',
topClick: 'click',
topCompositionEnd: 'compositionend',
topCompositionStart: 'compositionstart',
topCompositionUpdate: 'compositionupdate',
topContextMenu: 'contextmenu',
topCopy: 'copy',
topCut: 'cut',
topDoubleClick: 'dblclick',
topDrag: 'drag',
topDragEnd: 'dragend',
topDragEnter: 'dragenter',
topDragExit: 'dragexit',
topDragLeave: 'dragleave',
topDragOver: 'dragover',
topDragStart: 'dragstart',
topDrop: 'drop',
topFocus: 'focus',
topInput: 'input',
topKeyDown: 'keydown',
topKeyPress: 'keypress',
topKeyUp: 'keyup',
topMouseDown: 'mousedown',
topMouseMove: 'mousemove',
topMouseOut: 'mouseout',
topMouseOver: 'mouseover',
topMouseUp: 'mouseup',
topPaste: 'paste',
topScroll: 'scroll',
topSelectionChange: 'selectionchange',
topTextInput: 'textInput',
topTouchCancel: 'touchcancel',
topTouchEnd: 'touchend',
topTouchMove: 'touchmove',
topTouchStart: 'touchstart',
topWheel: 'wheel'
};
/**
* To ensure no conflicts with other potential React instances on the page
*/
var topListenersIDKey = "_reactListenersID" + String(Math.random()).slice(2);
function getListeningForDocument(mountAt) {
// In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
// directly.
if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
mountAt[topListenersIDKey] = reactTopListenersCounter++;
alreadyListeningTo[mountAt[topListenersIDKey]] = {};
}
return alreadyListeningTo[mountAt[topListenersIDKey]];
}
/**
* `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
* example:
*
* ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction);
*
* This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
*
* @internal
*/
var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
/**
* Injectable event backend
*/
ReactEventListener: null,
injection: {
/**
* @param {object} ReactEventListener
*/
injectReactEventListener: function(ReactEventListener) {
ReactEventListener.setHandleTopLevel(
ReactBrowserEventEmitter.handleTopLevel
);
ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
}
},
/**
* Sets whether or not any created callbacks should be enabled.
*
* @param {boolean} enabled True if callbacks should be enabled.
*/
setEnabled: function(enabled) {
if (ReactBrowserEventEmitter.ReactEventListener) {
ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
}
},
/**
* @return {boolean} True if callbacks are enabled.
*/
isEnabled: function() {
return !!(
ReactBrowserEventEmitter.ReactEventListener &&
ReactBrowserEventEmitter.ReactEventListener.isEnabled()
);
},
/**
* We listen for bubbled touch events on the document object.
*
* Firefox v8.01 (and possibly others) exhibited strange behavior when
* mounting `onmousemove` events at some node that was not the document
* element. The symptoms were that if your mouse is not moving over something
* contained within that mount point (for example on the background) the
* top-level listeners for `onmousemove` won't be called. However, if you
* register the `mousemove` on the document object, then it will of course
* catch all `mousemove`s. This along with iOS quirks, justifies restricting
* top-level listeners to the document object only, at least for these
* movement types of events and possibly all events.
*
* @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
*
* Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
* they bubble to document.
*
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @param {object} contentDocumentHandle Document which owns the container
*/
listenTo: function(registrationName, contentDocumentHandle) {
var mountAt = contentDocumentHandle;
var isListening = getListeningForDocument(mountAt);
var dependencies = EventPluginRegistry.
registrationNameDependencies[registrationName];
var topLevelTypes = EventConstants.topLevelTypes;
for (var i = 0, l = dependencies.length; i < l; i++) {
var dependency = dependencies[i];
if (!(
isListening.hasOwnProperty(dependency) &&
isListening[dependency]
)) {
if (dependency === topLevelTypes.topWheel) {
if (isEventSupported('wheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
topLevelTypes.topWheel,
'wheel',
mountAt
);
} else if (isEventSupported('mousewheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
topLevelTypes.topWheel,
'mousewheel',
mountAt
);
} else {
// Firefox needs to capture a different mouse scroll event.
// @see http://www.quirksmode.org/dom/events/tests/scroll.html
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
topLevelTypes.topWheel,
'DOMMouseScroll',
mountAt
);
}
} else if (dependency === topLevelTypes.topScroll) {
if (isEventSupported('scroll', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(
topLevelTypes.topScroll,
'scroll',
mountAt
);
} else {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
topLevelTypes.topScroll,
'scroll',
ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE
);
}
} else if (dependency === topLevelTypes.topFocus ||
dependency === topLevelTypes.topBlur) {
if (isEventSupported('focus', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(
topLevelTypes.topFocus,
'focus',
mountAt
);
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(
topLevelTypes.topBlur,
'blur',
mountAt
);
} else if (isEventSupported('focusin')) {
// IE has `focusin` and `focusout` events which bubble.
// @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
topLevelTypes.topFocus,
'focusin',
mountAt
);
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
topLevelTypes.topBlur,
'focusout',
mountAt
);
}
// to make sure blur and focus event listeners are only attached once
isListening[topLevelTypes.topBlur] = true;
isListening[topLevelTypes.topFocus] = true;
} else if (topEventMapping.hasOwnProperty(dependency)) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
dependency,
topEventMapping[dependency],
mountAt
);
}
isListening[dependency] = true;
}
}
},
trapBubbledEvent: function(topLevelType, handlerBaseName, handle) {
return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
topLevelType,
handlerBaseName,
handle
);
},
trapCapturedEvent: function(topLevelType, handlerBaseName, handle) {
return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(
topLevelType,
handlerBaseName,
handle
);
},
/**
* Listens to window scroll and resize events. We cache scroll values so that
* application code can access them without triggering reflows.
*
* NOTE: Scroll events do not bubble.
*
* @see http://www.quirksmode.org/dom/events/scroll.html
*/
ensureScrollValueMonitoring: function(){
if (!isMonitoringScrollValue) {
var refresh = ViewportMetrics.refreshScrollValues;
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
isMonitoringScrollValue = true;
}
},
eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
registrationNameModules: EventPluginHub.registrationNameModules,
putListener: EventPluginHub.putListener,
getListener: EventPluginHub.getListener,
deleteListener: EventPluginHub.deleteListener,
deleteAllListeners: EventPluginHub.deleteAllListeners
});
module.exports = ReactBrowserEventEmitter;
},{"./EventConstants":16,"./EventPluginHub":18,"./EventPluginRegistry":19,"./Object.assign":27,"./ReactEventEmitterMixin":56,"./ViewportMetrics":96,"./isEventSupported":127}],31:[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.
*
* @providesModule ReactChildren
*/
"use strict";
var PooledClass = _dereq_("./PooledClass");
var traverseAllChildren = _dereq_("./traverseAllChildren");
var warning = _dereq_("./warning");
var twoArgumentPooler = PooledClass.twoArgumentPooler;
var threeArgumentPooler = PooledClass.threeArgumentPooler;
/**
* PooledClass representing the bookkeeping associated with performing a child
* traversal. Allows avoiding binding callbacks.
*
* @constructor ForEachBookKeeping
* @param {!function} forEachFunction Function to perform traversal with.
* @param {?*} forEachContext Context to perform context with.
*/
function ForEachBookKeeping(forEachFunction, forEachContext) {
this.forEachFunction = forEachFunction;
this.forEachContext = forEachContext;
}
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
function forEachSingleChild(traverseContext, child, name, i) {
var forEachBookKeeping = traverseContext;
forEachBookKeeping.forEachFunction.call(
forEachBookKeeping.forEachContext, child, i);
}
/**
* Iterates through children that are typically specified as `props.children`.
*
* The provided forEachFunc(child, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} forEachFunc.
* @param {*} forEachContext Context for forEachContext.
*/
function forEachChildren(children, forEachFunc, forEachContext) {
if (children == null) {
return children;
}
var traverseContext =
ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
traverseAllChildren(children, forEachSingleChild, traverseContext);
ForEachBookKeeping.release(traverseContext);
}
/**
* PooledClass representing the bookkeeping associated with performing a child
* mapping. Allows avoiding binding callbacks.
*
* @constructor MapBookKeeping
* @param {!*} mapResult Object containing the ordered map of results.
* @param {!function} mapFunction Function to perform mapping with.
* @param {?*} mapContext Context to perform mapping with.
*/
function MapBookKeeping(mapResult, mapFunction, mapContext) {
this.mapResult = mapResult;
this.mapFunction = mapFunction;
this.mapContext = mapContext;
}
PooledClass.addPoolingTo(MapBookKeeping, threeArgumentPooler);
function mapSingleChildIntoContext(traverseContext, child, name, i) {
var mapBookKeeping = traverseContext;
var mapResult = mapBookKeeping.mapResult;
var keyUnique = !mapResult.hasOwnProperty(name);
("production" !== "development" ? warning(
keyUnique,
'ReactChildren.map(...): Encountered two children with the same key, ' +
'`%s`. Child keys must be unique; when two children share a key, only ' +
'the first child will be used.',
name
) : null);
if (keyUnique) {
var mappedChild =
mapBookKeeping.mapFunction.call(mapBookKeeping.mapContext, child, i);
mapResult[name] = mappedChild;
}
}
/**
* Maps children that are typically specified as `props.children`.
*
* The provided mapFunction(child, key, index) will be called for each
* leaf child.
*
* TODO: This may likely break any calls to `ReactChildren.map` that were
* previously relying on the fact that we guarded against null children.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} mapFunction.
* @param {*} mapContext Context for mapFunction.
* @return {object} Object containing the ordered map of results.
*/
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var mapResult = {};
var traverseContext = MapBookKeeping.getPooled(mapResult, func, context);
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
MapBookKeeping.release(traverseContext);
return mapResult;
}
function forEachSingleChildDummy(traverseContext, child, name, i) {
return null;
}
/**
* Count the number of children that are typically specified as
* `props.children`.
*
* @param {?*} children Children tree container.
* @return {number} The number of children.
*/
function countChildren(children, context) {
return traverseAllChildren(children, forEachSingleChildDummy, null);
}
var ReactChildren = {
forEach: forEachChildren,
map: mapChildren,
count: countChildren
};
module.exports = ReactChildren;
},{"./PooledClass":28,"./traverseAllChildren":144,"./warning":145}],32:[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.
*
* @providesModule ReactComponent
*/
"use strict";
var ReactElement = _dereq_("./ReactElement");
var ReactOwner = _dereq_("./ReactOwner");
var ReactUpdates = _dereq_("./ReactUpdates");
var assign = _dereq_("./Object.assign");
var invariant = _dereq_("./invariant");
var keyMirror = _dereq_("./keyMirror");
/**
* Every React component is in one of these life cycles.
*/
var ComponentLifeCycle = keyMirror({
/**
* Mounted components have a DOM node representation and are capable of
* receiving new props.
*/
MOUNTED: null,
/**
* Unmounted components are inactive and cannot receive new props.
*/
UNMOUNTED: null
});
var injected = false;
/**
* Optionally injectable environment dependent cleanup hook. (server vs.
* browser etc). Example: A browser system caches DOM nodes based on component
* ID and must remove that cache entry when this instance is unmounted.
*
* @private
*/
var unmountIDFromEnvironment = null;
/**
* The "image" of a component tree, is the platform specific (typically
* serialized) data that represents a tree of lower level UI building blocks.
* On the web, this "image" is HTML markup which describes a construction of
* low level `div` and `span` nodes. Other platforms may have different
* encoding of this "image". This must be injected.
*
* @private
*/
var mountImageIntoNode = null;
/**
* Components are the basic units of composition in React.
*
* Every component accepts a set of keyed input parameters known as "props" that
* are initialized by the constructor. Once a component is mounted, the props
* can be mutated using `setProps` or `replaceProps`.
*
* Every component is capable of the following operations:
*
* `mountComponent`
* Initializes the component, renders markup, and registers event listeners.
*
* `receiveComponent`
* Updates the rendered DOM nodes to match the given component.
*
* `unmountComponent`
* Releases any resources allocated by this component.
*
* Components can also be "owned" by other components. Being owned by another
* component means being constructed by that component. This is different from
* being the child of a component, which means having a DOM representation that
* is a child of the DOM representation of that component.
*
* @class ReactComponent
*/
var ReactComponent = {
injection: {
injectEnvironment: function(ReactComponentEnvironment) {
("production" !== "development" ? invariant(
!injected,
'ReactComponent: injectEnvironment() can only be called once.'
) : invariant(!injected));
mountImageIntoNode = ReactComponentEnvironment.mountImageIntoNode;
unmountIDFromEnvironment =
ReactComponentEnvironment.unmountIDFromEnvironment;
ReactComponent.BackendIDOperations =
ReactComponentEnvironment.BackendIDOperations;
injected = true;
}
},
/**
* @internal
*/
LifeCycle: ComponentLifeCycle,
/**
* Injected module that provides ability to mutate individual properties.
* Injected into the base class because many different subclasses need access
* to this.
*
* @internal
*/
BackendIDOperations: null,
/**
* Base functionality for every ReactComponent constructor. Mixed into the
* `ReactComponent` prototype, but exposed statically for easy access.
*
* @lends {ReactComponent.prototype}
*/
Mixin: {
/**
* Checks whether or not this component is mounted.
*
* @return {boolean} True if mounted, false otherwise.
* @final
* @protected
*/
isMounted: function() {
return this._lifeCycleState === ComponentLifeCycle.MOUNTED;
},
/**
* Sets a subset of the props.
*
* @param {object} partialProps Subset of the next props.
* @param {?function} callback Called after props are updated.
* @final
* @public
*/
setProps: function(partialProps, callback) {
// Merge with the pending element if it exists, otherwise with existing
// element props.
var element = this._pendingElement || this._currentElement;
this.replaceProps(
assign({}, element.props, partialProps),
callback
);
},
/**
* Replaces all of the props.
*
* @param {object} props New props.
* @param {?function} callback Called after props are updated.
* @final
* @public
*/
replaceProps: function(props, callback) {
("production" !== "development" ? invariant(
this.isMounted(),
'replaceProps(...): Can only update a mounted component.'
) : invariant(this.isMounted()));
("production" !== "development" ? invariant(
this._mountDepth === 0,
'replaceProps(...): You called `setProps` or `replaceProps` on a ' +
'component with a parent. This is an anti-pattern since props will ' +
'get reactively updated when rendered. Instead, change the owner\'s ' +
'`render` method to pass the correct value as props to the component ' +
'where it is created.'
) : invariant(this._mountDepth === 0));
// This is a deoptimized path. We optimize for always having a element.
// This creates an extra internal element.
this._pendingElement = ReactElement.cloneAndReplaceProps(
this._pendingElement || this._currentElement,
props
);
ReactUpdates.enqueueUpdate(this, callback);
},
/**
* Schedule a partial update to the props. Only used for internal testing.
*
* @param {object} partialProps Subset of the next props.
* @param {?function} callback Called after props are updated.
* @final
* @internal
*/
_setPropsInternal: function(partialProps, callback) {
// This is a deoptimized path. We optimize for always having a element.
// This creates an extra internal element.
var element = this._pendingElement || this._currentElement;
this._pendingElement = ReactElement.cloneAndReplaceProps(
element,
assign({}, element.props, partialProps)
);
ReactUpdates.enqueueUpdate(this, callback);
},
/**
* Base constructor for all React components.
*
* Subclasses that override this method should make sure to invoke
* `ReactComponent.Mixin.construct.call(this, ...)`.
*
* @param {ReactElement} element
* @internal
*/
construct: function(element) {
// This is the public exposed props object after it has been processed
// with default props. The element's props represents the true internal
// state of the props.
this.props = element.props;
// Record the component responsible for creating this component.
// This is accessible through the element but we maintain an extra
// field for compatibility with devtools and as a way to make an
// incremental update. TODO: Consider deprecating this field.
this._owner = element._owner;
// All components start unmounted.
this._lifeCycleState = ComponentLifeCycle.UNMOUNTED;
// See ReactUpdates.
this._pendingCallbacks = null;
// We keep the old element and a reference to the pending element
// to track updates.
this._currentElement = element;
this._pendingElement = null;
},
/**
* Initializes the component, renders markup, and registers event listeners.
*
* NOTE: This does not insert any nodes into the DOM.
*
* Subclasses that override this method should make sure to invoke
* `ReactComponent.Mixin.mountComponent.call(this, ...)`.
*
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {number} mountDepth number of components in the owner hierarchy.
* @return {?string} Rendered markup to be inserted into the DOM.
* @internal
*/
mountComponent: function(rootID, transaction, mountDepth) {
("production" !== "development" ? invariant(
!this.isMounted(),
'mountComponent(%s, ...): Can only mount an unmounted component. ' +
'Make sure to avoid storing components between renders or reusing a ' +
'single component instance in multiple places.',
rootID
) : invariant(!this.isMounted()));
var ref = this._currentElement.ref;
if (ref != null) {
var owner = this._currentElement._owner;
ReactOwner.addComponentAsRefTo(this, ref, owner);
}
this._rootNodeID = rootID;
this._lifeCycleState = ComponentLifeCycle.MOUNTED;
this._mountDepth = mountDepth;
// Effectively: return '';
},
/**
* Releases any resources allocated by `mountComponent`.
*
* NOTE: This does not remove any nodes from the DOM.
*
* Subclasses that override this method should make sure to invoke
* `ReactComponent.Mixin.unmountComponent.call(this)`.
*
* @internal
*/
unmountComponent: function() {
("production" !== "development" ? invariant(
this.isMounted(),
'unmountComponent(): Can only unmount a mounted component.'
) : invariant(this.isMounted()));
var ref = this._currentElement.ref;
if (ref != null) {
ReactOwner.removeComponentAsRefFrom(this, ref, this._owner);
}
unmountIDFromEnvironment(this._rootNodeID);
this._rootNodeID = null;
this._lifeCycleState = ComponentLifeCycle.UNMOUNTED;
},
/**
* Given a new instance of this component, updates the rendered DOM nodes
* as if that instance was rendered instead.
*
* Subclasses that override this method should make sure to invoke
* `ReactComponent.Mixin.receiveComponent.call(this, ...)`.
*
* @param {object} nextComponent Next set of properties.
* @param {ReactReconcileTransaction} transaction
* @internal
*/
receiveComponent: function(nextElement, transaction) {
("production" !== "development" ? invariant(
this.isMounted(),
'receiveComponent(...): Can only update a mounted component.'
) : invariant(this.isMounted()));
this._pendingElement = nextElement;
this.performUpdateIfNecessary(transaction);
},
/**
* If `_pendingElement` is set, update the component.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function(transaction) {
if (this._pendingElement == null) {
return;
}
var prevElement = this._currentElement;
var nextElement = this._pendingElement;
this._currentElement = nextElement;
this.props = nextElement.props;
this._owner = nextElement._owner;
this._pendingElement = null;
this.updateComponent(transaction, prevElement);
},
/**
* Updates the component's currently mounted representation.
*
* @param {ReactReconcileTransaction} transaction
* @param {object} prevElement
* @internal
*/
updateComponent: function(transaction, prevElement) {
var nextElement = this._currentElement;
// If either the owner or a `ref` has changed, make sure the newest owner
// has stored a reference to `this`, and the previous owner (if different)
// has forgotten the reference to `this`. We use the element instead
// of the public this.props because the post processing cannot determine
// a ref. The ref conceptually lives on the element.
// TODO: Should this even be possible? The owner cannot change because
// it's forbidden by shouldUpdateReactComponent. The ref can change
// if you swap the keys of but not the refs. Reconsider where this check
// is made. It probably belongs where the key checking and
// instantiateReactComponent is done.
if (nextElement._owner !== prevElement._owner ||
nextElement.ref !== prevElement.ref) {
if (prevElement.ref != null) {
ReactOwner.removeComponentAsRefFrom(
this, prevElement.ref, prevElement._owner
);
}
// Correct, even if the owner is the same, and only the ref has changed.
if (nextElement.ref != null) {
ReactOwner.addComponentAsRefTo(
this,
nextElement.ref,
nextElement._owner
);
}
}
},
/**
* Mounts this component and inserts it into the DOM.
*
* @param {string} rootID DOM ID of the root node.
* @param {DOMElement} container DOM element to mount into.
* @param {boolean} shouldReuseMarkup If true, do not insert markup
* @final
* @internal
* @see {ReactMount.render}
*/
mountComponentIntoNode: function(rootID, container, shouldReuseMarkup) {
var transaction = ReactUpdates.ReactReconcileTransaction.getPooled();
transaction.perform(
this._mountComponentIntoNode,
this,
rootID,
container,
transaction,
shouldReuseMarkup
);
ReactUpdates.ReactReconcileTransaction.release(transaction);
},
/**
* @param {string} rootID DOM ID of the root node.
* @param {DOMElement} container DOM element to mount into.
* @param {ReactReconcileTransaction} transaction
* @param {boolean} shouldReuseMarkup If true, do not insert markup
* @final
* @private
*/
_mountComponentIntoNode: function(
rootID,
container,
transaction,
shouldReuseMarkup) {
var markup = this.mountComponent(rootID, transaction, 0);
mountImageIntoNode(markup, container, shouldReuseMarkup);
},
/**
* Checks if this component is owned by the supplied `owner` component.
*
* @param {ReactComponent} owner Component to check.
* @return {boolean} True if `owners` owns this component.
* @final
* @internal
*/
isOwnedBy: function(owner) {
return this._owner === owner;
},
/**
* Gets another component, that shares the same owner as this one, by ref.
*
* @param {string} ref of a sibling Component.
* @return {?ReactComponent} the actual sibling Component.
* @final
* @internal
*/
getSiblingByRef: function(ref) {
var owner = this._owner;
if (!owner || !owner.refs) {
return null;
}
return owner.refs[ref];
}
}
};
module.exports = ReactComponent;
},{"./Object.assign":27,"./ReactElement":52,"./ReactOwner":67,"./ReactUpdates":79,"./invariant":126,"./keyMirror":132}],33:[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.
*
* @providesModule ReactComponentBrowserEnvironment
*/
/*jslint evil: true */
"use strict";
var ReactDOMIDOperations = _dereq_("./ReactDOMIDOperations");
var ReactMarkupChecksum = _dereq_("./ReactMarkupChecksum");
var ReactMount = _dereq_("./ReactMount");
var ReactPerf = _dereq_("./ReactPerf");
var ReactReconcileTransaction = _dereq_("./ReactReconcileTransaction");
var getReactRootElementInContainer = _dereq_("./getReactRootElementInContainer");
var invariant = _dereq_("./invariant");
var setInnerHTML = _dereq_("./setInnerHTML");
var ELEMENT_NODE_TYPE = 1;
var DOC_NODE_TYPE = 9;
/**
* Abstracts away all functionality of `ReactComponent` requires knowledge of
* the browser context.
*/
var ReactComponentBrowserEnvironment = {
ReactReconcileTransaction: ReactReconcileTransaction,
BackendIDOperations: ReactDOMIDOperations,
/**
* If a particular environment requires that some resources be cleaned up,
* specify this in the injected Mixin. In the DOM, we would likely want to
* purge any cached node ID lookups.
*
* @private
*/
unmountIDFromEnvironment: function(rootNodeID) {
ReactMount.purgeID(rootNodeID);
},
/**
* @param {string} markup Markup string to place into the DOM Element.
* @param {DOMElement} container DOM Element to insert markup into.
* @param {boolean} shouldReuseMarkup Should reuse the existing markup in the
* container if possible.
*/
mountImageIntoNode: ReactPerf.measure(
'ReactComponentBrowserEnvironment',
'mountImageIntoNode',
function(markup, container, shouldReuseMarkup) {
("production" !== "development" ? invariant(
container && (
container.nodeType === ELEMENT_NODE_TYPE ||
container.nodeType === DOC_NODE_TYPE
),
'mountComponentIntoNode(...): Target container is not valid.'
) : invariant(container && (
container.nodeType === ELEMENT_NODE_TYPE ||
container.nodeType === DOC_NODE_TYPE
)));
if (shouldReuseMarkup) {
if (ReactMarkupChecksum.canReuseMarkup(
markup,
getReactRootElementInContainer(container))) {
return;
} else {
("production" !== "development" ? invariant(
container.nodeType !== DOC_NODE_TYPE,
'You\'re trying to render a component to the document using ' +
'server rendering but the checksum was invalid. This usually ' +
'means you rendered a different component type or props on ' +
'the client from the one on the server, or your render() ' +
'methods are impure. React cannot handle this case due to ' +
'cross-browser quirks by rendering at the document root. You ' +
'should look for environment dependent code in your components ' +
'and ensure the props are the same client and server side.'
) : invariant(container.nodeType !== DOC_NODE_TYPE));
if ("production" !== "development") {
console.warn(
'React attempted to use reuse markup in a container but the ' +
'checksum was invalid. This generally means that you are ' +
'using server rendering and the markup generated on the ' +
'server was not what the client was expecting. React injected ' +
'new markup to compensate which works but you have lost many ' +
'of the benefits of server rendering. Instead, figure out ' +
'why the markup being generated is different on the client ' +
'or server.'
);
}
}
}
("production" !== "development" ? invariant(
container.nodeType !== DOC_NODE_TYPE,
'You\'re trying to render a component to the document but ' +
'you didn\'t use server rendering. We can\'t do this ' +
'without using server rendering due to cross-browser quirks. ' +
'See renderComponentToString() for server rendering.'
) : invariant(container.nodeType !== DOC_NODE_TYPE));
setInnerHTML(container, markup);
}
)
};
module.exports = ReactComponentBrowserEnvironment;
},{"./ReactDOMIDOperations":41,"./ReactMarkupChecksum":62,"./ReactMount":63,"./ReactPerf":68,"./ReactReconcileTransaction":74,"./getReactRootElementInContainer":120,"./invariant":126,"./setInnerHTML":140}],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.
*
* @providesModule ReactCompositeComponent
*/
"use strict";
var ReactComponent = _dereq_("./ReactComponent");
var ReactContext = _dereq_("./ReactContext");
var ReactCurrentOwner = _dereq_("./ReactCurrentOwner");
var ReactElement = _dereq_("./ReactElement");
var ReactElementValidator = _dereq_("./ReactElementValidator");
var ReactEmptyComponent = _dereq_("./ReactEmptyComponent");
var ReactErrorUtils = _dereq_("./ReactErrorUtils");
var ReactLegacyElement = _dereq_("./ReactLegacyElement");
var ReactOwner = _dereq_("./ReactOwner");
var ReactPerf = _dereq_("./ReactPerf");
var ReactPropTransferer = _dereq_("./ReactPropTransferer");
var ReactPropTypeLocations = _dereq_("./ReactPropTypeLocations");
var ReactPropTypeLocationNames = _dereq_("./ReactPropTypeLocationNames");
var ReactUpdates = _dereq_("./ReactUpdates");
var assign = _dereq_("./Object.assign");
var instantiateReactComponent = _dereq_("./instantiateReactComponent");
var invariant = _dereq_("./invariant");
var keyMirror = _dereq_("./keyMirror");
var keyOf = _dereq_("./keyOf");
var monitorCodeUse = _dereq_("./monitorCodeUse");
var mapObject = _dereq_("./mapObject");
var shouldUpdateReactComponent = _dereq_("./shouldUpdateReactComponent");
var warning = _dereq_("./warning");
var MIXINS_KEY = keyOf({mixins: null});
/**
* Policies that describe methods in `ReactCompositeComponentInterface`.
*/
var SpecPolicy = keyMirror({
/**
* These methods may be defined only once by the class specification or mixin.
*/
DEFINE_ONCE: null,
/**
* These methods may be defined by both the class specification and mixins.
* Subsequent definitions will be chained. These methods must return void.
*/
DEFINE_MANY: null,
/**
* These methods are overriding the base ReactCompositeComponent class.
*/
OVERRIDE_BASE: null,
/**
* These methods are similar to DEFINE_MANY, except we assume they return
* objects. We try to merge the keys of the return values of all the mixed in
* functions. If there is a key conflict we throw.
*/
DEFINE_MANY_MERGED: null
});
var injectedMixins = [];
/**
* Composite components are higher-level components that compose other composite
* or native components.
*
* To create a new type of `ReactCompositeComponent`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return <div>Hello World</div>;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactCompositeComponentInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will available on the prototype.
*
* @interface ReactCompositeComponentInterface
* @internal
*/
var ReactCompositeComponentInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: SpecPolicy.DEFINE_MANY,
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: SpecPolicy.DEFINE_MANY,
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: SpecPolicy.DEFINE_MANY,
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: SpecPolicy.DEFINE_MANY,
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: SpecPolicy.DEFINE_MANY,
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
/**
* Invoked once before the component is mounted. The return value will be used
* as the initial value of `this.state`.
*
* getInitialState: function() {
* return {
* isOn: false,
* fooBaz: new BazFoo()
* }
* }
*
* @return {object}
* @optional
*/
getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
/**
* @return {object}
* @optional
*/
getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
/**
* Uses props from `this.props` and state from `this.state` to render the
* structure of the component.
*
* No guarantees are made about when or how often this method is invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return <div>Hello, {name}!</div>;
* }
*
* @return {ReactComponent}
* @nosideeffects
* @required
*/
render: SpecPolicy.DEFINE_ONCE,
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component has been mounted and has a DOM representation.
* However, there is no guarantee that the DOM node is in the document.
*
* Use this as an opportunity to operate on the DOM when the component has
* been mounted (initialized and rendered) for the first time.
*
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidMount: SpecPolicy.DEFINE_MANY,
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
* transition may cause a state change, but the opposite is not true. If you
* need it, you are probably looking for `componentWillUpdate`.
*
* @param {object} nextProps
* @optional
*/
componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* update.
*
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
* return !equal(nextProps, this.props) ||
* !equal(nextState, this.state) ||
* !equal(nextContext, this.context);
* }
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @return {boolean} True if the component should update.
* @optional
*/
shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* and `nextContext`.
*
* Use this as an opportunity to perform preparation before an update occurs.
*
* NOTE: You **cannot** use `this.setState()` in this method.
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @param {ReactReconcileTransaction} transaction
* @optional
*/
componentWillUpdate: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component's DOM representation has been updated.
*
* Use this as an opportunity to operate on the DOM when the component has
* been updated.
*
* @param {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: SpecPolicy.DEFINE_MANY,
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: SpecPolicy.OVERRIDE_BASE
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* being static, they must be defined outside of the "statics" key under
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
displayName: function(Constructor, displayName) {
Constructor.displayName = displayName;
},
mixins: function(Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
childContextTypes: function(Constructor, childContextTypes) {
validateTypeDef(
Constructor,
childContextTypes,
ReactPropTypeLocations.childContext
);
Constructor.childContextTypes = assign(
{},
Constructor.childContextTypes,
childContextTypes
);
},
contextTypes: function(Constructor, contextTypes) {
validateTypeDef(
Constructor,
contextTypes,
ReactPropTypeLocations.context
);
Constructor.contextTypes = assign(
{},
Constructor.contextTypes,
contextTypes
);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function(Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(
Constructor.getDefaultProps,
getDefaultProps
);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function(Constructor, propTypes) {
validateTypeDef(
Constructor,
propTypes,
ReactPropTypeLocations.prop
);
Constructor.propTypes = assign(
{},
Constructor.propTypes,
propTypes
);
},
statics: function(Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
}
};
function getDeclarationErrorAddendum(component) {
var owner = component._owner || null;
if (owner && owner.constructor && owner.constructor.displayName) {
return ' Check the render method of `' + owner.constructor.displayName +
'`.';
}
return '';
}
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
("production" !== "development" ? invariant(
typeof typeDef[propName] == 'function',
'%s: %s type `%s` is invalid; it must be a function, usually from ' +
'React.PropTypes.',
Constructor.displayName || 'ReactCompositeComponent',
ReactPropTypeLocationNames[location],
propName
) : invariant(typeof typeDef[propName] == 'function'));
}
}
}
function validateMethodOverride(proto, name) {
var specPolicy = ReactCompositeComponentInterface.hasOwnProperty(name) ?
ReactCompositeComponentInterface[name] :
null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactCompositeComponentMixin.hasOwnProperty(name)) {
("production" !== "development" ? invariant(
specPolicy === SpecPolicy.OVERRIDE_BASE,
'ReactCompositeComponentInterface: You are attempting to override ' +
'`%s` from your class specification. Ensure that your method names ' +
'do not overlap with React methods.',
name
) : invariant(specPolicy === SpecPolicy.OVERRIDE_BASE));
}
// Disallow defining methods more than once unless explicitly allowed.
if (proto.hasOwnProperty(name)) {
("production" !== "development" ? invariant(
specPolicy === SpecPolicy.DEFINE_MANY ||
specPolicy === SpecPolicy.DEFINE_MANY_MERGED,
'ReactCompositeComponentInterface: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be due ' +
'to a mixin.',
name
) : invariant(specPolicy === SpecPolicy.DEFINE_MANY ||
specPolicy === SpecPolicy.DEFINE_MANY_MERGED));
}
}
function validateLifeCycleOnReplaceState(instance) {
var compositeLifeCycleState = instance._compositeLifeCycleState;
("production" !== "development" ? invariant(
instance.isMounted() ||
compositeLifeCycleState === CompositeLifeCycle.MOUNTING,
'replaceState(...): Can only update a mounted or mounting component.'
) : invariant(instance.isMounted() ||
compositeLifeCycleState === CompositeLifeCycle.MOUNTING));
("production" !== "development" ? invariant(
ReactCurrentOwner.current == null,
'replaceState(...): Cannot update during an existing state transition ' +
'(such as within `render`). Render methods should be a pure function ' +
'of props and state.'
) : invariant(ReactCurrentOwner.current == null));
("production" !== "development" ? invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING,
'replaceState(...): Cannot update while unmounting component. This ' +
'usually means you called setState() on an unmounted component.'
) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING));
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building `ReactCompositeComponent` classses.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
return;
}
("production" !== "development" ? invariant(
!ReactLegacyElement.isValidFactory(spec),
'ReactCompositeComponent: You\'re attempting to ' +
'use a component class as a mixin. Instead, just use a regular object.'
) : invariant(!ReactLegacyElement.isValidFactory(spec)));
("production" !== "development" ? invariant(
!ReactElement.isValidElement(spec),
'ReactCompositeComponent: You\'re attempting to ' +
'use a component as a mixin. Instead, just use a regular object.'
) : invariant(!ReactElement.isValidElement(spec)));
var proto = Constructor.prototype;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above
continue;
}
var property = spec[name];
validateMethodOverride(proto, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactCompositeComponent methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isCompositeComponentMethod =
ReactCompositeComponentInterface.hasOwnProperty(name);
var isAlreadyDefined = proto.hasOwnProperty(name);
var markedDontBind = property && property.__reactDontBind;
var isFunction = typeof property === 'function';
var shouldAutoBind =
isFunction &&
!isCompositeComponentMethod &&
!isAlreadyDefined &&
!markedDontBind;
if (shouldAutoBind) {
if (!proto.__reactAutoBindMap) {
proto.__reactAutoBindMap = {};
}
proto.__reactAutoBindMap[name] = property;
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactCompositeComponentInterface[name];
// These cases should already be caught by validateMethodOverride
("production" !== "development" ? invariant(
isCompositeComponentMethod && (
specPolicy === SpecPolicy.DEFINE_MANY_MERGED ||
specPolicy === SpecPolicy.DEFINE_MANY
),
'ReactCompositeComponent: Unexpected spec policy %s for key %s ' +
'when mixing in component specs.',
specPolicy,
name
) : invariant(isCompositeComponentMethod && (
specPolicy === SpecPolicy.DEFINE_MANY_MERGED ||
specPolicy === SpecPolicy.DEFINE_MANY
)));
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === SpecPolicy.DEFINE_MANY) {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if ("production" !== "development") {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
function mixStaticSpecIntoComponent(Constructor, statics) {
if (!statics) {
return;
}
for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
continue;
}
var isReserved = name in RESERVED_SPEC_KEYS;
("production" !== "development" ? invariant(
!isReserved,
'ReactCompositeComponent: You are attempting to define a reserved ' +
'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
'as an instance property instead; it will still be accessible on the ' +
'constructor.',
name
) : invariant(!isReserved));
var isInherited = name in Constructor;
("production" !== "development" ? invariant(
!isInherited,
'ReactCompositeComponent: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be ' +
'due to a mixin.',
name
) : invariant(!isInherited));
Constructor[name] = property;
}
}
/**
* Merge two objects, but throw if both contain the same key.
*
* @param {object} one The first object, which is mutated.
* @param {object} two The second object
* @return {object} one after it has been mutated to contain everything in two.
*/
function mergeObjectsWithNoDuplicateKeys(one, two) {
("production" !== "development" ? invariant(
one && two && typeof one === 'object' && typeof two === 'object',
'mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects'
) : invariant(one && two && typeof one === 'object' && typeof two === 'object'));
mapObject(two, function(value, key) {
("production" !== "development" ? invariant(
one[key] === undefined,
'mergeObjectsWithNoDuplicateKeys(): ' +
'Tried to merge two objects with the same key: `%s`. This conflict ' +
'may be due to a mixin; in particular, this may be caused by two ' +
'getInitialState() or getDefaultProps() methods returning objects ' +
'with clashing keys.',
key
) : invariant(one[key] === undefined));
one[key] = value;
});
return one;
}
/**
* Creates a function that invokes two functions and merges their return values.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createMergedResultFunction(one, two) {
return function mergedResult() {
var a = one.apply(this, arguments);
var b = two.apply(this, arguments);
if (a == null) {
return b;
} else if (b == null) {
return a;
}
return mergeObjectsWithNoDuplicateKeys(a, b);
};
}
/**
* Creates a function that invokes two functions and ignores their return vales.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createChainedFunction(one, two) {
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
/**
* `ReactCompositeComponent` maintains an auxiliary life cycle state in
* `this._compositeLifeCycleState` (which can be null).
*
* This is different from the life cycle state maintained by `ReactComponent` in
* `this._lifeCycleState`. The following diagram shows how the states overlap in
* time. There are times when the CompositeLifeCycle is null - at those times it
* is only meaningful to look at ComponentLifeCycle alone.
*
* Top Row: ReactComponent.ComponentLifeCycle
* Low Row: ReactComponent.CompositeLifeCycle
*
* +-------+---------------------------------+--------+
* | UN | MOUNTED | UN |
* |MOUNTED| | MOUNTED|
* +-------+---------------------------------+--------+
* | ^--------+ +-------+ +--------^ |
* | | | | | | | |
* | 0--|MOUNTING|-0-|RECEIVE|-0-| UN |--->0 |
* | | | |PROPS | |MOUNTING| |
* | | | | | | | |
* | | | | | | | |
* | +--------+ +-------+ +--------+ |
* | | | |
* +-------+---------------------------------+--------+
*/
var CompositeLifeCycle = keyMirror({
/**
* Components in the process of being mounted respond to state changes
* differently.
*/
MOUNTING: null,
/**
* Components in the process of being unmounted are guarded against state
* changes.
*/
UNMOUNTING: null,
/**
* Components that are mounted and receiving new props respond to state
* changes differently.
*/
RECEIVING_PROPS: null
});
/**
* @lends {ReactCompositeComponent.prototype}
*/
var ReactCompositeComponentMixin = {
/**
* Base constructor for all composite component.
*
* @param {ReactElement} element
* @final
* @internal
*/
construct: function(element) {
// Children can be either an array or more than one argument
ReactComponent.Mixin.construct.apply(this, arguments);
ReactOwner.Mixin.construct.apply(this, arguments);
this.state = null;
this._pendingState = null;
// This is the public post-processed context. The real context and pending
// context lives on the element.
this.context = null;
this._compositeLifeCycleState = null;
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function() {
return ReactComponent.Mixin.isMounted.call(this) &&
this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING;
},
/**
* Initializes the component, renders markup, and registers event listeners.
*
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {number} mountDepth number of components in the owner hierarchy
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: ReactPerf.measure(
'ReactCompositeComponent',
'mountComponent',
function(rootID, transaction, mountDepth) {
ReactComponent.Mixin.mountComponent.call(
this,
rootID,
transaction,
mountDepth
);
this._compositeLifeCycleState = CompositeLifeCycle.MOUNTING;
if (this.__reactAutoBindMap) {
this._bindAutoBindMethods();
}
this.context = this._processContext(this._currentElement._context);
this.props = this._processProps(this.props);
this.state = this.getInitialState ? this.getInitialState() : null;
("production" !== "development" ? invariant(
typeof this.state === 'object' && !Array.isArray(this.state),
'%s.getInitialState(): must return an object or null',
this.constructor.displayName || 'ReactCompositeComponent'
) : invariant(typeof this.state === 'object' && !Array.isArray(this.state)));
this._pendingState = null;
this._pendingForceUpdate = false;
if (this.componentWillMount) {
this.componentWillMount();
// When mounting, calls to `setState` by `componentWillMount` will set
// `this._pendingState` without triggering a re-render.
if (this._pendingState) {
this.state = this._pendingState;
this._pendingState = null;
}
}
this._renderedComponent = instantiateReactComponent(
this._renderValidatedComponent(),
this._currentElement.type // The wrapping type
);
// Done with mounting, `setState` will now trigger UI changes.
this._compositeLifeCycleState = null;
var markup = this._renderedComponent.mountComponent(
rootID,
transaction,
mountDepth + 1
);
if (this.componentDidMount) {
transaction.getReactMountReady().enqueue(this.componentDidMount, this);
}
return markup;
}
),
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function() {
this._compositeLifeCycleState = CompositeLifeCycle.UNMOUNTING;
if (this.componentWillUnmount) {
this.componentWillUnmount();
}
this._compositeLifeCycleState = null;
this._renderedComponent.unmountComponent();
this._renderedComponent = null;
ReactComponent.Mixin.unmountComponent.call(this);
// Some existing components rely on this.props even after they've been
// destroyed (in event handlers).
// TODO: this.props = null;
// TODO: this.state = null;
},
/**
* Sets a subset of the state. Always use this or `replaceState` to mutate
* state. You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* There is no guarantee that calls to `setState` will run synchronously,
* as they may eventually be batched together. You can provide an optional
* callback that will be executed when the call to setState is actually
* completed.
*
* @param {object} partialState Next partial state to be merged with state.
* @param {?function} callback Called after state is updated.
* @final
* @protected
*/
setState: function(partialState, callback) {
("production" !== "development" ? invariant(
typeof partialState === 'object' || partialState == null,
'setState(...): takes an object of state variables to update.'
) : invariant(typeof partialState === 'object' || partialState == null));
if ("production" !== "development"){
("production" !== "development" ? warning(
partialState != null,
'setState(...): You passed an undefined or null state object; ' +
'instead, use forceUpdate().'
) : null);
}
// Merge with `_pendingState` if it exists, otherwise with existing state.
this.replaceState(
assign({}, this._pendingState || this.state, partialState),
callback
);
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {object} completeState Next state.
* @param {?function} callback Called after state is updated.
* @final
* @protected
*/
replaceState: function(completeState, callback) {
validateLifeCycleOnReplaceState(this);
this._pendingState = completeState;
if (this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING) {
// If we're in a componentWillMount handler, don't enqueue a rerender
// because ReactUpdates assumes we're in a browser context (which is wrong
// for server rendering) and we're about to do a render anyway.
// TODO: The callback here is ignored when setState is called from
// componentWillMount. Either fix it or disallow doing so completely in
// favor of getInitialState.
ReactUpdates.enqueueUpdate(this, callback);
}
},
/**
* Filters the context object to only contain keys specified in
* `contextTypes`, and asserts that they are valid.
*
* @param {object} context
* @return {?object}
* @private
*/
_processContext: function(context) {
var maskedContext = null;
var contextTypes = this.constructor.contextTypes;
if (contextTypes) {
maskedContext = {};
for (var contextName in contextTypes) {
maskedContext[contextName] = context[contextName];
}
if ("production" !== "development") {
this._checkPropTypes(
contextTypes,
maskedContext,
ReactPropTypeLocations.context
);
}
}
return maskedContext;
},
/**
* @param {object} currentContext
* @return {object}
* @private
*/
_processChildContext: function(currentContext) {
var childContext = this.getChildContext && this.getChildContext();
var displayName = this.constructor.displayName || 'ReactCompositeComponent';
if (childContext) {
("production" !== "development" ? invariant(
typeof this.constructor.childContextTypes === 'object',
'%s.getChildContext(): childContextTypes must be defined in order to ' +
'use getChildContext().',
displayName
) : invariant(typeof this.constructor.childContextTypes === 'object'));
if ("production" !== "development") {
this._checkPropTypes(
this.constructor.childContextTypes,
childContext,
ReactPropTypeLocations.childContext
);
}
for (var name in childContext) {
("production" !== "development" ? invariant(
name in this.constructor.childContextTypes,
'%s.getChildContext(): key "%s" is not defined in childContextTypes.',
displayName,
name
) : invariant(name in this.constructor.childContextTypes));
}
return assign({}, currentContext, childContext);
}
return currentContext;
},
/**
* Processes props by setting default values for unspecified props and
* asserting that the props are valid. Does not mutate its argument; returns
* a new props object with defaults merged in.
*
* @param {object} newProps
* @return {object}
* @private
*/
_processProps: function(newProps) {
if ("production" !== "development") {
var propTypes = this.constructor.propTypes;
if (propTypes) {
this._checkPropTypes(propTypes, newProps, ReactPropTypeLocations.prop);
}
}
return newProps;
},
/**
* Assert that the props are valid
*
* @param {object} propTypes Map of prop name to a ReactPropType
* @param {object} props
* @param {string} location e.g. "prop", "context", "child context"
* @private
*/
_checkPropTypes: function(propTypes, props, location) {
// TODO: Stop validating prop types here and only use the element
// validation.
var componentName = this.constructor.displayName;
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error =
propTypes[propName](props, propName, componentName, location);
if (error instanceof Error) {
// We may want to extend this logic for similar errors in
// renderComponent calls, so I'm abstracting it away into
// a function to minimize refactoring in the future
var addendum = getDeclarationErrorAddendum(this);
("production" !== "development" ? warning(false, error.message + addendum) : null);
}
}
}
},
/**
* If any of `_pendingElement`, `_pendingState`, or `_pendingForceUpdate`
* is set, update the component.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function(transaction) {
var compositeLifeCycleState = this._compositeLifeCycleState;
// Do not trigger a state transition if we are in the middle of mounting or
// receiving props because both of those will already be doing this.
if (compositeLifeCycleState === CompositeLifeCycle.MOUNTING ||
compositeLifeCycleState === CompositeLifeCycle.RECEIVING_PROPS) {
return;
}
if (this._pendingElement == null &&
this._pendingState == null &&
!this._pendingForceUpdate) {
return;
}
var nextContext = this.context;
var nextProps = this.props;
var nextElement = this._currentElement;
if (this._pendingElement != null) {
nextElement = this._pendingElement;
nextContext = this._processContext(nextElement._context);
nextProps = this._processProps(nextElement.props);
this._pendingElement = null;
this._compositeLifeCycleState = CompositeLifeCycle.RECEIVING_PROPS;
if (this.componentWillReceiveProps) {
this.componentWillReceiveProps(nextProps, nextContext);
}
}
this._compositeLifeCycleState = null;
var nextState = this._pendingState || this.state;
this._pendingState = null;
var shouldUpdate =
this._pendingForceUpdate ||
!this.shouldComponentUpdate ||
this.shouldComponentUpdate(nextProps, nextState, nextContext);
if ("production" !== "development") {
if (typeof shouldUpdate === "undefined") {
console.warn(
(this.constructor.displayName || 'ReactCompositeComponent') +
'.shouldComponentUpdate(): Returned undefined instead of a ' +
'boolean value. Make sure to return true or false.'
);
}
}
if (shouldUpdate) {
this._pendingForceUpdate = false;
// Will set `this.props`, `this.state` and `this.context`.
this._performComponentUpdate(
nextElement,
nextProps,
nextState,
nextContext,
transaction
);
} else {
// If it's determined that a component should not update, we still want
// to set props and state.
this._currentElement = nextElement;
this.props = nextProps;
this.state = nextState;
this.context = nextContext;
// Owner cannot change because shouldUpdateReactComponent doesn't allow
// it. TODO: Remove this._owner completely.
this._owner = nextElement._owner;
}
},
/**
* Merges new props and state, notifies delegate methods of update and
* performs update.
*
* @param {ReactElement} nextElement Next element
* @param {object} nextProps Next public object to set as properties.
* @param {?object} nextState Next object to set as state.
* @param {?object} nextContext Next public object to set as context.
* @param {ReactReconcileTransaction} transaction
* @private
*/
_performComponentUpdate: function(
nextElement,
nextProps,
nextState,
nextContext,
transaction
) {
var prevElement = this._currentElement;
var prevProps = this.props;
var prevState = this.state;
var prevContext = this.context;
if (this.componentWillUpdate) {
this.componentWillUpdate(nextProps, nextState, nextContext);
}
this._currentElement = nextElement;
this.props = nextProps;
this.state = nextState;
this.context = nextContext;
// Owner cannot change because shouldUpdateReactComponent doesn't allow
// it. TODO: Remove this._owner completely.
this._owner = nextElement._owner;
this.updateComponent(
transaction,
prevElement
);
if (this.componentDidUpdate) {
transaction.getReactMountReady().enqueue(
this.componentDidUpdate.bind(this, prevProps, prevState, prevContext),
this
);
}
},
receiveComponent: function(nextElement, transaction) {
if (nextElement === this._currentElement &&
nextElement._owner != null) {
// Since elements are immutable after the owner is rendered,
// we can do a cheap identity compare here to determine if this is a
// superfluous reconcile. It's possible for state to be mutable but such
// change should trigger an update of the owner which would recreate
// the element. We explicitly check for the existence of an owner since
// it's possible for a element created outside a composite to be
// deeply mutated and reused.
return;
}
ReactComponent.Mixin.receiveComponent.call(
this,
nextElement,
transaction
);
},
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevElement
* @internal
* @overridable
*/
updateComponent: ReactPerf.measure(
'ReactCompositeComponent',
'updateComponent',
function(transaction, prevParentElement) {
ReactComponent.Mixin.updateComponent.call(
this,
transaction,
prevParentElement
);
var prevComponentInstance = this._renderedComponent;
var prevElement = prevComponentInstance._currentElement;
var nextElement = this._renderValidatedComponent();
if (shouldUpdateReactComponent(prevElement, nextElement)) {
prevComponentInstance.receiveComponent(nextElement, transaction);
} else {
// These two IDs are actually the same! But nothing should rely on that.
var thisID = this._rootNodeID;
var prevComponentID = prevComponentInstance._rootNodeID;
prevComponentInstance.unmountComponent();
this._renderedComponent = instantiateReactComponent(
nextElement,
this._currentElement.type
);
var nextMarkup = this._renderedComponent.mountComponent(
thisID,
transaction,
this._mountDepth + 1
);
ReactComponent.BackendIDOperations.dangerouslyReplaceNodeWithMarkupByID(
prevComponentID,
nextMarkup
);
}
}
),
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldUpdateComponent`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {?function} callback Called after update is complete.
* @final
* @protected
*/
forceUpdate: function(callback) {
var compositeLifeCycleState = this._compositeLifeCycleState;
("production" !== "development" ? invariant(
this.isMounted() ||
compositeLifeCycleState === CompositeLifeCycle.MOUNTING,
'forceUpdate(...): Can only force an update on mounted or mounting ' +
'components.'
) : invariant(this.isMounted() ||
compositeLifeCycleState === CompositeLifeCycle.MOUNTING));
("production" !== "development" ? invariant(
compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING &&
ReactCurrentOwner.current == null,
'forceUpdate(...): Cannot force an update while unmounting component ' +
'or within a `render` function.'
) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING &&
ReactCurrentOwner.current == null));
this._pendingForceUpdate = true;
ReactUpdates.enqueueUpdate(this, callback);
},
/**
* @private
*/
_renderValidatedComponent: ReactPerf.measure(
'ReactCompositeComponent',
'_renderValidatedComponent',
function() {
var renderedComponent;
var previousContext = ReactContext.current;
ReactContext.current = this._processChildContext(
this._currentElement._context
);
ReactCurrentOwner.current = this;
try {
renderedComponent = this.render();
if (renderedComponent === null || renderedComponent === false) {
renderedComponent = ReactEmptyComponent.getEmptyComponent();
ReactEmptyComponent.registerNullComponentID(this._rootNodeID);
} else {
ReactEmptyComponent.deregisterNullComponentID(this._rootNodeID);
}
} finally {
ReactContext.current = previousContext;
ReactCurrentOwner.current = null;
}
("production" !== "development" ? invariant(
ReactElement.isValidElement(renderedComponent),
'%s.render(): A valid ReactComponent must be returned. You may have ' +
'returned undefined, an array or some other invalid object.',
this.constructor.displayName || 'ReactCompositeComponent'
) : invariant(ReactElement.isValidElement(renderedComponent)));
return renderedComponent;
}
),
/**
* @private
*/
_bindAutoBindMethods: function() {
for (var autoBindKey in this.__reactAutoBindMap) {
if (!this.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
continue;
}
var method = this.__reactAutoBindMap[autoBindKey];
this[autoBindKey] = this._bindAutoBindMethod(ReactErrorUtils.guard(
method,
this.constructor.displayName + '.' + autoBindKey
));
}
},
/**
* Binds a method to the component.
*
* @param {function} method Method to be bound.
* @private
*/
_bindAutoBindMethod: function(method) {
var component = this;
var boundMethod = method.bind(component);
if ("production" !== "development") {
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName;
var _bind = boundMethod.bind;
boundMethod.bind = function(newThis ) {var args=Array.prototype.slice.call(arguments,1);
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
monitorCodeUse('react_bind_warning', { component: componentName });
console.warn(
'bind(): React component methods may only be bound to the ' +
'component instance. See ' + componentName
);
} else if (!args.length) {
monitorCodeUse('react_bind_warning', { component: componentName });
console.warn(
'bind(): You are binding a component method to the component. ' +
'React does this for you automatically in a high-performance ' +
'way, so you can safely remove this call. See ' + componentName
);
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
}
return boundMethod;
}
};
var ReactCompositeComponentBase = function() {};
assign(
ReactCompositeComponentBase.prototype,
ReactComponent.Mixin,
ReactOwner.Mixin,
ReactPropTransferer.Mixin,
ReactCompositeComponentMixin
);
/**
* Module for creating composite components.
*
* @class ReactCompositeComponent
* @extends ReactComponent
* @extends ReactOwner
* @extends ReactPropTransferer
*/
var ReactCompositeComponent = {
LifeCycle: CompositeLifeCycle,
Base: ReactCompositeComponentBase,
/**
* Creates a composite component class given a class specification.
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
createClass: function(spec) {
var Constructor = function(props) {
// This constructor is overridden by mocks. The argument is used
// by mocks to assert on what gets mounted. This will later be used
// by the stand-alone class implementation.
};
Constructor.prototype = new ReactCompositeComponentBase();
Constructor.prototype.constructor = Constructor;
injectedMixins.forEach(
mixSpecIntoComponent.bind(null, Constructor)
);
mixSpecIntoComponent(Constructor, spec);
// Initialize the defaultProps property after all mixins have been merged
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
("production" !== "development" ? invariant(
Constructor.prototype.render,
'createClass(...): Class specification must implement a `render` method.'
) : invariant(Constructor.prototype.render));
if ("production" !== "development") {
if (Constructor.prototype.componentShouldUpdate) {
monitorCodeUse(
'react_component_should_update_warning',
{ component: spec.displayName }
);
console.warn(
(spec.displayName || 'A component') + ' has a method called ' +
'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
'The name is phrased as a question because the function is ' +
'expected to return a value.'
);
}
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactCompositeComponentInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
if ("production" !== "development") {
return ReactLegacyElement.wrapFactory(
ReactElementValidator.createFactory(Constructor)
);
}
return ReactLegacyElement.wrapFactory(
ReactElement.createFactory(Constructor)
);
},
injection: {
injectMixin: function(mixin) {
injectedMixins.push(mixin);
}
}
};
module.exports = ReactCompositeComponent;
},{"./Object.assign":27,"./ReactComponent":32,"./ReactContext":35,"./ReactCurrentOwner":36,"./ReactElement":52,"./ReactElementValidator":53,"./ReactEmptyComponent":54,"./ReactErrorUtils":55,"./ReactLegacyElement":61,"./ReactOwner":67,"./ReactPerf":68,"./ReactPropTransferer":69,"./ReactPropTypeLocationNames":70,"./ReactPropTypeLocations":71,"./ReactUpdates":79,"./instantiateReactComponent":125,"./invariant":126,"./keyMirror":132,"./keyOf":133,"./mapObject":134,"./monitorCodeUse":136,"./shouldUpdateReactComponent":142,"./warning":145}],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.
*
* @providesModule ReactContext
*/
"use strict";
var assign = _dereq_("./Object.assign");
/**
* Keeps track of the current context.
*
* The context is automatically passed down the component ownership hierarchy
* and is accessible via `this.context` on ReactCompositeComponents.
*/
var ReactContext = {
/**
* @internal
* @type {object}
*/
current: {},
/**
* Temporarily extends the current context while executing scopedCallback.
*
* A typical use case might look like
*
* render: function() {
* var children = ReactContext.withContext({foo: 'foo'}, () => (
*
* ));
* return <div>{children}</div>;
* }
*
* @param {object} newContext New context to merge into the existing context
* @param {function} scopedCallback Callback to run with the new context
* @return {ReactComponent|array<ReactComponent>}
*/
withContext: function(newContext, scopedCallback) {
var result;
var previousContext = ReactContext.current;
ReactContext.current = assign({}, previousContext, newContext);
try {
result = scopedCallback();
} finally {
ReactContext.current = previousContext;
}
return result;
}
};
module.exports = ReactContext;
},{"./Object.assign":27}],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.
*
* @providesModule ReactCurrentOwner
*/
"use strict";
/**
* Keeps track of the current owner.
*
* The current owner is the component who should own any components that are
* currently being constructed.
*
* The depth indicate how many composite components are above this render level.
*/
var ReactCurrentOwner = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
module.exports = ReactCurrentOwner;
},{}],37:[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.
*
* @providesModule ReactDOM
* @typechecks static-only
*/
"use strict";
var ReactElement = _dereq_("./ReactElement");
var ReactElementValidator = _dereq_("./ReactElementValidator");
var ReactLegacyElement = _dereq_("./ReactLegacyElement");
var mapObject = _dereq_("./mapObject");
/**
* Create a factory that creates HTML tag elements.
*
* @param {string} tag Tag name (e.g. `div`).
* @private
*/
function createDOMFactory(tag) {
if ("production" !== "development") {
return ReactLegacyElement.markNonLegacyFactory(
ReactElementValidator.createFactory(tag)
);
}
return ReactLegacyElement.markNonLegacyFactory(
ReactElement.createFactory(tag)
);
}
/**
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
* This is also accessible via `React.DOM`.
*
* @public
*/
var ReactDOM = mapObject({
a: 'a',
abbr: 'abbr',
address: 'address',
area: 'area',
article: 'article',
aside: 'aside',
audio: 'audio',
b: 'b',
base: 'base',
bdi: 'bdi',
bdo: 'bdo',
big: 'big',
blockquote: 'blockquote',
body: 'body',
br: 'br',
button: 'button',
canvas: 'canvas',
caption: 'caption',
cite: 'cite',
code: 'code',
col: 'col',
colgroup: 'colgroup',
data: 'data',
datalist: 'datalist',
dd: 'dd',
del: 'del',
details: 'details',
dfn: 'dfn',
dialog: 'dialog',
div: 'div',
dl: 'dl',
dt: 'dt',
em: 'em',
embed: 'embed',
fieldset: 'fieldset',
figcaption: 'figcaption',
figure: 'figure',
footer: 'footer',
form: 'form',
h1: 'h1',
h2: 'h2',
h3: 'h3',
h4: 'h4',
h5: 'h5',
h6: 'h6',
head: 'head',
header: 'header',
hr: 'hr',
html: 'html',
i: 'i',
iframe: 'iframe',
img: 'img',
input: 'input',
ins: 'ins',
kbd: 'kbd',
keygen: 'keygen',
label: 'label',
legend: 'legend',
li: 'li',
link: 'link',
main: 'main',
map: 'map',
mark: 'mark',
menu: 'menu',
menuitem: 'menuitem',
meta: 'meta',
meter: 'meter',
nav: 'nav',
noscript: 'noscript',
object: 'object',
ol: 'ol',
optgroup: 'optgroup',
option: 'option',
output: 'output',
p: 'p',
param: 'param',
picture: 'picture',
pre: 'pre',
progress: 'progress',
q: 'q',
rp: 'rp',
rt: 'rt',
ruby: 'ruby',
s: 's',
samp: 'samp',
script: 'script',
section: 'section',
select: 'select',
small: 'small',
source: 'source',
span: 'span',
strong: 'strong',
style: 'style',
sub: 'sub',
summary: 'summary',
sup: 'sup',
table: 'table',
tbody: 'tbody',
td: 'td',
textarea: 'textarea',
tfoot: 'tfoot',
th: 'th',
thead: 'thead',
time: 'time',
title: 'title',
tr: 'tr',
track: 'track',
u: 'u',
ul: 'ul',
'var': 'var',
video: 'video',
wbr: 'wbr',
// SVG
circle: 'circle',
defs: 'defs',
ellipse: 'ellipse',
g: 'g',
line: 'line',
linearGradient: 'linearGradient',
mask: 'mask',
path: 'path',
pattern: 'pattern',
polygon: 'polygon',
polyline: 'polyline',
radialGradient: 'radialGradient',
rect: 'rect',
stop: 'stop',
svg: 'svg',
text: 'text',
tspan: 'tspan'
}, createDOMFactory);
module.exports = ReactDOM;
},{"./ReactElement":52,"./ReactElementValidator":53,"./ReactLegacyElement":61,"./mapObject":134}],38:[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.
*
* @providesModule ReactDOMButton
*/
"use strict";
var AutoFocusMixin = _dereq_("./AutoFocusMixin");
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactElement = _dereq_("./ReactElement");
var ReactDOM = _dereq_("./ReactDOM");
var keyMirror = _dereq_("./keyMirror");
// Store a reference to the <button> `ReactDOMComponent`. TODO: use string
var button = ReactElement.createFactory(ReactDOM.button.type);
var mouseListenerNames = keyMirror({
onClick: true,
onDoubleClick: true,
onMouseDown: true,
onMouseMove: true,
onMouseUp: true,
onClickCapture: true,
onDoubleClickCapture: true,
onMouseDownCapture: true,
onMouseMoveCapture: true,
onMouseUpCapture: true
});
/**
* Implements a <button> native component that does not receive mouse events
* when `disabled` is set.
*/
var ReactDOMButton = ReactCompositeComponent.createClass({
displayName: 'ReactDOMButton',
mixins: [AutoFocusMixin, ReactBrowserComponentMixin],
render: function() {
var props = {};
// Copy the props; except the mouse listeners if we're disabled
for (var key in this.props) {
if (this.props.hasOwnProperty(key) &&
(!this.props.disabled || !mouseListenerNames[key])) {
props[key] = this.props[key];
}
}
return button(props, this.props.children);
}
});
module.exports = ReactDOMButton;
},{"./AutoFocusMixin":2,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":52,"./keyMirror":132}],39:[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.
*
* @providesModule ReactDOMComponent
* @typechecks static-only
*/
"use strict";
var CSSPropertyOperations = _dereq_("./CSSPropertyOperations");
var DOMProperty = _dereq_("./DOMProperty");
var DOMPropertyOperations = _dereq_("./DOMPropertyOperations");
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactComponent = _dereq_("./ReactComponent");
var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter");
var ReactMount = _dereq_("./ReactMount");
var ReactMultiChild = _dereq_("./ReactMultiChild");
var ReactPerf = _dereq_("./ReactPerf");
var assign = _dereq_("./Object.assign");
var escapeTextForBrowser = _dereq_("./escapeTextForBrowser");
var invariant = _dereq_("./invariant");
var isEventSupported = _dereq_("./isEventSupported");
var keyOf = _dereq_("./keyOf");
var monitorCodeUse = _dereq_("./monitorCodeUse");
var deleteListener = ReactBrowserEventEmitter.deleteListener;
var listenTo = ReactBrowserEventEmitter.listenTo;
var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules;
// For quickly matching children type, to test if can be treated as content.
var CONTENT_TYPES = {'string': true, 'number': true};
var STYLE = keyOf({style: null});
var ELEMENT_NODE_TYPE = 1;
/**
* @param {?object} props
*/
function assertValidProps(props) {
if (!props) {
return;
}
// Note the use of `==` which checks for null or undefined.
("production" !== "development" ? invariant(
props.children == null || props.dangerouslySetInnerHTML == null,
'Can only set one of `children` or `props.dangerouslySetInnerHTML`.'
) : invariant(props.children == null || props.dangerouslySetInnerHTML == null));
if ("production" !== "development") {
if (props.contentEditable && props.children != null) {
console.warn(
'A component is `contentEditable` and contains `children` managed by ' +
'React. It is now your responsibility to guarantee that none of those '+
'nodes are unexpectedly modified or duplicated. This is probably not ' +
'intentional.'
);
}
}
("production" !== "development" ? invariant(
props.style == null || typeof props.style === 'object',
'The `style` prop expects a mapping from style properties to values, ' +
'not a string.'
) : invariant(props.style == null || typeof props.style === 'object'));
}
function putListener(id, registrationName, listener, transaction) {
if ("production" !== "development") {
// IE8 has no API for event capturing and the `onScroll` event doesn't
// bubble.
if (registrationName === 'onScroll' &&
!isEventSupported('scroll', true)) {
monitorCodeUse('react_no_scroll_event');
console.warn('This browser doesn\'t support the `onScroll` event');
}
}
var container = ReactMount.findReactContainerForID(id);
if (container) {
var doc = container.nodeType === ELEMENT_NODE_TYPE ?
container.ownerDocument :
container;
listenTo(registrationName, doc);
}
transaction.getPutListenerQueue().enqueuePutListener(
id,
registrationName,
listener
);
}
// For HTML, certain tags should omit their close tag. We keep a whitelist for
// those special cased tags.
var omittedCloseTags = {
'area': true,
'base': true,
'br': true,
'col': true,
'embed': true,
'hr': true,
'img': true,
'input': true,
'keygen': true,
'link': true,
'meta': true,
'param': true,
'source': true,
'track': true,
'wbr': true
// NOTE: menuitem's close tag should be omitted, but that causes problems.
};
// We accept any tag to be rendered but since this gets injected into abitrary
// HTML, we want to make sure that it's a safe tag.
// http://www.w3.org/TR/REC-xml/#NT-Name
var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
var validatedTagCache = {};
var hasOwnProperty = {}.hasOwnProperty;
function validateDangerousTag(tag) {
if (!hasOwnProperty.call(validatedTagCache, tag)) {
("production" !== "development" ? invariant(VALID_TAG_REGEX.test(tag), 'Invalid tag: %s', tag) : invariant(VALID_TAG_REGEX.test(tag)));
validatedTagCache[tag] = true;
}
}
/**
* Creates a new React class that is idempotent and capable of containing other
* React components. It accepts event listeners and DOM properties that are
* valid according to `DOMProperty`.
*
* - Event listeners: `onClick`, `onMouseDown`, etc.
* - DOM properties: `className`, `name`, `title`, etc.
*
* The `style` property functions differently from the DOM API. It accepts an
* object mapping of style properties to values.
*
* @constructor ReactDOMComponent
* @extends ReactComponent
* @extends ReactMultiChild
*/
function ReactDOMComponent(tag) {
validateDangerousTag(tag);
this._tag = tag;
this.tagName = tag.toUpperCase();
}
ReactDOMComponent.displayName = 'ReactDOMComponent';
ReactDOMComponent.Mixin = {
/**
* Generates root tag markup then recurses. This method has side effects and
* is not idempotent.
*
* @internal
* @param {string} rootID The root DOM ID for this node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {number} mountDepth number of components in the owner hierarchy
* @return {string} The computed markup.
*/
mountComponent: ReactPerf.measure(
'ReactDOMComponent',
'mountComponent',
function(rootID, transaction, mountDepth) {
ReactComponent.Mixin.mountComponent.call(
this,
rootID,
transaction,
mountDepth
);
assertValidProps(this.props);
var closeTag = omittedCloseTags[this._tag] ? '' : '</' + this._tag + '>';
return (
this._createOpenTagMarkupAndPutListeners(transaction) +
this._createContentMarkup(transaction) +
closeTag
);
}
),
/**
* Creates markup for the open tag and all attributes.
*
* This method has side effects because events get registered.
*
* Iterating over object properties is faster than iterating over arrays.
* @see http://jsperf.com/obj-vs-arr-iteration
*
* @private
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {string} Markup of opening tag.
*/
_createOpenTagMarkupAndPutListeners: function(transaction) {
var props = this.props;
var ret = '<' + this._tag;
for (var propKey in props) {
if (!props.hasOwnProperty(propKey)) {
continue;
}
var propValue = props[propKey];
if (propValue == null) {
continue;
}
if (registrationNameModules.hasOwnProperty(propKey)) {
putListener(this._rootNodeID, propKey, propValue, transaction);
} else {
if (propKey === STYLE) {
if (propValue) {
propValue = props.style = assign({}, props.style);
}
propValue = CSSPropertyOperations.createMarkupForStyles(propValue);
}
var markup =
DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
if (markup) {
ret += ' ' + markup;
}
}
}
// For static pages, no need to put React ID and checksum. Saves lots of
// bytes.
if (transaction.renderToStaticMarkup) {
return ret + '>';
}
var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
return ret + ' ' + markupForID + '>';
},
/**
* Creates markup for the content between the tags.
*
* @private
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {string} Content markup.
*/
_createContentMarkup: function(transaction) {
// Intentional use of != to avoid catching zero/false.
var innerHTML = this.props.dangerouslySetInnerHTML;
if (innerHTML != null) {
if (innerHTML.__html != null) {
return innerHTML.__html;
}
} else {
var contentToUse =
CONTENT_TYPES[typeof this.props.children] ? this.props.children : null;
var childrenToUse = contentToUse != null ? null : this.props.children;
if (contentToUse != null) {
return escapeTextForBrowser(contentToUse);
} else if (childrenToUse != null) {
var mountImages = this.mountChildren(
childrenToUse,
transaction
);
return mountImages.join('');
}
}
return '';
},
receiveComponent: function(nextElement, transaction) {
if (nextElement === this._currentElement &&
nextElement._owner != null) {
// Since elements are immutable after the owner is rendered,
// we can do a cheap identity compare here to determine if this is a
// superfluous reconcile. It's possible for state to be mutable but such
// change should trigger an update of the owner which would recreate
// the element. We explicitly check for the existence of an owner since
// it's possible for a element created outside a composite to be
// deeply mutated and reused.
return;
}
ReactComponent.Mixin.receiveComponent.call(
this,
nextElement,
transaction
);
},
/**
* Updates a native DOM component after it has already been allocated and
* attached to the DOM. Reconciles the root DOM node, then recurses.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevElement
* @internal
* @overridable
*/
updateComponent: ReactPerf.measure(
'ReactDOMComponent',
'updateComponent',
function(transaction, prevElement) {
assertValidProps(this._currentElement.props);
ReactComponent.Mixin.updateComponent.call(
this,
transaction,
prevElement
);
this._updateDOMProperties(prevElement.props, transaction);
this._updateDOMChildren(prevElement.props, transaction);
}
),
/**
* Reconciles the properties by detecting differences in property values and
* updating the DOM as necessary. This function is probably the single most
* critical path for performance optimization.
*
* TODO: Benchmark whether checking for changed values in memory actually
* improves performance (especially statically positioned elements).
* TODO: Benchmark the effects of putting this at the top since 99% of props
* do not change for a given reconciliation.
* TODO: Benchmark areas that can be improved with caching.
*
* @private
* @param {object} lastProps
* @param {ReactReconcileTransaction} transaction
*/
_updateDOMProperties: function(lastProps, transaction) {
var nextProps = this.props;
var propKey;
var styleName;
var styleUpdates;
for (propKey in lastProps) {
if (nextProps.hasOwnProperty(propKey) ||
!lastProps.hasOwnProperty(propKey)) {
continue;
}
if (propKey === STYLE) {
var lastStyle = lastProps[propKey];
for (styleName in lastStyle) {
if (lastStyle.hasOwnProperty(styleName)) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = '';
}
}
} else if (registrationNameModules.hasOwnProperty(propKey)) {
deleteListener(this._rootNodeID, propKey);
} else if (
DOMProperty.isStandardName[propKey] ||
DOMProperty.isCustomAttribute(propKey)) {
ReactComponent.BackendIDOperations.deletePropertyByID(
this._rootNodeID,
propKey
);
}
}
for (propKey in nextProps) {
var nextProp = nextProps[propKey];
var lastProp = lastProps[propKey];
if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) {
continue;
}
if (propKey === STYLE) {
if (nextProp) {
nextProp = nextProps.style = assign({}, nextProp);
}
if (lastProp) {
// Unset styles on `lastProp` but not on `nextProp`.
for (styleName in lastProp) {
if (lastProp.hasOwnProperty(styleName) &&
(!nextProp || !nextProp.hasOwnProperty(styleName))) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = '';
}
}
// Update styles that changed since `lastProp`.
for (styleName in nextProp) {
if (nextProp.hasOwnProperty(styleName) &&
lastProp[styleName] !== nextProp[styleName]) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = nextProp[styleName];
}
}
} else {
// Relies on `updateStylesByID` not mutating `styleUpdates`.
styleUpdates = nextProp;
}
} else if (registrationNameModules.hasOwnProperty(propKey)) {
putListener(this._rootNodeID, propKey, nextProp, transaction);
} else if (
DOMProperty.isStandardName[propKey] ||
DOMProperty.isCustomAttribute(propKey)) {
ReactComponent.BackendIDOperations.updatePropertyByID(
this._rootNodeID,
propKey,
nextProp
);
}
}
if (styleUpdates) {
ReactComponent.BackendIDOperations.updateStylesByID(
this._rootNodeID,
styleUpdates
);
}
},
/**
* Reconciles the children with the various properties that affect the
* children content.
*
* @param {object} lastProps
* @param {ReactReconcileTransaction} transaction
*/
_updateDOMChildren: function(lastProps, transaction) {
var nextProps = this.props;
var lastContent =
CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
var nextContent =
CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
var lastHtml =
lastProps.dangerouslySetInnerHTML &&
lastProps.dangerouslySetInnerHTML.__html;
var nextHtml =
nextProps.dangerouslySetInnerHTML &&
nextProps.dangerouslySetInnerHTML.__html;
// Note the use of `!=` which checks for null or undefined.
var lastChildren = lastContent != null ? null : lastProps.children;
var nextChildren = nextContent != null ? null : nextProps.children;
// If we're switching from children to content/html or vice versa, remove
// the old content
var lastHasContentOrHtml = lastContent != null || lastHtml != null;
var nextHasContentOrHtml = nextContent != null || nextHtml != null;
if (lastChildren != null && nextChildren == null) {
this.updateChildren(null, transaction);
} else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
this.updateTextContent('');
}
if (nextContent != null) {
if (lastContent !== nextContent) {
this.updateTextContent('' + nextContent);
}
} else if (nextHtml != null) {
if (lastHtml !== nextHtml) {
ReactComponent.BackendIDOperations.updateInnerHTMLByID(
this._rootNodeID,
nextHtml
);
}
} else if (nextChildren != null) {
this.updateChildren(nextChildren, transaction);
}
},
/**
* Destroys all event registrations for this instance. Does not remove from
* the DOM. That must be done by the parent.
*
* @internal
*/
unmountComponent: function() {
this.unmountChildren();
ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID);
ReactComponent.Mixin.unmountComponent.call(this);
}
};
assign(
ReactDOMComponent.prototype,
ReactComponent.Mixin,
ReactDOMComponent.Mixin,
ReactMultiChild.Mixin,
ReactBrowserComponentMixin
);
module.exports = ReactDOMComponent;
},{"./CSSPropertyOperations":5,"./DOMProperty":11,"./DOMPropertyOperations":12,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactBrowserEventEmitter":30,"./ReactComponent":32,"./ReactMount":63,"./ReactMultiChild":64,"./ReactPerf":68,"./escapeTextForBrowser":109,"./invariant":126,"./isEventSupported":127,"./keyOf":133,"./monitorCodeUse":136}],40:[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.
*
* @providesModule ReactDOMForm
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var LocalEventTrapMixin = _dereq_("./LocalEventTrapMixin");
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactElement = _dereq_("./ReactElement");
var ReactDOM = _dereq_("./ReactDOM");
// Store a reference to the <form> `ReactDOMComponent`. TODO: use string
var form = ReactElement.createFactory(ReactDOM.form.type);
/**
* Since onSubmit doesn't bubble OR capture on the top level in IE8, we need
* to capture it on the <form> element itself. There are lots of hacks we could
* do to accomplish this, but the most reliable is to make <form> a
* composite component and use `componentDidMount` to attach the event handlers.
*/
var ReactDOMForm = ReactCompositeComponent.createClass({
displayName: 'ReactDOMForm',
mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
render: function() {
// TODO: Instead of using `ReactDOM` directly, we should use JSX. However,
// `jshint` fails to parse JSX so in order for linting to work in the open
// source repo, we need to just use `ReactDOM.form`.
return form(this.props);
},
componentDidMount: function() {
this.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset');
this.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit');
}
});
module.exports = ReactDOMForm;
},{"./EventConstants":16,"./LocalEventTrapMixin":25,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":52}],41:[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.
*
* @providesModule ReactDOMIDOperations
* @typechecks static-only
*/
/*jslint evil: true */
"use strict";
var CSSPropertyOperations = _dereq_("./CSSPropertyOperations");
var DOMChildrenOperations = _dereq_("./DOMChildrenOperations");
var DOMPropertyOperations = _dereq_("./DOMPropertyOperations");
var ReactMount = _dereq_("./ReactMount");
var ReactPerf = _dereq_("./ReactPerf");
var invariant = _dereq_("./invariant");
var setInnerHTML = _dereq_("./setInnerHTML");
/**
* Errors for properties that should not be updated with `updatePropertyById()`.
*
* @type {object}
* @private
*/
var INVALID_PROPERTY_ERRORS = {
dangerouslySetInnerHTML:
'`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.',
style: '`style` must be set using `updateStylesByID()`.'
};
/**
* Operations used to process updates to DOM nodes. This is made injectable via
* `ReactComponent.BackendIDOperations`.
*/
var ReactDOMIDOperations = {
/**
* Updates a DOM node with new property values. This should only be used to
* update DOM properties in `DOMProperty`.
*
* @param {string} id ID of the node to update.
* @param {string} name A valid property name, see `DOMProperty`.
* @param {*} value New value of the property.
* @internal
*/
updatePropertyByID: ReactPerf.measure(
'ReactDOMIDOperations',
'updatePropertyByID',
function(id, name, value) {
var node = ReactMount.getNode(id);
("production" !== "development" ? invariant(
!INVALID_PROPERTY_ERRORS.hasOwnProperty(name),
'updatePropertyByID(...): %s',
INVALID_PROPERTY_ERRORS[name]
) : invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name)));
// If we're updating to null or undefined, we should remove the property
// from the DOM node instead of inadvertantly setting to a string. This
// brings us in line with the same behavior we have on initial render.
if (value != null) {
DOMPropertyOperations.setValueForProperty(node, name, value);
} else {
DOMPropertyOperations.deleteValueForProperty(node, name);
}
}
),
/**
* Updates a DOM node to remove a property. This should only be used to remove
* DOM properties in `DOMProperty`.
*
* @param {string} id ID of the node to update.
* @param {string} name A property name to remove, see `DOMProperty`.
* @internal
*/
deletePropertyByID: ReactPerf.measure(
'ReactDOMIDOperations',
'deletePropertyByID',
function(id, name, value) {
var node = ReactMount.getNode(id);
("production" !== "development" ? invariant(
!INVALID_PROPERTY_ERRORS.hasOwnProperty(name),
'updatePropertyByID(...): %s',
INVALID_PROPERTY_ERRORS[name]
) : invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name)));
DOMPropertyOperations.deleteValueForProperty(node, name, value);
}
),
/**
* Updates a DOM node with new style values. If a value is specified as '',
* the corresponding style property will be unset.
*
* @param {string} id ID of the node to update.
* @param {object} styles Mapping from styles to values.
* @internal
*/
updateStylesByID: ReactPerf.measure(
'ReactDOMIDOperations',
'updateStylesByID',
function(id, styles) {
var node = ReactMount.getNode(id);
CSSPropertyOperations.setValueForStyles(node, styles);
}
),
/**
* Updates a DOM node's innerHTML.
*
* @param {string} id ID of the node to update.
* @param {string} html An HTML string.
* @internal
*/
updateInnerHTMLByID: ReactPerf.measure(
'ReactDOMIDOperations',
'updateInnerHTMLByID',
function(id, html) {
var node = ReactMount.getNode(id);
setInnerHTML(node, html);
}
),
/**
* Updates a DOM node's text content set by `props.content`.
*
* @param {string} id ID of the node to update.
* @param {string} content Text content.
* @internal
*/
updateTextContentByID: ReactPerf.measure(
'ReactDOMIDOperations',
'updateTextContentByID',
function(id, content) {
var node = ReactMount.getNode(id);
DOMChildrenOperations.updateTextContent(node, content);
}
),
/**
* Replaces a DOM node that exists in the document with markup.
*
* @param {string} id ID of child to be replaced.
* @param {string} markup Dangerous markup to inject in place of child.
* @internal
* @see {Danger.dangerouslyReplaceNodeWithMarkup}
*/
dangerouslyReplaceNodeWithMarkupByID: ReactPerf.measure(
'ReactDOMIDOperations',
'dangerouslyReplaceNodeWithMarkupByID',
function(id, markup) {
var node = ReactMount.getNode(id);
DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup);
}
),
/**
* Updates a component's children by processing a series of updates.
*
* @param {array<object>} updates List of update configurations.
* @param {array<string>} markup List of markup strings.
* @internal
*/
dangerouslyProcessChildrenUpdates: ReactPerf.measure(
'ReactDOMIDOperations',
'dangerouslyProcessChildrenUpdates',
function(updates, markup) {
for (var i = 0; i < updates.length; i++) {
updates[i].parentNode = ReactMount.getNode(updates[i].parentID);
}
DOMChildrenOperations.processUpdates(updates, markup);
}
)
};
module.exports = ReactDOMIDOperations;
},{"./CSSPropertyOperations":5,"./DOMChildrenOperations":10,"./DOMPropertyOperations":12,"./ReactMount":63,"./ReactPerf":68,"./invariant":126,"./setInnerHTML":140}],42:[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.
*
* @providesModule ReactDOMImg
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var LocalEventTrapMixin = _dereq_("./LocalEventTrapMixin");
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactElement = _dereq_("./ReactElement");
var ReactDOM = _dereq_("./ReactDOM");
// Store a reference to the <img> `ReactDOMComponent`. TODO: use string
var img = ReactElement.createFactory(ReactDOM.img.type);
/**
* Since onLoad doesn't bubble OR capture on the top level in IE8, we need to
* capture it on the <img> element itself. There are lots of hacks we could do
* to accomplish this, but the most reliable is to make <img> a composite
* component and use `componentDidMount` to attach the event handlers.
*/
var ReactDOMImg = ReactCompositeComponent.createClass({
displayName: 'ReactDOMImg',
tagName: 'IMG',
mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
render: function() {
return img(this.props);
},
componentDidMount: function() {
this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
this.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error');
}
});
module.exports = ReactDOMImg;
},{"./EventConstants":16,"./LocalEventTrapMixin":25,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":52}],43:[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.
*
* @providesModule ReactDOMInput
*/
"use strict";
var AutoFocusMixin = _dereq_("./AutoFocusMixin");
var DOMPropertyOperations = _dereq_("./DOMPropertyOperations");
var LinkedValueUtils = _dereq_("./LinkedValueUtils");
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactElement = _dereq_("./ReactElement");
var ReactDOM = _dereq_("./ReactDOM");
var ReactMount = _dereq_("./ReactMount");
var ReactUpdates = _dereq_("./ReactUpdates");
var assign = _dereq_("./Object.assign");
var invariant = _dereq_("./invariant");
// Store a reference to the <input> `ReactDOMComponent`. TODO: use string
var input = ReactElement.createFactory(ReactDOM.input.type);
var instancesByReactID = {};
function forceUpdateIfMounted() {
/*jshint validthis:true */
if (this.isMounted()) {
this.forceUpdate();
}
}
/**
* Implements an <input> native component that allows setting these optional
* props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
*
* If `checked` or `value` are not supplied (or null/undefined), user actions
* that affect the checked state or value will trigger updates to the element.
*
* If they are supplied (and not null/undefined), the rendered element will not
* trigger updates to the element. Instead, the props must change in order for
* the rendered element to be updated.
*
* The rendered element will be initialized as unchecked (or `defaultChecked`)
* with an empty value (or `defaultValue`).
*
* @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
*/
var ReactDOMInput = ReactCompositeComponent.createClass({
displayName: 'ReactDOMInput',
mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
getInitialState: function() {
var defaultValue = this.props.defaultValue;
return {
initialChecked: this.props.defaultChecked || false,
initialValue: defaultValue != null ? defaultValue : null
};
},
render: function() {
// Clone `this.props` so we don't mutate the input.
var props = assign({}, this.props);
props.defaultChecked = null;
props.defaultValue = null;
var value = LinkedValueUtils.getValue(this);
props.value = value != null ? value : this.state.initialValue;
var checked = LinkedValueUtils.getChecked(this);
props.checked = checked != null ? checked : this.state.initialChecked;
props.onChange = this._handleChange;
return input(props, this.props.children);
},
componentDidMount: function() {
var id = ReactMount.getID(this.getDOMNode());
instancesByReactID[id] = this;
},
componentWillUnmount: function() {
var rootNode = this.getDOMNode();
var id = ReactMount.getID(rootNode);
delete instancesByReactID[id];
},
componentDidUpdate: function(prevProps, prevState, prevContext) {
var rootNode = this.getDOMNode();
if (this.props.checked != null) {
DOMPropertyOperations.setValueForProperty(
rootNode,
'checked',
this.props.checked || false
);
}
var value = LinkedValueUtils.getValue(this);
if (value != null) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value);
}
},
_handleChange: function(event) {
var returnValue;
var onChange = LinkedValueUtils.getOnChange(this);
if (onChange) {
returnValue = onChange.call(this, event);
}
// Here we use asap to wait until all updates have propagated, which
// is important when using controlled components within layers:
// https://github.com/facebook/react/issues/1698
ReactUpdates.asap(forceUpdateIfMounted, this);
var name = this.props.name;
if (this.props.type === 'radio' && name != null) {
var rootNode = this.getDOMNode();
var queryRoot = rootNode;
while (queryRoot.parentNode) {
queryRoot = queryRoot.parentNode;
}
// If `rootNode.form` was non-null, then we could try `form.elements`,
// but that sometimes behaves strangely in IE8. We could also try using
// `form.getElementsByName`, but that will only return direct children
// and won't include inputs that use the HTML5 `form=` attribute. Since
// the input might not even be in a form, let's just use the global
// `querySelectorAll` to ensure we don't miss anything.
var group = queryRoot.querySelectorAll(
'input[name=' + JSON.stringify('' + name) + '][type="radio"]');
for (var i = 0, groupLen = group.length; i < groupLen; i++) {
var otherNode = group[i];
if (otherNode === rootNode ||
otherNode.form !== rootNode.form) {
continue;
}
var otherID = ReactMount.getID(otherNode);
("production" !== "development" ? invariant(
otherID,
'ReactDOMInput: Mixing React and non-React radio inputs with the ' +
'same `name` is not supported.'
) : invariant(otherID));
var otherInstance = instancesByReactID[otherID];
("production" !== "development" ? invariant(
otherInstance,
'ReactDOMInput: Unknown radio button ID %s.',
otherID
) : invariant(otherInstance));
// If this is a controlled radio button group, forcing the input that
// was previously checked to update will cause it to be come re-checked
// as appropriate.
ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
}
}
return returnValue;
}
});
module.exports = ReactDOMInput;
},{"./AutoFocusMixin":2,"./DOMPropertyOperations":12,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":52,"./ReactMount":63,"./ReactUpdates":79,"./invariant":126}],44:[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.
*
* @providesModule ReactDOMOption
*/
"use strict";
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactElement = _dereq_("./ReactElement");
var ReactDOM = _dereq_("./ReactDOM");
var warning = _dereq_("./warning");
// Store a reference to the <option> `ReactDOMComponent`. TODO: use string
var option = ReactElement.createFactory(ReactDOM.option.type);
/**
* Implements an <option> native component that warns when `selected` is set.
*/
var ReactDOMOption = ReactCompositeComponent.createClass({
displayName: 'ReactDOMOption',
mixins: [ReactBrowserComponentMixin],
componentWillMount: function() {
// TODO (yungsters): Remove support for `selected` in <option>.
if ("production" !== "development") {
("production" !== "development" ? warning(
this.props.selected == null,
'Use the `defaultValue` or `value` props on <select> instead of ' +
'setting `selected` on <option>.'
) : null);
}
},
render: function() {
return option(this.props, this.props.children);
}
});
module.exports = ReactDOMOption;
},{"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":52,"./warning":145}],45:[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.
*
* @providesModule ReactDOMSelect
*/
"use strict";
var AutoFocusMixin = _dereq_("./AutoFocusMixin");
var LinkedValueUtils = _dereq_("./LinkedValueUtils");
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactElement = _dereq_("./ReactElement");
var ReactDOM = _dereq_("./ReactDOM");
var ReactUpdates = _dereq_("./ReactUpdates");
var assign = _dereq_("./Object.assign");
// Store a reference to the <select> `ReactDOMComponent`. TODO: use string
var select = ReactElement.createFactory(ReactDOM.select.type);
function updateWithPendingValueIfMounted() {
/*jshint validthis:true */
if (this.isMounted()) {
this.setState({value: this._pendingValue});
this._pendingValue = 0;
}
}
/**
* Validation function for `value` and `defaultValue`.
* @private
*/
function selectValueType(props, propName, componentName) {
if (props[propName] == null) {
return;
}
if (props.multiple) {
if (!Array.isArray(props[propName])) {
return new Error(
("The `" + propName + "` prop supplied to <select> must be an array if ") +
("`multiple` is true.")
);
}
} else {
if (Array.isArray(props[propName])) {
return new Error(
("The `" + propName + "` prop supplied to <select> must be a scalar ") +
("value if `multiple` is false.")
);
}
}
}
/**
* If `value` is supplied, updates <option> elements on mount and update.
* @param {ReactComponent} component Instance of ReactDOMSelect
* @param {?*} propValue For uncontrolled components, null/undefined. For
* controlled components, a string (or with `multiple`, a list of strings).
* @private
*/
function updateOptions(component, propValue) {
var multiple = component.props.multiple;
var value = propValue != null ? propValue : component.state.value;
var options = component.getDOMNode().options;
var selectedValue, i, l;
if (multiple) {
selectedValue = {};
for (i = 0, l = value.length; i < l; ++i) {
selectedValue['' + value[i]] = true;
}
} else {
selectedValue = '' + value;
}
for (i = 0, l = options.length; i < l; i++) {
var selected = multiple ?
selectedValue.hasOwnProperty(options[i].value) :
options[i].value === selectedValue;
if (selected !== options[i].selected) {
options[i].selected = selected;
}
}
}
/**
* Implements a <select> native component that allows optionally setting the
* props `value` and `defaultValue`. If `multiple` is false, the prop must be a
* string. If `multiple` is true, the prop must be an array of strings.
*
* If `value` is not supplied (or null/undefined), user actions that change the
* selected option will trigger updates to the rendered options.
*
* If it is supplied (and not null/undefined), the rendered options will not
* update in response to user actions. Instead, the `value` prop must change in
* order for the rendered options to update.
*
* If `defaultValue` is provided, any options with the supplied values will be
* selected.
*/
var ReactDOMSelect = ReactCompositeComponent.createClass({
displayName: 'ReactDOMSelect',
mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
propTypes: {
defaultValue: selectValueType,
value: selectValueType
},
getInitialState: function() {
return {value: this.props.defaultValue || (this.props.multiple ? [] : '')};
},
componentWillMount: function() {
this._pendingValue = null;
},
componentWillReceiveProps: function(nextProps) {
if (!this.props.multiple && nextProps.multiple) {
this.setState({value: [this.state.value]});
} else if (this.props.multiple && !nextProps.multiple) {
this.setState({value: this.state.value[0]});
}
},
render: function() {
// Clone `this.props` so we don't mutate the input.
var props = assign({}, this.props);
props.onChange = this._handleChange;
props.value = null;
return select(props, this.props.children);
},
componentDidMount: function() {
updateOptions(this, LinkedValueUtils.getValue(this));
},
componentDidUpdate: function(prevProps) {
var value = LinkedValueUtils.getValue(this);
var prevMultiple = !!prevProps.multiple;
var multiple = !!this.props.multiple;
if (value != null || prevMultiple !== multiple) {
updateOptions(this, value);
}
},
_handleChange: function(event) {
var returnValue;
var onChange = LinkedValueUtils.getOnChange(this);
if (onChange) {
returnValue = onChange.call(this, event);
}
var selectedValue;
if (this.props.multiple) {
selectedValue = [];
var options = event.target.options;
for (var i = 0, l = options.length; i < l; i++) {
if (options[i].selected) {
selectedValue.push(options[i].value);
}
}
} else {
selectedValue = event.target.value;
}
this._pendingValue = selectedValue;
ReactUpdates.asap(updateWithPendingValueIfMounted, this);
return returnValue;
}
});
module.exports = ReactDOMSelect;
},{"./AutoFocusMixin":2,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":52,"./ReactUpdates":79}],46:[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.
*
* @providesModule ReactDOMSelection
*/
"use strict";
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var getNodeForCharacterOffset = _dereq_("./getNodeForCharacterOffset");
var getTextContentAccessor = _dereq_("./getTextContentAccessor");
/**
* While `isCollapsed` is available on the Selection object and `collapsed`
* is available on the Range object, IE11 sometimes gets them wrong.
* If the anchor/focus nodes and offsets are the same, the range is collapsed.
*/
function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
return anchorNode === focusNode && anchorOffset === focusOffset;
}
/**
* Get the appropriate anchor and focus node/offset pairs for IE.
*
* The catch here is that IE's selection API doesn't provide information
* about whether the selection is forward or backward, so we have to
* behave as though it's always forward.
*
* IE text differs from modern selection in that it behaves as though
* block elements end with a new line. This means character offsets will
* differ between the two APIs.
*
* @param {DOMElement} node
* @return {object}
*/
function getIEOffsets(node) {
var selection = document.selection;
var selectedRange = selection.createRange();
var selectedLength = selectedRange.text.length;
// Duplicate selection so we can move range without breaking user selection.
var fromStart = selectedRange.duplicate();
fromStart.moveToElementText(node);
fromStart.setEndPoint('EndToStart', selectedRange);
var startOffset = fromStart.text.length;
var endOffset = startOffset + selectedLength;
return {
start: startOffset,
end: endOffset
};
}
/**
* @param {DOMElement} node
* @return {?object}
*/
function getModernOffsets(node) {
var selection = window.getSelection && window.getSelection();
if (!selection || selection.rangeCount === 0) {
return null;
}
var anchorNode = selection.anchorNode;
var anchorOffset = selection.anchorOffset;
var focusNode = selection.focusNode;
var focusOffset = selection.focusOffset;
var currentRange = selection.getRangeAt(0);
// If the node and offset values are the same, the selection is collapsed.
// `Selection.isCollapsed` is available natively, but IE sometimes gets
// this value wrong.
var isSelectionCollapsed = isCollapsed(
selection.anchorNode,
selection.anchorOffset,
selection.focusNode,
selection.focusOffset
);
var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
var tempRange = currentRange.cloneRange();
tempRange.selectNodeContents(node);
tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
var isTempRangeCollapsed = isCollapsed(
tempRange.startContainer,
tempRange.startOffset,
tempRange.endContainer,
tempRange.endOffset
);
var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
var end = start + rangeLength;
// Detect whether the selection is backward.
var detectionRange = document.createRange();
detectionRange.setStart(anchorNode, anchorOffset);
detectionRange.setEnd(focusNode, focusOffset);
var isBackward = detectionRange.collapsed;
return {
start: isBackward ? end : start,
end: isBackward ? start : end
};
}
/**
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
function setIEOffsets(node, offsets) {
var range = document.selection.createRange().duplicate();
var start, end;
if (typeof offsets.end === 'undefined') {
start = offsets.start;
end = start;
} else if (offsets.start > offsets.end) {
start = offsets.end;
end = offsets.start;
} else {
start = offsets.start;
end = offsets.end;
}
range.moveToElementText(node);
range.moveStart('character', start);
range.setEndPoint('EndToStart', range);
range.moveEnd('character', end - start);
range.select();
}
/**
* In modern non-IE browsers, we can support both forward and backward
* selections.
*
* Note: IE10+ supports the Selection object, but it does not support
* the `extend` method, which means that even in modern IE, it's not possible
* to programatically create a backward selection. Thus, for all IE
* versions, we use the old IE API to create our selections.
*
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
function setModernOffsets(node, offsets) {
if (!window.getSelection) {
return;
}
var selection = window.getSelection();
var length = node[getTextContentAccessor()].length;
var start = Math.min(offsets.start, length);
var end = typeof offsets.end === 'undefined' ?
start : Math.min(offsets.end, length);
// IE 11 uses modern selection, but doesn't support the extend method.
// Flip backward selections, so we can set with a single range.
if (!selection.extend && start > end) {
var temp = end;
end = start;
start = temp;
}
var startMarker = getNodeForCharacterOffset(node, start);
var endMarker = getNodeForCharacterOffset(node, end);
if (startMarker && endMarker) {
var range = document.createRange();
range.setStart(startMarker.node, startMarker.offset);
selection.removeAllRanges();
if (start > end) {
selection.addRange(range);
selection.extend(endMarker.node, endMarker.offset);
} else {
range.setEnd(endMarker.node, endMarker.offset);
selection.addRange(range);
}
}
}
var useIEOffsets = ExecutionEnvironment.canUseDOM && document.selection;
var ReactDOMSelection = {
/**
* @param {DOMElement} node
*/
getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
/**
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
};
module.exports = ReactDOMSelection;
},{"./ExecutionEnvironment":22,"./getNodeForCharacterOffset":119,"./getTextContentAccessor":121}],47:[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.
*
* @providesModule ReactDOMTextarea
*/
"use strict";
var AutoFocusMixin = _dereq_("./AutoFocusMixin");
var DOMPropertyOperations = _dereq_("./DOMPropertyOperations");
var LinkedValueUtils = _dereq_("./LinkedValueUtils");
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactElement = _dereq_("./ReactElement");
var ReactDOM = _dereq_("./ReactDOM");
var ReactUpdates = _dereq_("./ReactUpdates");
var assign = _dereq_("./Object.assign");
var invariant = _dereq_("./invariant");
var warning = _dereq_("./warning");
// Store a reference to the <textarea> `ReactDOMComponent`. TODO: use string
var textarea = ReactElement.createFactory(ReactDOM.textarea.type);
function forceUpdateIfMounted() {
/*jshint validthis:true */
if (this.isMounted()) {
this.forceUpdate();
}
}
/**
* Implements a <textarea> native component that allows setting `value`, and
* `defaultValue`. This differs from the traditional DOM API because value is
* usually set as PCDATA children.
*
* If `value` is not supplied (or null/undefined), user actions that affect the
* value will trigger updates to the element.
*
* If `value` is supplied (and not null/undefined), the rendered element will
* not trigger updates to the element. Instead, the `value` prop must change in
* order for the rendered element to be updated.
*
* The rendered element will be initialized with an empty value, the prop
* `defaultValue` if specified, or the children content (deprecated).
*/
var ReactDOMTextarea = ReactCompositeComponent.createClass({
displayName: 'ReactDOMTextarea',
mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
getInitialState: function() {
var defaultValue = this.props.defaultValue;
// TODO (yungsters): Remove support for children content in <textarea>.
var children = this.props.children;
if (children != null) {
if ("production" !== "development") {
("production" !== "development" ? warning(
false,
'Use the `defaultValue` or `value` props instead of setting ' +
'children on <textarea>.'
) : null);
}
("production" !== "development" ? invariant(
defaultValue == null,
'If you supply `defaultValue` on a <textarea>, do not pass children.'
) : invariant(defaultValue == null));
if (Array.isArray(children)) {
("production" !== "development" ? invariant(
children.length <= 1,
'<textarea> can only have at most one child.'
) : invariant(children.length <= 1));
children = children[0];
}
defaultValue = '' + children;
}
if (defaultValue == null) {
defaultValue = '';
}
var value = LinkedValueUtils.getValue(this);
return {
// We save the initial value so that `ReactDOMComponent` doesn't update
// `textContent` (unnecessary since we update value).
// The initial value can be a boolean or object so that's why it's
// forced to be a string.
initialValue: '' + (value != null ? value : defaultValue)
};
},
render: function() {
// Clone `this.props` so we don't mutate the input.
var props = assign({}, this.props);
("production" !== "development" ? invariant(
props.dangerouslySetInnerHTML == null,
'`dangerouslySetInnerHTML` does not make sense on <textarea>.'
) : invariant(props.dangerouslySetInnerHTML == null));
props.defaultValue = null;
props.value = null;
props.onChange = this._handleChange;
// Always set children to the same thing. In IE9, the selection range will
// get reset if `textContent` is mutated.
return textarea(props, this.state.initialValue);
},
componentDidUpdate: function(prevProps, prevState, prevContext) {
var value = LinkedValueUtils.getValue(this);
if (value != null) {
var rootNode = this.getDOMNode();
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value);
}
},
_handleChange: function(event) {
var returnValue;
var onChange = LinkedValueUtils.getOnChange(this);
if (onChange) {
returnValue = onChange.call(this, event);
}
ReactUpdates.asap(forceUpdateIfMounted, this);
return returnValue;
}
});
module.exports = ReactDOMTextarea;
},{"./AutoFocusMixin":2,"./DOMPropertyOperations":12,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":52,"./ReactUpdates":79,"./invariant":126,"./warning":145}],48:[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.
*
* @providesModule ReactDefaultBatchingStrategy
*/
"use strict";
var ReactUpdates = _dereq_("./ReactUpdates");
var Transaction = _dereq_("./Transaction");
var assign = _dereq_("./Object.assign");
var emptyFunction = _dereq_("./emptyFunction");
var RESET_BATCHED_UPDATES = {
initialize: emptyFunction,
close: function() {
ReactDefaultBatchingStrategy.isBatchingUpdates = false;
}
};
var FLUSH_BATCHED_UPDATES = {
initialize: emptyFunction,
close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
};
var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
function ReactDefaultBatchingStrategyTransaction() {
this.reinitializeTransaction();
}
assign(
ReactDefaultBatchingStrategyTransaction.prototype,
Transaction.Mixin,
{
getTransactionWrappers: function() {
return TRANSACTION_WRAPPERS;
}
}
);
var transaction = new ReactDefaultBatchingStrategyTransaction();
var ReactDefaultBatchingStrategy = {
isBatchingUpdates: false,
/**
* Call the provided function in a context within which calls to `setState`
* and friends are batched such that components aren't updated unnecessarily.
*/
batchedUpdates: function(callback, a, b) {
var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
ReactDefaultBatchingStrategy.isBatchingUpdates = true;
// The code is written this way to avoid extra allocations
if (alreadyBatchingUpdates) {
callback(a, b);
} else {
transaction.perform(callback, null, a, b);
}
}
};
module.exports = ReactDefaultBatchingStrategy;
},{"./Object.assign":27,"./ReactUpdates":79,"./Transaction":95,"./emptyFunction":107}],49:[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.
*
* @providesModule ReactDefaultInjection
*/
"use strict";
var BeforeInputEventPlugin = _dereq_("./BeforeInputEventPlugin");
var ChangeEventPlugin = _dereq_("./ChangeEventPlugin");
var ClientReactRootIndex = _dereq_("./ClientReactRootIndex");
var CompositionEventPlugin = _dereq_("./CompositionEventPlugin");
var DefaultEventPluginOrder = _dereq_("./DefaultEventPluginOrder");
var EnterLeaveEventPlugin = _dereq_("./EnterLeaveEventPlugin");
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var HTMLDOMPropertyConfig = _dereq_("./HTMLDOMPropertyConfig");
var MobileSafariClickEventPlugin = _dereq_("./MobileSafariClickEventPlugin");
var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin");
var ReactComponentBrowserEnvironment =
_dereq_("./ReactComponentBrowserEnvironment");
var ReactDefaultBatchingStrategy = _dereq_("./ReactDefaultBatchingStrategy");
var ReactDOMComponent = _dereq_("./ReactDOMComponent");
var ReactDOMButton = _dereq_("./ReactDOMButton");
var ReactDOMForm = _dereq_("./ReactDOMForm");
var ReactDOMImg = _dereq_("./ReactDOMImg");
var ReactDOMInput = _dereq_("./ReactDOMInput");
var ReactDOMOption = _dereq_("./ReactDOMOption");
var ReactDOMSelect = _dereq_("./ReactDOMSelect");
var ReactDOMTextarea = _dereq_("./ReactDOMTextarea");
var ReactEventListener = _dereq_("./ReactEventListener");
var ReactInjection = _dereq_("./ReactInjection");
var ReactInstanceHandles = _dereq_("./ReactInstanceHandles");
var ReactMount = _dereq_("./ReactMount");
var SelectEventPlugin = _dereq_("./SelectEventPlugin");
var ServerReactRootIndex = _dereq_("./ServerReactRootIndex");
var SimpleEventPlugin = _dereq_("./SimpleEventPlugin");
var SVGDOMPropertyConfig = _dereq_("./SVGDOMPropertyConfig");
var createFullPageComponent = _dereq_("./createFullPageComponent");
function inject() {
ReactInjection.EventEmitter.injectReactEventListener(
ReactEventListener
);
/**
* Inject modules for resolving DOM hierarchy and plugin ordering.
*/
ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles);
ReactInjection.EventPluginHub.injectMount(ReactMount);
/**
* Some important event plugins included by default (without having to require
* them).
*/
ReactInjection.EventPluginHub.injectEventPluginsByName({
SimpleEventPlugin: SimpleEventPlugin,
EnterLeaveEventPlugin: EnterLeaveEventPlugin,
ChangeEventPlugin: ChangeEventPlugin,
CompositionEventPlugin: CompositionEventPlugin,
MobileSafariClickEventPlugin: MobileSafariClickEventPlugin,
SelectEventPlugin: SelectEventPlugin,
BeforeInputEventPlugin: BeforeInputEventPlugin
});
ReactInjection.NativeComponent.injectGenericComponentClass(
ReactDOMComponent
);
ReactInjection.NativeComponent.injectComponentClasses({
'button': ReactDOMButton,
'form': ReactDOMForm,
'img': ReactDOMImg,
'input': ReactDOMInput,
'option': ReactDOMOption,
'select': ReactDOMSelect,
'textarea': ReactDOMTextarea,
'html': createFullPageComponent('html'),
'head': createFullPageComponent('head'),
'body': createFullPageComponent('body')
});
// This needs to happen after createFullPageComponent() otherwise the mixin
// gets double injected.
ReactInjection.CompositeComponent.injectMixin(ReactBrowserComponentMixin);
ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
ReactInjection.Updates.injectReconcileTransaction(
ReactComponentBrowserEnvironment.ReactReconcileTransaction
);
ReactInjection.Updates.injectBatchingStrategy(
ReactDefaultBatchingStrategy
);
ReactInjection.RootIndex.injectCreateReactRootIndex(
ExecutionEnvironment.canUseDOM ?
ClientReactRootIndex.createReactRootIndex :
ServerReactRootIndex.createReactRootIndex
);
ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
if ("production" !== "development") {
var url = (ExecutionEnvironment.canUseDOM && window.location.href) || '';
if ((/[?&]react_perf\b/).test(url)) {
var ReactDefaultPerf = _dereq_("./ReactDefaultPerf");
ReactDefaultPerf.start();
}
}
}
module.exports = {
inject: inject
};
},{"./BeforeInputEventPlugin":3,"./ChangeEventPlugin":7,"./ClientReactRootIndex":8,"./CompositionEventPlugin":9,"./DefaultEventPluginOrder":14,"./EnterLeaveEventPlugin":15,"./ExecutionEnvironment":22,"./HTMLDOMPropertyConfig":23,"./MobileSafariClickEventPlugin":26,"./ReactBrowserComponentMixin":29,"./ReactComponentBrowserEnvironment":33,"./ReactDOMButton":38,"./ReactDOMComponent":39,"./ReactDOMForm":40,"./ReactDOMImg":42,"./ReactDOMInput":43,"./ReactDOMOption":44,"./ReactDOMSelect":45,"./ReactDOMTextarea":47,"./ReactDefaultBatchingStrategy":48,"./ReactDefaultPerf":50,"./ReactEventListener":57,"./ReactInjection":58,"./ReactInstanceHandles":60,"./ReactMount":63,"./SVGDOMPropertyConfig":80,"./SelectEventPlugin":81,"./ServerReactRootIndex":82,"./SimpleEventPlugin":83,"./createFullPageComponent":103}],50:[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.
*
* @providesModule ReactDefaultPerf
* @typechecks static-only
*/
"use strict";
var DOMProperty = _dereq_("./DOMProperty");
var ReactDefaultPerfAnalysis = _dereq_("./ReactDefaultPerfAnalysis");
var ReactMount = _dereq_("./ReactMount");
var ReactPerf = _dereq_("./ReactPerf");
var performanceNow = _dereq_("./performanceNow");
function roundFloat(val) {
return Math.floor(val * 100) / 100;
}
function addValue(obj, key, val) {
obj[key] = (obj[key] || 0) + val;
}
var ReactDefaultPerf = {
_allMeasurements: [], // last item in the list is the current one
_mountStack: [0],
_injected: false,
start: function() {
if (!ReactDefaultPerf._injected) {
ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure);
}
ReactDefaultPerf._allMeasurements.length = 0;
ReactPerf.enableMeasure = true;
},
stop: function() {
ReactPerf.enableMeasure = false;
},
getLastMeasurements: function() {
return ReactDefaultPerf._allMeasurements;
},
printExclusive: function(measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements);
console.table(summary.map(function(item) {
return {
'Component class name': item.componentName,
'Total inclusive time (ms)': roundFloat(item.inclusive),
'Exclusive mount time (ms)': roundFloat(item.exclusive),
'Exclusive render time (ms)': roundFloat(item.render),
'Mount time per instance (ms)': roundFloat(item.exclusive / item.count),
'Render time per instance (ms)': roundFloat(item.render / item.count),
'Instances': item.count
};
}));
// TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct
// number.
},
printInclusive: function(measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements);
console.table(summary.map(function(item) {
return {
'Owner > component': item.componentName,
'Inclusive time (ms)': roundFloat(item.time),
'Instances': item.count
};
}));
console.log(
'Total time:',
ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'
);
},
getMeasurementsSummaryMap: function(measurements) {
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(
measurements,
true
);
return summary.map(function(item) {
return {
'Owner > component': item.componentName,
'Wasted time (ms)': item.time,
'Instances': item.count
};
});
},
printWasted: function(measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
console.log(
'Total time:',
ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'
);
},
printDOM: function(measurements) {
measurements = measurements || ReactDefaultPerf._allMeasurements;
var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
console.table(summary.map(function(item) {
var result = {};
result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
result['type'] = item.type;
result['args'] = JSON.stringify(item.args);
return result;
}));
console.log(
'Total time:',
ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'
);
},
_recordWrite: function(id, fnName, totalTime, args) {
// TODO: totalTime isn't that useful since it doesn't count paints/reflows
var writes =
ReactDefaultPerf
._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1]
.writes;
writes[id] = writes[id] || [];
writes[id].push({
type: fnName,
time: totalTime,
args: args
});
},
measure: function(moduleName, fnName, func) {
return function() {var args=Array.prototype.slice.call(arguments,0);
var totalTime;
var rv;
var start;
if (fnName === '_renderNewRootComponent' ||
fnName === 'flushBatchedUpdates') {
// A "measurement" is a set of metrics recorded for each flush. We want
// to group the metrics for a given flush together so we can look at the
// components that rendered and the DOM operations that actually
// happened to determine the amount of "wasted work" performed.
ReactDefaultPerf._allMeasurements.push({
exclusive: {},
inclusive: {},
render: {},
counts: {},
writes: {},
displayNames: {},
totalTime: 0
});
start = performanceNow();
rv = func.apply(this, args);
ReactDefaultPerf._allMeasurements[
ReactDefaultPerf._allMeasurements.length - 1
].totalTime = performanceNow() - start;
return rv;
} else if (moduleName === 'ReactDOMIDOperations' ||
moduleName === 'ReactComponentBrowserEnvironment') {
start = performanceNow();
rv = func.apply(this, args);
totalTime = performanceNow() - start;
if (fnName === 'mountImageIntoNode') {
var mountID = ReactMount.getID(args[1]);
ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]);
} else if (fnName === 'dangerouslyProcessChildrenUpdates') {
// special format
args[0].forEach(function(update) {
var writeArgs = {};
if (update.fromIndex !== null) {
writeArgs.fromIndex = update.fromIndex;
}
if (update.toIndex !== null) {
writeArgs.toIndex = update.toIndex;
}
if (update.textContent !== null) {
writeArgs.textContent = update.textContent;
}
if (update.markupIndex !== null) {
writeArgs.markup = args[1][update.markupIndex];
}
ReactDefaultPerf._recordWrite(
update.parentID,
update.type,
totalTime,
writeArgs
);
});
} else {
// basic format
ReactDefaultPerf._recordWrite(
args[0],
fnName,
totalTime,
Array.prototype.slice.call(args, 1)
);
}
return rv;
} else if (moduleName === 'ReactCompositeComponent' && (
fnName === 'mountComponent' ||
fnName === 'updateComponent' || // TODO: receiveComponent()?
fnName === '_renderValidatedComponent')) {
var rootNodeID = fnName === 'mountComponent' ?
args[0] :
this._rootNodeID;
var isRender = fnName === '_renderValidatedComponent';
var isMount = fnName === 'mountComponent';
var mountStack = ReactDefaultPerf._mountStack;
var entry = ReactDefaultPerf._allMeasurements[
ReactDefaultPerf._allMeasurements.length - 1
];
if (isRender) {
addValue(entry.counts, rootNodeID, 1);
} else if (isMount) {
mountStack.push(0);
}
start = performanceNow();
rv = func.apply(this, args);
totalTime = performanceNow() - start;
if (isRender) {
addValue(entry.render, rootNodeID, totalTime);
} else if (isMount) {
var subMountTime = mountStack.pop();
mountStack[mountStack.length - 1] += totalTime;
addValue(entry.exclusive, rootNodeID, totalTime - subMountTime);
addValue(entry.inclusive, rootNodeID, totalTime);
} else {
addValue(entry.inclusive, rootNodeID, totalTime);
}
entry.displayNames[rootNodeID] = {
current: this.constructor.displayName,
owner: this._owner ? this._owner.constructor.displayName : '<root>'
};
return rv;
} else {
return func.apply(this, args);
}
};
}
};
module.exports = ReactDefaultPerf;
},{"./DOMProperty":11,"./ReactDefaultPerfAnalysis":51,"./ReactMount":63,"./ReactPerf":68,"./performanceNow":139}],51:[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.
*
* @providesModule ReactDefaultPerfAnalysis
*/
var assign = _dereq_("./Object.assign");
// Don't try to save users less than 1.2ms (a number I made up)
var DONT_CARE_THRESHOLD = 1.2;
var DOM_OPERATION_TYPES = {
'mountImageIntoNode': 'set innerHTML',
INSERT_MARKUP: 'set innerHTML',
MOVE_EXISTING: 'move',
REMOVE_NODE: 'remove',
TEXT_CONTENT: 'set textContent',
'updatePropertyByID': 'update attribute',
'deletePropertyByID': 'delete attribute',
'updateStylesByID': 'update styles',
'updateInnerHTMLByID': 'set innerHTML',
'dangerouslyReplaceNodeWithMarkupByID': 'replace'
};
function getTotalTime(measurements) {
// TODO: return number of DOM ops? could be misleading.
// TODO: measure dropped frames after reconcile?
// TODO: log total time of each reconcile and the top-level component
// class that triggered it.
var totalTime = 0;
for (var i = 0; i < measurements.length; i++) {
var measurement = measurements[i];
totalTime += measurement.totalTime;
}
return totalTime;
}
function getDOMSummary(measurements) {
var items = [];
for (var i = 0; i < measurements.length; i++) {
var measurement = measurements[i];
var id;
for (id in measurement.writes) {
measurement.writes[id].forEach(function(write) {
items.push({
id: id,
type: DOM_OPERATION_TYPES[write.type] || write.type,
args: write.args
});
});
}
}
return items;
}
function getExclusiveSummary(measurements) {
var candidates = {};
var displayName;
for (var i = 0; i < measurements.length; i++) {
var measurement = measurements[i];
var allIDs = assign(
{},
measurement.exclusive,
measurement.inclusive
);
for (var id in allIDs) {
displayName = measurement.displayNames[id].current;
candidates[displayName] = candidates[displayName] || {
componentName: displayName,
inclusive: 0,
exclusive: 0,
render: 0,
count: 0
};
if (measurement.render[id]) {
candidates[displayName].render += measurement.render[id];
}
if (measurement.exclusive[id]) {
candidates[displayName].exclusive += measurement.exclusive[id];
}
if (measurement.inclusive[id]) {
candidates[displayName].inclusive += measurement.inclusive[id];
}
if (measurement.counts[id]) {
candidates[displayName].count += measurement.counts[id];
}
}
}
// Now make a sorted array with the results.
var arr = [];
for (displayName in candidates) {
if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) {
arr.push(candidates[displayName]);
}
}
arr.sort(function(a, b) {
return b.exclusive - a.exclusive;
});
return arr;
}
function getInclusiveSummary(measurements, onlyClean) {
var candidates = {};
var inclusiveKey;
for (var i = 0; i < measurements.length; i++) {
var measurement = measurements[i];
var allIDs = assign(
{},
measurement.exclusive,
measurement.inclusive
);
var cleanComponents;
if (onlyClean) {
cleanComponents = getUnchangedComponents(measurement);
}
for (var id in allIDs) {
if (onlyClean && !cleanComponents[id]) {
continue;
}
var displayName = measurement.displayNames[id];
// Inclusive time is not useful for many components without knowing where
// they are instantiated. So we aggregate inclusive time with both the
// owner and current displayName as the key.
inclusiveKey = displayName.owner + ' > ' + displayName.current;
candidates[inclusiveKey] = candidates[inclusiveKey] || {
componentName: inclusiveKey,
time: 0,
count: 0
};
if (measurement.inclusive[id]) {
candidates[inclusiveKey].time += measurement.inclusive[id];
}
if (measurement.counts[id]) {
candidates[inclusiveKey].count += measurement.counts[id];
}
}
}
// Now make a sorted array with the results.
var arr = [];
for (inclusiveKey in candidates) {
if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) {
arr.push(candidates[inclusiveKey]);
}
}
arr.sort(function(a, b) {
return b.time - a.time;
});
return arr;
}
function getUnchangedComponents(measurement) {
// For a given reconcile, look at which components did not actually
// render anything to the DOM and return a mapping of their ID to
// the amount of time it took to render the entire subtree.
var cleanComponents = {};
var dirtyLeafIDs = Object.keys(measurement.writes);
var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
for (var id in allIDs) {
var isDirty = false;
// For each component that rendered, see if a component that triggered
// a DOM op is in its subtree.
for (var i = 0; i < dirtyLeafIDs.length; i++) {
if (dirtyLeafIDs[i].indexOf(id) === 0) {
isDirty = true;
break;
}
}
if (!isDirty && measurement.counts[id] > 0) {
cleanComponents[id] = true;
}
}
return cleanComponents;
}
var ReactDefaultPerfAnalysis = {
getExclusiveSummary: getExclusiveSummary,
getInclusiveSummary: getInclusiveSummary,
getDOMSummary: getDOMSummary,
getTotalTime: getTotalTime
};
module.exports = ReactDefaultPerfAnalysis;
},{"./Object.assign":27}],52:[function(_dereq_,module,exports){
/**
* 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 ReactElement
*/
"use strict";
var ReactContext = _dereq_("./ReactContext");
var ReactCurrentOwner = _dereq_("./ReactCurrentOwner");
var warning = _dereq_("./warning");
var RESERVED_PROPS = {
key: true,
ref: true
};
/**
* Warn for mutations.
*
* @internal
* @param {object} object
* @param {string} key
*/
function defineWarningProperty(object, key) {
Object.defineProperty(object, key, {
configurable: false,
enumerable: true,
get: function() {
if (!this._store) {
return null;
}
return this._store[key];
},
set: function(value) {
("production" !== "development" ? warning(
false,
'Don\'t set the ' + key + ' property of the component. ' +
'Mutate the existing props object instead.'
) : null);
this._store[key] = value;
}
});
}
/**
* This is updated to true if the membrane is successfully created.
*/
var useMutationMembrane = false;
/**
* Warn for mutations.
*
* @internal
* @param {object} element
*/
function defineMutationMembrane(prototype) {
try {
var pseudoFrozenProperties = {
props: true
};
for (var key in pseudoFrozenProperties) {
defineWarningProperty(prototype, key);
}
useMutationMembrane = true;
} catch (x) {
// IE will fail on defineProperty
}
}
/**
* Base constructor for all React elements. This is only used to make this
* work with a dynamic instanceof check. Nothing should live on this prototype.
*
* @param {*} type
* @param {string|object} ref
* @param {*} key
* @param {*} props
* @internal
*/
var ReactElement = function(type, key, ref, owner, context, props) {
// Built-in properties that belong on the element
this.type = type;
this.key = key;
this.ref = ref;
// Record the component responsible for creating this element.
this._owner = owner;
// TODO: Deprecate withContext, and then the context becomes accessible
// through the owner.
this._context = context;
if ("production" !== "development") {
// The validation flag and props are currently mutative. We put them on
// an external backing store so that we can freeze the whole object.
// This can be replaced with a WeakMap once they are implemented in
// commonly used development environments.
this._store = { validated: false, props: props };
// We're not allowed to set props directly on the object so we early
// return and rely on the prototype membrane to forward to the backing
// store.
if (useMutationMembrane) {
Object.freeze(this);
return;
}
}
this.props = props;
};
// We intentionally don't expose the function on the constructor property.
// ReactElement should be indistinguishable from a plain object.
ReactElement.prototype = {
_isReactElement: true
};
if ("production" !== "development") {
defineMutationMembrane(ReactElement.prototype);
}
ReactElement.createElement = function(type, config, children) {
var propName;
// Reserved names are extracted
var props = {};
var key = null;
var ref = null;
if (config != null) {
ref = config.ref === undefined ? null : config.ref;
if ("production" !== "development") {
("production" !== "development" ? warning(
config.key !== null,
'createElement(...): Encountered component with a `key` of null. In ' +
'a future version, this will be treated as equivalent to the string ' +
'\'null\'; instead, provide an explicit key or use undefined.'
) : null);
}
// TODO: Change this back to `config.key === undefined`
key = config.key == null ? null : '' + config.key;
// Remaining properties are added to a new props object
for (propName in config) {
if (config.hasOwnProperty(propName) &&
!RESERVED_PROPS.hasOwnProperty(propName)) {
props[propName] = config[propName];
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
props.children = childArray;
}
// Resolve default props
if (type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (typeof props[propName] === 'undefined') {
props[propName] = defaultProps[propName];
}
}
}
return new ReactElement(
type,
key,
ref,
ReactCurrentOwner.current,
ReactContext.current,
props
);
};
ReactElement.createFactory = function(type) {
var factory = ReactElement.createElement.bind(null, type);
// Expose the type on the factory and the prototype so that it can be
// easily accessed on elements. E.g. <Foo />.type === Foo.type.
// This should not be named `constructor` since this may not be the function
// that created the element, and it may not even be a constructor.
factory.type = type;
return factory;
};
ReactElement.cloneAndReplaceProps = function(oldElement, newProps) {
var newElement = new ReactElement(
oldElement.type,
oldElement.key,
oldElement.ref,
oldElement._owner,
oldElement._context,
newProps
);
if ("production" !== "development") {
// If the key on the original is valid, then the clone is valid
newElement._store.validated = oldElement._store.validated;
}
return newElement;
};
/**
* @param {?object} object
* @return {boolean} True if `object` is a valid component.
* @final
*/
ReactElement.isValidElement = function(object) {
// ReactTestUtils is often used outside of beforeEach where as React is
// within it. This leads to two different instances of React on the same
// page. To identify a element from a different React instance we use
// a flag instead of an instanceof check.
var isElement = !!(object && object._isReactElement);
// if (isElement && !(object instanceof ReactElement)) {
// This is an indicator that you're using multiple versions of React at the
// same time. This will screw with ownership and stuff. Fix it, please.
// TODO: We could possibly warn here.
// }
return isElement;
};
module.exports = ReactElement;
},{"./ReactContext":35,"./ReactCurrentOwner":36,"./warning":145}],53:[function(_dereq_,module,exports){
/**
* 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 ReactElementValidator
*/
/**
* ReactElementValidator provides a wrapper around a element factory
* which validates the props passed to the element. This is intended to be
* used only in DEV and could be replaced by a static type checker for languages
* that support it.
*/
"use strict";
var ReactElement = _dereq_("./ReactElement");
var ReactPropTypeLocations = _dereq_("./ReactPropTypeLocations");
var ReactCurrentOwner = _dereq_("./ReactCurrentOwner");
var monitorCodeUse = _dereq_("./monitorCodeUse");
/**
* Warn if there's no key explicitly set on dynamic arrays of children or
* object keys are not valid. This allows us to keep track of children between
* updates.
*/
var ownerHasKeyUseWarning = {
'react_key_warning': {},
'react_numeric_key_warning': {}
};
var ownerHasMonitoredObjectMap = {};
var loggedTypeFailures = {};
var NUMERIC_PROPERTY_REGEX = /^\d+$/;
/**
* Gets the current owner's displayName for use in warnings.
*
* @internal
* @return {?string} Display name or undefined
*/
function getCurrentOwnerDisplayName() {
var current = ReactCurrentOwner.current;
return current && current.constructor.displayName || undefined;
}
/**
* Warn if the component doesn't have an explicit key assigned to it.
* This component is in an array. The array could grow and shrink or be
* reordered. All children that haven't already been validated are required to
* have a "key" property assigned to it.
*
* @internal
* @param {ReactComponent} component Component that requires a key.
* @param {*} parentType component's parent's type.
*/
function validateExplicitKey(component, parentType) {
if (component._store.validated || component.key != null) {
return;
}
component._store.validated = true;
warnAndMonitorForKeyUse(
'react_key_warning',
'Each child in an array should have a unique "key" prop.',
component,
parentType
);
}
/**
* Warn if the key is being defined as an object property but has an incorrect
* value.
*
* @internal
* @param {string} name Property name of the key.
* @param {ReactComponent} component Component that requires a key.
* @param {*} parentType component's parent's type.
*/
function validatePropertyKey(name, component, parentType) {
if (!NUMERIC_PROPERTY_REGEX.test(name)) {
return;
}
warnAndMonitorForKeyUse(
'react_numeric_key_warning',
'Child objects should have non-numeric keys so ordering is preserved.',
component,
parentType
);
}
/**
* Shared warning and monitoring code for the key warnings.
*
* @internal
* @param {string} warningID The id used when logging.
* @param {string} message The base warning that gets output.
* @param {ReactComponent} component Component that requires a key.
* @param {*} parentType component's parent's type.
*/
function warnAndMonitorForKeyUse(warningID, message, component, parentType) {
var ownerName = getCurrentOwnerDisplayName();
var parentName = parentType.displayName;
var useName = ownerName || parentName;
var memoizer = ownerHasKeyUseWarning[warningID];
if (memoizer.hasOwnProperty(useName)) {
return;
}
memoizer[useName] = true;
message += ownerName ?
(" Check the render method of " + ownerName + ".") :
(" Check the renderComponent call using <" + parentName + ">.");
// Usually the current owner is the offender, but if it accepts children as a
// property, it may be the creator of the child that's responsible for
// assigning it a key.
var childOwnerName = null;
if (component._owner && component._owner !== ReactCurrentOwner.current) {
// Name of the component that originally created this child.
childOwnerName = component._owner.constructor.displayName;
message += (" It was passed a child from " + childOwnerName + ".");
}
message += ' See http://fb.me/react-warning-keys for more information.';
monitorCodeUse(warningID, {
component: useName,
componentOwner: childOwnerName
});
console.warn(message);
}
/**
* Log that we're using an object map. We're considering deprecating this
* feature and replace it with proper Map and ImmutableMap data structures.
*
* @internal
*/
function monitorUseOfObjectMap() {
var currentName = getCurrentOwnerDisplayName() || '';
if (ownerHasMonitoredObjectMap.hasOwnProperty(currentName)) {
return;
}
ownerHasMonitoredObjectMap[currentName] = true;
monitorCodeUse('react_object_map_children');
}
/**
* Ensure that every component either is passed in a static location, in an
* array with an explicit keys property defined, or in an object literal
* with valid key property.
*
* @internal
* @param {*} component Statically passed child of any type.
* @param {*} parentType component's parent's type.
* @return {boolean}
*/
function validateChildKeys(component, parentType) {
if (Array.isArray(component)) {
for (var i = 0; i < component.length; i++) {
var child = component[i];
if (ReactElement.isValidElement(child)) {
validateExplicitKey(child, parentType);
}
}
} else if (ReactElement.isValidElement(component)) {
// This component was passed in a valid location.
component._store.validated = true;
} else if (component && typeof component === 'object') {
monitorUseOfObjectMap();
for (var name in component) {
validatePropertyKey(name, component[name], parentType);
}
}
}
/**
* Assert that the props are valid
*
* @param {string} componentName Name of the component for error messages.
* @param {object} propTypes Map of prop name to a ReactPropType
* @param {object} props
* @param {string} location e.g. "prop", "context", "child context"
* @private
*/
function checkPropTypes(componentName, propTypes, props, location) {
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
error = propTypes[propName](props, propName, componentName, location);
} catch (ex) {
error = ex;
}
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
// This will soon use the warning module
monitorCodeUse(
'react_failed_descriptor_type_check',
{ message: error.message }
);
}
}
}
}
var ReactElementValidator = {
createElement: function(type, props, children) {
var element = ReactElement.createElement.apply(this, arguments);
// The result can be nullish if a mock or a custom function is used.
// TODO: Drop this when these are no longer allowed as the type argument.
if (element == null) {
return element;
}
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], type);
}
var name = type.displayName;
if (type.propTypes) {
checkPropTypes(
name,
type.propTypes,
element.props,
ReactPropTypeLocations.prop
);
}
if (type.contextTypes) {
checkPropTypes(
name,
type.contextTypes,
element._context,
ReactPropTypeLocations.context
);
}
return element;
},
createFactory: function(type) {
var validatedFactory = ReactElementValidator.createElement.bind(
null,
type
);
validatedFactory.type = type;
return validatedFactory;
}
};
module.exports = ReactElementValidator;
},{"./ReactCurrentOwner":36,"./ReactElement":52,"./ReactPropTypeLocations":71,"./monitorCodeUse":136}],54:[function(_dereq_,module,exports){
/**
* 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 ReactEmptyComponent
*/
"use strict";
var ReactElement = _dereq_("./ReactElement");
var invariant = _dereq_("./invariant");
var component;
// This registry keeps track of the React IDs of the components that rendered to
// `null` (in reality a placeholder such as `noscript`)
var nullComponentIdsRegistry = {};
var ReactEmptyComponentInjection = {
injectEmptyComponent: function(emptyComponent) {
component = ReactElement.createFactory(emptyComponent);
}
};
/**
* @return {ReactComponent} component The injected empty component.
*/
function getEmptyComponent() {
("production" !== "development" ? invariant(
component,
'Trying to return null from a render, but no null placeholder component ' +
'was injected.'
) : invariant(component));
return component();
}
/**
* Mark the component as having rendered to null.
* @param {string} id Component's `_rootNodeID`.
*/
function registerNullComponentID(id) {
nullComponentIdsRegistry[id] = true;
}
/**
* Unmark the component as having rendered to null: it renders to something now.
* @param {string} id Component's `_rootNodeID`.
*/
function deregisterNullComponentID(id) {
delete nullComponentIdsRegistry[id];
}
/**
* @param {string} id Component's `_rootNodeID`.
* @return {boolean} True if the component is rendered to null.
*/
function isNullComponentID(id) {
return nullComponentIdsRegistry[id];
}
var ReactEmptyComponent = {
deregisterNullComponentID: deregisterNullComponentID,
getEmptyComponent: getEmptyComponent,
injection: ReactEmptyComponentInjection,
isNullComponentID: isNullComponentID,
registerNullComponentID: registerNullComponentID
};
module.exports = ReactEmptyComponent;
},{"./ReactElement":52,"./invariant":126}],55:[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.
*
* @providesModule ReactErrorUtils
* @typechecks
*/
"use strict";
var ReactErrorUtils = {
/**
* Creates a guarded version of a function. This is supposed to make debugging
* of event handlers easier. To aid debugging with the browser's debugger,
* this currently simply returns the original function.
*
* @param {function} func Function to be executed
* @param {string} name The name of the guard
* @return {function}
*/
guard: function(func, name) {
return func;
}
};
module.exports = ReactErrorUtils;
},{}],56:[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.
*
* @providesModule ReactEventEmitterMixin
*/
"use strict";
var EventPluginHub = _dereq_("./EventPluginHub");
function runEventQueueInBatch(events) {
EventPluginHub.enqueueEvents(events);
EventPluginHub.processEventQueue();
}
var ReactEventEmitterMixin = {
/**
* Streams a fired top-level event to `EventPluginHub` where plugins have the
* opportunity to create `ReactEvent`s to be dispatched.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {object} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native environment event.
*/
handleTopLevel: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
var events = EventPluginHub.extractEvents(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent
);
runEventQueueInBatch(events);
}
};
module.exports = ReactEventEmitterMixin;
},{"./EventPluginHub":18}],57:[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.
*
* @providesModule ReactEventListener
* @typechecks static-only
*/
"use strict";
var EventListener = _dereq_("./EventListener");
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var PooledClass = _dereq_("./PooledClass");
var ReactInstanceHandles = _dereq_("./ReactInstanceHandles");
var ReactMount = _dereq_("./ReactMount");
var ReactUpdates = _dereq_("./ReactUpdates");
var assign = _dereq_("./Object.assign");
var getEventTarget = _dereq_("./getEventTarget");
var getUnboundedScrollPosition = _dereq_("./getUnboundedScrollPosition");
/**
* Finds the parent React component of `node`.
*
* @param {*} node
* @return {?DOMEventTarget} Parent container, or `null` if the specified node
* is not nested.
*/
function findParent(node) {
// TODO: It may be a good idea to cache this to prevent unnecessary DOM
// traversal, but caching is difficult to do correctly without using a
// mutation observer to listen for all DOM changes.
var nodeID = ReactMount.getID(node);
var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
var container = ReactMount.findReactContainerForID(rootID);
var parent = ReactMount.getFirstReactDOM(container);
return parent;
}
// Used to store ancestor hierarchy in top level callback
function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
this.topLevelType = topLevelType;
this.nativeEvent = nativeEvent;
this.ancestors = [];
}
assign(TopLevelCallbackBookKeeping.prototype, {
destructor: function() {
this.topLevelType = null;
this.nativeEvent = null;
this.ancestors.length = 0;
}
});
PooledClass.addPoolingTo(
TopLevelCallbackBookKeeping,
PooledClass.twoArgumentPooler
);
function handleTopLevelImpl(bookKeeping) {
var topLevelTarget = ReactMount.getFirstReactDOM(
getEventTarget(bookKeeping.nativeEvent)
) || window;
// Loop through the hierarchy, in case there's any nested components.
// It's important that we build the array of ancestors before calling any
// event handlers, because event handlers can modify the DOM, leading to
// inconsistencies with ReactMount's node cache. See #1105.
var ancestor = topLevelTarget;
while (ancestor) {
bookKeeping.ancestors.push(ancestor);
ancestor = findParent(ancestor);
}
for (var i = 0, l = bookKeeping.ancestors.length; i < l; i++) {
topLevelTarget = bookKeeping.ancestors[i];
var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
ReactEventListener._handleTopLevel(
bookKeeping.topLevelType,
topLevelTarget,
topLevelTargetID,
bookKeeping.nativeEvent
);
}
}
function scrollValueMonitor(cb) {
var scrollPosition = getUnboundedScrollPosition(window);
cb(scrollPosition);
}
var ReactEventListener = {
_enabled: true,
_handleTopLevel: null,
WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
setHandleTopLevel: function(handleTopLevel) {
ReactEventListener._handleTopLevel = handleTopLevel;
},
setEnabled: function(enabled) {
ReactEventListener._enabled = !!enabled;
},
isEnabled: function() {
return ReactEventListener._enabled;
},
/**
* Traps top-level events by using event bubbling.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} handle Element on which to attach listener.
* @return {object} An object with a remove function which will forcefully
* remove the listener.
* @internal
*/
trapBubbledEvent: function(topLevelType, handlerBaseName, handle) {
var element = handle;
if (!element) {
return;
}
return EventListener.listen(
element,
handlerBaseName,
ReactEventListener.dispatchEvent.bind(null, topLevelType)
);
},
/**
* Traps a top-level event by using event capturing.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} handle Element on which to attach listener.
* @return {object} An object with a remove function which will forcefully
* remove the listener.
* @internal
*/
trapCapturedEvent: function(topLevelType, handlerBaseName, handle) {
var element = handle;
if (!element) {
return;
}
return EventListener.capture(
element,
handlerBaseName,
ReactEventListener.dispatchEvent.bind(null, topLevelType)
);
},
monitorScrollValue: function(refresh) {
var callback = scrollValueMonitor.bind(null, refresh);
EventListener.listen(window, 'scroll', callback);
EventListener.listen(window, 'resize', callback);
},
dispatchEvent: function(topLevelType, nativeEvent) {
if (!ReactEventListener._enabled) {
return;
}
var bookKeeping = TopLevelCallbackBookKeeping.getPooled(
topLevelType,
nativeEvent
);
try {
// Event queue being processed in the same cycle allows
// `preventDefault`.
ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
} finally {
TopLevelCallbackBookKeeping.release(bookKeeping);
}
}
};
module.exports = ReactEventListener;
},{"./EventListener":17,"./ExecutionEnvironment":22,"./Object.assign":27,"./PooledClass":28,"./ReactInstanceHandles":60,"./ReactMount":63,"./ReactUpdates":79,"./getEventTarget":117,"./getUnboundedScrollPosition":122}],58:[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.
*
* @providesModule ReactInjection
*/
"use strict";
var DOMProperty = _dereq_("./DOMProperty");
var EventPluginHub = _dereq_("./EventPluginHub");
var ReactComponent = _dereq_("./ReactComponent");
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactEmptyComponent = _dereq_("./ReactEmptyComponent");
var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter");
var ReactNativeComponent = _dereq_("./ReactNativeComponent");
var ReactPerf = _dereq_("./ReactPerf");
var ReactRootIndex = _dereq_("./ReactRootIndex");
var ReactUpdates = _dereq_("./ReactUpdates");
var ReactInjection = {
Component: ReactComponent.injection,
CompositeComponent: ReactCompositeComponent.injection,
DOMProperty: DOMProperty.injection,
EmptyComponent: ReactEmptyComponent.injection,
EventPluginHub: EventPluginHub.injection,
EventEmitter: ReactBrowserEventEmitter.injection,
NativeComponent: ReactNativeComponent.injection,
Perf: ReactPerf.injection,
RootIndex: ReactRootIndex.injection,
Updates: ReactUpdates.injection
};
module.exports = ReactInjection;
},{"./DOMProperty":11,"./EventPluginHub":18,"./ReactBrowserEventEmitter":30,"./ReactComponent":32,"./ReactCompositeComponent":34,"./ReactEmptyComponent":54,"./ReactNativeComponent":66,"./ReactPerf":68,"./ReactRootIndex":75,"./ReactUpdates":79}],59:[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.
*
* @providesModule ReactInputSelection
*/
"use strict";
var ReactDOMSelection = _dereq_("./ReactDOMSelection");
var containsNode = _dereq_("./containsNode");
var focusNode = _dereq_("./focusNode");
var getActiveElement = _dereq_("./getActiveElement");
function isInDocument(node) {
return containsNode(document.documentElement, node);
}
/**
* @ReactInputSelection: React input selection module. Based on Selection.js,
* but modified to be suitable for react and has a couple of bug fixes (doesn't
* assume buttons have range selections allowed).
* Input selection module for React.
*/
var ReactInputSelection = {
hasSelectionCapabilities: function(elem) {
return elem && (
(elem.nodeName === 'INPUT' && elem.type === 'text') ||
elem.nodeName === 'TEXTAREA' ||
elem.contentEditable === 'true'
);
},
getSelectionInformation: function() {
var focusedElem = getActiveElement();
return {
focusedElem: focusedElem,
selectionRange:
ReactInputSelection.hasSelectionCapabilities(focusedElem) ?
ReactInputSelection.getSelection(focusedElem) :
null
};
},
/**
* @restoreSelection: If any selection information was potentially lost,
* restore it. This is useful when performing operations that could remove dom
* nodes and place them back in, resulting in focus being lost.
*/
restoreSelection: function(priorSelectionInformation) {
var curFocusedElem = getActiveElement();
var priorFocusedElem = priorSelectionInformation.focusedElem;
var priorSelectionRange = priorSelectionInformation.selectionRange;
if (curFocusedElem !== priorFocusedElem &&
isInDocument(priorFocusedElem)) {
if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
ReactInputSelection.setSelection(
priorFocusedElem,
priorSelectionRange
);
}
focusNode(priorFocusedElem);
}
},
/**
* @getSelection: Gets the selection bounds of a focused textarea, input or
* contentEditable node.
* -@input: Look up selection bounds of this input
* -@return {start: selectionStart, end: selectionEnd}
*/
getSelection: function(input) {
var selection;
if ('selectionStart' in input) {
// Modern browser with input or textarea.
selection = {
start: input.selectionStart,
end: input.selectionEnd
};
} else if (document.selection && input.nodeName === 'INPUT') {
// IE8 input.
var range = document.selection.createRange();
// There can only be one selection per document in IE, so it must
// be in our element.
if (range.parentElement() === input) {
selection = {
start: -range.moveStart('character', -input.value.length),
end: -range.moveEnd('character', -input.value.length)
};
}
} else {
// Content editable or old IE textarea.
selection = ReactDOMSelection.getOffsets(input);
}
return selection || {start: 0, end: 0};
},
/**
* @setSelection: Sets the selection bounds of a textarea or input and focuses
* the input.
* -@input Set selection bounds of this input or textarea
* -@offsets Object of same form that is returned from get*
*/
setSelection: function(input, offsets) {
var start = offsets.start;
var end = offsets.end;
if (typeof end === 'undefined') {
end = start;
}
if ('selectionStart' in input) {
input.selectionStart = start;
input.selectionEnd = Math.min(end, input.value.length);
} else if (document.selection && input.nodeName === 'INPUT') {
var range = input.createTextRange();
range.collapse(true);
range.moveStart('character', start);
range.moveEnd('character', end - start);
range.select();
} else {
ReactDOMSelection.setOffsets(input, offsets);
}
}
};
module.exports = ReactInputSelection;
},{"./ReactDOMSelection":46,"./containsNode":101,"./focusNode":111,"./getActiveElement":113}],60:[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.
*
* @providesModule ReactInstanceHandles
* @typechecks static-only
*/
"use strict";
var ReactRootIndex = _dereq_("./ReactRootIndex");
var invariant = _dereq_("./invariant");
var SEPARATOR = '.';
var SEPARATOR_LENGTH = SEPARATOR.length;
/**
* Maximum depth of traversals before we consider the possibility of a bad ID.
*/
var MAX_TREE_DEPTH = 100;
/**
* Creates a DOM ID prefix to use when mounting React components.
*
* @param {number} index A unique integer
* @return {string} React root ID.
* @internal
*/
function getReactRootIDString(index) {
return SEPARATOR + index.toString(36);
}
/**
* Checks if a character in the supplied ID is a separator or the end.
*
* @param {string} id A React DOM ID.
* @param {number} index Index of the character to check.
* @return {boolean} True if the character is a separator or end of the ID.
* @private
*/
function isBoundary(id, index) {
return id.charAt(index) === SEPARATOR || index === id.length;
}
/**
* Checks if the supplied string is a valid React DOM ID.
*
* @param {string} id A React DOM ID, maybe.
* @return {boolean} True if the string is a valid React DOM ID.
* @private
*/
function isValidID(id) {
return id === '' || (
id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR
);
}
/**
* Checks if the first ID is an ancestor of or equal to the second ID.
*
* @param {string} ancestorID
* @param {string} descendantID
* @return {boolean} True if `ancestorID` is an ancestor of `descendantID`.
* @internal
*/
function isAncestorIDOf(ancestorID, descendantID) {
return (
descendantID.indexOf(ancestorID) === 0 &&
isBoundary(descendantID, ancestorID.length)
);
}
/**
* Gets the parent ID of the supplied React DOM ID, `id`.
*
* @param {string} id ID of a component.
* @return {string} ID of the parent, or an empty string.
* @private
*/
function getParentID(id) {
return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';
}
/**
* Gets the next DOM ID on the tree path from the supplied `ancestorID` to the
* supplied `destinationID`. If they are equal, the ID is returned.
*
* @param {string} ancestorID ID of an ancestor node of `destinationID`.
* @param {string} destinationID ID of the destination node.
* @return {string} Next ID on the path from `ancestorID` to `destinationID`.
* @private
*/
function getNextDescendantID(ancestorID, destinationID) {
("production" !== "development" ? invariant(
isValidID(ancestorID) && isValidID(destinationID),
'getNextDescendantID(%s, %s): Received an invalid React DOM ID.',
ancestorID,
destinationID
) : invariant(isValidID(ancestorID) && isValidID(destinationID)));
("production" !== "development" ? invariant(
isAncestorIDOf(ancestorID, destinationID),
'getNextDescendantID(...): React has made an invalid assumption about ' +
'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.',
ancestorID,
destinationID
) : invariant(isAncestorIDOf(ancestorID, destinationID)));
if (ancestorID === destinationID) {
return ancestorID;
}
// Skip over the ancestor and the immediate separator. Traverse until we hit
// another separator or we reach the end of `destinationID`.
var start = ancestorID.length + SEPARATOR_LENGTH;
for (var i = start; i < destinationID.length; i++) {
if (isBoundary(destinationID, i)) {
break;
}
}
return destinationID.substr(0, i);
}
/**
* Gets the nearest common ancestor ID of two IDs.
*
* Using this ID scheme, the nearest common ancestor ID is the longest common
* prefix of the two IDs that immediately preceded a "marker" in both strings.
*
* @param {string} oneID
* @param {string} twoID
* @return {string} Nearest common ancestor ID, or the empty string if none.
* @private
*/
function getFirstCommonAncestorID(oneID, twoID) {
var minLength = Math.min(oneID.length, twoID.length);
if (minLength === 0) {
return '';
}
var lastCommonMarkerIndex = 0;
// Use `<=` to traverse until the "EOL" of the shorter string.
for (var i = 0; i <= minLength; i++) {
if (isBoundary(oneID, i) && isBoundary(twoID, i)) {
lastCommonMarkerIndex = i;
} else if (oneID.charAt(i) !== twoID.charAt(i)) {
break;
}
}
var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
("production" !== "development" ? invariant(
isValidID(longestCommonID),
'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s',
oneID,
twoID,
longestCommonID
) : invariant(isValidID(longestCommonID)));
return longestCommonID;
}
/**
* Traverses the parent path between two IDs (either up or down). The IDs must
* not be the same, and there must exist a parent path between them. If the
* callback returns `false`, traversal is stopped.
*
* @param {?string} start ID at which to start traversal.
* @param {?string} stop ID at which to end traversal.
* @param {function} cb Callback to invoke each ID with.
* @param {?boolean} skipFirst Whether or not to skip the first node.
* @param {?boolean} skipLast Whether or not to skip the last node.
* @private
*/
function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
start = start || '';
stop = stop || '';
("production" !== "development" ? invariant(
start !== stop,
'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.',
start
) : invariant(start !== stop));
var traverseUp = isAncestorIDOf(stop, start);
("production" !== "development" ? invariant(
traverseUp || isAncestorIDOf(start, stop),
'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' +
'not have a parent path.',
start,
stop
) : invariant(traverseUp || isAncestorIDOf(start, stop)));
// Traverse from `start` to `stop` one depth at a time.
var depth = 0;
var traverse = traverseUp ? getParentID : getNextDescendantID;
for (var id = start; /* until break */; id = traverse(id, stop)) {
var ret;
if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
ret = cb(id, traverseUp, arg);
}
if (ret === false || id === stop) {
// Only break //after// visiting `stop`.
break;
}
("production" !== "development" ? invariant(
depth++ < MAX_TREE_DEPTH,
'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' +
'traversing the React DOM ID tree. This may be due to malformed IDs: %s',
start, stop
) : invariant(depth++ < MAX_TREE_DEPTH));
}
}
/**
* Manages the IDs assigned to DOM representations of React components. This
* uses a specific scheme in order to traverse the DOM efficiently (e.g. in
* order to simulate events).
*
* @internal
*/
var ReactInstanceHandles = {
/**
* Constructs a React root ID
* @return {string} A React root ID.
*/
createReactRootID: function() {
return getReactRootIDString(ReactRootIndex.createReactRootIndex());
},
/**
* Constructs a React ID by joining a root ID with a name.
*
* @param {string} rootID Root ID of a parent component.
* @param {string} name A component's name (as flattened children).
* @return {string} A React ID.
* @internal
*/
createReactID: function(rootID, name) {
return rootID + name;
},
/**
* Gets the DOM ID of the React component that is the root of the tree that
* contains the React component with the supplied DOM ID.
*
* @param {string} id DOM ID of a React component.
* @return {?string} DOM ID of the React component that is the root.
* @internal
*/
getReactRootIDFromNodeID: function(id) {
if (id && id.charAt(0) === SEPARATOR && id.length > 1) {
var index = id.indexOf(SEPARATOR, 1);
return index > -1 ? id.substr(0, index) : id;
}
return null;
},
/**
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
* should would receive a `mouseEnter` or `mouseLeave` event.
*
* NOTE: Does not invoke the callback on the nearest common ancestor because
* nothing "entered" or "left" that element.
*
* @param {string} leaveID ID being left.
* @param {string} enterID ID being entered.
* @param {function} cb Callback to invoke on each entered/left ID.
* @param {*} upArg Argument to invoke the callback with on left IDs.
* @param {*} downArg Argument to invoke the callback with on entered IDs.
* @internal
*/
traverseEnterLeave: function(leaveID, enterID, cb, upArg, downArg) {
var ancestorID = getFirstCommonAncestorID(leaveID, enterID);
if (ancestorID !== leaveID) {
traverseParentPath(leaveID, ancestorID, cb, upArg, false, true);
}
if (ancestorID !== enterID) {
traverseParentPath(ancestorID, enterID, cb, downArg, true, false);
}
},
/**
* Simulates the traversal of a two-phase, capture/bubble event dispatch.
*
* NOTE: This traversal happens on IDs without touching the DOM.
*
* @param {string} targetID ID of the target node.
* @param {function} cb Callback to invoke.
* @param {*} arg Argument to invoke the callback with.
* @internal
*/
traverseTwoPhase: function(targetID, cb, arg) {
if (targetID) {
traverseParentPath('', targetID, cb, arg, true, false);
traverseParentPath(targetID, '', cb, arg, false, true);
}
},
/**
* Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
* example, passing `.0.$row-0.1` would result in `cb` getting called
* with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
*
* NOTE: This traversal happens on IDs without touching the DOM.
*
* @param {string} targetID ID of the target node.
* @param {function} cb Callback to invoke.
* @param {*} arg Argument to invoke the callback with.
* @internal
*/
traverseAncestors: function(targetID, cb, arg) {
traverseParentPath('', targetID, cb, arg, true, false);
},
/**
* Exposed for unit testing.
* @private
*/
_getFirstCommonAncestorID: getFirstCommonAncestorID,
/**
* Exposed for unit testing.
* @private
*/
_getNextDescendantID: getNextDescendantID,
isAncestorIDOf: isAncestorIDOf,
SEPARATOR: SEPARATOR
};
module.exports = ReactInstanceHandles;
},{"./ReactRootIndex":75,"./invariant":126}],61:[function(_dereq_,module,exports){
/**
* 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 ReactLegacyElement
*/
"use strict";
var ReactCurrentOwner = _dereq_("./ReactCurrentOwner");
var invariant = _dereq_("./invariant");
var monitorCodeUse = _dereq_("./monitorCodeUse");
var warning = _dereq_("./warning");
var legacyFactoryLogs = {};
function warnForLegacyFactoryCall() {
if (!ReactLegacyElementFactory._isLegacyCallWarningEnabled) {
return;
}
var owner = ReactCurrentOwner.current;
var name = owner && owner.constructor ? owner.constructor.displayName : '';
if (!name) {
name = 'Something';
}
if (legacyFactoryLogs.hasOwnProperty(name)) {
return;
}
legacyFactoryLogs[name] = true;
("production" !== "development" ? warning(
false,
name + ' is calling a React component directly. ' +
'Use a factory or JSX instead. See: http://fb.me/react-legacyfactory'
) : null);
monitorCodeUse('react_legacy_factory_call', { version: 3, name: name });
}
function warnForPlainFunctionType(type) {
var isReactClass =
type.prototype &&
typeof type.prototype.mountComponent === 'function' &&
typeof type.prototype.receiveComponent === 'function';
if (isReactClass) {
("production" !== "development" ? warning(
false,
'Did not expect to get a React class here. Use `Component` instead ' +
'of `Component.type` or `this.constructor`.'
) : null);
} else {
if (!type._reactWarnedForThisType) {
try {
type._reactWarnedForThisType = true;
} catch (x) {
// just incase this is a frozen object or some special object
}
monitorCodeUse(
'react_non_component_in_jsx',
{ version: 3, name: type.name }
);
}
("production" !== "development" ? warning(
false,
'This JSX uses a plain function. Only React components are ' +
'valid in React\'s JSX transform.'
) : null);
}
}
function warnForNonLegacyFactory(type) {
("production" !== "development" ? warning(
false,
'Do not pass React.DOM.' + type.type + ' to JSX or createFactory. ' +
'Use the string "' + type.type + '" instead.'
) : null);
}
/**
* Transfer static properties from the source to the target. Functions are
* rebound to have this reflect the original source.
*/
function proxyStaticMethods(target, source) {
if (typeof source !== 'function') {
return;
}
for (var key in source) {
if (source.hasOwnProperty(key)) {
var value = source[key];
if (typeof value === 'function') {
var bound = value.bind(source);
// Copy any properties defined on the function, such as `isRequired` on
// a PropTypes validator.
for (var k in value) {
if (value.hasOwnProperty(k)) {
bound[k] = value[k];
}
}
target[key] = bound;
} else {
target[key] = value;
}
}
}
}
// We use an object instead of a boolean because booleans are ignored by our
// mocking libraries when these factories gets mocked.
var LEGACY_MARKER = {};
var NON_LEGACY_MARKER = {};
var ReactLegacyElementFactory = {};
ReactLegacyElementFactory.wrapCreateFactory = function(createFactory) {
var legacyCreateFactory = function(type) {
if (typeof type !== 'function') {
// Non-function types cannot be legacy factories
return createFactory(type);
}
if (type.isReactNonLegacyFactory) {
// This is probably a factory created by ReactDOM we unwrap it to get to
// the underlying string type. It shouldn't have been passed here so we
// warn.
if ("production" !== "development") {
warnForNonLegacyFactory(type);
}
return createFactory(type.type);
}
if (type.isReactLegacyFactory) {
// This is probably a legacy factory created by ReactCompositeComponent.
// We unwrap it to get to the underlying class.
return createFactory(type.type);
}
if ("production" !== "development") {
warnForPlainFunctionType(type);
}
// Unless it's a legacy factory, then this is probably a plain function,
// that is expecting to be invoked by JSX. We can just return it as is.
return type;
};
return legacyCreateFactory;
};
ReactLegacyElementFactory.wrapCreateElement = function(createElement) {
var legacyCreateElement = function(type, props, children) {
if (typeof type !== 'function') {
// Non-function types cannot be legacy factories
return createElement.apply(this, arguments);
}
var args;
if (type.isReactNonLegacyFactory) {
// This is probably a factory created by ReactDOM we unwrap it to get to
// the underlying string type. It shouldn't have been passed here so we
// warn.
if ("production" !== "development") {
warnForNonLegacyFactory(type);
}
args = Array.prototype.slice.call(arguments, 0);
args[0] = type.type;
return createElement.apply(this, args);
}
if (type.isReactLegacyFactory) {
// This is probably a legacy factory created by ReactCompositeComponent.
// We unwrap it to get to the underlying class.
if (type._isMockFunction) {
// If this is a mock function, people will expect it to be called. We
// will actually call the original mock factory function instead. This
// future proofs unit testing that assume that these are classes.
type.type._mockedReactClassConstructor = type;
}
args = Array.prototype.slice.call(arguments, 0);
args[0] = type.type;
return createElement.apply(this, args);
}
if ("production" !== "development") {
warnForPlainFunctionType(type);
}
// This is being called with a plain function we should invoke it
// immediately as if this was used with legacy JSX.
return type.apply(null, Array.prototype.slice.call(arguments, 1));
};
return legacyCreateElement;
};
ReactLegacyElementFactory.wrapFactory = function(factory) {
("production" !== "development" ? invariant(
typeof factory === 'function',
'This is suppose to accept a element factory'
) : invariant(typeof factory === 'function'));
var legacyElementFactory = function(config, children) {
// This factory should not be called when JSX is used. Use JSX instead.
if ("production" !== "development") {
warnForLegacyFactoryCall();
}
return factory.apply(this, arguments);
};
proxyStaticMethods(legacyElementFactory, factory.type);
legacyElementFactory.isReactLegacyFactory = LEGACY_MARKER;
legacyElementFactory.type = factory.type;
return legacyElementFactory;
};
// This is used to mark a factory that will remain. E.g. we're allowed to call
// it as a function. However, you're not suppose to pass it to createElement
// or createFactory, so it will warn you if you do.
ReactLegacyElementFactory.markNonLegacyFactory = function(factory) {
factory.isReactNonLegacyFactory = NON_LEGACY_MARKER;
return factory;
};
// Checks if a factory function is actually a legacy factory pretending to
// be a class.
ReactLegacyElementFactory.isValidFactory = function(factory) {
// TODO: This will be removed and moved into a class validator or something.
return typeof factory === 'function' &&
factory.isReactLegacyFactory === LEGACY_MARKER;
};
ReactLegacyElementFactory.isValidClass = function(factory) {
if ("production" !== "development") {
("production" !== "development" ? warning(
false,
'isValidClass is deprecated and will be removed in a future release. ' +
'Use a more specific validator instead.'
) : null);
}
return ReactLegacyElementFactory.isValidFactory(factory);
};
ReactLegacyElementFactory._isLegacyCallWarningEnabled = true;
module.exports = ReactLegacyElementFactory;
},{"./ReactCurrentOwner":36,"./invariant":126,"./monitorCodeUse":136,"./warning":145}],62:[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.
*
* @providesModule ReactMarkupChecksum
*/
"use strict";
var adler32 = _dereq_("./adler32");
var ReactMarkupChecksum = {
CHECKSUM_ATTR_NAME: 'data-react-checksum',
/**
* @param {string} markup Markup string
* @return {string} Markup string with checksum attribute attached
*/
addChecksumToMarkup: function(markup) {
var checksum = adler32(markup);
return markup.replace(
'>',
' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '">'
);
},
/**
* @param {string} markup to use
* @param {DOMElement} element root React element
* @returns {boolean} whether or not the markup is the same
*/
canReuseMarkup: function(markup, element) {
var existingChecksum = element.getAttribute(
ReactMarkupChecksum.CHECKSUM_ATTR_NAME
);
existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
var markupChecksum = adler32(markup);
return markupChecksum === existingChecksum;
}
};
module.exports = ReactMarkupChecksum;
},{"./adler32":98}],63:[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.
*
* @providesModule ReactMount
*/
"use strict";
var DOMProperty = _dereq_("./DOMProperty");
var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter");
var ReactCurrentOwner = _dereq_("./ReactCurrentOwner");
var ReactElement = _dereq_("./ReactElement");
var ReactLegacyElement = _dereq_("./ReactLegacyElement");
var ReactInstanceHandles = _dereq_("./ReactInstanceHandles");
var ReactPerf = _dereq_("./ReactPerf");
var containsNode = _dereq_("./containsNode");
var deprecated = _dereq_("./deprecated");
var getReactRootElementInContainer = _dereq_("./getReactRootElementInContainer");
var instantiateReactComponent = _dereq_("./instantiateReactComponent");
var invariant = _dereq_("./invariant");
var shouldUpdateReactComponent = _dereq_("./shouldUpdateReactComponent");
var warning = _dereq_("./warning");
var createElement = ReactLegacyElement.wrapCreateElement(
ReactElement.createElement
);
var SEPARATOR = ReactInstanceHandles.SEPARATOR;
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
var nodeCache = {};
var ELEMENT_NODE_TYPE = 1;
var DOC_NODE_TYPE = 9;
/** Mapping from reactRootID to React component instance. */
var instancesByReactRootID = {};
/** Mapping from reactRootID to `container` nodes. */
var containersByReactRootID = {};
if ("production" !== "development") {
/** __DEV__-only mapping from reactRootID to root elements. */
var rootElementsByReactRootID = {};
}
// Used to store breadth-first search state in findComponentRoot.
var findComponentRootReusableArray = [];
/**
* @param {DOMElement} container DOM element that may contain a React component.
* @return {?string} A "reactRoot" ID, if a React component is rendered.
*/
function getReactRootID(container) {
var rootElement = getReactRootElementInContainer(container);
return rootElement && ReactMount.getID(rootElement);
}
/**
* Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form
* element can return its control whose name or ID equals ATTR_NAME. All
* DOM nodes support `getAttributeNode` but this can also get called on
* other objects so just return '' if we're given something other than a
* DOM node (such as window).
*
* @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node.
* @return {string} ID of the supplied `domNode`.
*/
function getID(node) {
var id = internalGetID(node);
if (id) {
if (nodeCache.hasOwnProperty(id)) {
var cached = nodeCache[id];
if (cached !== node) {
("production" !== "development" ? invariant(
!isValid(cached, id),
'ReactMount: Two valid but unequal nodes with the same `%s`: %s',
ATTR_NAME, id
) : invariant(!isValid(cached, id)));
nodeCache[id] = node;
}
} else {
nodeCache[id] = node;
}
}
return id;
}
function internalGetID(node) {
// If node is something like a window, document, or text node, none of
// which support attributes or a .getAttribute method, gracefully return
// the empty string, as if the attribute were missing.
return node && node.getAttribute && node.getAttribute(ATTR_NAME) || '';
}
/**
* Sets the React-specific ID of the given node.
*
* @param {DOMElement} node The DOM node whose ID will be set.
* @param {string} id The value of the ID attribute.
*/
function setID(node, id) {
var oldID = internalGetID(node);
if (oldID !== id) {
delete nodeCache[oldID];
}
node.setAttribute(ATTR_NAME, id);
nodeCache[id] = node;
}
/**
* Finds the node with the supplied React-generated DOM ID.
*
* @param {string} id A React-generated DOM ID.
* @return {DOMElement} DOM node with the suppled `id`.
* @internal
*/
function getNode(id) {
if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
nodeCache[id] = ReactMount.findReactNodeByID(id);
}
return nodeCache[id];
}
/**
* A node is "valid" if it is contained by a currently mounted container.
*
* This means that the node does not have to be contained by a document in
* order to be considered valid.
*
* @param {?DOMElement} node The candidate DOM node.
* @param {string} id The expected ID of the node.
* @return {boolean} Whether the node is contained by a mounted container.
*/
function isValid(node, id) {
if (node) {
("production" !== "development" ? invariant(
internalGetID(node) === id,
'ReactMount: Unexpected modification of `%s`',
ATTR_NAME
) : invariant(internalGetID(node) === id));
var container = ReactMount.findReactContainerForID(id);
if (container && containsNode(container, node)) {
return true;
}
}
return false;
}
/**
* Causes the cache to forget about one React-specific ID.
*
* @param {string} id The ID to forget.
*/
function purgeID(id) {
delete nodeCache[id];
}
var deepestNodeSoFar = null;
function findDeepestCachedAncestorImpl(ancestorID) {
var ancestor = nodeCache[ancestorID];
if (ancestor && isValid(ancestor, ancestorID)) {
deepestNodeSoFar = ancestor;
} else {
// This node isn't populated in the cache, so presumably none of its
// descendants are. Break out of the loop.
return false;
}
}
/**
* Return the deepest cached node whose ID is a prefix of `targetID`.
*/
function findDeepestCachedAncestor(targetID) {
deepestNodeSoFar = null;
ReactInstanceHandles.traverseAncestors(
targetID,
findDeepestCachedAncestorImpl
);
var foundNode = deepestNodeSoFar;
deepestNodeSoFar = null;
return foundNode;
}
/**
* Mounting is the process of initializing a React component by creatings its
* representative DOM elements and inserting them into a supplied `container`.
* Any prior content inside `container` is destroyed in the process.
*
* ReactMount.render(
* component,
* document.getElementById('container')
* );
*
* <div id="container"> <-- Supplied `container`.
* <div data-reactid=".3"> <-- Rendered reactRoot of React
* // ... component.
* </div>
* </div>
*
* Inside of `container`, the first element rendered is the "reactRoot".
*/
var ReactMount = {
/** Exposed for debugging purposes **/
_instancesByReactRootID: instancesByReactRootID,
/**
* This is a hook provided to support rendering React components while
* ensuring that the apparent scroll position of its `container` does not
* change.
*
* @param {DOMElement} container The `container` being rendered into.
* @param {function} renderCallback This must be called once to do the render.
*/
scrollMonitor: function(container, renderCallback) {
renderCallback();
},
/**
* Take a component that's already mounted into the DOM and replace its props
* @param {ReactComponent} prevComponent component instance already in the DOM
* @param {ReactComponent} nextComponent component instance to render
* @param {DOMElement} container container to render into
* @param {?function} callback function triggered on completion
*/
_updateRootComponent: function(
prevComponent,
nextComponent,
container,
callback) {
var nextProps = nextComponent.props;
ReactMount.scrollMonitor(container, function() {
prevComponent.replaceProps(nextProps, callback);
});
if ("production" !== "development") {
// Record the root element in case it later gets transplanted.
rootElementsByReactRootID[getReactRootID(container)] =
getReactRootElementInContainer(container);
}
return prevComponent;
},
/**
* Register a component into the instance map and starts scroll value
* monitoring
* @param {ReactComponent} nextComponent component instance to render
* @param {DOMElement} container container to render into
* @return {string} reactRoot ID prefix
*/
_registerComponent: function(nextComponent, container) {
("production" !== "development" ? invariant(
container && (
container.nodeType === ELEMENT_NODE_TYPE ||
container.nodeType === DOC_NODE_TYPE
),
'_registerComponent(...): Target container is not a DOM element.'
) : invariant(container && (
container.nodeType === ELEMENT_NODE_TYPE ||
container.nodeType === DOC_NODE_TYPE
)));
ReactBrowserEventEmitter.ensureScrollValueMonitoring();
var reactRootID = ReactMount.registerContainer(container);
instancesByReactRootID[reactRootID] = nextComponent;
return reactRootID;
},
/**
* Render a new component into the DOM.
* @param {ReactComponent} nextComponent component instance to render
* @param {DOMElement} container container to render into
* @param {boolean} shouldReuseMarkup if we should skip the markup insertion
* @return {ReactComponent} nextComponent
*/
_renderNewRootComponent: ReactPerf.measure(
'ReactMount',
'_renderNewRootComponent',
function(
nextComponent,
container,
shouldReuseMarkup) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case.
("production" !== "development" ? warning(
ReactCurrentOwner.current == null,
'_renderNewRootComponent(): Render methods should be a pure function ' +
'of props and state; triggering nested component updates from ' +
'render is not allowed. If necessary, trigger nested updates in ' +
'componentDidUpdate.'
) : null);
var componentInstance = instantiateReactComponent(nextComponent, null);
var reactRootID = ReactMount._registerComponent(
componentInstance,
container
);
componentInstance.mountComponentIntoNode(
reactRootID,
container,
shouldReuseMarkup
);
if ("production" !== "development") {
// Record the root element in case it later gets transplanted.
rootElementsByReactRootID[reactRootID] =
getReactRootElementInContainer(container);
}
return componentInstance;
}
),
/**
* Renders a React component into the DOM in the supplied `container`.
*
* If the React component was previously rendered into `container`, this will
* perform an update on it and only mutate the DOM as necessary to reflect the
* latest React component.
*
* @param {ReactElement} nextElement Component element to render.
* @param {DOMElement} container DOM element to render into.
* @param {?function} callback function triggered on completion
* @return {ReactComponent} Component instance rendered in `container`.
*/
render: function(nextElement, container, callback) {
("production" !== "development" ? invariant(
ReactElement.isValidElement(nextElement),
'renderComponent(): Invalid component element.%s',
(
typeof nextElement === 'string' ?
' Instead of passing an element string, make sure to instantiate ' +
'it by passing it to React.createElement.' :
ReactLegacyElement.isValidFactory(nextElement) ?
' Instead of passing a component class, make sure to instantiate ' +
'it by passing it to React.createElement.' :
// Check if it quacks like a element
typeof nextElement.props !== "undefined" ?
' This may be caused by unintentionally loading two independent ' +
'copies of React.' :
''
)
) : invariant(ReactElement.isValidElement(nextElement)));
var prevComponent = instancesByReactRootID[getReactRootID(container)];
if (prevComponent) {
var prevElement = prevComponent._currentElement;
if (shouldUpdateReactComponent(prevElement, nextElement)) {
return ReactMount._updateRootComponent(
prevComponent,
nextElement,
container,
callback
);
} else {
ReactMount.unmountComponentAtNode(container);
}
}
var reactRootElement = getReactRootElementInContainer(container);
var containerHasReactMarkup =
reactRootElement && ReactMount.isRenderedByReact(reactRootElement);
var shouldReuseMarkup = containerHasReactMarkup && !prevComponent;
var component = ReactMount._renderNewRootComponent(
nextElement,
container,
shouldReuseMarkup
);
callback && callback.call(component);
return component;
},
/**
* Constructs a component instance of `constructor` with `initialProps` and
* renders it into the supplied `container`.
*
* @param {function} constructor React component constructor.
* @param {?object} props Initial props of the component instance.
* @param {DOMElement} container DOM element to render into.
* @return {ReactComponent} Component instance rendered in `container`.
*/
constructAndRenderComponent: function(constructor, props, container) {
var element = createElement(constructor, props);
return ReactMount.render(element, container);
},
/**
* Constructs a component instance of `constructor` with `initialProps` and
* renders it into a container node identified by supplied `id`.
*
* @param {function} componentConstructor React component constructor
* @param {?object} props Initial props of the component instance.
* @param {string} id ID of the DOM element to render into.
* @return {ReactComponent} Component instance rendered in the container node.
*/
constructAndRenderComponentByID: function(constructor, props, id) {
var domNode = document.getElementById(id);
("production" !== "development" ? invariant(
domNode,
'Tried to get element with id of "%s" but it is not present on the page.',
id
) : invariant(domNode));
return ReactMount.constructAndRenderComponent(constructor, props, domNode);
},
/**
* Registers a container node into which React components will be rendered.
* This also creates the "reactRoot" ID that will be assigned to the element
* rendered within.
*
* @param {DOMElement} container DOM element to register as a container.
* @return {string} The "reactRoot" ID of elements rendered within.
*/
registerContainer: function(container) {
var reactRootID = getReactRootID(container);
if (reactRootID) {
// If one exists, make sure it is a valid "reactRoot" ID.
reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID);
}
if (!reactRootID) {
// No valid "reactRoot" ID found, create one.
reactRootID = ReactInstanceHandles.createReactRootID();
}
containersByReactRootID[reactRootID] = container;
return reactRootID;
},
/**
* Unmounts and destroys the React component rendered in the `container`.
*
* @param {DOMElement} container DOM element containing a React component.
* @return {boolean} True if a component was found in and unmounted from
* `container`
*/
unmountComponentAtNode: function(container) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (Strictly speaking, unmounting won't cause a
// render but we still don't expect to be in a render call here.)
("production" !== "development" ? warning(
ReactCurrentOwner.current == null,
'unmountComponentAtNode(): Render methods should be a pure function of ' +
'props and state; triggering nested component updates from render is ' +
'not allowed. If necessary, trigger nested updates in ' +
'componentDidUpdate.'
) : null);
var reactRootID = getReactRootID(container);
var component = instancesByReactRootID[reactRootID];
if (!component) {
return false;
}
ReactMount.unmountComponentFromNode(component, container);
delete instancesByReactRootID[reactRootID];
delete containersByReactRootID[reactRootID];
if ("production" !== "development") {
delete rootElementsByReactRootID[reactRootID];
}
return true;
},
/**
* Unmounts a component and removes it from the DOM.
*
* @param {ReactComponent} instance React component instance.
* @param {DOMElement} container DOM element to unmount from.
* @final
* @internal
* @see {ReactMount.unmountComponentAtNode}
*/
unmountComponentFromNode: function(instance, container) {
instance.unmountComponent();
if (container.nodeType === DOC_NODE_TYPE) {
container = container.documentElement;
}
// http://jsperf.com/emptying-a-node
while (container.lastChild) {
container.removeChild(container.lastChild);
}
},
/**
* Finds the container DOM element that contains React component to which the
* supplied DOM `id` belongs.
*
* @param {string} id The ID of an element rendered by a React component.
* @return {?DOMElement} DOM element that contains the `id`.
*/
findReactContainerForID: function(id) {
var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id);
var container = containersByReactRootID[reactRootID];
if ("production" !== "development") {
var rootElement = rootElementsByReactRootID[reactRootID];
if (rootElement && rootElement.parentNode !== container) {
("production" !== "development" ? invariant(
// Call internalGetID here because getID calls isValid which calls
// findReactContainerForID (this function).
internalGetID(rootElement) === reactRootID,
'ReactMount: Root element ID differed from reactRootID.'
) : invariant(// Call internalGetID here because getID calls isValid which calls
// findReactContainerForID (this function).
internalGetID(rootElement) === reactRootID));
var containerChild = container.firstChild;
if (containerChild &&
reactRootID === internalGetID(containerChild)) {
// If the container has a new child with the same ID as the old
// root element, then rootElementsByReactRootID[reactRootID] is
// just stale and needs to be updated. The case that deserves a
// warning is when the container is empty.
rootElementsByReactRootID[reactRootID] = containerChild;
} else {
console.warn(
'ReactMount: Root element has been removed from its original ' +
'container. New container:', rootElement.parentNode
);
}
}
}
return container;
},
/**
* Finds an element rendered by React with the supplied ID.
*
* @param {string} id ID of a DOM node in the React component.
* @return {DOMElement} Root DOM node of the React component.
*/
findReactNodeByID: function(id) {
var reactRoot = ReactMount.findReactContainerForID(id);
return ReactMount.findComponentRoot(reactRoot, id);
},
/**
* True if the supplied `node` is rendered by React.
*
* @param {*} node DOM Element to check.
* @return {boolean} True if the DOM Element appears to be rendered by React.
* @internal
*/
isRenderedByReact: function(node) {
if (node.nodeType !== 1) {
// Not a DOMElement, therefore not a React component
return false;
}
var id = ReactMount.getID(node);
return id ? id.charAt(0) === SEPARATOR : false;
},
/**
* Traverses up the ancestors of the supplied node to find a node that is a
* DOM representation of a React component.
*
* @param {*} node
* @return {?DOMEventTarget}
* @internal
*/
getFirstReactDOM: function(node) {
var current = node;
while (current && current.parentNode !== current) {
if (ReactMount.isRenderedByReact(current)) {
return current;
}
current = current.parentNode;
}
return null;
},
/**
* Finds a node with the supplied `targetID` inside of the supplied
* `ancestorNode`. Exploits the ID naming scheme to perform the search
* quickly.
*
* @param {DOMEventTarget} ancestorNode Search from this root.
* @pararm {string} targetID ID of the DOM representation of the component.
* @return {DOMEventTarget} DOM node with the supplied `targetID`.
* @internal
*/
findComponentRoot: function(ancestorNode, targetID) {
var firstChildren = findComponentRootReusableArray;
var childIndex = 0;
var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode;
firstChildren[0] = deepestAncestor.firstChild;
firstChildren.length = 1;
while (childIndex < firstChildren.length) {
var child = firstChildren[childIndex++];
var targetChild;
while (child) {
var childID = ReactMount.getID(child);
if (childID) {
// Even if we find the node we're looking for, we finish looping
// through its siblings to ensure they're cached so that we don't have
// to revisit this node again. Otherwise, we make n^2 calls to getID
// when visiting the many children of a single node in order.
if (targetID === childID) {
targetChild = child;
} else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) {
// If we find a child whose ID is an ancestor of the given ID,
// then we can be sure that we only want to search the subtree
// rooted at this child, so we can throw out the rest of the
// search state.
firstChildren.length = childIndex = 0;
firstChildren.push(child.firstChild);
}
} else {
// If this child had no ID, then there's a chance that it was
// injected automatically by the browser, as when a `<table>`
// element sprouts an extra `<tbody>` child as a side effect of
// `.innerHTML` parsing. Optimistically continue down this
// branch, but not before examining the other siblings.
firstChildren.push(child.firstChild);
}
child = child.nextSibling;
}
if (targetChild) {
// Emptying firstChildren/findComponentRootReusableArray is
// not necessary for correctness, but it helps the GC reclaim
// any nodes that were left at the end of the search.
firstChildren.length = 0;
return targetChild;
}
}
firstChildren.length = 0;
("production" !== "development" ? invariant(
false,
'findComponentRoot(..., %s): Unable to find element. This probably ' +
'means the DOM was unexpectedly mutated (e.g., by the browser), ' +
'usually due to forgetting a <tbody> when using tables, nesting tags ' +
'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' +
'parent. ' +
'Try inspecting the child nodes of the element with React ID `%s`.',
targetID,
ReactMount.getID(ancestorNode)
) : invariant(false));
},
/**
* React ID utilities.
*/
getReactRootID: getReactRootID,
getID: getID,
setID: setID,
getNode: getNode,
purgeID: purgeID
};
// Deprecations (remove for 0.13)
ReactMount.renderComponent = deprecated(
'ReactMount',
'renderComponent',
'render',
this,
ReactMount.render
);
module.exports = ReactMount;
},{"./DOMProperty":11,"./ReactBrowserEventEmitter":30,"./ReactCurrentOwner":36,"./ReactElement":52,"./ReactInstanceHandles":60,"./ReactLegacyElement":61,"./ReactPerf":68,"./containsNode":101,"./deprecated":106,"./getReactRootElementInContainer":120,"./instantiateReactComponent":125,"./invariant":126,"./shouldUpdateReactComponent":142,"./warning":145}],64:[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.
*
* @providesModule ReactMultiChild
* @typechecks static-only
*/
"use strict";
var ReactComponent = _dereq_("./ReactComponent");
var ReactMultiChildUpdateTypes = _dereq_("./ReactMultiChildUpdateTypes");
var flattenChildren = _dereq_("./flattenChildren");
var instantiateReactComponent = _dereq_("./instantiateReactComponent");
var shouldUpdateReactComponent = _dereq_("./shouldUpdateReactComponent");
/**
* Updating children of a component may trigger recursive updates. The depth is
* used to batch recursive updates to render markup more efficiently.
*
* @type {number}
* @private
*/
var updateDepth = 0;
/**
* Queue of update configuration objects.
*
* Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.
*
* @type {array<object>}
* @private
*/
var updateQueue = [];
/**
* Queue of markup to be rendered.
*
* @type {array<string>}
* @private
*/
var markupQueue = [];
/**
* Enqueues markup to be rendered and inserted at a supplied index.
*
* @param {string} parentID ID of the parent component.
* @param {string} markup Markup that renders into an element.
* @param {number} toIndex Destination index.
* @private
*/
function enqueueMarkup(parentID, markup, toIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
markupIndex: markupQueue.push(markup) - 1,
textContent: null,
fromIndex: null,
toIndex: toIndex
});
}
/**
* Enqueues moving an existing element to another index.
*
* @param {string} parentID ID of the parent component.
* @param {number} fromIndex Source index of the existing element.
* @param {number} toIndex Destination index of the element.
* @private
*/
function enqueueMove(parentID, fromIndex, toIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
markupIndex: null,
textContent: null,
fromIndex: fromIndex,
toIndex: toIndex
});
}
/**
* Enqueues removing an element at an index.
*
* @param {string} parentID ID of the parent component.
* @param {number} fromIndex Index of the element to remove.
* @private
*/
function enqueueRemove(parentID, fromIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.REMOVE_NODE,
markupIndex: null,
textContent: null,
fromIndex: fromIndex,
toIndex: null
});
}
/**
* Enqueues setting the text content.
*
* @param {string} parentID ID of the parent component.
* @param {string} textContent Text content to set.
* @private
*/
function enqueueTextContent(parentID, textContent) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
markupIndex: null,
textContent: textContent,
fromIndex: null,
toIndex: null
});
}
/**
* Processes any enqueued updates.
*
* @private
*/
function processQueue() {
if (updateQueue.length) {
ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(
updateQueue,
markupQueue
);
clearQueue();
}
}
/**
* Clears any enqueued updates.
*
* @private
*/
function clearQueue() {
updateQueue.length = 0;
markupQueue.length = 0;
}
/**
* ReactMultiChild are capable of reconciling multiple children.
*
* @class ReactMultiChild
* @internal
*/
var ReactMultiChild = {
/**
* Provides common functionality for components that must reconcile multiple
* children. This is used by `ReactDOMComponent` to mount, update, and
* unmount child components.
*
* @lends {ReactMultiChild.prototype}
*/
Mixin: {
/**
* Generates a "mount image" for each of the supplied children. In the case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildren Nested child maps.
* @return {array} An array of mounted representations.
* @internal
*/
mountChildren: function(nestedChildren, transaction) {
var children = flattenChildren(nestedChildren);
var mountImages = [];
var index = 0;
this._renderedChildren = children;
for (var name in children) {
var child = children[name];
if (children.hasOwnProperty(name)) {
// The rendered children must be turned into instances as they're
// mounted.
var childInstance = instantiateReactComponent(child, null);
children[name] = childInstance;
// Inlined for performance, see `ReactInstanceHandles.createReactID`.
var rootID = this._rootNodeID + name;
var mountImage = childInstance.mountComponent(
rootID,
transaction,
this._mountDepth + 1
);
childInstance._mountIndex = index;
mountImages.push(mountImage);
index++;
}
}
return mountImages;
},
/**
* Replaces any rendered children with a text content string.
*
* @param {string} nextContent String of content.
* @internal
*/
updateTextContent: function(nextContent) {
updateDepth++;
var errorThrown = true;
try {
var prevChildren = this._renderedChildren;
// Remove any rendered children.
for (var name in prevChildren) {
if (prevChildren.hasOwnProperty(name)) {
this._unmountChildByName(prevChildren[name], name);
}
}
// Set new text content.
this.setTextContent(nextContent);
errorThrown = false;
} finally {
updateDepth--;
if (!updateDepth) {
errorThrown ? clearQueue() : processQueue();
}
}
},
/**
* Updates the rendered children with new children.
*
* @param {?object} nextNestedChildren Nested child maps.
* @param {ReactReconcileTransaction} transaction
* @internal
*/
updateChildren: function(nextNestedChildren, transaction) {
updateDepth++;
var errorThrown = true;
try {
this._updateChildren(nextNestedChildren, transaction);
errorThrown = false;
} finally {
updateDepth--;
if (!updateDepth) {
errorThrown ? clearQueue() : processQueue();
}
}
},
/**
* Improve performance by isolating this hot code path from the try/catch
* block in `updateChildren`.
*
* @param {?object} nextNestedChildren Nested child maps.
* @param {ReactReconcileTransaction} transaction
* @final
* @protected
*/
_updateChildren: function(nextNestedChildren, transaction) {
var nextChildren = flattenChildren(nextNestedChildren);
var prevChildren = this._renderedChildren;
if (!nextChildren && !prevChildren) {
return;
}
var name;
// `nextIndex` will increment for each child in `nextChildren`, but
// `lastIndex` will be the last index visited in `prevChildren`.
var lastIndex = 0;
var nextIndex = 0;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
var prevChild = prevChildren && prevChildren[name];
var prevElement = prevChild && prevChild._currentElement;
var nextElement = nextChildren[name];
if (shouldUpdateReactComponent(prevElement, nextElement)) {
this.moveChild(prevChild, nextIndex, lastIndex);
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
prevChild.receiveComponent(nextElement, transaction);
prevChild._mountIndex = nextIndex;
} else {
if (prevChild) {
// Update `lastIndex` before `_mountIndex` gets unset by unmounting.
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
this._unmountChildByName(prevChild, name);
}
// The child must be instantiated before it's mounted.
var nextChildInstance = instantiateReactComponent(
nextElement,
null
);
this._mountChildByNameAtIndex(
nextChildInstance, name, nextIndex, transaction
);
}
nextIndex++;
}
// Remove children that are no longer present.
for (name in prevChildren) {
if (prevChildren.hasOwnProperty(name) &&
!(nextChildren && nextChildren[name])) {
this._unmountChildByName(prevChildren[name], name);
}
}
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted.
*
* @internal
*/
unmountChildren: function() {
var renderedChildren = this._renderedChildren;
for (var name in renderedChildren) {
var renderedChild = renderedChildren[name];
// TODO: When is this not true?
if (renderedChild.unmountComponent) {
renderedChild.unmountComponent();
}
}
this._renderedChildren = null;
},
/**
* Moves a child component to the supplied index.
*
* @param {ReactComponent} child Component to move.
* @param {number} toIndex Destination index of the element.
* @param {number} lastIndex Last index visited of the siblings of `child`.
* @protected
*/
moveChild: function(child, toIndex, lastIndex) {
// If the index of `child` is less than `lastIndex`, then it needs to
// be moved. Otherwise, we do not need to move it because a child will be
// inserted or moved before `child`.
if (child._mountIndex < lastIndex) {
enqueueMove(this._rootNodeID, child._mountIndex, toIndex);
}
},
/**
* Creates a child component.
*
* @param {ReactComponent} child Component to create.
* @param {string} mountImage Markup to insert.
* @protected
*/
createChild: function(child, mountImage) {
enqueueMarkup(this._rootNodeID, mountImage, child._mountIndex);
},
/**
* Removes a child component.
*
* @param {ReactComponent} child Child to remove.
* @protected
*/
removeChild: function(child) {
enqueueRemove(this._rootNodeID, child._mountIndex);
},
/**
* Sets this text content string.
*
* @param {string} textContent Text content to set.
* @protected
*/
setTextContent: function(textContent) {
enqueueTextContent(this._rootNodeID, textContent);
},
/**
* Mounts a child with the supplied name.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to mount.
* @param {string} name Name of the child.
* @param {number} index Index at which to insert the child.
* @param {ReactReconcileTransaction} transaction
* @private
*/
_mountChildByNameAtIndex: function(child, name, index, transaction) {
// Inlined for performance, see `ReactInstanceHandles.createReactID`.
var rootID = this._rootNodeID + name;
var mountImage = child.mountComponent(
rootID,
transaction,
this._mountDepth + 1
);
child._mountIndex = index;
this.createChild(child, mountImage);
this._renderedChildren = this._renderedChildren || {};
this._renderedChildren[name] = child;
},
/**
* Unmounts a rendered child by name.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to unmount.
* @param {string} name Name of the child in `this._renderedChildren`.
* @private
*/
_unmountChildByName: function(child, name) {
this.removeChild(child);
child._mountIndex = null;
child.unmountComponent();
delete this._renderedChildren[name];
}
}
};
module.exports = ReactMultiChild;
},{"./ReactComponent":32,"./ReactMultiChildUpdateTypes":65,"./flattenChildren":110,"./instantiateReactComponent":125,"./shouldUpdateReactComponent":142}],65:[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.
*
* @providesModule ReactMultiChildUpdateTypes
*/
"use strict";
var keyMirror = _dereq_("./keyMirror");
/**
* When a component's children are updated, a series of update configuration
* objects are created in order to batch and serialize the required changes.
*
* Enumerates all the possible types of update configurations.
*
* @internal
*/
var ReactMultiChildUpdateTypes = keyMirror({
INSERT_MARKUP: null,
MOVE_EXISTING: null,
REMOVE_NODE: null,
TEXT_CONTENT: null
});
module.exports = ReactMultiChildUpdateTypes;
},{"./keyMirror":132}],66:[function(_dereq_,module,exports){
/**
* 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 ReactNativeComponent
*/
"use strict";
var assign = _dereq_("./Object.assign");
var invariant = _dereq_("./invariant");
var genericComponentClass = null;
// This registry keeps track of wrapper classes around native tags
var tagToComponentClass = {};
var ReactNativeComponentInjection = {
// This accepts a class that receives the tag string. This is a catch all
// that can render any kind of tag.
injectGenericComponentClass: function(componentClass) {
genericComponentClass = componentClass;
},
// This accepts a keyed object with classes as values. Each key represents a
// tag. That particular tag will use this class instead of the generic one.
injectComponentClasses: function(componentClasses) {
assign(tagToComponentClass, componentClasses);
}
};
/**
* Create an internal class for a specific tag.
*
* @param {string} tag The tag for which to create an internal instance.
* @param {any} props The props passed to the instance constructor.
* @return {ReactComponent} component The injected empty component.
*/
function createInstanceForTag(tag, props, parentType) {
var componentClass = tagToComponentClass[tag];
if (componentClass == null) {
("production" !== "development" ? invariant(
genericComponentClass,
'There is no registered component for the tag %s',
tag
) : invariant(genericComponentClass));
return new genericComponentClass(tag, props);
}
if (parentType === tag) {
// Avoid recursion
("production" !== "development" ? invariant(
genericComponentClass,
'There is no registered component for the tag %s',
tag
) : invariant(genericComponentClass));
return new genericComponentClass(tag, props);
}
// Unwrap legacy factories
return new componentClass.type(props);
}
var ReactNativeComponent = {
createInstanceForTag: createInstanceForTag,
injection: ReactNativeComponentInjection
};
module.exports = ReactNativeComponent;
},{"./Object.assign":27,"./invariant":126}],67:[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.
*
* @providesModule ReactOwner
*/
"use strict";
var emptyObject = _dereq_("./emptyObject");
var invariant = _dereq_("./invariant");
/**
* ReactOwners are capable of storing references to owned components.
*
* All components are capable of //being// referenced by owner components, but
* only ReactOwner components are capable of //referencing// owned components.
* The named reference is known as a "ref".
*
* Refs are available when mounted and updated during reconciliation.
*
* var MyComponent = React.createClass({
* render: function() {
* return (
* <div onClick={this.handleClick}>
* <CustomComponent ref="custom" />
* </div>
* );
* },
* handleClick: function() {
* this.refs.custom.handleClick();
* },
* componentDidMount: function() {
* this.refs.custom.initialize();
* }
* });
*
* Refs should rarely be used. When refs are used, they should only be done to
* control data that is not handled by React's data flow.
*
* @class ReactOwner
*/
var ReactOwner = {
/**
* @param {?object} object
* @return {boolean} True if `object` is a valid owner.
* @final
*/
isValidOwner: function(object) {
return !!(
object &&
typeof object.attachRef === 'function' &&
typeof object.detachRef === 'function'
);
},
/**
* Adds a component by ref to an owner component.
*
* @param {ReactComponent} component Component to reference.
* @param {string} ref Name by which to refer to the component.
* @param {ReactOwner} owner Component on which to record the ref.
* @final
* @internal
*/
addComponentAsRefTo: function(component, ref, owner) {
("production" !== "development" ? invariant(
ReactOwner.isValidOwner(owner),
'addComponentAsRefTo(...): Only a ReactOwner can have refs. This ' +
'usually means that you\'re trying to add a ref to a component that ' +
'doesn\'t have an owner (that is, was not created inside of another ' +
'component\'s `render` method). Try rendering this component inside of ' +
'a new top-level component which will hold the ref.'
) : invariant(ReactOwner.isValidOwner(owner)));
owner.attachRef(ref, component);
},
/**
* Removes a component by ref from an owner component.
*
* @param {ReactComponent} component Component to dereference.
* @param {string} ref Name of the ref to remove.
* @param {ReactOwner} owner Component on which the ref is recorded.
* @final
* @internal
*/
removeComponentAsRefFrom: function(component, ref, owner) {
("production" !== "development" ? invariant(
ReactOwner.isValidOwner(owner),
'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. This ' +
'usually means that you\'re trying to remove a ref to a component that ' +
'doesn\'t have an owner (that is, was not created inside of another ' +
'component\'s `render` method). Try rendering this component inside of ' +
'a new top-level component which will hold the ref.'
) : invariant(ReactOwner.isValidOwner(owner)));
// Check that `component` is still the current ref because we do not want to
// detach the ref if another component stole it.
if (owner.refs[ref] === component) {
owner.detachRef(ref);
}
},
/**
* A ReactComponent must mix this in to have refs.
*
* @lends {ReactOwner.prototype}
*/
Mixin: {
construct: function() {
this.refs = emptyObject;
},
/**
* Lazily allocates the refs object and stores `component` as `ref`.
*
* @param {string} ref Reference name.
* @param {component} component Component to store as `ref`.
* @final
* @private
*/
attachRef: function(ref, component) {
("production" !== "development" ? invariant(
component.isOwnedBy(this),
'attachRef(%s, ...): Only a component\'s owner can store a ref to it.',
ref
) : invariant(component.isOwnedBy(this)));
var refs = this.refs === emptyObject ? (this.refs = {}) : this.refs;
refs[ref] = component;
},
/**
* Detaches a reference name.
*
* @param {string} ref Name to dereference.
* @final
* @private
*/
detachRef: function(ref) {
delete this.refs[ref];
}
}
};
module.exports = ReactOwner;
},{"./emptyObject":108,"./invariant":126}],68:[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.
*
* @providesModule ReactPerf
* @typechecks static-only
*/
"use strict";
/**
* ReactPerf is a general AOP system designed to measure performance. This
* module only has the hooks: see ReactDefaultPerf for the analysis tool.
*/
var ReactPerf = {
/**
* Boolean to enable/disable measurement. Set to false by default to prevent
* accidental logging and perf loss.
*/
enableMeasure: false,
/**
* Holds onto the measure function in use. By default, don't measure
* anything, but we'll override this if we inject a measure function.
*/
storedMeasure: _noMeasure,
/**
* Use this to wrap methods you want to measure. Zero overhead in production.
*
* @param {string} objName
* @param {string} fnName
* @param {function} func
* @return {function}
*/
measure: function(objName, fnName, func) {
if ("production" !== "development") {
var measuredFunc = null;
var wrapper = function() {
if (ReactPerf.enableMeasure) {
if (!measuredFunc) {
measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
}
return measuredFunc.apply(this, arguments);
}
return func.apply(this, arguments);
};
wrapper.displayName = objName + '_' + fnName;
return wrapper;
}
return func;
},
injection: {
/**
* @param {function} measure
*/
injectMeasure: function(measure) {
ReactPerf.storedMeasure = measure;
}
}
};
/**
* Simply passes through the measured function, without measuring it.
*
* @param {string} objName
* @param {string} fnName
* @param {function} func
* @return {function}
*/
function _noMeasure(objName, fnName, func) {
return func;
}
module.exports = ReactPerf;
},{}],69:[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.
*
* @providesModule ReactPropTransferer
*/
"use strict";
var assign = _dereq_("./Object.assign");
var emptyFunction = _dereq_("./emptyFunction");
var invariant = _dereq_("./invariant");
var joinClasses = _dereq_("./joinClasses");
var warning = _dereq_("./warning");
var didWarn = false;
/**
* Creates a transfer strategy that will merge prop values using the supplied
* `mergeStrategy`. If a prop was previously unset, this just sets it.
*
* @param {function} mergeStrategy
* @return {function}
*/
function createTransferStrategy(mergeStrategy) {
return function(props, key, value) {
if (!props.hasOwnProperty(key)) {
props[key] = value;
} else {
props[key] = mergeStrategy(props[key], value);
}
};
}
var transferStrategyMerge = createTransferStrategy(function(a, b) {
// `merge` overrides the first object's (`props[key]` above) keys using the
// second object's (`value`) keys. An object's style's existing `propA` would
// get overridden. Flip the order here.
return assign({}, b, a);
});
/**
* Transfer strategies dictate how props are transferred by `transferPropsTo`.
* NOTE: if you add any more exceptions to this list you should be sure to
* update `cloneWithProps()` accordingly.
*/
var TransferStrategies = {
/**
* Never transfer `children`.
*/
children: emptyFunction,
/**
* Transfer the `className` prop by merging them.
*/
className: createTransferStrategy(joinClasses),
/**
* Transfer the `style` prop (which is an object) by merging them.
*/
style: transferStrategyMerge
};
/**
* Mutates the first argument by transferring the properties from the second
* argument.
*
* @param {object} props
* @param {object} newProps
* @return {object}
*/
function transferInto(props, newProps) {
for (var thisKey in newProps) {
if (!newProps.hasOwnProperty(thisKey)) {
continue;
}
var transferStrategy = TransferStrategies[thisKey];
if (transferStrategy && TransferStrategies.hasOwnProperty(thisKey)) {
transferStrategy(props, thisKey, newProps[thisKey]);
} else if (!props.hasOwnProperty(thisKey)) {
props[thisKey] = newProps[thisKey];
}
}
return props;
}
/**
* ReactPropTransferer are capable of transferring props to another component
* using a `transferPropsTo` method.
*
* @class ReactPropTransferer
*/
var ReactPropTransferer = {
TransferStrategies: TransferStrategies,
/**
* Merge two props objects using TransferStrategies.
*
* @param {object} oldProps original props (they take precedence)
* @param {object} newProps new props to merge in
* @return {object} a new object containing both sets of props merged.
*/
mergeProps: function(oldProps, newProps) {
return transferInto(assign({}, oldProps), newProps);
},
/**
* @lends {ReactPropTransferer.prototype}
*/
Mixin: {
/**
* Transfer props from this component to a target component.
*
* Props that do not have an explicit transfer strategy will be transferred
* only if the target component does not already have the prop set.
*
* This is usually used to pass down props to a returned root component.
*
* @param {ReactElement} element Component receiving the properties.
* @return {ReactElement} The supplied `component`.
* @final
* @protected
*/
transferPropsTo: function(element) {
("production" !== "development" ? invariant(
element._owner === this,
'%s: You can\'t call transferPropsTo() on a component that you ' +
'don\'t own, %s. This usually means you are calling ' +
'transferPropsTo() on a component passed in as props or children.',
this.constructor.displayName,
typeof element.type === 'string' ?
element.type :
element.type.displayName
) : invariant(element._owner === this));
if ("production" !== "development") {
if (!didWarn) {
didWarn = true;
("production" !== "development" ? warning(
false,
'transferPropsTo is deprecated. ' +
'See http://fb.me/react-transferpropsto for more information.'
) : null);
}
}
// Because elements are immutable we have to merge into the existing
// props object rather than clone it.
transferInto(element.props, this.props);
return element;
}
}
};
module.exports = ReactPropTransferer;
},{"./Object.assign":27,"./emptyFunction":107,"./invariant":126,"./joinClasses":131,"./warning":145}],70:[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.
*
* @providesModule ReactPropTypeLocationNames
*/
"use strict";
var ReactPropTypeLocationNames = {};
if ("production" !== "development") {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
},{}],71:[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.
*
* @providesModule ReactPropTypeLocations
*/
"use strict";
var keyMirror = _dereq_("./keyMirror");
var ReactPropTypeLocations = keyMirror({
prop: null,
context: null,
childContext: null
});
module.exports = ReactPropTypeLocations;
},{"./keyMirror":132}],72:[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.
*
* @providesModule ReactPropTypes
*/
"use strict";
var ReactElement = _dereq_("./ReactElement");
var ReactPropTypeLocationNames = _dereq_("./ReactPropTypeLocationNames");
var deprecated = _dereq_("./deprecated");
var emptyFunction = _dereq_("./emptyFunction");
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
var elementTypeChecker = createElementTypeChecker();
var nodeTypeChecker = createNodeChecker();
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: elementTypeChecker,
instanceOf: createInstanceTypeChecker,
node: nodeTypeChecker,
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker,
component: deprecated(
'React.PropTypes',
'component',
'element',
this,
elementTypeChecker
),
renderable: deprecated(
'React.PropTypes',
'renderable',
'node',
this,
nodeTypeChecker
)
};
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName, location) {
componentName = componentName || ANONYMOUS;
if (props[propName] == null) {
var locationName = ReactPropTypeLocationNames[location];
if (isRequired) {
return new Error(
("Required " + locationName + " `" + propName + "` was not specified in ")+
("`" + componentName + "`.")
);
}
} else {
return validate(props, propName, componentName, location);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
var locationName = ReactPropTypeLocationNames[location];
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new Error(
("Invalid " + locationName + " `" + propName + "` of type `" + preciseType + "` ") +
("supplied to `" + componentName + "`, expected `" + expectedType + "`.")
);
}
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturns());
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location) {
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var locationName = ReactPropTypeLocationNames[location];
var propType = getPropType(propValue);
return new Error(
("Invalid " + locationName + " `" + propName + "` of type ") +
("`" + propType + "` supplied to `" + componentName + "`, expected an array.")
);
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location);
if (error instanceof Error) {
return error;
}
}
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location) {
if (!ReactElement.isValidElement(props[propName])) {
var locationName = ReactPropTypeLocationNames[location];
return new Error(
("Invalid " + locationName + " `" + propName + "` supplied to ") +
("`" + componentName + "`, expected a ReactElement.")
);
}
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location) {
if (!(props[propName] instanceof expectedClass)) {
var locationName = ReactPropTypeLocationNames[location];
var expectedClassName = expectedClass.name || ANONYMOUS;
return new Error(
("Invalid " + locationName + " `" + propName + "` supplied to ") +
("`" + componentName + "`, expected instance of `" + expectedClassName + "`.")
);
}
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
function validate(props, propName, componentName, location) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (propValue === expectedValues[i]) {
return;
}
}
var locationName = ReactPropTypeLocationNames[location];
var valuesString = JSON.stringify(expectedValues);
return new Error(
("Invalid " + locationName + " `" + propName + "` of value `" + propValue + "` ") +
("supplied to `" + componentName + "`, expected one of " + valuesString + ".")
);
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
var locationName = ReactPropTypeLocationNames[location];
return new Error(
("Invalid " + locationName + " `" + propName + "` of type ") +
("`" + propType + "` supplied to `" + componentName + "`, expected an object.")
);
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location);
if (error instanceof Error) {
return error;
}
}
}
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
function validate(props, propName, componentName, location) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location) == null) {
return;
}
}
var locationName = ReactPropTypeLocationNames[location];
return new Error(
("Invalid " + locationName + " `" + propName + "` supplied to ") +
("`" + componentName + "`.")
);
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location) {
if (!isNode(props[propName])) {
var locationName = ReactPropTypeLocationNames[location];
return new Error(
("Invalid " + locationName + " `" + propName + "` supplied to ") +
("`" + componentName + "`, expected a ReactNode.")
);
}
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
var locationName = ReactPropTypeLocationNames[location];
return new Error(
("Invalid " + locationName + " `" + propName + "` of type `" + propType + "` ") +
("supplied to `" + componentName + "`, expected `object`.")
);
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location);
if (error) {
return error;
}
}
}
return createChainableTypeChecker(validate, 'expected `object`');
}
function isNode(propValue) {
switch(typeof propValue) {
case 'number':
case 'string':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (ReactElement.isValidElement(propValue)) {
return true;
}
for (var k in propValue) {
if (!isNode(propValue[k])) {
return false;
}
}
return true;
default:
return false;
}
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
module.exports = ReactPropTypes;
},{"./ReactElement":52,"./ReactPropTypeLocationNames":70,"./deprecated":106,"./emptyFunction":107}],73:[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.
*
* @providesModule ReactPutListenerQueue
*/
"use strict";
var PooledClass = _dereq_("./PooledClass");
var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter");
var assign = _dereq_("./Object.assign");
function ReactPutListenerQueue() {
this.listenersToPut = [];
}
assign(ReactPutListenerQueue.prototype, {
enqueuePutListener: function(rootNodeID, propKey, propValue) {
this.listenersToPut.push({
rootNodeID: rootNodeID,
propKey: propKey,
propValue: propValue
});
},
putListeners: function() {
for (var i = 0; i < this.listenersToPut.length; i++) {
var listenerToPut = this.listenersToPut[i];
ReactBrowserEventEmitter.putListener(
listenerToPut.rootNodeID,
listenerToPut.propKey,
listenerToPut.propValue
);
}
},
reset: function() {
this.listenersToPut.length = 0;
},
destructor: function() {
this.reset();
}
});
PooledClass.addPoolingTo(ReactPutListenerQueue);
module.exports = ReactPutListenerQueue;
},{"./Object.assign":27,"./PooledClass":28,"./ReactBrowserEventEmitter":30}],74:[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.
*
* @providesModule ReactReconcileTransaction
* @typechecks static-only
*/
"use strict";
var CallbackQueue = _dereq_("./CallbackQueue");
var PooledClass = _dereq_("./PooledClass");
var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter");
var ReactInputSelection = _dereq_("./ReactInputSelection");
var ReactPutListenerQueue = _dereq_("./ReactPutListenerQueue");
var Transaction = _dereq_("./Transaction");
var assign = _dereq_("./Object.assign");
/**
* Ensures that, when possible, the selection range (currently selected text
* input) is not disturbed by performing the transaction.
*/
var SELECTION_RESTORATION = {
/**
* @return {Selection} Selection information.
*/
initialize: ReactInputSelection.getSelectionInformation,
/**
* @param {Selection} sel Selection information returned from `initialize`.
*/
close: ReactInputSelection.restoreSelection
};
/**
* Suppresses events (blur/focus) that could be inadvertently dispatched due to
* high level DOM manipulations (like temporarily removing a text input from the
* DOM).
*/
var EVENT_SUPPRESSION = {
/**
* @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
* the reconciliation.
*/
initialize: function() {
var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
ReactBrowserEventEmitter.setEnabled(false);
return currentlyEnabled;
},
/**
* @param {boolean} previouslyEnabled Enabled status of
* `ReactBrowserEventEmitter` before the reconciliation occured. `close`
* restores the previous value.
*/
close: function(previouslyEnabled) {
ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
}
};
/**
* Provides a queue for collecting `componentDidMount` and
* `componentDidUpdate` callbacks during the the transaction.
*/
var ON_DOM_READY_QUEUEING = {
/**
* Initializes the internal `onDOMReady` queue.
*/
initialize: function() {
this.reactMountReady.reset();
},
/**
* After DOM is flushed, invoke all registered `onDOMReady` callbacks.
*/
close: function() {
this.reactMountReady.notifyAll();
}
};
var PUT_LISTENER_QUEUEING = {
initialize: function() {
this.putListenerQueue.reset();
},
close: function() {
this.putListenerQueue.putListeners();
}
};
/**
* Executed within the scope of the `Transaction` instance. Consider these as
* being member methods, but with an implied ordering while being isolated from
* each other.
*/
var TRANSACTION_WRAPPERS = [
PUT_LISTENER_QUEUEING,
SELECTION_RESTORATION,
EVENT_SUPPRESSION,
ON_DOM_READY_QUEUEING
];
/**
* Currently:
* - The order that these are listed in the transaction is critical:
* - Suppresses events.
* - Restores selection range.
*
* Future:
* - Restore document/overflow scroll positions that were unintentionally
* modified via DOM insertions above the top viewport boundary.
* - Implement/integrate with customized constraint based layout system and keep
* track of which dimensions must be remeasured.
*
* @class ReactReconcileTransaction
*/
function ReactReconcileTransaction() {
this.reinitializeTransaction();
// Only server-side rendering really needs this option (see
// `ReactServerRendering`), but server-side uses
// `ReactServerRenderingTransaction` instead. This option is here so that it's
// accessible and defaults to false when `ReactDOMComponent` and
// `ReactTextComponent` checks it in `mountComponent`.`
this.renderToStaticMarkup = false;
this.reactMountReady = CallbackQueue.getPooled(null);
this.putListenerQueue = ReactPutListenerQueue.getPooled();
}
var Mixin = {
/**
* @see Transaction
* @abstract
* @final
* @return {array<object>} List of operation wrap proceedures.
* TODO: convert to array<TransactionWrapper>
*/
getTransactionWrappers: function() {
return TRANSACTION_WRAPPERS;
},
/**
* @return {object} The queue to collect `onDOMReady` callbacks with.
*/
getReactMountReady: function() {
return this.reactMountReady;
},
getPutListenerQueue: function() {
return this.putListenerQueue;
},
/**
* `PooledClass` looks for this, and will invoke this before allowing this
* instance to be resused.
*/
destructor: function() {
CallbackQueue.release(this.reactMountReady);
this.reactMountReady = null;
ReactPutListenerQueue.release(this.putListenerQueue);
this.putListenerQueue = null;
}
};
assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
PooledClass.addPoolingTo(ReactReconcileTransaction);
module.exports = ReactReconcileTransaction;
},{"./CallbackQueue":6,"./Object.assign":27,"./PooledClass":28,"./ReactBrowserEventEmitter":30,"./ReactInputSelection":59,"./ReactPutListenerQueue":73,"./Transaction":95}],75:[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.
*
* @providesModule ReactRootIndex
* @typechecks
*/
"use strict";
var ReactRootIndexInjection = {
/**
* @param {function} _createReactRootIndex
*/
injectCreateReactRootIndex: function(_createReactRootIndex) {
ReactRootIndex.createReactRootIndex = _createReactRootIndex;
}
};
var ReactRootIndex = {
createReactRootIndex: null,
injection: ReactRootIndexInjection
};
module.exports = ReactRootIndex;
},{}],76:[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.
*
* @typechecks static-only
* @providesModule ReactServerRendering
*/
"use strict";
var ReactElement = _dereq_("./ReactElement");
var ReactInstanceHandles = _dereq_("./ReactInstanceHandles");
var ReactMarkupChecksum = _dereq_("./ReactMarkupChecksum");
var ReactServerRenderingTransaction =
_dereq_("./ReactServerRenderingTransaction");
var instantiateReactComponent = _dereq_("./instantiateReactComponent");
var invariant = _dereq_("./invariant");
/**
* @param {ReactElement} element
* @return {string} the HTML markup
*/
function renderToString(element) {
("production" !== "development" ? invariant(
ReactElement.isValidElement(element),
'renderToString(): You must pass a valid ReactElement.'
) : invariant(ReactElement.isValidElement(element)));
var transaction;
try {
var id = ReactInstanceHandles.createReactRootID();
transaction = ReactServerRenderingTransaction.getPooled(false);
return transaction.perform(function() {
var componentInstance = instantiateReactComponent(element, null);
var markup = componentInstance.mountComponent(id, transaction, 0);
return ReactMarkupChecksum.addChecksumToMarkup(markup);
}, null);
} finally {
ReactServerRenderingTransaction.release(transaction);
}
}
/**
* @param {ReactElement} element
* @return {string} the HTML markup, without the extra React ID and checksum
* (for generating static pages)
*/
function renderToStaticMarkup(element) {
("production" !== "development" ? invariant(
ReactElement.isValidElement(element),
'renderToStaticMarkup(): You must pass a valid ReactElement.'
) : invariant(ReactElement.isValidElement(element)));
var transaction;
try {
var id = ReactInstanceHandles.createReactRootID();
transaction = ReactServerRenderingTransaction.getPooled(true);
return transaction.perform(function() {
var componentInstance = instantiateReactComponent(element, null);
return componentInstance.mountComponent(id, transaction, 0);
}, null);
} finally {
ReactServerRenderingTransaction.release(transaction);
}
}
module.exports = {
renderToString: renderToString,
renderToStaticMarkup: renderToStaticMarkup
};
},{"./ReactElement":52,"./ReactInstanceHandles":60,"./ReactMarkupChecksum":62,"./ReactServerRenderingTransaction":77,"./instantiateReactComponent":125,"./invariant":126}],77:[function(_dereq_,module,exports){
/**
* 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 ReactServerRenderingTransaction
* @typechecks
*/
"use strict";
var PooledClass = _dereq_("./PooledClass");
var CallbackQueue = _dereq_("./CallbackQueue");
var ReactPutListenerQueue = _dereq_("./ReactPutListenerQueue");
var Transaction = _dereq_("./Transaction");
var assign = _dereq_("./Object.assign");
var emptyFunction = _dereq_("./emptyFunction");
/**
* Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks
* during the performing of the transaction.
*/
var ON_DOM_READY_QUEUEING = {
/**
* Initializes the internal `onDOMReady` queue.
*/
initialize: function() {
this.reactMountReady.reset();
},
close: emptyFunction
};
var PUT_LISTENER_QUEUEING = {
initialize: function() {
this.putListenerQueue.reset();
},
close: emptyFunction
};
/**
* Executed within the scope of the `Transaction` instance. Consider these as
* being member methods, but with an implied ordering while being isolated from
* each other.
*/
var TRANSACTION_WRAPPERS = [
PUT_LISTENER_QUEUEING,
ON_DOM_READY_QUEUEING
];
/**
* @class ReactServerRenderingTransaction
* @param {boolean} renderToStaticMarkup
*/
function ReactServerRenderingTransaction(renderToStaticMarkup) {
this.reinitializeTransaction();
this.renderToStaticMarkup = renderToStaticMarkup;
this.reactMountReady = CallbackQueue.getPooled(null);
this.putListenerQueue = ReactPutListenerQueue.getPooled();
}
var Mixin = {
/**
* @see Transaction
* @abstract
* @final
* @return {array} Empty list of operation wrap proceedures.
*/
getTransactionWrappers: function() {
return TRANSACTION_WRAPPERS;
},
/**
* @return {object} The queue to collect `onDOMReady` callbacks with.
*/
getReactMountReady: function() {
return this.reactMountReady;
},
getPutListenerQueue: function() {
return this.putListenerQueue;
},
/**
* `PooledClass` looks for this, and will invoke this before allowing this
* instance to be resused.
*/
destructor: function() {
CallbackQueue.release(this.reactMountReady);
this.reactMountReady = null;
ReactPutListenerQueue.release(this.putListenerQueue);
this.putListenerQueue = null;
}
};
assign(
ReactServerRenderingTransaction.prototype,
Transaction.Mixin,
Mixin
);
PooledClass.addPoolingTo(ReactServerRenderingTransaction);
module.exports = ReactServerRenderingTransaction;
},{"./CallbackQueue":6,"./Object.assign":27,"./PooledClass":28,"./ReactPutListenerQueue":73,"./Transaction":95,"./emptyFunction":107}],78:[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.
*
* @providesModule ReactTextComponent
* @typechecks static-only
*/
"use strict";
var DOMPropertyOperations = _dereq_("./DOMPropertyOperations");
var ReactComponent = _dereq_("./ReactComponent");
var ReactElement = _dereq_("./ReactElement");
var assign = _dereq_("./Object.assign");
var escapeTextForBrowser = _dereq_("./escapeTextForBrowser");
/**
* Text nodes violate a couple assumptions that React makes about components:
*
* - When mounting text into the DOM, adjacent text nodes are merged.
* - Text nodes cannot be assigned a React root ID.
*
* This component is used to wrap strings in elements so that they can undergo
* the same reconciliation that is applied to elements.
*
* TODO: Investigate representing React components in the DOM with text nodes.
*
* @class ReactTextComponent
* @extends ReactComponent
* @internal
*/
var ReactTextComponent = function(props) {
// This constructor and it's argument is currently used by mocks.
};
assign(ReactTextComponent.prototype, ReactComponent.Mixin, {
/**
* Creates the markup for this text node. This node is not intended to have
* any features besides containing text content.
*
* @param {string} rootID DOM ID of the root node.
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {number} mountDepth number of components in the owner hierarchy
* @return {string} Markup for this text node.
* @internal
*/
mountComponent: function(rootID, transaction, mountDepth) {
ReactComponent.Mixin.mountComponent.call(
this,
rootID,
transaction,
mountDepth
);
var escapedText = escapeTextForBrowser(this.props);
if (transaction.renderToStaticMarkup) {
// Normally we'd wrap this in a `span` for the reasons stated above, but
// since this is a situation where React won't take over (static pages),
// we can simply return the text as it is.
return escapedText;
}
return (
'<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' +
escapedText +
'</span>'
);
},
/**
* Updates this component by updating the text content.
*
* @param {object} nextComponent Contains the next text content.
* @param {ReactReconcileTransaction} transaction
* @internal
*/
receiveComponent: function(nextComponent, transaction) {
var nextProps = nextComponent.props;
if (nextProps !== this.props) {
this.props = nextProps;
ReactComponent.BackendIDOperations.updateTextContentByID(
this._rootNodeID,
nextProps
);
}
}
});
var ReactTextComponentFactory = function(text) {
// Bypass validation and configuration
return new ReactElement(ReactTextComponent, null, null, null, null, text);
};
ReactTextComponentFactory.type = ReactTextComponent;
module.exports = ReactTextComponentFactory;
},{"./DOMPropertyOperations":12,"./Object.assign":27,"./ReactComponent":32,"./ReactElement":52,"./escapeTextForBrowser":109}],79:[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.
*
* @providesModule ReactUpdates
*/
"use strict";
var CallbackQueue = _dereq_("./CallbackQueue");
var PooledClass = _dereq_("./PooledClass");
var ReactCurrentOwner = _dereq_("./ReactCurrentOwner");
var ReactPerf = _dereq_("./ReactPerf");
var Transaction = _dereq_("./Transaction");
var assign = _dereq_("./Object.assign");
var invariant = _dereq_("./invariant");
var warning = _dereq_("./warning");
var dirtyComponents = [];
var asapCallbackQueue = CallbackQueue.getPooled();
var asapEnqueued = false;
var batchingStrategy = null;
function ensureInjected() {
("production" !== "development" ? invariant(
ReactUpdates.ReactReconcileTransaction && batchingStrategy,
'ReactUpdates: must inject a reconcile transaction class and batching ' +
'strategy'
) : invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy));
}
var NESTED_UPDATES = {
initialize: function() {
this.dirtyComponentsLength = dirtyComponents.length;
},
close: function() {
if (this.dirtyComponentsLength !== dirtyComponents.length) {
// Additional updates were enqueued by componentDidUpdate handlers or
// similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
// these new updates so that if A's componentDidUpdate calls setState on
// B, B will update before the callback A's updater provided when calling
// setState.
dirtyComponents.splice(0, this.dirtyComponentsLength);
flushBatchedUpdates();
} else {
dirtyComponents.length = 0;
}
}
};
var UPDATE_QUEUEING = {
initialize: function() {
this.callbackQueue.reset();
},
close: function() {
this.callbackQueue.notifyAll();
}
};
var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
function ReactUpdatesFlushTransaction() {
this.reinitializeTransaction();
this.dirtyComponentsLength = null;
this.callbackQueue = CallbackQueue.getPooled();
this.reconcileTransaction =
ReactUpdates.ReactReconcileTransaction.getPooled();
}
assign(
ReactUpdatesFlushTransaction.prototype,
Transaction.Mixin, {
getTransactionWrappers: function() {
return TRANSACTION_WRAPPERS;
},
destructor: function() {
this.dirtyComponentsLength = null;
CallbackQueue.release(this.callbackQueue);
this.callbackQueue = null;
ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
this.reconcileTransaction = null;
},
perform: function(method, scope, a) {
// Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
// with this transaction's wrappers around it.
return Transaction.Mixin.perform.call(
this,
this.reconcileTransaction.perform,
this.reconcileTransaction,
method,
scope,
a
);
}
});
PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
function batchedUpdates(callback, a, b) {
ensureInjected();
batchingStrategy.batchedUpdates(callback, a, b);
}
/**
* Array comparator for ReactComponents by owner depth
*
* @param {ReactComponent} c1 first component you're comparing
* @param {ReactComponent} c2 second component you're comparing
* @return {number} Return value usable by Array.prototype.sort().
*/
function mountDepthComparator(c1, c2) {
return c1._mountDepth - c2._mountDepth;
}
function runBatchedUpdates(transaction) {
var len = transaction.dirtyComponentsLength;
("production" !== "development" ? invariant(
len === dirtyComponents.length,
'Expected flush transaction\'s stored dirty-components length (%s) to ' +
'match dirty-components array length (%s).',
len,
dirtyComponents.length
) : invariant(len === dirtyComponents.length));
// Since reconciling a component higher in the owner hierarchy usually (not
// always -- see shouldComponentUpdate()) will reconcile children, reconcile
// them before their children by sorting the array.
dirtyComponents.sort(mountDepthComparator);
for (var i = 0; i < len; i++) {
// If a component is unmounted before pending changes apply, ignore them
// TODO: Queue unmounts in the same list to avoid this happening at all
var component = dirtyComponents[i];
if (component.isMounted()) {
// If performUpdateIfNecessary happens to enqueue any new updates, we
// shouldn't execute the callbacks until the next render happens, so
// stash the callbacks first
var callbacks = component._pendingCallbacks;
component._pendingCallbacks = null;
component.performUpdateIfNecessary(transaction.reconcileTransaction);
if (callbacks) {
for (var j = 0; j < callbacks.length; j++) {
transaction.callbackQueue.enqueue(
callbacks[j],
component
);
}
}
}
}
}
var flushBatchedUpdates = ReactPerf.measure(
'ReactUpdates',
'flushBatchedUpdates',
function() {
// ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
// array and perform any updates enqueued by mount-ready handlers (i.e.,
// componentDidUpdate) but we need to check here too in order to catch
// updates enqueued by setState callbacks and asap calls.
while (dirtyComponents.length || asapEnqueued) {
if (dirtyComponents.length) {
var transaction = ReactUpdatesFlushTransaction.getPooled();
transaction.perform(runBatchedUpdates, null, transaction);
ReactUpdatesFlushTransaction.release(transaction);
}
if (asapEnqueued) {
asapEnqueued = false;
var queue = asapCallbackQueue;
asapCallbackQueue = CallbackQueue.getPooled();
queue.notifyAll();
CallbackQueue.release(queue);
}
}
}
);
/**
* Mark a component as needing a rerender, adding an optional callback to a
* list of functions which will be executed once the rerender occurs.
*/
function enqueueUpdate(component, callback) {
("production" !== "development" ? invariant(
!callback || typeof callback === "function",
'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +
'`setState`, `replaceState`, or `forceUpdate` with a callback that ' +
'isn\'t callable.'
) : invariant(!callback || typeof callback === "function"));
ensureInjected();
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (This is called by each top-level update
// function, like setProps, setState, forceUpdate, etc.; creation and
// destruction of top-level components is guarded in ReactMount.)
("production" !== "development" ? warning(
ReactCurrentOwner.current == null,
'enqueueUpdate(): Render methods should be a pure function of props ' +
'and state; triggering nested component updates from render is not ' +
'allowed. If necessary, trigger nested updates in ' +
'componentDidUpdate.'
) : null);
if (!batchingStrategy.isBatchingUpdates) {
batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);
return;
}
dirtyComponents.push(component);
if (callback) {
if (component._pendingCallbacks) {
component._pendingCallbacks.push(callback);
} else {
component._pendingCallbacks = [callback];
}
}
}
/**
* Enqueue a callback to be run at the end of the current batching cycle. Throws
* if no updates are currently being performed.
*/
function asap(callback, context) {
("production" !== "development" ? invariant(
batchingStrategy.isBatchingUpdates,
'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' +
'updates are not being batched.'
) : invariant(batchingStrategy.isBatchingUpdates));
asapCallbackQueue.enqueue(callback, context);
asapEnqueued = true;
}
var ReactUpdatesInjection = {
injectReconcileTransaction: function(ReconcileTransaction) {
("production" !== "development" ? invariant(
ReconcileTransaction,
'ReactUpdates: must provide a reconcile transaction class'
) : invariant(ReconcileTransaction));
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
},
injectBatchingStrategy: function(_batchingStrategy) {
("production" !== "development" ? invariant(
_batchingStrategy,
'ReactUpdates: must provide a batching strategy'
) : invariant(_batchingStrategy));
("production" !== "development" ? invariant(
typeof _batchingStrategy.batchedUpdates === 'function',
'ReactUpdates: must provide a batchedUpdates() function'
) : invariant(typeof _batchingStrategy.batchedUpdates === 'function'));
("production" !== "development" ? invariant(
typeof _batchingStrategy.isBatchingUpdates === 'boolean',
'ReactUpdates: must provide an isBatchingUpdates boolean attribute'
) : invariant(typeof _batchingStrategy.isBatchingUpdates === 'boolean'));
batchingStrategy = _batchingStrategy;
}
};
var ReactUpdates = {
/**
* React references `ReactReconcileTransaction` using this property in order
* to allow dependency injection.
*
* @internal
*/
ReactReconcileTransaction: null,
batchedUpdates: batchedUpdates,
enqueueUpdate: enqueueUpdate,
flushBatchedUpdates: flushBatchedUpdates,
injection: ReactUpdatesInjection,
asap: asap
};
module.exports = ReactUpdates;
},{"./CallbackQueue":6,"./Object.assign":27,"./PooledClass":28,"./ReactCurrentOwner":36,"./ReactPerf":68,"./Transaction":95,"./invariant":126,"./warning":145}],80:[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.
*
* @providesModule SVGDOMPropertyConfig
*/
/*jslint bitwise: true*/
"use strict";
var DOMProperty = _dereq_("./DOMProperty");
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
var SVGDOMPropertyConfig = {
Properties: {
cx: MUST_USE_ATTRIBUTE,
cy: MUST_USE_ATTRIBUTE,
d: MUST_USE_ATTRIBUTE,
dx: MUST_USE_ATTRIBUTE,
dy: MUST_USE_ATTRIBUTE,
fill: MUST_USE_ATTRIBUTE,
fillOpacity: MUST_USE_ATTRIBUTE,
fontFamily: MUST_USE_ATTRIBUTE,
fontSize: MUST_USE_ATTRIBUTE,
fx: MUST_USE_ATTRIBUTE,
fy: MUST_USE_ATTRIBUTE,
gradientTransform: MUST_USE_ATTRIBUTE,
gradientUnits: MUST_USE_ATTRIBUTE,
markerEnd: MUST_USE_ATTRIBUTE,
markerMid: MUST_USE_ATTRIBUTE,
markerStart: MUST_USE_ATTRIBUTE,
offset: MUST_USE_ATTRIBUTE,
opacity: MUST_USE_ATTRIBUTE,
patternContentUnits: MUST_USE_ATTRIBUTE,
patternUnits: MUST_USE_ATTRIBUTE,
points: MUST_USE_ATTRIBUTE,
preserveAspectRatio: MUST_USE_ATTRIBUTE,
r: MUST_USE_ATTRIBUTE,
rx: MUST_USE_ATTRIBUTE,
ry: MUST_USE_ATTRIBUTE,
spreadMethod: MUST_USE_ATTRIBUTE,
stopColor: MUST_USE_ATTRIBUTE,
stopOpacity: MUST_USE_ATTRIBUTE,
stroke: MUST_USE_ATTRIBUTE,
strokeDasharray: MUST_USE_ATTRIBUTE,
strokeLinecap: MUST_USE_ATTRIBUTE,
strokeOpacity: MUST_USE_ATTRIBUTE,
strokeWidth: MUST_USE_ATTRIBUTE,
textAnchor: MUST_USE_ATTRIBUTE,
transform: MUST_USE_ATTRIBUTE,
version: MUST_USE_ATTRIBUTE,
viewBox: MUST_USE_ATTRIBUTE,
x1: MUST_USE_ATTRIBUTE,
x2: MUST_USE_ATTRIBUTE,
x: MUST_USE_ATTRIBUTE,
y1: MUST_USE_ATTRIBUTE,
y2: MUST_USE_ATTRIBUTE,
y: MUST_USE_ATTRIBUTE
},
DOMAttributeNames: {
fillOpacity: 'fill-opacity',
fontFamily: 'font-family',
fontSize: 'font-size',
gradientTransform: 'gradientTransform',
gradientUnits: 'gradientUnits',
markerEnd: 'marker-end',
markerMid: 'marker-mid',
markerStart: 'marker-start',
patternContentUnits: 'patternContentUnits',
patternUnits: 'patternUnits',
preserveAspectRatio: 'preserveAspectRatio',
spreadMethod: 'spreadMethod',
stopColor: 'stop-color',
stopOpacity: 'stop-opacity',
strokeDasharray: 'stroke-dasharray',
strokeLinecap: 'stroke-linecap',
strokeOpacity: 'stroke-opacity',
strokeWidth: 'stroke-width',
textAnchor: 'text-anchor',
viewBox: 'viewBox'
}
};
module.exports = SVGDOMPropertyConfig;
},{"./DOMProperty":11}],81:[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.
*
* @providesModule SelectEventPlugin
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var EventPropagators = _dereq_("./EventPropagators");
var ReactInputSelection = _dereq_("./ReactInputSelection");
var SyntheticEvent = _dereq_("./SyntheticEvent");
var getActiveElement = _dereq_("./getActiveElement");
var isTextInputElement = _dereq_("./isTextInputElement");
var keyOf = _dereq_("./keyOf");
var shallowEqual = _dereq_("./shallowEqual");
var topLevelTypes = EventConstants.topLevelTypes;
var eventTypes = {
select: {
phasedRegistrationNames: {
bubbled: keyOf({onSelect: null}),
captured: keyOf({onSelectCapture: null})
},
dependencies: [
topLevelTypes.topBlur,
topLevelTypes.topContextMenu,
topLevelTypes.topFocus,
topLevelTypes.topKeyDown,
topLevelTypes.topMouseDown,
topLevelTypes.topMouseUp,
topLevelTypes.topSelectionChange
]
}
};
var activeElement = null;
var activeElementID = null;
var lastSelection = null;
var mouseDown = false;
/**
* Get an object which is a unique representation of the current selection.
*
* The return value will not be consistent across nodes or browsers, but
* two identical selections on the same node will return identical objects.
*
* @param {DOMElement} node
* @param {object}
*/
function getSelection(node) {
if ('selectionStart' in node &&
ReactInputSelection.hasSelectionCapabilities(node)) {
return {
start: node.selectionStart,
end: node.selectionEnd
};
} else if (window.getSelection) {
var selection = window.getSelection();
return {
anchorNode: selection.anchorNode,
anchorOffset: selection.anchorOffset,
focusNode: selection.focusNode,
focusOffset: selection.focusOffset
};
} else if (document.selection) {
var range = document.selection.createRange();
return {
parentElement: range.parentElement(),
text: range.text,
top: range.boundingTop,
left: range.boundingLeft
};
}
}
/**
* Poll selection to see whether it's changed.
*
* @param {object} nativeEvent
* @return {?SyntheticEvent}
*/
function constructSelectEvent(nativeEvent) {
// Ensure we have the right element, and that the user is not dragging a
// selection (this matches native `select` event behavior). In HTML5, select
// fires only on input and textarea thus if there's no focused element we
// won't dispatch.
if (mouseDown ||
activeElement == null ||
activeElement != getActiveElement()) {
return;
}
// Only fire when selection has actually changed.
var currentSelection = getSelection(activeElement);
if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
lastSelection = currentSelection;
var syntheticEvent = SyntheticEvent.getPooled(
eventTypes.select,
activeElementID,
nativeEvent
);
syntheticEvent.type = 'select';
syntheticEvent.target = activeElement;
EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
return syntheticEvent;
}
}
/**
* This plugin creates an `onSelect` event that normalizes select events
* across form elements.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - contentEditable
*
* This differs from native browser implementations in the following ways:
* - Fires on contentEditable fields as well as inputs.
* - Fires for collapsed selection.
* - Fires after user input.
*/
var SelectEventPlugin = {
eventTypes: eventTypes,
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
switch (topLevelType) {
// Track the input node that has focus.
case topLevelTypes.topFocus:
if (isTextInputElement(topLevelTarget) ||
topLevelTarget.contentEditable === 'true') {
activeElement = topLevelTarget;
activeElementID = topLevelTargetID;
lastSelection = null;
}
break;
case topLevelTypes.topBlur:
activeElement = null;
activeElementID = null;
lastSelection = null;
break;
// Don't fire the event while the user is dragging. This matches the
// semantics of the native select event.
case topLevelTypes.topMouseDown:
mouseDown = true;
break;
case topLevelTypes.topContextMenu:
case topLevelTypes.topMouseUp:
mouseDown = false;
return constructSelectEvent(nativeEvent);
// Chrome and IE fire non-standard event when selection is changed (and
// sometimes when it hasn't).
// Firefox doesn't support selectionchange, so check selection status
// after each key entry. The selection changes after keydown and before
// keyup, but we check on keydown as well in the case of holding down a
// key, when multiple keydown events are fired but only one keyup is.
case topLevelTypes.topSelectionChange:
case topLevelTypes.topKeyDown:
case topLevelTypes.topKeyUp:
return constructSelectEvent(nativeEvent);
}
}
};
module.exports = SelectEventPlugin;
},{"./EventConstants":16,"./EventPropagators":21,"./ReactInputSelection":59,"./SyntheticEvent":87,"./getActiveElement":113,"./isTextInputElement":129,"./keyOf":133,"./shallowEqual":141}],82:[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.
*
* @providesModule ServerReactRootIndex
* @typechecks
*/
"use strict";
/**
* Size of the reactRoot ID space. We generate random numbers for React root
* IDs and if there's a collision the events and DOM update system will
* get confused. In the future we need a way to generate GUIDs but for
* now this will work on a smaller scale.
*/
var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
var ServerReactRootIndex = {
createReactRootIndex: function() {
return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
}
};
module.exports = ServerReactRootIndex;
},{}],83:[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.
*
* @providesModule SimpleEventPlugin
*/
"use strict";
var EventConstants = _dereq_("./EventConstants");
var EventPluginUtils = _dereq_("./EventPluginUtils");
var EventPropagators = _dereq_("./EventPropagators");
var SyntheticClipboardEvent = _dereq_("./SyntheticClipboardEvent");
var SyntheticEvent = _dereq_("./SyntheticEvent");
var SyntheticFocusEvent = _dereq_("./SyntheticFocusEvent");
var SyntheticKeyboardEvent = _dereq_("./SyntheticKeyboardEvent");
var SyntheticMouseEvent = _dereq_("./SyntheticMouseEvent");
var SyntheticDragEvent = _dereq_("./SyntheticDragEvent");
var SyntheticTouchEvent = _dereq_("./SyntheticTouchEvent");
var SyntheticUIEvent = _dereq_("./SyntheticUIEvent");
var SyntheticWheelEvent = _dereq_("./SyntheticWheelEvent");
var getEventCharCode = _dereq_("./getEventCharCode");
var invariant = _dereq_("./invariant");
var keyOf = _dereq_("./keyOf");
var warning = _dereq_("./warning");
var topLevelTypes = EventConstants.topLevelTypes;
var eventTypes = {
blur: {
phasedRegistrationNames: {
bubbled: keyOf({onBlur: true}),
captured: keyOf({onBlurCapture: true})
}
},
click: {
phasedRegistrationNames: {
bubbled: keyOf({onClick: true}),
captured: keyOf({onClickCapture: true})
}
},
contextMenu: {
phasedRegistrationNames: {
bubbled: keyOf({onContextMenu: true}),
captured: keyOf({onContextMenuCapture: true})
}
},
copy: {
phasedRegistrationNames: {
bubbled: keyOf({onCopy: true}),
captured: keyOf({onCopyCapture: true})
}
},
cut: {
phasedRegistrationNames: {
bubbled: keyOf({onCut: true}),
captured: keyOf({onCutCapture: true})
}
},
doubleClick: {
phasedRegistrationNames: {
bubbled: keyOf({onDoubleClick: true}),
captured: keyOf({onDoubleClickCapture: true})
}
},
drag: {
phasedRegistrationNames: {
bubbled: keyOf({onDrag: true}),
captured: keyOf({onDragCapture: true})
}
},
dragEnd: {
phasedRegistrationNames: {
bubbled: keyOf({onDragEnd: true}),
captured: keyOf({onDragEndCapture: true})
}
},
dragEnter: {
phasedRegistrationNames: {
bubbled: keyOf({onDragEnter: true}),
captured: keyOf({onDragEnterCapture: true})
}
},
dragExit: {
phasedRegistrationNames: {
bubbled: keyOf({onDragExit: true}),
captured: keyOf({onDragExitCapture: true})
}
},
dragLeave: {
phasedRegistrationNames: {
bubbled: keyOf({onDragLeave: true}),
captured: keyOf({onDragLeaveCapture: true})
}
},
dragOver: {
phasedRegistrationNames: {
bubbled: keyOf({onDragOver: true}),
captured: keyOf({onDragOverCapture: true})
}
},
dragStart: {
phasedRegistrationNames: {
bubbled: keyOf({onDragStart: true}),
captured: keyOf({onDragStartCapture: true})
}
},
drop: {
phasedRegistrationNames: {
bubbled: keyOf({onDrop: true}),
captured: keyOf({onDropCapture: true})
}
},
focus: {
phasedRegistrationNames: {
bubbled: keyOf({onFocus: true}),
captured: keyOf({onFocusCapture: true})
}
},
input: {
phasedRegistrationNames: {
bubbled: keyOf({onInput: true}),
captured: keyOf({onInputCapture: true})
}
},
keyDown: {
phasedRegistrationNames: {
bubbled: keyOf({onKeyDown: true}),
captured: keyOf({onKeyDownCapture: true})
}
},
keyPress: {
phasedRegistrationNames: {
bubbled: keyOf({onKeyPress: true}),
captured: keyOf({onKeyPressCapture: true})
}
},
keyUp: {
phasedRegistrationNames: {
bubbled: keyOf({onKeyUp: true}),
captured: keyOf({onKeyUpCapture: true})
}
},
load: {
phasedRegistrationNames: {
bubbled: keyOf({onLoad: true}),
captured: keyOf({onLoadCapture: true})
}
},
error: {
phasedRegistrationNames: {
bubbled: keyOf({onError: true}),
captured: keyOf({onErrorCapture: true})
}
},
// Note: We do not allow listening to mouseOver events. Instead, use the
// onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
mouseDown: {
phasedRegistrationNames: {
bubbled: keyOf({onMouseDown: true}),
captured: keyOf({onMouseDownCapture: true})
}
},
mouseMove: {
phasedRegistrationNames: {
bubbled: keyOf({onMouseMove: true}),
captured: keyOf({onMouseMoveCapture: true})
}
},
mouseOut: {
phasedRegistrationNames: {
bubbled: keyOf({onMouseOut: true}),
captured: keyOf({onMouseOutCapture: true})
}
},
mouseOver: {
phasedRegistrationNames: {
bubbled: keyOf({onMouseOver: true}),
captured: keyOf({onMouseOverCapture: true})
}
},
mouseUp: {
phasedRegistrationNames: {
bubbled: keyOf({onMouseUp: true}),
captured: keyOf({onMouseUpCapture: true})
}
},
paste: {
phasedRegistrationNames: {
bubbled: keyOf({onPaste: true}),
captured: keyOf({onPasteCapture: true})
}
},
reset: {
phasedRegistrationNames: {
bubbled: keyOf({onReset: true}),
captured: keyOf({onResetCapture: true})
}
},
scroll: {
phasedRegistrationNames: {
bubbled: keyOf({onScroll: true}),
captured: keyOf({onScrollCapture: true})
}
},
submit: {
phasedRegistrationNames: {
bubbled: keyOf({onSubmit: true}),
captured: keyOf({onSubmitCapture: true})
}
},
touchCancel: {
phasedRegistrationNames: {
bubbled: keyOf({onTouchCancel: true}),
captured: keyOf({onTouchCancelCapture: true})
}
},
touchEnd: {
phasedRegistrationNames: {
bubbled: keyOf({onTouchEnd: true}),
captured: keyOf({onTouchEndCapture: true})
}
},
touchMove: {
phasedRegistrationNames: {
bubbled: keyOf({onTouchMove: true}),
captured: keyOf({onTouchMoveCapture: true})
}
},
touchStart: {
phasedRegistrationNames: {
bubbled: keyOf({onTouchStart: true}),
captured: keyOf({onTouchStartCapture: true})
}
},
wheel: {
phasedRegistrationNames: {
bubbled: keyOf({onWheel: true}),
captured: keyOf({onWheelCapture: true})
}
}
};
var topLevelEventsToDispatchConfig = {
topBlur: eventTypes.blur,
topClick: eventTypes.click,
topContextMenu: eventTypes.contextMenu,
topCopy: eventTypes.copy,
topCut: eventTypes.cut,
topDoubleClick: eventTypes.doubleClick,
topDrag: eventTypes.drag,
topDragEnd: eventTypes.dragEnd,
topDragEnter: eventTypes.dragEnter,
topDragExit: eventTypes.dragExit,
topDragLeave: eventTypes.dragLeave,
topDragOver: eventTypes.dragOver,
topDragStart: eventTypes.dragStart,
topDrop: eventTypes.drop,
topError: eventTypes.error,
topFocus: eventTypes.focus,
topInput: eventTypes.input,
topKeyDown: eventTypes.keyDown,
topKeyPress: eventTypes.keyPress,
topKeyUp: eventTypes.keyUp,
topLoad: eventTypes.load,
topMouseDown: eventTypes.mouseDown,
topMouseMove: eventTypes.mouseMove,
topMouseOut: eventTypes.mouseOut,
topMouseOver: eventTypes.mouseOver,
topMouseUp: eventTypes.mouseUp,
topPaste: eventTypes.paste,
topReset: eventTypes.reset,
topScroll: eventTypes.scroll,
topSubmit: eventTypes.submit,
topTouchCancel: eventTypes.touchCancel,
topTouchEnd: eventTypes.touchEnd,
topTouchMove: eventTypes.touchMove,
topTouchStart: eventTypes.touchStart,
topWheel: eventTypes.wheel
};
for (var topLevelType in topLevelEventsToDispatchConfig) {
topLevelEventsToDispatchConfig[topLevelType].dependencies = [topLevelType];
}
var SimpleEventPlugin = {
eventTypes: eventTypes,
/**
* Same as the default implementation, except cancels the event when return
* value is false. This behavior will be disabled in a future release.
*
* @param {object} Event to be dispatched.
* @param {function} Application-level callback.
* @param {string} domID DOM ID to pass to the callback.
*/
executeDispatch: function(event, listener, domID) {
var returnValue = EventPluginUtils.executeDispatch(event, listener, domID);
("production" !== "development" ? warning(
typeof returnValue !== 'boolean',
'Returning `false` from an event handler is deprecated and will be ' +
'ignored in a future release. Instead, manually call ' +
'e.stopPropagation() or e.preventDefault(), as appropriate.'
) : null);
if (returnValue === false) {
event.stopPropagation();
event.preventDefault();
}
},
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {DOMEventTarget} topLevelTarget The listening component root node.
* @param {string} topLevelTargetID ID of `topLevelTarget`.
* @param {object} nativeEvent Native browser event.
* @return {*} An accumulation of synthetic events.
* @see {EventPluginHub.extractEvents}
*/
extractEvents: function(
topLevelType,
topLevelTarget,
topLevelTargetID,
nativeEvent) {
var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
if (!dispatchConfig) {
return null;
}
var EventConstructor;
switch (topLevelType) {
case topLevelTypes.topInput:
case topLevelTypes.topLoad:
case topLevelTypes.topError:
case topLevelTypes.topReset:
case topLevelTypes.topSubmit:
// HTML Events
// @see http://www.w3.org/TR/html5/index.html#events-0
EventConstructor = SyntheticEvent;
break;
case topLevelTypes.topKeyPress:
// FireFox creates a keypress event for function keys too. This removes
// the unwanted keypress events. Enter is however both printable and
// non-printable. One would expect Tab to be as well (but it isn't).
if (getEventCharCode(nativeEvent) === 0) {
return null;
}
/* falls through */
case topLevelTypes.topKeyDown:
case topLevelTypes.topKeyUp:
EventConstructor = SyntheticKeyboardEvent;
break;
case topLevelTypes.topBlur:
case topLevelTypes.topFocus:
EventConstructor = SyntheticFocusEvent;
break;
case topLevelTypes.topClick:
// Firefox creates a click event on right mouse clicks. This removes the
// unwanted click events.
if (nativeEvent.button === 2) {
return null;
}
/* falls through */
case topLevelTypes.topContextMenu:
case topLevelTypes.topDoubleClick:
case topLevelTypes.topMouseDown:
case topLevelTypes.topMouseMove:
case topLevelTypes.topMouseOut:
case topLevelTypes.topMouseOver:
case topLevelTypes.topMouseUp:
EventConstructor = SyntheticMouseEvent;
break;
case topLevelTypes.topDrag:
case topLevelTypes.topDragEnd:
case topLevelTypes.topDragEnter:
case topLevelTypes.topDragExit:
case topLevelTypes.topDragLeave:
case topLevelTypes.topDragOver:
case topLevelTypes.topDragStart:
case topLevelTypes.topDrop:
EventConstructor = SyntheticDragEvent;
break;
case topLevelTypes.topTouchCancel:
case topLevelTypes.topTouchEnd:
case topLevelTypes.topTouchMove:
case topLevelTypes.topTouchStart:
EventConstructor = SyntheticTouchEvent;
break;
case topLevelTypes.topScroll:
EventConstructor = SyntheticUIEvent;
break;
case topLevelTypes.topWheel:
EventConstructor = SyntheticWheelEvent;
break;
case topLevelTypes.topCopy:
case topLevelTypes.topCut:
case topLevelTypes.topPaste:
EventConstructor = SyntheticClipboardEvent;
break;
}
("production" !== "development" ? invariant(
EventConstructor,
'SimpleEventPlugin: Unhandled event type, `%s`.',
topLevelType
) : invariant(EventConstructor));
var event = EventConstructor.getPooled(
dispatchConfig,
topLevelTargetID,
nativeEvent
);
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
};
module.exports = SimpleEventPlugin;
},{"./EventConstants":16,"./EventPluginUtils":20,"./EventPropagators":21,"./SyntheticClipboardEvent":84,"./SyntheticDragEvent":86,"./SyntheticEvent":87,"./SyntheticFocusEvent":88,"./SyntheticKeyboardEvent":90,"./SyntheticMouseEvent":91,"./SyntheticTouchEvent":92,"./SyntheticUIEvent":93,"./SyntheticWheelEvent":94,"./getEventCharCode":114,"./invariant":126,"./keyOf":133,"./warning":145}],84:[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.
*
* @providesModule SyntheticClipboardEvent
* @typechecks static-only
*/
"use strict";
var SyntheticEvent = _dereq_("./SyntheticEvent");
/**
* @interface Event
* @see http://www.w3.org/TR/clipboard-apis/
*/
var ClipboardEventInterface = {
clipboardData: function(event) {
return (
'clipboardData' in event ?
event.clipboardData :
window.clipboardData
);
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
module.exports = SyntheticClipboardEvent;
},{"./SyntheticEvent":87}],85:[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.
*
* @providesModule SyntheticCompositionEvent
* @typechecks static-only
*/
"use strict";
var SyntheticEvent = _dereq_("./SyntheticEvent");
/**
* @interface Event
* @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
*/
var CompositionEventInterface = {
data: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticCompositionEvent(
dispatchConfig,
dispatchMarker,
nativeEvent) {
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticEvent.augmentClass(
SyntheticCompositionEvent,
CompositionEventInterface
);
module.exports = SyntheticCompositionEvent;
},{"./SyntheticEvent":87}],86:[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.
*
* @providesModule SyntheticDragEvent
* @typechecks static-only
*/
"use strict";
var SyntheticMouseEvent = _dereq_("./SyntheticMouseEvent");
/**
* @interface DragEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var DragEventInterface = {
dataTransfer: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent) {
SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
module.exports = SyntheticDragEvent;
},{"./SyntheticMouseEvent":91}],87:[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.
*
* @providesModule SyntheticEvent
* @typechecks static-only
*/
"use strict";
var PooledClass = _dereq_("./PooledClass");
var assign = _dereq_("./Object.assign");
var emptyFunction = _dereq_("./emptyFunction");
var getEventTarget = _dereq_("./getEventTarget");
/**
* @interface Event
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var EventInterface = {
type: null,
target: getEventTarget,
// currentTarget is set when dispatching; no use in copying it here
currentTarget: emptyFunction.thatReturnsNull,
eventPhase: null,
bubbles: null,
cancelable: null,
timeStamp: function(event) {
return event.timeStamp || Date.now();
},
defaultPrevented: null,
isTrusted: null
};
/**
* Synthetic events are dispatched by event plugins, typically in response to a
* top-level event delegation handler.
*
* These systems should generally use pooling to reduce the frequency of garbage
* collection. The system should check `isPersistent` to determine whether the
* event should be released into the pool after being dispatched. Users that
* need a persisted event should invoke `persist`.
*
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by
* normalizing browser quirks. Subclasses do not necessarily have to implement a
* DOM interface; custom application-specific events can also subclass this.
*
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
*/
function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent) {
this.dispatchConfig = dispatchConfig;
this.dispatchMarker = dispatchMarker;
this.nativeEvent = nativeEvent;
var Interface = this.constructor.Interface;
for (var propName in Interface) {
if (!Interface.hasOwnProperty(propName)) {
continue;
}
var normalize = Interface[propName];
if (normalize) {
this[propName] = normalize(nativeEvent);
} else {
this[propName] = nativeEvent[propName];
}
}
var defaultPrevented = nativeEvent.defaultPrevented != null ?
nativeEvent.defaultPrevented :
nativeEvent.returnValue === false;
if (defaultPrevented) {
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
} else {
this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
}
this.isPropagationStopped = emptyFunction.thatReturnsFalse;
}
assign(SyntheticEvent.prototype, {
preventDefault: function() {
this.defaultPrevented = true;
var event = this.nativeEvent;
event.preventDefault ? event.preventDefault() : event.returnValue = false;
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
},
stopPropagation: function() {
var event = this.nativeEvent;
event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;
this.isPropagationStopped = emptyFunction.thatReturnsTrue;
},
/**
* We release all dispatched `SyntheticEvent`s after each event loop, adding
* them back into the pool. This allows a way to hold onto a reference that
* won't be added back into the pool.
*/
persist: function() {
this.isPersistent = emptyFunction.thatReturnsTrue;
},
/**
* Checks if this event should be released back into the pool.
*
* @return {boolean} True if this should not be released, false otherwise.
*/
isPersistent: emptyFunction.thatReturnsFalse,
/**
* `PooledClass` looks for `destructor` on each instance it releases.
*/
destructor: function() {
var Interface = this.constructor.Interface;
for (var propName in Interface) {
this[propName] = null;
}
this.dispatchConfig = null;
this.dispatchMarker = null;
this.nativeEvent = null;
}
});
SyntheticEvent.Interface = EventInterface;
/**
* Helper to reduce boilerplate when creating subclasses.
*
* @param {function} Class
* @param {?object} Interface
*/
SyntheticEvent.augmentClass = function(Class, Interface) {
var Super = this;
var prototype = Object.create(Super.prototype);
assign(prototype, Class.prototype);
Class.prototype = prototype;
Class.prototype.constructor = Class;
Class.Interface = assign({}, Super.Interface, Interface);
Class.augmentClass = Super.augmentClass;
PooledClass.addPoolingTo(Class, PooledClass.threeArgumentPooler);
};
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.threeArgumentPooler);
module.exports = SyntheticEvent;
},{"./Object.assign":27,"./PooledClass":28,"./emptyFunction":107,"./getEventTarget":117}],88:[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.
*
* @providesModule SyntheticFocusEvent
* @typechecks static-only
*/
"use strict";
var SyntheticUIEvent = _dereq_("./SyntheticUIEvent");
/**
* @interface FocusEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var FocusEventInterface = {
relatedTarget: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent) {
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
module.exports = SyntheticFocusEvent;
},{"./SyntheticUIEvent":93}],89:[function(_dereq_,module,exports){
/**
* Copyright 2013 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 SyntheticInputEvent
* @typechecks static-only
*/
"use strict";
var SyntheticEvent = _dereq_("./SyntheticEvent");
/**
* @interface Event
* @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
* /#events-inputevents
*/
var InputEventInterface = {
data: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticInputEvent(
dispatchConfig,
dispatchMarker,
nativeEvent) {
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticEvent.augmentClass(
SyntheticInputEvent,
InputEventInterface
);
module.exports = SyntheticInputEvent;
},{"./SyntheticEvent":87}],90:[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.
*
* @providesModule SyntheticKeyboardEvent
* @typechecks static-only
*/
"use strict";
var SyntheticUIEvent = _dereq_("./SyntheticUIEvent");
var getEventCharCode = _dereq_("./getEventCharCode");
var getEventKey = _dereq_("./getEventKey");
var getEventModifierState = _dereq_("./getEventModifierState");
/**
* @interface KeyboardEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var KeyboardEventInterface = {
key: getEventKey,
location: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
repeat: null,
locale: null,
getModifierState: getEventModifierState,
// Legacy Interface
charCode: function(event) {
// `charCode` is the result of a KeyPress event and represents the value of
// the actual printable character.
// KeyPress is deprecated, but its replacement is not yet final and not
// implemented in any major browser. Only KeyPress has charCode.
if (event.type === 'keypress') {
return getEventCharCode(event);
}
return 0;
},
keyCode: function(event) {
// `keyCode` is the result of a KeyDown/Up event and represents the value of
// physical keyboard key.
// The actual meaning of the value depends on the users' keyboard layout
// which cannot be detected. Assuming that it is a US keyboard layout
// provides a surprisingly accurate mapping for US and European users.
// Due to this, it is left to the user to implement at this time.
if (event.type === 'keydown' || event.type === 'keyup') {
return event.keyCode;
}
return 0;
},
which: function(event) {
// `which` is an alias for either `keyCode` or `charCode` depending on the
// type of the event.
if (event.type === 'keypress') {
return getEventCharCode(event);
}
if (event.type === 'keydown' || event.type === 'keyup') {
return event.keyCode;
}
return 0;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
module.exports = SyntheticKeyboardEvent;
},{"./SyntheticUIEvent":93,"./getEventCharCode":114,"./getEventKey":115,"./getEventModifierState":116}],91:[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.
*
* @providesModule SyntheticMouseEvent
* @typechecks static-only
*/
"use strict";
var SyntheticUIEvent = _dereq_("./SyntheticUIEvent");
var ViewportMetrics = _dereq_("./ViewportMetrics");
var getEventModifierState = _dereq_("./getEventModifierState");
/**
* @interface MouseEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var MouseEventInterface = {
screenX: null,
screenY: null,
clientX: null,
clientY: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
getModifierState: getEventModifierState,
button: function(event) {
// Webkit, Firefox, IE9+
// which: 1 2 3
// button: 0 1 2 (standard)
var button = event.button;
if ('which' in event) {
return button;
}
// IE<9
// which: undefined
// button: 0 0 0
// button: 1 4 2 (onmouseup)
return button === 2 ? 2 : button === 4 ? 1 : 0;
},
buttons: null,
relatedTarget: function(event) {
return event.relatedTarget || (
event.fromElement === event.srcElement ?
event.toElement :
event.fromElement
);
},
// "Proprietary" Interface.
pageX: function(event) {
return 'pageX' in event ?
event.pageX :
event.clientX + ViewportMetrics.currentScrollLeft;
},
pageY: function(event) {
return 'pageY' in event ?
event.pageY :
event.clientY + ViewportMetrics.currentScrollTop;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent) {
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
module.exports = SyntheticMouseEvent;
},{"./SyntheticUIEvent":93,"./ViewportMetrics":96,"./getEventModifierState":116}],92:[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.
*
* @providesModule SyntheticTouchEvent
* @typechecks static-only
*/
"use strict";
var SyntheticUIEvent = _dereq_("./SyntheticUIEvent");
var getEventModifierState = _dereq_("./getEventModifierState");
/**
* @interface TouchEvent
* @see http://www.w3.org/TR/touch-events/
*/
var TouchEventInterface = {
touches: null,
targetTouches: null,
changedTouches: null,
altKey: null,
metaKey: null,
ctrlKey: null,
shiftKey: null,
getModifierState: getEventModifierState
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent) {
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
module.exports = SyntheticTouchEvent;
},{"./SyntheticUIEvent":93,"./getEventModifierState":116}],93:[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.
*
* @providesModule SyntheticUIEvent
* @typechecks static-only
*/
"use strict";
var SyntheticEvent = _dereq_("./SyntheticEvent");
var getEventTarget = _dereq_("./getEventTarget");
/**
* @interface UIEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var UIEventInterface = {
view: function(event) {
if (event.view) {
return event.view;
}
var target = getEventTarget(event);
if (target != null && target.window === target) {
// target is a window object
return target;
}
var doc = target.ownerDocument;
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
if (doc) {
return doc.defaultView || doc.parentWindow;
} else {
return window;
}
},
detail: function(event) {
return event.detail || 0;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent) {
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
module.exports = SyntheticUIEvent;
},{"./SyntheticEvent":87,"./getEventTarget":117}],94:[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.
*
* @providesModule SyntheticWheelEvent
* @typechecks static-only
*/
"use strict";
var SyntheticMouseEvent = _dereq_("./SyntheticMouseEvent");
/**
* @interface WheelEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var WheelEventInterface = {
deltaX: function(event) {
return (
'deltaX' in event ? event.deltaX :
// Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
'wheelDeltaX' in event ? -event.wheelDeltaX : 0
);
},
deltaY: function(event) {
return (
'deltaY' in event ? event.deltaY :
// Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
'wheelDeltaY' in event ? -event.wheelDeltaY :
// Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
'wheelDelta' in event ? -event.wheelDelta : 0
);
},
deltaZ: null,
// Browsers without "deltaMode" is reporting in raw wheel delta where one
// notch on the scroll is always +/- 120, roughly equivalent to pixels.
// A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
// ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
deltaMode: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticMouseEvent}
*/
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent) {
SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
}
SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
module.exports = SyntheticWheelEvent;
},{"./SyntheticMouseEvent":91}],95:[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.
*
* @providesModule Transaction
*/
"use strict";
var invariant = _dereq_("./invariant");
/**
* `Transaction` creates a black box that is able to wrap any method such that
* certain invariants are maintained before and after the method is invoked
* (Even if an exception is thrown while invoking the wrapped method). Whoever
* instantiates a transaction can provide enforcers of the invariants at
* creation time. The `Transaction` class itself will supply one additional
* automatic invariant for you - the invariant that any transaction instance
* should not be run while it is already being run. You would typically create a
* single instance of a `Transaction` for reuse multiple times, that potentially
* is used to wrap several different methods. Wrappers are extremely simple -
* they only require implementing two methods.
*
* <pre>
* wrappers (injected at creation time)
* + +
* | |
* +-----------------|--------|--------------+
* | v | |
* | +---------------+ | |
* | +--| wrapper1 |---|----+ |
* | | +---------------+ v | |
* | | +-------------+ | |
* | | +----| wrapper2 |--------+ |
* | | | +-------------+ | | |
* | | | | | |
* | v v v v | wrapper
* | +---+ +---+ +---------+ +---+ +---+ | invariants
* perform(anyMethod) | | | | | | | | | | | | maintained
* +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* | +---+ +---+ +---------+ +---+ +---+ |
* | initialize close |
* +-----------------------------------------+
* </pre>
*
* Use cases:
* - Preserving the input selection ranges before/after reconciliation.
* Restoring selection even in the event of an unexpected error.
* - Deactivating events while rearranging the DOM, preventing blurs/focuses,
* while guaranteeing that afterwards, the event system is reactivated.
* - Flushing a queue of collected DOM mutations to the main UI thread after a
* reconciliation takes place in a worker thread.
* - Invoking any collected `componentDidUpdate` callbacks after rendering new
* content.
* - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
* to preserve the `scrollTop` (an automatic scroll aware DOM).
* - (Future use case): Layout calculations before and after DOM upates.
*
* Transactional plugin API:
* - A module that has an `initialize` method that returns any precomputation.
* - and a `close` method that accepts the precomputation. `close` is invoked
* when the wrapped process is completed, or has failed.
*
* @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
* that implement `initialize` and `close`.
* @return {Transaction} Single transaction for reuse in thread.
*
* @class Transaction
*/
var Mixin = {
/**
* Sets up this instance so that it is prepared for collecting metrics. Does
* so such that this setup method may be used on an instance that is already
* initialized, in a way that does not consume additional memory upon reuse.
* That can be useful if you decide to make your subclass of this mixin a
* "PooledClass".
*/
reinitializeTransaction: function() {
this.transactionWrappers = this.getTransactionWrappers();
if (!this.wrapperInitData) {
this.wrapperInitData = [];
} else {
this.wrapperInitData.length = 0;
}
this._isInTransaction = false;
},
_isInTransaction: false,
/**
* @abstract
* @return {Array<TransactionWrapper>} Array of transaction wrappers.
*/
getTransactionWrappers: null,
isInTransaction: function() {
return !!this._isInTransaction;
},
/**
* Executes the function within a safety window. Use this for the top level
* methods that result in large amounts of computation/mutations that would
* need to be safety checked.
*
* @param {function} method Member of scope to call.
* @param {Object} scope Scope to invoke from.
* @param {Object?=} args... Arguments to pass to the method (optional).
* Helps prevent need to bind in many cases.
* @return Return value from `method`.
*/
perform: function(method, scope, a, b, c, d, e, f) {
("production" !== "development" ? invariant(
!this.isInTransaction(),
'Transaction.perform(...): Cannot initialize a transaction when there ' +
'is already an outstanding transaction.'
) : invariant(!this.isInTransaction()));
var errorThrown;
var ret;
try {
this._isInTransaction = true;
// Catching errors makes debugging more difficult, so we start with
// errorThrown set to true before setting it to false after calling
// close -- if it's still set to true in the finally block, it means
// one of these calls threw.
errorThrown = true;
this.initializeAll(0);
ret = method.call(scope, a, b, c, d, e, f);
errorThrown = false;
} finally {
try {
if (errorThrown) {
// If `method` throws, prefer to show that stack trace over any thrown
// by invoking `closeAll`.
try {
this.closeAll(0);
} catch (err) {
}
} else {
// Since `method` didn't throw, we don't want to silence the exception
// here.
this.closeAll(0);
}
} finally {
this._isInTransaction = false;
}
}
return ret;
},
initializeAll: function(startIndex) {
var transactionWrappers = this.transactionWrappers;
for (var i = startIndex; i < transactionWrappers.length; i++) {
var wrapper = transactionWrappers[i];
try {
// Catching errors makes debugging more difficult, so we start with the
// OBSERVED_ERROR state before overwriting it with the real return value
// of initialize -- if it's still set to OBSERVED_ERROR in the finally
// block, it means wrapper.initialize threw.
this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
this.wrapperInitData[i] = wrapper.initialize ?
wrapper.initialize.call(this) :
null;
} finally {
if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
// The initializer for wrapper i threw an error; initialize the
// remaining wrappers but silence any exceptions from them to ensure
// that the first error is the one to bubble up.
try {
this.initializeAll(i + 1);
} catch (err) {
}
}
}
}
},
/**
* Invokes each of `this.transactionWrappers.close[i]` functions, passing into
* them the respective return values of `this.transactionWrappers.init[i]`
* (`close`rs that correspond to initializers that failed will not be
* invoked).
*/
closeAll: function(startIndex) {
("production" !== "development" ? invariant(
this.isInTransaction(),
'Transaction.closeAll(): Cannot close transaction when none are open.'
) : invariant(this.isInTransaction()));
var transactionWrappers = this.transactionWrappers;
for (var i = startIndex; i < transactionWrappers.length; i++) {
var wrapper = transactionWrappers[i];
var initData = this.wrapperInitData[i];
var errorThrown;
try {
// Catching errors makes debugging more difficult, so we start with
// errorThrown set to true before setting it to false after calling
// close -- if it's still set to true in the finally block, it means
// wrapper.close threw.
errorThrown = true;
if (initData !== Transaction.OBSERVED_ERROR) {
wrapper.close && wrapper.close.call(this, initData);
}
errorThrown = false;
} finally {
if (errorThrown) {
// The closer for wrapper i threw an error; close the remaining
// wrappers but silence any exceptions from them to ensure that the
// first error is the one to bubble up.
try {
this.closeAll(i + 1);
} catch (e) {
}
}
}
}
this.wrapperInitData.length = 0;
}
};
var Transaction = {
Mixin: Mixin,
/**
* Token to look for to determine if an error occured.
*/
OBSERVED_ERROR: {}
};
module.exports = Transaction;
},{"./invariant":126}],96:[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.
*
* @providesModule ViewportMetrics
*/
"use strict";
var getUnboundedScrollPosition = _dereq_("./getUnboundedScrollPosition");
var ViewportMetrics = {
currentScrollLeft: 0,
currentScrollTop: 0,
refreshScrollValues: function() {
var scrollPosition = getUnboundedScrollPosition(window);
ViewportMetrics.currentScrollLeft = scrollPosition.x;
ViewportMetrics.currentScrollTop = scrollPosition.y;
}
};
module.exports = ViewportMetrics;
},{"./getUnboundedScrollPosition":122}],97:[function(_dereq_,module,exports){
/**
* 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 accumulateInto
*/
"use strict";
var invariant = _dereq_("./invariant");
/**
*
* Accumulates items that must not be null or undefined into the first one. This
* is used to conserve memory by avoiding array allocations, and thus sacrifices
* API cleanness. Since `current` can be null before being passed in and not
* null after this function, make sure to assign it back to `current`:
*
* `a = accumulateInto(a, b);`
*
* This API should be sparingly used. Try `accumulate` for something cleaner.
*
* @return {*|array<*>} An accumulation of items.
*/
function accumulateInto(current, next) {
("production" !== "development" ? invariant(
next != null,
'accumulateInto(...): Accumulated items must not be null or undefined.'
) : invariant(next != null));
if (current == null) {
return next;
}
// Both are not empty. Warning: Never call x.concat(y) when you are not
// certain that x is an Array (x could be a string with concat method).
var currentIsArray = Array.isArray(current);
var nextIsArray = Array.isArray(next);
if (currentIsArray && nextIsArray) {
current.push.apply(current, next);
return current;
}
if (currentIsArray) {
current.push(next);
return current;
}
if (nextIsArray) {
// A bit too dangerous to mutate `next`.
return [current].concat(next);
}
return [current, next];
}
module.exports = accumulateInto;
},{"./invariant":126}],98:[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.
*
* @providesModule adler32
*/
/* jslint bitwise:true */
"use strict";
var MOD = 65521;
// This is a clean-room implementation of adler32 designed for detecting
// if markup is not what we expect it to be. It does not need to be
// cryptographically strong, only reasonably good at detecting if markup
// generated on the server is different than that on the client.
function adler32(data) {
var a = 1;
var b = 0;
for (var i = 0; i < data.length; i++) {
a = (a + data.charCodeAt(i)) % MOD;
b = (b + a) % MOD;
}
return a | (b << 16);
}
module.exports = adler32;
},{}],99:[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.
*
* @providesModule camelize
* @typechecks
*/
var _hyphenPattern = /-(.)/g;
/**
* Camelcases a hyphenated string, for example:
*
* > camelize('background-color')
* < "backgroundColor"
*
* @param {string} string
* @return {string}
*/
function camelize(string) {
return string.replace(_hyphenPattern, function(_, character) {
return character.toUpperCase();
});
}
module.exports = camelize;
},{}],100:[function(_dereq_,module,exports){
/**
* 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 camelizeStyleName
* @typechecks
*/
"use strict";
var camelize = _dereq_("./camelize");
var msPattern = /^-ms-/;
/**
* Camelcases a hyphenated CSS property name, for example:
*
* > camelizeStyleName('background-color')
* < "backgroundColor"
* > camelizeStyleName('-moz-transition')
* < "MozTransition"
* > camelizeStyleName('-ms-transition')
* < "msTransition"
*
* As Andi Smith suggests
* (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
* is converted to lowercase `ms`.
*
* @param {string} string
* @return {string}
*/
function camelizeStyleName(string) {
return camelize(string.replace(msPattern, 'ms-'));
}
module.exports = camelizeStyleName;
},{"./camelize":99}],101:[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.
*
* @providesModule containsNode
* @typechecks
*/
var isTextNode = _dereq_("./isTextNode");
/*jslint bitwise:true */
/**
* Checks if a given DOM node contains or is another DOM node.
*
* @param {?DOMNode} outerNode Outer DOM node.
* @param {?DOMNode} innerNode Inner DOM node.
* @return {boolean} True if `outerNode` contains or is `innerNode`.
*/
function containsNode(outerNode, innerNode) {
if (!outerNode || !innerNode) {
return false;
} else if (outerNode === innerNode) {
return true;
} else if (isTextNode(outerNode)) {
return false;
} else if (isTextNode(innerNode)) {
return containsNode(outerNode, innerNode.parentNode);
} else if (outerNode.contains) {
return outerNode.contains(innerNode);
} else if (outerNode.compareDocumentPosition) {
return !!(outerNode.compareDocumentPosition(innerNode) & 16);
} else {
return false;
}
}
module.exports = containsNode;
},{"./isTextNode":130}],102:[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.
*
* @providesModule createArrayFrom
* @typechecks
*/
var toArray = _dereq_("./toArray");
/**
* Perform a heuristic test to determine if an object is "array-like".
*
* A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
* Joshu replied: "Mu."
*
* This function determines if its argument has "array nature": it returns
* true if the argument is an actual array, an `arguments' object, or an
* HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
*
* It will return false for other array-like objects like Filelist.
*
* @param {*} obj
* @return {boolean}
*/
function hasArrayNature(obj) {
return (
// not null/false
!!obj &&
// arrays are objects, NodeLists are functions in Safari
(typeof obj == 'object' || typeof obj == 'function') &&
// quacks like an array
('length' in obj) &&
// not window
!('setInterval' in obj) &&
// no DOM node should be considered an array-like
// a 'select' element has 'length' and 'item' properties on IE8
(typeof obj.nodeType != 'number') &&
(
// a real array
(// HTMLCollection/NodeList
(Array.isArray(obj) ||
// arguments
('callee' in obj) || 'item' in obj))
)
);
}
/**
* Ensure that the argument is an array by wrapping it in an array if it is not.
* Creates a copy of the argument if it is already an array.
*
* This is mostly useful idiomatically:
*
* var createArrayFrom = require('createArrayFrom');
*
* function takesOneOrMoreThings(things) {
* things = createArrayFrom(things);
* ...
* }
*
* This allows you to treat `things' as an array, but accept scalars in the API.
*
* If you need to convert an array-like object, like `arguments`, into an array
* use toArray instead.
*
* @param {*} obj
* @return {array}
*/
function createArrayFrom(obj) {
if (!hasArrayNature(obj)) {
return [obj];
} else if (Array.isArray(obj)) {
return obj.slice();
} else {
return toArray(obj);
}
}
module.exports = createArrayFrom;
},{"./toArray":143}],103:[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.
*
* @providesModule createFullPageComponent
* @typechecks
*/
"use strict";
// Defeat circular references by requiring this directly.
var ReactCompositeComponent = _dereq_("./ReactCompositeComponent");
var ReactElement = _dereq_("./ReactElement");
var invariant = _dereq_("./invariant");
/**
* Create a component that will throw an exception when unmounted.
*
* Components like <html> <head> and <body> can't be removed or added
* easily in a cross-browser way, however it's valuable to be able to
* take advantage of React's reconciliation for styling and <title>
* management. So we just document it and throw in dangerous cases.
*
* @param {string} tag The tag to wrap
* @return {function} convenience constructor of new component
*/
function createFullPageComponent(tag) {
var elementFactory = ReactElement.createFactory(tag);
var FullPageComponent = ReactCompositeComponent.createClass({
displayName: 'ReactFullPageComponent' + tag,
componentWillUnmount: function() {
("production" !== "development" ? invariant(
false,
'%s tried to unmount. Because of cross-browser quirks it is ' +
'impossible to unmount some top-level components (eg <html>, <head>, ' +
'and <body>) reliably and efficiently. To fix this, have a single ' +
'top-level component that never unmounts render these elements.',
this.constructor.displayName
) : invariant(false));
},
render: function() {
return elementFactory(this.props);
}
});
return FullPageComponent;
}
module.exports = createFullPageComponent;
},{"./ReactCompositeComponent":34,"./ReactElement":52,"./invariant":126}],104:[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.
*
* @providesModule createNodesFromMarkup
* @typechecks
*/
/*jslint evil: true, sub: true */
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var createArrayFrom = _dereq_("./createArrayFrom");
var getMarkupWrap = _dereq_("./getMarkupWrap");
var invariant = _dereq_("./invariant");
/**
* Dummy container used to render all markup.
*/
var dummyNode =
ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
/**
* Pattern used by `getNodeName`.
*/
var nodeNamePattern = /^\s*<(\w+)/;
/**
* Extracts the `nodeName` of the first element in a string of markup.
*
* @param {string} markup String of markup.
* @return {?string} Node name of the supplied markup.
*/
function getNodeName(markup) {
var nodeNameMatch = markup.match(nodeNamePattern);
return nodeNameMatch && nodeNameMatch[1].toLowerCase();
}
/**
* Creates an array containing the nodes rendered from the supplied markup. The
* optionally supplied `handleScript` function will be invoked once for each
* <script> element that is rendered. If no `handleScript` function is supplied,
* an exception is thrown if any <script> elements are rendered.
*
* @param {string} markup A string of valid HTML markup.
* @param {?function} handleScript Invoked once for each rendered <script>.
* @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
*/
function createNodesFromMarkup(markup, handleScript) {
var node = dummyNode;
("production" !== "development" ? invariant(!!dummyNode, 'createNodesFromMarkup dummy not initialized') : invariant(!!dummyNode));
var nodeName = getNodeName(markup);
var wrap = nodeName && getMarkupWrap(nodeName);
if (wrap) {
node.innerHTML = wrap[1] + markup + wrap[2];
var wrapDepth = wrap[0];
while (wrapDepth--) {
node = node.lastChild;
}
} else {
node.innerHTML = markup;
}
var scripts = node.getElementsByTagName('script');
if (scripts.length) {
("production" !== "development" ? invariant(
handleScript,
'createNodesFromMarkup(...): Unexpected <script> element rendered.'
) : invariant(handleScript));
createArrayFrom(scripts).forEach(handleScript);
}
var nodes = createArrayFrom(node.childNodes);
while (node.lastChild) {
node.removeChild(node.lastChild);
}
return nodes;
}
module.exports = createNodesFromMarkup;
},{"./ExecutionEnvironment":22,"./createArrayFrom":102,"./getMarkupWrap":118,"./invariant":126}],105:[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.
*
* @providesModule dangerousStyleValue
* @typechecks static-only
*/
"use strict";
var CSSProperty = _dereq_("./CSSProperty");
var isUnitlessNumber = CSSProperty.isUnitlessNumber;
/**
* Convert a value into the proper css writable value. The style name `name`
* should be logical (no hyphens), as specified
* in `CSSProperty.isUnitlessNumber`.
*
* @param {string} name CSS property name such as `topMargin`.
* @param {*} value CSS property value such as `10px`.
* @return {string} Normalized style value with dimensions applied.
*/
function dangerousStyleValue(name, value) {
// Note that we've removed escapeTextForBrowser() calls here since the
// whole string will be escaped when the attribute is injected into
// the markup. If you provide unsafe user data here they can inject
// arbitrary CSS which may be problematic (I couldn't repro this):
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
// http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
// This is not an XSS hole but instead a potential CSS injection issue
// which has lead to a greater discussion about how we're going to
// trust URLs moving forward. See #2115901
var isEmpty = value == null || typeof value === 'boolean' || value === '';
if (isEmpty) {
return '';
}
var isNonNumeric = isNaN(value);
if (isNonNumeric || value === 0 ||
isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
return '' + value; // cast to string
}
if (typeof value === 'string') {
value = value.trim();
}
return value + 'px';
}
module.exports = dangerousStyleValue;
},{"./CSSProperty":4}],106:[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.
*
* @providesModule deprecated
*/
var assign = _dereq_("./Object.assign");
var warning = _dereq_("./warning");
/**
* This will log a single deprecation notice per function and forward the call
* on to the new API.
*
* @param {string} namespace The namespace of the call, eg 'React'
* @param {string} oldName The old function name, eg 'renderComponent'
* @param {string} newName The new function name, eg 'render'
* @param {*} ctx The context this forwarded call should run in
* @param {function} fn The function to forward on to
* @return {*} Will be the value as returned from `fn`
*/
function deprecated(namespace, oldName, newName, ctx, fn) {
var warned = false;
if ("production" !== "development") {
var newFn = function() {
("production" !== "development" ? warning(
warned,
(namespace + "." + oldName + " will be deprecated in a future version. ") +
("Use " + namespace + "." + newName + " instead.")
) : null);
warned = true;
return fn.apply(ctx, arguments);
};
newFn.displayName = (namespace + "_" + oldName);
// We need to make sure all properties of the original fn are copied over.
// In particular, this is needed to support PropTypes
return assign(newFn, fn);
}
return fn;
}
module.exports = deprecated;
},{"./Object.assign":27,"./warning":145}],107:[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.
*
* @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;
},{}],108:[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.
*
* @providesModule emptyObject
*/
"use strict";
var emptyObject = {};
if ("production" !== "development") {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
},{}],109:[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.
*
* @providesModule escapeTextForBrowser
* @typechecks static-only
*/
"use strict";
var ESCAPE_LOOKUP = {
"&": "&",
">": ">",
"<": "<",
"\"": """,
"'": "'"
};
var ESCAPE_REGEX = /[&><"']/g;
function escaper(match) {
return ESCAPE_LOOKUP[match];
}
/**
* Escapes text to prevent scripting attacks.
*
* @param {*} text Text value to escape.
* @return {string} An escaped string.
*/
function escapeTextForBrowser(text) {
return ('' + text).replace(ESCAPE_REGEX, escaper);
}
module.exports = escapeTextForBrowser;
},{}],110:[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.
*
* @providesModule flattenChildren
*/
"use strict";
var ReactTextComponent = _dereq_("./ReactTextComponent");
var traverseAllChildren = _dereq_("./traverseAllChildren");
var warning = _dereq_("./warning");
/**
* @param {function} traverseContext Context passed through traversal.
* @param {?ReactComponent} child React child component.
* @param {!string} name String name of key path to child.
*/
function flattenSingleChildIntoContext(traverseContext, child, name) {
// We found a component instance.
var result = traverseContext;
var keyUnique = !result.hasOwnProperty(name);
("production" !== "development" ? warning(
keyUnique,
'flattenChildren(...): Encountered two children with the same key, ' +
'`%s`. Child keys must be unique; when two children share a key, only ' +
'the first child will be used.',
name
) : null);
if (keyUnique && child != null) {
var type = typeof child;
var normalizedValue;
if (type === 'string') {
normalizedValue = ReactTextComponent(child);
} else if (type === 'number') {
normalizedValue = ReactTextComponent('' + child);
} else {
normalizedValue = child;
}
result[name] = normalizedValue;
}
}
/**
* Flattens children that are typically specified as `props.children`. Any null
* children will not be included in the resulting object.
* @return {!object} flattened children keyed by name.
*/
function flattenChildren(children) {
if (children == null) {
return children;
}
var result = {};
traverseAllChildren(children, flattenSingleChildIntoContext, result);
return result;
}
module.exports = flattenChildren;
},{"./ReactTextComponent":78,"./traverseAllChildren":144,"./warning":145}],111:[function(_dereq_,module,exports){
/**
* 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 focusNode
*/
"use strict";
/**
* @param {DOMElement} node input/textarea to focus
*/
function focusNode(node) {
// IE8 can throw "Can't move focus to the control because it is invisible,
// not enabled, or of a type that does not accept the focus." for all kinds of
// reasons that are too expensive and fragile to test.
try {
node.focus();
} catch(e) {
}
}
module.exports = focusNode;
},{}],112:[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.
*
* @providesModule forEachAccumulated
*/
"use strict";
/**
* @param {array} an "accumulation" of items which is either an Array or
* a single item. Useful when paired with the `accumulate` module. This is a
* simple utility that allows us to reason about a collection of items, but
* handling the case when there is exactly one item (and we do not need to
* allocate an array).
*/
var forEachAccumulated = function(arr, cb, scope) {
if (Array.isArray(arr)) {
arr.forEach(cb, scope);
} else if (arr) {
cb.call(scope, arr);
}
};
module.exports = forEachAccumulated;
},{}],113:[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.
*
* @providesModule getActiveElement
* @typechecks
*/
/**
* Same as document.activeElement but wraps in a try-catch block. In IE it is
* not safe to call document.activeElement if there is nothing focused.
*
* The activeElement will be null only if the document body is not yet defined.
*/
function getActiveElement() /*?DOMElement*/ {
try {
return document.activeElement || document.body;
} catch (e) {
return document.body;
}
}
module.exports = getActiveElement;
},{}],114:[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.
*
* @providesModule getEventCharCode
* @typechecks static-only
*/
"use strict";
/**
* `charCode` represents the actual "character code" and is safe to use with
* `String.fromCharCode`. As such, only keys that correspond to printable
* characters produce a valid `charCode`, the only exception to this is Enter.
* The Tab-key is considered non-printable and does not have a `charCode`,
* presumably because it does not produce a tab-character in browsers.
*
* @param {object} nativeEvent Native browser event.
* @return {string} Normalized `charCode` property.
*/
function getEventCharCode(nativeEvent) {
var charCode;
var keyCode = nativeEvent.keyCode;
if ('charCode' in nativeEvent) {
charCode = nativeEvent.charCode;
// FF does not set `charCode` for the Enter-key, check against `keyCode`.
if (charCode === 0 && keyCode === 13) {
charCode = 13;
}
} else {
// IE8 does not implement `charCode`, but `keyCode` has the correct value.
charCode = keyCode;
}
// Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
// Must not discard the (non-)printable Enter-key.
if (charCode >= 32 || charCode === 13) {
return charCode;
}
return 0;
}
module.exports = getEventCharCode;
},{}],115:[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.
*
* @providesModule getEventKey
* @typechecks static-only
*/
"use strict";
var getEventCharCode = _dereq_("./getEventCharCode");
/**
* Normalization of deprecated HTML5 `key` values
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
*/
var normalizeKey = {
'Esc': 'Escape',
'Spacebar': ' ',
'Left': 'ArrowLeft',
'Up': 'ArrowUp',
'Right': 'ArrowRight',
'Down': 'ArrowDown',
'Del': 'Delete',
'Win': 'OS',
'Menu': 'ContextMenu',
'Apps': 'ContextMenu',
'Scroll': 'ScrollLock',
'MozPrintableKey': 'Unidentified'
};
/**
* Translation from legacy `keyCode` to HTML5 `key`
* Only special keys supported, all others depend on keyboard layout or browser
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
*/
var translateToKey = {
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'
};
/**
* @param {object} nativeEvent Native browser event.
* @return {string} Normalized `key` property.
*/
function getEventKey(nativeEvent) {
if (nativeEvent.key) {
// Normalize inconsistent values reported by browsers due to
// implementations of a working draft specification.
// FireFox implements `key` but returns `MozPrintableKey` for all
// printable characters (normalized to `Unidentified`), ignore it.
var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
if (key !== 'Unidentified') {
return key;
}
}
// Browser does not implement `key`, polyfill as much of it as we can.
if (nativeEvent.type === 'keypress') {
var charCode = getEventCharCode(nativeEvent);
// The enter-key is technically both printable and non-printable and can
// thus be captured by `keypress`, no other non-printable key should.
return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
}
if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
// While user keyboard layout determines the actual meaning of each
// `keyCode` value, almost all function keys have a universal value.
return translateToKey[nativeEvent.keyCode] || 'Unidentified';
}
return '';
}
module.exports = getEventKey;
},{"./getEventCharCode":114}],116:[function(_dereq_,module,exports){
/**
* Copyright 2013 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 getEventModifierState
* @typechecks static-only
*/
"use strict";
/**
* Translation from modifier key to the associated property in the event.
* @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
*/
var modifierKeyToProp = {
'Alt': 'altKey',
'Control': 'ctrlKey',
'Meta': 'metaKey',
'Shift': 'shiftKey'
};
// IE8 does not implement getModifierState so we simply map it to the only
// modifier keys exposed by the event itself, does not support Lock-keys.
// Currently, all major browsers except Chrome seems to support Lock-keys.
function modifierStateGetter(keyArg) {
/*jshint validthis:true */
var syntheticEvent = this;
var nativeEvent = syntheticEvent.nativeEvent;
if (nativeEvent.getModifierState) {
return nativeEvent.getModifierState(keyArg);
}
var keyProp = modifierKeyToProp[keyArg];
return keyProp ? !!nativeEvent[keyProp] : false;
}
function getEventModifierState(nativeEvent) {
return modifierStateGetter;
}
module.exports = getEventModifierState;
},{}],117:[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.
*
* @providesModule getEventTarget
* @typechecks static-only
*/
"use strict";
/**
* Gets the target node from a native browser event by accounting for
* inconsistencies in browser DOM APIs.
*
* @param {object} nativeEvent Native browser event.
* @return {DOMEventTarget} Target node.
*/
function getEventTarget(nativeEvent) {
var target = nativeEvent.target || nativeEvent.srcElement || window;
// Safari may fire events on text nodes (Node.TEXT_NODE is 3).
// @see http://www.quirksmode.org/js/events_properties.html
return target.nodeType === 3 ? target.parentNode : target;
}
module.exports = getEventTarget;
},{}],118:[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.
*
* @providesModule getMarkupWrap
*/
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var invariant = _dereq_("./invariant");
/**
* Dummy container used to detect which wraps are necessary.
*/
var dummyNode =
ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
/**
* Some browsers cannot use `innerHTML` to render certain elements standalone,
* so we wrap them, render the wrapped nodes, then extract the desired node.
*
* In IE8, certain elements cannot render alone, so wrap all elements ('*').
*/
var shouldWrap = {
// Force wrapping for SVG elements because if they get created inside a <div>,
// they will be initialized in the wrong namespace (and will not display).
'circle': true,
'defs': true,
'ellipse': true,
'g': true,
'line': true,
'linearGradient': true,
'path': true,
'polygon': true,
'polyline': true,
'radialGradient': true,
'rect': true,
'stop': true,
'text': true
};
var selectWrap = [1, '<select multiple="true">', '</select>'];
var tableWrap = [1, '<table>', '</table>'];
var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
var svgWrap = [1, '<svg>', '</svg>'];
var markupWrap = {
'*': [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': selectWrap,
'option': selectWrap,
'caption': tableWrap,
'colgroup': tableWrap,
'tbody': tableWrap,
'tfoot': tableWrap,
'thead': tableWrap,
'td': trWrap,
'th': trWrap,
'circle': svgWrap,
'defs': svgWrap,
'ellipse': svgWrap,
'g': svgWrap,
'line': svgWrap,
'linearGradient': svgWrap,
'path': svgWrap,
'polygon': svgWrap,
'polyline': svgWrap,
'radialGradient': svgWrap,
'rect': svgWrap,
'stop': svgWrap,
'text': svgWrap
};
/**
* Gets the markup wrap configuration for the supplied `nodeName`.
*
* NOTE: This lazily detects which wraps are necessary for the current browser.
*
* @param {string} nodeName Lowercase `nodeName`.
* @return {?array} Markup wrap configuration, if applicable.
*/
function getMarkupWrap(nodeName) {
("production" !== "development" ? invariant(!!dummyNode, 'Markup wrapping node not initialized') : invariant(!!dummyNode));
if (!markupWrap.hasOwnProperty(nodeName)) {
nodeName = '*';
}
if (!shouldWrap.hasOwnProperty(nodeName)) {
if (nodeName === '*') {
dummyNode.innerHTML = '<link />';
} else {
dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
}
shouldWrap[nodeName] = !dummyNode.firstChild;
}
return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
}
module.exports = getMarkupWrap;
},{"./ExecutionEnvironment":22,"./invariant":126}],119:[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.
*
* @providesModule getNodeForCharacterOffset
*/
"use strict";
/**
* Given any node return the first leaf node without children.
*
* @param {DOMElement|DOMTextNode} node
* @return {DOMElement|DOMTextNode}
*/
function getLeafNode(node) {
while (node && node.firstChild) {
node = node.firstChild;
}
return node;
}
/**
* Get the next sibling within a container. This will walk up the
* DOM if a node's siblings have been exhausted.
*
* @param {DOMElement|DOMTextNode} node
* @return {?DOMElement|DOMTextNode}
*/
function getSiblingNode(node) {
while (node) {
if (node.nextSibling) {
return node.nextSibling;
}
node = node.parentNode;
}
}
/**
* Get object describing the nodes which contain characters at offset.
*
* @param {DOMElement|DOMTextNode} root
* @param {number} offset
* @return {?object}
*/
function getNodeForCharacterOffset(root, offset) {
var node = getLeafNode(root);
var nodeStart = 0;
var nodeEnd = 0;
while (node) {
if (node.nodeType == 3) {
nodeEnd = nodeStart + node.textContent.length;
if (nodeStart <= offset && nodeEnd >= offset) {
return {
node: node,
offset: offset - nodeStart
};
}
nodeStart = nodeEnd;
}
node = getLeafNode(getSiblingNode(node));
}
}
module.exports = getNodeForCharacterOffset;
},{}],120:[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.
*
* @providesModule getReactRootElementInContainer
*/
"use strict";
var DOC_NODE_TYPE = 9;
/**
* @param {DOMElement|DOMDocument} container DOM element that may contain
* a React component
* @return {?*} DOM element that may have the reactRoot ID, or null.
*/
function getReactRootElementInContainer(container) {
if (!container) {
return null;
}
if (container.nodeType === DOC_NODE_TYPE) {
return container.documentElement;
} else {
return container.firstChild;
}
}
module.exports = getReactRootElementInContainer;
},{}],121:[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.
*
* @providesModule getTextContentAccessor
*/
"use strict";
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var contentKey = null;
/**
* Gets the key used to access text content on a DOM node.
*
* @return {?string} Key used to access text content.
* @internal
*/
function getTextContentAccessor() {
if (!contentKey && ExecutionEnvironment.canUseDOM) {
// Prefer textContent to innerText because many browsers support both but
// SVG <text> elements don't support innerText even when <div> does.
contentKey = 'textContent' in document.documentElement ?
'textContent' :
'innerText';
}
return contentKey;
}
module.exports = getTextContentAccessor;
},{"./ExecutionEnvironment":22}],122:[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.
*
* @providesModule getUnboundedScrollPosition
* @typechecks
*/
"use strict";
/**
* Gets the scroll position of the supplied element or window.
*
* The return values are unbounded, unlike `getScrollPosition`. This means they
* may be negative or exceed the element boundaries (which is possible using
* inertial scrolling).
*
* @param {DOMWindow|DOMElement} scrollable
* @return {object} Map with `x` and `y` keys.
*/
function getUnboundedScrollPosition(scrollable) {
if (scrollable === window) {
return {
x: window.pageXOffset || document.documentElement.scrollLeft,
y: window.pageYOffset || document.documentElement.scrollTop
};
}
return {
x: scrollable.scrollLeft,
y: scrollable.scrollTop
};
}
module.exports = getUnboundedScrollPosition;
},{}],123:[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.
*
* @providesModule hyphenate
* @typechecks
*/
var _uppercasePattern = /([A-Z])/g;
/**
* Hyphenates a camelcased string, for example:
*
* > hyphenate('backgroundColor')
* < "background-color"
*
* For CSS style names, use `hyphenateStyleName` instead which works properly
* with all vendor prefixes, including `ms`.
*
* @param {string} string
* @return {string}
*/
function hyphenate(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
}
module.exports = hyphenate;
},{}],124:[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.
*
* @providesModule hyphenateStyleName
* @typechecks
*/
"use strict";
var hyphenate = _dereq_("./hyphenate");
var msPattern = /^ms-/;
/**
* Hyphenates a camelcased CSS property name, for example:
*
* > hyphenateStyleName('backgroundColor')
* < "background-color"
* > hyphenateStyleName('MozTransition')
* < "-moz-transition"
* > hyphenateStyleName('msTransition')
* < "-ms-transition"
*
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
* is converted to `-ms-`.
*
* @param {string} string
* @return {string}
*/
function hyphenateStyleName(string) {
return hyphenate(string).replace(msPattern, '-ms-');
}
module.exports = hyphenateStyleName;
},{"./hyphenate":123}],125:[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.
*
* @providesModule instantiateReactComponent
* @typechecks static-only
*/
"use strict";
var warning = _dereq_("./warning");
var ReactElement = _dereq_("./ReactElement");
var ReactLegacyElement = _dereq_("./ReactLegacyElement");
var ReactNativeComponent = _dereq_("./ReactNativeComponent");
var ReactEmptyComponent = _dereq_("./ReactEmptyComponent");
/**
* Given an `element` create an instance that will actually be mounted.
*
* @param {object} element
* @param {*} parentCompositeType The composite type that resolved this.
* @return {object} A new instance of the element's constructor.
* @protected
*/
function instantiateReactComponent(element, parentCompositeType) {
var instance;
if ("production" !== "development") {
("production" !== "development" ? warning(
element && (typeof element.type === 'function' ||
typeof element.type === 'string'),
'Only functions or strings can be mounted as React components.'
) : null);
// Resolve mock instances
if (element.type._mockedReactClassConstructor) {
// If this is a mocked class, we treat the legacy factory as if it was the
// class constructor for future proofing unit tests. Because this might
// be mocked as a legacy factory, we ignore any warnings triggerd by
// this temporary hack.
ReactLegacyElement._isLegacyCallWarningEnabled = false;
try {
instance = new element.type._mockedReactClassConstructor(
element.props
);
} finally {
ReactLegacyElement._isLegacyCallWarningEnabled = true;
}
// If the mock implementation was a legacy factory, then it returns a
// element. We need to turn this into a real component instance.
if (ReactElement.isValidElement(instance)) {
instance = new instance.type(instance.props);
}
var render = instance.render;
if (!render) {
// For auto-mocked factories, the prototype isn't shimmed and therefore
// there is no render function on the instance. We replace the whole
// component with an empty component instance instead.
element = ReactEmptyComponent.getEmptyComponent();
} else {
if (render._isMockFunction && !render._getMockImplementation()) {
// Auto-mocked components may have a prototype with a mocked render
// function. For those, we'll need to mock the result of the render
// since we consider undefined to be invalid results from render.
render.mockImplementation(
ReactEmptyComponent.getEmptyComponent
);
}
instance.construct(element);
return instance;
}
}
}
// Special case string values
if (typeof element.type === 'string') {
instance = ReactNativeComponent.createInstanceForTag(
element.type,
element.props,
parentCompositeType
);
} else {
// Normal case for non-mocks and non-strings
instance = new element.type(element.props);
}
if ("production" !== "development") {
("production" !== "development" ? warning(
typeof instance.construct === 'function' &&
typeof instance.mountComponent === 'function' &&
typeof instance.receiveComponent === 'function',
'Only React Components can be mounted.'
) : null);
}
// This actually sets up the internal instance. This will become decoupled
// from the public instance in a future diff.
instance.construct(element);
return instance;
}
module.exports = instantiateReactComponent;
},{"./ReactElement":52,"./ReactEmptyComponent":54,"./ReactLegacyElement":61,"./ReactNativeComponent":66,"./warning":145}],126:[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.
*
* @providesModule invariant
*/
"use strict";
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var invariant = function(condition, format, a, b, c, d, e, f) {
if ("production" !== "development") {
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;
},{}],127:[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.
*
* @providesModule isEventSupported
*/
"use strict";
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var useHasFeature;
if (ExecutionEnvironment.canUseDOM) {
useHasFeature =
document.implementation &&
document.implementation.hasFeature &&
// always returns true in newer browsers as per the standard.
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
document.implementation.hasFeature('', '') !== true;
}
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function isEventSupported(eventNameSuffix, capture) {
if (!ExecutionEnvironment.canUseDOM ||
capture && !('addEventListener' in document)) {
return false;
}
var eventName = 'on' + eventNameSuffix;
var isSupported = eventName in document;
if (!isSupported) {
var element = document.createElement('div');
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] === 'function';
}
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
// This is the only way to test support for the `wheel` event in IE9+.
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
}
return isSupported;
}
module.exports = isEventSupported;
},{"./ExecutionEnvironment":22}],128:[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.
*
* @providesModule isNode
* @typechecks
*/
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
function isNode(object) {
return !!(object && (
typeof Node === 'function' ? object instanceof Node :
typeof object === 'object' &&
typeof object.nodeType === 'number' &&
typeof object.nodeName === 'string'
));
}
module.exports = isNode;
},{}],129:[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.
*
* @providesModule isTextInputElement
*/
"use strict";
/**
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
*/
var supportedInputTypes = {
'color': true,
'date': true,
'datetime': true,
'datetime-local': true,
'email': true,
'month': true,
'number': true,
'password': true,
'range': true,
'search': true,
'tel': true,
'text': true,
'time': true,
'url': true,
'week': true
};
function isTextInputElement(elem) {
return elem && (
(elem.nodeName === 'INPUT' && supportedInputTypes[elem.type]) ||
elem.nodeName === 'TEXTAREA'
);
}
module.exports = isTextInputElement;
},{}],130:[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.
*
* @providesModule isTextNode
* @typechecks
*/
var isNode = _dereq_("./isNode");
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM text node.
*/
function isTextNode(object) {
return isNode(object) && object.nodeType == 3;
}
module.exports = isTextNode;
},{"./isNode":128}],131:[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.
*
* @providesModule joinClasses
* @typechecks static-only
*/
"use strict";
/**
* Combines multiple className strings into one.
* http://jsperf.com/joinclasses-args-vs-array
*
* @param {...?string} classes
* @return {string}
*/
function joinClasses(className/*, ... */) {
if (!className) {
className = '';
}
var nextClass;
var argLength = arguments.length;
if (argLength > 1) {
for (var ii = 1; ii < argLength; ii++) {
nextClass = arguments[ii];
if (nextClass) {
className = (className ? className + ' ' : '') + nextClass;
}
}
}
return className;
}
module.exports = joinClasses;
},{}],132:[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.
*
* @providesModule keyMirror
* @typechecks static-only
*/
"use strict";
var invariant = _dereq_("./invariant");
/**
* Constructs an enumeration with keys equal to their value.
*
* For example:
*
* var COLORS = keyMirror({blue: null, red: null});
* var myColor = COLORS.blue;
* var isColorValid = !!COLORS[myColor];
*
* The last line could not be performed if the values of the generated enum were
* not equal to their keys.
*
* Input: {key1: val1, key2: val2}
* Output: {key1: key1, key2: key2}
*
* @param {object} obj
* @return {object}
*/
var keyMirror = function(obj) {
var ret = {};
var key;
("production" !== "development" ? invariant(
obj instanceof Object && !Array.isArray(obj),
'keyMirror(...): Argument must be an object.'
) : invariant(obj instanceof Object && !Array.isArray(obj)));
for (key in obj) {
if (!obj.hasOwnProperty(key)) {
continue;
}
ret[key] = key;
}
return ret;
};
module.exports = keyMirror;
},{"./invariant":126}],133:[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.
*
* @providesModule keyOf
*/
/**
* Allows extraction of a minified key. Let's the build system minify keys
* without loosing the ability to dynamically use key strings as values
* themselves. Pass in an object with a single key/val pair and it will return
* you the string key of that single record. Suppose you want to grab the
* value for a key 'className' inside of an object. Key/val minification may
* have aliased that key to be 'xa12'. keyOf({className: null}) will return
* 'xa12' in that case. Resolve keys you want to use once at startup time, then
* reuse those resolutions.
*/
var keyOf = function(oneKeyObj) {
var key;
for (key in oneKeyObj) {
if (!oneKeyObj.hasOwnProperty(key)) {
continue;
}
return key;
}
return null;
};
module.exports = keyOf;
},{}],134:[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.
*
* @providesModule mapObject
*/
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* Executes the provided `callback` once for each enumerable own property in the
* object and constructs a new object from the results. The `callback` is
* invoked with three arguments:
*
* - the property value
* - the property name
* - the object being traversed
*
* Properties that are added after the call to `mapObject` will not be visited
* by `callback`. If the values of existing properties are changed, the value
* passed to `callback` will be the value at the time `mapObject` visits them.
* Properties that are deleted before being visited are not visited.
*
* @grep function objectMap()
* @grep function objMap()
*
* @param {?object} object
* @param {function} callback
* @param {*} context
* @return {?object}
*/
function mapObject(object, callback, context) {
if (!object) {
return null;
}
var result = {};
for (var name in object) {
if (hasOwnProperty.call(object, name)) {
result[name] = callback.call(context, object[name], name, object);
}
}
return result;
}
module.exports = mapObject;
},{}],135:[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.
*
* @providesModule memoizeStringOnly
* @typechecks static-only
*/
"use strict";
/**
* Memoizes the return value of a function that accepts one string argument.
*
* @param {function} callback
* @return {function}
*/
function memoizeStringOnly(callback) {
var cache = {};
return function(string) {
if (cache.hasOwnProperty(string)) {
return cache[string];
} else {
return cache[string] = callback.call(this, string);
}
};
}
module.exports = memoizeStringOnly;
},{}],136:[function(_dereq_,module,exports){
/**
* 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 monitorCodeUse
*/
"use strict";
var invariant = _dereq_("./invariant");
/**
* Provides open-source compatible instrumentation for monitoring certain API
* uses before we're ready to issue a warning or refactor. It accepts an event
* name which may only contain the characters [a-z0-9_] and an optional data
* object with further information.
*/
function monitorCodeUse(eventName, data) {
("production" !== "development" ? invariant(
eventName && !/[^a-z0-9_]/.test(eventName),
'You must provide an eventName using only the characters [a-z0-9_]'
) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));
}
module.exports = monitorCodeUse;
},{"./invariant":126}],137:[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.
*
* @providesModule onlyChild
*/
"use strict";
var ReactElement = _dereq_("./ReactElement");
var invariant = _dereq_("./invariant");
/**
* Returns the first child in a collection of children and verifies that there
* is only one child in the collection. The current implementation of this
* function assumes that a single child gets passed without a wrapper, but the
* purpose of this helper function is to abstract away the particular structure
* of children.
*
* @param {?object} children Child collection structure.
* @return {ReactComponent} The first and only `ReactComponent` contained in the
* structure.
*/
function onlyChild(children) {
("production" !== "development" ? invariant(
ReactElement.isValidElement(children),
'onlyChild must be passed a children with exactly one child.'
) : invariant(ReactElement.isValidElement(children)));
return children;
}
module.exports = onlyChild;
},{"./ReactElement":52,"./invariant":126}],138:[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.
*
* @providesModule performance
* @typechecks
*/
"use strict";
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var performance;
if (ExecutionEnvironment.canUseDOM) {
performance =
window.performance ||
window.msPerformance ||
window.webkitPerformance;
}
module.exports = performance || {};
},{"./ExecutionEnvironment":22}],139:[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.
*
* @providesModule performanceNow
* @typechecks
*/
var performance = _dereq_("./performance");
/**
* Detect if we can use `window.performance.now()` and gracefully fallback to
* `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
* because of Facebook's testing infrastructure.
*/
if (!performance || !performance.now) {
performance = Date;
}
var performanceNow = performance.now.bind(performance);
module.exports = performanceNow;
},{"./performance":138}],140:[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.
*
* @providesModule setInnerHTML
*/
"use strict";
var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
var WHITESPACE_TEST = /^[ \r\n\t\f]/;
var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
/**
* Set the innerHTML property of a node, ensuring that whitespace is preserved
* even in IE8.
*
* @param {DOMElement} node
* @param {string} html
* @internal
*/
var setInnerHTML = function(node, html) {
node.innerHTML = html;
};
if (ExecutionEnvironment.canUseDOM) {
// IE8: When updating a just created node with innerHTML only leading
// whitespace is removed. When updating an existing node with innerHTML
// whitespace in root TextNodes is also collapsed.
// @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
// Feature detection; only IE8 is known to behave improperly like this.
var testElement = document.createElement('div');
testElement.innerHTML = ' ';
if (testElement.innerHTML === '') {
setInnerHTML = function(node, html) {
// Magic theory: IE8 supposedly differentiates between added and updated
// nodes when processing innerHTML, innerHTML on updated nodes suffers
// from worse whitespace behavior. Re-adding a node like this triggers
// the initial and more favorable whitespace behavior.
// TODO: What to do on a detached node?
if (node.parentNode) {
node.parentNode.replaceChild(node, node);
}
// We also implement a workaround for non-visible tags disappearing into
// thin air on IE8, this only happens if there is no visible text
// in-front of the non-visible tags. Piggyback on the whitespace fix
// and simply check if any non-visible tags appear in the source.
if (WHITESPACE_TEST.test(html) ||
html[0] === '<' && NONVISIBLE_TEST.test(html)) {
// Recover leading whitespace by temporarily prepending any character.
// \uFEFF has the potential advantage of being zero-width/invisible.
node.innerHTML = '\uFEFF' + html;
// deleteData leaves an empty `TextNode` which offsets the index of all
// children. Definitely want to avoid this.
var textNode = node.firstChild;
if (textNode.data.length === 1) {
node.removeChild(textNode);
} else {
textNode.deleteData(0, 1);
}
} else {
node.innerHTML = html;
}
};
}
}
module.exports = setInnerHTML;
},{"./ExecutionEnvironment":22}],141:[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.
*
* @providesModule shallowEqual
*/
"use strict";
/**
* Performs equality by iterating through keys on an object and returning
* false when any key has values which are not strictly equal between
* objA and objB. Returns true when the values of all keys are strictly equal.
*
* @return {boolean}
*/
function shallowEqual(objA, objB) {
if (objA === objB) {
return true;
}
var key;
// Test for A's keys different from B.
for (key in objA) {
if (objA.hasOwnProperty(key) &&
(!objB.hasOwnProperty(key) || objA[key] !== objB[key])) {
return false;
}
}
// Test for B's keys missing from A.
for (key in objB) {
if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
},{}],142:[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.
*
* @providesModule shouldUpdateReactComponent
* @typechecks static-only
*/
"use strict";
/**
* Given a `prevElement` and `nextElement`, determines if the existing
* instance should be updated as opposed to being destroyed or replaced by a new
* instance. Both arguments are elements. This ensures that this logic can
* operate on stateless trees without any backing instance.
*
* @param {?object} prevElement
* @param {?object} nextElement
* @return {boolean} True if the existing instance should be updated.
* @protected
*/
function shouldUpdateReactComponent(prevElement, nextElement) {
if (prevElement && nextElement &&
prevElement.type === nextElement.type &&
prevElement.key === nextElement.key &&
prevElement._owner === nextElement._owner) {
return true;
}
return false;
}
module.exports = shouldUpdateReactComponent;
},{}],143:[function(_dereq_,module,exports){
/**
* 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 toArray
* @typechecks
*/
var invariant = _dereq_("./invariant");
/**
* Convert array-like objects to arrays.
*
* This API assumes the caller knows the contents of the data type. For less
* well defined inputs use createArrayFrom.
*
* @param {object|function|filelist} obj
* @return {array}
*/
function toArray(obj) {
var length = obj.length;
// Some browse builtin objects can report typeof 'function' (e.g. NodeList in
// old versions of Safari).
("production" !== "development" ? invariant(
!Array.isArray(obj) &&
(typeof obj === 'object' || typeof obj === 'function'),
'toArray: Array-like object expected'
) : invariant(!Array.isArray(obj) &&
(typeof obj === 'object' || typeof obj === 'function')));
("production" !== "development" ? invariant(
typeof length === 'number',
'toArray: Object needs a length property'
) : invariant(typeof length === 'number'));
("production" !== "development" ? invariant(
length === 0 ||
(length - 1) in obj,
'toArray: Object should have keys for indices'
) : invariant(length === 0 ||
(length - 1) in obj));
// Old IE doesn't give collections access to hasOwnProperty. Assume inputs
// without method will throw during the slice call and skip straight to the
// fallback.
if (obj.hasOwnProperty) {
try {
return Array.prototype.slice.call(obj);
} catch (e) {
// IE < 9 does not support Array#slice on collections objects
}
}
// Fall back to copying key by key. This assumes all keys have a value,
// so will not preserve sparsely populated inputs.
var ret = Array(length);
for (var ii = 0; ii < length; ii++) {
ret[ii] = obj[ii];
}
return ret;
}
module.exports = toArray;
},{"./invariant":126}],144:[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.
*
* @providesModule traverseAllChildren
*/
"use strict";
var ReactElement = _dereq_("./ReactElement");
var ReactInstanceHandles = _dereq_("./ReactInstanceHandles");
var invariant = _dereq_("./invariant");
var SEPARATOR = ReactInstanceHandles.SEPARATOR;
var SUBSEPARATOR = ':';
/**
* TODO: Test that:
* 1. `mapChildren` transforms strings and numbers into `ReactTextComponent`.
* 2. it('should fail when supplied duplicate key', function() {
* 3. That a single child and an array with one item have the same key pattern.
* });
*/
var userProvidedKeyEscaperLookup = {
'=': '=0',
'.': '=1',
':': '=2'
};
var userProvidedKeyEscapeRegex = /[=.:]/g;
function userProvidedKeyEscaper(match) {
return userProvidedKeyEscaperLookup[match];
}
/**
* Generate a key string that identifies a component within a set.
*
* @param {*} component A component that could contain a manual key.
* @param {number} index Index that is used if a manual key is not provided.
* @return {string}
*/
function getComponentKey(component, index) {
if (component && component.key != null) {
// Explicit key
return wrapUserProvidedKey(component.key);
}
// Implicit key determined by the index in the set
return index.toString(36);
}
/**
* Escape a component key so that it is safe to use in a reactid.
*
* @param {*} key Component key to be escaped.
* @return {string} An escaped string.
*/
function escapeUserProvidedKey(text) {
return ('' + text).replace(
userProvidedKeyEscapeRegex,
userProvidedKeyEscaper
);
}
/**
* Wrap a `key` value explicitly provided by the user to distinguish it from
* implicitly-generated keys generated by a component's index in its parent.
*
* @param {string} key Value of a user-provided `key` attribute
* @return {string}
*/
function wrapUserProvidedKey(key) {
return '$' + escapeUserProvidedKey(key);
}
/**
* @param {?*} children Children tree container.
* @param {!string} nameSoFar Name of the key path so far.
* @param {!number} indexSoFar Number of children encountered until this point.
* @param {!function} callback Callback to invoke with each child found.
* @param {?*} traverseContext Used to pass information throughout the traversal
* process.
* @return {!number} The number of children in this subtree.
*/
var traverseAllChildrenImpl =
function(children, nameSoFar, indexSoFar, callback, traverseContext) {
var nextName, nextIndex;
var subtreeCount = 0; // Count of children found in the current subtree.
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
nextName = (
nameSoFar +
(nameSoFar ? SUBSEPARATOR : SEPARATOR) +
getComponentKey(child, i)
);
nextIndex = indexSoFar + subtreeCount;
subtreeCount += traverseAllChildrenImpl(
child,
nextName,
nextIndex,
callback,
traverseContext
);
}
} else {
var type = typeof children;
var isOnlyChild = nameSoFar === '';
// If it's the only child, treat the name as if it was wrapped in an array
// so that it's consistent if the number of children grows
var storageName =
isOnlyChild ? SEPARATOR + getComponentKey(children, 0) : nameSoFar;
if (children == null || type === 'boolean') {
// All of the above are perceived as null.
callback(traverseContext, null, storageName, indexSoFar);
subtreeCount = 1;
} else if (type === 'string' || type === 'number' ||
ReactElement.isValidElement(children)) {
callback(traverseContext, children, storageName, indexSoFar);
subtreeCount = 1;
} else if (type === 'object') {
("production" !== "development" ? invariant(
!children || children.nodeType !== 1,
'traverseAllChildren(...): Encountered an invalid child; DOM ' +
'elements are not valid children of React components.'
) : invariant(!children || children.nodeType !== 1));
for (var key in children) {
if (children.hasOwnProperty(key)) {
nextName = (
nameSoFar + (nameSoFar ? SUBSEPARATOR : SEPARATOR) +
wrapUserProvidedKey(key) + SUBSEPARATOR +
getComponentKey(children[key], 0)
);
nextIndex = indexSoFar + subtreeCount;
subtreeCount += traverseAllChildrenImpl(
children[key],
nextName,
nextIndex,
callback,
traverseContext
);
}
}
}
}
return subtreeCount;
};
/**
* Traverses children that are typically specified as `props.children`, but
* might also be specified through attributes:
*
* - `traverseAllChildren(this.props.children, ...)`
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
*
* The `traverseContext` is an optional argument that is passed through the
* entire traversal. It can be used to store accumulations or anything else that
* the callback might find relevant.
*
* @param {?*} children Children tree object.
* @param {!function} callback To invoke upon traversing each child.
* @param {?*} traverseContext Context for traversal.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildren(children, callback, traverseContext) {
if (children == null) {
return 0;
}
return traverseAllChildrenImpl(children, '', 0, callback, traverseContext);
}
module.exports = traverseAllChildren;
},{"./ReactElement":52,"./ReactInstanceHandles":60,"./invariant":126}],145:[function(_dereq_,module,exports){
/**
* 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
*/
"use strict";
var emptyFunction = _dereq_("./emptyFunction");
/**
* 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 ("production" !== "development") {
warning = function(condition, format ) {var args=Array.prototype.slice.call(arguments,2);
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;
},{"./emptyFunction":107}]},{},[1])(1)
});
|
export { default as AreaChart } from './Area';
export { default as BarChart } from './Bar';
export { default as CandlestickChart } from './Candlestick';
export { default as ColumnChart } from './Column';
export { default as HeatmapChart } from './Heatmap';
export { default as LineChart } from './Line';
export { default as MixedChart } from './Mixed';
export { default as PieChart } from './Pie';
|
// see SignupForm.js for comments
import React, { useState } from 'react';
import { Form, Button, Alert } from 'react-bootstrap';
import Auth from '../utils/auth';
import { useMutation } from '@apollo/react-hooks';
import { LOGIN_USER } from '../utils/mutations';
const LoginForm = () => {
const [userFormData, setUserFormData] = useState({ email: '', password: '' });
const [validated] = useState(false);
const [showAlert, setShowAlert] = useState(false);
const [loginUser] = useMutation(LOGIN_USER);
const handleInputChange = (event) => {
const { name, value } = event.target;
setUserFormData({ ...userFormData, [name]: value });
};
const handleFormSubmit = async (event) => {
event.preventDefault();
// check if form has everything (as per react-bootstrap docs)
const form = event.currentTarget;
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
try {
const { data } = await loginUser({
variables: {...userFormData}
});
Auth.login(data.login.token);
} catch (err) {
console.error(err);
setShowAlert(true);
}
setUserFormData({
username: '',
email: '',
password: '',
});
};
return (
<>
<Form noValidate validated={validated} onSubmit={handleFormSubmit}>
<Alert dismissible onClose={() => setShowAlert(false)} show={showAlert} variant='danger'>
Something went wrong with your login credentials!
</Alert>
<Form.Group>
<Form.Label htmlFor='email'>Email</Form.Label>
<Form.Control
type='text'
placeholder='Your email'
name='email'
onChange={handleInputChange}
value={userFormData.email}
required
/>
<Form.Control.Feedback type='invalid'>Email is required!</Form.Control.Feedback>
</Form.Group>
<Form.Group>
<Form.Label htmlFor='password'>Password</Form.Label>
<Form.Control
type='password'
placeholder='Your password'
name='password'
onChange={handleInputChange}
value={userFormData.password}
required
/>
<Form.Control.Feedback type='invalid'>Password is required!</Form.Control.Feedback>
</Form.Group>
<Button
disabled={!(userFormData.email && userFormData.password)}
type='submit'
variant='success'>
Submit
</Button>
</Form>
</>
);
};
export default LoginForm;
|
define({
start: 'Uruchom',
chooseTemplateTip: 'Wybierz szablon',
chooseOtherTemplateTip: 'Wybierz inny szablon',
emptyTemplate: 'Pusty szablon',
lockItemRatio: 'Zablokuj współczynnik szerokość/wysokość',
itemStyle: 'Styl elementu',
on: 'pozostało:',
off: 'Wył',
cardAnimation: 'Animacja',
cardTransition: 'Przejście',
classic: 'Klasyczny',
classicTips: 'Umożliwia wyświetlanie powiązanych informacji.',
classicHover: 'Advanced',
classicHoverTips: 'Udostępnia różne kompozycje po wskazaniu kursorem, co umożliwia wyświetlenie dodatkowych informacji.',
// template
textPlaceholder: 'Kliknij dwukrotnie, aby edytować tekst',
buttonText: 'Przycisk',
contentPlaceholder: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
cardTemplateTitle: 'Tytuł karty',
createdAuthor: 'Autor',
createdBy: 'Utworzone przez',
createdDate: 'Data utworzenia',
viewsNumber: 'Liczba widoków',
createdDateTime: 'xxx',
createdAuthorName: 'admin',
shareButtonText: 'Udostępnianie',
totlePeople: 'Łączna liczba użytkowników',
oldPeopleText: 'Starzy użytkownicy',
youngPeopleText: 'Młodzi użytkownicy',
regularCard: 'Zwykły',
hoverCard: 'Wskazanie kursorem',
enableHover: 'Włącz wskazywanie kursorem',
useTips: 'Aby skonfigurować zawartość karty, wybierz każdy komponent zawarty w karcie na płótnie. Na przykład kliknij obraz, aby uzyskać dostęp do jego ustawień.',
cardWidgetName: 'Karta',
cardWidgetState: 'Województwo'
});
|
import { Button, makeStyles, Typography } from '@material-ui/core';
import React from 'react';
import { blue } from '../utils/static-value'
const Btn = ({ text, marginTop, isSubmit,id }) => {
const useStyle = makeStyles((theme) => ({
btnStyle: {
marginTop: marginTop,
height: 44,
width: 141,
borderRadius: 30,
border: `0px solid ${blue}`,
backgroundColor: blue,
color: "white",
"&:hover": {
backgroundColor: blue,
color: "white",
},
[theme.breakpoints.up('md')]: {
height: 54,
width: 161,
}
}
}))
const classes = useStyle()
const element = <Button id={id} type={isSubmit ? "submit" : ""} className={classes.btnStyle} ><Typography variant="h2">{text}</Typography></Button>
return (
element
);
};
export default Btn;
|
const MediaWiki = require('mediawiki');
const wiki = new MediaWiki.Bot({
endpoint: "https://alttp-wiki.net/api.php",
userAgent: "alttpbot/1.0"
});
let search = process.argv[2] || "test";
wiki.get({action: "query", list: "search", srsearch: `"${search}"`, srwhat: "text", srprop: "snippet|titlesnippet|sectiontitle|sectionsnippet", srlimit: "10"})
.complete(response => {
if (response.query.searchinfo.totalhits > 0) {
console.log(JSON.stringify(response.query));
} else {
// no results found
}
})
.error(err => {console.error(err)});
// @todo parse this response and convert title into a link
|
game.renderer = function(){
}
game.renderer.render = function(stgae){
}
|
'use strict';
const superagent = require('superagent');
const server = require('../lib/server');
const accCharMock = require('./lib/acc-char-mock');
const logger = require('../lib/logger');
const API_URL = `http://localhost:${process.env.PORT}`;
describe('USER PLAYS VIDEO GAME', () => {
beforeAll(server.start);
afterAll(server.stop);
beforeEach(accCharMock.pUserCleanMock);
test('user creates account, chooses character, plays video game.', () => {
return accCharMock.pUserMock()
.then((mock) => {
return superagent.get(`${API_URL}/api/status/${mock.account.character[0]._id}`)
.auth(mock.request.username, mock.request.password)
.then((status) => {
logger.log(logger.INFO, 'status', status);
expect(status.body.HP).toEqual(10);
expect(status.body.ac).toEqual(16);
expect(status.body.currentRoom).toEqual('At the [Entrance], Bright, brilliant colors are to be seen everywhere, the stones and pigments undimmed by the passage of decades. The floor of the corridor is a colorful mosaic of stone, with a distinct winding path of red tiles about two feet wide snaking its way south down the corridor. No stonework can be seen on the walls or the ceiling twenty feet above, for some cement or plaster has been smoothed over all of these surfaces and then illustrated. The scenes show fields with kine grazing, workers of various races and strange human-animal mixtures--pig human, ape-human, and dog-human--going about various tasks. Certain of the frescoes show rooms of some building--a library filled with many books and scrolls, the door of a torture chamber, and a wizard\'s work room. There are chairs, windows, boxes, bales, doors, chests, birds, bats, spiders, and all manner of things shown on the walls.');
expect(status.body.inventory).toEqual([]);
return superagent.put(`${API_URL}/api/move/Archway`)
.auth(mock.request.username, mock.request.password)
.then((response) => {
expect(response.body.roomName).toEqual('The Arch of Mist');
return superagent.put(`${API_URL}/api/move/Entrance`)
.auth(mock.request.username, mock.request.password)
.then((responsetwo) => {
expect(responsetwo.body.roomName).toEqual('Entrance of the Tomb of Horrors');
return superagent.put(`${API_URL}/api/move/Fresco`)
.auth(mock.request.username, mock.request.password)
.then((responsethree) => {
expect(responsethree.body.roomName).toEqual('Fresco of the Wizardly Work Room');
return superagent.put(`${API_URL}/api/move/Gargoyle`)
.auth(mock.request.username, mock.request.password)
.then((responsefour) => {
logger.log(logger.INFO, responsefour.body);
expect(responsefour.body.warning).toBeTruthy();
return superagent.put(`${API_URL}/api/fight/confirm/${mock.account.character[0]._id}`)
.auth(mock.request.username, mock.request.password)
.then((result) => {
expect(typeof result.body).toEqual('object');
});
});
});
});
});
});
});
});
});
|
// This doesn't have to be here – but if we do import Juniper here, it's already
// preloaded and cached when we dynamically import it in code.js.
import Juniper from './src/components/juniper' // eslint-disable-line no-unused-vars
|
/*global module:false*/
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks("grunt-contrib-yuidoc");
grunt.loadNpmTasks('grunt-exec');
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
browser: {
src: ['lib/*.js', 'test/*.js'],
options: {
jshintrc: ".jshintrc"
}
}
},
clean: ['coverage', 'doc'],
yuidoc: {
compile: {
name: '<%= pkg.name %>',
description: '<%= pkg.description %>',
version: '<%= pkg.version %>',
url: '<%= pkg.homepage %>',
logo: 'https://raw.github.com/yaniswang/jWebDriver/master/logo_s.png',
options: {
paths: './lib',
themedir: 'path/to/custom/theme/',
outdir: './doc'
}
}
},
exec: {
test: {
command: '"./node_modules/.bin/mocha"',
stdout: true,
stderr: true
},
cover: {
command: '"./node_modules/.bin/istanbul" cover "./node_modules/mocha/bin/_mocha"',
stdout: true,
stderr: true
}
},
watch: {
src: {
files: ['lib/*.js'],
tasks: 'dev'
}
}
});
grunt.registerTask('dev', ['jshint', 'exec:test']);
grunt.registerTask('default', ['jshint', 'clean', 'exec:cover', 'yuidoc']);
};
|
/*global ODSA */
$(document).ready(function() {
"use strict";
var av_name = "LazyLists5CON"; // Illustrate and develop the is.map function
var av = new JSAV(av_name);
var leftMargin = 10;
var offset_for_each_var = 50;
// var offset_between_var_label_and_cell = 20;
var arrValues = [1,"Thunk to expose integers after 1"];
var arr = av.ds.array(arrValues, {indexed: false, left: leftMargin, top: 20});
var arr_label = av.label("intsFrom1", {left: leftMargin, top: 0});
var arr1 = av.ds.array([12,"Thunk to expose integers after 12"], {indexed: false, left: leftMargin, top: 20 + offset_for_each_var}).hide();
var arr_label1 = av.label("evens12", {left: leftMargin, top: 0 + offset_for_each_var}).hide();
var arr2 = av.ds.array([12,14,16,18,20,22], {indexed: false, left: leftMargin, top: 20 + 2 * offset_for_each_var}).hide();
var arr_label2 = av.label("first6", {left: leftMargin, top: 0 + 2 * offset_for_each_var}).hide();
// var arr3 = av.ds.array([3,"Thunk to expose integers after 3"], {indexed: false, left: leftMargin, top: 20 + 3 * offset_for_each_var}).hide();
// var arr_label3 = av.label("s2", {left: leftMargin, top: 0 + 3 * offset_for_each_var}).hide();
// var arr4 = av.ds.array([3,4,5,6,7,8], {indexed: false, left: leftMargin, top: 20 + 4 * offset_for_each_var}).hide();
// var arr_label4 = av.label("s3", {left: leftMargin, top: 0 + 4 * offset_for_each_var}).hide();
var pseudo1 = av.code(
{
url:'../../../AV/PL/LazyLists/LazyLists5.code.1',
relativeTo:arr,
anchor:'right top',
myAnchor:'left top',
left: leftMargin+200,
top: 0,
lineNumbers: false
}
);
// Slide 1
av.umsg("The is.drop function takes an infinite sequence and returns a new sequence with the first n elements removed. Note that what is returned is still an infinite sequence since we have only removed a finite number. This is illustrated by the call to is.drop below, which returns a sequence of the even integers starting with 12. is.drop returns an infinite sequence, which is always an integer followed by a think. Contrast that with is.take, which returns a finite list, as illustrated by first6.");
arr.addClass(1,"wider");
arr1.addClass(1,"wider");
arr1.show();
arr_label1.show();
arr2.show();
arr_label2.show();
pseudo1.hide([6,9]);
pseudo1.highlight([13,14,15,16,17,18,19,20]);
av.displayInit();
//S 2
av.umsg("To implement the drop function, first consider the case highlighted below in which the number of items to drop is zero.");
pseudo1.unhighlight([13,14,15,16,17,18,19,20]);
pseudo1.highlight([5]);
av.step();
// S 3
av.umsg('This case is easy and represents the base case for the recursion on n. We just need to return the sequence that we are given in unaltered form.');
pseudo1.unhighlight(5);
pseudo1.hide(5);
pseudo1.show(6);
pseudo1.highlight(6);
av.step();
// S 4
av.umsg("Note that the recursion here is being controlled by the finite number n, not by the infinite sequence seq. This is different from what we have seen in is.map and is.filter where the recursion had to occur inside a thunk. Keep this in mind as you try to predict how the question marks below will be completed in the next slide.");
pseudo1.unhighlight(6);
pseudo1.highlight(8);
av.step();
// S 5
av.umsg("Because the recursion is being controlled by n, we must reduce that argument on the recursive call to ensure we reach the base case. At the same time, we throw away the head of the sequence at this level and pass in the (thawed) thunk that is the tail of the sequence.");
pseudo1.unhighlight(8);
pseudo1.hide(8);
pseudo1.show(9);
pseudo1.highlight(9);
av.step();
av.recorded();
});
|
(function TranslateAppModule() {
"use strict";
angular.module('translate.app', ['ngRoute'])
.config(TranslateAppConfig);
TranslateAppConfig.$inject = ['$routeProvider'];
function TranslateAppConfig($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'pages/translate-page.html'
})
.when('/config', {
templateUrl: 'pages/config-page.html',
controller: 'configTabsController',
controllerAs: 'vm'
})
;
}
})();
|
// Quantity buttons
function qtySum(){
var arr = document.getElementsByName('qtyInput');
var tot=0;
for(var i=0;i<arr.length;i++){
if(parseInt(arr[i].value))
tot += parseInt(arr[i].value);
}
var cardQty = document.querySelector(".qtyTotal");
// if(tot != 0){
cardQty.innerHTML = tot;
sessionStorage.setItem('guests',tot);
// }
}
qtySum();
$(function() {
$(".qtyButtons input").after('<div class="qtyInc"></div>');
$(".qtyButtons input").before('<div class="qtyDec"></div>');
$(".qtyDec, .qtyInc").on("click", function() {
var $button = $(this);
var oldValue = $button.parent().find("input").val();
if ($button.hasClass('qtyInc')) {
var newVal = parseFloat(oldValue) + 1;
} else {
// don't allow decrementing below zero
if (oldValue > 0) {
var newVal = parseFloat(oldValue) - 1;
} else {
newVal = 0;
}
}
$button.parent().find("input").val(newVal);
qtySum();
$(".qtyTotal").addClass("rotate-x");
});
function removeAnimation() { $(".qtyTotal").removeClass("rotate-x"); }
const counter = document.querySelector(".qtyTotal");
counter.addEventListener("animationend", removeAnimation);
});
|
/*!
* angular-translate - v2.18.2 - 2020-01-04
*
* Copyright (c) 2020 The angular-translate team, Pascal Precht; Licensed MIT
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define([], function () {
return (factory());
});
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
factory();
}
}(this, function () {
angular.module('pascalprecht.translate')
/**
* @ngdoc object
* @name pascalprecht.translate.$translatePartialLoaderProvider
*
* @description
* By using a $translatePartialLoaderProvider you can configure a list of a needed
* translation parts directly during the configuration phase of your application's
* lifetime. All parts you add by using this provider would be loaded by
* angular-translate at the startup as soon as possible.
*/
.provider('$translatePartialLoader', $translatePartialLoader);
function $translatePartialLoader() {
'use strict';
/**
* @constructor
* @name Part
*
* @description
* Represents Part object to add and set parts at runtime.
*/
function Part(name, priority, urlTemplate) {
this.name = name;
this.isActive = true;
this.tables = {};
this.priority = priority || 0;
this.langPromises = {};
this.urlTemplate = urlTemplate;
}
/**
* @name parseUrl
* @method
*
* @description
* Returns a parsed url template string and replaces given target lang
* and part name it.
*
* @param {string|function} urlTemplate - Either a string containing an url pattern (with
* '{part}' and '{lang}') or a function(part, lang)
* returning a string.
* @param {string} targetLang - Language key for language to be used.
* @return {string} Parsed url template string
*/
Part.prototype.parseUrl = function (urlTemplate, targetLang) {
if (angular.isFunction(urlTemplate)) {
return urlTemplate(this.name, targetLang);
}
return urlTemplate.replace(/\{part\}/g, this.name).replace(/\{lang\}/g, targetLang);
};
Part.prototype.getTable = function (lang, $q, $http, $httpOptions, urlTemplate, errorHandler) {
//locals
var self = this;
var lastLangPromise = this.langPromises[lang];
var deferred = $q.defer();
//private helper helpers
var fetchData = function () {
return $http(
angular.extend({
method : 'GET',
url : self.parseUrl(self.urlTemplate || urlTemplate, lang)
},
$httpOptions)
);
};
//private helper
var handleNewData = function (data) {
self.tables[lang] = data;
deferred.resolve(data);
};
//private helper
var rejectDeferredWithPartName = function () {
deferred.reject(self.name);
};
//private helper
var tryGettingThisTable = function () {
//data fetching logic
fetchData().then(
function (result) {
handleNewData(result.data);
},
function (errorResponse) {
if (errorHandler) {
errorHandler(self.name, lang, errorResponse).then(handleNewData, rejectDeferredWithPartName);
} else {
rejectDeferredWithPartName();
}
});
};
//loading logic
if (!this.tables[lang]) {
//let's try loading the data
if (!lastLangPromise) {
//this is the first request - just go ahead and hit the server
tryGettingThisTable();
} else {
//this is an additional request after one or more unfinished or failed requests
//chain the deferred off the previous request's promise so that this request conditionally executes
//if the previous request succeeds then the result will be passed through, but if it fails then this request will try again and hit the server
lastLangPromise.then(deferred.resolve, tryGettingThisTable);
}
//retain a reference to the last promise so we can continue the chain if another request is made before any succeed
//you can picture the promise chain as a singly-linked list (formed by the .then handler queues) that's traversed by the execution context
this.langPromises[lang] = deferred.promise;
}
else {
//the part has already been loaded - if lastLangPromise is also undefined then the table has been populated using setPart
//this breaks the promise chain because we're not tying langDeferred's outcome to a previous call's promise handler queues, but we don't care because there's no asynchronous execution context to keep track of anymore
deferred.resolve(this.tables[lang]);
}
return deferred.promise;
};
var parts = {};
function hasPart(name) {
return Object.prototype.hasOwnProperty.call(parts, name);
}
function isStringValid(str) {
return angular.isString(str) && str !== '';
}
function isPartAvailable(name) {
if (!isStringValid(name)) {
throw new TypeError('Invalid type of a first argument, a non-empty string expected.');
}
return (hasPart(name) && parts[name].isActive);
}
function deepExtend(dst, src) {
for (var property in src) {
if (src[property] && src[property].constructor &&
src[property].constructor === Object) {
dst[property] = dst[property] || {};
deepExtend(dst[property], src[property]);
} else {
dst[property] = src[property];
}
}
return dst;
}
function getPrioritizedParts() {
var prioritizedParts = [];
for (var part in parts) {
if (parts[part].isActive) {
prioritizedParts.push(parts[part]);
}
}
prioritizedParts.sort(function (a, b) {
return a.priority - b.priority;
});
return prioritizedParts;
}
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoaderProvider#addPart
* @methodOf pascalprecht.translate.$translatePartialLoaderProvider
*
* @description
* Registers a new part of the translation table to be loaded once the
* `angular-translate` gets into runtime phase. It does not actually load any
* translation data, but only registers a part to be loaded in the future.
*
* @param {string} name A name of the part to add
* @param {int} [priority=0] Sets the load priority of this part.
* @param {string|function} urlTemplate Either a string containing an url pattern (with
* '{part}' and '{lang}') or a function(part, lang)
* returning a string.
*
* @returns {object} $translatePartialLoaderProvider, so this method is chainable
* @throws {TypeError} The method could throw a **TypeError** if you pass the param
* of the wrong type. Please, note that the `name` param has to be a
* non-empty **string**.
*/
this.addPart = function (name, priority, urlTemplate) {
if (!isStringValid(name)) {
throw new TypeError('Couldn\'t add part, part name has to be a string!');
}
if (!hasPart(name)) {
parts[name] = new Part(name, priority, urlTemplate);
}
parts[name].isActive = true;
return this;
};
/**
* @ngdocs function
* @name pascalprecht.translate.$translatePartialLoaderProvider#setPart
* @methodOf pascalprecht.translate.$translatePartialLoaderProvider
*
* @description
* Sets a translation table to the specified part. This method does not make the
* specified part available, but only avoids loading this part from the server.
*
* @param {string} lang A language of the given translation table
* @param {string} part A name of the target part
* @param {object} table A translation table to set to the specified part
*
* @return {object} $translatePartialLoaderProvider, so this method is chainable
* @throws {TypeError} The method could throw a **TypeError** if you pass params
* of the wrong type. Please, note that the `lang` and `part` params have to be a
* non-empty **string**s and the `table` param has to be an object.
*/
this.setPart = function (lang, part, table) {
if (!isStringValid(lang)) {
throw new TypeError('Couldn\'t set part.`lang` parameter has to be a string!');
}
if (!isStringValid(part)) {
throw new TypeError('Couldn\'t set part.`part` parameter has to be a string!');
}
if (typeof table !== 'object' || table === null) {
throw new TypeError('Couldn\'t set part. `table` parameter has to be an object!');
}
if (!hasPart(part)) {
parts[part] = new Part(part);
parts[part].isActive = false;
}
parts[part].tables[lang] = table;
return this;
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoaderProvider#deletePart
* @methodOf pascalprecht.translate.$translatePartialLoaderProvider
*
* @description
* Removes the previously added part of the translation data. So, `angular-translate` will not
* load it at the startup.
*
* @param {string} name A name of the part to delete
*
* @returns {object} $translatePartialLoaderProvider, so this method is chainable
*
* @throws {TypeError} The method could throw a **TypeError** if you pass the param of the wrong
* type. Please, note that the `name` param has to be a non-empty **string**.
*/
this.deletePart = function (name) {
if (!isStringValid(name)) {
throw new TypeError('Couldn\'t delete part, first arg has to be string.');
}
if (hasPart(name)) {
parts[name].isActive = false;
}
return this;
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoaderProvider#isPartAvailable
* @methodOf pascalprecht.translate.$translatePartialLoaderProvider
*
* @description
* Checks if the specific part is available. A part becomes available after it was added by the
* `addPart` method. Available parts would be loaded from the server once the `angular-translate`
* asks the loader to that.
*
* @param {string} name A name of the part to check
*
* @returns {boolean} Returns **true** if the part is available now and **false** if not.
*
* @throws {TypeError} The method could throw a **TypeError** if you pass the param of the wrong
* type. Please, note that the `name` param has to be a non-empty **string**.
*/
this.isPartAvailable = isPartAvailable;
/**
* @ngdoc object
* @name pascalprecht.translate.$translatePartialLoader
*
* @requires $q
* @requires $http
* @requires $injector
* @requires $rootScope
* @requires $translate
*
* @description
*
* @param {object} options Options object
*
* @throws {TypeError}
*/
this.$get = ['$rootScope', '$injector', '$q', '$http', '$log',
function ($rootScope, $injector, $q, $http, $log) {
/**
* @ngdoc event
* @name pascalprecht.translate.$translatePartialLoader#$translatePartialLoaderStructureChanged
* @eventOf pascalprecht.translate.$translatePartialLoader
* @eventType broadcast on root scope
*
* @description
* A $translatePartialLoaderStructureChanged event is called when a state of the loader was
* changed somehow. It could mean either some part is added or some part is deleted. Anyway when
* you get this event the translation table is not longer current and has to be updated.
*
* @param {string} name A name of the part which is a reason why the event was fired
*/
var service = function (options) {
if (!isStringValid(options.key)) {
throw new TypeError('Unable to load data, a key is not a non-empty string.');
}
if (!isStringValid(options.urlTemplate) && !angular.isFunction(options.urlTemplate)) {
throw new TypeError('Unable to load data, a urlTemplate is not a non-empty string or not a function.');
}
var errorHandler = options.loadFailureHandler;
if (errorHandler !== undefined) {
if (!angular.isString(errorHandler)) {
throw new Error('Unable to load data, a loadFailureHandler is not a string.');
} else {
errorHandler = $injector.get(errorHandler);
}
}
var loaders = [],
prioritizedParts = getPrioritizedParts();
angular.forEach(prioritizedParts, function (part) {
loaders.push(
part.getTable(options.key, $q, $http, options.$http, options.urlTemplate, errorHandler)
);
part.urlTemplate = part.urlTemplate || options.urlTemplate;
});
// workaround for #1781
var structureHasBeenChangedWhileLoading = false;
var dirtyCheckEventCloser = $rootScope.$on('$translatePartialLoaderStructureChanged', function () {
structureHasBeenChangedWhileLoading = true;
});
return $q.all(loaders)
.then(function () {
dirtyCheckEventCloser();
if (structureHasBeenChangedWhileLoading) {
if (!options.__retries) {
// the part structure has been changed while loading (the origin ones)
// this can happen if an addPart/removePart has been invoked right after a $translate.use(lang)
// TODO maybe we can optimize this with the actual list of missing parts
options.__retries = (options.__retries || 0) + 1;
return service(options);
} else {
// the part structure has been changed again while loading (retried one)
// because this could an infinite loop, this will not load another one again
$log.warn('The partial loader has detected a multiple structure change (with addPort/removePart) ' +
'while loading translations. You should consider using promises of $translate.use(lang) and ' +
'$translate.refresh(). Also parts should be added/removed right before an explicit refresh ' +
'if possible.');
}
}
var table = {};
prioritizedParts = getPrioritizedParts();
angular.forEach(prioritizedParts, function (part) {
deepExtend(table, part.tables[options.key]);
});
return table;
}, function () {
dirtyCheckEventCloser();
return $q.reject(options.key);
});
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoader#addPart
* @methodOf pascalprecht.translate.$translatePartialLoader
*
* @description
* Registers a new part of the translation table. This method does not actually perform any xhr
* requests to get translation data. The new parts will be loaded in order of priority from the server next time
* `angular-translate` asks the loader to load translations.
*
* @param {string} name A name of the part to add
* @param {int} [priority=0] Sets the load priority of this part.
*
* @returns {object} $translatePartialLoader, so this method is chainable
*
* @fires {$translatePartialLoaderStructureChanged} The $translatePartialLoaderStructureChanged
* event would be fired by this method in case the new part affected somehow on the loaders
* state. This way it means that there are a new translation data available to be loaded from
* the server.
*
* @throws {TypeError} The method could throw a **TypeError** if you pass the param of the wrong
* type. Please, note that the `name` param has to be a non-empty **string**.
*/
service.addPart = function (name, priority, urlTemplate) {
if (!isStringValid(name)) {
throw new TypeError('Couldn\'t add part, first arg has to be a string');
}
if (!hasPart(name)) {
parts[name] = new Part(name, priority, urlTemplate);
$rootScope.$emit('$translatePartialLoaderStructureChanged', name);
} else if (!parts[name].isActive) {
parts[name].isActive = true;
$rootScope.$emit('$translatePartialLoaderStructureChanged', name);
}
return service;
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoader#deletePart
* @methodOf pascalprecht.translate.$translatePartialLoader
*
* @description
* Deletes the previously added part of the translation data. The target part could be deleted
* either logically or physically. When the data is deleted logically it is not actually deleted
* from the browser, but the loader marks it as not active and prevents it from affecting on the
* translations. If the deleted in such way part is added again, the loader will use the
* previously loaded data rather than loading it from the server once more time. But if the data
* is deleted physically, the loader will completely remove all information about it. So in case
* of recycling this part will be loaded from the server again.
*
* @param {string} name A name of the part to delete
* @param {boolean=} [removeData=false] An indicator if the loader has to remove a loaded
* translation data physically. If the `removeData` if set to **false** the loaded data will not be
* deleted physically and might be reused in the future to prevent an additional xhr requests.
*
* @returns {object} $translatePartialLoader, so this method is chainable
*
* @fires {$translatePartialLoaderStructureChanged} The $translatePartialLoaderStructureChanged
* event would be fired by this method in case a part deletion process affects somehow on the
* loaders state. This way it means that some part of the translation data is now deprecated and
* the translation table has to be recompiled with the remaining translation parts.
*
* @throws {TypeError} The method could throw a **TypeError** if you pass some param of the
* wrong type. Please, note that the `name` param has to be a non-empty **string** and
* the `removeData` param has to be either **undefined** or **boolean**.
*/
service.deletePart = function (name, removeData) {
if (!isStringValid(name)) {
throw new TypeError('Couldn\'t delete part, first arg has to be string');
}
if (removeData === undefined) {
removeData = false;
} else if (typeof removeData !== 'boolean') {
throw new TypeError('Invalid type of a second argument, a boolean expected.');
}
if (hasPart(name)) {
var wasActive = parts[name].isActive;
if (removeData) {
var $translate = $injector.get('$translate');
var cache = $translate.loaderCache();
if (typeof(cache) === 'string') {
// getting on-demand instance of loader
cache = $injector.get(cache);
}
// Purging items from cache...
if (typeof(cache) === 'object') {
angular.forEach(parts[name].tables, function (value, key) {
cache.remove(parts[name].parseUrl(parts[name].urlTemplate, key));
});
}
delete parts[name];
} else {
parts[name].isActive = false;
}
if (wasActive) {
$rootScope.$emit('$translatePartialLoaderStructureChanged', name);
}
}
return service;
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoader#isPartLoaded
* @methodOf pascalprecht.translate.$translatePartialLoader
*
* @description
* Checks if the registered translation part is loaded into the translation table.
*
* @param {string} name A name of the part
* @param {string} lang A key of the language
*
* @returns {boolean} Returns **true** if the translation of the part is loaded to the translation table and **false** if not.
*
* @throws {TypeError} The method could throw a **TypeError** if you pass the param of the wrong
* type. Please, note that the `name` and `lang` params have to be non-empty **string**.
*/
service.isPartLoaded = function (name, lang) {
return angular.isDefined(parts[name]) && angular.isDefined(parts[name].tables[lang]);
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoader#getRegisteredParts
* @methodOf pascalprecht.translate.$translatePartialLoader
*
* @description
* Gets names of the parts that were added with the `addPart`.
*
* @returns {array} Returns array of registered parts, if none were registered then an empty array is returned.
*/
service.getRegisteredParts = function () {
var registeredParts = [];
angular.forEach(parts, function (p) {
if (p.isActive) {
registeredParts.push(p.name);
}
});
return registeredParts;
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translatePartialLoader#isPartAvailable
* @methodOf pascalprecht.translate.$translatePartialLoader
*
* @description
* Checks if a target translation part is available. The part becomes available just after it was
* added by the `addPart` method. Part's availability does not mean that it was loaded from the
* server, but only that it was added to the loader. The available part might be loaded next
* time the loader is called.
*
* @param {string} name A name of the part to delete
*
* @returns {boolean} Returns **true** if the part is available now and **false** if not.
*
* @throws {TypeError} The method could throw a **TypeError** if you pass the param of the wrong
* type. Please, note that the `name` param has to be a non-empty **string**.
*/
service.isPartAvailable = isPartAvailable;
return service;
}];
}
$translatePartialLoader.displayName = '$translatePartialLoader';
return 'pascalprecht.translate';
}));
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{79:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"p:1"},[e.error?s("alert",{attrs:{color:"red"}},[e._v(e._s(e.error))]):e._e(),e._v(" "),e.isLoading?s("loader",{attrs:{message:e.loadingMessage}}):e._e(),e._v(" "),e.isLoading?e._e():s("div",[e.success?s("alert",{attrs:{color:"green"}},[s("p",[e._v("Files transfert with success :)")])]):e._e(),e._v(" "),e.hasEpisodes?s("div",{staticClass:"sm:none flex:col"},e._l(e.episodes,(function(t){return s("div",{key:t.directory,staticClass:"flex flex:wrap justify:between"},[s("div",[e._v(e._s(t.destination.filename))]),e._v(" "),s("div",[t.loading?s("loader"):e._e(),e._v(" "),t.transfered?s("span",{staticClass:"text:green"},[e._v("Done")]):e._e()],1)])})),0):e._e(),e._v(" "),e.hasEpisodes?s("div",{staticClass:"none sm:block"},[s("table",{staticClass:"border:collapse w:full"},[e._m(0),e._v(" "),s("tbody",e._l(e.episodes,(function(t){return s("tr",{key:t.directory,staticClass:"hover:bg:grey-darker"},[s("td",[e._v(e._s(t.origin.file))]),e._v(" "),s("td",[e._v(e._s(t.destination.path))]),e._v(" "),s("td",{staticClass:"text:center"},[t.loading?s("loader"):e._e(),e._v(" "),t.transfered?s("span",{staticClass:"text:green"},[e._v("Done")]):e._e()],1)])})),0)])]):s("div",{staticClass:"text:center"},[e._v("No espiode found :(")])],1),e._v(" "),e.isLoading?e._e():s("div",{staticClass:"flex w:full justify:center mt:1"},[s("btn",{staticClass:"mr:1",on:{click:function(t){return e.search()}}},[e._v("Scan")]),e._v(" "),e.hasEpisodes?s("btn",{on:{click:function(t){return e.transfert()}}},[e._v("Transfert")]):e._e()],1)],1)};i._withStripped=!0;var r={name:"Transfert",computed:{hasEpisodes:function(){return this.episodes&&this.episodes.length>0},hasNoEpisode:function(){return this.episodes&&0===this.episodes.length},message:function(){return this.$store.getters["webSocket/message"]}},data:function(){return{error:null,episodes:null,success:null,isLoading:!1,loadingMessage:null,subtitlesSettings:null}},created:function(){this.getSubtitlesSettings(),this.search()},watch:{message:function(e){var t=this;switch(e.object){case"transfert":switch(e.method){case"search":this.isLoading=!1,e.error?this.error=e.error:this.episodes=Object.assign([],e.results);break;case"move":e.error?console.error(error):this.episodes.map((function(s,i){e.params.episode.origin.path===s.origin.path&&(t.getSubtitle(e.params.episode.destination.path),t.$set(t.episodes,i,Object.assign(s,{loading:!1,transfered:!0})))}))}break;case"plex":switch(e.method){case"refresh":e.error?(console.error(e.error),this.$store("notification/add",{message:"Error when refreshing Plex library !",type:"error"})):console.log("[Plex] Refresh Tv Shows...")}break;case"subtitles":switch(e.method){case"getAll":e.error?this.error=e.error:this.subtitlesSettings=e.results}}}},methods:{search:function(){this.isLoading=!0,this.loadingMessage="Searching new files...",this.$store.commit("webSocket/send",{object:"transfert",method:"search"})},transfert:function(){var e=this;this.episodes&&(this.episodes.map((function(t,s){e.move(t,s)})),this.refreshPlex())},move:function(e,t){this.$set(this.episodes,t,Object.assign(e,{loading:!0})),this.$store.commit("webSocket/send",{object:"transfert",method:"move",params:{episode:e}})},refreshPlex:function(){this.$store.commit("webSocket/send",{object:"plex",method:"refresh",params:{uuid:"67d119bc-e8ae-45ff-8cf3-0fc876576a6a"}})},getSubtitlesSettings:function(){this.$store.commit("webSocket/send",{object:"subtitles",method:"getAll"})},getSubtitle:function(e){this.subtitlesSettings&&this.subtitlesSettings.downloadAfterTransfert&&this.$store.commit("webSocket/send",{object:"subtitles",method:"getSubtitle",params:{file:e}})}}},o=s(0),n=Object(o.a)(r,i,[function(){var e=this.$createElement,t=this._self._c||e;return t("thead",[t("tr",[t("th",[this._v("Episode found")]),this._v(" "),t("th",[this._v("Episode destination")]),this._v(" "),t("th",[this._v("Status")])])])}],!1,null,null,null);n.options.__file="src/pages/Transfert.vue";t.default=n.exports}}]);
|
const Counter = artifacts.require('Counter');
const truffleConfig = require('../truffle-config');
const _assert = require('assert');
const utils = require('../src/utils');
const oasis = require('@oasislabs/client');
const web3 = utils.setupWebsocketProvider(Counter.web3.currentProvider);
if (truffleConfig.shouldRun(__filename)) {
contract('Deploy Header', async (accounts) => {
let labels = ['non-confidential', 'confidential'];
const gateway = new oasis.gateways.Web3Gateway(
utils.wsProviderUrl(),
new oasis.Wallet(truffleConfig.OASIS_CLIENT_SK)
);
oasis.setGateway(gateway);
labels.forEach((label) => {
let instance;
let confidential = label === 'confidential';
let options = { gasLimit: '0xe79732' };
it(`${label}: creates a contract that expires tomorrow with success`, async () => {
let expectedExpiry = Math.floor(Date.now() / 1000 + 60 * 60 * 24);
instance = await oasis.deploy({
bytecode: oasis.workspace.OasisCounter.bytecode,
header: {
expiry: expectedExpiry,
confidential
},
...options
});
let resultantExpiry = await gateway.oasis.getExpiry(instance.address.hex);
assert.equal(expectedExpiry, resultantExpiry);
});
it(`${label}: can execute transactions and calls on a contract with expiry`, async () => {
let count = await instance.getCounter(options);
assert.equal(count, 0);
await instance.incrementCounter(options);
count = await instance.getCounter(options);
assert.equal(count, 1);
});
it(`${label}: creates a contract that expires yesterday with failure`, async () => {
await _assert.rejects(
async function () {
let expectedExpiry = Math.floor(Date.now() / 1000 - 60 * 60 * 24);
await oasis.deploy({
data: oasis.workspace.OasisCounter.bytecode,
header: {
expiry: expectedExpiry,
confidential
},
...options
});
}
);
});
it(`${label}: calls a contract that has expired with failure`, async () => {
// Given.
instance = await oasis.deploy({
bytecode: oasis.workspace.OasisCounter.bytecode,
header: {
expiry: Math.floor(Date.now() / 1000 + 20),
confidential
},
...options
});
// When.
await utils.sleep(60 * 1000);
// Send dummy transaction to make the tendermint clock tick.
await web3.eth.sendTransaction({
from: accounts[0],
to: web3.eth.accounts.create().address,
value: 100,
gas: 2100
});
// Then.
await _assert.rejects(async function () {
await instance.incrementCounter(options);
});
});
});
});
}
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MssqlParameter = void 0;
/**
* Sql server driver requires parameter types to be specified fo input parameters used in the query.
*
* @see https://github.com/patriksimek/node-mssql#data-types
*/
class MssqlParameter {
constructor(value, type, ...params) {
this.value = value;
this.type = type;
this["@instanceof"] = Symbol.for("MssqlParameter");
// -------------------------------------------------------------------------
// Public Properties
// -------------------------------------------------------------------------
this.params = [];
this.params = params || [];
}
}
exports.MssqlParameter = MssqlParameter;
//# sourceMappingURL=MssqlParameter.js.map
|
const URL = require('url').URL
const hyperquest = require('hyperquest')
const bl = require('bl')
const stringify = require('json-stringify-safe')
function HttpError (message) {
SyntaxError.call(this, message)
Error.captureStackTrace(this, arguments.callee) // eslint-disable-line
}
HttpError.prototype = Object.create(SyntaxError.prototype)
HttpError.prototype.constructor = HttpError
function collector (uri, options, callback) {
const request = makeRequest(uri, options)
let redirect = null
let redirectCount = 0
return handle(request)
function handle (request) {
if (options.followRedirects) {
request.on('response', (response) => {
redirect = isRedirect(request.request, response) && response.headers.location
})
}
request.pipe(bl((err, data) => {
if (redirect) {
if (++redirectCount >= (typeof options.followRedirects === 'number' ? options.followRedirects : 10)) {
return callback(new Error('Response was redirected too many times (' + redirectCount + ')'))
}
request = makeRequest(new URL(redirect, uri).toString(), options)
redirect = null
return handle(request)
}
if (err) {
return callback(err)
}
if (!data.length) {
return callback(null, null, request.response)
}
let ret, msg
try {
ret = JSON.parse(data.toString())
} catch (e) {
msg = 'JSON parse error: ' + e.message
err = request.response.statusCode >= 300 ? new HttpError(msg) : new SyntaxError(msg)
err.statusCode = request.response.statusCode
err.data = data
err.response = request.response
return callback(err)
}
callback(null, ret, request.response)
}))
return request
}
}
function makeMethod (method, data) {
function handler (uri, options, callback) {
const defaultOptions = { method, headers: {} }
if (typeof options === 'object') {
options = Object.assign(defaultOptions, options)
} else {
callback = options
options = defaultOptions
}
if (data && typeof options.headers['content-type'] !== 'string') {
options.headers['content-type'] = 'application/json'
}
if (typeof options.headers.accept !== 'string') {
options.headers.accept = 'application/json'
}
return collector(uri, options, callback)
}
function dataHandler (uri, data, options, callback) {
const request = handler(uri, options, callback)
if (typeof data.pipe === 'function') {
data.pipe(request)
} else {
request.end(stringify(data))
}
return request
}
return data ? dataHandler : handler
}
function makeRequest (uri, options) {
return (options.hyperquest || hyperquest)(uri, options)
}
function isRedirect (request, response) {
return request.method === 'GET' &&
response.headers.location &&
(response.statusCode === 301 ||
response.statusCode === 302 ||
response.statusCode === 307 ||
response.statusCode === 308
)
}
function maybePromisify (fn) {
return function jsonistMaybePromise (...args) {
if (typeof args[args.length - 1] !== 'function') { // no callback
return new Promise((resolve, reject) => {
this.request = fn.call(this, ...args, (err, data, response) => {
if (err) {
return reject(err)
}
resolve({ data, response })
})
})
} else {
return fn.call(this, ...args)
}
}
}
module.exports.get = maybePromisify(makeMethod('GET', false))
module.exports.post = maybePromisify(makeMethod('POST', true))
module.exports.put = maybePromisify(makeMethod('PUT', true))
module.exports.delete = maybePromisify(function deleteHandler (uri, options, callback) {
// behaves half-way between a data posting request and a GET
// since https://github.com/substack/hyperquest/commit/9b130e101
return makeMethod('DELETE', false)(uri, options, callback).end()
})
module.exports.HttpError = HttpError
|
import React, { Component, Fragment } from "react";
import axios from "axios";
import { Link } from "react-router-dom";
import Moment from "react-moment";
import Spinner from "../layout/Spinner";
import { heroku, lyrics, trackId } from "../../config/apiUrl";
class Lyrics extends Component {
state = {
track: {},
lyrics: {}
};
componentDidMount() {
axios
.get(
`${heroku}${lyrics}${this.props.match.params.id}&apikey=${
process.env.REACT_APP_MM_KEY
}`
)
.then(res => {
this.setState({ lyrics: res.data.message.body.lyrics });
return axios.get(
`${heroku}${trackId}${this.props.match.params.id}&apikey=${
process.env.REACT_APP_MM_KEY
}`
);
})
.then(res => {
this.setState({ track: res.data.message.body.track });
})
.catch(err => console.log(err));
}
render() {
const { track, lyrics } = this.state;
if (
track === undefined ||
lyrics === undefined ||
Object.keys(track).length === 0 ||
Object.keys(lyrics).length === 0
) {
return <Spinner />;
} else {
return (
<Fragment>
<Link to="/" className="btn btn-dark btn-sm mb-4">
Go Back
</Link>
<div className="card">
<h5 className="card-header">
{track.track_name} by{" "}
<span className="text-secondary">{track.artist_name}</span>
</h5>
<div className="card-body">
<p className="card-text">{lyrics.lyrics_body}</p>
</div>
</div>
<ul className="list-group mt-3">
<li className="list-group-item">
<strong>Album ID</strong>: {track.album_id}
</li>
<li className="list-group-item">
<strong>Song Genre</strong>:{" "}
{track.primary_genres.music_genre_list.length === 0
? "NO GENRE AVAILABLE"
: track.primary_genres.music_genre_list[0].music_genre
.music_genre_name}
</li>
<li className="list-group-item">
<strong>Explicit Words</strong>:{" "}
{track.explicit === 0 ? "No" : "Yes"}
</li>
<li className="list-group-item">
<strong>Release Date</strong>:{" "}
<Moment format="MM/DD/YYYY">{track.first_release_date}</Moment>
</li>
</ul>
</Fragment>
);
}
}
}
export default Lyrics;
|
var datapath_2linux_2compat_2include_2linux_2rculist_8h =
[
[ "hlist_first_rcu", "datapath_2linux_2compat_2include_2linux_2rculist_8h.html#a1c749ab0534a0164d62d148214203c84", null ],
[ "hlist_for_each_entry_rcu", "datapath_2linux_2compat_2include_2linux_2rculist_8h.html#a482ed6bca0b607f6455d5386f3b1ed75", null ],
[ "hlist_next_rcu", "datapath_2linux_2compat_2include_2linux_2rculist_8h.html#a80a41016049f9bd4e5e8b79f3373f722", null ],
[ "hlist_pprev_rcu", "datapath_2linux_2compat_2include_2linux_2rculist_8h.html#a82cf19afe32c14e1b1a4a782489a1649", null ]
];
|
ScalaJS.impls.scala_Function2$mcIID$sp$class__$init$__Lscala_Function2$mcIID$sp__V = (function($$this) {
/*<skip>*/
});
//@ sourceMappingURL=Function2$mcIID$sp$class.js.map
|
const docker = require('./docker');
exports.removeContainer = async containerInfo => {
const service = docker.getContainer(containerInfo.Id);
try {
await service.remove({force: true});
} catch (e) {
// ignore not found errors
if (e.statusCode === 404) {
return;
}
throw e;
}
};
exports.removeService = async serviceInfo => {
const service = docker.getService(serviceInfo.ID);
try {
await service.remove();
} catch (e) {
// ignore not found errors
if (e.statusCode === 404) {
return;
}
throw e;
}
};
|
module.exports = class ReturnStatement {
constructor(returnValue) {
this.returnValue = returnValue;
}
};
|
import deepmerge from 'deepmerge'; // < 1kb payload overhead when lodash/merge is > 3kb.
import warning from 'warning';
import typographyMigration from './typographyMigration';
function round(value) {
return Math.round(value * 1e5) / 1e5;
}
const caseAllCaps = {
textTransform: 'uppercase',
};
const defaultFontFamiliy = '"Roboto", "Helvetica", "Arial", sans-serif';
/**
* @see @link{https://material.io/design/typography/the-type-system.html}
* @see @link{https://material.io/design/typography/understanding-typography.html}
*/
export default function createTypography(palette, typography) {
const {
fontFamily = defaultFontFamiliy,
// The default font size of the Material Specification.
fontSize = 14, // px
fontWeightLight = 300,
fontWeightRegular = 400,
fontWeightMedium = 500,
// Tell Material-UI what's the font-size on the html element.
// 16px is the default font-size used by browsers.
htmlFontSize = 16,
suppressDeprecationWarnings = process.env.MUI_SUPPRESS_DEPRECATION_WARNINGS,
useNextVariants = false,
// Apply the CSS properties to all the variants.
allVariants,
...other
} = typeof typography === 'function' ? typography(palette) : typography;
warning(
!Object.keys(other).some(variant => typographyMigration.deprecatedVariants.includes(variant)),
'Material-UI: You are passing a deprecated variant to ' +
`createTypography. ${typographyMigration.migrationGuideMessage}`,
);
warning(
useNextVariants ||
!Object.keys(other).some(variant => typographyMigration.restyledVariants.includes(variant)),
'Material-UI: You are passing a variant to createTypography ' +
'that will be restyled in the next major release, without indicating that you ' +
`are using typography v2 (set \`useNextVariants\` to true. ${
typographyMigration.migrationGuideMessage
}`,
);
const coef = fontSize / 14;
const pxToRem = size => `${(size / htmlFontSize) * coef}rem`;
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => ({
color: palette.text.primary,
fontFamily,
fontWeight,
fontSize: pxToRem(size),
// Unitless following http://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
lineHeight,
// The letter spacing was designed for the Roboto font-family. Using the same letter-spacing
// across font-families can cause issues with the kerning.
...(fontFamily === defaultFontFamiliy
? { letterSpacing: `${round(letterSpacing / size)}em` }
: {}),
...casing,
...allVariants,
});
const nextVariants = {
h1: buildVariant(fontWeightLight, 96, 1, -1.5),
h2: buildVariant(fontWeightLight, 60, 1, -0.5),
h3: buildVariant(fontWeightRegular, 48, 1.04, 0),
h4: buildVariant(fontWeightRegular, 34, 1.17, 0.25),
h5: buildVariant(fontWeightRegular, 24, 1.33, 0),
h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
body1Next: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
body2Next: buildVariant(fontWeightRegular, 14, 1.5, 0.15),
buttonNext: buildVariant(fontWeightMedium, 14, 1.5, 0.4, caseAllCaps),
captionNext: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
};
// To remove in v4
const oldVariants = {
display4: {
fontSize: pxToRem(112),
fontWeight: fontWeightLight,
fontFamily,
letterSpacing: '-.04em',
lineHeight: `${round(128 / 112)}em`,
marginLeft: '-.04em',
color: palette.text.secondary,
...allVariants,
},
display3: {
fontSize: pxToRem(56),
fontWeight: fontWeightRegular,
fontFamily,
letterSpacing: '-.02em',
lineHeight: `${round(73 / 56)}em`,
marginLeft: '-.02em',
color: palette.text.secondary,
...allVariants,
},
display2: {
fontSize: pxToRem(45),
fontWeight: fontWeightRegular,
fontFamily,
lineHeight: `${round(51 / 45)}em`,
marginLeft: '-.02em',
color: palette.text.secondary,
...allVariants,
},
display1: {
fontSize: pxToRem(34),
fontWeight: fontWeightRegular,
fontFamily,
lineHeight: `${round(41 / 34)}em`,
color: palette.text.secondary,
...allVariants,
},
headline: {
fontSize: pxToRem(24),
fontWeight: fontWeightRegular,
fontFamily,
lineHeight: `${round(32.5 / 24)}em`,
color: palette.text.primary,
...allVariants,
},
title: {
fontSize: pxToRem(21),
fontWeight: fontWeightMedium,
fontFamily,
lineHeight: `${round(24.5 / 21)}em`,
color: palette.text.primary,
...allVariants,
},
subheading: {
fontSize: pxToRem(16),
fontWeight: fontWeightRegular,
fontFamily,
lineHeight: `${round(24 / 16)}em`,
color: palette.text.primary,
...allVariants,
},
body2: {
fontSize: pxToRem(14),
fontWeight: fontWeightMedium,
fontFamily,
lineHeight: `${round(24 / 14)}em`,
color: palette.text.primary,
...allVariants,
},
body1: {
fontSize: pxToRem(14),
fontWeight: fontWeightRegular,
fontFamily,
lineHeight: `${round(20.5 / 14)}em`,
color: palette.text.primary,
...allVariants,
},
caption: {
fontSize: pxToRem(12),
fontWeight: fontWeightRegular,
fontFamily,
lineHeight: `${round(16.5 / 12)}em`,
color: palette.text.secondary,
...allVariants,
},
button: {
fontSize: pxToRem(14),
textTransform: 'uppercase',
fontWeight: fontWeightMedium,
fontFamily,
color: palette.text.primary,
...allVariants,
},
};
return deepmerge(
{
pxToRem,
round,
fontFamily,
fontSize,
fontWeightLight,
fontWeightRegular,
fontWeightMedium,
...oldVariants,
...(useNextVariants
? {
...nextVariants,
body1: nextVariants.body1Next,
body2: nextVariants.body2Next,
button: nextVariants.buttonNext,
caption: nextVariants.captionNext,
}
: nextVariants),
suppressDeprecationWarnings,
useNextVariants,
},
other,
{
clone: false, // No need to clone deep
},
);
}
|
$(document).ready(function ()
{
$.ajaxSetup({
headers :
{
'X-CSRF-TOKEN' : $('meta[name="csrf-token"]').attr('content')
}
})
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').trigger('focus')
})
$("body").bind("ajaxSend", function(elm, xhr, s){
if (s.type == "POST") {
xhr.setRequestHeader('X-CSRF-Token', getCSRFTokenValue());
}
});
$('select').on('change', getPrice);
$('a.cart').on('click', addToBasket);
$('a.delete').on('click', deleteFromBasket);
});
function getPrice()
{
let productid = $(this).data('productid')
$.ajax({
url: 'getPrice',
method: "post",
accepts: "application/json",
data: {
"productid": productid,
"value" : $(this).val()
},
success: function (data) {
$('#cena' + productid).html("Cena: " + data['price'] + "din")
},
error: function (xhr, status, error) {
console.log(xhr)
}
});
}
function addToBasket()
{
let productid = $(this).attr('id');
let sizeID = $('select#product_size' + productid).val();
$.ajax({
url: 'cart',
method: "post",
accepts: "application/json",
data: {
"productid": productid,
"sizeid" : sizeID
},
success: function (data) {
alert(data)
},
error: function (xhr, status, error) {
alert('Doslo je do greske, molimo Vas kontaktirajte administratora.')
}
});
}
function deleteFromBasket()
{
let productid = $(this).attr('id');
console.log(productid)
$.ajax({
url: 'cart',
method: "delete",
accepts: "application/json",
data: {
"id": productid
},
success: function (data) {
location.reload();
alert(data)
},
error: function (xhr, status, error) {
alert('Doslo je do greske, molimo Vas kontaktirajte administratora.')
}
});
}
|
import Schema from 'ember-json-schema/models/schema';
import Document from 'ember-json-schema/models/document';
import { module, test, skip } from 'qunit';
import schemaFixture from '../../fixtures/default-nested-property-schema';
import arrayBaseObjectFixture from '../../fixtures/location-schema';
module('models/document', {
beforeEach() {
this.schema = new Schema(schemaFixture);
this.document = this.schema.buildDocument();
}
});
test('requires a schema', function(assert) {
assert.throws(function() {
new Document();
}, /You must provide a Schema instance to the Document constructor/);
});
test('can set a value for a root property', function(assert) {
this.document.set('description', 'awesome sauce');
assert.equal(this.document.get('description'), 'awesome sauce');
});
test('can set a value for a nested property', function(assert) {
this.document.set('address.streetAddress', '123 Blah St.');
assert.equal(this.document.get('address.streetAddress'), '123 Blah St.');
});
test('using an invalid property throws an error', function(assert) {
assert.throws(function() {
this.document.set('address.nonExistant', 'foo');
}, /You may not set a nonexistant field/);
});
test('set without a value throws an error', function(assert) {
assert.throws(function() {
this.document.set('address');
}, /You must provide a value as the second argument to `.set`/);
});
test('toJSON returns a object with values that were set', function(assert) {
this.document.set('address.streetAddress', '123 Blah St.');
this.document.set('address.city', 'Hope');
// TODO: deal with phoneNumber array somehow
let result = this.document.toJSON();
assert.deepEqual(result, {
address: {
streetAddress: '123 Blah St.',
city: 'Hope'
}
});
});
test('add array as base object type using per-property syntax', function(assert) {
this.schema = new Schema(arrayBaseObjectFixture);
this.document = this.schema.buildDocument();
let expected = {
'description': 'stuff here',
'streetAddress': 'unknown st',
'city': 'hope',
'state': 'ri',
'zip': '02831'
};
let item = this.document.addItem();
for (let key in expected) {
item.set(key, expected[key]);
}
let result = this.document.toJSON();
assert.deepEqual(result, [expected]);
});
test('can add multiple items to an array based document using per-property syntax', function(assert) {
let item;
this.schema = new Schema(arrayBaseObjectFixture);
this.document = this.schema.buildDocument();
let expected1 = {
'description': 'stuff here',
'streetAddress': 'unknown st',
'city': 'hope',
'state': 'ri',
'zip': '02831'
};
let expected2 = {
'description': 'other stuff here',
'streetAddress': 'totally known st',
'city': 'hope',
'state': 'ri',
'zip': '02831'
};
item = this.document.addItem();
for (let key in expected1) {
item.set(key, expected1[key]);
}
item = this.document.addItem();
for (let key in expected2) {
item.set(key, expected2[key]);
}
let result = this.document.toJSON();
assert.deepEqual(result, [expected1, expected2]);
});
test('can access the backing document for array items after initial creation', function(assert) {
this.schema = new Schema(arrayBaseObjectFixture);
this.document = this.schema.buildDocument();
let item1 = this.document.addItem();
let item2 = this.document.getItem(0);
assert.equal(item1, item2, 'items added with addItem can be retrieved');
});
test('can access all items after creation', function(assert) {
this.schema = new Schema(arrayBaseObjectFixture);
this.document = this.schema.buildDocument();
let expected1 = {
'description': 'stuff here',
'streetAddress': 'unknown st',
'city': 'hope',
'state': 'ri',
'zip': '02831'
};
let expected2 = {
'description': 'other stuff here',
'streetAddress': 'totally known st',
'city': 'hope',
'state': 'ri',
'zip': '02831'
};
let item1 = this.document.addItem();
for (let key in expected1) {
item1.set(key, expected1[key]);
}
let item2 = this.document.addItem();
for (let key in expected2) {
item2.set(key, expected2[key]);
}
let result = this.document.allItems();
assert.deepEqual(result, [item1, item2]);
});
skip('throw an error if calling `toJSON` when required fields are not specified');
skip('handle array properties (where you have many of a given item)');
skip('add validations when setting property types');
|
// IMPORT PACKAGE REFERENCES
import React from 'react';
// IMPORT IMAGES
// COMPONENT
const SearchPage = () => (
<main>
SearchPage
</main>
);
export { SearchPage };
|
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// paths is just a variable for common storage during the build and templating process
paths: {
src: 'src', // source directory for content
dest: 'dest', // final document root, symlink this into htdocs
build: 'build', // build directory for all the tooling to build the content
tmp: 'tmp', // tmp folder for generated content
url: '/', // if the site is in a subdirectory, put the server-relative path here (ie: '/subdir/') with a trailing slash.
}
});
// Load Grunt plugins.
grunt.loadTasks( 'build/grunt' );
// CSS task does the less preprocessing, adds any .css files, adds vendor prefixes, minifies (leaving a copy) and cleans up.
grunt.registerTask(
'css',
[
'less',
'concat:css',
'postcss',
'cssmin',
'clean:tmp'
]
);
// JS task just concats and uglifies (leaving a copy)
grunt.registerTask(
'js',
[
'concat:js',
'uglify'
]
);
// HTML task reads markdown, copies assets, and cleans up.
grunt.registerTask(
'html',
[
'slice_front',
'copy', // copying assets as a part of this step, too. Could be made a separate step of prod task
'clean:tmp',
]
);
// prod task could do some additional processing - like assembling libraries
// For now, it just wipes out /dest/ completely and then does the same thing as default
grunt.registerTask(
'prod',
[
'clean:prod',
'css',
'js',
'html',
]
);
grunt.registerTask(
'default',
[
'css',
'js',
'html',
]
)
// watch not needed here, it is already adequately defined in its own file in the build folder.
// grunt.registerTask(
// 'watch',
// [
// 'watch'
// ]
// )
};
|
import Immutable from 'seamless-immutable';
import { REDO, UNDO } from '../../src/actions/history.jsx';
import * as MutableActions from '../../src/actions/mutable.jsx';
import { history, INITIAL_HISTORY } from '../../src/reducers/history.jsx';
import { namespaces } from '../../src/reducers/namespaces.jsx';
const reducer = history(namespaces)
describe('history reducer', () => {
it('should return the initial state', () => {
expect(reducer(undefined, {})).toEqual(INITIAL_HISTORY)
})
it('should handle UNDO', () => {
expect(reducer(INITIAL_HISTORY, {
type: UNDO
})).toEqual(INITIAL_HISTORY)
const undoState = Immutable.from({ foo: 1 })
const pastState = Immutable.from({ bar: 2 })
expect(reducer({
items: undoState,
history: {
past: [{ items: pastState, change: 2 }],
future: []
}
}, {
type: UNDO
})).toEqual({
items: pastState,
history: {
past: [],
future: [{ items: undoState, change: 2 }]
}
})
})
it('should handle REDO', () => {
expect(reducer(INITIAL_HISTORY, {
type: REDO
})).toEqual(INITIAL_HISTORY)
const undoState = Immutable.from({ foo: 1 })
const pastState = Immutable.from({ bar: 2 })
expect(reducer({
items: pastState,
history: {
past: [],
future: [{ items: undoState, change: 2 }]
}
}, {
type: REDO
})).toEqual({
items: undoState,
history: {
past: [{ items: pastState, change: 2 }],
future: []
}
})
})
it('should handle mutable actions', () => {
let namespace = (n, a = {}) => {
return Immutable.from({
[n]: Object.assign({
name: n,
buckets: {}
}, a)
})
}
let state = INITIAL_HISTORY
let nextState = {
items: namespace('new.namespace'),
history: {
past: [{
items: Immutable.from({}),
change: {
type: MutableActions.ADD_NAMESPACE,
key: 'new.namespace'
}
}],
future: []
}
}
expect(reducer(state, {
type: MutableActions.ADD_NAMESPACE,
namespace: 'new.namespace'
})).toEqual(nextState)
// Test merging
state = nextState
nextState = {
items: namespace('new.namespace', { foo: 'bar' }),
history: {
past: [{
change: {
type: MutableActions.UPDATE_NAMESPACE,
key: 'new.namespace.foo',
value: 'bar'
},
items: namespace('new.namespace')
}, {
change: {
type: MutableActions.ADD_NAMESPACE,
key: 'new.namespace'
},
items: Immutable.from({})
}],
future: []
}
}
expect(reducer(state, {
type: MutableActions.UPDATE_NAMESPACE,
namespace: 'new.namespace',
key: 'foo',
value: 'bar'
})).toEqual(nextState)
// We merge consective updates
state = nextState
nextState = {
items: namespace('new.namespace', { foo: 'bar2' }),
history: {
past: [{
change: {
type: MutableActions.UPDATE_NAMESPACE,
key: 'new.namespace.foo',
value: 'bar2'
},
items: namespace('new.namespace')
}, {
change: {
type: MutableActions.ADD_NAMESPACE,
key: 'new.namespace'
},
items: Immutable.from({})
}],
future: []
}
}
expect(reducer(state, {
type: MutableActions.UPDATE_NAMESPACE,
namespace: 'new.namespace',
key: 'foo',
value: 'bar2'
})).toEqual(nextState)
state = nextState
nextState = {
items: Immutable.from(Object.assign(
{},
namespace('new.namespace2'),
namespace('new.namespace', { foo: 'bar2' }),
)),
history: {
past: [{
change: {
type: MutableActions.ADD_NAMESPACE,
key: 'new.namespace2'
},
items: namespace('new.namespace', { foo: 'bar2' })
}, {
change: {
type: MutableActions.UPDATE_NAMESPACE,
key: 'new.namespace.foo',
value: 'bar2'
},
items: namespace('new.namespace')
}, {
change: {
type: MutableActions.ADD_NAMESPACE,
key: 'new.namespace'
},
items: Immutable.from({})
}],
future: []
}
}
expect(reducer(state, {
type: MutableActions.ADD_NAMESPACE,
namespace: 'new.namespace2'
})).toEqual(nextState)
// We don't merge across non-mergeable boundaries
state = nextState
nextState = {
items: Immutable.from(Object.assign(
{},
namespace('new.namespace2'),
namespace('new.namespace', { foo: 'bar3' }),
)),
history: {
past: [{
change: {
type: MutableActions.UPDATE_NAMESPACE,
key: 'new.namespace.foo',
value: 'bar3'
},
items: Immutable.from(Object.assign(
{},
namespace('new.namespace2'),
namespace('new.namespace', { foo: 'bar2' }),
))
}, {
change: {
type: MutableActions.ADD_NAMESPACE,
key: 'new.namespace2'
},
items: namespace('new.namespace', { foo: 'bar2' })
}, {
change: {
type: MutableActions.UPDATE_NAMESPACE,
key: 'new.namespace.foo',
value: 'bar2'
},
items: namespace('new.namespace')
}, {
change: {
type: MutableActions.ADD_NAMESPACE,
key: 'new.namespace'
},
items: Immutable.from({})
}],
future: []
}
}
expect(reducer(state, {
type: MutableActions.UPDATE_NAMESPACE,
namespace: 'new.namespace',
key: 'foo',
value: 'bar3'
})).toEqual(nextState)
})
it('should handle immutable actions', () => {
expect(reducer(INITIAL_HISTORY, {
type: 'MY_ACTION',
payload: 'test'
})).toEqual(INITIAL_HISTORY)
})
})
|
var defined = require('defined');
var wrap = require('./lib/wrap');
var EPSILON = Number.EPSILON;
function clamp (value, min, max) {
return min < max
? (value < min ? min : value > max ? max : value)
: (value < max ? max : value > min ? min : value);
}
function clamp01 (v) {
return clamp(v, 0, 1);
}
function lerp (min, max, t) {
return min * (1 - t) + max * t;
}
function inverseLerp (min, max, t) {
if (Math.abs(min - max) < EPSILON) return 0;
else return (t - min) / (max - min);
}
function smoothstep (min, max, t) {
var x = clamp(inverseLerp(min, max, t), 0, 1);
return x * x * (3 - 2 * x);
}
function toFinite (n, defaultValue) {
defaultValue = defined(defaultValue, 0);
return typeof n === 'number' && isFinite(n) ? n : defaultValue;
}
function expandVector (dims) {
if (typeof dims !== 'number') throw new TypeError('Expected dims argument');
return function (p, defaultValue) {
defaultValue = defined(defaultValue, 0);
var scalar;
if (p == null) {
// No vector, create a default one
scalar = defaultValue;
} else if (typeof p === 'number' && isFinite(p)) {
// Expand single channel to multiple vector
scalar = p;
}
var out = [];
var i;
if (scalar == null) {
for (i = 0; i < dims; i++) {
out[i] = toFinite(p[i], defaultValue);
}
} else {
for (i = 0; i < dims; i++) {
out[i] = scalar;
}
}
return out;
};
}
function lerpArray (min, max, t, out) {
out = out || [];
if (min.length !== max.length) {
throw new TypeError('min and max array are expected to have the same length');
}
for (var i = 0; i < min.length; i++) {
out[i] = lerp(min[i], max[i], t);
}
return out;
}
function newArray (n, initialValue) {
n = defined(n, 0);
if (typeof n !== 'number') throw new TypeError('Expected n argument to be a number');
var out = [];
for (var i = 0; i < n; i++) out.push(initialValue);
return out;
}
function linspace (n, opts) {
n = defined(n, 0);
if (typeof n !== 'number') throw new TypeError('Expected n argument to be a number');
opts = opts || {};
if (typeof opts === 'boolean') {
opts = { endpoint: true };
}
var offset = defined(opts.offset, 0);
if (opts.endpoint) {
return newArray(n).map(function (_, i) {
return n <= 1 ? 0 : ((i + offset) / (n - 1));
});
} else {
return newArray(n).map(function (_, i) {
return (i + offset) / n;
});
}
}
function lerpFrames (values, t, out) {
t = clamp(t, 0, 1);
var len = values.length - 1;
var whole = t * len;
var frame = Math.floor(whole);
var fract = whole - frame;
var nextFrame = Math.min(frame + 1, len);
var a = values[frame % values.length];
var b = values[nextFrame % values.length];
if (typeof a === 'number' && typeof b === 'number') {
return lerp(a, b, fract);
} else if (Array.isArray(a) && Array.isArray(b)) {
return lerpArray(a, b, fract, out);
} else {
throw new TypeError('Mismatch in value type of two array elements: ' + frame + ' and ' + nextFrame);
}
}
function mod (a, b) {
return ((a % b) + b) % b;
}
function degToRad (n) {
return n * Math.PI / 180;
}
function radToDeg (n) {
return n * 180 / Math.PI;
}
function fract (n) {
return n - Math.floor(n);
}
function sign (n) {
if (n > 0) return 1;
else if (n < 0) return -1;
else return 0;
}
// Specific function from Unity / ofMath, not sure its needed?
// function lerpWrap (a, b, t, min, max) {
// return wrap(a + wrap(b - a, min, max) * t, min, max)
// }
function pingPong (t, length) {
t = mod(t, length * 2);
return length - Math.abs(t - length);
}
function damp (a, b, lambda, dt) {
return lerp(a, b, 1 - Math.exp(-lambda * dt));
}
function dampArray (a, b, lambda, dt, out) {
out = out || [];
for (var i = 0; i < a.length; i++) {
out[i] = damp(a[i], b[i], lambda, dt);
}
return out;
}
function mapRange (value, inputMin, inputMax, outputMin, outputMax, clamp) {
// Reference:
// https://openframeworks.cc/documentation/math/ofMath/
if (Math.abs(inputMin - inputMax) < EPSILON) {
return outputMin;
} else {
var outVal = ((value - inputMin) / (inputMax - inputMin) * (outputMax - outputMin) + outputMin);
if (clamp) {
if (outputMax < outputMin) {
if (outVal < outputMax) outVal = outputMax;
else if (outVal > outputMin) outVal = outputMin;
} else {
if (outVal > outputMax) outVal = outputMax;
else if (outVal < outputMin) outVal = outputMin;
}
}
return outVal;
}
}
module.exports = {
mod: mod,
fract: fract,
sign: sign,
degToRad: degToRad,
radToDeg: radToDeg,
wrap: wrap,
pingPong: pingPong,
linspace: linspace,
lerp: lerp,
lerpArray: lerpArray,
inverseLerp: inverseLerp,
lerpFrames: lerpFrames,
clamp: clamp,
clamp01: clamp01,
smoothstep: smoothstep,
damp: damp,
dampArray: dampArray,
mapRange: mapRange,
expand2D: expandVector(2),
expand3D: expandVector(3),
expand4D: expandVector(4)
};
|
;(function (window, linkify, $) {
<%= contents %>
if (typeof $.fn.linkify !== 'function') {
linkifyJquery($);
}
})(window, linkify, jQuery);
|
/**
* PHP服务端脚本模板
* 开写:2016/04/12
* 更新:-
* 作者:蚁逅 <https://github.com/antoor>
*/
'use strict';
// import Base from '../base';
const Base = require('../base');
class PHP extends Base {
constructor(opts) {
super(opts);
// 解析模板
[
'base',
'command',
'filemanager',
'database/mysql',
'database/mysqli',
'database/mssql',
'database/sqlsrv',
'database/oracle',
'database/oracle_oci8',
'database/postgresql',
'database/postgresql_pdo',
'database/informix'
].map((_) => {
this.parseTemplate(`./php/template/${_}`);
});
// 解析编码器
this
.encoders
.map((_) => {
this.parseEncoder(`./php/encoder/${_}`);
});
this
.decoders
.map((_) => {
this.parseDecoder(`./php/decoder/${_}`);
});
}
/**
* 获取编码器列表
* ? 可以在antSword.core.php.prototype.encoders中获取此变量
* @return {array} 编码器列表
*/
get encoders() {
return ["base64", "chr", "chr16", "rot13"];
}
get decoders() {
return ["default", "base64", "rot13"];
}
/**
* HTTP请求数据组合函数
* @param {Object} data 通过模板解析后的代码对象
* @param {bool} force_default 强制使用 default 解码
* @return {Promise} 返回一个Promise操作对象
*/
complete(data, force_default = false) {
// 分隔符号
let tag_s, tag_e;
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tags']) {
tag_s = this.__opts__['otherConf']['custom-datatag-tags'];
} else {
tag_s = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "->|";
}
if (this.__opts__['otherConf'].hasOwnProperty('use-custom-datatag') && this.__opts__['otherConf']['use-custom-datatag'] == 1 && this.__opts__['otherConf']['custom-datatag-tage']) {
tag_e = this.__opts__['otherConf']['custom-datatag-tage'];
} else {
tag_e = Math.random().toString(16).substr(2, parseInt(Math.random() * 8 + 5)); // "|<-";
}
let asencCode;
let ext = {
opts: this.__opts__,
};
if (!force_default) {
asencCode = this.__decoder__[this.__opts__['decoder'] || 'default'].asoutput(ext);
} else {
asencCode = this.__decoder__['default'].asoutput(ext);
}
// 组合完整的代码
let tmpCode = data['_'];
data['_'] = `@ini_set("display_errors", "0");@set_time_limit(0);${asencCode};function asoutput(){$output=ob_get_contents();ob_end_clean();echo "${tag_s.substr(0,tag_s.length/2)}"."${tag_s.substr(tag_s.length/2)}";echo @asenc($output);echo "${tag_e.substr(0,tag_e.length/2)}"."${tag_e.substr(tag_e.length/2)}";}ob_start();try{${tmpCode};}catch(Exception $e){echo "ERROR://".$e->getMessage();};asoutput();die();`;
// 使用编码器进行处理并返回
return this.encodeComplete(tag_s, tag_e, data);
}
}
module.exports = PHP;
|
/**
* Copyright (C) 2017-2019 thirty bees
* Copyright (C) 2007-2016 PrestaShop SA
*
* thirty bees is an extension to the PrestaShop software by PrestaShop SA.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@thirtybees.com so we can send you a copy immediately.
*
* @author thirty bees <modules@thirtybees.com>
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2017-2019 thirty bees
* @copyright 2007-2016 PrestaShop SA
* @license Academic Free License (AFL 3.0)
* PrestaShop is an internationally registered trademark of PrestaShop SA.
*/
function checkForm()
{
var is_category_selected = false;
var is_filter_selected = false;
$('#categories-treeview input[type=checkbox]').each(
function()
{
if ($(this).prop('checked'))
{
is_category_selected = true;
return false;
}
}
);
$('.filter_list_item input[type=checkbox]').each(
function()
{
if ($(this).prop('checked'))
{
is_filter_selected = true;
return false;
}
}
);
if (!is_category_selected)
{
alert(translations['no_selected_categories']);
$('#categories-treeview input[type=checkbox]').first().focus();
return false;
}
if (!is_filter_selected)
{
alert(translations['no_selected_filters']);
$('#filter_list_item input[type=checkbox]').first().focus();
return false;
}
return true;
}
$(document).ready(
function()
{
$('.ajaxcall').click(
function()
{
if (this.legend == undefined)
this.legend = $(this).html();
if (this.running == undefined)
this.running = false;
if (this.running == true)
return false;
$('.ajax-message').hide();
this.running = true;
if (typeof(this.restartAllowed) == 'undefined' || this.restartAllowed)
{
$(this).html(this.legend+translations['in_progress']);
$('#indexing-warning').show();
}
this.restartAllowed = false;
var type = $(this).attr('rel');
$.ajax(
{
url: this.href+'&ajax=1',
context: this,
dataType: 'json',
cache: 'false',
success: function(res)
{
this.running = false;
this.restartAllowed = true;
$('#indexing-warning').hide();
$(this).html(this.legend);
if (type == 'price')
$('#ajax-message-ok span').html(translations['url_indexation_finished']);
else
$('#ajax-message-ok span').html(translations['attribute_indexation_finished']);
$('#ajax-message-ok').show();
return;
},
error: function(res)
{
this.restartAllowed = true;
$('#indexing-warning').hide();
if (type == 'price')
$('#ajax-message-ko span').html(translations['url_indexation_failed']);
else
$('#ajax-message-ko span').html(translations['attribute_indexation_failed']);
$('#ajax-message-ko').show();
$(this).html(this.legend);
this.running = false;
}
}
);
return false;
});
$('.ajaxcall-recurcive').each(
function(it, elm)
{
$(elm).click(
function()
{
if (this.cursor == undefined)
this.cursor = 0;
if (this.legend == undefined)
this.legend = $(this).html();
if (this.running == undefined)
this.running = false;
if (this.running == true)
return false;
$('.ajax-message').hide();
this.running = true;
if (typeof(this.restartAllowed) == 'undefined' || this.restartAllowed)
{
$(this).html(this.legend+translations['in_progress']);
$('#indexing-warning').show();
}
this.restartAllowed = false;
$.ajax(
{
url: this.href+'&ajax=1&cursor='+this.cursor,
context: this,
dataType: 'json',
cache: 'false',
success: function(res)
{
this.running = false;
if (res.result)
{
this.cursor = 0;
$('#indexing-warning').hide();
$(this).html(this.legend);
$('#ajax-message-ok span').html(translations['price_indexation_finished']);
$('#ajax-message-ok').show();
return;
}
this.cursor = parseInt(res.cursor);
$(this).html(this.legend+translations['price_indexation_in_progress'].replace('%s', res.count));
$(this).click();
},
error: function(res)
{
this.restartAllowed = true;
$('#indexing-warning').hide();
$('#ajax-message-ko span').html(translations['price_indexation_failed']);
$('#ajax-message-ko').show();
$(this).html(this.legend);
this.cursor = 0;
this.running = false;
}
});
return false;
}
);
}
);
if (typeof PS_LAYERED_INDEXED !== 'undefined' && PS_LAYERED_INDEXED)
{
$('#url-indexe').click();
$('#full-index').click();
}
$('.sortable').sortable(
{
forcePlaceholderSize: true
});
$('.filter_list_item input[type=checkbox]').click(
function()
{
var current_selected_filters_count = parseInt($('#selected_filters').html());
if ($(this).prop('checked'))
$('#selected_filters').html(current_selected_filters_count+1);
else
$('#selected_filters').html(current_selected_filters_count-1);
}
);
if (typeof filters !== 'undefined')
{
filters = JSON.parse(filters);
for (filter in filters)
{
$('#'+filter).attr("checked","checked");
$('#selected_filters').html(parseInt($('#selected_filters').html())+1);
$('select[name="'+filter+'_filter_type"]').val(filters[filter].filter_type);
$('select[name="'+filter+'_filter_show_limit"]').val(filters[filter].filter_show_limit);
}
}
}
);
|
import { createLocalVue, mount } from '@vue/test-utils';
import { config as dotenv } from 'dotenv';
import path from 'path';
import VueEnvPlugin from '@/index';
describe('Vue env plugin', () => {
dotenv({ path: path.join(__dirname, '.env.test') });
test('loads environment into plugin', () => {
const localVue = createLocalVue();
localVue.use(VueEnvPlugin);
const Component = {
template: '<div>Hello World</div>'
};
const wrapper = mount(Component, { localVue });
// Env var
expect(wrapper.vm.$env).toHaveProperty('TEST_VAR', 'Hello World');
// Camelcase
expect(wrapper.vm.$env).toHaveProperty('testVar', 'Hello World');
// Vue env var
expect(wrapper.vm.$env).toHaveProperty('VUE_APP_TEST_VAR_2', 'Hello Vue');
// Vue shortcut
expect(wrapper.vm.$env).toHaveProperty('TEST_VAR_2', 'Hello Vue');
// Vue camelcase
expect(wrapper.vm.$env).toHaveProperty('vueAppTestVar2', 'Hello Vue');
// Vue shortcut camelcase
expect(wrapper.vm.$env).toHaveProperty('testVar2', 'Hello Vue');
});
});
|
import { FileLoader } from '../FileLoader.js'
import { Matrix4 } from '../../math/Matrix4.js'
import { Color } from '../../math/Color.js'
import { DirectionalLight } from '../../lights/DirectionalLight.js'
import { PointLight } from '../../lights/PointLight.js'
import { SpotLight } from '../../lights/SpotLight.js'
import { AmbientLight } from '../../lights/AmbientLight.js'
import { MeshPhongMaterial } from '../../materials/MeshPhongMaterial.js'
import { RawShaderMaterial } from '../../materials/RawShaderMaterial.js'
import { InterleavedBuffer } from '../../core/InterleavedBuffer.js'
import { InterleavedBufferAttribute } from '../../core/InterleavedBufferAttribute.js'
import { BufferAttribute } from '../../core/BufferAttribute.js'
import { TextureLoader } from '../TextureLoader.js'
import { Group } from '../../objects/Group.js'
import { BufferGeometry } from '../../core/BufferGeometry.js'
import { Mesh } from '../../objects/Mesh.js'
import { LineSegments } from '../../objects/LineSegments.js'
import { Line } from '../../objects/Line.js'
import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js'
import { OrthographicCamera } from '../../cameras/OrthographicCamera.js'
import { AnimationClip } from '../../animation/AnimationClip.js'
import { Bone } from '../../objects/Bone.js'
import { Object3D } from '../../core/Object3D.js'
import { LineLoop } from '../../objects/LineLoop.js'
import { SkinnedMesh } from '../../objects/SkinnedMesh.js'
import { Skeleton } from '../../objects/Skeleton.js'
import { Scene } from '../../scenes/Scene.js'
import { Texture } from '../../textures/Texture.js'
import {
FrontSide,
BackSide,
DoubleSide,
NoBlending,
CustomBlending,
AddEquation,
SubtractEquation,
ReverseSubtractEquation,
ZeroFactor,
OneFactor,
SrcColorFactor,
OneMinusSrcColorFactor,
SrcAlphaFactor,
OneMinusSrcAlphaFactor,
DstAlphaFactor,
OneMinusDstAlphaFactor,
DstColorFactor,
OneMinusDstColorFactor,
SrcAlphaSaturateFactor,
NeverDepth,
AlwaysDepth,
LessDepth,
LessEqualDepth,
EqualDepth,
GreaterEqualDepth,
NotEqualDepth,
RepeatWrapping,
ClampToEdgeWrapping,
MirroredRepeatWrapping,
NearestFilter,
NearestMipMapNearestFilter,
NearestMipMapLinearFilter,
LinearFilter,
LinearMipMapNearestFilter,
LinearMipMapLinearFilter,
UnsignedByteType,
UnsignedShort4444Type,
UnsignedShort5551Type,
UnsignedShort565Type,
AlphaFormat,
RGBFormat,
RGBAFormat,
LuminanceFormat,
LuminanceAlphaFormat,
InterpolateDiscrete,
InterpolateLinear
} from '../../constants.js'
import { DefaultLoadingManager } from '../LoadingManager.js'
import { Loader } from '../Loader.js'
import { Matrix3 } from '../../math/Matrix3.js'
import { Vector2 } from '../../math/Vector2.js'
import { Vector3 } from '../../math/Vector3.js'
import { Vector4 } from '../../math/Vector4.js'
import { UniformsUtils } from '../../renderers/shaders/UniformsUtils.js'
import { MeshBasicMaterial } from '../../materials/MeshBasicMaterial.js'
import { MeshLambertMaterial } from '../../materials/MeshLambertMaterial.js'
import { QuaternionKeyframeTrack } from '../../animation/tracks/QuaternionKeyframeTrack.js'
import { VectorKeyframeTrack } from '../../animation/tracks/VectorKeyframeTrack.js'
import { AnimationUtils } from '../../animation/AnimationUtils.js'
import { LoaderUtils } from '../LoaderUtils.js'
import { _Math } from '../../math/Math.js'
var LegacyGLTFLoader = ( function () {
function LegacyGLTFLoader( manager ) {
this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
}
LegacyGLTFLoader.prototype = {
constructor: LegacyGLTFLoader,
crossOrigin: 'Anonymous',
load: function ( url, onLoad, onProgress, onError ) {
var scope = this;
var path = this.path && ( typeof this.path === "string" ) ? this.path : LoaderUtils.extractUrlBase( url );
var loader = new FileLoader( scope.manager );
loader.setResponseType( 'arraybuffer' );
loader.load( url, function ( data ) {
scope.parse( data, path, onLoad );
}, onProgress, onError );
},
setCrossOrigin: function ( value ) {
this.crossOrigin = value;
},
setPath: function ( value ) {
this.path = value;
},
parse: function ( data, path, callback ) {
var content;
var extensions = {};
var magic = LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) );
if ( magic === BINARY_EXTENSION_HEADER_DEFAULTS.magic ) {
extensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data );
content = extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content;
} else {
content = LoaderUtils.decodeText( new Uint8Array( data ) );
}
var json = JSON.parse( content );
if ( json.extensionsUsed && json.extensionsUsed.indexOf( EXTENSIONS.KHR_MATERIALS_COMMON ) >= 0 ) {
extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ] = new GLTFMaterialsCommonExtension( json );
}
var parser = new GLTFParser( json, extensions, {
path: path || this.path,
crossOrigin: this.crossOrigin
} );
parser.parse( function ( scene, scenes, cameras, animations ) {
var glTF = {
"scene": scene,
"scenes": scenes,
"cameras": cameras,
"animations": animations
};
callback( glTF );
} );
}
};
function GLTFRegistry() {
var objects = {};
return {
get: function ( key ) {
return objects[ key ];
},
add: function ( key, object ) {
objects[ key ] = object;
},
remove: function ( key ) {
delete objects[ key ];
},
removeAll: function () {
objects = {};
},
update: function ( scene, camera ) {
for ( var name in objects ) {
var object = objects[ name ];
if ( object.update ) {
object.update( scene, camera );
}
}
}
};
}
LegacyGLTFLoader.Shaders = {
update: function () {
console.warn( 'LegacyGLTFLoader.Shaders has been deprecated, and now updates automatically.' );
}
};
function GLTFShader( targetNode, allNodes ) {
var boundUniforms = {};
// bind each uniform to its source node
var uniforms = targetNode.material.uniforms;
for ( var uniformId in uniforms ) {
var uniform = uniforms[ uniformId ];
if ( uniform.semantic ) {
var sourceNodeRef = uniform.node;
var sourceNode = targetNode;
if ( sourceNodeRef ) {
sourceNode = allNodes[ sourceNodeRef ];
}
boundUniforms[ uniformId ] = {
semantic: uniform.semantic,
sourceNode: sourceNode,
targetNode: targetNode,
uniform: uniform
};
}
}
this.boundUniforms = boundUniforms;
this._m4 = new Matrix4();
}
// Update - update all the uniform values
GLTFShader.prototype.update = function ( scene, camera ) {
var boundUniforms = this.boundUniforms;
for ( var name in boundUniforms ) {
var boundUniform = boundUniforms[ name ];
switch ( boundUniform.semantic ) {
case "MODELVIEW":
var m4 = boundUniform.uniform.value;
m4.multiplyMatrices( camera.matrixWorldInverse, boundUniform.sourceNode.matrixWorld );
break;
case "MODELVIEWINVERSETRANSPOSE":
var m3 = boundUniform.uniform.value;
this._m4.multiplyMatrices( camera.matrixWorldInverse, boundUniform.sourceNode.matrixWorld );
m3.getNormalMatrix( this._m4 );
break;
case "PROJECTION":
var m4 = boundUniform.uniform.value;
m4.copy( camera.projectionMatrix );
break;
case "JOINTMATRIX":
var m4v = boundUniform.uniform.value;
for ( var mi = 0; mi < m4v.length; mi ++ ) {
// So it goes like this:
// SkinnedMesh world matrix is already baked into MODELVIEW;
// transform joints to local space,
// then transform using joint's inverse
m4v[ mi ]
.getInverse( boundUniform.sourceNode.matrixWorld )
.multiply( boundUniform.targetNode.skeleton.bones[ mi ].matrixWorld )
.multiply( boundUniform.targetNode.skeleton.boneInverses[ mi ] )
.multiply( boundUniform.targetNode.bindMatrix );
}
break;
default :
console.warn( "Unhandled shader semantic: " + boundUniform.semantic );
break;
}
}
};
LegacyGLTFLoader.Animations = {
update: function () {
console.warn( 'LegacyGLTFLoader.Animation has been deprecated. Use AnimationMixer instead.' );
}
};
var EXTENSIONS = {
KHR_BINARY_GLTF: 'KHR_binary_glTF',
KHR_MATERIALS_COMMON: 'KHR_materials_common'
};
function GLTFMaterialsCommonExtension( json ) {
this.name = EXTENSIONS.KHR_MATERIALS_COMMON;
this.lights = {};
var extension = ( json.extensions && json.extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ] ) || {};
var lights = extension.lights || {};
for ( var lightId in lights ) {
var light = lights[ lightId ];
var lightNode;
var lightParams = light[ light.type ];
var color = new Color().fromArray( lightParams.color );
switch ( light.type ) {
case "directional":
lightNode = new DirectionalLight( color );
lightNode.position.set( 0, 0, 1 );
break;
case "point":
lightNode = new PointLight( color );
break;
case "spot":
lightNode = new SpotLight( color );
lightNode.position.set( 0, 0, 1 );
break;
case "ambient":
lightNode = new AmbientLight( color );
break;
}
if ( lightNode ) {
this.lights[ lightId ] = lightNode;
}
}
}
var BINARY_EXTENSION_BUFFER_NAME = 'binary_glTF';
var BINARY_EXTENSION_HEADER_DEFAULTS = { magic: 'glTF', version: 1, contentFormat: 0 };
var BINARY_EXTENSION_HEADER_LENGTH = 20;
function GLTFBinaryExtension( data ) {
this.name = EXTENSIONS.KHR_BINARY_GLTF;
var headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH );
var header = {
magic: LoaderUtils.decodeText( new Uint8Array( data.slice( 0, 4 ) ) ),
version: headerView.getUint32( 4, true ),
length: headerView.getUint32( 8, true ),
contentLength: headerView.getUint32( 12, true ),
contentFormat: headerView.getUint32( 16, true )
};
for ( var key in BINARY_EXTENSION_HEADER_DEFAULTS ) {
var value = BINARY_EXTENSION_HEADER_DEFAULTS[ key ];
if ( header[ key ] !== value ) {
throw new Error( 'Unsupported glTF-Binary header: Expected "%s" to be "%s".', key, value );
}
}
var contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH, header.contentLength );
this.header = header;
this.content = LoaderUtils.decodeText( contentArray );
this.body = data.slice( BINARY_EXTENSION_HEADER_LENGTH + header.contentLength, header.length );
}
GLTFBinaryExtension.prototype.loadShader = function ( shader, bufferViews ) {
var bufferView = bufferViews[ shader.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].bufferView ];
var array = new Uint8Array( bufferView );
return LoaderUtils.decodeText( array );
};
var WEBGL_CONSTANTS = {
FLOAT: 5126,
//FLOAT_MAT2: 35674,
FLOAT_MAT3: 35675,
FLOAT_MAT4: 35676,
FLOAT_VEC2: 35664,
FLOAT_VEC3: 35665,
FLOAT_VEC4: 35666,
LINEAR: 9729,
REPEAT: 10497,
SAMPLER_2D: 35678,
TRIANGLES: 4,
LINES: 1,
UNSIGNED_BYTE: 5121,
UNSIGNED_SHORT: 5123,
VERTEX_SHADER: 35633,
FRAGMENT_SHADER: 35632
};
var WEBGL_TYPE = {
5126: Number,
//35674: Matrix2,
35675: Matrix3,
35676: Matrix4,
35664: Vector2,
35665: Vector3,
35666: Vector4,
35678: Texture
};
var WEBGL_COMPONENT_TYPES = {
5120: Int8Array,
5121: Uint8Array,
5122: Int16Array,
5123: Uint16Array,
5125: Uint32Array,
5126: Float32Array
};
var WEBGL_FILTERS = {
9728: NearestFilter,
9729: LinearFilter,
9984: NearestMipMapNearestFilter,
9985: LinearMipMapNearestFilter,
9986: NearestMipMapLinearFilter,
9987: LinearMipMapLinearFilter
};
var WEBGL_WRAPPINGS = {
33071: ClampToEdgeWrapping,
33648: MirroredRepeatWrapping,
10497: RepeatWrapping
};
var WEBGL_TEXTURE_FORMATS = {
6406: AlphaFormat,
6407: RGBFormat,
6408: RGBAFormat,
6409: LuminanceFormat,
6410: LuminanceAlphaFormat
};
var WEBGL_TEXTURE_DATATYPES = {
5121: UnsignedByteType,
32819: UnsignedShort4444Type,
32820: UnsignedShort5551Type,
33635: UnsignedShort565Type
};
var WEBGL_SIDES = {
1028: BackSide, // Culling front
1029: FrontSide // Culling back
//1032: NoSide // Culling front and back, what to do?
};
var WEBGL_DEPTH_FUNCS = {
512: NeverDepth,
513: LessDepth,
514: EqualDepth,
515: LessEqualDepth,
516: GreaterEqualDepth,
517: NotEqualDepth,
518: GreaterEqualDepth,
519: AlwaysDepth
};
var WEBGL_BLEND_EQUATIONS = {
32774: AddEquation,
32778: SubtractEquation,
32779: ReverseSubtractEquation
};
var WEBGL_BLEND_FUNCS = {
0: ZeroFactor,
1: OneFactor,
768: SrcColorFactor,
769: OneMinusSrcColorFactor,
770: SrcAlphaFactor,
771: OneMinusSrcAlphaFactor,
772: DstAlphaFactor,
773: OneMinusDstAlphaFactor,
774: DstColorFactor,
775: OneMinusDstColorFactor,
776: SrcAlphaSaturateFactor
// The followings are not supported by Three.js yet
//32769: CONSTANT_COLOR,
//32770: ONE_MINUS_CONSTANT_COLOR,
//32771: CONSTANT_ALPHA,
//32772: ONE_MINUS_CONSTANT_COLOR
};
var WEBGL_TYPE_SIZES = {
'SCALAR': 1,
'VEC2': 2,
'VEC3': 3,
'VEC4': 4,
'MAT2': 4,
'MAT3': 9,
'MAT4': 16
};
var PATH_PROPERTIES = {
scale: 'scale',
translation: 'position',
rotation: 'quaternion'
};
var INTERPOLATION = {
LINEAR: InterpolateLinear,
STEP: InterpolateDiscrete
};
var STATES_ENABLES = {
2884: 'CULL_FACE',
2929: 'DEPTH_TEST',
3042: 'BLEND',
3089: 'SCISSOR_TEST',
32823: 'POLYGON_OFFSET_FILL',
32926: 'SAMPLE_ALPHA_TO_COVERAGE'
};
function _each( object, callback, thisObj ) {
if ( !object ) {
return Promise.resolve();
}
var results;
var fns = [];
if ( Object.prototype.toString.call( object ) === '[object Array]' ) {
results = [];
var length = object.length;
for ( var idx = 0; idx < length; idx ++ ) {
var value = callback.call( thisObj || this, object[ idx ], idx );
if ( value ) {
fns.push( value );
if ( value instanceof Promise ) {
value.then( function( key, value ) {
results[ key ] = value;
}.bind( this, idx ));
} else {
results[ idx ] = value;
}
}
}
} else {
results = {};
for ( var key in object ) {
if ( object.hasOwnProperty( key ) ) {
var value = callback.call( thisObj || this, object[ key ], key );
if ( value ) {
fns.push( value );
if ( value instanceof Promise ) {
value.then( function( key, value ) {
results[ key ] = value;
}.bind( this, key ));
} else {
results[ key ] = value;
}
}
}
}
}
return Promise.all( fns ).then( function() {
return results;
});
}
function resolveURL( url, path ) {
// Invalid URL
if ( typeof url !== 'string' || url === '' )
return '';
// Absolute URL http://,https://,//
if ( /^(https?:)?\/\//i.test( url ) ) {
return url;
}
// Data URI
if ( /^data:.*,.*$/i.test( url ) ) {
return url;
}
// Blob URL
if ( /^blob:.*$/i.test( url ) ) {
return url;
}
// Relative URL
return ( path || '' ) + url;
}
// Three.js seems too dependent on attribute names so globally
// replace those in the shader code
function replaceTHREEShaderAttributes( shaderText, technique ) {
// Expected technique attributes
var attributes = {};
for ( var attributeId in technique.attributes ) {
var pname = technique.attributes[ attributeId ];
var param = technique.parameters[ pname ];
var atype = param.type;
var semantic = param.semantic;
attributes[ attributeId ] = {
type: atype,
semantic: semantic
};
}
// Figure out which attributes to change in technique
var shaderParams = technique.parameters;
var shaderAttributes = technique.attributes;
var params = {};
for ( var attributeId in attributes ) {
var pname = shaderAttributes[ attributeId ];
var shaderParam = shaderParams[ pname ];
var semantic = shaderParam.semantic;
if ( semantic ) {
params[ attributeId ] = shaderParam;
}
}
for ( var pname in params ) {
var param = params[ pname ];
var semantic = param.semantic;
var regEx = new RegExp( "\\b" + pname + "\\b", "g" );
switch ( semantic ) {
case "POSITION":
shaderText = shaderText.replace( regEx, 'position' );
break;
case "NORMAL":
shaderText = shaderText.replace( regEx, 'normal' );
break;
case 'TEXCOORD_0':
case 'TEXCOORD0':
case 'TEXCOORD':
shaderText = shaderText.replace( regEx, 'uv' );
break;
case 'TEXCOORD_1':
shaderText = shaderText.replace( regEx, 'uv2' );
break;
case 'COLOR_0':
case 'COLOR0':
case 'COLOR':
shaderText = shaderText.replace( regEx, 'color' );
break;
case "WEIGHT":
shaderText = shaderText.replace( regEx, 'skinWeight' );
break;
case "JOINT":
shaderText = shaderText.replace( regEx, 'skinIndex' );
break;
}
}
return shaderText;
}
function createDefaultMaterial() {
return new MeshPhongMaterial( {
color: 0x00000,
emissive: 0x888888,
specular: 0x000000,
shininess: 0,
transparent: false,
depthTest: true,
side: FrontSide
} );
}
// Deferred constructor for RawShaderMaterial types
function DeferredShaderMaterial( params ) {
this.isDeferredShaderMaterial = true;
this.params = params;
}
DeferredShaderMaterial.prototype.create = function () {
var uniforms = UniformsUtils.clone( this.params.uniforms );
for ( var uniformId in this.params.uniforms ) {
var originalUniform = this.params.uniforms[ uniformId ];
if ( originalUniform.value instanceof Texture ) {
uniforms[ uniformId ].value = originalUniform.value;
uniforms[ uniformId ].value.needsUpdate = true;
}
uniforms[ uniformId ].semantic = originalUniform.semantic;
uniforms[ uniformId ].node = originalUniform.node;
}
this.params.uniforms = uniforms;
return new RawShaderMaterial( this.params );
};
function GLTFParser( json, extensions, options ) {
this.json = json || {};
this.extensions = extensions || {};
this.options = options || {};
// loader object cache
this.cache = new GLTFRegistry();
}
GLTFParser.prototype._withDependencies = function ( dependencies ) {
var _dependencies = {};
for ( var i = 0; i < dependencies.length; i ++ ) {
var dependency = dependencies[ i ];
var fnName = "load" + dependency.charAt( 0 ).toUpperCase() + dependency.slice( 1 );
var cached = this.cache.get( dependency );
if ( cached !== undefined ) {
_dependencies[ dependency ] = cached;
} else if ( this[ fnName ] ) {
var fn = this[ fnName ]();
this.cache.add( dependency, fn );
_dependencies[ dependency ] = fn;
}
}
return _each( _dependencies, function ( dependency ) {
return dependency;
} );
};
GLTFParser.prototype.parse = function ( callback ) {
var json = this.json;
// Clear the loader cache
this.cache.removeAll();
// Fire the callback on complete
this._withDependencies( [
"scenes",
"cameras",
"animations"
] ).then( function ( dependencies ) {
var scenes = [];
for ( var name in dependencies.scenes ) {
scenes.push( dependencies.scenes[ name ] );
}
var scene = json.scene !== undefined ? dependencies.scenes[ json.scene ] : scenes[ 0 ];
var cameras = [];
for ( var name in dependencies.cameras ) {
var camera = dependencies.cameras[ name ];
cameras.push( camera );
}
var animations = [];
for ( var name in dependencies.animations ) {
animations.push( dependencies.animations[ name ] );
}
callback( scene, scenes, cameras, animations );
} );
};
GLTFParser.prototype.loadShaders = function () {
var json = this.json;
var extensions = this.extensions;
var options = this.options;
return this._withDependencies( [
"bufferViews"
] ).then( function ( dependencies ) {
return _each( json.shaders, function ( shader ) {
if ( shader.extensions && shader.extensions[ EXTENSIONS.KHR_BINARY_GLTF ] ) {
return extensions[ EXTENSIONS.KHR_BINARY_GLTF ].loadShader( shader, dependencies.bufferViews );
}
return new Promise( function ( resolve ) {
var loader = new FileLoader();
loader.setResponseType( 'text' );
loader.load( resolveURL( shader.uri, options.path ), function ( shaderText ) {
resolve( shaderText );
} );
} );
} );
} );
};
GLTFParser.prototype.loadBuffers = function () {
var json = this.json;
var extensions = this.extensions;
var options = this.options;
return _each( json.buffers, function ( buffer, name ) {
if ( name === BINARY_EXTENSION_BUFFER_NAME ) {
return extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body;
}
if ( buffer.type === 'arraybuffer' || buffer.type === undefined ) {
return new Promise( function ( resolve ) {
var loader = new FileLoader();
loader.setResponseType( 'arraybuffer' );
loader.load( resolveURL( buffer.uri, options.path ), function ( buffer ) {
resolve( buffer );
} );
} );
} else {
console.warn( 'LegacyGLTFLoader: ' + buffer.type + ' buffer type is not supported' );
}
} );
};
GLTFParser.prototype.loadBufferViews = function () {
var json = this.json;
return this._withDependencies( [
"buffers"
] ).then( function ( dependencies ) {
return _each( json.bufferViews, function ( bufferView ) {
var arraybuffer = dependencies.buffers[ bufferView.buffer ];
var byteLength = bufferView.byteLength !== undefined ? bufferView.byteLength : 0;
return arraybuffer.slice( bufferView.byteOffset, bufferView.byteOffset + byteLength );
} );
} );
};
GLTFParser.prototype.loadAccessors = function () {
var json = this.json;
return this._withDependencies( [
"bufferViews"
] ).then( function ( dependencies ) {
return _each( json.accessors, function ( accessor ) {
var arraybuffer = dependencies.bufferViews[ accessor.bufferView ];
var itemSize = WEBGL_TYPE_SIZES[ accessor.type ];
var TypedArray = WEBGL_COMPONENT_TYPES[ accessor.componentType ];
// For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.
var elementBytes = TypedArray.BYTES_PER_ELEMENT;
var itemBytes = elementBytes * itemSize;
// The buffer is not interleaved if the stride is the item size in bytes.
if ( accessor.byteStride && accessor.byteStride !== itemBytes ) {
// Use the full buffer if it's interleaved.
var array = new TypedArray( arraybuffer );
// Integer parameters to IB/IBA are in array elements, not bytes.
var ib = new InterleavedBuffer( array, accessor.byteStride / elementBytes );
return new InterleavedBufferAttribute( ib, itemSize, accessor.byteOffset / elementBytes );
} else {
array = new TypedArray( arraybuffer, accessor.byteOffset, accessor.count * itemSize );
return new BufferAttribute( array, itemSize );
}
} );
} );
};
GLTFParser.prototype.loadTextures = function () {
var json = this.json;
var extensions = this.extensions;
var options = this.options;
return this._withDependencies( [
"bufferViews"
] ).then( function ( dependencies ) {
return _each( json.textures, function ( texture ) {
if ( texture.source ) {
return new Promise( function ( resolve ) {
var source = json.images[ texture.source ];
var sourceUri = source.uri;
var isObjectURL = false;
if ( source.extensions && source.extensions[ EXTENSIONS.KHR_BINARY_GLTF ] ) {
var metadata = source.extensions[ EXTENSIONS.KHR_BINARY_GLTF ];
var bufferView = dependencies.bufferViews[ metadata.bufferView ];
var blob = new Blob( [ bufferView ], { type: metadata.mimeType } );
sourceUri = URL.createObjectURL( blob );
isObjectURL = true;
}
var textureLoader = Loader.Handlers.get( sourceUri );
if ( textureLoader === null ) {
textureLoader = new TextureLoader();
}
textureLoader.setCrossOrigin( options.crossOrigin );
textureLoader.load( resolveURL( sourceUri, options.path ), function ( _texture ) {
if ( isObjectURL ) URL.revokeObjectURL( sourceUri );
_texture.flipY = false;
if ( texture.name !== undefined ) _texture.name = texture.name;
_texture.format = texture.format !== undefined ? WEBGL_TEXTURE_FORMATS[ texture.format ] : RGBAFormat;
if ( texture.internalFormat !== undefined && _texture.format !== WEBGL_TEXTURE_FORMATS[ texture.internalFormat ] ) {
console.warn( 'LegacyGLTFLoader: Three.js doesn\'t support texture internalFormat which is different from texture format. ' +
'internalFormat will be forced to be the same value as format.' );
}
_texture.type = texture.type !== undefined ? WEBGL_TEXTURE_DATATYPES[ texture.type ] : UnsignedByteType;
if ( texture.sampler ) {
var sampler = json.samplers[ texture.sampler ];
_texture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || LinearFilter;
_texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || NearestMipMapLinearFilter;
_texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || RepeatWrapping;
_texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || RepeatWrapping;
}
resolve( _texture );
}, undefined, function () {
if ( isObjectURL ) URL.revokeObjectURL( sourceUri );
resolve();
} );
} );
}
} );
} );
};
GLTFParser.prototype.loadMaterials = function () {
var json = this.json;
return this._withDependencies( [
"shaders",
"textures"
] ).then( function ( dependencies ) {
return _each( json.materials, function ( material ) {
var materialType;
var materialValues = {};
var materialParams = {};
var khr_material;
if ( material.extensions && material.extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ] ) {
khr_material = material.extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ];
}
if ( khr_material ) {
// don't copy over unused values to avoid material warning spam
var keys = [ 'ambient', 'emission', 'transparent', 'transparency', 'doubleSided' ];
switch ( khr_material.technique ) {
case 'BLINN' :
case 'PHONG' :
materialType = MeshPhongMaterial;
keys.push( 'diffuse', 'specular', 'shininess' );
break;
case 'LAMBERT' :
materialType = MeshLambertMaterial;
keys.push( 'diffuse' );
break;
case 'CONSTANT' :
default :
materialType = MeshBasicMaterial;
break;
}
keys.forEach( function( v ) {
if ( khr_material.values[ v ] !== undefined ) materialValues[ v ] = khr_material.values[ v ];
} );
if ( khr_material.doubleSided || materialValues.doubleSided ) {
materialParams.side = DoubleSide;
}
if ( khr_material.transparent || materialValues.transparent ) {
materialParams.transparent = true;
materialParams.opacity = ( materialValues.transparency !== undefined ) ? materialValues.transparency : 1;
}
} else if ( material.technique === undefined ) {
materialType = MeshPhongMaterial;
Object.assign( materialValues, material.values );
} else {
materialType = DeferredShaderMaterial;
var technique = json.techniques[ material.technique ];
materialParams.uniforms = {};
var program = json.programs[ technique.program ];
if ( program ) {
materialParams.fragmentShader = dependencies.shaders[ program.fragmentShader ];
if ( ! materialParams.fragmentShader ) {
console.warn( "ERROR: Missing fragment shader definition:", program.fragmentShader );
materialType = MeshPhongMaterial;
}
var vertexShader = dependencies.shaders[ program.vertexShader ];
if ( ! vertexShader ) {
console.warn( "ERROR: Missing vertex shader definition:", program.vertexShader );
materialType = MeshPhongMaterial;
}
// IMPORTANT: FIX VERTEX SHADER ATTRIBUTE DEFINITIONS
materialParams.vertexShader = replaceTHREEShaderAttributes( vertexShader, technique );
var uniforms = technique.uniforms;
for ( var uniformId in uniforms ) {
var pname = uniforms[ uniformId ];
var shaderParam = technique.parameters[ pname ];
var ptype = shaderParam.type;
if ( WEBGL_TYPE[ ptype ] ) {
var pcount = shaderParam.count;
var value;
if ( material.values !== undefined ) value = material.values[ pname ];
var uvalue = new WEBGL_TYPE[ ptype ]();
var usemantic = shaderParam.semantic;
var unode = shaderParam.node;
switch ( ptype ) {
case WEBGL_CONSTANTS.FLOAT:
uvalue = shaderParam.value;
if ( pname == "transparency" ) {
materialParams.transparent = true;
}
if ( value !== undefined ) {
uvalue = value;
}
break;
case WEBGL_CONSTANTS.FLOAT_VEC2:
case WEBGL_CONSTANTS.FLOAT_VEC3:
case WEBGL_CONSTANTS.FLOAT_VEC4:
case WEBGL_CONSTANTS.FLOAT_MAT3:
if ( shaderParam && shaderParam.value ) {
uvalue.fromArray( shaderParam.value );
}
if ( value ) {
uvalue.fromArray( value );
}
break;
case WEBGL_CONSTANTS.FLOAT_MAT2:
// what to do?
console.warn( "FLOAT_MAT2 is not a supported uniform type" );
break;
case WEBGL_CONSTANTS.FLOAT_MAT4:
if ( pcount ) {
uvalue = new Array( pcount );
for ( var mi = 0; mi < pcount; mi ++ ) {
uvalue[ mi ] = new WEBGL_TYPE[ ptype ]();
}
if ( shaderParam && shaderParam.value ) {
var m4v = shaderParam.value;
uvalue.fromArray( m4v );
}
if ( value ) {
uvalue.fromArray( value );
}
} else {
if ( shaderParam && shaderParam.value ) {
var m4 = shaderParam.value;
uvalue.fromArray( m4 );
}
if ( value ) {
uvalue.fromArray( value );
}
}
break;
case WEBGL_CONSTANTS.SAMPLER_2D:
if ( value !== undefined ) {
uvalue = dependencies.textures[ value ];
} else if ( shaderParam.value !== undefined ) {
uvalue = dependencies.textures[ shaderParam.value ];
} else {
uvalue = null;
}
break;
}
materialParams.uniforms[ uniformId ] = {
value: uvalue,
semantic: usemantic,
node: unode
};
} else {
throw new Error( "Unknown shader uniform param type: " + ptype );
}
}
var states = technique.states || {};
var enables = states.enable || [];
var functions = states.functions || {};
var enableCullFace = false;
var enableDepthTest = false;
var enableBlend = false;
for ( var i = 0, il = enables.length; i < il; i ++ ) {
var enable = enables[ i ];
switch ( STATES_ENABLES[ enable ] ) {
case 'CULL_FACE':
enableCullFace = true;
break;
case 'DEPTH_TEST':
enableDepthTest = true;
break;
case 'BLEND':
enableBlend = true;
break;
// TODO: implement
case 'SCISSOR_TEST':
case 'POLYGON_OFFSET_FILL':
case 'SAMPLE_ALPHA_TO_COVERAGE':
break;
default:
throw new Error( "Unknown technique.states.enable: " + enable );
}
}
if ( enableCullFace ) {
materialParams.side = functions.cullFace !== undefined ? WEBGL_SIDES[ functions.cullFace ] : FrontSide;
} else {
materialParams.side = DoubleSide;
}
materialParams.depthTest = enableDepthTest;
materialParams.depthFunc = functions.depthFunc !== undefined ? WEBGL_DEPTH_FUNCS[ functions.depthFunc ] : LessDepth;
materialParams.depthWrite = functions.depthMask !== undefined ? functions.depthMask[ 0 ] : true;
materialParams.blending = enableBlend ? CustomBlending : NoBlending;
materialParams.transparent = enableBlend;
var blendEquationSeparate = functions.blendEquationSeparate;
if ( blendEquationSeparate !== undefined ) {
materialParams.blendEquation = WEBGL_BLEND_EQUATIONS[ blendEquationSeparate[ 0 ] ];
materialParams.blendEquationAlpha = WEBGL_BLEND_EQUATIONS[ blendEquationSeparate[ 1 ] ];
} else {
materialParams.blendEquation = AddEquation;
materialParams.blendEquationAlpha = AddEquation;
}
var blendFuncSeparate = functions.blendFuncSeparate;
if ( blendFuncSeparate !== undefined ) {
materialParams.blendSrc = WEBGL_BLEND_FUNCS[ blendFuncSeparate[ 0 ] ];
materialParams.blendDst = WEBGL_BLEND_FUNCS[ blendFuncSeparate[ 1 ] ];
materialParams.blendSrcAlpha = WEBGL_BLEND_FUNCS[ blendFuncSeparate[ 2 ] ];
materialParams.blendDstAlpha = WEBGL_BLEND_FUNCS[ blendFuncSeparate[ 3 ] ];
} else {
materialParams.blendSrc = OneFactor;
materialParams.blendDst = ZeroFactor;
materialParams.blendSrcAlpha = OneFactor;
materialParams.blendDstAlpha = ZeroFactor;
}
}
}
if ( Array.isArray( materialValues.diffuse ) ) {
materialParams.color = new Color().fromArray( materialValues.diffuse );
} else if ( typeof( materialValues.diffuse ) === 'string' ) {
materialParams.map = dependencies.textures[ materialValues.diffuse ];
}
delete materialParams.diffuse;
if ( typeof( materialValues.reflective ) === 'string' ) {
materialParams.envMap = dependencies.textures[ materialValues.reflective ];
}
if ( typeof( materialValues.bump ) === 'string' ) {
materialParams.bumpMap = dependencies.textures[ materialValues.bump ];
}
if ( Array.isArray( materialValues.emission ) ) {
if ( materialType === MeshBasicMaterial ) {
materialParams.color = new Color().fromArray( materialValues.emission );
} else {
materialParams.emissive = new Color().fromArray( materialValues.emission );
}
} else if ( typeof( materialValues.emission ) === 'string' ) {
if ( materialType === MeshBasicMaterial ) {
materialParams.map = dependencies.textures[ materialValues.emission ];
} else {
materialParams.emissiveMap = dependencies.textures[ materialValues.emission ];
}
}
if ( Array.isArray( materialValues.specular ) ) {
materialParams.specular = new Color().fromArray( materialValues.specular );
} else if ( typeof( materialValues.specular ) === 'string' ) {
materialParams.specularMap = dependencies.textures[ materialValues.specular ];
}
if ( materialValues.shininess !== undefined ) {
materialParams.shininess = materialValues.shininess;
}
var _material = new materialType( materialParams );
if ( material.name !== undefined ) _material.name = material.name;
return _material;
} );
} );
};
GLTFParser.prototype.loadMeshes = function () {
var json = this.json;
return this._withDependencies( [
"accessors",
"materials"
] ).then( function ( dependencies ) {
return _each( json.meshes, function ( mesh ) {
var group = new Group();
if ( mesh.name !== undefined ) group.name = mesh.name;
if ( mesh.extras ) group.userData = mesh.extras;
var primitives = mesh.primitives || [];
for ( var name in primitives ) {
var primitive = primitives[ name ];
if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || primitive.mode === undefined ) {
var geometry = new BufferGeometry();
var attributes = primitive.attributes;
for ( var attributeId in attributes ) {
var attributeEntry = attributes[ attributeId ];
if ( ! attributeEntry ) return;
var bufferAttribute = dependencies.accessors[ attributeEntry ];
switch ( attributeId ) {
case 'POSITION':
geometry.addAttribute( 'position', bufferAttribute );
break;
case 'NORMAL':
geometry.addAttribute( 'normal', bufferAttribute );
break;
case 'TEXCOORD_0':
case 'TEXCOORD0':
case 'TEXCOORD':
geometry.addAttribute( 'uv', bufferAttribute );
break;
case 'TEXCOORD_1':
geometry.addAttribute( 'uv2', bufferAttribute );
break;
case 'COLOR_0':
case 'COLOR0':
case 'COLOR':
geometry.addAttribute( 'color', bufferAttribute );
break;
case 'WEIGHT':
geometry.addAttribute( 'skinWeight', bufferAttribute );
break;
case 'JOINT':
geometry.addAttribute( 'skinIndex', bufferAttribute );
break;
default:
if ( ! primitive.material ) break;
var material = json.materials[ primitive.material ];
if ( ! material.technique ) break;
var parameters = json.techniques[ material.technique ].parameters || {};
for( var attributeName in parameters ) {
if ( parameters [ attributeName ][ 'semantic' ] === attributeId ) {
geometry.addAttribute( attributeName, bufferAttribute );
}
}
}
}
if ( primitive.indices ) {
geometry.setIndex( dependencies.accessors[ primitive.indices ] );
}
var material = dependencies.materials !== undefined ? dependencies.materials[ primitive.material ] : createDefaultMaterial();
var meshNode = new Mesh( geometry, material );
meshNode.castShadow = true;
meshNode.name = ( name === "0" ? group.name : group.name + name );
if ( primitive.extras ) meshNode.userData = primitive.extras;
group.add( meshNode );
} else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) {
var geometry = new BufferGeometry();
var attributes = primitive.attributes;
for ( var attributeId in attributes ) {
var attributeEntry = attributes[ attributeId ];
if ( ! attributeEntry ) return;
var bufferAttribute = dependencies.accessors[ attributeEntry ];
switch ( attributeId ) {
case 'POSITION':
geometry.addAttribute( 'position', bufferAttribute );
break;
case 'COLOR_0':
case 'COLOR0':
case 'COLOR':
geometry.addAttribute( 'color', bufferAttribute );
break;
}
}
var material = dependencies.materials[ primitive.material ];
var meshNode;
if ( primitive.indices ) {
geometry.setIndex( dependencies.accessors[ primitive.indices ] );
meshNode = new LineSegments( geometry, material );
} else {
meshNode = new Line( geometry, material );
}
meshNode.name = ( name === "0" ? group.name : group.name + name );
if ( primitive.extras ) meshNode.userData = primitive.extras;
group.add( meshNode );
} else {
console.warn( "Only triangular and line primitives are supported" );
}
}
return group;
} );
} );
};
GLTFParser.prototype.loadCameras = function () {
var json = this.json;
return _each( json.cameras, function ( camera ) {
if ( camera.type == "perspective" && camera.perspective ) {
var yfov = camera.perspective.yfov;
var aspectRatio = camera.perspective.aspectRatio !== undefined ? camera.perspective.aspectRatio : 1;
// According to COLLADA spec...
// aspectRatio = xfov / yfov
var xfov = yfov * aspectRatio;
var _camera = new PerspectiveCamera( _Math.radToDeg( xfov ), aspectRatio, camera.perspective.znear || 1, camera.perspective.zfar || 2e6 );
if ( camera.name !== undefined ) _camera.name = camera.name;
if ( camera.extras ) _camera.userData = camera.extras;
return _camera;
} else if ( camera.type == "orthographic" && camera.orthographic ) {
var _camera = new OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, camera.orthographic.znear, camera.orthographic.zfar );
if ( camera.name !== undefined ) _camera.name = camera.name;
if ( camera.extras ) _camera.userData = camera.extras;
return _camera;
}
} );
};
GLTFParser.prototype.loadSkins = function () {
var json = this.json;
return this._withDependencies( [
"accessors"
] ).then( function ( dependencies ) {
return _each( json.skins, function ( skin ) {
var bindShapeMatrix = new Matrix4();
if ( skin.bindShapeMatrix !== undefined ) bindShapeMatrix.fromArray( skin.bindShapeMatrix );
var _skin = {
bindShapeMatrix: bindShapeMatrix,
jointNames: skin.jointNames,
inverseBindMatrices: dependencies.accessors[ skin.inverseBindMatrices ]
};
return _skin;
} );
} );
};
GLTFParser.prototype.loadAnimations = function () {
var json = this.json;
return this._withDependencies( [
"accessors",
"nodes"
] ).then( function ( dependencies ) {
return _each( json.animations, function ( animation, animationId ) {
var tracks = [];
for ( var channelId in animation.channels ) {
var channel = animation.channels[ channelId ];
var sampler = animation.samplers[ channel.sampler ];
if ( sampler ) {
var target = channel.target;
var name = target.id;
var input = animation.parameters !== undefined ? animation.parameters[ sampler.input ] : sampler.input;
var output = animation.parameters !== undefined ? animation.parameters[ sampler.output ] : sampler.output;
var inputAccessor = dependencies.accessors[ input ];
var outputAccessor = dependencies.accessors[ output ];
var node = dependencies.nodes[ name ];
if ( node ) {
node.updateMatrix();
node.matrixAutoUpdate = true;
var TypedKeyframeTrack = PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.rotation
? QuaternionKeyframeTrack
: VectorKeyframeTrack;
var targetName = node.name ? node.name : node.uuid;
var interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : InterpolateLinear;
// KeyframeTrack.optimize() will modify given 'times' and 'values'
// buffers before creating a truncated copy to keep. Because buffers may
// be reused by other tracks, make copies here.
tracks.push( new TypedKeyframeTrack(
targetName + '.' + PATH_PROPERTIES[ target.path ],
AnimationUtils.arraySlice( inputAccessor.array, 0 ),
AnimationUtils.arraySlice( outputAccessor.array, 0 ),
interpolation
) );
}
}
}
var name = animation.name !== undefined ? animation.name : "animation_" + animationId;
return new AnimationClip( name, undefined, tracks );
} );
} );
};
GLTFParser.prototype.loadNodes = function () {
var json = this.json;
var extensions = this.extensions;
var scope = this;
return _each( json.nodes, function ( node ) {
var matrix = new Matrix4();
var _node;
if ( node.jointName ) {
_node = new Bone();
_node.name = node.name !== undefined ? node.name : node.jointName;
_node.jointName = node.jointName;
} else {
_node = new Object3D();
if ( node.name !== undefined ) _node.name = node.name;
}
if ( node.extras ) _node.userData = node.extras;
if ( node.matrix !== undefined ) {
matrix.fromArray( node.matrix );
_node.applyMatrix( matrix );
} else {
if ( node.translation !== undefined ) {
_node.position.fromArray( node.translation );
}
if ( node.rotation !== undefined ) {
_node.quaternion.fromArray( node.rotation );
}
if ( node.scale !== undefined ) {
_node.scale.fromArray( node.scale );
}
}
return _node;
} ).then( function ( __nodes ) {
return scope._withDependencies( [
"meshes",
"skins",
"cameras"
] ).then( function ( dependencies ) {
return _each( __nodes, function ( _node, nodeId ) {
var node = json.nodes[ nodeId ];
if ( node.meshes !== undefined ) {
for ( var meshId in node.meshes ) {
var mesh = node.meshes[ meshId ];
var group = dependencies.meshes[ mesh ];
if ( group === undefined ) {
console.warn( 'LegacyGLTFLoader: Couldn\'t find node "' + mesh + '".' );
continue;
}
for ( var childrenId in group.children ) {
var child = group.children[ childrenId ];
// clone Mesh to add to _node
var originalMaterial = child.material;
var originalGeometry = child.geometry;
var originalUserData = child.userData;
var originalName = child.name;
var material;
if ( originalMaterial.isDeferredShaderMaterial ) {
originalMaterial = material = originalMaterial.create();
} else {
material = originalMaterial;
}
switch ( child.type ) {
case 'LineSegments':
child = new LineSegments( originalGeometry, material );
break;
case 'LineLoop':
child = new LineLoop( originalGeometry, material );
break;
case 'Line':
child = new Line( originalGeometry, material );
break;
default:
child = new Mesh( originalGeometry, material );
}
child.castShadow = true;
child.userData = originalUserData;
child.name = originalName;
var skinEntry;
if ( node.skin ) {
skinEntry = dependencies.skins[ node.skin ];
}
// Replace Mesh with SkinnedMesh in library
if ( skinEntry ) {
var getJointNode = function ( jointId ) {
var keys = Object.keys( __nodes );
for ( var i = 0, il = keys.length; i < il; i ++ ) {
var n = __nodes[ keys[ i ] ];
if ( n.jointName === jointId ) return n;
}
return null;
};
var geometry = originalGeometry;
var material = originalMaterial;
material.skinning = true;
child = new SkinnedMesh( geometry, material );
child.castShadow = true;
child.userData = originalUserData;
child.name = originalName;
var bones = [];
var boneInverses = [];
for ( var i = 0, l = skinEntry.jointNames.length; i < l; i ++ ) {
var jointId = skinEntry.jointNames[ i ];
var jointNode = getJointNode( jointId );
if ( jointNode ) {
bones.push( jointNode );
var m = skinEntry.inverseBindMatrices.array;
var mat = new Matrix4().fromArray( m, i * 16 );
boneInverses.push( mat );
} else {
console.warn( "WARNING: joint: '" + jointId + "' could not be found" );
}
}
child.bind( new Skeleton( bones, boneInverses ), skinEntry.bindShapeMatrix );
var buildBoneGraph = function ( parentJson, parentObject, property ) {
var children = parentJson[ property ];
if ( children === undefined ) return;
for ( var i = 0, il = children.length; i < il; i ++ ) {
var nodeId = children[ i ];
var bone = __nodes[ nodeId ];
var boneJson = json.nodes[ nodeId ];
if ( bone !== undefined && bone.isBone === true && boneJson !== undefined ) {
parentObject.add( bone );
buildBoneGraph( boneJson, bone, 'children' );
}
}
};
buildBoneGraph( node, child, 'skeletons' );
}
_node.add( child );
}
}
}
if ( node.camera !== undefined ) {
var camera = dependencies.cameras[ node.camera ];
_node.add( camera );
}
if ( node.extensions
&& node.extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ]
&& node.extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ].light ) {
var extensionLights = extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ].lights;
var light = extensionLights[ node.extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ].light ];
_node.add( light );
}
return _node;
} );
} );
} );
};
GLTFParser.prototype.loadScenes = function () {
var json = this.json;
// scene node hierachy builder
function buildNodeHierachy( nodeId, parentObject, allNodes ) {
var _node = allNodes[ nodeId ];
parentObject.add( _node );
var node = json.nodes[ nodeId ];
if ( node.children ) {
var children = node.children;
for ( var i = 0, l = children.length; i < l; i ++ ) {
var child = children[ i ];
buildNodeHierachy( child, _node, allNodes );
}
}
}
return this._withDependencies( [
"nodes"
] ).then( function ( dependencies ) {
return _each( json.scenes, function ( scene ) {
var _scene = new Scene();
if ( scene.name !== undefined ) _scene.name = scene.name;
if ( scene.extras ) _scene.userData = scene.extras;
var nodes = scene.nodes || [];
for ( var i = 0, l = nodes.length; i < l; i ++ ) {
var nodeId = nodes[ i ];
buildNodeHierachy( nodeId, _scene, dependencies.nodes );
}
_scene.traverse( function ( child ) {
// Register raw material meshes with LegacyGLTFLoader.Shaders
if ( child.material && child.material.isRawShaderMaterial ) {
child.gltfShader = new GLTFShader( child, dependencies.nodes );
child.onBeforeRender = function(renderer, scene, camera){
this.gltfShader.update(scene, camera);
};
}
} );
return _scene;
} );
} );
};
return LegacyGLTFLoader;
} )();
export { LegacyGLTFLoader }
|
/**
* @param {string[][]} equations
* @param {number[]} values
* @param {string[][]} queries
* @return {number[]}
*/
const calcEquation = function (equations, values, queries) {
let map = new Map();
for (let i = 0; i < equations.length; ++i) {
enterToMap(map, equations[i][0], equations[i][1], values[i]);
}
let ret = [];
queries.forEach(query => ret.push(answer(map, query[0], query[1], new Set())));
return ret;
};
function enterToMap(map, v0, v1, k) {
// Enter both v0/v1 and v1/v0
let loop = v0 !== v1 ? 2 : 1;
for (let i = 0; i < loop; ++i) {
let subMap = map.get(v0);
if (!subMap) {
subMap = new Map();
map.set(v0, subMap);
}
subMap.set(v1, k);
[v0, v1] = [v1, v0];
k = 1 / k;
}
}
function answer(map, v0, v1, set) {
if (!map.has(v0) || !map.has(v1)) {
return -1;
}
if (v0 === v1) {
return 1;
}
let subMap = map.get(v0);
if (subMap.has(v1)) {
return subMap.get(v1);
}
for (let pair of subMap) {
if (set.has(pair[0])) {
continue;
}
set.add(pair[0]);
let x = answer(map, pair[0], v1, set);
set.delete(pair[0]);
if (x !== -1) {
return pair[1] * x;
}
}
return -1;
}
module.exports = calcEquation;
|
import {
FETCH_LOGIN,
FETCH_LOGIN_SUCCESS,
FETCH_LOGIN_FAIL,
FETCH_SIGNUP,
FETCH_SIGNUP_SUCCESS,
FETCH_SIGNUP_FAIL,
LOGOUT
} from 'reducers/user-reducer';
import { callService } from 'libs/service-caller';
export const login = (email, password) => {
return async (dispatch) => {
dispatch({ type: FETCH_LOGIN });
const { result } = await loginService(email, password);
if (result.code === 'OK') {
dispatch({
type: FETCH_LOGIN_SUCCESS,
payload: { userInfo: result.data }
});
} else {
dispatch({ type: FETCH_LOGIN_FAIL, payload: { error: result.code } })
}
}
};
export const signup = (name, email, password) => {
return async (dispatch) => {
dispatch({ type: FETCH_SIGNUP });
const { result } = await signupService(name, email, password);
if (result.code === 'OK') {
dispatch({
type: FETCH_SIGNUP_SUCCESS,
payload: { userInfo: result.data }
});
} else {
dispatch({ type: FETCH_SIGNUP_FAIL, payload: { error: result.code } })
}
};
};
export const logout = () => {
logoutService();
return { type: LOGOUT };
};
const loginService = (email, password) => {
const URL = 'api/users/login';
const data = { email, password };
const options = { method: 'POST' };
return callService(URL, data, options);
};
const signupService = (name, email, password) => {
const URL = 'api/users';
const method = 'POST';
const data = { name, email, password }
return callService(URL, data, { method });
};
const logoutService = () => {
const URL = 'api/me/token';
const method = 'DELETE';
return callService(URL, {}, { method });
};
|
jQuery(function() {
//ace.click_event defined in ace-elements.js
handle_side_menu();
enable_search_ahead();
general_things();//and settings
widget_boxes();
});
function handle_side_menu() {
$('#menu-toggler').on(ace.click_event, function() {
$('#sidebar').toggleClass('display');
$(this).toggleClass('display');
return false;
});
//mini
var $minimized = $('#sidebar').hasClass('menu-min');
$('#sidebar-collapse').on(ace.click_event, function(){
$('#sidebar').toggleClass('menu-min');
$(this).find('[class*="icon-"]:eq(0)').toggleClass('icon-double-angle-right');
$minimized = $('#sidebar').hasClass('menu-min');
if($minimized) {
$('.open > .submenu').removeClass('open');
}
});
var touch = "ontouchend" in document;
//opening submenu
$('.nav-list').on(ace.click_event, function(e){
//check to see if we have clicked on an element which is inside a .dropdown-toggle element?!
//if so, it means we should toggle a submenu
var link_element = $(e.target).closest('a');
if(!link_element || link_element.length == 0) return;//if not clicked inside a link element
if(! link_element.hasClass('dropdown-toggle') ) {//it doesn't have a submenu return
//just one thing before we return
//if we are in minimized mode, and we click on a first level menu item
//and the click is on the icon, not on the menu text then let's cancel event and cancel navigation
//Good for touch devices, that when the icon is tapped to see the menu text, navigation is cancelled
//navigation is only done when menu text is tapped
if($minimized && ace.click_event == "tap" &&
link_element.get(0).parentNode.parentNode == this /*.nav-list*/ )//i.e. only level-1 links
{
var text = link_element.find('.menu-text').get(0);
if( e.target != text && !$.contains(text , e.target) )//not clicking on the text or its children
return false;
}
return;
}
//
var sub = link_element.next().get(0);
//if we are opening this submenu, close all other submenus except the ".active" one
if(! $(sub).is(':visible') ) {//if not open and visible, let's open it and make it visible
var parent_ul = $(sub.parentNode).closest('ul');
if($minimized && parent_ul.hasClass('nav-list')) return;
parent_ul.find('> .open > .submenu').each(function(){
//close all other open submenus except for the active one
if(this != sub && !$(this.parentNode).hasClass('active')) {
$(this).slideUp(200).parent().removeClass('open');
//uncomment the following line to close all submenus on deeper levels when closing a submenu
//$(this).find('.open > .submenu').slideUp(0).parent().removeClass('open');
}
});
} else {
//uncomment the following line to close all submenus on deeper levels when closing a submenu
//$(sub).find('.open > .submenu').slideUp(0).parent().removeClass('open');
}
if($minimized && $(sub.parentNode.parentNode).hasClass('nav-list')) return false;
$(sub).slideToggle(200).parent().toggleClass('open');
return false;
})
}
function enable_search_ahead() {
$('#nav-search-input').typeahead({
source: ["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],
updater:function (item) {
$('#nav-search-input').focus();
return item;
}
});
}
function general_things() {
$('.ace-nav [class*="icon-animated-"]').closest('a').on('click', function(){
var icon = $(this).find('[class*="icon-animated-"]').eq(0);
var $match = icon.attr('class').match(/icon\-animated\-([\d\w]+)/);
icon.removeClass($match[0]);
$(this).off('click');
});
$('.nav-list .badge[title],.nav-list .label[title]').tooltip({'placement':'right'});
//simple settings
$('#ace-settings-btn').on(ace.click_event, function(){
$(this).toggleClass('open');
$('#ace-settings-box').toggleClass('open');
});
$('#ace-settings-header').removeAttr('checked').on('click', function(){
if(! this.checked ) {
if($('#ace-settings-sidebar').get(0).checked) $('#ace-settings-sidebar').click();
}
$('.navbar').toggleClass('navbar-fixed-top');
$(document.body).toggleClass('navbar-fixed');
});
$('#ace-settings-sidebar').removeAttr('checked').on('click', function(){
if(this.checked) {
if(! $('#ace-settings-header').get(0).checked) $('#ace-settings-header').click();
} else {
if($('#ace-settings-breadcrumbs').get(0).checked) $('#ace-settings-breadcrumbs').click();
}
$('#sidebar').toggleClass('fixed');
});
$('#ace-settings-breadcrumbs').removeAttr('checked').on('click', function(){
if(this.checked) {
if(! $('#ace-settings-sidebar').get(0).checked ) $('#ace-settings-sidebar').click();
}
$('#breadcrumbs').toggleClass('fixed');
$(document.body).toggleClass('breadcrumbs-fixed');
});
//Switching to RTL (right to left) Mode
$('#ace-settings-rtl').removeAttr('checked').on('click', function(){
switch_direction();
});
$('#btn-scroll-up').on(ace.click_event, function(){
var duration = Math.max(100, parseInt($('html').scrollTop() / 3));
$('html,body').animate({scrollTop: 0}, duration);
return false;
});
$('#skin-colorpicker').ace_colorpicker().on('change', function(){
var skin_class = $(this).find('option:selected').data('class');
var body = $(document.body);
body.removeClass('skin-1 skin-2 skin-3');
if(skin_class != 'default') body.addClass(skin_class);
if(skin_class == 'skin-1') {
$('.ace-nav > li.grey').addClass('dark');
}
else {
$('.ace-nav > li.grey').removeClass('dark');
}
if(skin_class == 'skin-2') {
$('.ace-nav > li').addClass('no-border margin-1');
$('.ace-nav > li:not(:last-child)').addClass('light-pink').find('> a > [class*="icon-"]').addClass('pink').end().eq(0).find('.badge').addClass('badge-warning');
}
else {
$('.ace-nav > li').removeClass('no-border margin-1');
$('.ace-nav > li:not(:last-child)').removeClass('light-pink').find('> a > [class*="icon-"]').removeClass('pink').end().eq(0).find('.badge').removeClass('badge-warning');
}
if(skin_class == 'skin-3') {
$('.ace-nav > li.grey').addClass('red').find('.badge').addClass('badge-yellow');
} else {
$('.ace-nav > li.grey').removeClass('red').find('.badge').removeClass('badge-yellow');
}
});
}
function widget_boxes() {
$('.page-content').delegate('.widget-toolbar > [data-action]' , 'click', function(ev) {
ev.preventDefault();
var $this = $(this);
var $action = $this.data('action');
var $box = $this.closest('.widget-box');
if($box.hasClass('ui-sortable-helper')) return;
if($action == 'collapse') {
var $body = $box.find('.widget-body');
var $icon = $this.find('[class*=icon-]').eq(0);
var $match = $icon.attr('class').match(/icon\-(.*)\-(up|down)/);
var $icon_down = 'icon-'+$match[1]+'-down';
var $icon_up = 'icon-'+$match[1]+'-up';
var $body_inner = $body.find('.widget-body-inner')
if($body_inner.length == 0) {
$body = $body.wrapInner('<div class="widget-body-inner"></div>').find(':first-child').eq(0);
} else $body = $body_inner.eq(0);
var expandSpeed = 300;
var collapseSpeed = 200;
if($box.hasClass('collapsed')) {
if($icon) $icon.addClass($icon_up).removeClass($icon_down);
$box.removeClass('collapsed');
$body.slideUp(0 , function(){$body.slideDown(expandSpeed)});
}
else {
if($icon) $icon.addClass($icon_down).removeClass($icon_up);
$body.slideUp(collapseSpeed, function(){$box.addClass('collapsed')});
}
}
else if($action == 'close') {
var closeSpeed = parseInt($this.data('close-speed')) || 300;
$box.hide(closeSpeed , function(){$box.remove()});
}
else if($action == 'reload') {
$this.blur();
var $remove = false;
if($box.css('position') == 'static') {$remove = true; $box.addClass('position-relative');}
$box.append('<div class="widget-box-layer"><i class="icon-spinner icon-spin icon-2x white"></i></div>');
setTimeout(function(){
$box.find('.widget-box-layer').remove();
if($remove) $box.removeClass('position-relative');
}, parseInt(Math.random() * 1000 + 1000));
}
else if($action == 'settings') {
}
});
}
function switch_direction() {
var $body = $(document.body);
$body
.toggleClass('rtl')
//toggle pull-right class on dropdown-menu
.find('.dropdown-menu:not(.datepicker-dropdown,.colorpicker)').toggleClass('pull-right')
.end()
//swap pull-left & pull-right
.find('.pull-right:not(.dropdown-menu,blockquote,.dropdown-submenu,.profile-skills .pull-right,.control-group .controls > [class*="span"]:first-child)').removeClass('pull-right').addClass('tmp-rtl-pull-right')
.end()
.find('.pull-left:not(.dropdown-submenu,.profile-skills .pull-left)').removeClass('pull-left').addClass('pull-right')
.end()
.find('.tmp-rtl-pull-right').removeClass('tmp-rtl-pull-right').addClass('pull-left')
.end()
.find('.chzn-container').toggleClass('chzn-rtl')
.end()
.find('.control-group .controls > [class*="span"]:first-child').toggleClass('pull-right')
.end()
function swap_classes(class1, class2) {
$body
.find('.'+class1).removeClass(class1).addClass('tmp-rtl-'+class1)
.end()
.find('.'+class2).removeClass(class2).addClass(class1)
.end()
.find('.tmp-rtl-'+class1).removeClass('tmp-rtl-'+class1).addClass(class2)
}
function swap_styles(style1, style2, elements) {
elements.each(function(){
var e = $(this);
var tmp = e.css(style2);
e.css(style2 , e.css(style1));
e.css(style1 , tmp);
});
}
swap_classes('align-left', 'align-right');
swap_classes('arrowed', 'arrowed-right');
swap_classes('arrowed-in', 'arrowed-in-right');
//redraw the traffic pie chart on homepage with a different parameter
var placeholder = $('#piechart-placeholder');
if(placeholder.size() > 0) {
var pos = $(document.body).hasClass('rtl') ? 'nw' : 'ne';//draw on north-west or north-east?
placeholder.data('draw').call(placeholder.get(0) , placeholder, placeholder.data('chart'), pos);
}
}
|
'use strict';
const Assert = require('assert');
const CodeStreamMessageTest = require(process.env.CSSVC_BACKEND_ROOT + '/api_server/modules/broadcaster/test/codestream_message_test');
const TokenHandler = require(process.env.CSSVC_BACKEND_ROOT + '/shared/server_utils/token_handler');
class ConfirmationEmailTest extends CodeStreamMessageTest {
constructor (options) {
super(options);
this.messageReceiveTimeout = 10000; // wait 10 seconds for message
this.userOptions.numRegistered = 1;
delete this.teamOptions.creatorIndex;
}
get description () {
return 'should send a confirmation email when a new user sends a change-email request';
}
// make the data that will be used during the test
makeData (callback) {
this.data = {
email: this.userFactory.randomEmail()
};
this.data._delayEmail = this.usingSocketCluster ? 1000 : (this.mockMode ? 200 : 5000); // delay the sending of the email, so we can start subscribing to the me-channel before the email is sent
callback();
}
// set the channel name to listen for the email message on
setChannelName (callback) {
// for the user we expect to receive the confirmation email, we use their me-channel
// we'll be sending the data that we would otherwise send to the outbound email
// service on this channel, and then we'll validate the data
this.channelName = `user-${this.currentUser.user.id}`;
callback();
}
// generate the message that starts the test
generateMessage (callback) {
// this is the message we expect to see
this.message = {
type: 'changeEmail',
userId: this.currentUser.user.id,
email: this.data.email,
fromSupport: true
};
// send the request to initiate chaning email
this.doApiRequest(
{
method: 'put',
path: '/change-email',
data: this.data,
testEmails: true, // this should get us email data back in the pubnub me-channel
token: this.token
},
callback
);
}
// validate the message received from pubnub
validateMessage (message) {
const gotMessage = message.message;
// verify a match to the url
const host = this.apiConfig.apiServer.publicApiUrl.replace(/\//g, '\\/');
const shouldMatch = new RegExp(`^${host}\\/web\\/confirm-email\\?t=(.+)$`);
const match = gotMessage.url.match(shouldMatch);
Assert(match && match.length === 2, 'confirmation link url is not correct');
// verify correct payload
const token = match[1];
const payload = new TokenHandler(this.apiConfig.sharedSecrets.auth).verify(token);
Assert.equal(payload.iss, 'CodeStream', 'token payload issuer is not CodeStream');
Assert.equal(payload.alg, 'HS256', 'token payload algortihm is not HS256');
Assert.equal(payload.type, 'email', 'token payload type should be conf');
Assert.equal(payload.uid, this.currentUser.user.id, 'uid in token payload is incorrect');
Assert(payload.iat <= Math.floor(Date.now() / 1000), 'iat in token payload is not earlier than now');
Assert.equal(payload.exp, payload.iat + 86400, 'token payload expiration is not one day out');
// allow to pass deepEqual
this.message.url = gotMessage.url;
return super.validateMessage(message);
}
}
module.exports = ConfirmationEmailTest;
|
const express = require('express');
const router = express.Router();
router.get('/', function(req, res) {
res.sendFile('/index.html');
});
module.exports = router;
|
"use strict";
const Document = require("../models/document");
/**
* Utility class that handles parsing the document file
* for any metadata
*/
class DocumentParserUtility {
constructor() {
this._metaRegex = /<!--META (.*) -->/;
this._missingLinkRegex = /\[(.*)\]\(\)/;
}
/**
* Handles taking in file content and returning
* a document object;
*/
getDocumentFromFileContent(fileContent) {
if (fileContent == null || fileContent.length <= 0) return null;
let metaData = this.extractMetaData(fileContent);
let markdown = this.extractContent(fileContent);
let document = new Document();
if (metaData) {
document.title = metaData.title;
document.tags = metaData.tags;
document.createDate = metaData.createDate;
document.updateDate = metaData.updateDate;
}
if (markdown) {
if (markdown.startsWith("\n")) {
markdown = markdown.substring(1);
}
document.markdown = markdown;
}
return document;
}
/**
* Extracts the metadata object from the document
* file if it exists.
*/
extractMetaData(fileContent) {
let meta = fileContent.match(this._metaRegex);
if (!meta || meta.length !== 2) return null;
return JSON.parse(meta[1]);
}
/**
* Handles extracting just the content from the
* document file
*/
extractContent(fileContent) {
return fileContent.replace(this._metaRegex, "");
}
/**
* Handles converting a document into a file content
* string
*/
convertDocumentToFileContent(document) {
if (document == null) return null;
let metaData = {
title: document.title,
tags: document.tags,
createDate: document.createDate,
updateDate: document.updateDate
};
let metaString = JSON.stringify(metaData);
let commentString = "<!--META " + metaString + " -->";
return commentString + "\n" + document.markdown;
}
/**
* Handles fetching the missing links from the markdown
*/
fetchMissingLinksFromMarkdown(markdown) {
if (!markdown || !markdown.length > 0) return [];
return markdown.match(this._missingLinkRegex) || [];
}
}
module.exports = DocumentParserUtility;
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rexrhombusplugin=e()}(this,function(){"use strict";function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function t(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(i){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=o(i);if(r){var n=o(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return s(this,t)}}function a(t,e,n){for(var i,r=t.points,o=0,s=r.length;o<s;o++)(i=r[o]).x+=e,i.y+=n;return t}var e=Phaser.Geom.Polygon,y=Phaser.Utils.Objects.IsPlainObject,l=Phaser.Utils.Objects.GetValue,g=Phaser.Geom.Line,h=function(){r(c,e);var h=u(c);function c(t,e,n,i){var r;if(f(this,c),r=h.call(this),y(t)){var o=t;t=l(o,"x",0),e=l(o,"y",0),n=l(o,"width",0),i=l(o,"height",0)}for(var s=r.points,u=0;u<4;u++)s.push({});return r.setTo(t,e,n,i),r}return t(c,[{key:"setTo",value:function(t,e,n,i){this._x=t,this._y=e,this._width=n,this._height=i;var r=this.points,o=this.centerX,s=this.centerY,u=n/2,h=i/2;return r[0].x=o+u,r[0].y=s,r[1].x=o,r[1].y=s+h,r[2].x=o-u,r[2].y=s,r[3].x=o,r[3].y=s-h,this.calculateArea(),this}},{key:"x",get:function(){return this._x},set:function(t){var e=t-this.x;0!=e&&(a(this,e,0),this._x=t)}},{key:"y",get:function(){return this._y},set:function(t){var e=t-this.y;0!=e&&(a(this,0,e),this._y=t)}},{key:"setPosition",value:function(t,e){var n=t-this.x,i=e-this.y;return 0==n&&0==i||(a(this,n,i),this._x=t,this._y=e),this}},{key:"left",get:function(){return this.x},set:function(t){this.x+=t-this.left}},{key:"right",get:function(){return this.x+this.width},set:function(t){this.x+=t-this.right}},{key:"top",get:function(){return this.y},set:function(t){this.y+=t-this.top}},{key:"bottom",get:function(){return this.y+this.height},set:function(t){this.y+=t-this.bottom}},{key:"centerX",get:function(){return this.x+this.width/2},set:function(t){this.x+=t-this.centerX}},{key:"centerY",get:function(){return this.y+this.height/2},set:function(t){this.y+=t-this.centetY}},{key:"width",get:function(){return this._width},set:function(t){this.setTo(this._x,this._y,t,this._height)}},{key:"height",get:function(){return this._height},set:function(t){this.setTo(this._x,this._y,this._width,t)}},{key:"setSize",value:function(t,e){return this.setTo(this._x,this._y,t,e),this}},{key:"isEmpty",value:function(){return this.width<=0||this.height<=0}},{key:"getEdge",value:function(t,e){void 0===e&&(e=new g);var n=this.points[t],i=this.points[(t+1)%4];return e.setTo(n.x,n.y,i.x,i.y),e}},{key:"getLineA",value:function(t){return this.getEdge(0,t)}},{key:"getLineB",value:function(t){return this.getEdge(1,t)}},{key:"getLineC",value:function(t){return this.getEdge(2,t)}},{key:"getLineD",value:function(t){return this.getEdge(3,t)}}]),c}();return Phaser.Geom.rexRhombus=h,function(){r(n,Phaser.Plugins.BasePlugin);var e=u(n);function n(t){return f(this,n),e.call(this,t)}return t(n,[{key:"start",value:function(){this.game.events.on("destroy",this.destroy,this)}},{key:"add",value:function(t,e,n,i){return new h(t,e,n,i)}}]),n}()});
|
import request from '@/utils/request'
// 常规纱采购分页查询
export function purchaseGeneralYarnPage(data = {}) {
const defaultParams = { pageNum: 1, pageSize: 20 }
return request({
url: '/aps/purchaseGeneralYarn/page',
method: 'post',
data: { ...defaultParams, ...data }
})
}
|
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/axios/index.js":
/*!*************************************!*\
!*** ./node_modules/axios/index.js ***!
\*************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");
/***/ }),
/***/ "./node_modules/axios/lib/adapters/xhr.js":
/*!************************************************!*\
!*** ./node_modules/axios/lib/adapters/xhr.js ***!
\************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
module.exports = function xhrAdapter(config) {
return new Promise(function dispatchXhrRequest(resolve, reject) {
var requestData = config.data;
var requestHeaders = config.headers;
if (utils.isFormData(requestData)) {
delete requestHeaders['Content-Type']; // Let the browser set it
}
var request = new XMLHttpRequest();
// HTTP basic authentication
if (config.auth) {
var username = config.auth.username || '';
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
}
var fullPath = buildFullPath(config.baseURL, config.url);
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
// Set the request timeout in MS
request.timeout = config.timeout;
// Listen for ready state
request.onreadystatechange = function handleLoad() {
if (!request || request.readyState !== 4) {
return;
}
// The request errored out and we didn't get a response, this will be
// handled by onerror instead
// With one exception: request that using file: protocol, most browsers
// will return status as 0 even though it's a successful request
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
return;
}
// Prepare the response
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
var response = {
data: responseData,
status: request.status,
statusText: request.statusText,
headers: responseHeaders,
config: config,
request: request
};
settle(resolve, reject, response);
// Clean up request
request = null;
};
// Handle browser request cancellation (as opposed to a manual cancellation)
request.onabort = function handleAbort() {
if (!request) {
return;
}
reject(createError('Request aborted', config, 'ECONNABORTED', request));
// Clean up request
request = null;
};
// Handle low level network errors
request.onerror = function handleError() {
// Real errors are hidden from us by the browser
// onerror should only fire if it's a network error
reject(createError('Network Error', config, null, request));
// Clean up request
request = null;
};
// Handle timeout
request.ontimeout = function handleTimeout() {
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
if (config.timeoutErrorMessage) {
timeoutErrorMessage = config.timeoutErrorMessage;
}
reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
request));
// Clean up request
request = null;
};
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if (utils.isStandardBrowserEnv()) {
// Add xsrf header
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
cookies.read(config.xsrfCookieName) :
undefined;
if (xsrfValue) {
requestHeaders[config.xsrfHeaderName] = xsrfValue;
}
}
// Add headers to the request
if ('setRequestHeader' in request) {
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
// Remove Content-Type if data is undefined
delete requestHeaders[key];
} else {
// Otherwise add header to the request
request.setRequestHeader(key, val);
}
});
}
// Add withCredentials to request if needed
if (!utils.isUndefined(config.withCredentials)) {
request.withCredentials = !!config.withCredentials;
}
// Add responseType to request if needed
if (config.responseType) {
try {
request.responseType = config.responseType;
} catch (e) {
// Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
if (config.responseType !== 'json') {
throw e;
}
}
}
// Handle progress if needed
if (typeof config.onDownloadProgress === 'function') {
request.addEventListener('progress', config.onDownloadProgress);
}
// Not all browsers support upload events
if (typeof config.onUploadProgress === 'function' && request.upload) {
request.upload.addEventListener('progress', config.onUploadProgress);
}
if (config.cancelToken) {
// Handle cancellation
config.cancelToken.promise.then(function onCanceled(cancel) {
if (!request) {
return;
}
request.abort();
reject(cancel);
// Clean up request
request = null;
});
}
if (!requestData) {
requestData = null;
}
// Send the request
request.send(requestData);
});
};
/***/ }),
/***/ "./node_modules/axios/lib/axios.js":
/*!*****************************************!*\
!*** ./node_modules/axios/lib/axios.js ***!
\*****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
/**
* Create an instance of Axios
*
* @param {Object} defaultConfig The default config for the instance
* @return {Axios} A new instance of Axios
*/
function createInstance(defaultConfig) {
var context = new Axios(defaultConfig);
var instance = bind(Axios.prototype.request, context);
// Copy axios.prototype to instance
utils.extend(instance, Axios.prototype, context);
// Copy context to instance
utils.extend(instance, context);
return instance;
}
// Create the default instance to be exported
var axios = createInstance(defaults);
// Expose Axios class to allow class inheritance
axios.Axios = Axios;
// Factory for creating new instances
axios.create = function create(instanceConfig) {
return createInstance(mergeConfig(axios.defaults, instanceConfig));
};
// Expose Cancel & CancelToken
axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
// Expose all/spread
axios.all = function all(promises) {
return Promise.all(promises);
};
axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
// Expose isAxiosError
axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js");
module.exports = axios;
// Allow use of default import syntax in TypeScript
module.exports.default = axios;
/***/ }),
/***/ "./node_modules/axios/lib/cancel/Cancel.js":
/*!*************************************************!*\
!*** ./node_modules/axios/lib/cancel/Cancel.js ***!
\*************************************************/
/***/ ((module) => {
"use strict";
/**
* A `Cancel` is an object that is thrown when an operation is canceled.
*
* @class
* @param {string=} message The message.
*/
function Cancel(message) {
this.message = message;
}
Cancel.prototype.toString = function toString() {
return 'Cancel' + (this.message ? ': ' + this.message : '');
};
Cancel.prototype.__CANCEL__ = true;
module.exports = Cancel;
/***/ }),
/***/ "./node_modules/axios/lib/cancel/CancelToken.js":
/*!******************************************************!*\
!*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
\******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
/**
* A `CancelToken` is an object that can be used to request cancellation of an operation.
*
* @class
* @param {Function} executor The executor function.
*/
function CancelToken(executor) {
if (typeof executor !== 'function') {
throw new TypeError('executor must be a function.');
}
var resolvePromise;
this.promise = new Promise(function promiseExecutor(resolve) {
resolvePromise = resolve;
});
var token = this;
executor(function cancel(message) {
if (token.reason) {
// Cancellation has already been requested
return;
}
token.reason = new Cancel(message);
resolvePromise(token.reason);
});
}
/**
* Throws a `Cancel` if cancellation has been requested.
*/
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
if (this.reason) {
throw this.reason;
}
};
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
CancelToken.source = function source() {
var cancel;
var token = new CancelToken(function executor(c) {
cancel = c;
});
return {
token: token,
cancel: cancel
};
};
module.exports = CancelToken;
/***/ }),
/***/ "./node_modules/axios/lib/cancel/isCancel.js":
/*!***************************************************!*\
!*** ./node_modules/axios/lib/cancel/isCancel.js ***!
\***************************************************/
/***/ ((module) => {
"use strict";
module.exports = function isCancel(value) {
return !!(value && value.__CANCEL__);
};
/***/ }),
/***/ "./node_modules/axios/lib/core/Axios.js":
/*!**********************************************!*\
!*** ./node_modules/axios/lib/core/Axios.js ***!
\**********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
/**
* Create a new instance of Axios
*
* @param {Object} instanceConfig The default config for the instance
*/
function Axios(instanceConfig) {
this.defaults = instanceConfig;
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()
};
}
/**
* Dispatch a request
*
* @param {Object} config The config specific for this request (merged with this.defaults)
*/
Axios.prototype.request = function request(config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof config === 'string') {
config = arguments[1] || {};
config.url = arguments[0];
} else {
config = config || {};
}
config = mergeConfig(this.defaults, config);
// Set config.method
if (config.method) {
config.method = config.method.toLowerCase();
} else if (this.defaults.method) {
config.method = this.defaults.method.toLowerCase();
} else {
config.method = 'get';
}
// Hook up interceptors middleware
var chain = [dispatchRequest, undefined];
var promise = Promise.resolve(config);
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
chain.unshift(interceptor.fulfilled, interceptor.rejected);
});
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
chain.push(interceptor.fulfilled, interceptor.rejected);
});
while (chain.length) {
promise = promise.then(chain.shift(), chain.shift());
}
return promise;
};
Axios.prototype.getUri = function getUri(config) {
config = mergeConfig(this.defaults, config);
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
};
// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, config) {
return this.request(mergeConfig(config || {}, {
method: method,
url: url,
data: (config || {}).data
}));
};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, data, config) {
return this.request(mergeConfig(config || {}, {
method: method,
url: url,
data: data
}));
};
});
module.exports = Axios;
/***/ }),
/***/ "./node_modules/axios/lib/core/InterceptorManager.js":
/*!***********************************************************!*\
!*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
function InterceptorManager() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
this.handlers.push({
fulfilled: fulfilled,
rejected: rejected
});
return this.handlers.length - 1;
};
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*/
InterceptorManager.prototype.eject = function eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
};
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*/
InterceptorManager.prototype.forEach = function forEach(fn) {
utils.forEach(this.handlers, function forEachHandler(h) {
if (h !== null) {
fn(h);
}
});
};
module.exports = InterceptorManager;
/***/ }),
/***/ "./node_modules/axios/lib/core/buildFullPath.js":
/*!******************************************************!*\
!*** ./node_modules/axios/lib/core/buildFullPath.js ***!
\******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");
/**
* Creates a new URL by combining the baseURL with the requestedURL,
* only when the requestedURL is not already an absolute URL.
* If the requestURL is absolute, this function returns the requestedURL untouched.
*
* @param {string} baseURL The base URL
* @param {string} requestedURL Absolute or relative URL to combine
* @returns {string} The combined full path
*/
module.exports = function buildFullPath(baseURL, requestedURL) {
if (baseURL && !isAbsoluteURL(requestedURL)) {
return combineURLs(baseURL, requestedURL);
}
return requestedURL;
};
/***/ }),
/***/ "./node_modules/axios/lib/core/createError.js":
/*!****************************************************!*\
!*** ./node_modules/axios/lib/core/createError.js ***!
\****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
/**
* Create an Error with the specified message, config, error code, request and response.
*
* @param {string} message The error message.
* @param {Object} config The config.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
* @param {Object} [request] The request.
* @param {Object} [response] The response.
* @returns {Error} The created error.
*/
module.exports = function createError(message, config, code, request, response) {
var error = new Error(message);
return enhanceError(error, config, code, request, response);
};
/***/ }),
/***/ "./node_modules/axios/lib/core/dispatchRequest.js":
/*!********************************************************!*\
!*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
\********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
/**
* Throws a `Cancel` if cancellation has been requested.
*/
function throwIfCancellationRequested(config) {
if (config.cancelToken) {
config.cancelToken.throwIfRequested();
}
}
/**
* Dispatch a request to the server using the configured adapter.
*
* @param {object} config The config that is to be used for the request
* @returns {Promise} The Promise to be fulfilled
*/
module.exports = function dispatchRequest(config) {
throwIfCancellationRequested(config);
// Ensure headers exist
config.headers = config.headers || {};
// Transform request data
config.data = transformData(
config.data,
config.headers,
config.transformRequest
);
// Flatten headers
config.headers = utils.merge(
config.headers.common || {},
config.headers[config.method] || {},
config.headers
);
utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
function cleanHeaderConfig(method) {
delete config.headers[method];
}
);
var adapter = config.adapter || defaults.adapter;
return adapter(config).then(function onAdapterResolution(response) {
throwIfCancellationRequested(config);
// Transform response data
response.data = transformData(
response.data,
response.headers,
config.transformResponse
);
return response;
}, function onAdapterRejection(reason) {
if (!isCancel(reason)) {
throwIfCancellationRequested(config);
// Transform response data
if (reason && reason.response) {
reason.response.data = transformData(
reason.response.data,
reason.response.headers,
config.transformResponse
);
}
}
return Promise.reject(reason);
});
};
/***/ }),
/***/ "./node_modules/axios/lib/core/enhanceError.js":
/*!*****************************************************!*\
!*** ./node_modules/axios/lib/core/enhanceError.js ***!
\*****************************************************/
/***/ ((module) => {
"use strict";
/**
* Update an Error with the specified config, error code, and response.
*
* @param {Error} error The error to update.
* @param {Object} config The config.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
* @param {Object} [request] The request.
* @param {Object} [response] The response.
* @returns {Error} The error.
*/
module.exports = function enhanceError(error, config, code, request, response) {
error.config = config;
if (code) {
error.code = code;
}
error.request = request;
error.response = response;
error.isAxiosError = true;
error.toJSON = function toJSON() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: this.config,
code: this.code
};
};
return error;
};
/***/ }),
/***/ "./node_modules/axios/lib/core/mergeConfig.js":
/*!****************************************************!*\
!*** ./node_modules/axios/lib/core/mergeConfig.js ***!
\****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
/**
* Config-specific merge-function which creates a new config-object
* by merging two configuration objects together.
*
* @param {Object} config1
* @param {Object} config2
* @returns {Object} New object resulting from merging config2 to config1
*/
module.exports = function mergeConfig(config1, config2) {
// eslint-disable-next-line no-param-reassign
config2 = config2 || {};
var config = {};
var valueFromConfig2Keys = ['url', 'method', 'data'];
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
var defaultToConfig2Keys = [
'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
];
var directMergeKeys = ['validateStatus'];
function getMergedValue(target, source) {
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
return utils.merge(target, source);
} else if (utils.isPlainObject(source)) {
return utils.merge({}, source);
} else if (utils.isArray(source)) {
return source.slice();
}
return source;
}
function mergeDeepProperties(prop) {
if (!utils.isUndefined(config2[prop])) {
config[prop] = getMergedValue(config1[prop], config2[prop]);
} else if (!utils.isUndefined(config1[prop])) {
config[prop] = getMergedValue(undefined, config1[prop]);
}
}
utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
if (!utils.isUndefined(config2[prop])) {
config[prop] = getMergedValue(undefined, config2[prop]);
}
});
utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
if (!utils.isUndefined(config2[prop])) {
config[prop] = getMergedValue(undefined, config2[prop]);
} else if (!utils.isUndefined(config1[prop])) {
config[prop] = getMergedValue(undefined, config1[prop]);
}
});
utils.forEach(directMergeKeys, function merge(prop) {
if (prop in config2) {
config[prop] = getMergedValue(config1[prop], config2[prop]);
} else if (prop in config1) {
config[prop] = getMergedValue(undefined, config1[prop]);
}
});
var axiosKeys = valueFromConfig2Keys
.concat(mergeDeepPropertiesKeys)
.concat(defaultToConfig2Keys)
.concat(directMergeKeys);
var otherKeys = Object
.keys(config1)
.concat(Object.keys(config2))
.filter(function filterAxiosKeys(key) {
return axiosKeys.indexOf(key) === -1;
});
utils.forEach(otherKeys, mergeDeepProperties);
return config;
};
/***/ }),
/***/ "./node_modules/axios/lib/core/settle.js":
/*!***********************************************!*\
!*** ./node_modules/axios/lib/core/settle.js ***!
\***********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
/**
* Resolve or reject a Promise based on response status.
*
* @param {Function} resolve A function that resolves the promise.
* @param {Function} reject A function that rejects the promise.
* @param {object} response The response.
*/
module.exports = function settle(resolve, reject, response) {
var validateStatus = response.config.validateStatus;
if (!response.status || !validateStatus || validateStatus(response.status)) {
resolve(response);
} else {
reject(createError(
'Request failed with status code ' + response.status,
response.config,
null,
response.request,
response
));
}
};
/***/ }),
/***/ "./node_modules/axios/lib/core/transformData.js":
/*!******************************************************!*\
!*** ./node_modules/axios/lib/core/transformData.js ***!
\******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
/**
* Transform the data for a request or a response
*
* @param {Object|String} data The data to be transformed
* @param {Array} headers The headers for the request or response
* @param {Array|Function} fns A single function or Array of functions
* @returns {*} The resulting transformed data
*/
module.exports = function transformData(data, headers, fns) {
/*eslint no-param-reassign:0*/
utils.forEach(fns, function transform(fn) {
data = fn(data, headers);
});
return data;
};
/***/ }),
/***/ "./node_modules/axios/lib/defaults.js":
/*!********************************************!*\
!*** ./node_modules/axios/lib/defaults.js ***!
\********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/* provided dependency */ var process = __webpack_require__(/*! process/browser */ "./node_modules/process/browser.js");
var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
var DEFAULT_CONTENT_TYPE = {
'Content-Type': 'application/x-www-form-urlencoded'
};
function setContentTypeIfUnset(headers, value) {
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
headers['Content-Type'] = value;
}
}
function getDefaultAdapter() {
var adapter;
if (typeof XMLHttpRequest !== 'undefined') {
// For browsers use XHR adapter
adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
// For node use HTTP adapter
adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
}
return adapter;
}
var defaults = {
adapter: getDefaultAdapter(),
transformRequest: [function transformRequest(data, headers) {
normalizeHeaderName(headers, 'Accept');
normalizeHeaderName(headers, 'Content-Type');
if (utils.isFormData(data) ||
utils.isArrayBuffer(data) ||
utils.isBuffer(data) ||
utils.isStream(data) ||
utils.isFile(data) ||
utils.isBlob(data)
) {
return data;
}
if (utils.isArrayBufferView(data)) {
return data.buffer;
}
if (utils.isURLSearchParams(data)) {
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
return data.toString();
}
if (utils.isObject(data)) {
setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
return JSON.stringify(data);
}
return data;
}],
transformResponse: [function transformResponse(data) {
/*eslint no-param-reassign:0*/
if (typeof data === 'string') {
try {
data = JSON.parse(data);
} catch (e) { /* Ignore */ }
}
return data;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: function validateStatus(status) {
return status >= 200 && status < 300;
}
};
defaults.headers = {
common: {
'Accept': 'application/json, text/plain, */*'
}
};
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
defaults.headers[method] = {};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
});
module.exports = defaults;
/***/ }),
/***/ "./node_modules/axios/lib/helpers/bind.js":
/*!************************************************!*\
!*** ./node_modules/axios/lib/helpers/bind.js ***!
\************************************************/
/***/ ((module) => {
"use strict";
module.exports = function bind(fn, thisArg) {
return function wrap() {
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
return fn.apply(thisArg, args);
};
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/buildURL.js":
/*!****************************************************!*\
!*** ./node_modules/axios/lib/helpers/buildURL.js ***!
\****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
function encode(val) {
return encodeURIComponent(val).
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%20/g, '+').
replace(/%5B/gi, '[').
replace(/%5D/gi, ']');
}
/**
* Build a URL by appending params to the end
*
* @param {string} url The base of the url (e.g., http://www.google.com)
* @param {object} [params] The params to be appended
* @returns {string} The formatted url
*/
module.exports = function buildURL(url, params, paramsSerializer) {
/*eslint no-param-reassign:0*/
if (!params) {
return url;
}
var serializedParams;
if (paramsSerializer) {
serializedParams = paramsSerializer(params);
} else if (utils.isURLSearchParams(params)) {
serializedParams = params.toString();
} else {
var parts = [];
utils.forEach(params, function serialize(val, key) {
if (val === null || typeof val === 'undefined') {
return;
}
if (utils.isArray(val)) {
key = key + '[]';
} else {
val = [val];
}
utils.forEach(val, function parseValue(v) {
if (utils.isDate(v)) {
v = v.toISOString();
} else if (utils.isObject(v)) {
v = JSON.stringify(v);
}
parts.push(encode(key) + '=' + encode(v));
});
});
serializedParams = parts.join('&');
}
if (serializedParams) {
var hashmarkIndex = url.indexOf('#');
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
}
return url;
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/combineURLs.js":
/*!*******************************************************!*\
!*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
\*******************************************************/
/***/ ((module) => {
"use strict";
/**
* Creates a new URL by combining the specified URLs
*
* @param {string} baseURL The base URL
* @param {string} relativeURL The relative URL
* @returns {string} The combined URL
*/
module.exports = function combineURLs(baseURL, relativeURL) {
return relativeURL
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
: baseURL;
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/cookies.js":
/*!***************************************************!*\
!*** ./node_modules/axios/lib/helpers/cookies.js ***!
\***************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs support document.cookie
(function standardBrowserEnv() {
return {
write: function write(name, value, expires, path, domain, secure) {
var cookie = [];
cookie.push(name + '=' + encodeURIComponent(value));
if (utils.isNumber(expires)) {
cookie.push('expires=' + new Date(expires).toGMTString());
}
if (utils.isString(path)) {
cookie.push('path=' + path);
}
if (utils.isString(domain)) {
cookie.push('domain=' + domain);
}
if (secure === true) {
cookie.push('secure');
}
document.cookie = cookie.join('; ');
},
read: function read(name) {
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
},
remove: function remove(name) {
this.write(name, '', Date.now() - 86400000);
}
};
})() :
// Non standard browser env (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return {
write: function write() {},
read: function read() { return null; },
remove: function remove() {}
};
})()
);
/***/ }),
/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
/*!*********************************************************!*\
!*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
\*********************************************************/
/***/ ((module) => {
"use strict";
/**
* Determines whether the specified URL is absolute
*
* @param {string} url The URL to test
* @returns {boolean} True if the specified URL is absolute, otherwise false
*/
module.exports = function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/isAxiosError.js":
/*!********************************************************!*\
!*** ./node_modules/axios/lib/helpers/isAxiosError.js ***!
\********************************************************/
/***/ ((module) => {
"use strict";
/**
* Determines whether the payload is an error thrown by Axios
*
* @param {*} payload The value to test
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
*/
module.exports = function isAxiosError(payload) {
return (typeof payload === 'object') && (payload.isAxiosError === true);
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
/*!***********************************************************!*\
!*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
(function standardBrowserEnv() {
var msie = /(msie|trident)/i.test(navigator.userAgent);
var urlParsingNode = document.createElement('a');
var originURL;
/**
* Parse a URL to discover it's components
*
* @param {String} url The URL to be parsed
* @returns {Object}
*/
function resolveURL(url) {
var href = url;
if (msie) {
// IE needs attribute set twice to normalize properties
urlParsingNode.setAttribute('href', href);
href = urlParsingNode.href;
}
urlParsingNode.setAttribute('href', href);
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
return {
href: urlParsingNode.href,
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
host: urlParsingNode.host,
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
hostname: urlParsingNode.hostname,
port: urlParsingNode.port,
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
urlParsingNode.pathname :
'/' + urlParsingNode.pathname
};
}
originURL = resolveURL(window.location.href);
/**
* Determine if a URL shares the same origin as the current location
*
* @param {String} requestURL The URL to test
* @returns {boolean} True if URL shares the same origin, otherwise false
*/
return function isURLSameOrigin(requestURL) {
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
return (parsed.protocol === originURL.protocol &&
parsed.host === originURL.host);
};
})() :
// Non standard browser envs (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return function isURLSameOrigin() {
return true;
};
})()
);
/***/ }),
/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
/*!***************************************************************!*\
!*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
module.exports = function normalizeHeaderName(headers, normalizedName) {
utils.forEach(headers, function processHeader(value, name) {
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
headers[normalizedName] = value;
delete headers[name];
}
});
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
/*!********************************************************!*\
!*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
\********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
// Headers whose duplicates are ignored by node
// c.f. https://nodejs.org/api/http.html#http_message_headers
var ignoreDuplicateOf = [
'age', 'authorization', 'content-length', 'content-type', 'etag',
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
'referer', 'retry-after', 'user-agent'
];
/**
* Parse headers into an object
*
* ```
* Date: Wed, 27 Aug 2014 08:58:49 GMT
* Content-Type: application/json
* Connection: keep-alive
* Transfer-Encoding: chunked
* ```
*
* @param {String} headers Headers needing to be parsed
* @returns {Object} Headers parsed into an object
*/
module.exports = function parseHeaders(headers) {
var parsed = {};
var key;
var val;
var i;
if (!headers) { return parsed; }
utils.forEach(headers.split('\n'), function parser(line) {
i = line.indexOf(':');
key = utils.trim(line.substr(0, i)).toLowerCase();
val = utils.trim(line.substr(i + 1));
if (key) {
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
return;
}
if (key === 'set-cookie') {
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
} else {
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
}
});
return parsed;
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/spread.js":
/*!**************************************************!*\
!*** ./node_modules/axios/lib/helpers/spread.js ***!
\**************************************************/
/***/ ((module) => {
"use strict";
/**
* Syntactic sugar for invoking a function and expanding an array for arguments.
*
* Common use case would be to use `Function.prototype.apply`.
*
* ```js
* function f(x, y, z) {}
* var args = [1, 2, 3];
* f.apply(null, args);
* ```
*
* With `spread` this example can be re-written.
*
* ```js
* spread(function(x, y, z) {})([1, 2, 3]);
* ```
*
* @param {Function} callback
* @returns {Function}
*/
module.exports = function spread(callback) {
return function wrap(arr) {
return callback.apply(null, arr);
};
};
/***/ }),
/***/ "./node_modules/axios/lib/utils.js":
/*!*****************************************!*\
!*** ./node_modules/axios/lib/utils.js ***!
\*****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
/*global toString:true*/
// utils is a library of generic helper functions non-specific to axios
var toString = Object.prototype.toString;
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Array, otherwise false
*/
function isArray(val) {
return toString.call(val) === '[object Array]';
}
/**
* Determine if a value is undefined
*
* @param {Object} val The value to test
* @returns {boolean} True if the value is undefined, otherwise false
*/
function isUndefined(val) {
return typeof val === 'undefined';
}
/**
* Determine if a value is a Buffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Buffer, otherwise false
*/
function isBuffer(val) {
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
}
/**
* Determine if a value is an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
function isArrayBuffer(val) {
return toString.call(val) === '[object ArrayBuffer]';
}
/**
* Determine if a value is a FormData
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an FormData, otherwise false
*/
function isFormData(val) {
return (typeof FormData !== 'undefined') && (val instanceof FormData);
}
/**
* Determine if a value is a view on an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
function isArrayBufferView(val) {
var result;
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
result = ArrayBuffer.isView(val);
} else {
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
}
return result;
}
/**
* Determine if a value is a String
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a String, otherwise false
*/
function isString(val) {
return typeof val === 'string';
}
/**
* Determine if a value is a Number
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Number, otherwise false
*/
function isNumber(val) {
return typeof val === 'number';
}
/**
* Determine if a value is an Object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Object, otherwise false
*/
function isObject(val) {
return val !== null && typeof val === 'object';
}
/**
* Determine if a value is a plain Object
*
* @param {Object} val The value to test
* @return {boolean} True if value is a plain Object, otherwise false
*/
function isPlainObject(val) {
if (toString.call(val) !== '[object Object]') {
return false;
}
var prototype = Object.getPrototypeOf(val);
return prototype === null || prototype === Object.prototype;
}
/**
* Determine if a value is a Date
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Date, otherwise false
*/
function isDate(val) {
return toString.call(val) === '[object Date]';
}
/**
* Determine if a value is a File
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
function isFile(val) {
return toString.call(val) === '[object File]';
}
/**
* Determine if a value is a Blob
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Blob, otherwise false
*/
function isBlob(val) {
return toString.call(val) === '[object Blob]';
}
/**
* Determine if a value is a Function
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Function, otherwise false
*/
function isFunction(val) {
return toString.call(val) === '[object Function]';
}
/**
* Determine if a value is a Stream
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Stream, otherwise false
*/
function isStream(val) {
return isObject(val) && isFunction(val.pipe);
}
/**
* Determine if a value is a URLSearchParams object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
function isURLSearchParams(val) {
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
}
/**
* Trim excess whitespace off the beginning and end of a string
*
* @param {String} str The String to trim
* @returns {String} The String freed of excess whitespace
*/
function trim(str) {
return str.replace(/^\s*/, '').replace(/\s*$/, '');
}
/**
* Determine if we're running in a standard browser environment
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
*
* web workers:
* typeof window -> undefined
* typeof document -> undefined
*
* react-native:
* navigator.product -> 'ReactNative'
* nativescript
* navigator.product -> 'NativeScript' or 'NS'
*/
function isStandardBrowserEnv() {
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
navigator.product === 'NativeScript' ||
navigator.product === 'NS')) {
return false;
}
return (
typeof window !== 'undefined' &&
typeof document !== 'undefined'
);
}
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*/
function forEach(obj, fn) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return;
}
// Force an array if not already something iterable
if (typeof obj !== 'object') {
/*eslint no-param-reassign:0*/
obj = [obj];
}
if (isArray(obj)) {
// Iterate over array values
for (var i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj);
}
} else {
// Iterate over object keys
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
fn.call(null, obj[key], key, obj);
}
}
}
}
/**
* Accepts varargs expecting each argument to be an object, then
* immutably merges the properties of each object and returns result.
*
* When multiple objects contain the same key the later object in
* the arguments list will take precedence.
*
* Example:
*
* ```js
* var result = merge({foo: 123}, {foo: 456});
* console.log(result.foo); // outputs 456
* ```
*
* @param {Object} obj1 Object to merge
* @returns {Object} Result of all merge properties
*/
function merge(/* obj1, obj2, obj3, ... */) {
var result = {};
function assignValue(val, key) {
if (isPlainObject(result[key]) && isPlainObject(val)) {
result[key] = merge(result[key], val);
} else if (isPlainObject(val)) {
result[key] = merge({}, val);
} else if (isArray(val)) {
result[key] = val.slice();
} else {
result[key] = val;
}
}
for (var i = 0, l = arguments.length; i < l; i++) {
forEach(arguments[i], assignValue);
}
return result;
}
/**
* Extends object a by mutably adding to it the properties of object b.
*
* @param {Object} a The object to be extended
* @param {Object} b The object to copy properties from
* @param {Object} thisArg The object to bind function to
* @return {Object} The resulting value of object a
*/
function extend(a, b, thisArg) {
forEach(b, function assignValue(val, key) {
if (thisArg && typeof val === 'function') {
a[key] = bind(val, thisArg);
} else {
a[key] = val;
}
});
return a;
}
/**
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
*
* @param {string} content with BOM
* @return {string} content value without BOM
*/
function stripBOM(content) {
if (content.charCodeAt(0) === 0xFEFF) {
content = content.slice(1);
}
return content;
}
module.exports = {
isArray: isArray,
isArrayBuffer: isArrayBuffer,
isBuffer: isBuffer,
isFormData: isFormData,
isArrayBufferView: isArrayBufferView,
isString: isString,
isNumber: isNumber,
isObject: isObject,
isPlainObject: isPlainObject,
isUndefined: isUndefined,
isDate: isDate,
isFile: isFile,
isBlob: isBlob,
isFunction: isFunction,
isStream: isStream,
isURLSearchParams: isURLSearchParams,
isStandardBrowserEnv: isStandardBrowserEnv,
forEach: forEach,
merge: merge,
extend: extend,
trim: trim,
stripBOM: stripBOM
};
/***/ }),
/***/ "./node_modules/process/browser.js":
/*!*****************************************!*\
!*** ./node_modules/process/browser.js ***!
\*****************************************/
/***/ ((module) => {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
/*!****************************************!*\
!*** ./resources/js/create_article.js ***!
\****************************************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function datasetHTMLTemplate(currentChartDataset) {
return "\n <div class=\"row mb-3 d-flex align-items-end dataset\" id=\"dataset_".concat(currentChartDataset, "\">\n <div class=\"col-4\">\n <label for=\"label_").concat(currentChartDataset, "\" class=\"form-label\">\u041D\u0430\u0437\u0432\u0430 \u043F\u043E\u043B\u044F</label>\n <input type=\"text\" class=\"form-control dataset_element dataset_label\" id=\"label_").concat(currentChartDataset, "\">\n </div>\n <div class=\"col-5\">\n <label for=\"value_").concat(currentChartDataset, "\" class=\"form-label\">\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F</label>\n <input type=\"text\" class=\"form-control dataset_element dataset_value\" id=\"value_").concat(currentChartDataset, "\">\n </div>\n <div class=\"col-3\">\n <button class=\"btn btn-primary col-12\" onclick=\"document.querySelector('#dataset_").concat(currentChartDataset, "').remove()\">\n \u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438\n </button>\n </div>\n </div>\n ");
}
var isValidationEnabled = true;
var datasetContainer = document.querySelector('#datasets_container');
var editDatasetContainer = document.querySelector('#edit_datasets_container');
var currentChartDataset = 0;
document.querySelector('#add_dataset_button').onclick = function () {
datasetContainer.innerHTML += datasetHTMLTemplate(currentChartDataset);
currentChartDataset += 1;
};
document.querySelector('#edit_add_dataset_button').onclick = function () {
editDatasetContainer.innerHTML += datasetHTMLTemplate(currentChartDataset);
currentChartDataset += 1;
};
/* ************************************************************************ */
var articleFieldsIDs = ['report_id', 'article_name', 'article_text', 'additional_file'];
var chartFieldsIDs = ['chart_title', 'chart_legend', 'chart_type', 'chart_axis_x', 'chart_axis_y', 'chart_sufix', 'chart_verbal_rounding', 'chart_verbal_rounding_when_hovered'];
var editChartFieldsIDs = ['edit_chart_id', 'edit_chart_title', 'edit_chart_legend', 'edit_chart_type', 'edit_chart_axis_x', 'edit_chart_axis_y', 'edit_chart_sufix', 'edit_chart_verbal_rounding', 'edit_chart_verbal_rounding_when_hovered'];
var rules = {
'requeried': function requeried(string) {
return string.length > 0 ? true : false;
},
'numbers': function numbers(string) {
var re = /^[0-9]+$/gmi;
return string.match(re) != null ? true : false;
},
'letters': function letters(string) {
var re = /^[a-zA-Zа-яА-ЯґҐїЇіІ\s`"’'.]+$/gmi;
return string.match(re) != null ? true : false;
},
'datasets': function datasets() {
var amountOfDatasets = document.querySelectorAll('.dataset');
return amountOfDatasets.length > 0 ? true : false;
}
};
var elementsForArticlesValidation = [{
selector: '#report_id',
rules: ['requeried'],
errorMessage: 'Оберіть звіт, до якого відноситься стаття'
}, {
selector: '#article_name',
rules: ['requeried'],
errorMessage: 'Поле "Назва статті" повинно бути заповнене'
}, {
selector: '#article_text',
rules: ['requeried'],
errorMessage: 'Заповніть текст статті'
}];
var elementsForChartCreateValidation = [{
selector: '#chart_title',
rules: ['requeried'],
errorMessage: 'Поле "Назва графіка" повинно бути заповнене'
}, {
selector: '#chart_legend',
rules: ['requeried'],
errorMessage: 'Поле "Додаткова назва графіка" повинне бути заповнене'
}, {
selector: '#chart_type',
rules: ['requeried'],
errorMessage: 'Необхідно обрати тип графіку'
}, {
selector: '.dataset_label',
rules: ['requeried'],
errorMessage: 'Назва набору даних повнинна бути заповнена'
}, {
selector: '.dataset_value',
rules: ['requeried', 'numbers'],
errorMessage: 'Значення набору даних повинне бути заповнене та містити лише цифри'
}, {
selector: '#add_dataset_button',
rules: ['datasets'],
errorMessage: 'Додайте хоча б один набір данних!'
}];
var elementsForChartEditValidation = [{
selector: '#edit_chart_title',
rules: ['requeried'],
errorMessage: 'Поле "Назва графіка" повинно бути заповнене'
}, {
selector: '#edit_chart_legend',
rules: ['requeried'],
errorMessage: 'Поле "Додаткова назва графіка" повинне бути заповнене'
}, {
selector: '#edit_chart_type',
rules: ['requeried'],
errorMessage: 'Необхідно обрати тип графіку'
}, {
selector: '.dataset_label',
rules: ['requeried'],
errorMessage: 'Назва набору даних повнинна бути заповнена'
}, {
selector: '.dataset_value',
rules: ['requeried', 'numbers'],
errorMessage: 'Значення набору даних повинне бути заповнене та містити лише цифри'
}, {
selector: '#edit_add_dataset_button',
rules: ['datasets'],
errorMessage: 'Додайте хоча б один набір данних!'
}];
function chartHTMLTemplate(chartArrayId) {
return "\n <div class=\"col-12 col-md-10 col-xxl-8 ms-4 px-3 py-4 shadow chart-holder\"> \n <div class=\"chart-menu-buttons-holder d-flex flex-column shadow p-2 rounded\">\n <button class=\"btn btn-primary edit-chart-button mb-2\" chart_array_id=\"".concat(chartArrayId, "\">\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438</button>\n <button class=\"btn btn-danger remove-chart-button\" chart_array_id=\"").concat(chartArrayId, "\">\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438</button>\n </div>\n <canvas class=\"__article_id___chart\"></canvas> \n </div>\n <hr class=\"mb-3\"/>\n ");
}
var chartSelectors = {
chartContainer: '.charts-container',
chart: '.__article_id___chart',
editChartButton: '.edit-chart-button',
removeChartButton: '.remove-chart-button'
};
var charts = [];
var articleChartsInstances = [];
/**
* Cuts incoming string into pieces with length wich are close to "symbolsPerLine" number and places them into array
*
* @param {number} symbolsPerLine
* @param {string} string
* @returns
*/
function stringCut(symbolsPerLine, string) {
function findClosestSpaceToSymbolsPerLineNumberInString(lengthPerLine, string) {
var spaceIndexes = [];
var closestSpaces = [];
var previousDifference;
var currentClosestSpaceIndex;
for (var i = 0; i < string.length; i++) {
if (string[i] === ' ') {
spaceIndexes.push(i);
}
}
var _loop = function _loop(_i) {
lengthPerLine = lengthPerLine * _i;
spaceIndexes.forEach(function (spaceIndex, index) {
if (index == 0) {
previousDifference = Math.abs(lengthPerLine - spaceIndex);
} else if (previousDifference > Math.abs(lengthPerLine - spaceIndex)) {
currentClosestSpaceIndex = spaceIndex;
previousDifference = Math.abs(lengthPerLine - spaceIndex);
closestSpaces[_i - 1] = spaceIndex;
}
});
};
for (var _i = 1; spaceIndexes[spaceIndexes.length - 1] > lengthPerLine; _i++) {
_loop(_i);
} //deletes last space
closestSpaces.pop();
return closestSpaces;
}
function devideStringBySpaceIndexes(closestSpaceIndexes, string) {
var devidedString = [];
var tempString;
closestSpaceIndexes.unshift(0);
closestSpaceIndexes.push(string.length);
for (var i = 0; i < closestSpaceIndexes.length - 1; i++) {
tempString = '';
for (var j = i == 0 ? closestSpaceIndexes[i] : closestSpaceIndexes[i] + 1; j < closestSpaceIndexes[i + 1]; j++) {
tempString += string[j];
}
devidedString[i] = tempString;
}
return devidedString;
}
if (string.length < symbolsPerLine * 1.5) {
return string;
} else {
return devideStringBySpaceIndexes(findClosestSpaceToSymbolsPerLineNumberInString(symbolsPerLine, string), string);
}
}
function removeElementFromChartArray(chartArrayIndex) {
charts.splice(chartArrayIndex, 1);
articleChartsInstances.splice(chartArrayIndex, 1);
}
/**
* Show edit chart modal with filled inputs
*
* @param {number} id id of a particular chart in charts array
*/
function showEditChartModal(id) {
function element(selector) {
return document.querySelector(selector);
}
var modal = new bootstrap.Modal(document.getElementById('editChartModal'));
var chartElement = charts[id];
modal.show();
var chartTitle = '';
if (_typeof(chartElement.title) == 'object') {
chartElement.title.forEach(function (titleFragment, index) {
chartTitle += index == 0 ? titleFragment : ' ' + titleFragment;
});
} else {
chartTitle = chartElement.title;
}
element('#edit_chart_id').value = id;
element('#edit_chart_title').value = chartTitle;
element('#edit_chart_legend').value = chartElement.legend;
element('#edit_chart_type').value = chartElement.type;
element('#edit_chart_axis_x').value = chartElement.axis.x;
element('#edit_chart_axis_y').value = chartElement.axis.y;
element('#edit_chart_sufix').value = chartElement.suffix;
element('#edit_chart_verbal_rounding').checked = chartElement.isVerbalRoundingEnabled == 'true' ? true : false;
element('#edit_chart_verbal_rounding_when_hovered').checked = chartElement.isVerbalRoundingEnabledForHoveredLabels == 'true' ? true : false;
editDatasetContainer.innerHTML = '';
chartElement.dataset.forEach(function (data, index) {
editDatasetContainer.innerHTML += datasetHTMLTemplate(index);
});
document.querySelectorAll('.dataset_label').forEach(function (element, index) {
element.value = chartElement.dataset[index].label;
});
document.querySelectorAll('.dataset_value').forEach(function (element, index) {
element.value = chartElement.dataset[index].value;
});
}
/**
*
* @param {string} chartHTMLTemplate template for chart's canvas, actually chart holder template
* @param {object} selectors object wich contains selectors for main elements
* @param {array} chartsArray array with charts params like title, legend, values, etc
* @returns
*/
function buildCharts(chartHTMLTemplate, selectors, chartsArray) {
var chartContainer = document.querySelector(selectors.chartContainer);
chartContainer.innerHTML = '';
charts.forEach(function (chart, index) {
chartContainer.innerHTML += chartHTMLTemplate(index);
});
/* ITEMS FOR CHART DISPLAYING */
var ChartPrototype = function ChartPrototype() {
this.type = '';
this.data = {
labels: [],
datasets: [{
label: '',
data: [],
backgroundColor: [],
borderColor: []
}]
};
};
function optimizeCanvasSize(canvas, chartData) {
function optimizeCanvasHeight(chartHeight, multiplier) {
if (chartData.type === 'pie' || chartData.type === 'doughnut') {
canvas.width = '120';
canvas.height = (chartHeight + chartData.dataset.length * 0.5 * multiplier).toString();
} else {
//if chart has additional strings to their title, height of canvas will be increased
if (_typeof(chartData.title) === 'object') {
canvas.height = (chartHeight + chartData.title.length * multiplier).toString();
canvas.width = '80';
} else {
canvas.height = chartHeight.toString();
canvas.width = '80';
}
}
}
var chartsDefaultHeight = {
more0less300: 55,
more300less370: 55,
more370less450: 55,
more450less580: 55,
more580less768: 55,
more768less1365: 55,
more1365: 55
};
if (window.innerWidth > 0 && window.innerWidth <= 300) {
optimizeCanvasHeight(chartsDefaultHeight.more0less300, 4);
}
if (window.innerWidth > 300 && window.innerWidth <= 370) {
optimizeCanvasHeight(chartsDefaultHeight.more300less370, 4);
}
if (window.innerWidth > 370 && window.innerWidth <= 450) {
optimizeCanvasHeight(chartsDefaultHeight.more370less450, 4);
}
if (window.innerWidth > 450 && window.innerWidth <= 580) {
optimizeCanvasHeight(chartsDefaultHeight.more450less580, 3);
}
if (window.innerWidth > 580 && window.innerWidth <= 768) {
optimizeCanvasHeight(chartsDefaultHeight.more580less768, 3);
}
if (window.innerWidth > 768 && window.innerWidth <= 1365) {
optimizeCanvasHeight(chartsDefaultHeight.more768less1365, 3);
}
if (window.innerWidth > 1365) {
optimizeCanvasHeight(chartsDefaultHeight.more1365, 3);
}
}
function getRandomColor() {
var r = Math.floor(Math.random() * 256);
var g = Math.floor(Math.random() * 256);
var b = Math.floor(Math.random() * 256);
return {
r: r,
g: g,
b: b
};
}
function proceedAdditionalOptionsToChart(chartInstance, chartData) {
var type = chartInstance.type,
legend = chartData.legend,
name = stringCut(35, chartData.title),
axisNames = chartData.axis,
dataLabelSuffix = chartData.suffix,
arrayWithData = chartInstance.data.datasets[0].data.map(function (element) {
return parseInt(element);
}),
showVerbalRounding = chartData.isVerbalRoundingEnabled === 'true',
showVerbalRoundingForHoveredLabels = chartData.isVerbalRoundingEnabledForHoveredLabels === 'true',
barsBackgroundsColors = [];
chartInstance.data.datasets[0].barPercentage = 0.7;
chartInstance.type = type;
chartInstance.data.datasets[0].label = legend;
chartInstance.options = {
//here chart's title can be enabled
title: {
display: true,
text: name,
fontSize: 16,
fontColor: 'black',
fontFamily: '\'Open Sans\', sans-serif',
padding: chartInstance.type === 'pie' || chartInstance.type === 'doughnut' ? 0 : 20
},
tooltips: {
titleFontSize: 14,
bodyFontSize: 12,
footerFontSize: 12,
callbacks: {
label: function label(tooltipItem, data) {
var currentItemIndex = tooltipItem.index,
currentItemData = data.datasets[0].data[currentItemIndex],
label = "".concat(data.labels[currentItemIndex], ": ");
if (showVerbalRoundingForHoveredLabels == 'true' || showVerbalRoundingForHoveredLabels == true) {
if (currentItemData >= 1000 && currentItemData < 1000000) {
return "".concat(label).concat((currentItemData / 1000).toFixed(1), " \u0442\u0438\u0441.").concat(dataLabelSuffix);
} else if (currentItemData >= 1000000 && currentItemData < 1000000000) {
return "".concat(label).concat((currentItemData / 1000000).toFixed(1), " \u043C\u043B\u043D.").concat(dataLabelSuffix);
} else if (currentItemData >= 1000000000) {
return "".concat(label).concat((currentItemData / 1000000000).toFixed(1), " \u043C\u043B\u0440\u0434.").concat(dataLabelSuffix);
} else {
return "".concat(label).concat(currentItemData).concat(dataLabelSuffix);
}
} else {
return "".concat(label).concat(currentItemData).concat(dataLabelSuffix);
}
}
}
},
legend: {
display: chartInstance.type === 'pie' || chartInstance.type === 'doughnut' || legend !== '',
labels: {
display: true,
fontFamily: '\'Open Sans\', sans-serif',
fontColor: 'black',
fontSize: 14
}
},
plugins: {
datalabels: {
display: !(chartInstance.type === 'pie' || chartInstance.type === 'doughnut'),
anchor: chartInstance.type === 'pie' || chartInstance.type === 'doughnut' ? 'center' : 'end',
align: chartInstance.type === 'pie' || chartInstance.type === 'doughnut' ? 'end' : chartInstance.type === 'horizontalBar' ? 'end' : 'top',
formatter: function formatter(value, context) {
if (showVerbalRounding == 'true' || showVerbalRounding == true) {
if (value >= 1000 && value < 1000000) {
return "".concat((value / 1000).toFixed(1), " \u0442\u0438\u0441.").concat(dataLabelSuffix);
} else if (value >= 1000000 && value < 1000000000) {
return "".concat((value / 1000000).toFixed(1), " \u043C\u043B\u043D.").concat(dataLabelSuffix);
} else if (value >= 1000000000) {
return "".concat((value / 1000000000).toFixed(1), " \u043C\u043B\u0440\u0434.").concat(dataLabelSuffix);
} else {
return "".concat(value).concat(dataLabelSuffix);
}
} else {
return "".concat(value).concat(dataLabelSuffix);
}
},
font: {
family: '\'Open Sans\', sans-serif',
size: 14
},
color: 'black'
}
}
};
if (chartInstance.type === 'line') {
chartInstance.data.datasets[0].fill = false;
/*
fill chart elements with color according to amount of incoming data
*/
for (var i = 0; i < arrayWithData.length; i++) {
chartInstance.data.datasets[0].pointBorderColor.push('rgba(0, 0, 0, 1)');
chartInstance.data.datasets[0].pointBackgroundColor.push('rgba(255, 99, 132, 1)');
chartInstance.data.datasets[0].borderColor.push('rgba(255, 99, 132, 1)');
}
chartInstance.data.datasets[0].pointBorderWidth = 2;
}
if (chartInstance.type === 'bar' || chartInstance.type === 'horizontalBar') {
for (var _i2 = 0; _i2 < arrayWithData.length; _i2++) {
chartInstance.data.datasets[0].backgroundColor.push('rgba(255, 0, 0, 1)');
}
chartInstance.data.datasets[0].borderWidth = 0;
}
if (chartInstance.type === 'doughnut' || chartInstance.type === 'pie') {
chartInstance.options.legend.position = window.innerWidth < 768 ? 'top' : 'top';
for (var _i3 = 0; _i3 < arrayWithData.length; _i3++) {
var randomColor = getRandomColor();
chartInstance.data.datasets[0].backgroundColor.push("rgba(".concat(randomColor.r, ",").concat(randomColor.g, ",").concat(randomColor.b, ", 0.4)"));
chartInstance.data.datasets[0].borderColor.push("rgba(".concat(randomColor.r, ",").concat(randomColor.g, ",").concat(randomColor.b, ", 0.8)"));
}
chartInstance.data.datasets[0].borderWidth = 1;
}
if (chartInstance.type === 'bar' || chartInstance.type === 'horizontalBar' || chartInstance.type === 'line') {
chartInstance.options.scales = {
xAxes: [{
scaleLabel: {
labelString: axisNames.x,
display: axisNames.x !== '',
fontFamily: '\'Open Sans\', sans-serif',
fontSize: 14,
fontColor: 'black',
padding: 0
},
offset: chartInstance.type !== 'horizontalBar',
ticks: {
callback: function callback(value, index, values) {
if (showVerbalRounding == 'true' || showVerbalRounding == true) {
if (value >= 1000 && value < 1000000) {
return "".concat((value / 1000).toFixed(1), " \u0442\u0438\u0441.").concat(dataLabelSuffix);
} else if (value >= 1000000 && value < 1000000000) {
return "".concat((value / 1000000).toFixed(1), " \u043C\u043B\u043D.").concat(dataLabelSuffix);
} else if (value >= 1000000000) {
return "".concat((value / 1000000000).toFixed(1), " \u043C\u043B\u0440\u0434.").concat(dataLabelSuffix);
} else {
return "".concat(value).concat(dataLabelSuffix);
}
} else {
return "".concat(value).concat(dataLabelSuffix);
}
},
beginAtZero: true,
fontSize: 14,
suggestedMax: Math.max.apply(Math, _toConsumableArray(arrayWithData)) * 1.25
}
}],
yAxes: [{
scaleLabel: {
labelString: axisNames.y,
display: axisNames.y !== '',
fontFamily: '\'Open Sans\', sans-serif',
fontSize: 14,
fontColor: 'black',
padding: 0
},
ticks: {
callback: function callback(value, index, values) {
if (showVerbalRounding == 'true' || showVerbalRounding == true) {
if (value >= 1000 && value < 1000000) {
return "".concat((value / 1000).toFixed(1), " \u0442\u0438\u0441.").concat(dataLabelSuffix);
} else if (value >= 1000000 && value < 1000000000) {
return "".concat((value / 1000000).toFixed(1), " \u043C\u043B\u043D.").concat(dataLabelSuffix);
} else if (value >= 1000000000) {
return "".concat((value / 1000000000).toFixed(1), " \u043C\u043B\u0440\u0434.").concat(dataLabelSuffix);
} else {
return "".concat(value).concat(dataLabelSuffix);
}
} else {
return "".concat(value).concat(dataLabelSuffix);
}
},
beginAtZero: true,
fontSize: 14,
suggestedMax: Math.max.apply(Math, _toConsumableArray(arrayWithData)) * 1.25
}
}]
};
}
}
var chartCanvases = document.querySelectorAll(selectors.chart),
articleChartsInstances = [];
/*
Building a chart according to amount of datasets
*/
chartsArray.forEach(function (currentChartData, index) {
var canvas = chartCanvases[index],
chart = new ChartPrototype();
chart.type = currentChartData.type;
chart.data.datasets[0].label = currentChartData.label;
/*
optimizing canvas size depends on incoming data and other information,
before assigning it as a chart holder
*/
optimizeCanvasSize(canvas, currentChartData);
/*
fills chart prototype with data according to it's structure
*/
currentChartData.dataset.forEach(function (data) {
chart.data.datasets[0].data.push(data.value); //[data1,data2,data3,...,dataN]
chart.data.labels.push(data.label); //[label1,label2,label3,...,labelN]
});
proceedAdditionalOptionsToChart(chart, currentChartData);
articleChartsInstances.push(new Chart(canvas, chart));
}); //assign to chart keys some actions (edit, remove, etc)
if (articleChartsInstances.length > 0) {
//remove button asignment
document.querySelectorAll('.remove-chart-button').forEach(function (button) {
button.onclick = function (event) {
removeElementFromChartArray(event.target.getAttribute('chart_array_id'));
buildCharts(chartHTMLTemplate, selectors, charts);
};
}); //edit button asignment
document.querySelectorAll('.edit-chart-button').forEach(function (button) {
button.onclick = function (event) {
showEditChartModal(event.target.getAttribute('chart_array_id'));
};
});
}
return articleChartsInstances;
}
/**
* do errors validation of html inputs
*
* 1) gets all fields wich are needed to be validated
* 2) checks it value, if it match required rule (basically regexp based)
* 3) fills error array with invalid inputs IDs and error messages
* 4) returns this array to further proceed
*/
function doFieldsValidation(elementsForValidation, rules) {
var errors = [],
nodesFromHTML;
elementsForValidation.forEach(function (element) {
nodesFromHTML = document.querySelectorAll(element.selector);
nodesFromHTML.forEach(function (node) {
element.rules.every(function (rule) {
if (!rules[rule](node.value)) {
errors.push({
nodeID: node.id,
message: element.errorMessage
});
return false;
} else {
return true;
}
});
});
});
return errors;
}
/**
* Removes old error displaying, generate new depends on needs
*
* returns true, if errors is still on the page, false - if there is no errors left
*/
function handleErrorDisplaying(errors, errorsContainerSelector) {
var chartErrorsContainer = document.querySelector(errorsContainerSelector);
chartErrorsContainer.hidden = true;
chartErrorsContainer.innerHTML = '';
document.querySelectorAll('.is-invalid').forEach(function (errorNode) {
errorNode.classList.remove('is-invalid');
});
if (errors.length > 0) {
chartErrorsContainer.hidden = false;
errors.forEach(function (error) {
chartErrorsContainer.innerHTML += "<li>".concat(error.message, "</li>");
document.querySelector("#".concat(error.nodeID)).classList.add('is-invalid');
});
return true;
} else {
return false;
}
}
function clearCreateChartModal() {
chartFieldsIDs.forEach(function (ID) {
if (ID == 'chart_verbal_rounding' || ID == 'chart_verbal_rounding_when_hovered') {
document.querySelector("#".concat(ID)).checked = false;
} else {
document.querySelector("#".concat(ID)).value = '';
}
});
var datasetElements = document.querySelectorAll('.dataset_element');
datasetElements.forEach(function (elem) {
elem.remove();
});
currentChartDataset = 0;
datasetContainer.innerHTML = '';
var myModalEl = document.getElementById('diagramModal');
var modal = bootstrap.Modal.getInstance(myModalEl);
modal.hide();
}
function clearEditChartModal() {
editChartFieldsIDs.forEach(function (ID) {
if (ID == 'edit_chart_verbal_rounding' || ID == 'edit_chart_verbal_rounding_when_hovered') {
document.querySelector("#".concat(ID)).checked = false;
} else {
document.querySelector("#".concat(ID)).value = '';
}
});
var datasetElements = document.querySelectorAll('.dataset_element');
datasetElements.forEach(function (elem) {
elem.remove();
});
currentChartDataset = 0;
editDatasetContainer.innerHTML = '';
var modalEl = document.getElementById('editChartModal');
var modal = bootstrap.Modal.getInstance(modalEl);
modal.hide(); //clear black backscreens
document.querySelectorAll('.modal-backdrop').forEach(function (element) {
element.remove();
});
}
function submitChartData(mode, chartID) {
switch (mode) {
case 'create':
if (isValidationEnabled == true && handleErrorDisplaying(doFieldsValidation(elementsForChartCreateValidation, rules), '#chart_errors')) {
return false;
}
break;
case 'edit':
if (isValidationEnabled == true && handleErrorDisplaying(doFieldsValidation(elementsForChartEditValidation, rules), '#edit_chart_errors')) {
return false;
}
break;
}
/* Defining and filling chart fields with values */
var chartFields = {};
switch (mode) {
case 'create':
chartFieldsIDs.every(function (ID) {
if (ID == 'chart_verbal_rounding') {
chartFields[ID] = document.querySelector("#".concat(ID)).checked ? 'true' : 'false';
return true;
}
if (ID == 'chart_verbal_rounding_when_hovered') {
chartFields[ID] = document.querySelector("#".concat(ID)).checked ? 'true' : 'false';
return true;
}
chartFields[ID] = document.querySelector("#".concat(ID)).value;
return true;
});
break;
case 'edit':
editChartFieldsIDs.every(function (ID) {
if (ID == 'edit_chart_verbal_rounding') {
chartFields[ID] = document.querySelector("#".concat(ID)).checked ? 'true' : 'false';
return true;
}
if (ID == 'edit_chart_verbal_rounding_when_hovered') {
chartFields[ID] = document.querySelector("#".concat(ID)).checked ? 'true' : 'false';
return true;
}
chartFields[ID] = document.querySelector("#".concat(ID)).value;
return true;
});
break;
}
/* Defining and filling chart datasets with values */
var dataset = [];
var datasetElement = {};
var datasetElements = document.querySelectorAll('.dataset_element');
datasetElements.forEach(function (element, index) {
if (index % 2 == 0) {
datasetElement.label = element.value;
}
if (index % 2 == 1) {
datasetElement.value = element.value;
dataset.push(datasetElement);
datasetElement = {};
}
});
var chartInstance = {};
switch (mode) {
case 'create':
chartInstance = null;
chartInstance = {
// numberInList: charts.length,
title: chartFields.chart_title,
legend: chartFields.chart_legend,
type: chartFields.chart_type,
axis: {
x: chartFields.chart_axis_x,
y: chartFields.chart_axis_y
},
suffix: chartFields.chart_sufix,
isVerbalRoundingEnabled: chartFields.chart_verbal_rounding,
isVerbalRoundingEnabledForHoveredLabels: chartFields.chart_verbal_rounding_when_hovered,
dataset: dataset
};
charts.push(chartInstance);
clearCreateChartModal();
break;
case 'edit':
chartInstance = null;
chartInstance = {
// numberInList: charts.length,
title: chartFields.edit_chart_title,
legend: chartFields.edit_chart_legend,
type: chartFields.edit_chart_type,
axis: {
x: chartFields.edit_chart_axis_x,
y: chartFields.edit_chart_axis_y
},
suffix: chartFields.edit_chart_sufix,
isVerbalRoundingEnabled: chartFields.edit_chart_verbal_rounding,
isVerbalRoundingEnabledForHoveredLabels: chartFields.edit_chart_verbal_rounding_when_hovered,
dataset: dataset
};
charts[chartID] = chartInstance;
clearEditChartModal();
break;
}
/*
charts = [
{
title: ['Виконання бюджету', 'виконання бюджету'],
legend: 'План',
type: 'pie',
axis: {
x: 'назва фонду',
y: 'грн'
},
suffix: 'грн',
isVerbalRoundingEnabled: 'false',
isVerbalRoundingEnabledForHoveredLabels: 'true',
dataset: [
{label: 'Загальний фонд', value: '1701400000'},
{label: 'Міжбюджетні трансферти', value: '492900000'},
{label: 'Спеціальний фонд', value: '134200000'},
{label: 'Бюджет розвитку', value: '33000000'},
{label: 'Міжбюджетні трансферти', value: '492900000'},
{label: 'Спеціальний фонд', value: '134200000'},
{label: 'Бюджет розвитку', value: '33000000'},
{label: 'Міжбюджетні трансферти', value: '492900000'},
{label: 'Спеціальний фонд', value: '134200000'},
{label: 'Бюджет розвитку', value: '33000000'}
]
},
{
title: 'Назва діаграми',
legend: 'Додаткова назва діаграми',
type: 'doughnut',
axis: {
x: 'назва фонду',
y: 'назва фонду'
},
suffix: 'грн',
isVerbalRoundingEnabled: 'false',
isVerbalRoundingEnabledForHoveredLabels: 'false',
dataset: [
{label: 'Назва діаграми', value: '123'},
{label: 'Назва діаграми 2', value: '321'},
]
},
{
title: 'Виконання бюджету',
legend: 'План',
type: 'bar',
axis: {
x: 'назва фонду',
y: 'грн'
},
suffix: 'грн',
isVerbalRoundingEnabled: 'true',
isVerbalRoundingEnabledForHoveredLabels: 'true',
dataset: [
{label: 'Загальний фонд', value: '1701400000'},
{label: 'Міжбюджетні трансферти', value: '492900000'},
{label: 'Спеціальний фонд', value: '134200000'},
{label: 'Бюджет розвитку', value: '33000000'}
]
}
]
/* */
console.log(charts);
articleChartsInstances = buildCharts(chartHTMLTemplate, chartSelectors, charts);
}
function submitArticleData() {
// editor.getData()
function element(selector) {
return document.querySelector(selector);
}
editor.updateSourceElement();
if (isValidationEnabled == true && handleErrorDisplaying(doFieldsValidation(elementsForArticlesValidation, rules), '#article_errors')) {
return false;
}
/* Replacer for article text '@@@' -> replaceWith variable value */
var articleText = element('#article_text').value;
var replaceWith = '<div class="col-12 col-md-10 col-xxl-8 mb-4"><canvas class="__article_id___chart"></canvas></div>';
var re = /@@@/ig;
var formData = new FormData();
formData.append('report_id', element('#report_id').value);
formData.append('article_name', element('#article_name').value);
formData.append('article_text', articleText.replace(re, replaceWith));
formData.append('additional_file', element('#additional_file').files[0] == undefined ? null : element('#additional_file').files[0]);
formData.append('charts', JSON.stringify(charts));
var options = {
headers: {
'Content-Type': 'multipart/form-data'
}
};
axios__WEBPACK_IMPORTED_MODULE_0___default().post('/articles/create', formData, options).then(function (response) {
console.log(response);
})["catch"](function (errors) {
console.log(errors);
});
}
document.querySelector('#submit_chart_data').onclick = function () {
submitChartData('create');
};
document.querySelector('#submit_edited_chart_data').onclick = function () {
submitChartData('edit', document.querySelector('#edit_chart_id').value);
};
document.querySelector('#debug').onclick = function () {};
/* Submiting article */
document.querySelector('#submit_article_data').onclick = function (event) {
event.preventDefault();
submitArticleData();
};
})();
/******/ })()
;
|
const content = require('app/steps/help/need-help/content.json').resources.en.translation.content;
const pagePath = '/pay/help/need-help';
function selectHelpWithFees(needHelp = true) {
const I = this;
I.waitInUrl(pagePath, 5);
I.seeCurrentUrlEquals(pagePath);
I.retry(2).click(needHelp ? content.yes : content.no);
I.navByClick('Continue');
}
module.exports = { selectHelpWithFees };
|
const StateMock = [
{
"id": "1",
"image": "https://arepa.s3.amazonaws.com/camiseta.png",
"title": "Camiseta",
"price": 25,
"description": "bla bla bla bla bla"
},
{
"id": "3",
"image": "https://arepa.s3.amazonaws.com/mug.png",
"title": "Mug",
"price": 10,
"description": "bla bla bla bla bla"
},
{
"id": "4",
"image": "https://arepa.s3.amazonaws.com/pin.png",
"title": "Pin",
"price": 4,
"description": "bla bla bla bla bla"
},
{
"id": "5",
"image": "https://arepa.s3.amazonaws.com/stickers1.png",
"title": "Stickers",
"price": 2,
"description": "bla bla bla bla bla"
},
{
"id": "6",
"image": "https://arepa.s3.amazonaws.com/stickers2.png",
"title": "Stickers",
"price": 2,
"description": "bla bla bla bla bla"
},
{
"id": "7",
"image": "https://arepa.s3.amazonaws.com/hoodie.png",
"title": "Hoodie",
"price": 35,
"description": "bla bla bla bla bla"
},
];
module.exports = {
StateMock
}
|
define({"topics" : [{"title":"Understanding harnesses","shortdesc":"\n <p class=\"shortdesc\">Some project requirements cannot be addressed strictly by building upon built-in actions.</p>\n ","id":"concept_xdn_1gg_wg","href":"TA_Tutorials\/Topics\/Understanding_harnesses.html","menu": {"hasChildren":false,},"tocID":"concept_xdn_1gg_wg-d46e16946","topics":[]},{"title":"Invoking a user-scripted action","shortdesc":"\n <p class=\"shortdesc\"> What it takes to access a user-scripted action from your test module. </p>\n ","id":"Invoking_a_harness_action","href":"TA_Tutorials\/Topics\/Invoking_a_harness_action.html","menu": {"hasChildren":false,},"tocID":"Invoking_a_harness_action-d46e16957","topics":[]},{"title":"Working with the Python harness","shortdesc":"\n <p class=\"shortdesc\">How to implement <span class=\"ph\">TestArchitect</span> actions using the Python programming language.\n </p>\n ","id":"Tutorial_Scripting_actions_in_other_languages_Python","href":"TA_Tutorials\/Topics\/Tutorial_Scripting_actions_in_other_languages_python.html","menu": {"hasChildren":false,},"tocID":"Tutorial_Scripting_actions_in_other_languages_Python-d46e16968","next":"Tutorial_Scripting_actions_in_other_languages_Python-d46e16968",},{"title":"Working with the Java harness","shortdesc":"\n <p class=\"shortdesc\">How to implement <span class=\"ph\">TestArchitect</span> actions using the Java programming language.\n </p>\n ","id":"Tutorial_Scripting_actions_in_other_languages_Java","href":"TA_Tutorials\/Topics\/Tutorial_Scripting_actions_in_other_languages_java.html","menu": {"hasChildren":false,},"tocID":"Tutorial_Scripting_actions_in_other_languages_Java-d46e17107","next":"Tutorial_Scripting_actions_in_other_languages_Java-d46e17107",},{"title":"Working with the C# bundle harness","shortdesc":"\n <p class=\"shortdesc\">How to implement customized <span class=\"ph\">TestArchitect</span> actions using the C# programming language.\n </p>\n ","id":"concept_mcn_1td_jy","href":"TA_Tutorials\/Topics\/tut_Scripting_actions_in_other_languages_CSharp_bundle.html","menu": {"hasChildren":false,},"tocID":"concept_mcn_1td_jy-d46e17260","next":"concept_mcn_1td_jy-d46e17260",},{"title":"Summary: What you have learned","id":"summary_nbr_lgt_pr","href":"TA_Tutorials\/Topics\/Summary_Scripting_in_other_languages.html","menu": {"hasChildren":false,},"tocID":"summary_nbr_lgt_pr-d46e17439","topics":[]}]});
|
// @flow
import React from "react";
import { useSelector } from "react-redux";
import { useTranslation } from "react-i18next";
import { EXPERIMENTAL_MARKET_INDICATOR_SETTINGS } from "~/config/constants";
import { hasPasswordSelector, langAndRegionSelector } from "~/renderer/reducers/settings";
import TrackPage from "~/renderer/analytics/TrackPage";
import IconDisplay from "~/renderer/icons/Display";
import {
SettingsSection as Section,
SettingsSectionHeader as Header,
SettingsSectionBody as Body,
SettingsSectionRow as Row,
} from "../../SettingsSection";
import CounterValueSelect from "./CounterValueSelect";
import LanguageSelect from "./LanguageSelect";
import RegionSelect from "./RegionSelect";
import ThemeSelect from "./ThemeSelect";
import MarketIndicatorRadio from "./MarketIndicatorRadio";
import PasswordButton from "./PasswordButton";
import PasswordAutoLockSelect from "./PasswordAutoLockSelect";
import SentryLogsButton from "./SentryLogsButton";
import ShareAnalyticsButton from "./ShareAnalyticsButton";
const SectionGeneral = () => {
const { useSystem } = useSelector(langAndRegionSelector);
const hasPassword = useSelector(hasPasswordSelector);
const { t } = useTranslation();
return (
<Section>
<TrackPage category="Settings" name="Display" />
<Header
icon={<IconDisplay size={16} />}
title={t("settings.tabs.display")}
desc={t("settings.display.desc")}
/>
<Body>
<Row
title={t("settings.display.counterValue")}
desc={t("settings.display.counterValueDesc")}
>
<CounterValueSelect />
</Row>
<Row title={t("settings.display.language")} desc={t("settings.display.languageDesc")}>
<LanguageSelect />
</Row>
{useSystem ? null : (
<Row title={t("settings.display.region")} desc={t("settings.display.regionDesc")}>
<RegionSelect />
</Row>
)}
<Row title={t("settings.display.theme")} desc={t("settings.display.themeDesc")}>
<ThemeSelect />
</Row>
{EXPERIMENTAL_MARKET_INDICATOR_SETTINGS ? (
<Row title={t("settings.display.stock")} desc={t("settings.display.stockDesc")}>
<MarketIndicatorRadio />
</Row>
) : null}
<Row title={t("settings.profile.password")} desc={t("settings.profile.passwordDesc")}>
<PasswordButton />
</Row>
{hasPassword ? (
<Row
title={t("settings.profile.passwordAutoLock")}
desc={t("settings.profile.passwordAutoLockDesc")}
>
<PasswordAutoLockSelect />
</Row>
) : null}
<Row
title={t("settings.profile.reportErrors")}
desc={t("settings.profile.reportErrorsDesc")}
>
<SentryLogsButton />
</Row>
<Row title={t("settings.profile.analytics")} desc={t("settings.profile.analyticsDesc")}>
<ShareAnalyticsButton />
</Row>
</Body>
</Section>
);
};
export default SectionGeneral;
|
export default {
DESKTOP: 992,
TABLET: 768,
PHONE: 414,
};
|
/* Onfido SDK 5.13.0 */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Onfido=t():e.Onfido=t()}(window,(function(){return function(e){function t(t){for(var n,r,i=t[0],a=t[1],s=0,c=[];s<i.length;s++)r=i[s],Object.prototype.hasOwnProperty.call(o,r)&&o[r]&&c.push(o[r][0]),o[r]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(u&&u(t);c.length;)c.shift()()}var n={},r={2:0},o={2:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(e){var t=[];r[e]?t.push(r[e]):0!==r[e]&&{4:1}[e]&&t.push(r[e]=new Promise((function(t,n){for(var o="onfido."+({0:"crossDevice",4:"vendors~crossDevice"}[e]||e)+".css",a=i.p+o,s=document.getElementsByTagName("link"),c=0;c<s.length;c++){var u=(f=s[c]).getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(u===o||u===a))return t()}var l=document.getElementsByTagName("style");for(c=0;c<l.length;c++){var f;if((u=(f=l[c]).getAttribute("data-href"))===o||u===a)return t()}var p=document.createElement("link");p.rel="stylesheet",p.type="text/css",p.onload=t,p.onerror=function(t){var o=t&&t.target&&t.target.src||a,i=new Error("Loading CSS chunk "+e+" failed.\n("+o+")");i.request=o,delete r[e],p.parentNode.removeChild(p),n(i)},p.href=a,document.getElementsByTagName("head")[0].appendChild(p)})).then((function(){r[e]=0})));var n=o[e];if(0!==n)if(n)t.push(n[2]);else{var a=new Promise((function(t,r){n=o[e]=[t,r]}));t.push(n[2]=a);var s,c=document.createElement("script");c.charset="utf-8",c.timeout=120,i.nc&&c.setAttribute("nonce",i.nc),c.src=function(e){return i.p+"onfido."+({0:"crossDevice",4:"vendors~crossDevice"}[e]||e)+".min.js"}(e);var u=new Error;s=function(t){c.onerror=c.onload=null,clearTimeout(l);var n=o[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",u.name="ChunkLoadError",u.type=r,u.request=i,n[1](u)}o[e]=void 0}};var l=setTimeout((function(){s({type:"timeout",target:c})}),12e4);c.onerror=c.onload=s,document.head.appendChild(c)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="https://assets.onfido.com/web-sdk-releases/5.13.0/",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonpOnfido=window.webpackJsonpOnfido||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var c=0;c<a.length;c++)t(a[c]);var u=s;return i(i.s=589)}([function(e,t,n){"use strict";n.r(t),n.d(t,"h",(function(){return s})),n.d(t,"createElement",(function(){return s})),n.d(t,"cloneElement",(function(){return f})),n.d(t,"createRef",(function(){return F})),n.d(t,"Component",(function(){return L})),n.d(t,"render",(function(){return B})),n.d(t,"rerender",(function(){return v})),n.d(t,"options",(function(){return o}));var r=function(){},o={},i=[],a=[];function s(e,t){var n,s,c,u,l=a;for(u=arguments.length;u-- >2;)i.push(arguments[u]);for(t&&null!=t.children&&(i.length||i.push(t.children),delete t.children);i.length;)if((s=i.pop())&&void 0!==s.pop)for(u=s.length;u--;)i.push(s[u]);else"boolean"==typeof s&&(s=null),(c="function"!=typeof e)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(c=!1)),c&&n?l[l.length-1]+=s:l===a?l=[s]:l.push(s),n=c;var f=new r;return f.nodeName=e,f.children=l,f.attributes=null==t?void 0:t,f.key=null==t?void 0:t.key,void 0!==o.vnode&&o.vnode(f),f}function c(e,t){for(var n in t)e[n]=t[n];return e}function u(e,t){e&&("function"==typeof e?e(t):e.current=t)}var l="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function f(e,t){return s(e.nodeName,c(c({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var p=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,d=[];function h(e){!e._dirty&&(e._dirty=!0)&&1==d.push(e)&&(o.debounceRendering||l)(v)}function v(){for(var e;e=d.pop();)e._dirty&&R(e)}function m(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&y(e,t.nodeName):n||e._componentConstructor===t.nodeName}function y(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function g(e){var t=c({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function b(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)u(n,null),u(r,e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===p.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,k,a):e.removeEventListener(t,k,a),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function k(e){return this._listeners[e.type](o.event&&o.event(e)||e)}var w=[],S=0,O=!1,C=!1;function x(){for(var e;e=w.shift();)o.afterMount&&o.afterMount(e),e.componentDidMount&&e.componentDidMount()}function E(e,t,n,r,o,i){S++||(O=null!=o&&void 0!==o.ownerSVGElement,C=null!=e&&!("__preactattr_"in e));var a=j(e,t,n,r,i);return o&&a.parentNode!==o&&o.appendChild(a),--S||(C=!1,i||x()),a}function j(e,t,n,r,o){var i=e,a=O;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),A(e,!0))),i.__preactattr_=!0,i;var s,c,u=t.nodeName;if("function"==typeof u)return function(e,t,n,r){var o=e&&e._component,i=o,a=e,s=o&&e._componentConstructor===t.nodeName,c=s,u=g(t);for(;o&&!c&&(o=o._parentComponent);)c=o.constructor===t.nodeName;o&&c&&(!r||o._component)?(N(o,u,3,n,r),e=o.base):(i&&!s&&(M(i),e=a=null),o=D(t.nodeName,u,n),e&&!o.nextBase&&(o.nextBase=e,a=null),N(o,u,1,n,r),e=o.base,a&&e!==a&&(a._component=null,A(a,!1)));return e}(e,t,n,r);if(O="svg"===u||"foreignObject"!==u&&O,u=String(u),(!e||!y(e,u))&&(s=u,(c=O?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,i=c,e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),A(e,!0)}var l=i.firstChild,f=i.__preactattr_,p=t.children;if(null==f){f=i.__preactattr_={};for(var d=i.attributes,h=d.length;h--;)f[d[h].name]=d[h].value}return!C&&p&&1===p.length&&"string"==typeof p[0]&&null!=l&&void 0!==l.splitText&&null==l.nextSibling?l.nodeValue!=p[0]&&(l.nodeValue=p[0]):(p&&p.length||null!=l)&&function(e,t,n,r,o){var i,a,s,c,u,l=e.childNodes,f=[],p={},d=0,h=0,v=l.length,y=0,g=t?t.length:0;if(0!==v)for(var _=0;_<v;_++){var k=l[_],w=k.__preactattr_;null!=(S=g&&w?k._component?k._component.__key:w.key:null)?(d++,p[S]=k):(w||(void 0!==k.splitText?!o||k.nodeValue.trim():o))&&(f[y++]=k)}if(0!==g)for(_=0;_<g;_++){var S;if(c=t[_],u=null,null!=(S=c.key))d&&void 0!==p[S]&&(u=p[S],p[S]=void 0,d--);else if(h<y)for(i=h;i<y;i++)if(void 0!==f[i]&&m(a=f[i],c,o)){u=a,f[i]=void 0,i===y-1&&y--,i===h&&h++;break}u=j(u,c,n,r),s=l[_],u&&u!==e&&u!==s&&(null==s?e.appendChild(u):u===s.nextSibling?b(s):e.insertBefore(u,s))}if(d)for(var _ in p)void 0!==p[_]&&A(p[_],!1);for(;h<=y;)void 0!==(u=f[y--])&&A(u,!1)}(i,p,n,r,C||null!=f.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||_(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||_(e,r,n[r],n[r]=t[r],O)}(i,t.attributes,f),O=a,i}function A(e,t){var n=e._component;n?M(n):(null!=e.__preactattr_&&u(e.__preactattr_.ref,null),!1!==t&&null!=e.__preactattr_||b(e),P(e))}function P(e){for(e=e.lastChild;e;){var t=e.previousSibling;A(e,!0),e=t}}var T=[];function D(e,t,n){var r,o=T.length;for(e.prototype&&e.prototype.render?(r=new e(t,n),L.call(r,t,n)):((r=new L(t,n)).constructor=e,r.render=I);o--;)if(T[o].constructor===e)return r.nextBase=T[o].nextBase,T.splice(o,1),r;return r}function I(e,t,n){return this.constructor(e,n)}function N(e,t,n,r,i){e._disable||(e._disable=!0,e.__ref=t.ref,e.__key=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r)),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==n&&(1!==n&&!1===o.syncComponentUpdates&&e.base?h(e):R(e,1,i)),u(e.__ref,e))}function R(e,t,n,r){if(!e._disable){var i,a,s,u=e.props,l=e.state,f=e.context,p=e.prevProps||u,d=e.prevState||l,h=e.prevContext||f,v=e.base,m=e.nextBase,y=v||m,b=e._component,_=!1,k=h;if(e.constructor.getDerivedStateFromProps&&(l=c(c({},l),e.constructor.getDerivedStateFromProps(u,l)),e.state=l),v&&(e.props=p,e.state=d,e.context=h,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,l,f)?_=!0:e.componentWillUpdate&&e.componentWillUpdate(u,l,f),e.props=u,e.state=l,e.context=f),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!_){i=e.render(u,l,f),e.getChildContext&&(f=c(c({},f),e.getChildContext())),v&&e.getSnapshotBeforeUpdate&&(k=e.getSnapshotBeforeUpdate(p,d));var O,C,j=i&&i.nodeName;if("function"==typeof j){var P=g(i);(a=b)&&a.constructor===j&&P.key==a.__key?N(a,P,1,f,!1):(O=a,e._component=a=D(j,P,f),a.nextBase=a.nextBase||m,a._parentComponent=e,N(a,P,0,f,!1),R(a,1,n,!0)),C=a.base}else s=y,(O=b)&&(s=e._component=null),(y||1===t)&&(s&&(s._component=null),C=E(s,i,f,n||!v,y&&y.parentNode,!0));if(y&&C!==y&&a!==b){var T=y.parentNode;T&&C!==T&&(T.replaceChild(C,y),O||(y._component=null,A(y,!1)))}if(O&&M(O),e.base=C,C&&!r){for(var I=e,L=e;L=L._parentComponent;)(I=L).base=C;C._component=I,C._componentConstructor=I.constructor}}for(!v||n?w.push(e):_||(e.componentDidUpdate&&e.componentDidUpdate(p,d,k),o.afterUpdate&&o.afterUpdate(e));e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);S||r||x()}}function M(e){o.beforeUnmount&&o.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?M(n):t&&(null!=t.__preactattr_&&u(t.__preactattr_.ref,null),e.nextBase=t,b(t),T.push(e),P(t)),u(e.__ref,null)}function L(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{},this._renderCallbacks=[]}function B(e,t,n){return E(n,e,{},!1,t,!1)}function F(){return{}}c(L.prototype,{setState:function(e,t){this.prevState||(this.prevState=this.state),this.state=c(c({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this._renderCallbacks.push(t),h(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),R(this,2)},render:function(){}});var U={h:s,createElement:s,cloneElement:f,createRef:F,Component:L,render:B,rerender:v,options:o};t.default=U},function(e,t,n){var r=n(143);e.exports=function(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){e.exports=n(237)},function(e,t,n){var r=n(250),o=n(146);function i(t){return e.exports=i=o?r:function(e){return e.__proto__||r(e)},i(t)}e.exports=i},function(e,t,n){e.exports=n(256)},function(e,t,n){e.exports={step:"onfido-sdk-ui-Theme-step",fullScreenStep:"onfido-sdk-ui-Theme-fullScreenStep",fullHeightContainer:"onfido-sdk-ui-Theme-fullHeightContainer",fullHeightMobileContainer:"onfido-sdk-ui-Theme-fullHeightMobileContainer",navigationBar:"onfido-sdk-ui-Theme-navigationBar",content:"onfido-sdk-ui-Theme-content",scrollableContent:"onfido-sdk-ui-Theme-scrollableContent",fullScreenContentWrapper:"onfido-sdk-ui-Theme-fullScreenContentWrapper",cobrandFooter:"onfido-sdk-ui-Theme-cobrandFooter",cobrandLabel:"onfido-sdk-ui-Theme-cobrandLabel",cobrandText:"onfido-sdk-ui-Theme-cobrandText",poweredBy:"onfido-sdk-ui-Theme-poweredBy",logo:"onfido-sdk-ui-Theme-logo",cobrandLogo:"onfido-sdk-ui-Theme-cobrandLogo",footer:"onfido-sdk-ui-Theme-footer",defaultLogo:"onfido-sdk-ui-Theme-defaultLogo",noLogo:"onfido-sdk-ui-Theme-noLogo",thickWrapper:"onfido-sdk-ui-Theme-thickWrapper","mbottom-large":"onfido-sdk-ui-Theme-mbottom-large",center:"onfido-sdk-ui-Theme-center",icon:"onfido-sdk-ui-Theme-icon",header:"onfido-sdk-ui-Theme-header",help:"onfido-sdk-ui-Theme-help",helpList:"onfido-sdk-ui-Theme-helpList",link:"onfido-sdk-ui-Theme-link",warning:"onfido-sdk-ui-Theme-warning",error:"onfido-sdk-ui-Theme-error"}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(242),o=n(246);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=r(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t,n){"use strict";var r=n(31),o=n(67).f,i=n(160),a=n(22),s=n(77),c=n(38),u=n(35),l=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,f,p,d,h,v,m,y,g=e.target,b=e.global,_=e.stat,k=e.proto,w=b?r:_?r[g]:(r[g]||{}).prototype,S=b?a:a[g]||(a[g]={}),O=S.prototype;for(p in t)n=!i(b?p:g+(_?".":"#")+p,e.forced)&&w&&u(w,p),h=S[p],n&&(v=e.noTargetGet?(y=o(w,p))&&y.value:w[p]),d=n&&v?v:t[p],n&&typeof h==typeof d||(m=e.bind&&n?s(d,r):e.wrap&&n?l(d):k&&"function"==typeof d?s(Function.call,d):d,(e.sham||d&&d.sham||h&&h.sham)&&c(m,"sham",!0),S[p]=m,k&&(u(a,f=g+"Prototype")||c(a,f,{}),a[f][p]=d,e.real&&O&&!O[p]&&c(O,p,d)))}},function(e,t,n){var r=n(98),o=n(2);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){var r=n(143);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(e,o.key,o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}},function(e,t,n){var r;
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){e.exports=n(185)},function(e,t,n){"use strict";n.d(t,"a",(function(){return J})),n.d(t,"b",(function(){return X}));var r=n(19),o=n.n(r),i=n(278),a=n.n(i),s=(n(20),n(0)),c=n(109),u=n(23),l=n(26),f=n.n(l),p=n(27),d=n.n(p),h=n(16),v=n.n(h),m=n(13),y=n.n(m),g=n(17),b=n.n(g),_=n(18),k=n.n(_),w=n(434),S=n.n(w),O=n(1),C=n.n(O),x=n(15),E=n.n(x),j=n(65),A=n.n(j),P=n(21),T=n.n(P),D=n(131),I=n.n(D),N=n(378),R=n.n(N),M=n(435),L=n(436),B=n(437),F=n(438),U=n(42);function z(e,t){var n=E()(e);if(k.a){var r=k()(e);t&&(r=T()(r).call(r,(function(t){return b()(e,t).enumerable}))),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)y()(n=z(Object(r),!0)).call(n,(function(t){C()(e,t,r[t])}));else if(v.a)d()(e,v()(r));else{var o;y()(o=z(Object(r))).call(o,(function(t){f()(e,t,b()(r,t))}))}}return e}var W={en_US:M,es_ES:L,de_DE:B,fr_FR:F},H=function(){var e={};for(var t in W)({}).hasOwnProperty.call(W,t)&&(e[t]=W[t].mobilePhrases);return e}(),V=function(e,t,n,r){return t.locale(e),t.extend(n),u.j||t.extend(r),t},G=function(e,t){var n=e.phrases,r=e.mobilePhrases,o=E()(t.phrases),i=q(q({},n.mobilePhrases),r);!function(e,t,n){var r,o=new I.a(t),i=T()(e).call(e,(function(e){return!o.has(e)})),a=A()(r=E()(W)).call(r,(function(e){return e===n}));i.length&&!a&&console.warn("Missing keys:",i)}(o,function(e){return E()(new R.a({phrases:e}).phrases)}(q(q({},n),{},{mobilePhrases:i})),e)},K=function(e,t){if(W[e])return V(e,t,W[e],H[e]);console.warn("Locale not supported")},Q=function(e,t){if("string"==typeof e){var n=function(e){for(var t in W)if({}.hasOwnProperty.call(W,t)&&S()(t).call(t,e))return t}(e);return K(n,t)}return function(e,t){var n=e.locale,r=e.phrases,o=e.mobilePhrases;G(e,t);var i=K(n,t)||t;return V(n,i,r,o)}(e,t)},$=Object(U.c)((function(e){var t=function(){var e=new R.a({onMissingKey:function(){return null}});return V("en_US",e,W.en_US,H.en_US)}();return e&&Q(e,t)||t})),Y=Object(c.createContext)({}),J=function(e){var t,n=e.language,r=e.children,o=$(n),i=a()(t=o.t).call(t,o);return Object(s.h)(Y.Provider,{value:{language:o.currentLocale,translate:i,parseTranslatedTags:function(e,t){return Object(u.m)(i(e),t)}}},r)},X=function(e){return function(t){return Object(s.h)(Y.Consumer,null,(function(n){return Object(s.h)(e,o()({},t,n))}))}}},function(e,t,n){e.exports=n(206)},function(e,t,n){e.exports=n(181)},function(e,t,n){e.exports=n(197)},function(e,t,n){e.exports=n(204)},function(e,t,n){var r=n(332);function o(){return e.exports=o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}e.exports=o},function(e,t,n){"use strict";n.r(t),n.d(t,"version",(function(){return s})),n.d(t,"DOM",(function(){return A})),n.d(t,"Children",(function(){return E})),n.d(t,"render",(function(){return b})),n.d(t,"hydrate",(function(){return b})),n.d(t,"createClass",(function(){return q})),n.d(t,"createPortal",(function(){return S})),n.d(t,"createFactory",(function(){return j})),n.d(t,"createElement",(function(){return I})),n.d(t,"cloneElement",(function(){return R})),n.d(t,"isValidElement",(function(){return M})),n.d(t,"findDOMNode",(function(){return U})),n.d(t,"unmountComponentAtNode",(function(){return O})),n.d(t,"Component",(function(){return $})),n.d(t,"PureComponent",(function(){return Y})),n.d(t,"unstable_renderSubtreeIntoContainer",(function(){return k})),n.d(t,"unstable_batchedUpdates",(function(){return J})),n.d(t,"__spread",(function(){return B}));var r=n(56),o=n.n(r);n.d(t,"PropTypes",(function(){return o.a}));var i=n(0);n.d(t,"createRef",(function(){return i.createRef}));var a=n(109);n.d(t,"createContext",(function(){return a.createContext}));var s="15.1.0",c="a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" "),u="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,l="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("__preactCompatWrapper"):"__preactCompatWrapper",f={constructor:1,render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},p=/^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/,d={},h=!1;try{h=!1}catch(e){}function v(){return null}var m=Object(i.h)("a",null).constructor;m.prototype.$$typeof=u,m.prototype.preactCompatUpgraded=!1,m.prototype.preactCompatNormalized=!1,Object.defineProperty(m.prototype,"type",{get:function(){return this.nodeName},set:function(e){this.nodeName=e},configurable:!0}),Object.defineProperty(m.prototype,"props",{get:function(){return this.attributes},set:function(e){this.attributes=e},configurable:!0});var y=i.options.event;i.options.event=function(e){return y&&(e=y(e)),e.persist=Object,e.nativeEvent=e,e};var g=i.options.vnode;function b(e,t,n){var r=t&&t._preactCompatRendered&&t._preactCompatRendered.base;r&&r.parentNode!==t&&(r=null),!r&&t&&(r=t.firstElementChild);for(var o=t.childNodes.length;o--;)t.childNodes[o]!==r&&t.removeChild(t.childNodes[o]);var a=Object(i.render)(e,t,r);return t&&(t._preactCompatRendered=a&&(a._component||{base:a})),"function"==typeof n&&n(),a&&a._component||a}i.options.vnode=function(e){if(!e.preactCompatUpgraded){e.preactCompatUpgraded=!0;var t=e.nodeName,n=e.attributes=null==e.attributes?{}:B({},e.attributes);"function"==typeof t?(!0===t[l]||t.prototype&&"isReactComponent"in t.prototype)&&(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),e.preactCompatNormalized||N(e),function(e){var t=e.nodeName,n=e.attributes;e.attributes={},t.defaultProps&&B(e.attributes,t.defaultProps);n&&B(e.attributes,n)}(e)):(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),n.defaultValue&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),function(e,t){var n,r,o;if(t){for(o in t)if(n=p.test(o))break;if(n)for(o in r=e.attributes={},t)t.hasOwnProperty(o)&&(r[p.test(o)?o.replace(/([A-Z0-9])/,"-$1").toLowerCase():o]=t[o])}}(e,n))}g&&g(e)};var _=function(){};function k(e,t,n,r){var o=b(Object(i.h)(_,{context:e.context},t),n),a=o._component||o.base;return r&&r.call(a,o),a}function w(e){k(this,e.vnode,e.container)}function S(e,t){return Object(i.h)(w,{vnode:e,container:t})}function O(e){var t=e._preactCompatRendered&&e._preactCompatRendered.base;return!(!t||t.parentNode!==e)&&(Object(i.render)(Object(i.h)(v),e,t),!0)}_.prototype.getChildContext=function(){return this.props.context},_.prototype.render=function(e){return e.children[0]};var C,x=[],E={map:function(e,t,n){return null==e?null:(e=E.toArray(e),n&&n!==e&&(t=t.bind(n)),e.map(t))},forEach:function(e,t,n){if(null==e)return null;e=E.toArray(e),n&&n!==e&&(t=t.bind(n)),e.forEach(t)},count:function(e){return e&&e.length||0},only:function(e){if(1!==(e=E.toArray(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:function(e){return null==e?[]:x.concat(e)}};function j(e){return I.bind(null,e)}for(var A={},P=c.length;P--;)A[c[P]]=j(c[P]);function T(e,t){for(var n=t||0;n<e.length;n++){var r=e[n];Array.isArray(r)?T(r):r&&"object"==typeof r&&!M(r)&&(r.props&&r.type||r.attributes&&r.nodeName||r.children)&&(e[n]=I(r.type||r.nodeName,r.props||r.attributes,r.children))}}function D(e){var t,n=e[l];return n?!0===n?e:n:(n=q({displayName:(t=e).displayName||t.name,render:function(){return t(this.props,this.context)}}),Object.defineProperty(n,l,{configurable:!0,value:!0}),n.displayName=e.displayName,n.propTypes=e.propTypes,n.defaultProps=e.defaultProps,Object.defineProperty(e,l,{configurable:!0,value:n}),n)}function I(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return T(e,2),N(i.h.apply(void 0,e))}function N(e){var t;e.preactCompatNormalized=!0,function(e){var t=e.attributes||(e.attributes={});L.enumerable="className"in t,t.className&&(t.class=t.className);Object.defineProperty(t,"className",L)}(e),"function"!=typeof(t=e.nodeName)||t.prototype&&t.prototype.render||(e.nodeName=D(e.nodeName));var n,r,o=e.attributes.ref,i=o&&typeof o;return!C||"string"!==i&&"number"!==i||(e.attributes.ref=(n=o,(r=C)._refProxies[n]||(r._refProxies[n]=function(e){r&&r.refs&&(r.refs[n]=e,null===e&&(delete r._refProxies[n],r=null))}))),function(e){var t=e.nodeName,n=e.attributes;if(!n||"string"!=typeof t)return;var r={};for(var o in n)r[o.toLowerCase()]=o;r.ondoubleclick&&(n.ondblclick=n[r.ondoubleclick],delete n[r.ondoubleclick]);if(r.onchange&&("textarea"===t||"input"===t.toLowerCase()&&!/^fil|che|rad/i.test(n.type))){var i=r.oninput||"oninput";n[i]||(n[i]=H([n[i],n[r.onchange]]),delete n[r.onchange])}}(e),e}function R(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];if(!M(e))return e;var o=e.attributes||e.props,a=Object(i.h)(e.nodeName||e.type,B({},o),e.children||o&&o.children),s=[a,t];return n&&n.length?s.push(n):t&&t.children&&s.push(t.children),N(i.cloneElement.apply(void 0,s))}function M(e){return e&&(e instanceof m||e.$$typeof===u)}var L={configurable:!0,get:function(){return this.class},set:function(e){this.class=e}};function B(e,t){for(var n=arguments,r=1,o=void 0;r<arguments.length;r++)if(o=n[r])for(var i in o)o.hasOwnProperty(i)&&(e[i]=o[i]);return e}function F(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}function U(e){return e&&(e.base||1===e.nodeType&&e)||null}function z(){}function q(e){function t(e,t){!function(e){for(var t in e){var n=e[t];"function"!=typeof n||n.__bound||f.hasOwnProperty(t)||((e[t]=n.bind(e)).__bound=!0)}}(this),$.call(this,e,t,d),V.call(this,e,t)}return(e=B({constructor:t},e)).mixins&&function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=H(t[n].concat(e[n]||x),"getDefaultProps"===n||"getInitialState"===n||"getChildContext"===n))}(e,function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];for(var o in r)r.hasOwnProperty(o)&&"function"==typeof r[o]&&(t[o]||(t[o]=[])).push(r[o])}return t}(e.mixins)),e.statics&&B(t,e.statics),e.propTypes&&(t.propTypes=e.propTypes),e.defaultProps&&(t.defaultProps=e.defaultProps),e.getDefaultProps&&(t.defaultProps=e.getDefaultProps.call(t)),z.prototype=$.prototype,t.prototype=B(new z,e),t.displayName=e.displayName||"Component",t}function W(e,t,n){if("string"==typeof t&&(t=e.constructor.prototype[t]),"function"==typeof t)return t.apply(e,n)}function H(e,t){return function(){for(var n,r=arguments,o=this,i=0;i<e.length;i++){var a=W(o,e[i],r);if(t&&null!=a)for(var s in n||(n={}),a)a.hasOwnProperty(s)&&(n[s]=a[s]);else void 0!==a&&(n=a)}return n}}function V(e,t){G.call(this,e,t),this.componentWillReceiveProps=H([G,this.componentWillReceiveProps||"componentWillReceiveProps"]),this.render=H([G,K,this.render||"render",Q])}function G(e,t){if(e){var n=e.children;if(n&&Array.isArray(n)&&1===n.length&&("string"==typeof n[0]||"function"==typeof n[0]||n[0]instanceof m)&&(e.children=n[0],e.children&&"object"==typeof e.children&&(e.children.length=1,e.children[0]=e.children)),h){var r="function"==typeof this?this:this.constructor,i=this.propTypes||r.propTypes,a=this.displayName||r.name;i&&o.a.checkPropTypes(i,e,"prop",a)}}}function K(e){C=this}function Q(){C===this&&(C=null)}function $(e,t,n){i.Component.call(this,e,t),this.state=this.getInitialState?this.getInitialState():{},this.refs={},this._refProxies={},n!==d&&V.call(this,e,t)}function Y(e,t){$.call(this,e,t)}function J(e){e()}B($.prototype=new i.Component,{constructor:$,isReactComponent:{},replaceState:function(e,t){for(var n in this.setState(e,t),this.state)n in e||delete this.state[n]},getDOMNode:function(){return this.base},isMounted:function(){return!!this.base}}),z.prototype=$.prototype,Y.prototype=new z,Y.prototype.isPureReactComponent=!0,Y.prototype.shouldComponentUpdate=function(e,t){return F(this.props,e)||F(this.state,t)};var X={version:s,DOM:A,PropTypes:o.a,Children:E,render:b,hydrate:b,createClass:q,createContext:a.createContext,createPortal:S,createFactory:j,createElement:I,cloneElement:R,createRef:i.createRef,isValidElement:M,findDOMNode:U,unmountComponentAtNode:O,Component:$,PureComponent:Y,unstable_renderSubtreeIntoContainer:k,unstable_batchedUpdates:J,__spread:B};t.default=X},function(e,t,n){e.exports=n(200)},function(e,t){e.exports={}},function(e,t,n){"use strict";n.d(t,"g",(function(){return $})),n.d(t,"h",(function(){return Y})),n.d(t,"o",(function(){return J})),n.d(t,"n",(function(){return X})),n.d(t,"l",(function(){return ee})),n.d(t,"i",(function(){return te})),n.d(t,"j",(function(){return ne})),n.d(t,"k",(function(){return ae})),n.d(t,"b",(function(){return fe})),n.d(t,"c",(function(){return pe})),n.d(t,"m",(function(){return de})),n.d(t,"f",(function(){return he})),n.d(t,"e",(function(){return ve})),n.d(t,"d",(function(){return me})),n.d(t,"a",(function(){return ye}));var r,o=n(26),i=n.n(o),a=n(27),s=n.n(a),c=n(16),u=n.n(c),l=n(13),f=n.n(l),p=n(17),d=n.n(p),h=n(18),v=n.n(h),m=n(15),y=n.n(m),g=n(1),b=n.n(g),_=n(429),k=n.n(_),w=n(33),S=n.n(w),O=n(430),C=n.n(O),x=n(21),E=n.n(x),j=n(65),A=n.n(j),P=n(301),T=n.n(P),D=n(44),I=n.n(D),N=n(172),R=n.n(N),M=n(431),L=n.n(M),B=n(5),F=n.n(B),U=n(88),z=n.n(U),q=n(432),W=n.n(q),H=n(0),V=n(433),G=n.n(V);function K(e,t){var n=y()(e);if(v.a){var r=v()(e);t&&(r=E()(r).call(r,(function(t){return d()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)f()(n=K(Object(r),!0)).call(n,(function(t){b()(e,t,r[t])}));else if(u.a)s()(e,u()(r));else{var o;f()(o=K(Object(r))).call(o,(function(t){i()(e,t,d()(r,t))}))}}return e}var $=function(e,t){return(t[e]||function(){return null})()},Y=function(e){return function(e,t){var n,r,o=W()(t),i=z()(o,2),a=i[0],s=i[1];s!==e&&console.warn(F()(n=F()(r="The css @value: ".concat(t," unit is ")).call(r,s," but it should be ")).call(n,e));return a}("ms",e)},J=function(e,t){return Object(H.h)("div",{className:e},t)},X=function(e){return function(t){t.preventDefault(),e()}},Z=(/iPad|iPhone|iPod/.test(navigator.platform||"")||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!window.MSStream,ee=function(){var e,t=navigator.userAgent,n=/Safari/.test(t)&&/Apple Computer/.test(navigator.vendor),r=L()(e=t.substring(R()(t).call(t,"Version/"),R()(t).call(t,"Safari/"))).call(e);return n&&I()(r).call(r,"13.1")},te=function(){console.warn("getMobileOSName - use of navigator.userAgent is highly discouraged unless absolutely necessary and only for simple use cases");var e=navigator.userAgent;return/android/i.test(e)?"UNSUPPORTED_ANDROID_BROWSER":Z?"UNSUPPORTED_IOS_BROWSER":(console.error("Unable to determine mobile OS"),"INTERRUPTED_FLOW_ERROR")},ne=!/Android|webOS|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(navigator.userAgent||"")&&!Z,re=I()(r=navigator.userAgent||"").call(r,"Windows"),oe=navigator.maxTouchPoints||navigator.msMaxTouchPoints,ie="ontouchstart"in window||oe>0||window.matchMedia&&matchMedia("(any-pointer: coarse)").matches,ae=re&&ie,se=function(e){return function(t){return function(e,t){try{G()().then(e).catch(t)}catch(e){t(e)}}((function(n){return t(e(n))}),(function(){return t(!1)}))}},ce=function(e){var t=e.kind,n=void 0===t?"":t;return I()(n).call(n,"input")},ue=function(e){var t=e.kind,n=void 0===t?"":t;return I()(n).call(n,"video")},le=function(e){return!!e.label},fe=se((function(e){return ee()?T()(e).call(e,ce):A()(e).call(e,ue)})),pe=se((function(e){var t;return A()(t=E()(e).call(e,ce)).call(t,le)})),de=function(e,t){var n=(new DOMParser).parseFromString("<l>".concat(e,"</l>"),"application/xml"),r=C()(n.firstChild.childNodes);return S()(r).call(r,(function(e){return e.nodeType===document.TEXT_NODE?e.textContent:t({type:e.tagName,text:e.textContent})}))},he=function(){return Math.floor(k()()/1e3)},ve=function(){return(new Date).getTime()},me=function(e,t){var n=document.createElement("input");document.body.appendChild(n),n.setAttribute("value",e),n.select(),document.execCommand("copy"),document.body.removeChild(n),t()},ye=function(e,t){return Q(Q({},e),{},{isCrossDeviceFlow:t,deviceType:ne?"desktop":"mobile"})}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(22),o=n(35),i=n(107),a=n(39).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},function(e,t,n){e.exports=n(176)},function(e,t,n){e.exports=n(178)},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return c}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function c(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}},function(e,t,n){var r=n(31),o=n(104),i=n(35),a=n(92),s=n(105),c=n(141),u=o("wks"),l=r.Symbol,f=c?l:l&&l.withoutSetter||a;e.exports=function(e){return i(u,e)||(s&&i(l,e)?u[e]=l[e]:u[e]=f("Symbol."+e)),u[e]}},function(e,t,n){var r=n(24);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(95))},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=n(320)},function(e,t,n){e.exports={container:"onfido-sdk-ui-Uploader-container",crossDeviceInstructionsContainer:"onfido-sdk-ui-Uploader-crossDeviceInstructionsContainer",instructions:"onfido-sdk-ui-Uploader-instructions",instructionsCopy:"onfido-sdk-ui-Uploader-instructionsCopy",error:"onfido-sdk-ui-Uploader-error",buttons:"onfido-sdk-ui-Uploader-buttons",poaButtons:"onfido-sdk-ui-Uploader-poaButtons",buttonContainer:"onfido-sdk-ui-Uploader-buttonContainer",poaBtnContainer:"onfido-sdk-ui-Uploader-poaBtnContainer",crossDeviceButton:"onfido-sdk-ui-Uploader-crossDeviceButton",iconContainer:"onfido-sdk-ui-Uploader-iconContainer",poaIconContainer:"onfido-sdk-ui-Uploader-poaIconContainer",proofOfAddressIcon:"onfido-sdk-ui-Uploader-proofOfAddressIcon",identityIcon:"onfido-sdk-ui-Uploader-identityIcon",icon:"onfido-sdk-ui-Uploader-icon",faceIcon:"onfido-sdk-ui-Uploader-faceIcon",contentWrapper:"onfido-sdk-ui-Uploader-contentWrapper",uploaderWrapper:"onfido-sdk-ui-Uploader-uploaderWrapper",uploadArea:"onfido-sdk-ui-Uploader-uploadArea",imageQualityGuide:"onfido-sdk-ui-Uploader-imageQualityGuide",imageQualityGuideRow:"onfido-sdk-ui-Uploader-imageQualityGuideRow",documentExampleCol:"onfido-sdk-ui-Uploader-documentExampleCol",documentExampleImg:"onfido-sdk-ui-Uploader-documentExampleImg",documentExampleImgBlur:"onfido-sdk-ui-Uploader-documentExampleImgBlur",documentExampleImgCutoff:"onfido-sdk-ui-Uploader-documentExampleImgCutoff",documentExampleImgGlare:"onfido-sdk-ui-Uploader-documentExampleImgGlare",documentExampleImgGood:"onfido-sdk-ui-Uploader-documentExampleImgGood",documentExampleLabel:"onfido-sdk-ui-Uploader-documentExampleLabel",passportUploadBtn:"onfido-sdk-ui-Uploader-passportUploadBtn"}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(22);e.exports=function(e){return r[e+"Prototype"]}},function(e,t,n){var r=n(82),o=n(60);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(30),o=n(39),i=n(59);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(30),o=n(135),i=n(40),a=n(83),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(i(e),t=a(t,!0),i(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(32);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){var r=n(60);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return l}));var r=n(58),o=n.n(r),i=n(439),a=n.n(i),s=function(e){return e},c=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a()(t).call(t,(function(e,t){return function(){return t(e.apply(void 0,arguments))}}),s)},u=function(e){var t={};return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=o()(r);return t[a]||(t[a]=e.apply(void 0,r))}},l=function(){}},function(e,t,n){var r=n(30),o=n(24),i=n(35),a=Object.defineProperty,s={},c=function(e){throw e};e.exports=function(e,t){if(i(s,e))return s[e];t||(t={});var n=[][e],u=!!i(t,"ACCESSORS")&&t.ACCESSORS,l=i(t,0)?t[0]:c,f=i(t,1)?t[1]:void 0;return s[e]=!!n&&!o((function(){if(u&&!r)return!0;var e={length:-1};u?a(e,1,{enumerable:!0,get:c}):e[1]=1,n.call(e,l,f)}))}},function(e,t,n){e.exports=n(309)},function(e,t,n){var r=n(209),o=n(327),i=n(329);e.exports=function(e,t){if(null==e)return{};var n,a,s=i(e,t);if(o){var c=o(e);for(a=0;a<c.length;a++)n=c[a],r(t).call(t,n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}},function(e,t,n){e.exports={challengeDescription:"onfido-sdk-ui-Video-challengeDescription",challengeTitle:"onfido-sdk-ui-Video-challengeTitle",introCopy:"onfido-sdk-ui-Video-introCopy",introBullets:"onfido-sdk-ui-Video-introBullets",introBullet:"onfido-sdk-ui-Video-introBullet",bolder:"onfido-sdk-ui-Video-bolder",introIcon:"onfido-sdk-ui-Video-introIcon",speakOutLoudIcon:"onfido-sdk-ui-Video-speakOutLoudIcon",twoActionsIcon:"onfido-sdk-ui-Video-twoActionsIcon",movement:"onfido-sdk-ui-Video-movement","movement-turnLeft":"onfido-sdk-ui-Video-movement-turnLeft",recite:"onfido-sdk-ui-Video-recite",actions:"onfido-sdk-ui-Video-actions",disabled:"onfido-sdk-ui-Video-disabled",btn:"onfido-sdk-ui-Video-btn","btn-centered":"onfido-sdk-ui-Video-btn-centered","btn-primary":"onfido-sdk-ui-Video-btn-primary",captureActionsHint:"onfido-sdk-ui-Video-captureActionsHint",recordAction:"onfido-sdk-ui-Video-recordAction",caption:"onfido-sdk-ui-Video-caption",recordingIndicator:"onfido-sdk-ui-Video-recordingIndicator",recordingIndicatorText:"onfido-sdk-ui-Video-recordingIndicatorText",startRecording:"onfido-sdk-ui-Video-startRecording",stopRecording:"onfido-sdk-ui-Video-stopRecording"}},function(e,t,n){e.exports={container:"onfido-sdk-ui-crossDevice-CrossDeviceLink-container",secureLinkView:"onfido-sdk-ui-crossDevice-CrossDeviceLink-secureLinkView",qrCodeSection:"onfido-sdk-ui-crossDevice-CrossDeviceLink-qrCodeSection",qrCodeContainer:"onfido-sdk-ui-crossDevice-CrossDeviceLink-qrCodeContainer",smsSection:"onfido-sdk-ui-crossDevice-CrossDeviceLink-smsSection",label:"onfido-sdk-ui-crossDevice-CrossDeviceLink-label",numberInputSection:"onfido-sdk-ui-crossDevice-CrossDeviceLink-numberInputSection",inputContainer:"onfido-sdk-ui-crossDevice-CrossDeviceLink-inputContainer",linkText:"onfido-sdk-ui-crossDevice-CrossDeviceLink-linkText",fieldError:"onfido-sdk-ui-crossDevice-CrossDeviceLink-fieldError",numberError:"onfido-sdk-ui-crossDevice-CrossDeviceLink-numberError",sending:"onfido-sdk-ui-crossDevice-CrossDeviceLink-sending",spin:"onfido-sdk-ui-crossDevice-CrossDeviceLink-spin",copyLinkSection:"onfido-sdk-ui-crossDevice-CrossDeviceLink-copyLinkSection",linkContainer:"onfido-sdk-ui-crossDevice-CrossDeviceLink-linkContainer",copySuccess:"onfido-sdk-ui-crossDevice-CrossDeviceLink-copySuccess",actionContainer:"onfido-sdk-ui-crossDevice-CrossDeviceLink-actionContainer",copyToClipboard:"onfido-sdk-ui-crossDevice-CrossDeviceLink-copyToClipboard",divider:"onfido-sdk-ui-crossDevice-CrossDeviceLink-divider",btn:"onfido-sdk-ui-crossDevice-CrossDeviceLink-btn",styledLabel:"onfido-sdk-ui-crossDevice-CrossDeviceLink-styledLabel",viewOptions:"onfido-sdk-ui-crossDevice-CrossDeviceLink-viewOptions",viewOption:"onfido-sdk-ui-crossDevice-CrossDeviceLink-viewOption",copyLinkOption:"onfido-sdk-ui-crossDevice-CrossDeviceLink-copyLinkOption",qrCodeLinkOption:"onfido-sdk-ui-crossDevice-CrossDeviceLink-qrCodeLinkOption",smsLinkOption:"onfido-sdk-ui-crossDevice-CrossDeviceLink-smsLinkOption"}},function(e,t,n){var r=n(91),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(22),o=n(31),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t,n){"use strict";(function(e,r){n.d(t,"d",(function(){return i})),n.d(t,"h",(function(){return a})),n.d(t,"f",(function(){return c})),n.d(t,"k",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return p})),n.d(t,"g",(function(){return d})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return _})),n.d(t,"e",(function(){return k}));var o=n(66);n(155);function i(e,t){return e.require(t)}function a(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var s={};function c(){return a()?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:s}function u(){var e=c(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function l(e){var t=c();if(!("console"in t))return e();var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var o=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),o}function f(e,t,n){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].value=e.exception.values[0].value||t||"",e.exception.values[0].type=e.exception.values[0].type||n||"Error"}function p(e,t){void 0===t&&(t={});try{e.exception.values[0].mechanism=e.exception.values[0].mechanism||{},Object.keys(t).forEach((function(n){e.exception.values[0].mechanism[n]=t[n]}))}catch(e){}}function d(e){try{for(var t=e,n=[],r=0,o=0,i=" > ".length,a=void 0;t&&r++<5&&!("html"===(a=h(t))||r>1&&o+n.length*i+a.length>=80);)n.push(a),o+=a.length,t=t.parentNode;return n.reverse().join(" > ")}catch(e){return"<unknown>"}}function h(e){var t,n,r,i,a,s=e,c=[];if(!s||!s.tagName)return"";if(c.push(s.tagName.toLowerCase()),s.id&&c.push("#"+s.id),(t=s.className)&&Object(o.k)(t))for(n=t.split(/\s+/),a=0;a<n.length;a++)c.push("."+n[a]);var u=["type","name","title","alt"];for(a=0;a<u.length;a++)r=u[a],(i=s.getAttribute(r))&&c.push("["+r+'="'+i+'"]');return c.join("")}var v=Date.now(),m=0,y={now:function(){var e=Date.now()-v;return e<m&&(e=m),m=e,e},timeOrigin:v},g=function(){if(a())try{return i(r,"perf_hooks").performance}catch(e){return y}return c().performance&&void 0===performance.timeOrigin&&(performance.timeOrigin=performance.timing&&performance.timing.navigationStart||v),c().performance||y}();function b(){return(g.timeOrigin+g.now())/1e3}function _(e,t){if(!t)return 6e4;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?6e4:r-e}function k(e){try{return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}}).call(this,n(95),n(412)(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return A})),n.d(t,"h",(function(){return P})),n.d(t,"g",(function(){return T})),n.d(t,"e",(function(){return D})),n.d(t,"f",(function(){return I})),n.d(t,"c",(function(){return N})),n.d(t,"d",(function(){return R})),n.d(t,"b",(function(){return M}));var r=n(13),o=n.n(r),i=n(1),a=n.n(i),s=n(88),c=n.n(s),u=n(133),l=n.n(u),f=n(33),p=n.n(f),d=n(279),h=n.n(d),v=n(57),m=n.n(v),y=n(64),g=n.n(y),b=n(44),_=n.n(b),k=n(5),w=n.n(k),S=n(131),O=n.n(S),C=n(15),x=n.n(C),E=n(73),j=n.n(E),A=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return j()(e=x()(t)).call(e,(function(e){return n(t[e],e)}))},P=function(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;var n=x()(e),r=x()(t),o=new O.a(w()(n).call(n,r));if(n.length!==r.length||n.length!==o.size)return!1;for(var i=0;i<n.length;i++)if(e[n[i]]!==t[n[i]])return!1;return!0},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return I(e,(function(e){return!_()(t).call(t,e)}))},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return I(e,(function(e){return _()(t).call(t,e)}))},I=function(e,t){var n;return g()(n=x()(e||{})).call(n,(function(n,r){return t(r,e[r])||(n[r]=e[r]),n}),{})},N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===x()(e).length},R=function(e,t){var n,r;return h.a.apply(Object,w()(n=[{}]).call(n,m()(p()(r=l()(e)).call(r,(function(e){var n=c()(e,2),r=n[0],o=n[1];return a()({},r,t(o,r))})))))},M=function(e,t){var n;return o()(n=l()(e)).call(n,(function(e){var n=c()(e,2),r=n[0],o=n[1];return t(o,r)}))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t){e.exports={}},function(e,t,n){var r=n(106),o=n(39).f,i=n(38),a=n(35),s=n(190),c=n(29)("toStringTag");e.exports=function(e,t,n,u){if(e){var l=n?e:e.prototype;a(l,c)||o(l,c,{configurable:!0,value:t}),u&&!r&&i(l,"toString",s)}}},function(e,t,n){var r=n(77),o=n(82),i=n(41),a=n(48),s=n(123),c=[].push,u=function(e){var t=1==e,n=2==e,u=3==e,l=4==e,f=6==e,p=5==e||f;return function(d,h,v,m){for(var y,g,b=i(d),_=o(b),k=r(h,v,3),w=a(_.length),S=0,O=m||s,C=t?O(d,w):n?O(d,0):void 0;w>S;S++)if((p||S in _)&&(g=k(y=_[S],S,b),e))if(t)C[S]=g;else if(g)switch(e){case 3:return!0;case 5:return y;case 6:return S;case 2:c.call(C,y)}else if(l)return!1;return f?-1:u||l?l:C}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6)}},function(e,t,n){e.exports=n(334)()},function(e,t,n){var r=n(366),o=n(367),i=n(370);e.exports=function(e){return r(e)||o(e)||i()}},function(e,t,n){e.exports=n(354)},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r,o,i,a=n(187),s=n(31),c=n(32),u=n(38),l=n(35),f=n(85),p=n(70),d=s.WeakMap;if(a){var h=new d,v=h.get,m=h.has,y=h.set;r=function(e,t){return y.call(h,e,t),t},o=function(e){return v.call(h,e)||{}},i=function(e){return m.call(h,e)}}else{var g=f("state");p[g]=!0,r=function(e,t){return u(e,g,t),t},o=function(e){return l(e,g)?e[g]:{}},i=function(e){return l(e,g)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t){e.exports=!0},function(e,t,n){var r,o=n(40),i=n(136),a=n(101),s=n(70),c=n(162),u=n(119),l=n(85),f=l("IE_PROTO"),p=function(){},d=function(e){return"<script>"+e+"<\/script>"},h=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;h=r?function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=u("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F);for(var n=a.length;n--;)delete h.prototype[a[n]];return h()};s[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p.prototype=o(e),n=new p,p.prototype=null,n[f]=e):n=h(),void 0===t?n:i(n,t)}},function(e,t,n){e.exports=n(262)},function(e,t,n){e.exports=n(483)},function(e,t,n){"use strict";function r(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return v(e,Error)}}function o(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)}function i(e){return"[object DOMError]"===Object.prototype.toString.call(e)}function a(e){return"[object DOMException]"===Object.prototype.toString.call(e)}function s(e){return"[object String]"===Object.prototype.toString.call(e)}function c(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function u(e){return"[object Object]"===Object.prototype.toString.call(e)}function l(e){return"undefined"!=typeof Event&&v(e,Event)}function f(e){return"undefined"!=typeof Element&&v(e,Element)}function p(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function d(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function h(e){return u(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function v(e,t){try{return e instanceof t}catch(e){return!1}}n.d(t,"d",(function(){return r})),n.d(t,"e",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a})),n.d(t,"k",(function(){return s})),n.d(t,"i",(function(){return c})),n.d(t,"h",(function(){return u})),n.d(t,"f",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"j",(function(){return p})),n.d(t,"m",(function(){return d})),n.d(t,"l",(function(){return h})),n.d(t,"g",(function(){return v}))},function(e,t,n){var r=n(30),o=n(90),i=n(59),a=n(37),s=n(83),c=n(35),u=n(135),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=a(e),t=s(t,!0),u)try{return l(e,t)}catch(e){}if(c(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(137),o=n(101);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){e.exports={}},function(e,t,n){n(186);var r=n(192),o=n(31),i=n(78),a=n(38),s=n(53),c=n(29)("toStringTag");for(var u in r){var l=o[u],f=l&&l.prototype;f&&i(f)!==c&&a(f,c,u),s[u]=s.Array}},function(e,t,n){var r=n(68);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){e.exports=n(316)},function(e,t,n){"use strict";t.__esModule=!0,t.connect=t.Provider=void 0;var r=i(n(456)),o=i(n(457));function i(e){return e&&e.__esModule?e:{default:e}}t.Provider=r.default,t.connect=o.default},function(e,t,n){"use strict";t.__esModule=!0,t.createPath=t.parsePath=t.locationsAreEqual=t.createLocation=t.createMemoryHistory=t.createHashHistory=t.createBrowserHistory=void 0;var r=n(128);Object.defineProperty(t,"createLocation",{enumerable:!0,get:function(){return r.createLocation}}),Object.defineProperty(t,"locationsAreEqual",{enumerable:!0,get:function(){return r.locationsAreEqual}});var o=n(108);Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return o.parsePath}}),Object.defineProperty(t,"createPath",{enumerable:!0,get:function(){return o.createPath}});var i=c(n(277)),a=c(n(359)),s=c(n(360));function c(e){return e&&e.__esModule?e:{default:e}}t.createBrowserHistory=i.default,t.createHashHistory=a.default,t.createMemoryHistory=s.default},,function(e,t,n){var r=n(52);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(106),o=n(68),i=n(29)("toStringTag"),a="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){"use strict";var r=n(24);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},function(e,t,n){"use strict";var r=n(213).charAt,o=n(61),i=n(112),a=o.set,s=o.getterFor("String Iterator");i(String,"String",(function(e){a(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=s(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t,n){e.exports={content:"onfido-sdk-ui-ProofOfAddress-Guidance-content",subTitle:"onfido-sdk-ui-ProofOfAddress-Guidance-subTitle",bolder:"onfido-sdk-ui-ProofOfAddress-Guidance-bolder",makeSure:"onfido-sdk-ui-ProofOfAddress-Guidance-makeSure",docImageContainer:"onfido-sdk-ui-ProofOfAddress-Guidance-docImageContainer",docImage:"onfido-sdk-ui-ProofOfAddress-Guidance-docImage",label:"onfido-sdk-ui-ProofOfAddress-Guidance-label"}},function(e,t,n){var r=n(24),o=n(68),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(32);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(83),o=n(39),i=n(59);e.exports=function(e,t,n){var a=r(t);a in e?o.f(e,a,i(0,n)):e[a]=n}},function(e,t,n){var r=n(104),o=n(92),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t,n){var r=n(24),o=n(29),i=n(124),a=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,n){e.exports=n(526)},function(e,t,n){var r=n(340),o=n(343),i=n(348);e.exports=function(e,t){return r(e)||o(e,t)||i()}},,function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);t.f=i?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){e.exports={pdfIcon:"onfido-sdk-ui-Confirm-CaptureViewer-pdfIcon",pdfWrapper:"onfido-sdk-ui-Confirm-CaptureViewer-pdfWrapper",imageWrapper:"onfido-sdk-ui-Confirm-CaptureViewer-imageWrapper",croppedImageWrapper:"onfido-sdk-ui-Confirm-CaptureViewer-croppedImageWrapper",videoWrapper:"onfido-sdk-ui-Confirm-CaptureViewer-videoWrapper",fullscreenImageWrapper:"onfido-sdk-ui-Confirm-CaptureViewer-fullscreenImageWrapper",image:"onfido-sdk-ui-Confirm-CaptureViewer-image",croppedDocumentImage:"onfido-sdk-ui-Confirm-CaptureViewer-croppedDocumentImage",video:"onfido-sdk-ui-Confirm-CaptureViewer-video"}},,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(35),o=n(41),i=n(85),a=n(140),s=i("IE_PROTO"),c=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=o(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}},function(e,t,n){var r=n(38);e.exports=function(e,t,n,o){o&&o.enumerable?e[t]=n:r(e,t,n)}},function(e,t,n){var r=n(210),o=n(214);function i(t){return e.exports=i="function"==typeof o&&"symbol"==typeof r?function(e){return typeof e}:function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":typeof e},i(t)}e.exports=i},function(e,t,n){e.exports={list:"onfido-sdk-ui-DocumentSelector-list",option:"onfido-sdk-ui-DocumentSelector-option",optionHoverDesktop:"onfido-sdk-ui-DocumentSelector-optionHoverDesktop",content:"onfido-sdk-ui-DocumentSelector-content",optionMain:"onfido-sdk-ui-DocumentSelector-optionMain",label:"onfido-sdk-ui-DocumentSelector-label",hint:"onfido-sdk-ui-DocumentSelector-hint",warning:"onfido-sdk-ui-DocumentSelector-warning",tag:"onfido-sdk-ui-DocumentSelector-tag",icon:"onfido-sdk-ui-DocumentSelector-icon","icon-passport":"onfido-sdk-ui-DocumentSelector-icon-passport","icon-national-identity-card":"onfido-sdk-ui-DocumentSelector-icon-national-identity-card","icon-driving-licence":"onfido-sdk-ui-DocumentSelector-icon-driving-licence","icon-bank-building-society-statement":"onfido-sdk-ui-DocumentSelector-icon-bank-building-society-statement","icon-utility-bill":"onfido-sdk-ui-DocumentSelector-icon-utility-bill","icon-letter":"onfido-sdk-ui-DocumentSelector-icon-letter"}},function(e,t,n){e.exports={container:"onfido-sdk-ui-Error-container","container-error":"onfido-sdk-ui-Error-container-error","container-warning":"onfido-sdk-ui-Error-container-warning",instruction:"onfido-sdk-ui-Error-instruction","instruction-text":"onfido-sdk-ui-Error-instruction-text",title:"onfido-sdk-ui-Error-title","title-text":"onfido-sdk-ui-Error-title-text","title-icon":"onfido-sdk-ui-Error-title-icon","title-icon-error":"onfido-sdk-ui-Error-title-icon-error","title-icon-warning":"onfido-sdk-ui-Error-title-icon-warning",roundedTriangle:"onfido-sdk-ui-Error-roundedTriangle",warningTriangle:"onfido-sdk-ui-Error-warningTriangle",errorTriangle:"onfido-sdk-ui-Error-errorTriangle",dismiss:"onfido-sdk-ui-Error-dismiss"}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var r=n(137),o=n(101).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(62),o=n(138);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(24);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(e,t,n){var r={};r[n(29)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){var r=n(29);t.f=r},function(e,t,n){"use strict";t.__esModule=!0;t.addLeadingSlash=function(e){return"/"===e.charAt(0)?e:"/"+e},t.stripLeadingSlash=function(e){return"/"===e.charAt(0)?e.substr(1):e},t.stripPrefix=function(e,t){return 0===e.indexOf(t)?e.substr(t.length):e},t.parsePath=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}},t.createPath=function(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}},function(e,t,n){!function(e,t){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function r(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o={register:function(e){console.warn("Consumer used without a Provider")},unregister:function(e){},val:function(e){}};function i(e){var t=e.children;return{child:1===t.length?t[0]:null,children:t}}function a(e){return i(e).child||"render"in e&&e.render}var s=1073741823,c=function(){return s},u=0;function l(e,n){var l="_preactContextProvider-"+u++;return{Provider:function(e){function o(t){var r=e.call(this,t)||this;return r.t=function(e,t){var n=[],r=e,o=function(e){return 0|t(r,e)};return{register:function(e){n.push(e),e(r,o(r))},unregister:function(e){n=n.filter((function(t){return t!==e}))},val:function(e){if(void 0===e||e==r)return r;var t=o(e);return r=e,n.forEach((function(n){return n(e,t)})),r}}}(t.value,n||c),r}return r(o,e),o.prototype.getChildContext=function(){var e;return(e={})[l]=this.t,e},o.prototype.componentDidUpdate=function(){this.t.val(this.props.value)},o.prototype.render=function(){var e=i(this.props),n=e.child,r=e.children;return n||t.h("span",null,r)},o}(t.Component),Consumer:function(t){function n(n,r){var o=t.call(this,n,r)||this;return o.i=function(e,t){var n=o.props.unstable_observedBits,r=null==n?s:n;0!=((r|=0)&t)&&o.setState({value:e})},o.state={value:o.u().val()||e},o}return r(n,t),n.prototype.componentDidMount=function(){this.u().register(this.i)},n.prototype.shouldComponentUpdate=function(e,t){return this.state.value!==t.value||a(this.props)!==a(e)},n.prototype.componentWillUnmount=function(){this.u().unregister(this.i)},n.prototype.componentDidUpdate=function(e,t,n){var r=n[l];r!==this.context[l]&&((r||o).unregister(this.i),this.componentDidMount())},n.prototype.render=function(){var e="render"in this.props&&this.props.render,t=a(this.props);if(e&&e!==t&&console.warn("Both children and a render function are defined. Children will be used"),"function"==typeof t)return t(this.state.value);console.warn("Consumer is expecting a function as one and only child but didn't find any")},n.prototype.u=function(){return this.context[l]||o},n}(t.Component)}}var f=l;e.default=l,e.createContext=f,Object.defineProperty(e,"__esModule",{value:!0})}(t,n(0))},function(e,t,n){e.exports={container:"onfido-sdk-ui-Photo-container",thinWrapper:"onfido-sdk-ui-Photo-thinWrapper",introIcon:"onfido-sdk-ui-Photo-introIcon",introBullet:"onfido-sdk-ui-Photo-introBullet",introBullets:"onfido-sdk-ui-Photo-introBullets",introText:"onfido-sdk-ui-Photo-introText",selfieIcon:"onfido-sdk-ui-Photo-selfieIcon",glassesIcon:"onfido-sdk-ui-Photo-glassesIcon",introCopy:"onfido-sdk-ui-Photo-introCopy"}},function(e,t){e.exports=function(){}},function(e,t,n){"use strict";var r=n(9),o=n(189),i=n(96),a=n(122),s=n(54),c=n(38),u=n(97),l=n(29),f=n(62),p=n(53),d=n(139),h=d.IteratorPrototype,v=d.BUGGY_SAFARI_ITERATORS,m=l("iterator"),y=function(){return this};e.exports=function(e,t,n,l,d,g,b){o(n,t,l);var _,k,w,S=function(e){if(e===d&&j)return j;if(!v&&e in x)return x[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},O=t+" Iterator",C=!1,x=e.prototype,E=x[m]||x["@@iterator"]||d&&x[d],j=!v&&E||S(d),A="Array"==t&&x.entries||E;if(A&&(_=i(A.call(new e)),h!==Object.prototype&&_.next&&(f||i(_)===h||(a?a(_,h):"function"!=typeof _[m]&&c(_,m,y)),s(_,O,!0,!0),f&&(p[O]=y))),"values"==d&&E&&"values"!==E.name&&(C=!0,j=function(){return E.call(this)}),f&&!b||x[m]===j||c(x,m,j),p[t]=j,d)if(k={values:S("values"),keys:g?j:S("keys"),entries:S("entries")},b)for(w in k)(v||C||!(w in x))&&u(x,w,k[w]);else r({target:t,proto:!0,forced:v||C},k);return k}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){e.exports={camera:"onfido-sdk-ui-Camera-camera",docAutoCaptureFrame:"onfido-sdk-ui-Camera-docAutoCaptureFrame",container:"onfido-sdk-ui-Camera-container",overlay:"onfido-sdk-ui-Camera-overlay",video:"onfido-sdk-ui-Camera-video",actions:"onfido-sdk-ui-Camera-actions",disabled:"onfido-sdk-ui-Camera-disabled",btn:"onfido-sdk-ui-Camera-btn",webcamContainer:"onfido-sdk-ui-Camera-webcamContainer"}},function(e,t,n){e.exports={previewsContainer:"onfido-sdk-ui-Confirm-previewsContainer",previewsContainerIsFullScreen:"onfido-sdk-ui-Confirm-previewsContainerIsFullScreen",actionsContainer:"onfido-sdk-ui-Confirm-actionsContainer",title:"onfido-sdk-ui-Confirm-title",message:"onfido-sdk-ui-Confirm-message",actions:"onfido-sdk-ui-Confirm-actions","btn-secondary":"onfido-sdk-ui-Confirm-btn-secondary",error:"onfido-sdk-ui-Confirm-error"}},function(e,t,n){e.exports={modal_animation_duration:"200ms",portal:"onfido-sdk-ui-Modal-portal",modalBody:"onfido-sdk-ui-Modal-modalBody",overlay:"onfido-sdk-ui-Modal-overlay","overlay--after-open":"onfido-sdk-ui-Modal-overlay--after-open","overlay--before-close":"onfido-sdk-ui-Modal-overlay--before-close",inner:"onfido-sdk-ui-Modal-inner",closeButton:"onfido-sdk-ui-Modal-closeButton",closeButtonLabel:"onfido-sdk-ui-Modal-closeButtonLabel",closeButtonFullScreen:"onfido-sdk-ui-Modal-closeButtonFullScreen"}},function(e,t,n){e.exports={icon:"onfido-sdk-ui-crossDevice-CrossDeviceSubmit-icon",uploadList:"onfido-sdk-ui-crossDevice-CrossDeviceSubmit-uploadList",uploadListItem:"onfido-sdk-ui-crossDevice-CrossDeviceSubmit-uploadListItem",listText:"onfido-sdk-ui-crossDevice-CrossDeviceSubmit-listText"}},function(e,t,n){e.exports={container:"onfido-sdk-ui-crossDevice-Intro-container",buttonContainer:"onfido-sdk-ui-crossDevice-Intro-buttonContainer",content:"onfido-sdk-ui-crossDevice-Intro-content",list:"onfido-sdk-ui-crossDevice-Intro-list",stage:"onfido-sdk-ui-crossDevice-Intro-stage",stageIcon:"onfido-sdk-ui-crossDevice-Intro-stageIcon","stageIcon-sms":"onfido-sdk-ui-crossDevice-Intro-stageIcon-sms","stageIcon-take-photos":"onfido-sdk-ui-crossDevice-Intro-stageIcon-take-photos","stageIcon-take-selfie":"onfido-sdk-ui-crossDevice-Intro-stageIcon-take-selfie","stageIcon-return-to-computer":"onfido-sdk-ui-crossDevice-Intro-stageIcon-return-to-computer",stageMessage:"onfido-sdk-ui-crossDevice-Intro-stageMessage","stageMessage-sms":"onfido-sdk-ui-crossDevice-Intro-stageMessage-sms","stageMessage-take-photos":"onfido-sdk-ui-crossDevice-Intro-stageMessage-take-photos","stageMessage-return-to-computer":"onfido-sdk-ui-crossDevice-Intro-stageMessage-return-to-computer"}},function(e,t,n){var r=n(31),o=n(32),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,n){var r=n(37),o=n(48),i=n(121),a=function(e){return function(t,n,a){var s,c=r(t),u=o(c.length),l=i(a,u);if(e&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t,n){var r=n(91),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},function(e,t,n){var r=n(40),o=n(191);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return r(n),o(i),t?e.call(n,i):n.__proto__=i,n}}():void 0)},function(e,t,n){var r=n(32),o=n(72),i=n(29)("species");e.exports=function(e,t){var n;return o(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[i])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},function(e,t,n){var r,o,i=n(31),a=n(148),s=i.process,c=s&&s.versions,u=c&&c.v8;u?o=(r=u.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},function(e,t){},function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(e,t,n){var r=n(40),o=n(255),i=n(48),a=n(77),s=n(151),c=n(254),u=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,n,l,f){var p,d,h,v,m,y,g,b=a(t,n,l?2:1);if(f)p=e;else{if("function"!=typeof(d=s(e)))throw TypeError("Target is not iterable");if(o(d)){for(h=0,v=i(e.length);v>h;h++)if((m=l?b(r(g=e[h])[0],g[1]):b(e[h]))&&m instanceof u)return m;return new u(!1)}p=d.call(e)}for(y=p.next;!(g=y.call(p)).done;)if("object"==typeof(m=c(p,b,g.value,l))&&m&&m instanceof u)return m;return new u(!1)}).stop=function(e){return new u(!0,e)}},function(e,t,n){"use strict";t.__esModule=!0,t.locationsAreEqual=t.createLocation=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=s(n(357)),i=s(n(358)),a=n(108);function s(e){return e&&e.__esModule?e:{default:e}}t.createLocation=function(e,t,n,i){var s=void 0;return"string"==typeof e?(s=(0,a.parsePath)(e)).state=t:(void 0===(s=r({},e)).pathname&&(s.pathname=""),s.search?"?"!==s.search.charAt(0)&&(s.search="?"+s.search):s.search="",s.hash?"#"!==s.hash.charAt(0)&&(s.hash="#"+s.hash):s.hash="",void 0!==t&&void 0===s.state&&(s.state=t)),s.key=n,i&&(s.pathname?"/"!==s.pathname.charAt(0)&&(s.pathname=(0,o.default)(s.pathname,i.pathname)):s.pathname=i.pathname),s},t.locationsAreEqual=function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&(0,i.default)(e.state,t.state)}},function(e,t,n){function r(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=n(528)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))})),e.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=r,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(r())},function(e,t,n){"use strict";t.__esModule=!0,t.compose=t.applyMiddleware=t.bindActionCreators=t.combineReducers=t.createStore=void 0;var r=c(n(389)),o=c(n(470)),i=c(n(471)),a=c(n(472)),s=c(n(392));c(n(391));function c(e){return e&&e.__esModule?e:{default:e}}t.createStore=r.default,t.combineReducers=o.default,t.bindActionCreators=i.default,t.applyMiddleware=a.default,t.compose=s.default},function(e,t,n){e.exports=n(349)},function(e,t,n){e.exports=n(268)},function(e,t,n){e.exports=n(361)},function(e,t,n){n(177);var r=n(22).Object,o=e.exports=function(e,t,n){return r.defineProperty(e,t,n)};r.defineProperty.sham&&(o.sham=!0)},function(e,t,n){var r=n(30),o=n(24),i=n(119);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(30),o=n(39),i=n(40),a=n(69);e.exports=r?Object.defineProperties:function(e,t){i(e);for(var n,r=a(t),s=r.length,c=0;s>c;)o.f(e,n=r[c++],t[n]);return e}},function(e,t,n){var r=n(35),o=n(37),i=n(120).indexOf,a=n(70);e.exports=function(e,t){var n,s=o(e),c=0,u=[];for(n in s)!r(a,n)&&r(s,n)&&u.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~i(u,n)||u.push(n));return u}},function(e,t,n){var r=n(31),o=n(188),i=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},function(e,t,n){"use strict";var r,o,i,a=n(96),s=n(38),c=n(35),u=n(29),l=n(62),f=u("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=a(a(i)))!==Object.prototype&&(r=o):p=!0),null==r&&(r={}),l||c(r,f)||s(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},function(e,t,n){var r=n(24);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,n){var r=n(105);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){"use strict";var r=n(9),o=n(31),i=n(49),a=n(62),s=n(30),c=n(105),u=n(141),l=n(24),f=n(35),p=n(72),d=n(32),h=n(40),v=n(41),m=n(37),y=n(83),g=n(59),b=n(63),_=n(69),k=n(102),w=n(205),S=n(103),O=n(67),C=n(39),x=n(90),E=n(38),j=n(97),A=n(104),P=n(85),T=n(70),D=n(92),I=n(29),N=n(107),R=n(25),M=n(54),L=n(61),B=n(55).forEach,F=P("hidden"),U=I("toPrimitive"),z=L.set,q=L.getterFor("Symbol"),W=Object.prototype,H=o.Symbol,V=i("JSON","stringify"),G=O.f,K=C.f,Q=w.f,$=x.f,Y=A("symbols"),J=A("op-symbols"),X=A("string-to-symbol-registry"),Z=A("symbol-to-string-registry"),ee=A("wks"),te=o.QObject,ne=!te||!te.prototype||!te.prototype.findChild,re=s&&l((function(){return 7!=b(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=G(W,t);r&&delete W[t],K(e,t,n),r&&e!==W&&K(W,t,r)}:K,oe=function(e,t){var n=Y[e]=b(H.prototype);return z(n,{type:"Symbol",tag:e,description:t}),s||(n.description=t),n},ie=u?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof H},ae=function(e,t,n){e===W&&ae(J,t,n),h(e);var r=y(t,!0);return h(n),f(Y,r)?(n.enumerable?(f(e,F)&&e[F][r]&&(e[F][r]=!1),n=b(n,{enumerable:g(0,!1)})):(f(e,F)||K(e,F,g(1,{})),e[F][r]=!0),re(e,r,n)):K(e,r,n)},se=function(e,t){h(e);var n=m(t),r=_(n).concat(fe(n));return B(r,(function(t){s&&!ce.call(n,t)||ae(e,t,n[t])})),e},ce=function(e){var t=y(e,!0),n=$.call(this,t);return!(this===W&&f(Y,t)&&!f(J,t))&&(!(n||!f(this,t)||!f(Y,t)||f(this,F)&&this[F][t])||n)},ue=function(e,t){var n=m(e),r=y(t,!0);if(n!==W||!f(Y,r)||f(J,r)){var o=G(n,r);return!o||!f(Y,r)||f(n,F)&&n[F][r]||(o.enumerable=!0),o}},le=function(e){var t=Q(m(e)),n=[];return B(t,(function(e){f(Y,e)||f(T,e)||n.push(e)})),n},fe=function(e){var t=e===W,n=Q(t?J:m(e)),r=[];return B(n,(function(e){!f(Y,e)||t&&!f(W,e)||r.push(Y[e])})),r};(c||(j((H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=D(e),n=function(e){this===W&&n.call(J,e),f(this,F)&&f(this[F],t)&&(this[F][t]=!1),re(this,t,g(1,e))};return s&&ne&&re(W,t,{configurable:!0,set:n}),oe(t,e)}).prototype,"toString",(function(){return q(this).tag})),j(H,"withoutSetter",(function(e){return oe(D(e),e)})),x.f=ce,C.f=ae,O.f=ue,k.f=w.f=le,S.f=fe,N.f=function(e){return oe(I(e),e)},s&&(K(H.prototype,"description",{configurable:!0,get:function(){return q(this).description}}),a||j(W,"propertyIsEnumerable",ce,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:H}),B(_(ee),(function(e){R(e)})),r({target:"Symbol",stat:!0,forced:!c},{for:function(e){var t=String(e);if(f(X,t))return X[t];var n=H(t);return X[t]=n,Z[n]=t,n},keyFor:function(e){if(!ie(e))throw TypeError(e+" is not a symbol");if(f(Z,e))return Z[e]},useSetter:function(){ne=!0},useSimple:function(){ne=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!s},{create:function(e,t){return void 0===t?b(e):se(b(e),t)},defineProperty:ae,defineProperties:se,getOwnPropertyDescriptor:ue}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:le,getOwnPropertySymbols:fe}),r({target:"Object",stat:!0,forced:l((function(){S.f(1)}))},{getOwnPropertySymbols:function(e){return S.f(v(e))}}),V)&&r({target:"JSON",stat:!0,forced:!c||l((function(){var e=H();return"[null]"!=V([e])||"{}"!=V({a:e})||"{}"!=V(Object(e))}))},{stringify:function(e,t,n){for(var r,o=[e],i=1;arguments.length>i;)o.push(arguments[i++]);if(r=t,(d(t)||void 0!==e)&&!ie(e))return p(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!ie(t))return t}),o[1]=t,V.apply(null,o)}});H.prototype[U]||E(H.prototype,U,H.prototype.valueOf),M(H,"Symbol"),T[F]=!0},function(e,t,n){e.exports=n(208)},function(e,t,n){n(25)("iterator")},function(e,t,n){"use strict";var r=n(9),o=n(24),i=n(72),a=n(32),s=n(41),c=n(48),u=n(84),l=n(123),f=n(86),p=n(29),d=n(124),h=p("isConcatSpreadable"),v=d>=51||!o((function(){var e=[];return e[h]=!1,e.concat()[0]!==e})),m=f("concat"),y=function(e){if(!a(e))return!1;var t=e[h];return void 0!==t?!!t:i(e)};r({target:"Array",proto:!0,forced:!v||!m},{concat:function(e){var t,n,r,o,i,a=s(this),f=l(a,0),p=0;for(t=-1,r=arguments.length;t<r;t++)if(y(i=-1===t?a:arguments[t])){if(p+(o=c(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,p++)n in i&&u(f,p,i[n])}else{if(p>=9007199254740991)throw TypeError("Maximum allowed index exceeded");u(f,p++,i)}return f.length=p,f}})},function(e,t,n){e.exports=n(247)},function(e,t,n){e.exports={navigation:"onfido-sdk-ui-NavigationBar-navigation",fullScreenNav:"onfido-sdk-ui-NavigationBar-fullScreenNav",backHoverDesktop:"onfido-sdk-ui-NavigationBar-backHoverDesktop",iconBack:"onfido-sdk-ui-NavigationBar-iconBack",back:"onfido-sdk-ui-NavigationBar-back",label:"onfido-sdk-ui-NavigationBar-label",disabled:"onfido-sdk-ui-NavigationBar-disabled"}},function(e,t,n){var r=n(49);e.exports=r("navigator","userAgent")||""},function(e,t,n){n(142);var r=n(22);e.exports=r.Object.getOwnPropertySymbols},function(e,t,n){n(207);var r=n(22);e.exports=r.Object.keys},function(e,t,n){var r=n(78),o=n(53),i=n(29)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(113);(r=o)&&r.__esModule;t.default=function(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0,r=function(){n&&e.apply(void 0,arguments)};return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}},function(e,t,n){e.exports=n(273)},function(e,t,n){e.exports={button:"onfido-sdk-ui-Button-button","button-text":"onfido-sdk-ui-Button-button-text","button-centered":"onfido-sdk-ui-Button-button-centered","button-primary":"onfido-sdk-ui-Button-button-primary",hoverDesktop:"onfido-sdk-ui-Button-hoverDesktop","button-lg":"onfido-sdk-ui-Button-button-lg","button-sm":"onfido-sdk-ui-Button-button-sm","button-secondary":"onfido-sdk-ui-Button-button-secondary","button-overlay":"onfido-sdk-ui-Button-button-overlay",fallbackButton:"onfido-sdk-ui-Button-fallbackButton"}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));n(66);function r(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function o(e,t){var n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);var o=Math.max(t-60,0);o<5&&(o=0);var i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n="'{snip} "+n),i<r&&(n+=" {snip}"),n}},function(e,t,n){e.exports={documentContainer:"onfido-sdk-ui-Capture-documentContainer",faceContainer:"onfido-sdk-ui-Capture-faceContainer",uploadFallback:"onfido-sdk-ui-Capture-uploadFallback"}},function(e,t,n){e.exports={title:"onfido-sdk-ui-PageTitle-title",titleSpan:"onfido-sdk-ui-PageTitle-titleSpan",subTitle:"onfido-sdk-ui-PageTitle-subTitle",titleWrapper:"onfido-sdk-ui-PageTitle-titleWrapper",smaller:"onfido-sdk-ui-PageTitle-smaller",fullScreen:"onfido-sdk-ui-PageTitle-fullScreen"}},function(e,t,n){e.exports={instructions:"onfido-sdk-ui-CameraPermissions-Recover-instructions",instructionsTitle:"onfido-sdk-ui-CameraPermissions-Recover-instructionsTitle",recovery:"onfido-sdk-ui-CameraPermissions-Recover-recovery",steps:"onfido-sdk-ui-CameraPermissions-Recover-steps",step:"onfido-sdk-ui-CameraPermissions-Recover-step",button:"onfido-sdk-ui-CameraPermissions-Recover-button"}},function(e,t,n){e.exports={expanded:"onfido-sdk-ui-EnlargedPreview-expanded",imageContainer:"onfido-sdk-ui-EnlargedPreview-imageContainer",image:"onfido-sdk-ui-EnlargedPreview-image",container:"onfido-sdk-ui-EnlargedPreview-container",button:"onfido-sdk-ui-EnlargedPreview-button","button-text":"onfido-sdk-ui-EnlargedPreview-button-text"}},function(e,t,n){var r=n(24),o=/#|\.prototype\./,i=function(e,t){var n=s[a(e)];return n==u||n!=c&&("function"==typeof t?r(t):!!t)},a=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},s=i.data={},c=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},function(e,t,n){var r=n(138),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},function(e,t,n){var r=n(49);e.exports=r("document","documentElement")},function(e,t,n){"use strict";var r=n(52),o=n(32),i=[].slice,a={},s=function(e,t,n){if(!(t in a)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";a[t]=Function("C,a","return new C("+r.join(",")+")")}return a[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=i.call(arguments,1),a=function(){var r=n.concat(i.call(arguments));return this instanceof a?s(t,r.length,r):t.apply(e,r)};return o(t.prototype)&&(a.prototype=t.prototype),a}},function(e,t,n){n(240);var r=n(22);e.exports=r.Object.assign},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,a,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){var r=n(60),o="["+n(126)+"]",i=RegExp("^"+o+o+"*"),a=RegExp(o+o+"*$"),s=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(i,"")),2&e&&(n=n.replace(a,"")),n}};e.exports={start:s(1),end:s(2),trim:s(3)}},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var r=n(52),o=n(41),i=n(82),a=n(48),s=function(e){return function(t,n,s,c){r(n);var u=o(t),l=i(u),f=a(u.length),p=e?f-1:0,d=e?-1:1;if(s<2)for(;;){if(p in l){c=l[p],p+=d;break}if(p+=d,e?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;e?p>=0:f>p;p+=d)p in l&&(c=n(c,l[p],p,u));return c}};e.exports={left:s(!1),right:s(!0)}},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){var r,o=n(535),i=n(406),a=n(536),s=n(537),c=n(538);"undefined"!=typeof ArrayBuffer&&(r=n(539));var u="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),l="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),f=u||l;t.protocol=3;var p=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},d=o(p),h={type:"error",data:"parser error"},v=n(540);function m(e,t,n){for(var r=new Array(e.length),o=s(e.length,n),i=function(e,n,o){t(n,(function(t,n){r[e]=n,o(t,r)}))},a=0;a<e.length;a++)i(a,e[a],o)}t.encodePacket=function(e,n,r,o){"function"==typeof n&&(o=n,n=!1),"function"==typeof r&&(o=r,r=null);var i=void 0===e.data?void 0:e.data.buffer||e.data;if("undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer)return function(e,n,r){if(!n)return t.encodeBase64Packet(e,r);var o=e.data,i=new Uint8Array(o),a=new Uint8Array(1+o.byteLength);a[0]=p[e.type];for(var s=0;s<i.length;s++)a[s+1]=i[s];return r(a.buffer)}(e,n,o);if(void 0!==v&&i instanceof v)return function(e,n,r){if(!n)return t.encodeBase64Packet(e,r);if(f)return function(e,n,r){if(!n)return t.encodeBase64Packet(e,r);var o=new FileReader;return o.onload=function(){t.encodePacket({type:e.type,data:o.result},n,!0,r)},o.readAsArrayBuffer(e.data)}(e,n,r);var o=new Uint8Array(1);o[0]=p[e.type];var i=new v([o.buffer,e.data]);return r(i)}(e,n,o);if(i&&i.base64)return function(e,n){var r="b"+t.packets[e.type]+e.data.data;return n(r)}(e,o);var a=p[e.type];return void 0!==e.data&&(a+=r?c.encode(String(e.data),{strict:!1}):String(e.data)),o(""+a)},t.encodeBase64Packet=function(e,n){var r,o="b"+t.packets[e.type];if(void 0!==v&&e.data instanceof v){var i=new FileReader;return i.onload=function(){var e=i.result.split(",")[1];n(o+e)},i.readAsDataURL(e.data)}try{r=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(t){for(var a=new Uint8Array(e.data),s=new Array(a.length),c=0;c<a.length;c++)s[c]=a[c];r=String.fromCharCode.apply(null,s)}return o+=btoa(r),n(o)},t.decodePacket=function(e,n,r){if(void 0===e)return h;if("string"==typeof e){if("b"===e.charAt(0))return t.decodeBase64Packet(e.substr(1),n);if(r&&!1===(e=function(e){try{e=c.decode(e,{strict:!1})}catch(e){return!1}return e}(e)))return h;var o=e.charAt(0);return Number(o)==o&&d[o]?e.length>1?{type:d[o],data:e.substring(1)}:{type:d[o]}:h}o=new Uint8Array(e)[0];var i=a(e,1);return v&&"blob"===n&&(i=new v([i])),{type:d[o],data:i}},t.decodeBase64Packet=function(e,t){var n=d[e.charAt(0)];if(!r)return{type:n,data:{base64:!0,data:e.substr(1)}};var o=r.decode(e.substr(1));return"blob"===t&&v&&(o=new v([o])),{type:n,data:o}},t.encodePayload=function(e,n,r){"function"==typeof n&&(r=n,n=null);var o=i(e);if(n&&o)return v&&!f?t.encodePayloadAsBlob(e,r):t.encodePayloadAsArrayBuffer(e,r);if(!e.length)return r("0:");m(e,(function(e,r){t.encodePacket(e,!!o&&n,!1,(function(e){r(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return r(t.join(""))}))},t.decodePayload=function(e,n,r){if("string"!=typeof e)return t.decodePayloadAsBinary(e,n,r);var o;if("function"==typeof n&&(r=n,n=null),""===e)return r(h,0,1);for(var i,a,s="",c=0,u=e.length;c<u;c++){var l=e.charAt(c);if(":"===l){if(""===s||s!=(i=Number(s)))return r(h,0,1);if(s!=(a=e.substr(c+1,i)).length)return r(h,0,1);if(a.length){if(o=t.decodePacket(a,n,!1),h.type===o.type&&h.data===o.data)return r(h,0,1);if(!1===r(o,c+i,u))return}c+=i,s=""}else s+=l}return""!==s?r(h,0,1):void 0},t.encodePayloadAsArrayBuffer=function(e,n){if(!e.length)return n(new ArrayBuffer(0));m(e,(function(e,n){t.encodePacket(e,!0,!0,(function(e){return n(null,e)}))}),(function(e,t){var r=t.reduce((function(e,t){var n;return e+(n="string"==typeof t?t.length:t.byteLength).toString().length+n+2}),0),o=new Uint8Array(r),i=0;return t.forEach((function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),a=0;a<e.length;a++)r[a]=e.charCodeAt(a);n=r.buffer}o[i++]=t?0:1;var s=n.byteLength.toString();for(a=0;a<s.length;a++)o[i++]=parseInt(s[a]);o[i++]=255;for(r=new Uint8Array(n),a=0;a<r.length;a++)o[i++]=r[a]})),n(o.buffer)}))},t.encodePayloadAsBlob=function(e,n){m(e,(function(e,n){t.encodePacket(e,!0,!0,(function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);e=r.buffer,t[0]=0}var i=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),a=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)a[o]=parseInt(i[o]);if(a[i.length]=255,v){var s=new v([t.buffer,a.buffer,e]);n(null,s)}}))}),(function(e,t){return n(new v(t))}))},t.decodePayloadAsBinary=function(e,n,r){"function"==typeof n&&(r=n,n=null);for(var o=e,i=[];o.byteLength>0;){for(var s=new Uint8Array(o),c=0===s[0],u="",l=1;255!==s[l];l++){if(u.length>310)return r(h,0,1);u+=s[l]}o=a(o,2+u.length),u=parseInt(u);var f=a(o,0,u);if(c)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(e){var p=new Uint8Array(f);f="";for(l=0;l<p.length;l++)f+=String.fromCharCode(p[l])}i.push(f),o=a(o,u)}var d=i.length;i.forEach((function(e,o){r(t.decodePacket(e,n,!0),o,d)}))}},function(e,t,n){var r;!function(o){"use strict";function i(e,t,n){var r,o=document.createElement("img");return o.onerror=function(r){return i.onerror(o,r,e,t,n)},o.onload=function(r){return i.onload(o,r,e,t,n)},"string"==typeof e?(i.fetchBlob(e,(function(t){t&&i.isInstanceOf("Blob",t)?(e=t,r=i.createObjectURL(e)):(r=e,n&&n.crossOrigin&&(o.crossOrigin=n.crossOrigin)),o.src=r}),n),o):i.isInstanceOf("Blob",e)||i.isInstanceOf("File",e)?(r=o._objectURL=i.createObjectURL(e))?(o.src=r,o):i.readFile(e,(function(e){var n=e.target;n&&n.result?o.src=n.result:t&&t(e)})):void 0}var a=o.createObjectURL&&o||o.URL&&URL.revokeObjectURL&&URL||o.webkitURL&&webkitURL;function s(e,t){!e._objectURL||t&&t.noRevoke||(i.revokeObjectURL(e._objectURL),delete e._objectURL)}i.fetchBlob=function(e,t){t()},i.isInstanceOf=function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},i.transform=function(e,t,n,r,o){n(e,o)},i.onerror=function(e,t,n,r,o){s(e,o),r&&r.call(e,t)},i.onload=function(e,t,n,r,o){s(e,o),r&&i.transform(e,o,r,n,{originalWidth:e.naturalWidth||e.width,originalHeight:e.naturalHeight||e.height})},i.createObjectURL=function(e){return!!a&&a.createObjectURL(e)},i.revokeObjectURL=function(e){return!!a&&a.revokeObjectURL(e)},i.readFile=function(e,t,n){if(o.FileReader){var r=new FileReader;if(r.onload=r.onerror=t,r[n=n||"readAsDataURL"])return r[n](e),r}return!1},void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}("undefined"!=typeof window&&window||this)},function(e,t,n){e.exports=n(491)},function(e,t,n){e.exports={id3Card:"onfido-sdk-ui-Overlay-id3Card",id1Card:"onfido-sdk-ui-Overlay-id1Card",rectangle:"onfido-sdk-ui-Overlay-rectangle",face:"onfido-sdk-ui-Overlay-face",isWithoutHole:"onfido-sdk-ui-Overlay-isWithoutHole"}},function(e,t,n){e.exports={bodyWrapper:"onfido-sdk-ui-CameraPermissions-Primer-bodyWrapper",instructions:"onfido-sdk-ui-CameraPermissions-Primer-instructions",image:"onfido-sdk-ui-CameraPermissions-Primer-image",reasons:"onfido-sdk-ui-CameraPermissions-Primer-reasons",reason:"onfido-sdk-ui-CameraPermissions-Primer-reason",graphic:"onfido-sdk-ui-CameraPermissions-Primer-graphic",allow:"onfido-sdk-ui-CameraPermissions-Primer-allow",actions:"onfido-sdk-ui-CameraPermissions-Primer-actions"}},function(e,t,n){e.exports={icon:"onfido-sdk-ui-crossDevice-MobileNotificationSent-icon",submessage:"onfido-sdk-ui-crossDevice-MobileNotificationSent-submessage",boldMessage:"onfido-sdk-ui-crossDevice-MobileNotificationSent-boldMessage",cancel:"onfido-sdk-ui-crossDevice-MobileNotificationSent-cancel"}},function(e,t,n){var r=n(134);e.exports=r},function(e,t,n){var r=n(9),o=n(30);r({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperty:n(39).f})},function(e,t,n){var r=n(179);e.exports=r},function(e,t,n){n(180);var r=n(22).Object,o=e.exports=function(e,t){return r.defineProperties(e,t)};r.defineProperties.sham&&(o.sham=!0)},function(e,t,n){var r=n(9),o=n(30);r({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperties:n(136)})},function(e,t,n){var r=n(182);e.exports=r},function(e,t,n){n(183);var r=n(22);e.exports=r.Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(9),o=n(30),i=n(184),a=n(37),s=n(67),c=n(84);r({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(e){for(var t,n,r=a(e),o=s.f,u=i(r),l={},f=0;u.length>f;)void 0!==(n=o(r,t=u[f++]))&&c(l,t,n);return l}})},function(e,t,n){var r=n(49),o=n(102),i=n(103),a=n(40);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(a(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){n(71);var r=n(193),o=n(78),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.forEach;return e===i||e instanceof Array&&t===i.forEach||a.hasOwnProperty(o(e))?r:t}},function(e,t,n){"use strict";var r=n(37),o=n(111),i=n(53),a=n(61),s=n(112),c=a.set,u=a.getterFor("Array Iterator");e.exports=s(Array,"Array",(function(e,t){c(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=u(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t,n){var r=n(31),o=n(161),i=r.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},function(e,t,n){var r=n(31),o=n(38);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){"use strict";var r=n(139).IteratorPrototype,o=n(63),i=n(59),a=n(54),s=n(53),c=function(){return this};e.exports=function(e,t,n){var u=t+" Iterator";return e.prototype=o(r,{next:i(1,n)}),a(e,u,!1,!0),s[u]=c,e}},function(e,t,n){"use strict";var r=n(106),o=n(78);e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},function(e,t,n){var r=n(32);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){var r=n(194);e.exports=r},function(e,t,n){n(195);var r=n(36);e.exports=r("Array").forEach},function(e,t,n){"use strict";var r=n(9),o=n(196);r({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},function(e,t,n){"use strict";var r=n(55).forEach,o=n(79),i=n(43),a=o("forEach"),s=i("forEach");e.exports=a&&s?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},function(e,t,n){var r=n(198);e.exports=r},function(e,t,n){n(199);var r=n(22).Object,o=e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)};r.getOwnPropertyDescriptor.sham&&(o.sham=!0)},function(e,t,n){var r=n(9),o=n(24),i=n(37),a=n(67).f,s=n(30),c=o((function(){a(1)}));r({target:"Object",stat:!0,forced:!s||c,sham:!s},{getOwnPropertyDescriptor:function(e,t){return a(i(e),t)}})},function(e,t,n){var r=n(201);e.exports=r},function(e,t,n){var r=n(202),o=Array.prototype;e.exports=function(e){var t=e.filter;return e===o||e instanceof Array&&t===o.filter?r:t}},function(e,t,n){n(203);var r=n(36);e.exports=r("Array").filter},function(e,t,n){"use strict";var r=n(9),o=n(55).filter,i=n(86),a=n(43),s=i("filter"),c=a("filter");r({target:"Array",proto:!0,forced:!s||!c},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(149);e.exports=r},function(e,t,n){var r=n(37),o=n(102).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){var r=n(150);e.exports=r},function(e,t,n){var r=n(9),o=n(41),i=n(69);r({target:"Object",stat:!0,forced:n(24)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},function(e,t,n){var r=n(134);e.exports=r},function(e,t,n){e.exports=n(324)},function(e,t,n){e.exports=n(211)},function(e,t,n){var r=n(212);e.exports=r},function(e,t,n){n(144),n(80),n(71);var r=n(107);e.exports=r.f("iterator")},function(e,t,n){var r=n(91),o=n(60),i=function(e){return function(t,n){var i,a,s=String(o(t)),c=r(n),u=s.length;return c<0||c>=u?e?"":void 0:(i=s.charCodeAt(c))<55296||i>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):i:e?s.slice(c,c+2):a-56320+(i-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,n){e.exports=n(215)},function(e,t,n){var r=n(216);n(232),n(233),n(234),n(235),n(236),e.exports=r},function(e,t,n){n(145),n(125),n(142),n(217),n(218),n(219),n(220),n(144),n(221),n(222),n(223),n(224),n(225),n(226),n(227),n(228),n(229),n(230),n(231);var r=n(22);e.exports=r.Symbol},function(e,t,n){n(25)("asyncIterator")},function(e,t){},function(e,t,n){n(25)("hasInstance")},function(e,t,n){n(25)("isConcatSpreadable")},function(e,t,n){n(25)("match")},function(e,t,n){n(25)("matchAll")},function(e,t,n){n(25)("replace")},function(e,t,n){n(25)("search")},function(e,t,n){n(25)("species")},function(e,t,n){n(25)("split")},function(e,t,n){n(25)("toPrimitive")},function(e,t,n){n(25)("toStringTag")},function(e,t,n){n(25)("unscopables")},function(e,t,n){n(54)(Math,"Math",!0)},function(e,t,n){var r=n(31);n(54)(r.JSON,"JSON",!0)},function(e,t,n){n(25)("asyncDispose")},function(e,t,n){n(25)("dispose")},function(e,t,n){n(25)("observable")},function(e,t,n){n(25)("patternMatch")},function(e,t,n){n(25)("replaceAll")},function(e,t,n){var r=n(238);e.exports=r},function(e,t,n){n(239);var r=n(22);e.exports=r.Reflect.construct},function(e,t,n){var r=n(9),o=n(49),i=n(52),a=n(40),s=n(32),c=n(63),u=n(163),l=n(24),f=o("Reflect","construct"),p=l((function(){function e(){}return!(f((function(){}),[],e)instanceof e)})),d=!l((function(){f((function(){}))})),h=p||d;r({target:"Reflect",stat:!0,forced:h,sham:h},{construct:function(e,t){i(e),a(t);var n=arguments.length<3?e:i(arguments[2]);if(d&&!p)return f(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(u.apply(e,r))}var o=n.prototype,l=c(s(o)?o:Object.prototype),h=Function.apply.call(e,l,t);return s(h)?h:l}})},function(e,t,n){var r=n(9),o=n(241);r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(e,t,n){"use strict";var r=n(30),o=n(24),i=n(69),a=n(103),s=n(90),c=n(41),u=n(82),l=Object.assign,f=Object.defineProperty;e.exports=!l||o((function(){if(r&&1!==l({b:1},l(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||"abcdefghijklmnopqrst"!=i(l({},t)).join("")}))?function(e,t){for(var n=c(e),o=arguments.length,l=1,f=a.f,p=s.f;o>l;)for(var d,h=u(arguments[l++]),v=f?i(h).concat(f(h)):i(h),m=v.length,y=0;m>y;)d=v[y++],r&&!p.call(h,d)||(n[d]=h[d]);return n}:l},function(e,t,n){e.exports=n(243)},function(e,t,n){var r=n(244);e.exports=r},function(e,t,n){n(245);var r=n(22).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){n(9)({target:"Object",stat:!0,sham:!n(30)},{create:n(63)})},function(e,t,n){var r=n(146);function o(t,n){return e.exports=o=r||function(e,t){return e.__proto__=t,e},o(t,n)}e.exports=o},function(e,t,n){var r=n(248);e.exports=r},function(e,t,n){n(249);var r=n(22);e.exports=r.Object.setPrototypeOf},function(e,t,n){n(9)({target:"Object",stat:!0},{setPrototypeOf:n(122)})},function(e,t,n){e.exports=n(251)},function(e,t,n){var r=n(252);e.exports=r},function(e,t,n){n(253);var r=n(22);e.exports=r.Object.getPrototypeOf},function(e,t,n){var r=n(9),o=n(24),i=n(41),a=n(96),s=n(140);r({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!s},{getPrototypeOf:function(e){return a(i(e))}})},function(e,t,n){var r=n(40);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(29),o=n(53),i=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},function(e,t,n){var r=n(257);e.exports=r},function(e,t,n){var r=n(258),o=Array.prototype;e.exports=function(e){var t=e.concat;return e===o||e instanceof Array&&t===o.concat?r:t}},function(e,t,n){n(145);var r=n(36);e.exports=r("Array").concat},function(e,t,n){e.exports=n(341)},function(e,t,n){e.exports=n(346)},function(e,t,n){var r=n(70),o=n(32),i=n(35),a=n(39).f,s=n(92),c=n(352),u=s("meta"),l=0,f=Object.isExtensible||function(){return!0},p=function(e){a(e,u,{value:{objectID:"O"+ ++l,weakData:{}}})},d=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,u)){if(!f(e))return"F";if(!t)return"E";p(e)}return e[u].objectID},getWeakData:function(e,t){if(!i(e,u)){if(!f(e))return!0;if(!t)return!1;p(e)}return e[u].weakData},onFreeze:function(e){return c&&d.REQUIRED&&f(e)&&!i(e,u)&&p(e),e}};r[u]=!0},function(e,t,n){var r=n(263);e.exports=r},function(e,t,n){var r=n(264),o=Array.prototype;e.exports=function(e){var t=e.reduce;return e===o||e instanceof Array&&t===o.reduce?r:t}},function(e,t,n){n(265);var r=n(36);e.exports=r("Array").reduce},function(e,t,n){"use strict";var r=n(9),o=n(168).left,i=n(79),a=n(43),s=i("reduce"),c=a("reduce",{1:0});r({target:"Array",proto:!0,forced:!s||!c},{reduce:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){"use strict";t.__esModule=!0;t.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(e,t,n){"use strict";t.__esModule=!0;t.addEventListener=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},t.getConfirmation=function(e,t){return t(window.confirm(e))},t.supportsHistory=function(){var e=window.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},t.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},t.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},t.isExtraneousPopstateEvent=function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")}},function(e,t,n){var r=n(269);e.exports=r},function(e,t,n){var r=n(270),o=Array.prototype;e.exports=function(e){var t=e.slice;return e===o||e instanceof Array&&t===o.slice?r:t}},function(e,t,n){n(271);var r=n(36);e.exports=r("Array").slice},function(e,t,n){"use strict";var r=n(9),o=n(32),i=n(72),a=n(121),s=n(48),c=n(37),u=n(84),l=n(29),f=n(86),p=n(43),d=f("slice"),h=p("slice",{ACCESSORS:!0,0:0,1:2}),v=l("species"),m=[].slice,y=Math.max;r({target:"Array",proto:!0,forced:!d||!h},{slice:function(e,t){var n,r,l,f=c(this),p=s(f.length),d=a(e,p),h=a(void 0===t?p:t,p);if(i(f)&&("function"!=typeof(n=f.constructor)||n!==Array&&!i(n.prototype)?o(n)&&null===(n=n[v])&&(n=void 0):n=void 0,n===Array||void 0===n))return m.call(f,d,h);for(r=new(void 0===n?Array:n)(y(h-d,0)),l=0;d<h;d++,l++)d in f&&u(r,l,f[d]);return r.length=l,r}})},function(e,t,n){"use strict";var r=n(52),o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},function(e,t,n){var r=n(274);e.exports=r},function(e,t,n){n(275);var r=n(22);e.exports=r.parseInt},function(e,t,n){var r=n(9),o=n(276);r({global:!0,forced:parseInt!=o},{parseInt:o})},function(e,t,n){var r=n(31),o=n(166).trim,i=n(126),a=r.parseInt,s=/^[+-]?0[Xx]/,c=8!==a(i+"08")||22!==a(i+"0x16");e.exports=c?function(e,t){var n=o(String(e));return a(n,t>>>0||(s.test(n)?16:10))}:a},function(e,t,n){"use strict";t.__esModule=!0;"function"==typeof Symbol&&Symbol.iterator;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=(l(n(113)),l(n(165))),i=n(128),a=n(108),s=l(n(152)),c=n(266),u=n(267);function l(e){return e&&e.__esModule?e:{default:e}}var f=function(){try{return window.history.state||{}}catch(e){return{}}};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c.canUseDOM||(0,o.default)(!1);var t=window.history,n=(0,u.supportsHistory)(),l=!(0,u.supportsPopStateOnHashChange)(),p=e.basename,d=void 0===p?"":p,h=e.forceRefresh,v=void 0!==h&&h,m=e.getUserConfirmation,y=void 0===m?u.getConfirmation:m,g=e.keyLength,b=void 0===g?6:g,_=function(e){var t=e||{},n=t.key,o=t.state,i=window.location,s=i.pathname+i.search+i.hash;return d&&(s=(0,a.stripPrefix)(s,d)),r({},(0,a.parsePath)(s),{state:o,key:n})},k=function(){return Math.random().toString(36).substr(2,b)},w=(0,s.default)(),S=function(e){r(q,e),q.length=t.length,w.notifyListeners(q.location,q.action)},O=function(e){(0,u.isExtraneousPopstateEvent)(e)||E(_(e.state))},C=function(){E(_(f()))},x=!1,E=function(e){x?(x=!1,S()):w.confirmTransitionTo(e,"POP",y,(function(t){t?S({action:"POP",location:e}):j(e)}))},j=function(e){var t=q.location,n=P.indexOf(t.key);-1===n&&(n=0);var r=P.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(x=!0,N(o))},A=_(f()),P=[A.key],T=function(e){return d+(0,a.createPath)(e)},D=function(e,r){var o=(0,i.createLocation)(e,r,k(),q.location);w.confirmTransitionTo(o,"PUSH",y,(function(e){if(e){var r=T(o),i=o.key,a=o.state;if(n)if(t.pushState({key:i,state:a},null,r),v)window.location.href=r;else{var s=P.indexOf(q.location.key),c=P.slice(0,-1===s?0:s+1);c.push(o.key),P=c,S({action:"PUSH",location:o})}else window.location.href=r}}))},I=function(e,r){var o=(0,i.createLocation)(e,r,k(),q.location);w.confirmTransitionTo(o,"REPLACE",y,(function(e){if(e){var r=T(o),i=o.key,a=o.state;if(n)if(t.replaceState({key:i,state:a},null,r),v)window.location.replace(r);else{var s=P.indexOf(q.location.key);-1!==s&&(P[s]=o.key),S({action:"REPLACE",location:o})}else window.location.replace(r)}}))},N=function(e){t.go(e)},R=function(){return N(-1)},M=function(){return N(1)},L=0,B=function(e){1===(L+=e)?((0,u.addEventListener)(window,"popstate",O),l&&(0,u.addEventListener)(window,"hashchange",C)):0===L&&((0,u.removeEventListener)(window,"popstate",O),l&&(0,u.removeEventListener)(window,"hashchange",C))},F=!1,U=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=w.setPrompt(e);return F||(B(1),F=!0),function(){return F&&(F=!1,B(-1)),t()}},z=function(e){var t=w.appendListener(e);return B(1),function(){return B(-1),t()}},q={length:t.length,action:"POP",location:A,createHref:T,push:D,replace:I,go:N,goBack:R,goForward:M,block:U,listen:z};return q}},function(e,t,n){e.exports=n(497)},function(e,t,n){e.exports=n(365)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r,o=n(66);!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(r||(r={}));var i=function(){function e(e){var t=this;this._state=r.PENDING,this._handlers=[],this._resolve=function(e){t._setResult(r.RESOLVED,e)},this._reject=function(e){t._setResult(r.REJECTED,e)},this._setResult=function(e,n){t._state===r.PENDING&&(Object(o.m)(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._attachHandler=function(e){t._handlers=t._handlers.concat(e),t._executeHandlers()},this._executeHandlers=function(){t._state!==r.PENDING&&(t._state===r.REJECTED?t._handlers.forEach((function(e){e.onrejected&&e.onrejected(t._value)})):t._handlers.forEach((function(e){e.onfulfilled&&e.onfulfilled(t._value)})),t._handlers=[])};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.prototype.toString=function(){return"[object SyncPromise]"},e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.all=function(t){return new e((function(n,r){if(Array.isArray(t))if(0!==t.length){var o=t.length,i=[];t.forEach((function(t,a){e.resolve(t).then((function(e){i[a]=e,0===(o-=1)&&n(i)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},e.prototype.then=function(t,n){var r=this;return new e((function(e,o){r._attachHandler({onfulfilled:function(n){if(t)try{return void e(t(n))}catch(e){return void o(e)}else e(n)},onrejected:function(t){if(n)try{return void e(n(t))}catch(e){return void o(e)}else o(t)}})}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e}()},function(e,t,n){e.exports={errorContainer:"onfido-sdk-ui-CameraError-errorContainer",errorContainerType:"onfido-sdk-ui-CameraError-errorContainerType",errorHasBackdrop:"onfido-sdk-ui-CameraError-errorHasBackdrop",errorMessage:"onfido-sdk-ui-CameraError-errorMessage"}},function(e,t,n){e.exports={qrCodeHelp:"onfido-sdk-ui-QRCode-qrCodeHelp",qrCodeHelpButton:"onfido-sdk-ui-QRCode-qrCodeHelpButton",qrCodeHelpIcon:"onfido-sdk-ui-QRCode-qrCodeHelpIcon",qrCodeHelpList:"onfido-sdk-ui-QRCode-qrCodeHelpList"}},function(e,t,n){e.exports={content:"onfido-sdk-ui-ProofOfAddress-PoAIntro-content",requirements:"onfido-sdk-ui-ProofOfAddress-PoAIntro-requirements",requirement:"onfido-sdk-ui-ProofOfAddress-PoAIntro-requirement",bolder:"onfido-sdk-ui-ProofOfAddress-PoAIntro-bolder"}},function(e,t,n){var r=n(315);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},function(e,t,n){var r=n(29)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},function(e,t,n){var r=n(325),o=Array.prototype;e.exports=function(e){var t=e.indexOf;return e===o||e instanceof Array&&t===o.indexOf?r:t}},function(e,t,n){"use strict";e.exports=n(337)},function(e,t,n){n(80),n(338);var r=n(22);e.exports=r.Array.from},function(e,t,n){var r=n(29)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n}},function(e,t,n){n(342);var r=n(22);e.exports=r.Array.isArray},function(e,t,n){e.exports=n(344)},function(e,t,n){"use strict";var r=n(9),o=n(31),i=n(261),a=n(24),s=n(38),c=n(127),u=n(167),l=n(32),f=n(54),p=n(39).f,d=n(55).forEach,h=n(30),v=n(61),m=v.set,y=v.getterFor;e.exports=function(e,t,n){var v,g=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),_=g?"set":"add",k=o[e],w=k&&k.prototype,S={};if(h&&"function"==typeof k&&(b||w.forEach&&!a((function(){(new k).entries().next()})))){v=t((function(t,n){m(u(t,v,e),{type:e,collection:new k}),null!=n&&c(n,t[_],t,g)}));var O=y(e);d(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in w)||b&&"clear"==e||s(v.prototype,e,(function(n,r){var o=O(this).collection;if(!t&&b&&!l(n))return"get"==e&&void 0;var i=o[e](0===n?0:n,r);return t?this:i}))})),b||p(v.prototype,"size",{configurable:!0,get:function(){return O(this).collection.size}})}else v=n.getConstructor(t,e,g,_),i.REQUIRED=!0;return f(v,e,!1,!0),S[e]=v,r({global:!0,forced:!0},S),b||n.setStrong(v,e,g),v}},function(e,t,n){"use strict";var r=n(39).f,o=n(63),i=n(294),a=n(77),s=n(167),c=n(127),u=n(112),l=n(295),f=n(30),p=n(261).fastKey,d=n(61),h=d.set,v=d.getterFor;e.exports={getConstructor:function(e,t,n,u){var l=e((function(e,r){s(e,l,t),h(e,{type:t,index:o(null),first:void 0,last:void 0,size:0}),f||(e.size=0),null!=r&&c(r,e[u],e,n)})),d=v(t),m=function(e,t,n){var r,o,i=d(e),a=y(e,t);return a?a.value=n:(i.last=a={index:o=p(t,!0),key:t,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=a),r&&(r.next=a),f?i.size++:e.size++,"F"!==o&&(i.index[o]=a)),e},y=function(e,t){var n,r=d(e),o=p(t);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==t)return n};return i(l.prototype,{clear:function(){for(var e=d(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,f?e.size=0:this.size=0},delete:function(e){var t=d(this),n=y(this,e);if(n){var r=n.next,o=n.previous;delete t.index[n.index],n.removed=!0,o&&(o.next=r),r&&(r.previous=o),t.first==n&&(t.first=r),t.last==n&&(t.last=o),f?t.size--:this.size--}return!!n},forEach:function(e){for(var t,n=d(this),r=a(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!y(this,e)}}),i(l.prototype,n?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),f&&r(l.prototype,"size",{get:function(){return d(this).size}}),l},setStrong:function(e,t,n){var r=t+" Iterator",o=v(t),i=v(r);u(e,t,(function(e,t){h(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),l(t)}}},function(e,t,n){var r=n(97);e.exports=function(e,t,n){for(var o in t)n&&n.unsafe&&e[o]?e[o]=t[o]:r(e,o,t[o],n);return e}},function(e,t,n){"use strict";var r=n(49),o=n(39),i=n(29),a=n(30),s=i("species");e.exports=function(e){var t=r(e),n=o.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=TypeError,o=Object.getOwnPropertyDescriptor;if(o)try{o({},"")}catch(e){o=null}var i=function(){throw new r},a=o?function(){try{return i}catch(e){try{return o(arguments,"callee").get}catch(e){return i}}}():i,s=n(510)(),c=Object.getPrototypeOf||function(e){return e.__proto__},u=void 0,l="undefined"==typeof Uint8Array?void 0:c(Uint8Array),f={"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":s?c([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":u&&s&&Symbol.asyncIterator?u[Symbol.asyncIterator]():void 0,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":s?c(c([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%JSONParse%":"object"==typeof JSON?JSON.parse:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&s?c((new Map)[Symbol.iterator]()):void 0,"%MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"%PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"%Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"%Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"%Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&s?c((new Set)[Symbol.iterator]()):void 0,"%SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":s?c(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":s?Symbol:void 0,"%SymbolPrototype%":s?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":a,"%TypedArray%":l,"%TypedArrayPrototype%":l?l.prototype:void 0,"%TypeError%":r,"%TypeErrorPrototype%":r.prototype,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"%WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype},p=n(353).call(Function.call,String.prototype.replace),d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,h=/\\(\\)?/g,v=function(e){var t=[];return p(e,d,(function(e,n,r,o){t[t.length]=r?p(o,h,"$1"):n||e})),t},m=function(e,t){if(!(e in f))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===f[e]&&!t)throw new r("intrinsic "+e+" exists, but is not available. Please file an issue!");return f[e]};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');for(var n=v(e),i=m("%"+(n.length>0?n[0]:"")+"%",t),a=1;a<n.length;a+=1)if(null!=i)if(o&&a+1>=n.length){var s=o(i,n[a]);if(!t&&!(n[a]in i))throw new r("base intrinsic for "+e+" exists, but the property is not available.");i=s?s.get||s.value:i[n[a]]}else i=i[n[a]];return i}},function(e,t){t.encode=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},t.decode=function(e){for(var t={},n=e.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}},function(e,t){e.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,n){"use strict";var r=n(287),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=d(n);o&&o!==h&&e(t,o,r)}var a=l(n);f&&(a=a.concat(f(n)));for(var s=c(t),v=c(n),m=0;m<a.length;++m){var y=a[m];if(!(i[y]||r&&r[y]||v&&v[y]||s&&s[y])){var g=p(n,y);try{u(t,y,g)}catch(e){}}}}return t}},function(e,t,n){e.exports=n(487)},function(e,t,n){e.exports=n(560)},function(e,t,n){e.exports=n(582)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(50),o=Object(r.f)(),i="Sentry Logger ",a=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Object(r.c)((function(){o.console.log(i+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Object(r.c)((function(){o.console.warn(i+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Object(r.c)((function(){o.console.error(i+"[Error]: "+e.join(" "))}))},e}();o.__SENTRY__=o.__SENTRY__||{};var s=o.__SENTRY__.logger||(o.__SENTRY__.logger=new a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var r=n(28),o=n(280),i=n(66),a=n(50),s=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._context={}}return e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,setTimeout((function(){e._scopeListeners.forEach((function(t){t(e)})),e._notifyingListeners=!1})))},e.prototype._notifyEventProcessors=function(e,t,n,a){var s=this;return void 0===a&&(a=0),new o.a((function(o,c){var u=e[a];if(null===t||"function"!=typeof u)o(t);else{var l=u(r.a({},t),n);Object(i.m)(l)?l.then((function(t){return s._notifyEventProcessors(e,t,n,a+1).then(o)})).then(null,c):s._notifyEventProcessors(e,l,n,a+1).then(o).then(null,c)}}))},e.prototype.setUser=function(e){return this._user=e||{},this._notifyScopeListeners(),this},e.prototype.setTags=function(e){return this._tags=r.a({},this._tags,e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=r.a({},this._tags,((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=r.a({},this._extra,e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=r.a({},this._extra,((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this._transaction=e,this._span&&(this._span.transaction=e),this._notifyScopeListeners(),this},e.prototype.setContext=function(e,t){var n;return this._context=r.a({},this._context,((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=r.d(t._breadcrumbs),n._tags=r.a({},t._tags),n._extra=r.a({},t._extra),n._context=r.a({},t._context),n._user=t._user,n._level=t._level,n._span=t._span,n._transaction=t._transaction,n._fingerprint=t._fingerprint,n._eventProcessors=r.d(t._eventProcessors)),n},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._context={},this._level=void 0,this._transaction=void 0,this._fingerprint=void 0,this._span=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n=r.a({timestamp:Object(a.j)()},e);return this._breadcrumbs=void 0!==t&&t>=0?r.d(this._breadcrumbs,[n]).slice(-t):r.d(this._breadcrumbs,[n]),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e.prototype.applyToEvent=function(e,t){return this._extra&&Object.keys(this._extra).length&&(e.extra=r.a({},this._extra,e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=r.a({},this._tags,e.tags)),this._user&&Object.keys(this._user).length&&(e.user=r.a({},this._user,e.user)),this._context&&Object.keys(this._context).length&&(e.contexts=r.a({},this._context,e.contexts)),this._level&&(e.level=this._level),this._transaction&&(e.transaction=this._transaction),this._span&&(e.contexts=r.a({trace:this._span.getTraceContext()},e.contexts)),this._applyFingerprint(e),e.breadcrumbs=r.d(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,this._notifyEventProcessors(r.d(c(),this._eventProcessors),e,t)},e}();function c(){var e=Object(a.f)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function u(e){c().push(e)}},function(e,t,n){e.exports=n(554)},function(e,t,n){e.exports={icon:"onfido-sdk-ui-crossDevice-MobileConnected-icon",cancel:"onfido-sdk-ui-crossDevice-MobileConnected-cancel"}},,function(e,t,n){var r=n(310);e.exports=r},function(e,t,n){var r=n(311),o=n(313),i=Array.prototype,a=String.prototype;e.exports=function(e){var t=e.includes;return e===i||e instanceof Array&&t===i.includes?r:"string"==typeof e||e===a||e instanceof String&&t===a.includes?o:t}},function(e,t,n){n(312);var r=n(36);e.exports=r("Array").includes},function(e,t,n){"use strict";var r=n(9),o=n(120).includes,i=n(111);r({target:"Array",proto:!0,forced:!n(43)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")},function(e,t,n){n(314);var r=n(36);e.exports=r("String").includes},function(e,t,n){"use strict";var r=n(9),o=n(284),i=n(60);r({target:"String",proto:!0,forced:!n(285)("includes")},{includes:function(e){return!!~String(i(this)).indexOf(o(e),arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(32),o=n(68),i=n(29)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(317);e.exports=r},function(e,t,n){var r=n(318),o=Array.prototype;e.exports=function(e){var t=e.find;return e===o||e instanceof Array&&t===o.find?r:t}},function(e,t,n){n(319);var r=n(36);e.exports=r("Array").find},function(e,t,n){"use strict";var r=n(9),o=n(55).find,i=n(111),a=n(43),s=!0,c=a("find");"find"in[]&&Array(1).find((function(){s=!1})),r({target:"Array",proto:!0,forced:s||!c},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("find")},function(e,t,n){var r=n(321);e.exports=r},function(e,t,n){var r=n(322),o=Array.prototype;e.exports=function(e){var t=e.map;return e===o||e instanceof Array&&t===o.map?r:t}},function(e,t,n){n(323);var r=n(36);e.exports=r("Array").map},function(e,t,n){"use strict";var r=n(9),o=n(55).map,i=n(86),a=n(43),s=i("map"),c=a("map");r({target:"Array",proto:!0,forced:!s||!c},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(286);e.exports=r},function(e,t,n){n(326);var r=n(36);e.exports=r("Array").indexOf},function(e,t,n){"use strict";var r=n(9),o=n(120).indexOf,i=n(79),a=n(43),s=[].indexOf,c=!!s&&1/[1].indexOf(1,-0)<0,u=i("indexOf"),l=a("indexOf",{ACCESSORS:!0,1:0});r({target:"Array",proto:!0,forced:c||!u||!l},{indexOf:function(e){return c?s.apply(this,arguments)||0:o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){e.exports=n(328)},function(e,t,n){var r=n(149);e.exports=r},function(e,t,n){var r=n(209),o=n(330);e.exports=function(e,t){if(null==e)return{};var n,i,a={},s=o(e);for(i=0;i<s.length;i++)n=s[i],r(t).call(t,n)>=0||(a[n]=e[n]);return a}},function(e,t,n){e.exports=n(331)},function(e,t,n){var r=n(150);e.exports=r},function(e,t,n){e.exports=n(333)},function(e,t,n){var r=n(164);e.exports=r},function(e,t,n){"use strict";var r=n(335);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var r=n(460),o=n(465),i=n(467),a=Function.prototype,s=Object.prototype,c=a.toString,u=s.hasOwnProperty,l=c.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==l}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,k=r?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case p:case a:case c:case s:case h:return e;default:switch(e=e&&e.$$typeof){case l:case d:case y:case m:case u:return e;default:return t}}case i:return t}}}function S(e){return w(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=u,t.Element=o,t.ForwardRef=d,t.Fragment=a,t.Lazy=y,t.Memo=m,t.Portal=i,t.Profiler=c,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return S(e)||w(e)===f},t.isConcurrentMode=S,t.isContextConsumer=function(e){return w(e)===l},t.isContextProvider=function(e){return w(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===y},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===c},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===c||e===s||e===h||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===u||e.$$typeof===l||e.$$typeof===d||e.$$typeof===b||e.$$typeof===_||e.$$typeof===k||e.$$typeof===g)},t.typeOf=w},function(e,t,n){var r=n(9),o=n(339);r({target:"Array",stat:!0,forced:!n(289)((function(e){Array.from(e)}))},{from:o})},function(e,t,n){"use strict";var r=n(77),o=n(41),i=n(254),a=n(255),s=n(48),c=n(84),u=n(151);e.exports=function(e){var t,n,l,f,p,d,h=o(e),v="function"==typeof this?this:Array,m=arguments.length,y=m>1?arguments[1]:void 0,g=void 0!==y,b=u(h),_=0;if(g&&(y=r(y,m>2?arguments[2]:void 0,2)),null==b||v==Array&&a(b))for(n=new v(t=s(h.length));t>_;_++)d=g?y(h[_],_):h[_],c(n,_,d);else for(p=(f=b.call(h)).next,n=new v;!(l=p.call(f)).done;_++)d=g?i(f,y,[l.value,_],!0):l.value,c(n,_,d);return n.length=_,n}},function(e,t,n){var r=n(259);e.exports=function(e){if(r(e))return e}},function(e,t,n){var r=n(290);e.exports=r},function(e,t,n){n(9)({target:"Array",stat:!0},{isArray:n(72)})},function(e,t,n){var r=n(291),o=n(260);e.exports=function(e,t){if(o(Object(e))||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],i=!0,a=!1,s=void 0;try{for(var c,u=r(e);!(i=(c=u.next()).done)&&(n.push(c.value),!t||n.length!==t);i=!0);}catch(e){a=!0,s=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}return n}}},function(e,t,n){n(71),n(80);var r=n(345);e.exports=r},function(e,t,n){var r=n(40),o=n(151);e.exports=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return r(t.call(e))}},function(e,t,n){n(71),n(80);var r=n(347);e.exports=r},function(e,t,n){var r=n(78),o=n(29),i=n(53),a=o("iterator");e.exports=function(e){var t=Object(e);return void 0!==t[a]||"@@iterator"in t||i.hasOwnProperty(r(t))}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){var r=n(350);e.exports=r},function(e,t,n){n(351),n(125),n(80),n(71);var r=n(22);e.exports=r.Set},function(e,t,n){"use strict";var r=n(292),o=n(293);e.exports=r("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),o)},function(e,t,n){var r=n(24);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(e,t,n){"use strict";var r=n(508);e.exports=Function.prototype.bind||r},function(e,t,n){var r=n(355);e.exports=r},function(e,t,n){n(356);var r=n(22);r.JSON||(r.JSON={stringify:JSON.stringify}),e.exports=function(e,t,n){return r.JSON.stringify.apply(null,arguments)}},function(e,t,n){var r=n(9),o=n(49),i=n(24),a=o("JSON","stringify"),s=/[\uD800-\uDFFF]/g,c=/^[\uD800-\uDBFF]$/,u=/^[\uDC00-\uDFFF]$/,l=function(e,t,n){var r=n.charAt(t-1),o=n.charAt(t+1);return c.test(e)&&!u.test(o)||u.test(e)&&!c.test(r)?"\\u"+e.charCodeAt(0).toString(16):e},f=i((function(){return'"\\udf06\\ud834"'!==a("\udf06\ud834")||'"\\udead"'!==a("\udead")}));a&&r({target:"JSON",stat:!0,forced:f},{stringify:function(e,t,n){var r=a.apply(null,arguments);return"string"==typeof r?r.replace(s,l):r}})},function(e,t,n){"use strict";function r(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}n.r(t),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],i=t&&t.split("/")||[],a=e&&r(e),s=t&&r(t),c=a||s;if(e&&r(e)?i=n:n.length&&(i.pop(),i=i.concat(n)),!i.length)return"/";var u=void 0;if(i.length){var l=i[i.length-1];u="."===l||".."===l||""===l}else u=!1;for(var f=0,p=i.length;p>=0;p--){var d=i[p];"."===d?o(i,p):".."===d?(o(i,p),f++):f&&(o(i,p),f--)}if(!c)for(;f--;f)i.unshift("..");!c||""===i[0]||i[0]&&r(i[0])||i.unshift("");var h=i.join("/");return u&&"/"!==h.substr(-1)&&(h+="/"),h}},function(e,t,n){"use strict";t.__esModule=!0;var r="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.default=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));var o=void 0===t?"undefined":r(t);if(o!==(void 0===n?"undefined":r(n)))return!1;if("object"===o){var i=t.valueOf(),a=n.valueOf();if(i!==t||a!==n)return e(i,a);var s=Object.keys(t),c=Object.keys(n);return s.length===c.length&&s.every((function(r){return e(t[r],n[r])}))}return!1}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=(l(n(113)),l(n(165))),i=n(128),a=n(108),s=l(n(152)),c=n(266),u=n(267);function l(e){return e&&e.__esModule?e:{default:e}}var f={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+(0,a.stripLeadingSlash)(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:a.stripLeadingSlash,decodePath:a.addLeadingSlash},slash:{encodePath:a.addLeadingSlash,decodePath:a.addLeadingSlash}},p=function(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)},d=function(e){return window.location.hash=e},h=function(e){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+e)};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c.canUseDOM||(0,o.default)(!1);var t=window.history,n=((0,u.supportsGoWithoutReloadUsingHash)(),e.basename),l=void 0===n?"":n,v=e.getUserConfirmation,m=void 0===v?u.getConfirmation:v,y=e.hashType,g=void 0===y?"slash":y,b=f[g],_=b.encodePath,k=b.decodePath,w=function(){var e=k(p());return l&&(e=(0,a.stripPrefix)(e,l)),(0,a.parsePath)(e)},S=(0,s.default)(),O=function(e){r(V,e),V.length=t.length,S.notifyListeners(V.location,V.action)},C=!1,x=null,E=function(){var e=p(),t=_(e);if(e!==t)h(t);else{var n=w(),r=V.location;if(!C&&(0,i.locationsAreEqual)(r,n))return;if(x===(0,a.createPath)(n))return;x=null,j(n)}},j=function(e){C?(C=!1,O()):S.confirmTransitionTo(e,"POP",m,(function(t){t?O({action:"POP",location:e}):A(e)}))},A=function(e){var t=V.location,n=I.lastIndexOf((0,a.createPath)(t));-1===n&&(n=0);var r=I.lastIndexOf((0,a.createPath)(e));-1===r&&(r=0);var o=n-r;o&&(C=!0,L(o))},P=p(),T=_(P);P!==T&&h(T);var D=w(),I=[(0,a.createPath)(D)],N=function(e){return"#"+_(l+(0,a.createPath)(e))},R=function(e,t){var n=(0,i.createLocation)(e,void 0,void 0,V.location);S.confirmTransitionTo(n,"PUSH",m,(function(e){if(e){var t=(0,a.createPath)(n),r=_(l+t);if(p()!==r){x=t,d(r);var o=I.lastIndexOf((0,a.createPath)(V.location)),i=I.slice(0,-1===o?0:o+1);i.push(t),I=i,O({action:"PUSH",location:n})}else O()}}))},M=function(e,t){var n=(0,i.createLocation)(e,void 0,void 0,V.location);S.confirmTransitionTo(n,"REPLACE",m,(function(e){if(e){var t=(0,a.createPath)(n),r=_(l+t);p()!==r&&(x=t,h(r));var o=I.indexOf((0,a.createPath)(V.location));-1!==o&&(I[o]=t),O({action:"REPLACE",location:n})}}))},L=function(e){t.go(e)},B=function(){return L(-1)},F=function(){return L(1)},U=0,z=function(e){1===(U+=e)?(0,u.addEventListener)(window,"hashchange",E):0===U&&(0,u.removeEventListener)(window,"hashchange",E)},q=!1,W=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=S.setPrompt(e);return q||(z(1),q=!0),function(){return q&&(q=!1,z(-1)),t()}},H=function(e){var t=S.appendListener(e);return z(1),function(){return z(-1),t()}},V={length:t.length,action:"POP",location:D,createHref:N,push:R,replace:M,go:L,goBack:B,goForward:F,block:W,listen:H};return V}},function(e,t,n){"use strict";t.__esModule=!0;"function"==typeof Symbol&&Symbol.iterator;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=(s(n(113)),n(108)),i=n(128),a=s(n(152));function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e,t,n){return Math.min(Math.max(e,t),n)};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getUserConfirmation,n=e.initialEntries,s=void 0===n?["/"]:n,u=e.initialIndex,l=void 0===u?0:u,f=e.keyLength,p=void 0===f?6:f,d=(0,a.default)(),h=function(e){r(E,e),E.length=E.entries.length,d.notifyListeners(E.location,E.action)},v=function(){return Math.random().toString(36).substr(2,p)},m=c(l,0,s.length-1),y=s.map((function(e,t){return"string"==typeof e?(0,i.createLocation)(e,void 0,t?v():void 0):(0,i.createLocation)(e,void 0,t?e.key||v():void 0)})),g=o.createPath,b=function(e,n){var r=(0,i.createLocation)(e,n,v(),E.location);d.confirmTransitionTo(r,"PUSH",t,(function(e){if(e){var t=E.index+1,n=E.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),h({action:"PUSH",location:r,index:t,entries:n})}}))},_=function(e,n){var r=(0,i.createLocation)(e,n,v(),E.location);d.confirmTransitionTo(r,"REPLACE",t,(function(e){e&&(E.entries[E.index]=r,h({action:"REPLACE",location:r}))}))},k=function(e){var n=c(E.index+e,0,E.entries.length-1),r=E.entries[n];d.confirmTransitionTo(r,"POP",t,(function(e){e?h({action:"POP",location:r,index:n}):h()}))},w=function(){return k(-1)},S=function(){return k(1)},O=function(e){var t=E.index+e;return t>=0&&t<E.entries.length},C=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return d.setPrompt(e)},x=function(e){return d.appendListener(e)},E={length:y.length,action:"POP",location:y[m],index:m,entries:y,createHref:g,push:b,replace:_,go:k,goBack:w,goForward:S,canGo:O,block:C,listen:x};return E}},function(e,t,n){var r=n(362);e.exports=r},function(e,t,n){n(363);var r=n(22);e.exports=r.Object.entries},function(e,t,n){var r=n(9),o=n(364).entries;r({target:"Object",stat:!0},{entries:function(e){return o(e)}})},function(e,t,n){var r=n(30),o=n(69),i=n(37),a=n(90).f,s=function(e){return function(t){for(var n,s=i(t),c=o(s),u=c.length,l=0,f=[];u>l;)n=c[l++],r&&!a.call(s,n)||f.push(e?[n,s[n]]:s[n]);return f}};e.exports={entries:s(!0),values:s(!1)}},function(e,t,n){var r=n(164);e.exports=r},function(e,t,n){var r=n(259);e.exports=function(e){if(r(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t,n){var r=n(368),o=n(260);e.exports=function(e){if(o(Object(e))||"[object Arguments]"===Object.prototype.toString.call(e))return r(e)}},function(e,t,n){e.exports=n(369)},function(e,t,n){var r=n(288);e.exports=r},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,n){var r=n(129)("socket.io-parser"),o=n(169),i=n(530),a=n(372),s=n(402);function c(){}t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=c,t.Decoder=f;var u=t.ERROR+'"encode error"';function l(e){var n=""+e.type;if(t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(n+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(n+=e.nsp+","),null!=e.id&&(n+=e.id),null!=e.data){var o=function(e){try{return JSON.stringify(e)}catch(e){return!1}}(e.data);if(!1===o)return u;n+=o}return r("encoded %j as %s",e,n),n}function f(){this.reconstructor=null}function p(e){this.reconPack=e,this.buffers=[]}function d(e){return{type:t.ERROR,data:"parser error: "+e}}c.prototype.encode=function(e,n){(r("encoding packet %j",e),t.BINARY_EVENT===e.type||t.BINARY_ACK===e.type)?function(e,t){i.removeBlobs(e,(function(e){var n=i.deconstructPacket(e),r=l(n.packet),o=n.buffers;o.unshift(r),t(o)}))}(e,n):n([l(e)])},o(f.prototype),f.prototype.add=function(e){var n;if("string"==typeof e)n=function(e){var n=0,o={type:Number(e.charAt(0))};if(null==t.types[o.type])return d("unknown packet type "+o.type);if(t.BINARY_EVENT===o.type||t.BINARY_ACK===o.type){for(var i="";"-"!==e.charAt(++n)&&(i+=e.charAt(n),n!=e.length););if(i!=Number(i)||"-"!==e.charAt(n))throw new Error("Illegal attachments");o.attachments=Number(i)}if("/"===e.charAt(n+1))for(o.nsp="";++n;){if(","===(c=e.charAt(n)))break;if(o.nsp+=c,n===e.length)break}else o.nsp="/";var s=e.charAt(n+1);if(""!==s&&Number(s)==s){for(o.id="";++n;){var c;if(null==(c=e.charAt(n))||Number(c)!=c){--n;break}if(o.id+=e.charAt(n),n===e.length)break}o.id=Number(o.id)}if(e.charAt(++n)){var u=function(e){try{return JSON.parse(e)}catch(e){return!1}}(e.substr(n));if(!(!1!==u&&(o.type===t.ERROR||a(u))))return d("invalid payload");o.data=u}return r("decoded %s as %j",e,o),o}(e),t.BINARY_EVENT===n.type||t.BINARY_ACK===n.type?(this.reconstructor=new p(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!s(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(n=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,this.emit("decoded",n))}},f.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=i.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(533);e.exports=function(e){var t=e.xdomain,n=e.xscheme,o=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||r))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!n&&o)return new XDomainRequest}catch(e){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},function(e,t,n){var r=n(170),o=n(169);function i(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=i,o(i.prototype),i.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(e){var t=r.decodePacket(e,this.socket.binaryType);this.onPacket(t)},i.prototype.onPacket=function(e){this.emit("packet",e)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(e,t,n){e.exports=n(546)},function(e,t,n){var r=n(562);function o(e,t,n,o,i,a,s){try{var c=e[a](s),u=c.value}catch(e){return void n(e)}c.done?t(u):r.resolve(u).then(o,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new r((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,c,"next",e)}function c(e){o(a,r,i,s,c,"throw",e)}s(void 0)}))}}},function(e,t,n){var r=n(415);n(567),n(568),n(569),n(570),e.exports=r},function(e,t,n){"use strict";var r=n(505),o=n(113),i=n(507),a=n(509),s=function(e){o(!1,e)},c=String.prototype.replace,u=String.prototype.split,l=function(e){var t=e%100,n=t%10;return 11!==t&&1===n?0:2<=n&&n<=4&&!(t>=12&&t<=14)?1:2},f={pluralTypes:{arabic:function(e){if(e<3)return e;var t=e%100;return t>=3&&t<=10?3:t>=11?4:5},bosnian_serbian:l,chinese:function(){return 0},croatian:l,french:function(e){return e>1?1:0},german:function(e){return 1!==e?1:0},russian:l,lithuanian:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?1:2},czech:function(e){return 1===e?0:e>=2&&e<=4?1:2},polish:function(e){if(1===e)return 0;var t=e%10;return 2<=t&&t<=4&&(e%100<10||e%100>=20)?1:2},icelandic:function(e){return e%10!=1||e%100==11?1:0},slovenian:function(e){var t=e%100;return 1===t?0:2===t?1:3===t||4===t?2:3}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is"],slovenian:["sl-SL"]}};function p(e,t){var n,o,i=(n=e.pluralTypeToLanguages,o={},r(n,(function(e,t){r(e,(function(e){o[e]=t}))})),o);return i[t]||i[u.call(t,/-/,1)[0]]||i.en}function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var h=/%\{(.*?)\}/g;function v(e,t,n,r,o){if("string"!=typeof e)throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(null==t)return e;var s=e,l=r||h,d=o||f,v="number"==typeof t?{smart_count:t}:t;if(null!=v.smart_count&&s){var m=u.call(s,"||||");s=a(m[function(e,t,n){return e.pluralTypes[p(e,t)](n)}(d,n||"en",v.smart_count)]||m[0])}return s=c.call(s,l,(function(e,t){return i(v,t)&&null!=v[t]?v[t]:e}))}function m(e){var t=e||{};this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en";var n=t.allowMissing?v:null;this.onMissingKey="function"==typeof t.onMissingKey?t.onMissingKey:n,this.warn=t.warn||s,this.tokenRegex=function(e){var t=e&&e.prefix||"%{",n=e&&e.suffix||"}";if("||||"===t||"||||"===n)throw new RangeError('"||||" token is reserved for pluralization');return new RegExp(d(t)+"(.*?)"+d(n),"g")}(t.interpolation),this.pluralRules=t.pluralRules||f}m.prototype.locale=function(e){return e&&(this.currentLocale=e),this.currentLocale},m.prototype.extend=function(e,t){r(e,(function(e,n){var r=t?t+"."+n:n;"object"==typeof e?this.extend(e,r):this.phrases[r]=e}),this)},m.prototype.unset=function(e,t){"string"==typeof e?delete this.phrases[e]:r(e,(function(e,n){var r=t?t+"."+n:n;"object"==typeof e?this.unset(e,r):delete this.phrases[r]}),this)},m.prototype.clear=function(){this.phrases={}},m.prototype.replace=function(e){this.clear(),this.extend(e)},m.prototype.t=function(e,t){var n,r,o=null==t?{}:t;if("string"==typeof this.phrases[e])n=this.phrases[e];else if("string"==typeof o._)n=o._;else if(this.onMissingKey){r=(0,this.onMissingKey)(e,o,this.currentLocale,this.tokenRegex,this.pluralRules)}else this.warn('Missing translation for key: "'+e+'"'),r=e;return"string"==typeof n&&(r=v(n,o,this.currentLocale,this.tokenRegex,this.pluralRules)),r},m.prototype.has=function(e){return i(this.phrases,e)},m.transformPhrase=function(e,t,n){return v(e,t,n)},e.exports=m},function(e,t,n){e.exports={container:"onfido-sdk-ui-CustomFileInput-container",input:"onfido-sdk-ui-CustomFileInput-input"}},function(e,t,n){e.exports={loader:"onfido-sdk-ui-Spinner-loader",inner:"onfido-sdk-ui-Spinner-inner","ball-scale-ripple-multiple":"onfido-sdk-ui-Spinner-ball-scale-ripple-multiple"}},function(e,t,n){e.exports={wrapper:"onfido-sdk-ui-Complete-wrapper",icon:"onfido-sdk-ui-Complete-icon"}},function(e,t,n){e.exports={icon:"onfido-sdk-ui-crossDevice-ClientSuccess-icon",text:"onfido-sdk-ui-crossDevice-ClientSuccess-text"}},,,,,function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(56),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default.shape({subscribe:i.default.func.isRequired,dispatch:i.default.func.isRequired,getState:i.default.func.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){"use strict";t.__esModule=!0,t.ActionTypes=void 0,t.default=function e(t,n,i){var s;"function"==typeof n&&void 0===i&&(i=n,n=void 0);if(void 0!==i){if("function"!=typeof i)throw new Error("Expected the enhancer to be a function.");return i(e)(t,n)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,u=n,l=[],f=l,p=!1;function d(){f===l&&(f=l.slice())}function h(){return u}function v(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return d(),f.push(e),function(){if(t){t=!1,d();var n=f.indexOf(e);f.splice(n,1)}}}function m(e){if(!(0,r.default)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,u=c(u,e)}finally{p=!1}for(var t=l=f,n=0;n<t.length;n++)t[n]();return e}return m({type:a.INIT}),(s={dispatch:m,subscribe:v,getState:h,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");c=e,m({type:a.INIT})}})[o.default]=function(){var e,t=v;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(h())}return n(),{unsubscribe:t(n)}}})[o.default]=function(){return this},e},s};var r=i(n(336)),o=i(n(468));function i(e){return e&&e.__esModule?e:{default:e}}var a=t.ActionTypes={INIT:"@@redux/INIT"}},function(e,t,n){var r=n(461).Symbol;e.exports=r},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return function(e){return e};var r=(o=t[t.length-1],i=t.slice(0,-1),{v:function(){return i.reduceRight((function(e,t){return t(e)}),o.apply(void 0,arguments))}});if("object"==typeof r)return r.v;var o,i}},function(e,t,n){"use strict";
/*!
* Adapted from jQuery UI core
*
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/function r(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n&&e.href||t)&&function(e){for(;e&&e!==document.body;){if((t=e).offsetWidth<=0&&t.offsetHeight<=0||"none"===t.style.display)return!1;e=e.parentNode}var t;return!0}(e)}e.exports=function(e){return[].slice.call(e.querySelectorAll("*"),0).filter((function(e){return function(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&r(e,!n)}(e)}))}},function(e,t,n){"use strict";var r="undefined"!=typeof document?document.body:null;function o(e){a(e),(e||r).setAttribute("aria-hidden","true")}function i(e){a(e),(e||r).removeAttribute("aria-hidden")}function a(e){if(!e&&!r)throw new Error("react-modal: You must set an element with `Modal.setAppElement(el)` to make this accessible")}t.toggle=function(e,t){e?o(t):i(t)},t.setElement=function(e){if("string"==typeof e){var t=document.querySelectorAll(e);e="length"in t?t[0]:t}return r=e||r},t.show=i,t.hide=o,t.resetForTesting=function(){r=document.body}},function(e,t,n){"use strict";var r=n(353),o=n(296)("%Function%"),i=o.apply,a=o.call;e.exports=function(){return r.apply(a,arguments)},e.exports.apply=function(){return r.apply(i,arguments)}},function(e,t,n){"use strict";var r=n(512),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,c=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),u=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===i.call(o)&&r())&&(c?s(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},l=function(e,t){var n=arguments.length>2?arguments[2]:{},i=r(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)u(e,i[s],t[i[s]],n[i[s]])};l.supportsDescriptors=!!c,e.exports=l},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}},function(e,t,n){"use strict";var r=n(514),o=n(515),i=n(516)("String.prototype.replace"),a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,s=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function(){var e=o(r(this));return i(i(e,a,""),s,"")}},function(e,t,n){"use strict";var r=n(398);e.exports=function(){return String.prototype.trim&&""==="".trim()?String.prototype.trim:r}},function(e,t,n){var r=n(9),o=n(31),i=n(148),a=[].slice,s=function(e){return function(t,n){var r=arguments.length>2,o=r?a.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,o)}:t,n)}};r({global:!0,bind:!0,forced:/MSIE .\./.test(i)},{setTimeout:s(o.setTimeout),setInterval:s(o.setInterval)})},function(e,t){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var t=e,o=e.indexOf("["),i=e.indexOf("]");-1!=o&&-1!=i&&(e=e.substring(0,o)+e.substring(o,i).replace(/:/g,";")+e.substring(i,e.length));for(var a=n.exec(e||""),s={},c=14;c--;)s[r[c]]=a[c]||"";return-1!=o&&-1!=i&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s}},function(e,t){e.exports=function(e){return n&&Buffer.isBuffer(e)||r&&(e instanceof ArrayBuffer||function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}(e))};var n="function"==typeof Buffer&&"function"==typeof Buffer.isBuffer,r="function"==typeof ArrayBuffer},function(e,t,n){var r=n(531),o=n(409),i=n(169),a=n(371),s=n(410),c=n(411),u=n(129)("socket.io-client:manager"),l=n(408),f=n(545),p=Object.prototype.hasOwnProperty;function d(e,t){if(!(this instanceof d))return new d(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=t.parser||a;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}e.exports=d,d.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)p.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},d.prototype.updateSocketIds=function(){for(var e in this.nsps)p.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},d.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},i(d.prototype),d.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},d.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},d.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},d.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},d.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},d.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},d.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},d.prototype.open=d.prototype.connect=function(e,t){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=r(this.uri,this.opts);var n=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var i=s(n,"open",(function(){o.onopen(),e&&e()})),a=s(n,"error",(function(t){if(u("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else o.maybeReconnectOnOpen()}));if(!1!==this._timeout){var c=this._timeout;u("connect attempt will timeout after %d",c);var l=setTimeout((function(){u("connect attempt timed out after %d",c),i.destroy(),n.close(),n.emit("error","timeout"),o.emitAll("connect_timeout",c)}),c);this.subs.push({destroy:function(){clearTimeout(l)}})}return this.subs.push(i),this.subs.push(a),this},d.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(s(e,"data",c(this,"ondata"))),this.subs.push(s(e,"ping",c(this,"onping"))),this.subs.push(s(e,"pong",c(this,"onpong"))),this.subs.push(s(e,"error",c(this,"onerror"))),this.subs.push(s(e,"close",c(this,"onclose"))),this.subs.push(s(this.decoder,"decoded",c(this,"ondecoded")))},d.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},d.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},d.prototype.ondata=function(e){this.decoder.add(e)},d.prototype.ondecoded=function(e){this.emit("packet",e)},d.prototype.onerror=function(e){u("error",e),this.emitAll("error",e)},d.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new o(this,e,t),this.nsps[e]=n;var r=this;n.on("connecting",i),n.on("connect",(function(){n.id=r.generateId(e)})),this.autoConnect&&i()}function i(){~l(r.connecting,n)||r.connecting.push(n)}return n},d.prototype.destroy=function(e){var t=l(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},d.prototype.packet=function(e){u("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()})))},d.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},d.prototype.cleanup=function(){u("cleanup");for(var e=this.subs.length,t=0;t<e;t++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},d.prototype.close=d.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},d.prototype.onclose=function(e){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},d.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();u("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout((function(){e.skipReconnect||(u("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(u("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(u("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(n)}})}},d.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},function(e,t,n){var r=n(373),o=n(534),i=n(541),a=n(542);t.polling=function(e){var t=!1,n=!1,a=!1!==e.jsonp;if("undefined"!=typeof location){var s="https:"===location.protocol,c=location.port;c||(c=s?443:80),t=e.hostname!==location.hostname||c!==e.port,n=e.secure!==s}if(e.xdomain=t,e.xscheme=n,"open"in new r(e)&&!e.forceJSONP)return new o(e);if(!a)throw new Error("JSONP disabled");return new i(e)},t.websocket=a},function(e,t,n){var r=n(374),o=n(297),i=n(170),a=n(298),s=n(407),c=n(129)("engine.io-client:polling");e.exports=l;var u=null!=new(n(373))({xdomain:!1}).responseType;function l(e){var t=e&&e.forceBase64;u&&!t||(this.supportsBinary=!1),r.call(this,e)}a(l,r),l.prototype.name="polling",l.prototype.doOpen=function(){this.poll()},l.prototype.pause=function(e){var t=this;function n(){c("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(c("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){c("pre-pause polling complete"),--r||n()}))),this.writable||(c("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){c("pre-pause writing complete"),--r||n()})))}else n()},l.prototype.poll=function(){c("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},l.prototype.onData=function(e){var t=this;c("polling got data %s",e);i.decodePayload(e,this.socket.binaryType,(function(e,n,r){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():c('ignoring poll - transport state "%s"',this.readyState))},l.prototype.doClose=function(){var e=this;function t(){c("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(c("transport open - closing"),t()):(c("transport not open - deferring close"),this.once("open",t))},l.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};i.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},l.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=s()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e}},function(e,t,n){var r=n(372),o=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),a="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);e.exports=function e(t){if(!t||"object"!=typeof t)return!1;if(r(t)){for(var n=0,o=t.length;n<o;n++)if(e(t[n]))return!0;return!1}if("function"==typeof Buffer&&Buffer.isBuffer&&Buffer.isBuffer(t)||"function"==typeof ArrayBuffer&&t instanceof ArrayBuffer||i&&t instanceof Blob||a&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return!0;return!1}},function(e,t,n){"use strict";var r,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i={},a=0,s=0;function c(e){var t="";do{t=o[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function u(){var e=c(+new Date);return e!==r?(a=0,r=e):e+"."+c(a++)}for(;s<64;s++)i[o[s]]=s;u.encode=c,u.decode=function(e){var t=0;for(s=0;s<e.length;s++)t=64*t+i[e.charAt(s)];return t},e.exports=u},function(e,t){var n=[].indexOf;e.exports=function(e,t){if(n)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}},function(e,t,n){var r=n(371),o=n(169),i=n(544),a=n(410),s=n(411),c=n(129)("socket.io-client:socket"),u=n(297),l=n(406);e.exports=d;var f={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=o.prototype.emit;function d(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}o(d.prototype),d.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[a(e,"open",s(this,"onopen")),a(e,"packet",s(this,"onpacket")),a(e,"close",s(this,"onclose"))]}},d.prototype.open=d.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},d.prototype.send=function(){var e=i(arguments);return e.unshift("message"),this.emit.apply(this,e),this},d.prototype.emit=function(e){if(f.hasOwnProperty(e))return p.apply(this,arguments),this;var t=i(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:l(t))?r.BINARY_EVENT:r.EVENT,data:t,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},d.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},d.prototype.onopen=function(){if(c("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?u.encode(this.query):this.query;c("sending connect packet with query %s",e),this.packet({type:r.CONNECT,query:e})}else this.packet({type:r.CONNECT})},d.prototype.onclose=function(e){c("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},d.prototype.onpacket=function(e){var t=e.nsp===this.nsp,n=e.type===r.ERROR&&"/"===e.nsp;if(t||n)switch(e.type){case r.CONNECT:this.onconnect();break;case r.EVENT:case r.BINARY_EVENT:this.onevent(e);break;case r.ACK:case r.BINARY_ACK:this.onack(e);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",e.data)}},d.prototype.onevent=function(e){var t=e.data||[];c("emitting event %j",t),null!=e.id&&(c("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?p.apply(this,t):this.receiveBuffer.push(t)},d.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var o=i(arguments);c("sending ack %j",o),t.packet({type:l(o)?r.BINARY_ACK:r.ACK,id:e,data:o})}}},d.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(c("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):c("bad ack %s",e.id)},d.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},d.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)p.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},d.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},d.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},d.prototype.close=d.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},d.prototype.compress=function(e){return this.flags.compress=e,this},d.prototype.binary=function(e){return this.flags.binary=e,this}},function(e,t){e.exports=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}},function(e,t){var n=[].slice;e.exports=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var r,o,i;!function(a){"use strict";o=[n(171)],void 0===(i="function"==typeof(r=function(e){var t="undefined"!=typeof Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);e.blobSlice=t&&function(){var e=this.slice||this.webkitSlice||this.mozSlice;return e.apply(this,arguments)},e.metaDataParsers={jpeg:{65505:[],65517:[]}},e.parseMetaData=function(t,n,r,o){o=o||{};var i=this,a=(r=r||{}).maxMetaDataSize||262144;!!("undefined"!=typeof DataView&&t&&t.size>=12&&"image/jpeg"===t.type&&e.blobSlice)&&e.readFile(e.blobSlice.call(t,0,a),(function(t){if(t.target.error)return console.log(t.target.error),void n(o);var a,s,c,u,l=t.target.result,f=new DataView(l),p=2,d=f.byteLength-4,h=p;if(65496===f.getUint16(0)){for(;p<d&&((a=f.getUint16(p))>=65504&&a<=65519||65534===a);){if(p+(s=f.getUint16(p+2)+2)>f.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(c=e.metaDataParsers.jpeg[a])for(u=0;u<c.length;u+=1)c[u].call(i,f,p,s,o,r);h=p+=s}!r.disableImageHead&&h>6&&(l.slice?o.imageHead=l.slice(0,h):o.imageHead=new Uint8Array(l).subarray(0,h))}else console.log("Invalid JPEG file: Missing JPEG marker.");n(o)}),"readAsArrayBuffer")||n(o)},e.hasMetaOption=function(e){return e&&e.meta};var n=e.transform;e.transform=function(t,r,o,i,a){e.hasMetaOption(r)?e.parseMetaData(i,(function(a){n.call(e,t,r,o,i,a)}),r,a):n.apply(e,arguments)}})?r.apply(t,o):r)||(e.exports=i)}()},function(e,t,n){!function(t){var n=-1,r={onVisible:function(e){var t=r.isSupported();if(!t||!r.hidden())return e(),t;var n=r.change((function(t,o){r.hidden()||(r.unbind(n),e())}));return n},change:function(e){if(!r.isSupported())return!1;var t=n+=1;return r._callbacks[t]=e,r._listen(),t},unbind:function(e){delete r._callbacks[e]},afterPrerendering:function(e){var t=r.isSupported();if(!t||"prerender"!=r.state())return e(),t;var n=r.change((function(t,o){"prerender"!=o&&(r.unbind(n),e())}));return n},hidden:function(){return!(!r._doc.hidden&&!r._doc.webkitHidden)},state:function(){return r._doc.visibilityState||r._doc.webkitVisibilityState||"visible"},isSupported:function(){return!(!r._doc.visibilityState&&!r._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(e){var t=r.state();for(var n in r._callbacks)r._callbacks[n].call(r._doc,e,t)},_listen:function(){if(!r._init){var e="visibilitychange";r._doc.webkitVisibilityState&&(e="webkit"+e);var t=function(){r._change.apply(r,arguments)};r._doc.addEventListener?r._doc.addEventListener(e,t):r._doc.attachEvent(e,t),r._init=!0}}};e.exports?e.exports=r:t.Visibility=r}(this)},function(e,t,n){n(125),n(80),n(71),n(563),n(421),n(566);var r=n(22);e.exports=r.Promise},function(e,t,n){var r=n(31);e.exports=r.Promise},function(e,t,n){var r=n(40),o=n(52),i=n(29)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r,o,i,a=n(31),s=n(24),c=n(68),u=n(77),l=n(162),f=n(119),p=n(419),d=a.location,h=a.setImmediate,v=a.clearImmediate,m=a.process,y=a.MessageChannel,g=a.Dispatch,b=0,_={},k=function(e){if(_.hasOwnProperty(e)){var t=_[e];delete _[e],t()}},w=function(e){return function(){k(e)}},S=function(e){k(e.data)},O=function(e){a.postMessage(e+"",d.protocol+"//"+d.host)};h&&v||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return _[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(b),b},v=function(e){delete _[e]},"process"==c(m)?r=function(e){m.nextTick(w(e))}:g&&g.now?r=function(e){g.now(w(e))}:y&&!p?(i=(o=new y).port2,o.port1.onmessage=S,r=u(i.postMessage,i,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(O)?r="onreadystatechange"in f("script")?function(e){l.appendChild(f("script")).onreadystatechange=function(){l.removeChild(this),k(e)}}:function(e){setTimeout(w(e),0)}:(r=O,a.addEventListener("message",S,!1))),e.exports={set:h,clear:v}},function(e,t,n){var r=n(148);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(e,t,n){var r=n(40),o=n(32),i=n(272);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(9),o=n(52),i=n(272),a=n(299),s=n(127);r({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=i.f(t),r=n.resolve,c=n.reject,u=a((function(){var n=o(t.resolve),i=[],a=0,c=1;s(e,(function(e){var o=a++,s=!1;i.push(void 0),c++,n.call(t,e).then((function(e){s||(s=!0,i[o]={status:"fulfilled",value:e},--c||r(i))}),(function(e){s||(s=!0,i[o]={status:"rejected",reason:e},--c||r(i))}))})),--c||r(i)}));return u.error&&c(u.value),n.promise}})},function(e,t,n){e.exports={loading:"onfido-sdk-ui-PhoneNumberInput-loading",mobileInput:"onfido-sdk-ui-PhoneNumberInput-mobileInput",phoneNumberContainer:"onfido-sdk-ui-PhoneNumberInput-phoneNumberContainer",flagIcon:"onfido-sdk-ui-PhoneNumberInput-flagIcon"}},function(e,t){e.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}},function(e,t){e.exports={L:1,M:0,Q:3,H:2}},function(e,t,n){var r=n(426);function o(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var n=0;n<e.length&&0==e[n];)n++;this.num=new Array(e.length-n+t);for(var r=0;r<e.length-n;r++)this.num[r]=e[r+n]}o.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),n=0;n<this.getLength();n++)for(var i=0;i<e.getLength();i++)t[n+i]^=r.gexp(r.glog(this.get(n))+r.glog(e.get(i)));return new o(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=r.glog(this.get(0))-r.glog(e.get(0)),n=new Array(this.getLength()),i=0;i<this.getLength();i++)n[i]=this.get(i);for(i=0;i<e.getLength();i++)n[i]^=r.gexp(r.glog(e.get(i))+t);return new o(n,0).mod(e)}},e.exports=o},function(e,t){for(var n={glog:function(e){if(e<1)throw new Error("glog("+e+")");return n.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return n.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},r=0;r<8;r++)n.EXP_TABLE[r]=1<<r;for(r=8;r<256;r++)n.EXP_TABLE[r]=n.EXP_TABLE[r-4]^n.EXP_TABLE[r-5]^n.EXP_TABLE[r-6]^n.EXP_TABLE[r-8];for(r=0;r<255;r++)n.LOG_TABLE[n.EXP_TABLE[r]]=r;e.exports=n},function(e,t,n){var r;
/*!
* EventEmitter2
* https://github.com/hij1nx/EventEmitter2
*
* Copyright (c) 2013 hij1nx
* Licensed under the MIT license.
*/!function(o){var i=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(){this._events={},this._conf&&s.call(this,this._conf)}function s(e){e?(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),this._events.maxListeners=void 0!==e.maxListeners?e.maxListeners:10,e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this.newListener=e.newListener),this.wildcard&&(this.listenerTree={})):this._events.maxListeners=10}function c(e){console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",e),console.trace&&console.trace()}function u(e){this._events={},this.newListener=!1,s.call(this,e)}function l(e,t,n,r){if(!n)return[];var o,i,a,s,c,u,f,p=[],d=t.length,h=t[r],v=t[r+1];if(r===d&&n._listeners){if("function"==typeof n._listeners)return e&&e.push(n._listeners),[n];for(o=0,i=n._listeners.length;o<i;o++)e&&e.push(n._listeners[o]);return[n]}if("*"===h||"**"===h||n[h]){if("*"===h){for(a in n)"_listeners"!==a&&n.hasOwnProperty(a)&&(p=p.concat(l(e,t,n[a],r+1)));return p}if("**"===h){for(a in(f=r+1===d||r+2===d&&"*"===v)&&n._listeners&&(p=p.concat(l(e,t,n,d))),n)"_listeners"!==a&&n.hasOwnProperty(a)&&("*"===a||"**"===a?(n[a]._listeners&&!f&&(p=p.concat(l(e,t,n[a],d))),p=p.concat(l(e,t,n[a],r))):p=a===v?p.concat(l(e,t,n[a],r+2)):p.concat(l(e,t,n[a],r)));return p}p=p.concat(l(e,t,n[h],r+1))}if((s=n["*"])&&l(e,t,s,r+1),c=n["**"])if(r<d)for(a in c._listeners&&l(e,t,c,d),c)"_listeners"!==a&&c.hasOwnProperty(a)&&(a===v?l(e,t,c[a],r+2):a===h?l(e,t,c[a],r+1):((u={})[a]=c[a],l(e,t,{"**":u},r+1)));else c._listeners?l(e,t,c,d):c["*"]&&c["*"]._listeners&&l(e,t,c["*"],d);return p}function f(e,t){for(var n=0,r=(e="string"==typeof e?e.split(this.delimiter):e.slice()).length;n+1<r;n++)if("**"===e[n]&&"**"===e[n+1])return;for(var o=this.listenerTree,i=e.shift();void 0!==i;){if(o[i]||(o[i]={}),o=o[i],0===e.length)return o._listeners?("function"==typeof o._listeners&&(o._listeners=[o._listeners]),o._listeners.push(t),!o._listeners.warned&&this._events.maxListeners>0&&o._listeners.length>this._events.maxListeners&&(o._listeners.warned=!0,c(o._listeners.length))):o._listeners=t,!0;i=e.shift()}return!0}u.EventEmitter2=u,u.prototype.delimiter=".",u.prototype.setMaxListeners=function(e){void 0!==e&&(this._events||a.call(this),this._events.maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},u.prototype.event="",u.prototype.once=function(e,t){return this.many(e,1,t),this},u.prototype.many=function(e,t,n){var r=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");function o(){0==--t&&r.off(e,o),n.apply(this,arguments)}return o._origin=n,this.on(e,o),r},u.prototype.emit=function(){this._events||a.call(this);var e=arguments[0];if("newListener"===e&&!this.newListener&&!this._events.newListener)return!1;var t,n,r,o,i,s=arguments.length;if(this._all&&this._all.length){if(i=this._all.slice(),s>3)for(t=new Array(s),o=0;o<s;o++)t[o]=arguments[o];for(r=0,n=i.length;r<n;r++)switch(this.event=e,s){case 1:i[r].call(this,e);break;case 2:i[r].call(this,e,arguments[1]);break;case 3:i[r].call(this,e,arguments[1],arguments[2]);break;default:i[r].apply(this,t)}}if(this.wildcard){i=[];var c="string"==typeof e?e.split(this.delimiter):e.slice();l.call(this,i,c,this.listenerTree,0)}else{if("function"==typeof(i=this._events[e])){switch(this.event=e,s){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:for(t=new Array(s-1),o=1;o<s;o++)t[o-1]=arguments[o];i.apply(this,t)}return!0}i&&(i=i.slice())}if(i&&i.length){if(s>3)for(t=new Array(s-1),o=1;o<s;o++)t[o-1]=arguments[o];for(r=0,n=i.length;r<n;r++)switch(this.event=e,s){case 1:i[r].call(this);break;case 2:i[r].call(this,arguments[1]);break;case 3:i[r].call(this,arguments[1],arguments[2]);break;default:i[r].apply(this,t)}return!0}if(!this._all&&"error"===e)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},u.prototype.emitAsync=function(){this._events||a.call(this);var e=arguments[0];if("newListener"===e&&!this.newListener&&!this._events.newListener)return Promise.resolve([!1]);var t,n,r,o,i,s=[],c=arguments.length;if(this._all){if(c>3)for(t=new Array(c),o=1;o<c;o++)t[o]=arguments[o];for(r=0,n=this._all.length;r<n;r++)switch(this.event=e,c){case 1:s.push(this._all[r].call(this,e));break;case 2:s.push(this._all[r].call(this,e,arguments[1]));break;case 3:s.push(this._all[r].call(this,e,arguments[1],arguments[2]));break;default:s.push(this._all[r].apply(this,t))}}if(this.wildcard){i=[];var u="string"==typeof e?e.split(this.delimiter):e.slice();l.call(this,i,u,this.listenerTree,0)}else i=this._events[e];if("function"==typeof i)switch(this.event=e,c){case 1:s.push(i.call(this));break;case 2:s.push(i.call(this,arguments[1]));break;case 3:s.push(i.call(this,arguments[1],arguments[2]));break;default:for(t=new Array(c-1),o=1;o<c;o++)t[o-1]=arguments[o];s.push(i.apply(this,t))}else if(i&&i.length){if(c>3)for(t=new Array(c-1),o=1;o<c;o++)t[o-1]=arguments[o];for(r=0,n=i.length;r<n;r++)switch(this.event=e,c){case 1:s.push(i[r].call(this));break;case 2:s.push(i[r].call(this,arguments[1]));break;case 3:s.push(i[r].call(this,arguments[1],arguments[2]));break;default:s.push(i[r].apply(this,t))}}else if(!this._all&&"error"===e)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(s)},u.prototype.on=function(e,t){if("function"==typeof e)return this.onAny(e),this;if("function"!=typeof t)throw new Error("on only accepts instances of Function");return this._events||a.call(this),this.emit("newListener",e,t),this.wildcard?(f.call(this,e,t),this):(this._events[e]?("function"==typeof this._events[e]&&(this._events[e]=[this._events[e]]),this._events[e].push(t),!this._events[e].warned&&this._events.maxListeners>0&&this._events[e].length>this._events.maxListeners&&(this._events[e].warned=!0,c(this._events[e].length))):this._events[e]=t,this)},u.prototype.onAny=function(e){if("function"!=typeof e)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(e),this},u.prototype.addListener=u.prototype.on,u.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var n,r=[];if(this.wildcard){var o="string"==typeof e?e.split(this.delimiter):e.slice();r=l.call(this,null,o,this.listenerTree,0)}else{if(!this._events[e])return this;n=this._events[e],r.push({_listeners:n})}for(var a=0;a<r.length;a++){var s=r[a];if(n=s._listeners,i(n)){for(var c=-1,u=0,f=n.length;u<f;u++)if(n[u]===t||n[u].listener&&n[u].listener===t||n[u]._origin&&n[u]._origin===t){c=u;break}if(c<0)continue;return this.wildcard?s._listeners.splice(c,1):this._events[e].splice(c,1),0===n.length&&(this.wildcard?delete s._listeners:delete this._events[e]),this.emit("removeListener",e,t),this}(n===t||n.listener&&n.listener===t||n._origin&&n._origin===t)&&(this.wildcard?delete s._listeners:delete this._events[e],this.emit("removeListener",e,t))}return function e(t){if(void 0!==t){var n=Object.keys(t);for(var r in n){var o=n[r],i=t[o];i instanceof Function||"object"!=typeof i||null===i||(Object.keys(i).length>0&&e(t[o]),0===Object.keys(i).length&&delete t[o])}}}(this.listenerTree),this},u.prototype.offAny=function(e){var t,n=0,r=0;if(e&&this._all&&this._all.length>0){for(n=0,r=(t=this._all).length;n<r;n++)if(e===t[n])return t.splice(n,1),this.emit("removeListenerAny",e),this}else{for(n=0,r=(t=this._all).length;n<r;n++)this.emit("removeListenerAny",t[n]);this._all=[]}return this},u.prototype.removeListener=u.prototype.off,u.prototype.removeAllListeners=function(e){if(0===arguments.length)return!this._events||a.call(this),this;if(this.wildcard)for(var t="string"==typeof e?e.split(this.delimiter):e.slice(),n=l.call(this,null,t,this.listenerTree,0),r=0;r<n.length;r++){var o=n[r];o._listeners=null}else this._events&&(this._events[e]=null);return this},u.prototype.listeners=function(e){if(this.wildcard){var t=[],n="string"==typeof e?e.split(this.delimiter):e.slice();return l.call(this,t,n,this.listenerTree,0),t}return this._events||a.call(this),this._events[e]||(this._events[e]=[]),i(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},u.prototype.listenerCount=function(e){return this.listeners(e).length},u.prototype.listenersAny=function(){return this._all?this._all:[]},void 0===(r=function(){return u}.call(t,n,t,e))||(e.exports=r)}()},function(e,t,n){"use strict";e.exports=n(473)},function(e,t,n){e.exports=n(479)},function(e,t,n){e.exports=n(482)},function(e,t,n){e.exports=n(492)},function(e,t){e.exports=function(e,t){t||(t=[0,""]),e=String(e);var n=parseFloat(e,10);return t[0]=n,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},function(e,t){e.exports=function(e){if("function"!=typeof Promise){var t=new Error("Device enumeration not supported.");if(t.kind="METHOD_NOT_AVAILABLE",e)return console.warn("module now uses promise based api - callback is deprecated"),e(t);throw t}return new Promise((function(t,n){var r=function(n){for(var r=[],o=0;o<n.length;o++){var i=n[o],a=i.kind||null;a&&"audio"===a.toLowerCase()?a="audioinput":a&&"video"===a.toLowerCase()&&(a="videoinput"),r.push({facing:i.facing||null,deviceId:i.id||i.deviceId||null,label:i.label||null,kind:a,groupId:i.groupId||null})}t(r),e&&(console.warn("module now uses promise based api - callback is deprecated"),e(null,r))};if(window.navigator&&window.navigator.mediaDevices&&window.navigator.mediaDevices.enumerateDevices)window.navigator.mediaDevices.enumerateDevices().then(r);else if(window.MediaStreamTrack&&window.MediaStreamTrack.getSources)window.MediaStreamTrack.getSources(r);else{var o=new Error("Device enumeration not supported.");o.kind="METHOD_NOT_AVAILABLE",n(o),e&&(console.warn("module now uses promise based api - callback is deprecated"),e(o))}}))}},function(e,t,n){e.exports=n(501)},function(e){e.exports=JSON.parse('{"accessibility":{"camera_view":"View from camera","close_sdk_screen":"Close identity verification screen","country_select":"Select country","cross_device_verification":"Steps required to continue verification on your mobile","dismiss_alert":"Dismiss alert","document_types":"Documents you can use to verify your identity","replay_video":"Replay your recorded video","selfie_video_actions":"Actions to record a selfie video","shutter":"Take a photo","start_recording":"Start recording","stop_recording":"Stop recording"},"back":"back","bank_building_society_statement":"Bank or building society statement","benefit_letters":"Benefits Letter","cancel":"Cancel","capture":{"bank_building_society_statement":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 3 months</strong>","title":"Submit statement","webcam":"Position your bank statement in the frame (it will be automatically detected)"}},"benefit_letters":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Submit letter","webcam":"Position your benefits letter in the frame (it will be automatically detected)"}},"council_tax":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Submit letter","webcam":"Position your council tax letter in the frame (it will be automatically detected)"}},"driving_licence":{"back":{"instructions":"Upload back of license from your computer","title":"Submit license (back)","webcam":"Position the back of license in the frame (it will be automatically detected)"},"front":{"instructions":"Upload front of license from your computer","title":"Submit license (front)","webcam":"Position the front of license in the frame (it will be automatically detected)"}},"face":{"instructions":"Upload a selfie from your computer","intro":{"accessibility":{"selfie_capture_tips":"Tips to take a good selfie"},"glasses_instruction":"Remove your glasses, if necessary","selfie_instruction":"Face forward and make sure your eyes are clearly visible","subtitle":"We\'ll compare it with your document","title":"Take a selfie"},"title":"Take a selfie","upload_title":"Selfie"},"government_letter":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Government Letter","webcam":"Position your government letter in the frame (it will be automatically detected)"}},"liveness":{"challenges":{"done_next":"When you\'re done, press next","done_stop":"When you\'re done, press stop","left":"left","movement":"Look over your %{side} shoulder","next":"Next","position_face":"Position your face in the oval","recite":"Say each digit out loud","right":"right"},"intro":{"continue":"Continue","speak_out_loud":"One will involve <strong>speaking out loud</strong>","title":"Let\'s make sure nobody\'s impersonating you","two_actions":"We\'ll ask you to film yourself performing <strong>2 simple actions</strong>"},"press_record":"Press record and follow the instructions","recording":"Recording","start":"Start","stop":"Stop"},"national_identity_card":{"back":{"instructions":"Upload back of card from your computer","title":"Submit identity card (back)","webcam":"Position the back of card in the frame (it will be automatically detected)"},"front":{"instructions":"Upload front of card from your computer","title":"Submit identity card (front)","webcam":"Position the front of card in the frame (it will be automatically detected)"}},"passport":{"front":{"instructions":"Upload passport photo page from your computer","title":"Submit passport photo page","webcam":"Position your passport photo page in the frame (it will be automatically detected)"}},"switch_device":"Continue on phone","take_photo":"Take photo","upload_document":"Upload","upload_file":"or upload photo – no scans or photocopies","utility_bill":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 3 months</strong>","title":"Submit bill","webcam":"Position your utility bill in the frame (it will be automatically detected)"}}},"close":"close","complete":{"message":"Verification complete","submessage":"Thank you"},"confirm":{"bank_building_society_statement":{"message":"Make sure details are clear to read, with no blur or glare"},"benefit_letters":{"message":"Make sure details are clear to read, with no blur or glare"},"confirm":"Confirm","continue":"Continue","council_tax":{"message":"Make sure details are clear to read, with no blur or glare"},"document":{"alt":"Photo of your document","title":"Check readability"},"driving_licence":{"message":"Make sure your license details are clear to read, with no blur or glare"},"enlarge_image":{"close":"Close","enlarge":"Enlarge image"},"face":{"standard":{"alt":"Photo of your face","message":"Make sure your selfie clearly shows your face","title":"Check selfie"},"video":{"title":"Check selfie video"}},"national_identity_card":{"message":"Make sure your card details are clear to read, with no blur or glare"},"passport":{"message":"Make sure your passport details are clear to read, with no blur or glare"},"redo":"Redo","utility_bill":{"message":"Make sure details are clear to read, with no blur or glare"}},"continue":"Continue","council_tax":"Council Tax Letter","cross_device":{"client_success":{"body":"Your computer may take a few seconds to update","sub_title":"You can now return to your computer to continue","title":"Uploads successful"},"intro":{"action":"Get secure link","description_li_1":"Send a secure link to your phone","description_li_2":"Open the link and complete the tasks","description_li_3":"Check back here to finish the submission","sub_title":"Here\'s how to do it:","title":"Continue on your phone"},"link":{"button_copy":{"action":"Send link","status":"Sending"},"copy_link_label":"Copy the link to your mobile browser","copy_link_option":"Copy link","copy_link_sub_title":"Open the link on your mobile","copy_link":{"action":"Copy","success":"Copied"},"options_divider_label":"or","qr_code_option":"Scan QR code","qr_code_sub_title":"Scan the QR code with your phone","qr_code":{"help_label":"How to scan a QR code","help_step_1":"Point your phone’s camera at the QR code","help_step_2":"If it doesn’t work, download a QR code scanner from Google Play or the App Store"},"sms_label":"Enter your mobile number:","sms_option":"Get link via SMS","sms_sub_title":"Send this one-time link to your phone","title":"Get your secure link"},"loading":"Loading...","mobile_connected":{"tips":{"item_1":"Keep this window open while using your mobile","item_2":"Your mobile link will expire in one hour","item_3":"Don\'t refresh this page"},"title":{"message":"Connected to your mobile","submessage":"Once you\'ve finished we\'ll take you to the next step"}},"mobile_notification_sent":{"bold_message":"It may take a few minutes to arrive","resend_link":"Resend link","submessage":"We\'ve sent a secure link to %{number}","tips":{"item_1":"Keep this window open while using your mobile","item_2":"Your link will expire in one hour"},"title":"Check your mobile"},"phone_number_placeholder":"Enter mobile number","submit":{"action":"Submit verification","multiple_docs_uploaded":"Documents uploaded","one_doc_uploaded":"Document uploaded","selfie_uploaded":"Selfie uploaded","sub_title":"We\'re now ready to verify your identity","title":"Great, that\'s everything we need","video_uploaded":"Video uploaded"},"switch_device":{"header":"Take a photo with your phone"},"tips":"Tips"},"document_selector":{"identity":{"driving_licence_hint":"Front and back","hint":"Select the type of document you would like to upload","national_identity_card_hint":"Front and back","passport_hint":"Face photo page","title":"Verify your identity"},"proof_of_address":{"benefits_letter_hint":"Government authorised household benefits eg. Jobseeker allowance, Housing benefit, Tax credits","estatements_accepted":"e-statements accepted","government_letter_hint":"Any government issued letter eg. Benefits entitlement, Voting letters, Tax letters, etc","hint":"These are the documents most likely to show your current home address","title":"Select a %{country} document","utility_bill_hint":"Gas, electricity, water, landline, or broadband","utility_bill_warning":"Sorry, no mobile phone bills"}},"driving_licence":"Driver\'s license","errors":{"camera_inactive_no_fallback":{"instruction":"Make sure your device has a working camera"},"camera_inactive":{"instruction":"Check that it is connected and functional. You can also <fallback>continue verification on your phone</fallback>","message":"Camera not working?"},"camera_not_working_no_fallback":{"instruction":"Make sure your device\'s camera works"},"camera_not_working":{"instruction":"It may be disconnected. <fallback>Try using your phone instead</fallback>.","message":"Camera not working"},"forbidden_client_error":{"instruction":"The link only works on mobile devices","message":"Something\'s gone wrong"},"generic_client_error":{"instruction":"You\'ll need to restart your verification on your computer","message":"Something\'s gone wrong"},"glare_detected":{"instruction":"All details should be clear and readable","message":"Glare detected"},"interrupted_flow_error":{"instruction":"Restart process on a different device","message":"Camera not detected"},"invalid_capture":{"instruction":"Make sure all of the document is in the photo","message":"No document detected"},"invalid_number":{"message":"Check that your number is correct"},"invalid_size":{"instruction":"Must be under 10MB.","message":"File size exceeded."},"invalid_type":{"instruction":"Try using another file type.","message":"File not uploaded."},"lazy_loading":{"message":"An error occurred while loading the component"},"liveness_timeout":{"instruction":"Remember to press stop when you\'re done. <fallback>Redo video actions</fallback>","message":"Looks like you took too long"},"multiple_faces":{"instruction":"Only your face can be in the selfie","message":"Multiple faces found"},"no_face":{"instruction":"Your face is needed in the selfie","message":"No face found"},"server_error":{"instruction":"Please try again","message":"Connection lost"},"sms_failed":{"instruction":"Copy the link to your phone","message":"Something\'s gone wrong"},"sms_overuse":{"instruction":"Copy the link to your phone","message":"Too many failed attempts"},"unsupported_android_browser":{"instruction":"Restart the process on the latest version of Google Chrome","message":"Unsupported browser"},"unsupported_file":{"instruction":"Try using a JPG or PNG file","message":"File type not supported"},"unsupported_ios_browser":{"instruction":"Restart the process on the latest version of Safari","message":"Unsupported browser"}},"government_letter":"Government Letter","image_quality_guide":{"all_good":{"image_alt_text":"Document example","label":"This is good"},"next_step":"Upload photo","no_blur":{"image_alt_text":"Example of a blurry document","label":"All details must be clear"},"no_glare":{"image_alt_text":"Example of a document with glare","label":"Move away from direct light"},"not_cut_off":{"image_alt_text":"Example of a cut-off document","label":"Show all details — including the bottom 2 lines"},"sub_title":"Scans and photocopies are not accepted","title":"Upload passport photo page"},"loading":"Loading","mobilePhrases":{"capture":{"driving_licence":{"back":{"instructions":"Take a photo of the back of your license"},"front":{"instructions":"Take a photo of the front of your license"}},"face":{"instructions":"Take a selfie showing your face"},"national_identity_card":{"back":{"instructions":"Take a photo of the back of your card"},"front":{"instructions":"Take a photo of the front of your card"}},"passport":{"front":{"instructions":"Take a photo of your passport photo page"}}},"errors":{"camera_inactive":{"instruction":"Take a photo using the <fallback>basic camera mode</fallback> instead"},"camera_not_working":{"instruction":"Take a photo using the <fallback>basic camera mode</fallback> instead"}},"image_quality_guide":{"next_step":"Take a photo","title":"Passport photo page"}},"national_identity_card":"Identity Card","passport":"Passport","proof_of_address":{"guidance":{"continue":"Continue","current_address":"Current address","full_name":"Full name","issue_date":"Issue date or summary period","logo":"Logo","make_sure_it_shows":"Make sure it clearly shows:"},"intro":{"is_recent":"Is your most <strong>recent</strong> document","matches_signup":"<strong>Matches</strong> the address you used on signup","requirements":"You\'ll need a document that:","shows_address":"Shows your <strong>current</strong> address","start":"Start verification","title":"Let\'s verify your %{country} address"}},"short_driving_licence":"license","short_national_identity_card":"card","short_passport":"passport","SMS_BODY":"Continue your identity verification by tapping","utility_bill":"Utility Bill","webcam_permissions":{"access_denied":"Camera access is denied","allow":"Allow","allow_access":"Allow camera access","click_allow":"We cannot verify you without using your camera","enable_webcam":"Enable camera","enable_webcam_for_selfie":"When prompted, you must enable camera access to continue","follow_steps":"Follow these steps to recover camera access:","grant_access":"Grant access to your camera from your browser settings","if_denied":"If you deny camera access, you won\'t be able to take pictures and complete verification process.","recover_access":"Recover camera access to continue face verification","recovery":"Recovery","refresh":"Refresh","refresh_page":"Refresh this page to restart the identity verification process","why":"Why do I need to do this?"},"welcome":{"description_p_1":"To open a bank account, we will need to verify your identity.","description_p_2":"It will only take a couple of minutes.","next_button":"Verify Identity","title":"Open your new bank account"}}')},function(e){e.exports=JSON.parse('{"accessibility":{"camera_view":"Vista desde la cámara","close_sdk_screen":"Cerrar pantalla de verificación","country_select":"Seleccione el país","cross_device_verification":"Pasos requeridos para continuar con la verificación en su móvil","dismiss_alert":"Cerrar alerta","document_types":"Documentos que puede utilizar para verificar su identidad","replay_video":"Reproducir su video grabado","selfie_video_actions":"Acciones para grabar un video selfie","shutter":"Tome una foto","start_recording":"Iniciar grabación","stop_recording":"Parar grabación"},"back":"atrás","bank_building_society_statement":"Bank or building society statement","benefit_letters":"Benefits Letter","cancel":"Cancelar","capture":{"bank_building_society_statement":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 3 months</strong>","title":"Submit statement","webcam":"Position your bank statement in the frame (it will be automatically detected)"}},"benefit_letters":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Submit letter","webcam":"Position your benefits letter in the frame (it will be automatically detected)"}},"council_tax":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Submit letter","webcam":"Position your council tax letter in the frame (it will be automatically detected)"}},"driving_licence":{"back":{"instructions":"Suba el reverso de la licencia desde su computadora","title":"Reverso de la licencia de conducir","webcam":"Coloque el reverso de la licencia en el cuadro (será detectado automáticamente)"},"front":{"instructions":"Suba el frente de la licencia desde su computadora","title":"Frente de la licencia de conducir","webcam":"Coloque el frente de la licencia en el cuadro (será detectado automáticamente)"}},"face":{"instructions":"Suba una selfie desde su computadora","intro":{"accessibility":{"selfie_capture_tips":"Consejos para capturar un buen selfie"},"glasses_instruction":"¿Lleva gafas? Asegúrese de que podamos ver claramente sus ojos","selfie_instruction":"Por favor, mantenga una cara seria","subtitle":"Compararemos la foto en su documento con su selfie","title":"Tome una selfie"},"title":"Tome una selfie","upload_title":"Selfie"},"government_letter":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Government Letter","webcam":"Position your government letter in the frame (it will be automatically detected)"}},"liveness":{"challenges":{"done_next":"Cuando esté listo, presione continuar","done_stop":"Cuando esté listo, presione parar","left":"izquierdo","movement":"Mire sobre su hombro %{side}","next":"Siguiente","position_face":"Coloque su cara en el óvalo","recite":"Lea en voz alta cada dígito","right":"derecho"},"intro":{"continue":"Continuar","speak_out_loud":"Una de ellas implicará <strong>hablar en voz alta</strong>","title":"Asegurémonos de que nadie se está haciendo pasar por usted","two_actions":"Le pediremos que se grabe en video ejecutando <strong>dos simples acciones</strong>"},"press_record":"Presione grabar y siga las instrucciones","recording":"Grabando","start":"Iniciar","stop":"Parar"},"national_identity_card":{"back":{"instructions":"Suba el reverso de la tarjeta desde su computadora","title":"Reverso de la tarjeta de identificación","webcam":"Coloque el reverso de la tarjeta en el cuadro (será detectado automáticamente)"},"front":{"instructions":"Suba el frente de la tarjeta desde su computadora","title":"Frente de la tarjeta de identificación","webcam":"Coloque el frente de la tarjeta en el cuadro (será detectado automáticamente)"}},"passport":{"front":{"instructions":"Suba la página del pasaporte con su foto desde su computadora","title":"Página del pasaporte con su foto","webcam":"Coloque la página del pasaporte con su foto en el cuadro (será detectado automáticamente)"}},"switch_device":"Continuar en el teléfono","take_photo":"Tomar foto","upload_document":"Subir","upload_file":"o subir foto - no escaneos o fotocopias","utility_bill":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 3 months</strong>","title":"Submit bill","webcam":"Position your utility bill in the frame (it will be automatically detected)"}}},"close":"cerrar","complete":{"message":"Verificación completa","submessage":"Gracias."},"confirm":{"bank_building_society_statement":{"message":"Asegúrese de que los datos de su tarjeta se puedan leer claramente, sin borrosidades ni brillo"},"benefit_letters":{"message":"Asegúrese de que los datos de su tarjeta se puedan leer claramente, sin borrosidades ni brillo"},"confirm":"Confirmar","continue":"Continuar","council_tax":{"message":"Asegúrese de que los datos de su tarjeta se puedan leer claramente, sin borrosidades ni brillo"},"document":{"alt":"Foto de su documento","title":"Compruebe la legibilidad"},"driving_licence":{"message":"Asegúrese de que los datos de su licencia se puedan leer claramente, sin borrosidades ni brillo"},"enlarge_image":{"close":"Cerrar","enlarge":"Ampliar imagen"},"face":{"standard":{"alt":"Foto de su cara","message":"Asegúrese de que la selfie muestre claramente su cara","title":"Verificar selfie"},"video":{"title":"Verifique video"}},"national_identity_card":{"message":"Asegúrese de que los datos de su tarjeta se puedan leer claramente, sin borrosidades ni brillo"},"passport":{"message":"Asegúrese de que los datos de su pasaporte se puedan leer claramente, sin borrosidades ni brillo"},"redo":"Reintentar","utility_bill":{"message":"Asegúrese de que los datos de su tarjeta se puedan leer claramente, sin borrosidades ni brillo"}},"continue":"Continuar","council_tax":"Council Tax Letter","cross_device":{"client_success":{"body":"Su computadora puede tardar unos segundos en actualizarse","sub_title":"Ahora puede volver a su computadora para continuar","title":"Carga completa"},"intro":{"action":"Obtener enlace seguro","description_li_1":"Envíe el enlace seguro a su teléfono móvil","description_li_2":"Abra el enlace y complete las acciones","description_li_3":"Vuelva aquí para finalizar el envío","sub_title":"Siga estas instrucciones:","title":"Continúe en su teléfono móvil"},"link":{"button_copy":{"action":"Enviar enlace","status":"Enviando"},"copy_link_label":"Copie el enlace al navegador de internet de su teléfono","copy_link_option":"Copiar enlace","copy_link_sub_title":"Abrir el enlace en su teléfono","copy_link":{"action":"Copiar","success":"Copiado"},"options_divider_label":"u","qr_code_option":"Escanear código QR","qr_code_sub_title":"Escanear el código QR con su teléfono","qr_code":{"help_label":"Cómo escanear un código QR","help_step_1":"Apunte la cámara de su teléfono al código QR","help_step_2":"Si esto no funciona, descargue una aplicación para escanear códigos QR desde Google Play o Apple Store"},"sms_label":"Ingrese su número de teléfono móvil:","sms_option":"Obtener enlace via mensaje de texto","sms_sub_title":"Enviar este enlace de un solo uso a su teléfono","title":"Obtener enlace seguro"},"loading":"Cargando...","mobile_connected":{"tips":{"item_1":"Mantenga esta ventana abierta mientras usa su dispositivo móvil","item_2":"El enlace móvil caducará en una hora","item_3":"No actualizar esta página"},"title":{"message":"Conectado con su móvil","submessage":"Cuando haya terminado, le llevaremos al próximo paso"}},"mobile_notification_sent":{"bold_message":"Puede tardar unos minutos en llegar","resend_link":"Reenviar enlace","submessage":"Hemos enviado un enlace seguro a %{number}","tips":{"item_1":"Mantenga esta ventana abierta mientras usa su dispositivo móvil","item_2":"Su enlace móvil caducará en una hora"},"title":"Controle su dispositivo móvil"},"phone_number_placeholder":"Introduzca su número de móvil","submit":{"action":"Enviar verificación","multiple_docs_uploaded":"Documentos cargados","one_doc_uploaded":"Documento cargado","selfie_uploaded":"Selfie cargado","sub_title":"Estamos listos para verificar su identidad","title":"Genial, eso es todo","video_uploaded":"Video cargado"},"switch_device":{"header":"Tome una foto con su teléfono"},"tips":"Recomendaciones"},"document_selector":{"identity":{"driving_licence_hint":"Frente y reverso","hint":"Seleccione el tipo de documento que desea subir","national_identity_card_hint":"Frente y reverso","passport_hint":"Página del pasaporte con su foto","title":"Verifique su identidad"},"proof_of_address":{"benefits_letter_hint":"Government authorised household benefits eg. Jobseeker allowance, Housing benefit, Tax credits","estatements_accepted":"e-statements accepted","government_letter_hint":"Any government issued letter eg. Benefits entitlement, Voting letters, Tax letters, etc","hint":"These are the documents most likely to show your current home address","title":"Select a %{country} document","utility_bill_hint":"Gas, electricity, water, landline, or broadband","utility_bill_warning":"Sorry, no mobile phone bills"}},"driving_licence":"Licencia de conducir","errors":{"camera_inactive_no_fallback":{"instruction":"Asegúrese de que su dispositivo tenga una cámara que funcione"},"camera_inactive":{"instruction":"Revise que esté conectada y funcione. También puede<fallback>continuar con la verificación de identidad en su teléfono móvil</fallback>","message":"¿La cámara no está funcionando?"},"camera_not_working_no_fallback":{"instruction":"Asegúrese de que su dispositivo tenga una cámara que funcione"},"camera_not_working":{"instruction":"Puede estar desconectada o no funcionando. <fallback>Use su móvil</fallback> para continuar la verificación","message":"Su cámara no esta funcionando"},"forbidden_client_error":{"instruction":"Debe abrir este enlace en un dispositivo móvil.","message":"Algo salió mal"},"generic_client_error":{"instruction":"Deberá reiniciar su verificación en su computadora","message":"Algo salió mal"},"glare_detected":{"instruction":"Todos los detalles deben ser claros y legibles","message":"Brillo detectado"},"interrupted_flow_error":{"instruction":"Reinicie el proceso con un dispositivo diferente","message":"Cámara no detectada"},"invalid_capture":{"instruction":"Asegúrese de que todo el documento esté en la foto","message":"Documento no detectado"},"invalid_number":{"message":"Compruebe que su número de móvil sea correcto"},"invalid_size":{"instruction":"El tamaño debe ser menos de 10MB.","message":"El tamaño de archivo excede el limite."},"invalid_type":{"instruction":"Intenta usar otro tipo de archivo.","message":"Archivo no cargado."},"lazy_loading":{"message":"Se produjo un error al cargar el componente"},"liveness_timeout":{"instruction":"Recuerde presionar detener cuando esté listo. <fallback>Rehacer acciones</fallback>","message":"Parece que ha demorado demasiado"},"multiple_faces":{"instruction":"Solo su cara puede estar en la selfie","message":"Múltiples caras encontradas"},"no_face":{"instruction":"Su cara tiene que salir en la selfie","message":"Cara no encontrada"},"server_error":{"instruction":"Inténtalo de nuevo","message":"Conexión perdida"},"sms_failed":{"instruction":"Copie el enlace a continuación en su dispositivo móvil","message":"Algo salió mal"},"sms_overuse":{"instruction":"Copie el enlace a continuación en su dispositivo móvil","message":"Demasiados intentos de reenvío"},"unsupported_android_browser":{"instruction":"Reinicie el proceso en la versión más reciente de Google Chrome","message":"Browser no soportado"},"unsupported_file":{"instruction":"Intente usar un archivo .jpg o .png","message":"Tipo de archivo no admitido"},"unsupported_ios_browser":{"instruction":"Reinicie el proceso en la versión más reciente de Safari","message":"Browser no soportado"}},"government_letter":"Government Letter","image_quality_guide":{"all_good":{"image_alt_text":"Ejemplo de documento","label":"Está bien"},"next_step":"Subir foto","no_blur":{"image_alt_text":"Ejemplo de un documento borroso","label":"Todos los detalles deben ser claros"},"no_glare":{"image_alt_text":"Ejemplo de un documento con reflejo","label":"Aléjese de la luz directa"},"not_cut_off":{"image_alt_text":"Ejemplo de un documento cortado","label":"Mostrar todos los detalles, incluidas las dos líneas inferiores"},"sub_title":"No se aceptan fotos escaneadas ni fotocopias","title":"Subir la página del pasaporte con su foto"},"loading":"Cargando","mobilePhrases":{"capture":{"driving_licence":{"back":{"instructions":"Tome una foto del reverso de su licencia"},"front":{"instructions":"Tome una foto del frente de su licencia"}},"face":{"instructions":"Tome una selfie que muestre su cara"},"national_identity_card":{"back":{"instructions":"Tome una foto del reverso de su tarjeta"},"front":{"instructions":"Tome una foto del frente de su tarjeta"}},"passport":{"front":{"instructions":"Tome una foto de la página del pasaporte que incluye su fotografía"}}},"errors":{"camera_inactive":{"instruction":"Tome una foto usando el <fallback>modo de cámara básica</fallback> en su lugar"},"camera_not_working":{"instruction":"Tome una foto usando el <fallback>modo de cámara básica</fallback> en su lugar"}},"image_quality_guide":{"next_step":"Tomar foto","title":"Página del pasaporte con su foto"}},"national_identity_card":"Tarjeta de identificación","passport":"Pasaporte","proof_of_address":{"guidance":{"continue":"Continuar","current_address":"Current address","full_name":"Nombre completo","issue_date":"Issue date or summary period","logo":"Logo","make_sure_it_shows":"Make sure it clearly shows:"},"intro":{"is_recent":"Is your most <strong>recent</strong> document","matches_signup":"<strong>Matches</strong> the address you used on signup","requirements":"You\'ll need a document that:","shows_address":"Shows your <strong>current</strong> address","start":"Iniciar la verificación","title":"Let\'s verify your %{country} address"}},"short_driving_licence":"licencia","short_national_identity_card":"tarjeta","short_passport":"pasaporte","SMS_BODY":"Continúe su verificación pulsando","utility_bill":"Utility Bill","webcam_permissions":{"access_denied":"Acceso a la cámara no permitido","allow":"Permitir","allow_access":"Permitir acceso a la cámara","click_allow":"No le podemos verificar sin usar su cámara","enable_webcam":"Activar cámara","enable_webcam_for_selfie":"Deberá activar la cámara para continuar","follow_steps":"Siga estos pasos para recuperar acceso a la cámara:","grant_access":"Autorice acceso a su cámara desde los ajustes del navegador","if_denied":"Si niega acceso a la cámara, no podrá tomar fotos para completar el proceso de verificación","recover_access":"Recupere acceso a la cámara para continuar la verificación facial","recovery":"Recuperación","refresh":"Actualizar","refresh_page":"Actualice esta página para reiniciar el proceso de verificación","why":"¿Por qué necesita hacer esto?"},"welcome":{"description_p_1":"Para abrir una cuenta bancaria, necesitaremos verificar su identidad.","description_p_2":"Sólo tomará un par de minutos.","next_button":"Verificar identidad","title":"Abra su nueva cuenta bancaria"}}')},function(e){e.exports=JSON.parse('{"accessibility":{"camera_view":"Ansicht von der Kamera","close_sdk_screen":"Bildschirm zur Identitätsprüfung schließen","country_select":"Land auswählen","cross_device_verification":"Erforderliche Schritte zur weiteren Verifizierung auf Ihrem Mobiltelefon","dismiss_alert":"Alarm verwerfen","document_types":"Dokumente, die Sie zur Überprüfung Ihrer Identität verwenden können","replay_video":"Wiedergeben Ihres aufgezeichneten Videos","selfie_video_actions":"Aktionen zum Aufzeichnen eines Selfie-Videos","shutter":"Ein Foto machen","start_recording":"Aufnahme starten","stop_recording":"Aufnahme stoppen"},"back":"zurück","bank_building_society_statement":"Bank or building society statement","benefit_letters":"Benefits Letter","cancel":"Abbrechen","capture":{"bank_building_society_statement":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 3 months</strong>","title":"Submit statement","webcam":"Position your bank statement in the frame (it will be automatically detected)"}},"benefit_letters":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Submit letter","webcam":"Position your benefits letter in the frame (it will be automatically detected)"}},"council_tax":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Submit letter","webcam":"Position your council tax letter in the frame (it will be automatically detected)"}},"driving_licence":{"back":{"instructions":"Rückseite des Führerscheins von Ihrem Computer hochladen","title":"Führerschein einreichen (Rückseite)","webcam":"Positionieren Sie die Rückseite des Führerscheins innerhalb des Rahmens (sie wird automatisch erkannt)."},"front":{"instructions":"Vorderseite des Führerscheins von Ihrem Computer hochladen","title":"Führerschein einreichen (Vorderseite)","webcam":"Positionieren Sie die Vorderseite des Führerscheins innerhalb des Rahmens (sie wird automatisch erkannt)."}},"face":{"instructions":"Selfie von Ihrem Computer hochladen","intro":{"accessibility":{"selfie_capture_tips":"Tipps für ein gutes Selfie"},"glasses_instruction":"Nehmen Sie Ihre Brille ab, falls erforderlich.","selfie_instruction":"Richten Sie Ihr Gesicht nach vorne und stellen Sie sicher, dass Ihre Augen deutlich sichtbar sind.","subtitle":"Wir werden es mit Ihrem Dokument vergleichen.","title":"Ein Selfie aufnehmen"},"title":"Ein Selfie aufnehmen","upload_title":"Selfie"},"government_letter":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Government Letter","webcam":"Position your government letter in the frame (it will be automatically detected)"}},"liveness":{"challenges":{"done_next":"Wenn Sie fertig sind, klicken Sie auf Weiter.","done_stop":"Wenn Sie fertig sind, drücken Sie Stopp.","left":"links","movement":"Schauen Sie über Ihre %{side} Schulter.","next":"Weiter","position_face":"Positionieren Sie Ihr Gesicht im Oval","recite":"Sprechen Sie jede Ziffer laut aus.","right":"rechts"},"intro":{"continue":"Fortfahren","speak_out_loud":"Eine Aktion wird sein, <strong>etwas laut auszusprechen</strong>.","title":"Lassen Sie uns sicherstellen, dass sich niemand für Sie ausgibt.","two_actions":"Wir bitten Sie, sich bei der Durchführung von <strong>zwei einfachen Handlungen</strong> zu filmen."},"press_record":"Drücken Sie auf Aufnahme und folgen Sie den Anweisungen.","recording":"Aufnahme","start":"Start","stop":"Stopp"},"national_identity_card":{"back":{"instructions":"Kartenrückseite von Ihrem Computer hochladen","title":"Personalausweis einreichen (Rückseite)","webcam":"Positionieren Sie die Rückseite der Karte innerhalb des Rahmens (sie wird automatisch erkannt)."},"front":{"instructions":"Kartenvorderseite von Ihrem Computer hochladen","title":"Personalausweis einreichen (Vorderseite)","webcam":"Positionieren Sie die Vorderseite der Karte innerhalb des Rahmens (sie wird automatisch erkannt)."}},"passport":{"front":{"instructions":"Passfotoseite von Ihrem Computer hochladen","title":"Passfoto-Seite einreichen","webcam":"Positionieren Sie Ihre Passfotoseite innerhalb des Rahmens (sie wird automatisch erkannt)."}},"switch_device":"Weiter am Mobiltelefon","take_photo":"Foto machen","upload_document":"Hochladen","upload_file":"oder Foto hochladen – keine Scans oder Kopien","utility_bill":{"front":{"instructions":"Provide the whole document page for best results","sub_title":"Must be issued in the <strong>last 3 months</strong>","title":"Submit bill","webcam":"Position your utility bill in the frame (it will be automatically detected)"}}},"close":"Schließen","complete":{"message":"Verifizierung abgeschlossen","submessage":"Danke"},"confirm":{"bank_building_society_statement":{"message":"Make sure details are clear to read, with no blur or glare"},"benefit_letters":{"message":"Make sure details are clear to read, with no blur or glare"},"confirm":"Bestätigen","continue":"Fortfahren","council_tax":{"message":"Make sure details are clear to read, with no blur or glare"},"document":{"alt":"Foto Ihres Dokuments","title":"Lesbarkeit prüfen"},"driving_licence":{"message":"Die Führerschein Details müssen deutlich lesbar sein, ohne Unschärfe oder Spiegelung"},"enlarge_image":{"close":"Schließen","enlarge":"Bild vergrößern"},"face":{"standard":{"alt":"Foto von Ihrem Gesicht","message":"Stellen Sie sicher, dass Ihr Selfie Ihr Gesicht deutlich zeigt","title":"Selfie prüfen"},"video":{"title":"Selfie-Video prüfen"}},"national_identity_card":{"message":"Die Details der Karte müssen deutlich lesbar sein, ohne Unschärfe oder Spiegelung"},"passport":{"message":"Die Reisepass Details müssen deutlich lesbar sein, ohne Unschärfe oder Spiegelung"},"redo":"Wiederholen","utility_bill":{"message":"Make sure details are clear to read, with no blur or glare"}},"continue":"Fortfahren","council_tax":"Council Tax Letter","cross_device":{"client_success":{"body":"Die Aktualisierung Ihres Computers kann einige Sekunden dauern.","sub_title":"Sie können nun zu Ihrem Computer zurückkehren, um fortzufahren.","title":"Uploads erfolgreich!"},"intro":{"action":"Sicherheitslink erhalten","description_li_1":"Senden Sie einen Sicherheitslink an Ihr Mobiltelefon.","description_li_2":"Öffnen Sie den Link und führen Sie die Aktionen aus.","description_li_3":"Überprüfen Sie alle Eingaben und Daten, um die Einreichung abzuschließen.","sub_title":"So geht\'s:","title":"Fahren Sie mit Ihrem Mobiltelefon fort."},"link":{"button_copy":{"action":"Link senden","status":"Senden"},"copy_link_label":"Kopieren Sie den Link in Ihren mobilen Browser.","copy_link_option":"Link kopieren","copy_link_sub_title":"Öffnen Sie den Link auf Ihrem Mobiltelefon.","copy_link":{"action":"Kopieren","success":"Kopiert"},"options_divider_label":"oder","qr_code_option":"QR-Code scannen","qr_code_sub_title":"Scannen Sie den QR-Code mit Ihrem Mobiltelefon.","qr_code":{"help_label":"So scannen Sie einen QR-Code","help_step_1":"Richten Sie die Kamera Ihres Telefons auf den QR-Code.","help_step_2":"Wenn es nicht funktioniert, laden Sie einen QR-Code-Scanner von Google Play oder aus dem App Store herunter."},"sms_label":"Geben Sie Ihre Mobiltelefonnummer ein:","sms_option":"Link per SMS erhalten","sms_sub_title":"Senden Sie diesen einmaligen Link an Ihr Mobiltelefon.","title":"Holen Sie sich Ihren Sicherheitslink"},"loading":"Wird geladen …","mobile_connected":{"tips":{"item_1":"Lassen Sie dieses Fenster geöffnet, während Sie Ihr Mobiltelefon bedienen.","item_2":"Ihr mobiler Link läuft in einer Stunde ab.","item_3":"Diese Seite nicht aktualisieren."},"title":{"message":"Mit Ihrem Mobiltelefon verbunden","submessage":"Wenn Sie fertig sind, gelangen Sie zum nächsten Schritt."}},"mobile_notification_sent":{"bold_message":"Dieser Vorgang kann einige Minuten dauern.","resend_link":"Link erneut senden","submessage":"Wir haben einen sicheren Link an %{number} gesendet.","tips":{"item_1":"Lassen Sie dieses Fenster geöffnet, während Sie Ihr Mobiltelefon bedienen.","item_2":"Ihr Link läuft in einer Stunde ab."},"title":"Überprüfen Sie Ihr Mobiltelefon."},"phone_number_placeholder":"Mobiltelefonnummer eingeben","submit":{"action":"Bestätigung senden","multiple_docs_uploaded":"Dokumente hochgeladen","one_doc_uploaded":"Dokument hochgeladen","selfie_uploaded":"Selfie hochgeladen","sub_title":"Wir sind jetzt bereit, Ihre Identität zu überprüfen.","title":"Großartig, das ist alles, was wir brauchen.","video_uploaded":"Video hochgeladen"},"switch_device":{"header":"Machen Sie ein Foto mit Ihrem Mobiltelefon."},"tips":"Tipps"},"document_selector":{"identity":{"driving_licence_hint":"Vorder- und Rückseite","hint":"Wählen Sie die Art des Dokuments, das Sie hochladen möchten.","national_identity_card_hint":"Vorder- und Rückseite","passport_hint":"Seite mit Foto","title":"Identität überprüfen"},"proof_of_address":{"benefits_letter_hint":"Government authorised household benefits eg. Jobseeker allowance, Housing benefit, Tax credits","estatements_accepted":"e-statements accepted","government_letter_hint":"Any government issued letter eg. Benefits entitlement, Voting letters, Tax letters, etc","hint":"These are the documents most likely to show your current home address","title":"Select a %{country} document","utility_bill_hint":"Gas, electricity, water, landline, or broadband","utility_bill_warning":"Sorry, no mobile phone bills"}},"driving_licence":"Führerschein","errors":{"camera_inactive_no_fallback":{"instruction":"Stellen Sie sicher, dass Ihr Gerät über eine funktionierende Kamera verfügt."},"camera_inactive":{"instruction":"Überprüfen Sie, ob die Kamera verbunden und funktionsfähig ist. Sie können <fallback>die Überprüfung auch auf Ihrem Telefon fortsetzen.</fallback>","message":"Kamera funktioniert nicht?"},"camera_not_working_no_fallback":{"instruction":"Stellen Sie sicher, dass die Kamera Ihres Geräts funktioniert."},"camera_not_working":{"instruction":"Die Verbindung kann unterbrochen werden. <fallback>Versuchen Sie stattdessen, Ihr Telefon zu benutzen</fallback>.","message":"Kamera funktioniert nicht."},"forbidden_client_error":{"instruction":"Der Link funktioniert nur auf mobilen Geräten.","message":"Etwas ist schiefgelaufen."},"generic_client_error":{"instruction":"Sie müssen Ihre Verifizierung auf Ihrem Computer neu starten.","message":"Etwas ist schiefgelaufen."},"glare_detected":{"instruction":"Alle Details sollten klar und lesbar sein.","message":"Spiegelung erkannt"},"interrupted_flow_error":{"instruction":"Starten Sie den Prozess auf einem anderen Gerät neu.","message":"Kamera nicht erkannt"},"invalid_capture":{"instruction":"Stellen Sie sicher, dass das gesamte Dokument auf dem Foto zu sehen ist.","message":"Kein Dokument erkannt."},"invalid_number":{"message":"Überprüfen Sie, ob Ihre Nummer korrekt ist."},"invalid_size":{"instruction":"Die Dateigröße muss unter 10 MB sein.","message":"Dateigröße überschritten."},"invalid_type":{"instruction":"Versuchen Sie einen anderen Dateityp zu verwenden.","message":"Datei nicht hochgeladen."},"lazy_loading":{"message":"Beim Laden der Komponente ist ein Fehler aufgetreten."},"liveness_timeout":{"instruction":"Denken Sie daran, Stopp zu drücken, wenn Sie fertig sind. <fallback>Video-Aktionen wiederholen</fallback>","message":"Sieht aus, als hätten Sie zu lange gebraucht."},"multiple_faces":{"instruction":"Nur Ihr Gesicht kann im Selfie zu sehen sein.","message":"Mehrere Gesichter gefunden"},"no_face":{"instruction":"Ihr Gesicht muss im Selfie zu sehen sein.","message":"Kein Gesicht gefunden"},"server_error":{"instruction":"Bitte versuchen Sie es erneut.","message":"Verbindung unterbrochen"},"sms_failed":{"instruction":"Kopieren Sie den Link auf Ihr Mobiltelefon.","message":"Etwas ist schiefgelaufen."},"sms_overuse":{"instruction":"Kopieren Sie den Link auf Ihr Mobiltelefon.","message":"Zu viele fehlgeschlagene Versuche"},"unsupported_android_browser":{"instruction":"Starten Sie den Prozess auf der neuesten Version von Google Chrome neu.","message":"Nicht unterstützter Browser"},"unsupported_file":{"instruction":"Versuchen Sie es mit einer JPG- oder PNG-Datei.","message":"Dateityp nicht unterstützt."},"unsupported_ios_browser":{"instruction":"Starten Sie den Prozess mit der neuesten Version von Safari neu.","message":"Nicht unterstützter Browser"}},"government_letter":"Government Letter","image_quality_guide":{"all_good":{"image_alt_text":"Beispiel für ein Dokument","label":"Das ist gut"},"next_step":"Foto hochladen","no_blur":{"image_alt_text":"Beispiel eines verschwommenen Dokuments","label":"Alle Details müssen klar sein"},"no_glare":{"image_alt_text":"Beispiel eines Dokuments mit Blendung","label":"Entfernen Sie sich von direktem Licht"},"not_cut_off":{"image_alt_text":"Beispiel eines abgeschnittenen Dokuments","label":"Alle Details anzeigen - einschließlich der unteren 2 Zeilen"},"sub_title":"Scans und Fotokopien werden nicht akzeptiert","title":"Fotoseite des Reisepasses hochladen"},"loading":"Wird geladen","mobilePhrases":{"capture":{"driving_licence":{"back":{"instructions":"Machen Sie ein Foto von der Rückseite Ihres Führerscheins"},"front":{"instructions":"Machen Sie ein Foto von der Vorderseite Ihres Führerscheins"}},"face":{"instructions":"Machen Sie ein Selfie, das Ihr Gesicht zeigt"},"national_identity_card":{"back":{"instructions":"Machen Sie ein Foto von der Rückseite Ihrer Karte"},"front":{"instructions":"Machen Sie ein Foto von der Vorderseite Ihrer Karte"}},"passport":{"front":{"instructions":"Machen Sie ein Foto von Ihrer Passfotoseite"}}},"errors":{"camera_inactive":{"instruction":"Fotografieren Sie stattdessen mit dem <fallback>einfachen Kameramodus</fallback>"},"camera_not_working":{"instruction":"Fotografieren Sie stattdessen mit dem <fallback>einfachen Kameramodus</fallback>"}},"image_quality_guide":{"next_step":"Ein Foto machen","title":"Reisepass Foto-Seite"}},"national_identity_card":"Personalausweis","passport":"Reisepass","proof_of_address":{"guidance":{"continue":"Fortfahren","current_address":"Current address","full_name":"Full name","issue_date":"Issue date or summary period","logo":"Logo","make_sure_it_shows":"Make sure it clearly shows:"},"intro":{"is_recent":"Is your most <strong>recent</strong> document","matches_signup":"<strong>Matches</strong> the address you used on signup","requirements":"You\'ll need a document that:","shows_address":"Shows your <strong>current</strong> address","start":"Start verification","title":"Let\'s verify your %{country} address"}},"short_driving_licence":"Führerschein","short_national_identity_card":"Karte","short_passport":"Reisepass","SMS_BODY":"Fortsetzung der Nachprüfung durch klicken von","utility_bill":"Utility Bill","webcam_permissions":{"access_denied":"Kamerazugriff wird verweigert.","allow":"Erlauben","allow_access":"Zugriff auf Kamera erlauben","click_allow":"Wir können Sie nicht verifizieren, ohne Ihre Kamera zu benutzen.","enable_webcam":"Kamera aktivieren","enable_webcam_for_selfie":"Wenn Sie dazu aufgefordert werden, müssen Sie den Kamerazugriff aktivieren, um fortzufahren.","follow_steps":"Befolgen Sie diese Schritte, um den Kamerazugriff wiederherzustellen:","grant_access":"Gewähren Sie den Zugriff auf Ihre Kamera über Ihre Browsereinstellungen.","if_denied":"Wenn Sie den Kamerazugang verweigern, können Sie keine Bilder aufnehmen und den Verifizierungsprozess nicht abschließen.","recover_access":"Kamerazugriff wiederherstellen, um Gesichtsverifizierung fortzusetzen","recovery":"Wiederherstellen","refresh":"Aktualisieren","refresh_page":"Aktualisieren Sie diese Seite, um den Identitätsüberprüfungsprozess neu zu starten.","why":"Warum ist dies erforderlich?"},"welcome":{"description_p_1":"Um ein Bankkonto zu eröffnen, müssen wir Ihre Identität überprüfen.","description_p_2":"Es wird nur ein paar Minuten dauern.","next_button":"Identität überprüfen","title":"Eröffnen Sie Ihr neues Bankkonto"}}')},function(e){e.exports=JSON.parse('{"accessibility":{"camera_view":"Vue de la caméra","close_sdk_screen":"Fermer l\'écran de vérification de l\'identité","country_select":"Choisissez le pays","cross_device_verification":"Étapes requises pour continuer la vérification sur votre mobile","dismiss_alert":"Ignorer l\'alerte","document_types":"Documents que vous pouvez utiliser pour vérifier votre identité","replay_video":"Rejouer la vidéo","selfie_video_actions":"Actions pour enregistrer une vidéo de votre visage","shutter":"Prendre une photo","start_recording":"Commencer l\'enregistrement","stop_recording":"Arrêter l’enregistrement"},"back":"retour","bank_building_society_statement":"Bank or building society statement","benefit_letters":"Benefits Letter","cancel":"Annuler","capture":{"bank_building_society_statement":{"front":{"instructions":"Fournissez la page entière du document pour de meilleurs résultats","sub_title":"Must be issued in the <strong>last 3 months</strong>","title":"Envoyer la déclaration","webcam":"Position your bank statement in the frame (it will be automatically detected)"}},"benefit_letters":{"front":{"instructions":"Fournissez la page entière du document pour de meilleurs résultats","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Envoyer la lettre","webcam":"Position your benefits letter in the frame (it will be automatically detected)"}},"council_tax":{"front":{"instructions":"Fournissez la page entière du document pour de meilleurs résultats","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Envoyer la lettre","webcam":"Position your council tax letter in the frame (it will be automatically detected)"}},"driving_licence":{"back":{"instructions":"Envoyez le verso de votre permis depuis votre ordinateur","title":"Envoyer le permis (verso)","webcam":"Positionnez le verso du permis dans le cadre (il sera automatiquement détecté)"},"front":{"instructions":"Envoyez votre permis depuis votre ordinateur","title":"Envoyer le permis (recto)","webcam":"Positionnez le recto du permis dans le cadre (il sera automatiquement détecté)"}},"face":{"instructions":"Envoyez votre selfie depuis votre ordinateur","intro":{"accessibility":{"selfie_capture_tips":"Conseils pour prendre un bon selfie"},"glasses_instruction":"Retirez vos lunettes, si nécessaire","selfie_instruction":"Regardez vers l\'avant et assurez-vous que vos yeux sont bien visibles","subtitle":"Nous allons le comparer avec votre document","title":"Prendre un selfie"},"title":"Prendre un selfie","upload_title":"Selfie"},"government_letter":{"front":{"instructions":"Fournissez la page entière du document pour de meilleurs résultats","sub_title":"Must be issued in the <strong>last 12 months</strong>","title":"Government Letter","webcam":"Position your government letter in the frame (it will be automatically detected)"}},"liveness":{"challenges":{"done_next":"Lorsque vous avez terminé, appuyez sur suivant","done_stop":"Lorsque vous avez terminé, appuyez sur stop","left":"gauche","movement":"Regardez par-dessus votre épaule %{side}","next":"Suivant","position_face":"Positionnez votre visage dans le cercle","recite":"Prononcez chaque chiffre à voix haute","right":"droite"},"intro":{"continue":"Continuer","speak_out_loud":"L\'une d\'entre elles consistera à <strong>parler à haute</strong> voix","title":"Assurons-nous que personne ne se fait passer pour vous","two_actions":"Nous allons vous demander de vous filmer en train d\'exécuter <strong>2 actions simples</strong>"},"press_record":"Appuyez sur enregistrer et suivez les instructions","recording":"En cours d\'enregistrement","start":"Démarrer","stop":"Stop"},"national_identity_card":{"back":{"instructions":"Envoyez votre carte depuis votre ordinateur","title":"Envoyez votre carte d\'identité (verso)","webcam":"Positionnez le verso de la carte dans le cadre (il sera automatiquement détecté)"},"front":{"instructions":"Envoyez le recto de votre carte depuis votre ordinateur","title":"Envoyer la carte d\'identité (recto)","webcam":"Positionnez le recto de votre permis dans le cadre (il sera automatiquement détecté)"}},"passport":{"front":{"instructions":"Envoyez votre passeport depuis votre ordinateur","title":"Envoyez la page du passeport où figure votre photo","webcam":"Positionnez la page où figure votre photo dans le cadre (elle sera automatiquement détectée)"}},"switch_device":"Continuez sur votre mobile","take_photo":"Prendre une photo","upload_document":"Envoyer","upload_file":"ou télécharger une photo - pas de scans ou de photocopies","utility_bill":{"front":{"instructions":"Fournissez la page entière du document pour de meilleurs résultats","sub_title":"Must be issued in the <strong>last 3 months</strong>","title":"Submit bill","webcam":"Position your utility bill in the frame (it will be automatically detected)"}}},"close":"fermer","complete":{"message":"Vérification terminée","submessage":"Merci"},"confirm":{"bank_building_society_statement":{"message":"Assurez-vous que les détails sont lisibles, sans flou ni reflets"},"benefit_letters":{"message":"Assurez-vous que les détails sont lisibles, sans flou ni reflets"},"confirm":"Confirmer","continue":"Continuer","council_tax":{"message":"Assurez-vous que les détails sont lisibles, sans flou ni reflets"},"document":{"alt":"Photo de votre document","title":"Vérifier la lisibilité"},"driving_licence":{"message":"Assurez-vous que les détails de votre permis sont lisibles, sans flou ni reflets"},"enlarge_image":{"close":"Fermer","enlarge":"Agrandir l\'image"},"face":{"standard":{"alt":"Photo de votre visage","message":"Assurez-vous que votre selfie montre clairement votre visage","title":"Vérifier votre selfie"},"video":{"title":"Veuillez vérifier votre vidéo"}},"national_identity_card":{"message":"Assurez-vous que les détails de votre carte sont lisibles, sans flou ni reflets"},"passport":{"message":"Assurez-vous que les détails de votre passeport sont lisibles, sans flou ni reflets"},"redo":"Recommencer","utility_bill":{"message":"Assurez-vous que les détails sont lisibles, sans flou ni reflets"}},"continue":"Continuer","council_tax":"Council Tax Letter","cross_device":{"client_success":{"body":"Votre ordinateur peut prendre quelques secondes pour mettre à jour la page","sub_title":"Vous pouvez maintenant retourner sur votre ordinateur pour continuer","title":"Envois réussis"},"intro":{"action":"Obtenez un lien sécurisé","description_li_1":"Envoyez un lien sécurisé vers votre téléphone","description_li_2":"Ouvrez le lien et complétez les tâches","description_li_3":"Revenez ici pour finaliser l\'envoi","sub_title":"Voici comment faire :","title":"Continuez sur votre mobile"},"link":{"button_copy":{"action":"Envoyer le lien","status":"Envoi en cours"},"copy_link_label":"Copier le lien sur votre mobile","copy_link_option":"Copier le lien","copy_link_sub_title":"Ouvrez le lien sur votre mobile","copy_link":{"action":"Copier","success":"Copié"},"options_divider_label":"ou","qr_code_option":"Scanner le QR code","qr_code_sub_title":"Scannez le QR code avec votre mobile","qr_code":{"help_label":"Comment scanner un QR code","help_step_1":"Pointez l\'appareil photo de votre mobile sur le QR code","help_step_2":"Si cela ne fonctionne pas, téléchargez un scanner de QR code sur Google Play ou l\'App Store"},"sms_label":"Entrez votre numéro de mobile","sms_option":"Obtenez le lien par SMS","sms_sub_title":"Envoyez ce lien unique vers votre mobile","title":"Obtenez votre lien sécurisé"},"loading":"Chargement...","mobile_connected":{"tips":{"item_1":"Gardez cette fenêtre ouverte lorsque vous utilisez votre mobile","item_2":"Votre lien expirera dans une heure","item_3":"N\'actualisez pas cette page"},"title":{"message":"Connecté à votre mobile","submessage":"Une fois que vous aurez terminé, nous vous emmènerons à l\'étape suivante"}},"mobile_notification_sent":{"bold_message":"Cela peut prendre quelques minutes pour arriver","resend_link":"Renvoyer le lien","submessage":"Nous avons envoyé un lien sécurisé à %{number}","tips":{"item_1":"Gardez cette fenêtre ouverte lorsque vous utilisez votre mobile","item_2":"Votre lien expirera dans une heure"},"title":"Vérifiez votre mobile"},"phone_number_placeholder":"Entrez votre numéro de mobile","submit":{"action":"Envoyer la vérification","multiple_docs_uploaded":"Documents envoyés","one_doc_uploaded":"Document envoyé","selfie_uploaded":"Selfie envoyé","sub_title":"Nous sommes maintenant prêts à vérifier votre identité","title":"Merci, c\'est tout ce dont nous avons besoin","video_uploaded":"Vidéo envoyée"},"switch_device":{"header":"Prendre une photo avec votre téléphone"},"tips":"Conseils"},"document_selector":{"identity":{"driving_licence_hint":"Recto et verso","hint":"Sélectionnez le type de document que vous souhaitez envoyer","national_identity_card_hint":"Recto et verso","passport_hint":"Page de votre passeport où figure votre photo","title":"Vérification d\'identité"},"proof_of_address":{"benefits_letter_hint":"Government authorised household benefits eg. Jobseeker allowance, Housing benefit, Tax credits","estatements_accepted":"relevés électroniques acceptés","government_letter_hint":"Any government issued letter eg. Benefits entitlement, Voting letters, Tax letters, etc","hint":"Voici les documents les plus susceptibles d\'indiquer votre adresse de résidence actuelle","title":"Sélectionnez un document de %{country}","utility_bill_hint":"Gaz, électricité, eau, ligne fixe ou Internet","utility_bill_warning":"Désolé, pas de factures de mobile"}},"driving_licence":"Permis de conduire","errors":{"camera_inactive_no_fallback":{"instruction":"Assurez-vous que votre appareil est équipé d\'un appareil photo en état de marche"},"camera_inactive":{"instruction":"Vérifiez qu\'il est connecté et fonctionnel. Vous pouvez également <fallback> continuer la vérification sur votre mobile </fallback>","message":"L\'appareil photo ne fonctionne pas ?"},"camera_not_working_no_fallback":{"instruction":"Assurez-vous que l\'appareil photo de votre mobile fonctionne"},"camera_not_working":{"instruction":"Il peut être déconnecté.<fallback> Essayez d\'utiliser votre mobile à la place </fallback>.","message":"L\'appareil photo ne fonctionne pas"},"forbidden_client_error":{"instruction":"Le lien ne fonctionne que sur les appareils mobiles","message":"Quelque chose ne va pas"},"generic_client_error":{"instruction":"Vous devrez redémarrer votre vérification sur votre ordinateur","message":"Quelque chose ne va pas"},"glare_detected":{"instruction":"Tous les détails doivent être clairs et lisibles","message":"Attention aux reflets"},"interrupted_flow_error":{"instruction":"Redémarrez le processus sur un autre appareil","message":"Appareil photo non détecté"},"invalid_capture":{"instruction":"Assurez-vous que le document entier est sur la photo","message":"Aucun document détecté"},"invalid_number":{"message":"Vérifiez que votre numéro est correct"},"invalid_size":{"instruction":"Doit être inférieur à 10MB.","message":"La taille du fichier a été dépassée."},"invalid_type":{"instruction":"Essayez d\'utiliser un autre type de fichier.","message":"Fichier non téléchargé."},"lazy_loading":{"message":"Une erreur s\'est produite lors du chargement du composant"},"liveness_timeout":{"instruction":"Rappelez-vous d\'appuyer sur stop lorsque vous avez terminé. <fallback>Refaire la vidéo</fallback>","message":"Le temps est écoulé"},"multiple_faces":{"instruction":"Votre visage doit être visible sur le selfie","message":"Plusieurs visages détectés"},"no_face":{"instruction":"Votre visage doit être visible sur le selfie","message":"Aucun visage détecté"},"server_error":{"instruction":"Veuillez réessayer","message":"Connexion perdue"},"sms_failed":{"instruction":"Copier le lien sur votre mobile","message":"Quelque chose ne va pas"},"sms_overuse":{"instruction":"Copier le lien sur votre mobile","message":"Trop de tentatives infructueuses"},"unsupported_android_browser":{"instruction":"Redémarrez le processus sur la dernière version de Google Chrome","message":"Navigateur non pris en charge"},"unsupported_file":{"instruction":"Essayez d\'utiliser un fichier JPG ou PNG","message":"Type de fichier non pris en charge"},"unsupported_ios_browser":{"instruction":"Redémarrer le processus sur la dernière version de Safari","message":"Navigateur non pris en charge"}},"government_letter":"Government Letter","image_quality_guide":{"all_good":{"image_alt_text":"Exemple de document","label":"C\'est bon"},"next_step":"Envoyer une photo","no_blur":{"image_alt_text":"Exemple de document flou","label":"Tous les détails doivent être clairs"},"no_glare":{"image_alt_text":"Exemple de document avec reflets","label":"Éloignez-vous de la lumière directe"},"not_cut_off":{"image_alt_text":"Exemple de document tronqué","label":"Afficher tous les détails — y compris les deux dernières lignes"},"sub_title":"Les numérisations et photocopies ne sont pas acceptées","title":"Envoyez la page du passeport où figure votre photo"},"loading":"Chargement","mobilePhrases":{"capture":{"driving_licence":{"back":{"instructions":"Prenez une photo du verso de votre permis"},"front":{"instructions":"Prenez une photo du recto de votre permis"}},"face":{"instructions":"Prenez un selfie"},"national_identity_card":{"back":{"instructions":"Prenez une photo du verso de votre carte"},"front":{"instructions":"Prenez une photo du recto de votre carte"}},"passport":{"front":{"instructions":"Prenez une photo de la page du passeport où figure votre photo"}}},"errors":{"camera_inactive":{"instruction":"Prenez une photo en utilisant le <fallback> mode appareil photo basique </fallback>"},"camera_not_working":{"instruction":"Prenez une photo en utilisant le <fallback> mode appareil photo basique </fallback>"}},"image_quality_guide":{"next_step":"Prendre une photo","title":"Page du passeport où figure votre photo"}},"national_identity_card":"Carte d\'identité","passport":"Passeport","proof_of_address":{"guidance":{"continue":"Continuer","current_address":"Adresse actuelle","full_name":"Nom complet","issue_date":"Issue date or summary period","logo":"Logo","make_sure_it_shows":"Assurez-vous qu\'il montre clairement:"},"intro":{"is_recent":"Est votre document le plus <strong>récent</strong>","matches_signup":"<strong> Correspond à </strong> l\'adresse que vous avez utilisée lors de l\'inscription","requirements":"Vous aurez besoin d\'un document qui :","shows_address":"Indique votre adresse <strong>actuelle</strong>","start":"Commencer la vérification","title":"Vérifions votre adresse %{country}"}},"short_driving_licence":"permis","short_national_identity_card":"carte","short_passport":"passeport","SMS_BODY":"Continuez votre vérification ici","utility_bill":"Facture","webcam_permissions":{"access_denied":"L\'accès à l\'appareil photo n\'est pas autorisé","allow":"Autoriser","allow_access":"Autoriser l\'accès à l\'appareil photo","click_allow":"Nous ne pouvons pas vous vérifier sans utiliser votre appareil photo","enable_webcam":"Activer l\'appareil photo","enable_webcam_for_selfie":"Lorsque vous y serez invité, vous devez autoriser l\'accès à l\'appareil photo pour continuer","follow_steps":"Suivez ces étapes pour autoriser l\'accès à l\'appareil photo :","grant_access":"Autorisez l\'accès à l\'appareil photo à partir des paramètres de votre navigateur","if_denied":"Si vous refusez l\'accès à l\'appareil photo, vous ne pourrez pas prendre de photos et ne pourrez pas compléter la vérification.","recover_access":"Récupérez l\'accès à l\'appareil photo pour continuer la vérification","recovery":"Récupération","refresh":"Actualiser","refresh_page":"Actualisez cette page pour redémarrer la vérification d\'identité","why":"Pourquoi dois-je faire ça ?"},"welcome":{"description_p_1":"Pour ouvrir un compte bancaire, nous devons vérifier votre identité.","description_p_2":"Cela ne prendra que quelques instants.","next_button":"Vérification d\'identité","title":"Ouvrez votre nouveau compte bancaire"}}')},function(e,t,n){e.exports=n(518)},function(e,t,n){e.exports=n(522)},function(e,t,n){var r=n(527),o=n(371),i=n(403),a=n(129)("socket.io-client");e.exports=t=c;var s=t.managers={};function c(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,o=r(e),c=o.source,u=o.id,l=o.path,f=s[u]&&l in s[u].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||f?(a("ignoring socket cache for %s",c),n=i(c,t)):(s[u]||(a("new io instance for %s",c),s[u]=i(c,t)),n=s[u]),o.query&&!t.query&&(t.query=o.query),n.socket(o.path,t)}t.protocol=o.protocol,t.connect=c,t.Manager=n(403),t.Socket=n(409)},function(e,t,n){e.exports=n(549)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){function e(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return e.prototype.memoize=function(e){if(this._hasWeakSet)return!!this._inner.has(e)||(this._inner.add(e),!1);for(var t=0;t<this._inner.length;t++){if(this._inner[t]===e)return!0}return this._inner.push(e),!1},e.prototype.unmemoize=function(e){if(this._hasWeakSet)this._inner.delete(e);else for(var t=0;t<this._inner.length;t++)if(this._inner[t]===e){this._inner.splice(t,1);break}},e}()},function(e,t,n){e.exports={text:"onfido-sdk-ui-Welcome-text"}},function(e,t,n){e.exports={wrapper:"onfido-sdk-ui-Select-wrapper",select:"onfido-sdk-ui-Select-select"}},function(e,t,n){"use strict";
/*! npm.im/supports-webp 1.0.7 */var r="object"==typeof document?document.createElement("canvas"):{};r.width=r.height=1;var o=!!r.toDataURL&&5===r.toDataURL("image/webp").indexOf("image/webp");e.exports=o},function(e,t,n){var r;"undefined"!=typeof self&&self,r=function(e,t,n,r,o,i,a,s,c,u,l,f,p,d,h,v,m,y,g,b,_,k,w,S,O,C,x){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"default",(function(){return ye}));var r,o=n(1),i=n.n(o),a=n(2),s=n.n(a),c=n(3),u=n.n(c),l=n(4),f=n.n(l),p=n(5),d=n.n(p),h=n(6),v=n.n(h),m=n(7),y=n.n(m),g=n(8),b=n.n(g),_=n(9),k=n.n(_),w=n(10),S=n.n(w),O=n(11),C=n.n(O),x=n(12),E=n.n(x),j=n(13),A=n.n(j),P=n(14),T=n.n(P),D=n(15),I=n.n(D),N=n(16),R=n.n(N),M=n(17),L=n.n(M),B=n(18),F=n.n(B),U=n(19),z=n.n(U),q=n(20),W=n.n(q),H=n(21),V=n.n(H),G=n(22),K=n.n(G),Q=n(23),$=n.n(Q),Y=n(24),J=n.n(Y),X=n(25),Z=n.n(X),ee=n(26),te=n.n(ee),ne=n(27),re=n.n(ne),oe=n(28),ie=n(29),ae=n(30),se=n.n(ae),ce=navigator.mediaDevices,ue=ce&&ce.getUserMedia?te()(r=ce.getUserMedia).call(r,ce):null,le=!!ue,fe=function(e){if(e&&"object"===Z()(e.video)){var t=e.video.facingMode;return"environment"===t||"object"===Z()(t)&&t.exact&&"environment"===t.exact?se()().then((function(t){var n=he(t),r=ve(n);if(r&&""===r.deviceId)e.video.facingMode={ideal:"environment"};else{var o=r&&r.deviceId?r.deviceId:n[0].deviceId;e.video.deviceId={exact:o}}return e})):e}},pe=function(e){var t=e.toLowerCase();return J()(ie.a).call(ie.a,(function(e){return $()(t).call(t,e)}))},de=new K.a,he=function(e){var t,n=V()(t=W()(e).call(e,(function(e){return"videoinput"===e.kind}))).call(t,(function(e){if(de.has(e.deviceId))return de.get(e.deviceId);var t=null!==e.label?e.label:"",n={deviceId:e.deviceId,label:t,cameraType:pe(t)?"back":"front"};return""!==t&&de.set(e.deviceId,n),n}));if(n.length>1&&!J()(n).call(n,(function(e){return"back"===e.cameraType}))){var r=n.length-1,o=V()(n).call(n,(function(e){var t=e.label.match(/\b([0-9]+)MP?\b/i);return t?z()(t[1],10):NaN}));J()(o).call(o,(function(e){return isNaN(e)}))||(r=F()(o).call(o,Math.max.apply(Math,L()(o)))),n[r].cameraType="back"}return n},ve=function(e){var t;return R()(t=W()(e).call(e,(function(e){return"back"===e.cameraType}))).call(t,(function(e,t){return e.label.localeCompare(t.label)}))[0]},me=["PermissionDeniedError","NotAllowedError","NotFoundError"],ye=function(e){function t(e){var n;if(b()(this,t),n=S()(this,C()(t).call(this,e)),T()(E()(n),"state",{hasUserMedia:!1,mirrored:!1}),!le){var r=new Error("getUserMedia is not supported by this browser");n.props.onFailure(r)}return n}var n,r;return A()(t,e),k()(t,[{key:"componentDidMount",value:(r=y()(v.a.mark((function e(){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.mountedInstances.push(this),e.next=3,this.requestUserMedia();case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getConstraints",value:function(e,t,n,r){var o={video:{facingMode:n},audio:r};return e&&(o.video.width=z()(e,10)||e),t&&(o.video.height=z()(t,10)||t),o}},{key:"requestUserMedia",value:(n=y()(v.a.mark((function e(){var n,r,o,i,a,s,c,u,l,f,p,h,m;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ue&&ce&&!t.userMediaRequested){e.next=2;break}return e.abrupt("return");case 2:return n=this.props,r=n.width,o=n.height,i=n.facingMode,a=n.audio,s=n.fallbackWidth,c=n.fallbackHeight,u=this.getConstraints(r,o,i,a),l=this.getConstraints(s,c,i,a),f=function(e){return console.log("error",e,Z()(e))},p=function(e){var n;t.userMediaRequested=!1,d()(n=t.mountedInstances).call(n,(function(t){return t.handleUserMedia(e)}))},m=function e(n){var r;t.userMediaRequested=!1,f(n),$()(me).call(me,n.name)||h?d()(r=t.mountedInstances).call(r,(function(e){return e.handleError(n)})):(h=!0,ue(l).then(p).catch(e))},t.userMediaRequested=!0,e.prev=9,e.t0=ue,e.next=13,fe(u);case 13:return e.t1=e.sent,e.next=16,(0,e.t0)(e.t1);case 16:this.stream=e.sent,this.stream&&p(this.stream),e.next=23;break;case 20:e.prev=20,e.t2=e.catch(9),m(e.t2);case 23:case"end":return e.stop()}}),e,this,[[9,20]])}))),function(){return n.apply(this,arguments)})},{key:"handleError",value:function(e){this.setState({hasUserMedia:!1}),this.props.onFailure(e)}},{key:"handleUserMedia",value:function(e){var t=e?e.getVideoTracks()[0].getSettings():{};this.stream=e;var n=this.props.facingMode,r="environment"===n||n&&n.exact&&"environment"===n.exact;this.setState({hasUserMedia:!0,mirrored:!(r||"user"!==t.facingMode&&t.facingMode)}),this.props.onUserMedia()}},{key:"componentWillUnmount",value:function(){var e,n,r=this,o=f()(e=t.mountedInstances).call(e,this);u()(n=t.mountedInstances).call(n,o,1),s()((function(){return function(e){if(e&&e.getVideoTracks){var t=!0,n=!1,r=void 0;try{for(var o,i=I()(e.getVideoTracks());!(t=(o=i.next()).done);t=!0)o.value.stop()}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}if(e&&e.getAudioTracks){var a=!0,s=!1,c=void 0;try{for(var u,l=I()(e.getAudioTracks());!(a=(u=l.next()).done);a=!0)u.value.stop()}catch(e){s=!0,c=e}finally{try{a||null==l.return||l.return()}finally{if(s)throw c}}}}(r.stream)}),1e3)}},{key:"getScreenshot",value:function(){var e=this.getCanvas();return e?e.toDataURL(this.props.screenshotFormat):null}},{key:"getCanvas",value:function(){var e;if(!this.state.hasUserMedia||!this.video)return null;var t=this.video;this.canvas||(this.canvas=document.createElement("canvas"));var n=this.canvas;this.ctx||(this.ctx=n.getContext("2d"));var r=this.ctx;return n.width=t.videoWidth,n.height=t.videoHeight,r.drawImage(t,0,0,n.width,n.height),i()(e="drawn image to canvas: ".concat(n.width,"x")).call(e,n.height),n}},{key:"startRecording",value:function(){this.mediaRecorder=Object(oe.a)(this.stream),this.recordedBlobs=Object(oe.b)(this.mediaRecorder)}},{key:"stopRecording",value:function(){this.mediaRecorder.stop(this.recordedBlobs)}},{key:"getVideoBlob",value:function(){var e=this.mediaRecorder.mimeType.split(";")[0];return new Blob(this.recordedBlobs,{type:e})}},{key:"render",value:function(){var e=this;return this.stream?re.a.createElement("video",{style:{transform:this.state.mirrored?"scaleX(-1)":""},ref:function(t){return e.video=t},autoPlay:!0,playsinline:!0,srcObject:this.stream,muted:!0,className:this.props.className}):null}}]),t}(ne.Component);T()(ye,"defaultProps",{audio:!1,screenshotFormat:"image/webp",onUserMedia:function(){},onFailure:function(){}}),T()(ye,"mountedInstances",[]),T()(ye,"userMediaRequested",!1)},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t){e.exports=i},function(e,t){e.exports=a},function(e,t){e.exports=s},function(e,t){e.exports=c},function(e,t){e.exports=u},function(e,t){e.exports=l},function(e,t){e.exports=f},function(e,t){e.exports=p},function(e,t){e.exports=d},function(e,t){e.exports=h},function(e,t){e.exports=v},function(e,t){e.exports=m},function(e,t){e.exports=y},function(e,t){e.exports=g},function(e,t){e.exports=b},function(e,t){e.exports=_},function(e,t){e.exports=k},function(e,t){e.exports=w},function(e,t){e.exports=S},function(e,t){e.exports=O},function(e,t){e.exports=C},function(e,t){e.exports=x},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=window.MediaRecorder,o=function(e){console.log("Recorder stopped: ",e)},i=function(e){var t=function(){var e=["video/webm;codecs=vp9","video/webm;codecs=vp8,opus","video/webm;codecs=vp8","video/webm"],t="";for(var n in e){if(r.isTypeSupported(e[n])){t=e[n];break}console.log("".concat(e[n]," is not Supported"))}return t?{mimeType:t}:{mimeType:""}}();try{return new r(e,t)}catch(e){return void console.error("Exception while creating MediaRecorder: ".concat(e))}},a=function(e){var t=[];return e.onstop=o,e.ondataavailable=function(e){return function(e,t){e.data&&e.data.size>0&&t.push(e.data)}(e,t)},e.start(10),console.log("MediaRecorder started",e),t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=["rear","back","world","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"]},function(e,t){e.exports=function(e){if("function"!=typeof Promise){var t=new Error("Device enumeration not supported.");if(t.kind="METHOD_NOT_AVAILABLE",e)return console.warn("module now uses promise based api - callback is deprecated"),e(t);throw t}return new Promise((function(t,n){var r=function(n){for(var r=[],o=0;o<n.length;o++){var i=n[o],a=i.kind||null;a&&"audio"===a.toLowerCase()?a="audioinput":a&&"video"===a.toLowerCase()&&(a="videoinput"),r.push({facing:i.facing||null,deviceId:i.id||i.deviceId||null,label:i.label||null,kind:a,groupId:i.groupId||null})}t(r),e&&(console.warn("module now uses promise based api - callback is deprecated"),e(null,r))};if(window.navigator&&window.navigator.mediaDevices&&window.navigator.mediaDevices.enumerateDevices)window.navigator.mediaDevices.enumerateDevices().then(r);else if(window.MediaStreamTrack&&window.MediaStreamTrack.getSources)window.MediaStreamTrack.getSources(r);else{var o=new Error("Device enumeration not supported.");o.kind="METHOD_NOT_AVAILABLE",n(o),e&&(console.warn("module now uses promise based api - callback is deprecated"),e(o))}}))}}])},e.exports=r(n(5),n(87),n(555),n(172),n(13),n(302),n(376),n(7),n(11),n(10),n(4),n(2),n(8),n(1),n(291),n(571),n(57),n(576),n(153),n(21),n(33),n(375),n(44),n(65),n(98),n(278),n(20))},function(e,t,n){e.exports=n(583)},function(e,t,n){e.exports={unsupportedBrowserIcon:"onfido-sdk-ui-GenericError-unsupportedBrowserIcon",flowInterruptedIcon:"onfido-sdk-ui-GenericError-flowInterruptedIcon",genericErrorIcon:"onfido-sdk-ui-GenericError-genericErrorIcon"}},function(e,t,n){var r,o,i;o=[],void 0===(i="function"==typeof(r=function(){"use strict";if("undefined"==typeof window||"undefined"==typeof navigator)return!1;var e,t,n,r,o,i,a,s,c,u,l,f=void 0!==navigator.mimeTypes["application/pdf"],p=/iphone|ipad|ipod/i.test(navigator.userAgent.toLowerCase());return t=function(e){var t;try{t=new ActiveXObject(e)}catch(e){t=null}return t},n=function(){return!(!window.ActiveXObject&&!("ActiveXObject"in window))},r=function(){return!(!t("AcroPDF.PDF")&&!t("PDF.PdfCtrl"))},e=f||n()&&r(),o=function(e){var t,n="";if(e){for(t in e)e.hasOwnProperty(t)&&(n+=encodeURIComponent(t)+"="+encodeURIComponent(e[t])+"&");n&&(n=(n="#"+n).slice(0,n.length-1))}return n},i=function(e){"undefined"!=typeof console&&console.log&&console.log("[PDFObject] "+e)},a=function(e){return i(e),!1},c=function(e){var t=document.body;return"string"==typeof e?t=document.querySelector(e):"undefined"!=typeof jQuery&&e instanceof jQuery&&e.length?t=e.get(0):void 0!==e.nodeType&&1===e.nodeType&&(t=e),t},u=function(e,t,n,r,o){var i=r+"?file="+encodeURIComponent(t)+n,a="<div style='"+(p?"-webkit-overflow-scrolling: touch; overflow-y: scroll; ":"overflow: hidden; ")+"position: absolute; top: 0; right: 0; bottom: 0; left: 0;'><iframe "+o+" src='"+i+"' style='border: none; width: 100%; height: 100%;' frameborder='0'></iframe></div>";return e.className+=" pdfobject-container",e.style.position="relative",e.style.overflow="auto",e.innerHTML=a,e.getElementsByTagName("iframe")[0]},l=function(e,t,n,r,o,i,a){var s="";return s=t&&t!==document.body?"width: "+o+"; height: "+i+";":"position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;",e.className+=" pdfobject-container",e.innerHTML="<embed "+a+" class='pdfobject' src='"+n+r+"' type='application/pdf' style='overflow: auto; "+s+"'/>",e.getElementsByTagName("embed")[0]},s=function(t,n,r){if("string"!=typeof t)return a("URL is not valid");n=void 0!==n&&n;var i,s=(r=void 0!==r?r:{}).id&&"string"==typeof r.id?"id='"+r.id+"'":"",f=!!r.page&&r.page,p=r.pdfOpenParams?r.pdfOpenParams:{},d=void 0===r.fallbackLink||r.fallbackLink,h=r.width?r.width:"100%",v=r.height?r.height:"100%",m="boolean"==typeof r.forcePDFJS&&r.forcePDFJS,y=!!r.PDFJS_URL&&r.PDFJS_URL,g=c(n),b="";return g?(f&&(p.page=f),i=o(p),m&&y?u(g,t,i,y,s):e?l(g,n,t,i,h,v,s):y?u(g,t,i,y,s):(d&&(b="string"==typeof d?d:"<p>This browser does not support inline PDFs. Please download the PDF to view it: <a href='[url]'>Download PDF</a></p>",g.innerHTML=b.replace(/\[url\]/g,t)),a("This browser does not support embedded PDFs"))):a("Target element cannot be determined")},{embed:function(e,t,n){return s(e,t,n)},pdfobjectversion:"2.0.201604172",supportsPDFs:e}})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){e.exports={container:"onfido-sdk-ui-Pannable-container"}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){return(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}).apply(this,arguments)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(n,!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function f(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?d(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=n(20),g=(n(56),n(584)),b=n(424);function _(e){for(var t="",n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r<2048?(t+=String.fromCharCode(192|r>>6),t+=String.fromCharCode(128|63&r)):r<55296||r>=57344?(t+=String.fromCharCode(224|r>>12),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|63&r)):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t+=String.fromCharCode(240|r>>18),t+=String.fromCharCode(128|r>>12&63),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|63&r))}return t}var k={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1};function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return e.forEach((function(e,r){var o=null;e.forEach((function(i,a){if(!i&&null!==o)return n.push("M".concat(o+t," ").concat(r+t,"h").concat(a-o,"v1H").concat(o+t,"z")),void(o=null);if(a!==e.length-1)i&&null===o&&(o=a);else{if(!i)return;null===o?n.push("M".concat(a+t,",").concat(r+t," h1v1H").concat(a+t,"z")):n.push("M".concat(o+t,",").concat(r+t," h").concat(a+1-o,"v1H").concat(o+t,"z"))}}))})),n.join("")}function S(e,t){return e.slice().map((function(e,n){return n<t.y||n>=t.y+t.h?e:e.map((function(e,n){return(n<t.x||n>=t.x+t.w)&&e}))}))}function O(e,t){var n=e.imageSettings,r=e.size,o=e.includeMargin;if(null==n)return null;var i=o?4:0,a=t.length+2*i,s=Math.floor(.1*r),c=a/r,u=(n.width||s)*c,l=(n.height||s)*c,f=null==n.x?t.length/2-u/2:n.x*c,p=null==n.y?t.length/2-l/2:n.y*c,d=null;if(n.excavate){var h=Math.floor(f),v=Math.floor(p);d={x:h,y:v,w:Math.ceil(u+f-h),h:Math.ceil(l+p-v)}}return{x:f,y:p,h:l,w:u,excavation:d}}var C=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}(),x=function(e){function t(){var e,n;c(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return m(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(o)))),"_canvas",void 0),m(d(n),"_image",void 0),m(d(n),"state",{imgLoaded:!1}),m(d(n),"handleImageLoad",(function(){n.setState({imgLoaded:!0})})),n}return h(t,e),l(t,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var e=this.props,t=e.value,n=e.size,r=e.level,o=e.bgColor,i=e.fgColor,a=e.includeMargin,s=e.imageSettings,c=new g(-1,b[r]);if(c.addData(_(t)),c.make(),null!=this._canvas){var u=this._canvas,l=u.getContext("2d");if(!l)return;var f=c.modules;if(null===f)return;var p=a?4:0,d=f.length+2*p,h=O(this.props,f);null!=s&&null!=h&&null!=h.excavation&&(f=S(f,h.excavation));var v=window.devicePixelRatio||1;u.height=u.width=n*v;var m=n/d*v;l.scale(m,m),l.fillStyle=o,l.fillRect(0,0,d,d),l.fillStyle=i,C?l.fill(new Path2D(w(f,p))):f.forEach((function(e,t){e.forEach((function(e,n){e&&l.fillRect(n+p,t+p,1,1)}))})),this.state.imgLoaded&&this._image&&null!=h&&l.drawImage(this._image,h.x+p,h.y+p,h.w,h.h)}}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.size),r=(t.level,t.bgColor,t.fgColor,t.style),i=(t.includeMargin,t.imageSettings),c=s(t,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),u=a({height:n,width:n},r),l=null,f=i&&i.src;return null!=i&&null!=f&&(l=y.createElement("img",{src:f,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(t){return e._image=t}})),y.createElement(y.Fragment,null,y.createElement("canvas",o({style:u,height:n,width:n,ref:function(t){return e._canvas=t}},c)),l)}}]),t}(y.PureComponent);m(x,"defaultProps",k);var E=function(e){function t(){return c(this,t),f(this,p(t).apply(this,arguments))}return h(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.value,n=e.size,r=e.level,i=e.bgColor,a=e.fgColor,c=e.includeMargin,u=e.imageSettings,l=s(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),f=new g(-1,b[r]);f.addData(_(t)),f.make();var p=f.modules;if(null===p)return null;var d=c?4:0,h=p.length+2*d,v=O(this.props,p),m=null;null!=u&&null!=v&&(null!=v.excavation&&(p=S(p,v.excavation)),m=y.createElement("image",{xlinkHref:u.src,height:v.h,width:v.w,x:v.x+d,y:v.y+d,preserveAspectRatio:"none"}));var k=w(p,d);return y.createElement("svg",o({shapeRendering:"crispEdges",height:n,width:n,viewBox:"0 0 ".concat(h," ").concat(h)},l),y.createElement("path",{fill:i,d:"M0,0 h".concat(h,"v").concat(h,"H0z")}),y.createElement("path",{fill:a,d:k}),m)}}]),t}(y.PureComponent);m(E,"defaultProps",k);var j=function(e){var t=e.renderAs,n=s(e,["renderAs"]),r="svg"===t?E:x;return y.createElement(r,n)};j.defaultProps=a({renderAs:"canvas"},k),e.exports=j},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCountryCodes=function(e){return Object.keys(e).filter((function(e){return 2===e.length&&e.toUpperCase()===e&&"ZZ"!==e&&r.indexOf(e)<0}))},t.getCountryCodeForFlag=function(e){switch(e){case"AC":case"TA":return"SH";default:return e}};var r=t.SKIP_COUNTRIES=["001"]},function(e){e.exports=JSON.parse('{"ext":"ext.","country":"Country","phone":"Phone","AB":"Abkhazia","AC":"Ascension Island","AD":"Andorra","AE":"United Arab Emirates (الإمارات العربية المتحدة)","AF":"Afghanistan (افغانستان)","AG":"Antigua and Barbuda","AI":"Anguilla","AL":"Albania (Shqipëri)","AM":"Armenia (Հայաստան)","AO":"Angola","AQ":"Antarctica","AR":"Argentina","AS":"American Samoa (Amerika Sāmoa)","AT":"Austria (Österreich)","AU":"Australia","AW":"Aruba","AX":"Åland Islands","AZ":"Azerbaijan (Azərbaycan)","BA":"Bosnia and Herzegovina","BB":"Barbados","BD":"Bangladesh (বাংলাদেশ)","BE":"Belgium (België)","BF":"Burkina Faso","BG":"Bulgaria (България)","BH":"Bahrain (البحرين)","BI":"Burundi (Uburundi)","BJ":"Benin (Bénin)","BL":"Saint Barthélemy (Saint-Barthélemy)","BM":"Bermuda","BN":"Brunei (Negara Brunei Darussalam)","BO":"Bolivia","BQ":"Caribbean Netherlands","BR":"Brazil (Brasil)","BS":"Bahamas","BT":"Bhutan (འབྲུག)","BV":"Bouvet Island","BW":"Botswana","BY":"Belarus (Беларусь)","BZ":"Belize","CA":"Canada","CC":"Cocos (Keeling) Islands","CD":"Congo (DRC) (Kongo)","CF":"Central African Republic","CG":"Congo (Republic) (Congo-Brazzaville)","CH":"Switzerland (Schweiz)","CI":"Côte d’Ivoire","CK":"Cook Islands","CL":"Chile","CM":"Cameroon (Cameroun)","CN":"China (中国)","CO":"Colombia","CR":"Costa Rica","CU":"Cuba","CV":"Cape Verde (Kabu Verdi)","CW":"Curaçao","CX":"Christmas Island","CY":"Cyprus (Κύπρος)","CZ":"Czech Republic (Česká republika)","DE":"Germany (Deutschland)","DJ":"Djibouti","DK":"Denmark (Danmark)","DM":"Dominica","DO":"Dominican Republic","DZ":"Algeria (الجزائر)","EC":"Ecuador","EE":"Estonia (Eesti)","EG":"Egypt (مصر)","EH":"Western Sahara (الصحراء الغربية)","ER":"Eritrea","ES":"Spain (España)","ET":"Ethiopia","FI":"Finland (Suomi)","FJ":"Fiji (Matanitu Tugalala o Viti)","FK":"Falkland Islands (Islas Malvinas)","FM":"Micronesia","FO":"Faroe Islands (Føroyar)","FR":"France (République française)","GA":"Gabon (République gabonaise)","GB":"United Kingdom","GD":"Grenada","GE":"Georgia (საქართველო)","GF":"French Guiana (Guyane française)","GG":"Guernsey","GH":"Ghana (Gaana)","GI":"Gibraltar","GL":"Greenland (Kalaallit Nunaat)","GM":"Gambia","GN":"Guinea (Guinée)","GP":"Guadeloupe","GQ":"Equatorial Guinea (Guinea Ecuatorial)","GR":"Greece (Ελλάδα)","GS":"South Georgia and the South Sandwich Islands","GT":"Guatemala","GU":"Guam (Guåhån)","GW":"Guinea-Bissau (Guiné Bissau)","GY":"Guyana","HK":"Hong Kong (香港)","HM":"Heard Island and McDonald Islands","HN":"Honduras","HR":"Croatia (Hrvatska)","HT":"Haiti (République d\'Haïti)","HU":"Hungary (Magyarország)","ID":"Indonesia","IE":"Ireland","IL":"Israel (ישראל)","IM":"Isle of Man","IN":"India (भारत)","IO":"British Indian Ocean Territory","IQ":"Iraq (العراق)","IR":"Iran (ایران)","IS":"Iceland (Ísland)","IT":"Italy (Italia)","JE":"Jersey","JM":"Jamaica","JO":"Jordan (الأردن)","JP":"Japan (日本)","KE":"Kenya","KG":"Kyrgyzstan (Кыргызстан)","KH":"Cambodia (កម្ពុជា)","KI":"Kiribati","KM":"Comoros (جزر القمر)","KN":"Saint Kitts and Nevis","KP":"North Korea (조선 민주주의 인민 공화국)","KR":"South Korea (대한민국)","KW":"Kuwait (الكويت)","KY":"Cayman Islands","KZ":"Kazakhstan (Казахстан)","LA":"Laos (ລາວ)","LB":"Lebanon (لبنان)","LC":"Saint Lucia","LI":"Liechtenstein","LK":"Sri Lanka (ශ්රී ලංකාව)","LR":"Liberia","LS":"Lesotho","LT":"Lithuania (Lietuva)","LU":"Luxembourg (Lëtzebuerg)","LV":"Latvia (Latvija)","LY":"Libya (ليبيا)","MA":"Morocco (المغرب)","MC":"Monaco","MD":"Moldova (Republica Moldova)","ME":"Montenegro (Crna Gora)","MF":"Saint Martin (Saint-Martin)","MG":"Madagascar (Madagasikara)","MH":"Marshall Islands","MK":"Macedonia (FYROM) (Македонија)","ML":"Mali","MM":"Myanmar (Burma) (မြန်မာ)","MN":"Mongolia (Монгол)","MO":"Macau (澳門)","MP":"Northern Mariana Islands","MQ":"Martinique","MR":"Mauritania (موريتانيا)","MS":"Montserrat","MT":"Malta","MU":"Mauritius (Moris)","MV":"Maldives","MW":"Malawi (Malaŵi)","MX":"Mexico (México)","MY":"Malaysia","MZ":"Mozambique (Moçambique)","NA":"Namibia (Namibië)","NC":"New Caledonia (Nouvelle-Calédonie)","NE":"Niger (Nijar)","NF":"Norfolk Island","NG":"Nigeria","NI":"Nicaragua","NL":"Netherlands (Nederland)","NO":"Norway (Norge)","NP":"Nepal (नेपाल)","NR":"Nauru (Repubrikin Naoero)","NU":"Niue (Niuē)","NZ":"New Zealand","OM":"Oman (عُمان)","OS":"South Ossetia","PA":"Panama (Panamá)","PE":"Peru (Perú)","PF":"French Polynesia (Polynésie française)","PG":"Papua New Guinea","PH":"Philippines (Republika ng Pilipinas)","PK":"Pakistan (پاکستان)","PL":"Poland (Polska)","PM":"Saint Pierre and Miquelon","PN":"Pitcairn","PR":"Puerto Rico","PS":"Palestine (فلسطين)","PT":"Portugal (República Portuguesa)","PW":"Palau (Beluu er a Belau)","PY":"Paraguay (Tetã Paraguái)","QA":"Qatar (قطر)","RE":"Réunion (La Réunion)","RO":"Romania (România)","RS":"Serbia (Србија)","RU":"Russia (Россия)","RW":"Rwanda","SA":"Saudi Arabia (المملكة العربية السعودية)","SB":"Solomon Islands","SC":"Seychelles (Repiblik Sesel)","SD":"Sudan (السودان)","SE":"Sweden (Sverige)","SG":"Singapore (Singapura) (新加坡共和国)","SH":"Saint Helena","SI":"Slovenia (Slovenija)","SJ":"Svalbard and Jan Mayen","SK":"Slovakia (Slovensko)","SL":"Sierra Leone","SM":"San Marino","SN":"Senegal (Sénégal)","SO":"Somalia (Soomaaliya)","SR":"Suriname","SS":"South Sudan (جنوب السودان)","ST":"São Tomé and Príncipe","SV":"El Salvador","SX":"Sint Maarten","SY":"Syria (سوريا)","SZ":"Swaziland (Umbuso weSwatini)","TA":"Tristan da Cunha","TC":"Turks and Caicos Islands","TD":"Chad (Tchad)","TF":"French Southern Territories","TG":"Togo (République togolaise)","TH":"Thailand (ไทย)","TJ":"Tajikistan (Ҷумҳурии Тоҷикистон)","TK":"Tokelau","TL":"Timor-Leste (Timór-Leste)","TM":"Turkmenistan (Türkmenistan)","TN":"Tunisia (تونس)","TO":"Tonga","TR":"Turkey (Türkiye)","TT":"Trinidad and Tobago","TV":"Tuvalu","TW":"Taiwan (台灣)","TZ":"Tanzania","UA":"Ukraine (Україна)","UG":"Uganda","UM":"United States Minor Outlying Islands","US":"United States","UY":"Uruguay","UZ":"Uzbekistan (Oʻzbekiston)","VA":"Vatican City (Città del Vaticano)","VC":"Saint Vincent and the Grenadines","VE":"Venezuela","VG":"British Virgin Islands","VI":"U.S. Virgin Islands","VN":"Vietnam (Việt Nam)","VU":"Vanuatu","WF":"Wallis and Futuna (Wallis-et-Futuna)","WS":"Samoa (Sāmoa)","XK":"Kosovo","YE":"Yemen (اليمن)","YT":"Mayotte","ZA":"South Africa","ZM":"Zambia","ZW":"Zimbabwe","ZZ":"International"}')},function(e,t){!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,r;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}()},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(20),o=a(n(56)),i=a(n(387));a(n(388));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.store=n.store,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return r.Children.only(this.props.children)},t}(r.Component);t.default=s,s.propTypes={store:i.default.isRequired,children:o.default.element.isRequired},s.childContextTypes={store:i.default.isRequired}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t,n){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},k=Boolean(e),w=e||h,S=void 0;S="function"==typeof t?t:t?(0,s.default)(t):v;var O=n||m,C=l.pure,x=void 0===C||C,E=l.withRef,j=void 0!==E&&E,A=x&&O!==m,P=_++;return function(e){var t="Connect("+y(e)+")";var n=function(n){function i(e,r){f(this,i);var o=p(this,n.call(this,e,r));o.version=P,o.store=e.store||r.store,(0,u.default)(o.store,'Could not find "store" in either the context or props of "'+t+'". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "'+t+'".');var a=o.store.getState();return o.state={storeState:a},o.clearCache(),o}return d(i,n),i.prototype.shouldComponentUpdate=function(){return!x||this.haveOwnPropsChanged||this.hasStoreStateChanged},i.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState();return this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n)},i.prototype.configureFinalMapState=function(e,t){var n=w(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:w,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},i.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch;return this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n)},i.prototype.configureFinalMapDispatch=function(e,t){var n=S(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:S,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},i.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,a.default)(e,this.stateProps))&&(this.stateProps=e,!0)},i.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,a.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},i.prototype.updateMergedPropsIfNeeded=function(){var e,t,n,r=(e=this.stateProps,t=this.dispatchProps,n=this.props,O(e,t,n));return!(this.mergedProps&&A&&(0,a.default)(r,this.mergedProps))&&(this.mergedProps=r,!0)},i.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},i.prototype.trySubscribe=function(){k&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},i.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},i.prototype.componentDidMount=function(){this.trySubscribe()},i.prototype.componentWillReceiveProps=function(e){x&&(0,a.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},i.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},i.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},i.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!x||t!==e){if(x&&!this.doStatePropsDependOnOwnProps){var n=b(this.updateStatePropsIfNeeded,this);if(!n)return;n===g&&(this.statePropsPrecalculationError=g.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},i.prototype.getWrappedInstance=function(){return(0,u.default)(j,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},i.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,i=this.haveStatePropsBeenPrecalculated,a=this.statePropsPrecalculationError,s=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,a)throw a;var c=!0,u=!0;x&&s&&(c=n||t&&this.doStatePropsDependOnOwnProps,u=t&&this.doDispatchPropsDependOnOwnProps);var l=!1,f=!1;i?l=!0:c&&(l=this.updateStatePropsIfNeeded()),u&&(f=this.updateDispatchPropsIfNeeded());return!(!!(l||f||t)&&this.updateMergedPropsIfNeeded())&&s?s:(this.renderedElement=j?(0,o.createElement)(e,r({},this.mergedProps,{ref:"wrappedInstance"})):(0,o.createElement)(e,this.mergedProps),this.renderedElement)},i}(o.Component);return n.displayName=t,n.WrappedComponent=e,n.contextTypes={store:i.default},n.propTypes={store:i.default},(0,c.default)(n,e)}};var o=n(20),i=l(n(387)),a=l(n(458)),s=l(n(459)),c=(l(n(388)),l(n(336)),l(n(300))),u=l(n(165));function l(e){return e&&e.__esModule?e:{default: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)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(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 h=function(e){return{}},v=function(e){return{dispatch:e}},m=function(e,t,n){return r({},n,e,t)};function y(e){return e.displayName||e.name||"Component"}var g={value:null};function b(e,t){try{return e.apply(t)}catch(e){return g.value=e,g}}var _=0},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i++)if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;return!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return function(t){return(0,r.bindActionCreators)(e,t)}};var r=n(130)},function(e,t,n){var r=n(390),o=n(463),i=n(464),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(462),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(95))},function(e,t,n){var r=n(390),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(466)(Object.getPrototypeOf,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";(function(t){e.exports=n(469)(t||window||this)}).call(this,n(95))},function(e,t,n){"use strict";e.exports=function(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){for(var t=Object.keys(e),n={},o=0;o<t.length;o++){var a=t[o];"function"==typeof e[a]&&(n[a]=e[a])}var s,c=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:r.ActionTypes.INIT}))throw new Error('Reducer "'+t+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+r.ActionTypes.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.')}))}(n)}catch(e){s=e}return function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];if(s)throw s;for(var r=!1,o={},a=0;a<c.length;a++){var u=c[a],l=n[u],f=e[u],p=l(f,t);if(void 0===p){var d=i(u,t);throw new Error(d)}o[u]=p,r=r||p!==f}return r?o:e}};var r=n(389);o(n(336)),o(n(391));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state.'}},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}t.__esModule=!0,t.default=function(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),o={},i=0;i<n.length;i++){var a=n[i],s=e[a];"function"==typeof s&&(o[a]=r(s,t))}return o}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,o,i){var s,c=e(n,o,i),u=c.dispatch,l={getState:c.getState,dispatch:function(e){return u(e)}};return s=t.map((function(e){return e(l)})),u=a.default.apply(void 0,s)(c.dispatch),r({},c,{dispatch:u})}}};var o,i=n(392),a=(o=i)&&o.__esModule?o:{default:o}},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(20),i=n(20),a=n(474),s=o.createFactory(n(475)),c=n(394),u=n(478),l=n(20).unstable_renderSubtreeIntoContainer,f=a.canUseDOM?window.HTMLElement:{},p=(a.canUseDOM&&document.body,o.createClass({displayName:"Modal",statics:{setAppElement:function(e){c.setElement(e)},injectCSS:function(){}},propTypes:{isOpen:o.PropTypes.bool.isRequired,style:o.PropTypes.shape({content:o.PropTypes.object,overlay:o.PropTypes.object}),portalClassName:o.PropTypes.string,bodyClassName:o.PropTypes.string,appElement:o.PropTypes.instanceOf(f),onAfterOpen:o.PropTypes.func,onRequestClose:o.PropTypes.func,closeTimeoutMS:o.PropTypes.number,ariaHideApp:o.PropTypes.bool,shouldCloseOnOverlayClick:o.PropTypes.bool},getDefaultProps:function(){return{isOpen:!1,portalClassName:"ReactModalPortal",bodyClassName:"ReactModal__Body",ariaHideApp:!0,closeTimeoutMS:0,shouldCloseOnOverlayClick:!0}},componentDidMount:function(){this.node=document.createElement("div"),this.node.className=this.props.portalClassName,document.body.appendChild(this.node),this.renderPortal(this.props)},componentWillReceiveProps:function(e){this.renderPortal(e)},componentWillUnmount:function(){i.unmountComponentAtNode(this.node),document.body.removeChild(this.node),u(document.body).remove(this.openBodyClass())},openBodyClass:function(){return this.props.bodyClassName+"--open"},renderPortal:function(e){e.isOpen?u(document.body).add(this.openBodyClass()):u(document.body).remove(this.openBodyClass()),e.ariaHideApp&&c.toggle(e.isOpen,e.appElement),this.portal=l(this,s(r({},e,{defaultStyles:p.defaultStyles})),this.node)},render:function(){return o.DOM.noscript()}}));p.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},e.exports=p},function(e,t,n){var r;
/*!
Copyright (c) 2015 Jed Watson.
Based on code that is Copyright 2013-2015, Facebook, Inc.
All rights reserved.
*/!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(20),i=o.DOM.div,a=n(476),s=n(394),c=n(477),u=0,l={onAfterClose:function(){},style:{overlay:{},content:{}},overlayClassName:"ReactModal__Overlay",className:"ReactModal__Content"};e.exports=o.createClass({displayName:"ModalPortal",shouldClose:null,getDefaultProps:function(){return l},getInitialState:function(){return{afterOpen:!1,beforeClose:!1}},componentDidMount:function(){this.props.isOpen&&(this.setFocusAfterRender(!0),this.open())},componentWillUnmount:function(){clearTimeout(this.closeTimer)},componentWillReceiveProps:function(e){!this.props.isOpen&&e.isOpen?(this.setFocusAfterRender(!0),this.open()):this.props.isOpen&&!e.isOpen&&this.close()},componentDidUpdate:function(){this.focusAfterRender&&(this.focusContent(),this.setFocusAfterRender(!1))},setFocusAfterRender:function(e){this.focusAfterRender=e},open:function(){this.beforeOpen(),this.state.afterOpen&&this.state.beforeClose?(clearTimeout(this.closeTimer),this.setState({beforeClose:!1})):(a.setupScopedFocus(this.node),a.markForFocusLater(),this.setState({isOpen:!0},function(){this.setState({afterOpen:!0}),this.props.isOpen&&this.props.onAfterOpen&&this.props.onAfterOpen()}.bind(this)))},close:function(){this.ownerHandlesClose()&&(this.props.closeTimeoutMS>0?this.closeWithTimeout():this.closeWithoutTimeout())},focusContent:function(){this.refs.content&&!this.contentHasFocus()&&this.refs.content.focus()},closeWithTimeout:function(){this.setState({beforeClose:!0},function(){this.closeTimer=setTimeout(this.closeWithoutTimeout,this.props.closeTimeoutMS)}.bind(this))},closeWithoutTimeout:function(){this.setState({beforeClose:!1,isOpen:!1,afterOpen:!1},this.afterClose)},afterClose:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.onAfterClose;n&&u>0&&0===(u-=1)&&s.show(t),a.returnFocus(),a.teardownScopedFocus(),r()},beforeOpen:function(){var e=this.props,t=e.appElement;e.ariaHideApp&&(u+=1,s.hide(t))},handleKeyDown:function(e){9==e.keyCode&&c(this.refs.content,e),27==e.keyCode&&(e.preventDefault(),this.requestClose(e))},handleOverlayMouseDown:function(e){null===this.shouldClose&&(this.shouldClose=!0)},handleOverlayMouseUp:function(e){this.shouldClose&&this.props.shouldCloseOnOverlayClick&&(this.ownerHandlesClose()?this.requestClose(e):this.focusContent()),this.shouldClose=null},handleContentMouseDown:function(e){this.shouldClose=!1},handleContentMouseUp:function(e){this.shouldClose=!1},requestClose:function(e){this.ownerHandlesClose()&&this.props.onRequestClose(e)},ownerHandlesClose:function(){return this.props.onRequestClose},shouldBeClosed:function(){return!this.props.isOpen&&!this.state.beforeClose},contentHasFocus:function(){return document.activeElement===this.refs.content||this.refs.content.contains(document.activeElement)},buildClassName:function(e){var t=e+" ";return this.state.afterOpen&&(t+=e+"--after-open"),this.state.beforeClose&&(t+=e+"--before-close"),t},getPropInlineStyle:function(e,t){var n=e?this.props.defaultStyles[t]:{},o=this.props.style[t]||{};return r({},n,o)},isPropEqualToDefault:function(e){return this.props[e]===l[e]},render:function(){var e=this.getPropInlineStyle(this.isPropEqualToDefault("className"),"content"),t=this.getPropInlineStyle(this.isPropEqualToDefault("overlayClassName"),"overlay");return this.shouldBeClosed()?i():i({ref:"overlay",className:this.buildClassName(this.props.overlayClassName),style:t,onMouseDown:this.handleOverlayMouseDown,onMouseUp:this.handleOverlayMouseUp},i({ref:"content",style:e,className:this.buildClassName(this.props.className),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentMouseDown,onMouseUp:this.handleContentMouseUp,role:"dialog","aria-label":this.props.contentLabel},this.props.children))}})},function(e,t,n){"use strict";var r=n(393),o=null,i=null,a=!1;function s(e){a=!0}function c(e){if(a){if(a=!1,!o)return;setTimeout((function(){o.contains(document.activeElement)||(r(o)[0]||o).focus()}),0)}}t.markForFocusLater=function(){i=document.activeElement},t.returnFocus=function(){try{i.focus()}catch(e){console.warn("You tried to return focus to "+i+" but it is not in the DOM anymore")}i=null},t.setupScopedFocus=function(e){o=e,window.addEventListener?(window.addEventListener("blur",s,!1),document.addEventListener("focus",c,!0)):(window.attachEvent("onBlur",s),document.attachEvent("onFocus",c))},t.teardownScopedFocus=function(){o=null,window.addEventListener?(window.removeEventListener("blur",s),document.removeEventListener("focus",c)):(window.detachEvent("onBlur",s),document.detachEvent("onFocus",c))}},function(e,t,n){"use strict";var r=n(393);e.exports=function(e,t){var n=r(e);n.length?n[t.shiftKey?0:n.length-1]!==document.activeElement&&e!==document.activeElement||(t.preventDefault(),n[t.shiftKey?n.length-1:0].focus()):t.preventDefault()}},function(e,t){function n(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function r(e){if(!(this instanceof r))return new r(e);e||(e={}),e.nodeType&&(e={el:e}),this.opts=e,this.el=e.el||document.body,"object"!=typeof this.el&&(this.el=document.querySelector(this.el))}e.exports=function(e){return new r(e)},r.prototype.add=function(e){var t=this.el;if(t){if(""===t.className)return t.className=e;var r=t.className.split(" ");return n(r,e)>-1||(r.push(e),t.className=r.join(" ")),r}},r.prototype.remove=function(e){var t=this.el;if(t&&""!==t.className){var r=t.className.split(" "),o=n(r,e);return o>-1&&r.splice(o,1),t.className=r.join(" "),r}},r.prototype.has=function(e){var t=this.el;if(t)return n(t.className.split(" "),e)>-1},r.prototype.toggle=function(e){this.el&&(this.has(e)?this.remove(e):this.add(e))}},function(e,t,n){var r=n(480);e.exports=r},function(e,t,n){n(481);var r=n(22);e.exports=r.Date.now},function(e,t,n){n(9)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},function(e,t,n){var r=n(288);e.exports=r},function(e,t,n){var r=n(484);e.exports=r},function(e,t,n){var r=n(485),o=Array.prototype;e.exports=function(e){var t=e.some;return e===o||e instanceof Array&&t===o.some?r:t}},function(e,t,n){n(486);var r=n(36);e.exports=r("Array").some},function(e,t,n){"use strict";var r=n(9),o=n(55).some,i=n(79),a=n(43),s=i("some"),c=a("some");r({target:"Array",proto:!0,forced:!s||!c},{some:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(488);e.exports=r},function(e,t,n){var r=n(489),o=Array.prototype;e.exports=function(e){var t=e.every;return e===o||e instanceof Array&&t===o.every?r:t}},function(e,t,n){n(490);var r=n(36);e.exports=r("Array").every},function(e,t,n){"use strict";var r=n(9),o=n(55).every,i=n(79),a=n(43),s=i("every"),c=a("every");r({target:"Array",proto:!0,forced:!s||!c},{every:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(286);e.exports=r},function(e,t,n){var r=n(493);e.exports=r},function(e,t,n){var r=n(494),o=String.prototype;e.exports=function(e){var t=e.trim;return"string"==typeof e||e===o||e instanceof String&&t===o.trim?r:t}},function(e,t,n){n(495);var r=n(36);e.exports=r("String").trim},function(e,t,n){"use strict";var r=n(9),o=n(166).trim;r({target:"String",proto:!0,forced:n(496)("trim")},{trim:function(){return o(this)}})},function(e,t,n){var r=n(24),o=n(126);e.exports=function(e){return r((function(){return!!o[e]()||"
"!="
"[e]()||o[e].name!==e}))}},function(e,t,n){var r=n(498);e.exports=r},function(e,t,n){var r=n(499),o=Function.prototype;e.exports=function(e){var t=e.bind;return e===o||e instanceof Function&&t===o.bind?r:t}},function(e,t,n){n(500);var r=n(36);e.exports=r("Function").bind},function(e,t,n){n(9)({target:"Function",proto:!0},{bind:n(163)})},function(e,t,n){var r=n(502);e.exports=r},function(e,t,n){var r=n(503),o=String.prototype;e.exports=function(e){var t=e.startsWith;return"string"==typeof e||e===o||e instanceof String&&t===o.startsWith?r:t}},function(e,t,n){n(504);var r=n(36);e.exports=r("String").startsWith},function(e,t,n){"use strict";var r,o=n(9),i=n(67).f,a=n(48),s=n(284),c=n(60),u=n(285),l=n(62),f="".startsWith,p=Math.min,d=u("startsWith");o({target:"String",proto:!0,forced:!!(l||d||(r=i(String.prototype,"startsWith"),!r||r.writable))&&!d},{startsWith:function(e){var t=String(c(this));s(e);var n=a(p(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return f?f.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";var r=n(506),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,n){for(var r=0,o=e.length;r<o;r++)i.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))},s=function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},c=function(e,t,n){for(var r in e)i.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))};e.exports=function(e,t,n){if(!r(t))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),"[object Array]"===o.call(e)?a(e,t,i):"string"==typeof e?s(e,t,i):c(e,t,i)}},function(e,t,n){"use strict";var r=Function.prototype.toString,o=/^\s*class\b/,i=function(e){try{var t=r.call(e);return o.test(t)}catch(e){return!1}},a=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(s)return function(e){try{return!i(e)&&(r.call(e),!0)}catch(e){return!1}}(e);if(i(e))return!1;var t=a.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},function(e,t,n){"use strict";var r=n(353);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,n){"use strict";var r="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,i=Object.prototype.toString;e.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==i.call(t))throw new TypeError(r+t);for(var n,a=o.call(arguments,1),s=function(){if(this instanceof n){var r=t.apply(this,a.concat(o.call(arguments)));return Object(r)===r?r:this}return t.apply(e,a.concat(o.call(arguments)))},c=Math.max(0,t.length-a.length),u=[],l=0;l<c;l++)u.push("$"+l);if(n=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var f=function(){};f.prototype=t.prototype,n.prototype=new f,f.prototype=null}return n}},function(e,t,n){"use strict";var r=n(395),o=n(396),i=n(398),a=n(399),s=n(517),c=r(a());o(c,{getPolyfill:a,implementation:i,shim:s}),e.exports=c},function(e,t,n){"use strict";(function(t){var r=t.Symbol,o=n(511);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,n(95))},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){"use strict";var r=Array.prototype.slice,o=n(397),i=Object.keys,a=i?function(e){return i(e)}:n(513),s=Object.keys;a.shim=function(){Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return o(e)?s(r.call(e)):s(e)}):Object.keys=a;return Object.keys||a},e.exports=a},function(e,t,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=n(397),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!p["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===i.call(e),r=a(e),s=t&&"[object String]"===i.call(e),p=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var h=u&&n;if(s&&e.length>0&&!o.call(e,0))for(var v=0;v<e.length;++v)p.push(String(v));if(r&&e.length>0)for(var m=0;m<e.length;++m)p.push(String(m));else for(var y in e)h&&"prototype"===y||!o.call(e,y)||p.push(String(y));if(c)for(var g=function(e){if("undefined"==typeof window||!d)return f(e);try{return f(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)g&&"constructor"===l[b]||!o.call(e,l[b])||p.push(l[b]);return p}}e.exports=r},function(e,t,n){"use strict";var r=n(296)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(296),o=r("%String%"),i=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=n(296),o=n(395),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")?o(n):n}},function(e,t,n){"use strict";var r=n(396),o=n(399);e.exports=function(){var e=o();return r(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}},function(e,t,n){var r=n(519);e.exports=r},function(e,t,n){var r=n(520),o=Array.prototype;e.exports=function(e){var t=e.reduceRight;return e===o||e instanceof Array&&t===o.reduceRight?r:t}},function(e,t,n){n(521);var r=n(36);e.exports=r("Array").reduceRight},function(e,t,n){"use strict";var r=n(9),o=n(168).right,i=n(79),a=n(43),s=i("reduceRight"),c=a("reduce",{1:0});r({target:"Array",proto:!0,forced:!s||!c},{reduceRight:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(523);e.exports=r},function(e,t,n){var r=n(524),o=Array.prototype;e.exports=function(e){var t=e.findIndex;return e===o||e instanceof Array&&t===o.findIndex?r:t}},function(e,t,n){n(525);var r=n(36);e.exports=r("Array").findIndex},function(e,t,n){"use strict";var r=n(9),o=n(55).findIndex,i=n(111),a=n(43),s=!0,c=a("findIndex");"findIndex"in[]&&Array(1).findIndex((function(){s=!1})),r({target:"Array",proto:!0,forced:s||!c},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("findIndex")},function(e,t,n){n(400);var r=n(22);e.exports=r.setTimeout},function(e,t,n){var r=n(401),o=n(129)("socket.io-client:url");e.exports=function(e,t){var n=e;t=t||"undefined"!=typeof location&&location,null==e&&(e=t.protocol+"//"+t.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),o("parse %s",e),n=r(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var i=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n}},function(e,t,n){function r(e){var n;function r(){if(r.enabled){var e=r,o=+new Date,i=o-(n||o);e.diff=i,e.prev=n,e.curr=o,n=o;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var c=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;c++;var o=t.formatters[r];if("function"==typeof o){var i=a[c];n=o.call(e,i),a.splice(c,1),c--}return n})),t.formatArgs.call(e,a);var u=r.log||t.log||console.log.bind(console);u.apply(e,a)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),r.destroy=o,"function"==typeof t.init&&t.init(r),t.instances.push(r),r}function o(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var i=t.instances[n];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(529),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t){var n=1e3,r=6e4,o=60*r,i=24*o;function a(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}e.exports=function(e,t){t=t||{};var s,c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;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)return;var a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===c&&!1===isNaN(e))return t.long?a(s=e,i,"day")||a(s,o,"hour")||a(s,r,"minute")||a(s,n,"second")||s+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=r)return Math.round(e/r)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){var r=n(372),o=n(402),i=Object.prototype.toString,a="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===i.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===i.call(File);t.deconstructPacket=function(e){var t=[],n=e.data,i=e;return i.data=function e(t,n){if(!t)return t;if(o(t)){var i={_placeholder:!0,num:n.length};return n.push(t),i}if(r(t)){for(var a=new Array(t.length),s=0;s<t.length;s++)a[s]=e(t[s],n);return a}if("object"==typeof t&&!(t instanceof Date)){a={};for(var c in t)a[c]=e(t[c],n);return a}return t}(n,t),i.attachments=t.length,{packet:i,buffers:t}},t.reconstructPacket=function(e,t){return e.data=function e(t,n){if(!t)return t;if(t&&t._placeholder)return n[t.num];if(r(t))for(var o=0;o<t.length;o++)t[o]=e(t[o],n);else if("object"==typeof t)for(var i in t)t[i]=e(t[i],n);return t}(e.data,t),e.attachments=void 0,e},t.removeBlobs=function(e,t){var n=0,i=e;!function e(c,u,l){if(!c)return c;if(a&&c instanceof Blob||s&&c instanceof File){n++;var f=new FileReader;f.onload=function(){l?l[u]=this.result:i=this.result,--n||t(i)},f.readAsArrayBuffer(c)}else if(r(c))for(var p=0;p<c.length;p++)e(c[p],p,c);else if("object"==typeof c&&!o(c))for(var d in c)e(c[d],d,c)}(i),n||t(i)}},function(e,t,n){e.exports=n(532),e.exports.parser=n(170)},function(e,t,n){var r=n(404),o=n(169),i=n(129)("engine.io-client:socket"),a=n(408),s=n(170),c=n(401),u=n(297);function l(e,t){if(!(this instanceof l))return new l(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=c(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=c(t.host).host),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=u.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}e.exports=l,l.priorWebsocketSuccess=!1,o(l.prototype),l.protocol=s.protocol,l.Socket=l,l.Transport=n(374),l.transports=n(404),l.parser=n(170),l.prototype.createTransport=function(e){i('creating transport "%s"',e);var t=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(this.query);t.EIO=s.protocol,t.transport=e;var n=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new r[e]({query:t,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},l.prototype.open=function(){var e;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},l.prototype.setTransport=function(e){i("setting transport %s",e.name);var t=this;this.transport&&(i("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},l.prototype.probe=function(e){i('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),n=!1,r=this;function o(){if(r.onlyBinaryUpgrades){var o=!this.supportsBinary&&r.transport.supportsBinary;n=n||o}n||(i('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(o){if(!n)if("pong"===o.type&&"probe"===o.data){if(i('probe transport "%s" pong',e),r.upgrading=!0,r.emit("upgrading",t),!t)return;l.priorWebsocketSuccess="websocket"===t.name,i('pausing current transport "%s"',r.transport.name),r.transport.pause((function(){n||"closed"!==r.readyState&&(i("changing transport and sending upgrade packet"),p(),r.setTransport(t),t.send([{type:"upgrade"}]),r.emit("upgrade",t),t=null,r.upgrading=!1,r.flush())}))}else{i('probe transport "%s" failed',e);var a=new Error("probe error");a.transport=t.name,r.emit("upgradeError",a)}})))}function a(){n||(n=!0,p(),t.close(),t=null)}function s(n){var o=new Error("probe error: "+n);o.transport=t.name,a(),i('probe transport "%s" failed because of error: %s',e,n),r.emit("upgradeError",o)}function c(){s("transport closed")}function u(){s("socket closed")}function f(e){t&&e.name!==t.name&&(i('"%s" works - aborting "%s"',e.name,t.name),a())}function p(){t.removeListener("open",o),t.removeListener("error",s),t.removeListener("close",c),r.removeListener("close",u),r.removeListener("upgrading",f)}l.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",s),t.once("close",c),this.once("close",u),this.once("upgrading",f),t.open()},l.prototype.onOpen=function(){if(i("socket open"),this.readyState="open",l.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){i("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},l.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(i('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else i('packet received with socket readyState "%s"',this.readyState)},l.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},l.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},l.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){i("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},l.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},l.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},l.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(i("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},l.prototype.write=l.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},l.prototype.sendPacket=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:e,data:t,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},l.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?r():t()})):this.upgrading?r():t()}function t(){e.onClose("forced close"),i("socket closing - telling transport to close"),e.transport.close()}function n(){e.removeListener("upgrade",n),e.removeListener("upgradeError",n),t()}function r(){e.once("upgrade",n),e.once("upgradeError",n)}return this},l.prototype.onError=function(e){i("socket error %j",e),l.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},l.prototype.onClose=function(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){i('socket close with reason: "%s"',e);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0}},l.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;n<r;n++)~a(this.transports,e[n])&&t.push(e[n]);return t}},function(e,t){try{e.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){e.exports=!1}},function(e,t,n){var r=n(373),o=n(405),i=n(169),a=n(298),s=n(129)("engine.io-client:polling-xhr");function c(){}function u(e){if(o.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,"undefined"!=typeof location){var t="https:"===location.protocol,n=location.port;n||(n=t?443:80),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}}function l(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}if(e.exports=u,e.exports.Request=l,a(u,o),u.prototype.supportsBinary=!0,u.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new l(e)},u.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),o=this;r.on("success",t),r.on("error",(function(e){o.onError("xhr post error",e)})),this.sendXhr=r},u.prototype.doPoll=function(){s("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},i(l.prototype),l.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new r(e),n=this;try{s("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var o in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&t.setRequestHeader(o,this.extraHeaders[o])}catch(e){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){n.onLoad()},t.onerror=function(){n.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState)try{var e=t.getResponseHeader("Content-Type");n.supportsBinary&&"application/octet-stream"===e&&(t.responseType="arraybuffer")}catch(e){}4===t.readyState&&(200===t.status||1223===t.status?n.onLoad():setTimeout((function(){n.onError(t.status)}),0))},s("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout((function(){n.onError(e)}),0)}"undefined"!=typeof document&&(this.index=l.requestsCount++,l.requests[this.index]=this)},l.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},l.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},l.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},l.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=c:this.xhr.onreadystatechange=c,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete l.requests[this.index],this.xhr=null}},l.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},l.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},l.prototype.abort=function(){this.cleanup()},l.requestsCount=0,l.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",p);else if("function"==typeof addEventListener){var f="onpagehide"in self?"pagehide":"unload";addEventListener(f,p,!1)}function p(){for(var e in l.requests)l.requests.hasOwnProperty(e)&&l.requests[e].abort()}},function(e,t){e.exports=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t}},function(e,t){e.exports=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(t<0&&(t+=r),n<0&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),i=new Uint8Array(n-t),a=t,s=0;a<n;a++,s++)i[s]=o[a];return i.buffer}},function(e,t){function n(){}e.exports=function(e,t,r){var o=!1;return r=r||n,i.count=e,0===e?t():i;function i(e,n){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(o=!0,t(e),t=r):0!==i.count||o||t(null,n)}}},function(e,t){
/*! https://mths.be/utf8js v2.1.2 by @mathias */
var n,r,o,i=String.fromCharCode;function a(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function s(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function c(e,t){return i(e>>t&63|128)}function u(e,t){if(0==(4294967168&e))return i(e);var n="";return 0==(4294965248&e)?n=i(e>>6&31|192):0==(4294901760&e)?(s(e,t)||(e=65533),n=i(e>>12&15|224),n+=c(e,6)):0==(4292870144&e)&&(n=i(e>>18&7|240),n+=c(e,12),n+=c(e,6)),n+=i(63&e|128)}function l(){if(o>=r)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function f(e){var t,i;if(o>r)throw Error("Invalid byte index");if(o==r)return!1;if(t=255&n[o],o++,0==(128&t))return t;if(192==(224&t)){if((i=(31&t)<<6|l())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&t)){if((i=(15&t)<<12|l()<<6|l())>=2048)return s(i,e)?i:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(i=(7&t)<<18|l()<<12|l()<<6|l())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.exports={version:"2.1.2",encode:function(e,t){for(var n=!1!==(t=t||{}).strict,r=a(e),o=r.length,i=-1,s="";++i<o;)s+=u(r[i],n);return s},decode:function(e,t){var s=!1!==(t=t||{}).strict;n=a(e),r=n.length,o=0;for(var c,u=[];!1!==(c=f(s));)u.push(c);return function(e){for(var t,n=e.length,r=-1,o="";++r<n;)(t=e[r])>65535&&(o+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=i(t);return o}(u)}}},function(e,t){!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<e.length;r++)n[e.charCodeAt(r)]=r;t.encode=function(t){var n,r=new Uint8Array(t),o=r.length,i="";for(n=0;n<o;n+=3)i+=e[r[n]>>2],i+=e[(3&r[n])<<4|r[n+1]>>4],i+=e[(15&r[n+1])<<2|r[n+2]>>6],i+=e[63&r[n+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},t.decode=function(e){var t,r,o,i,a,s=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var l=new ArrayBuffer(s),f=new Uint8Array(l);for(t=0;t<c;t+=4)r=n[e.charCodeAt(t)],o=n[e.charCodeAt(t+1)],i=n[e.charCodeAt(t+2)],a=n[e.charCodeAt(t+3)],f[u++]=r<<2|o>>4,f[u++]=(15&o)<<4|i>>2,f[u++]=(3&i)<<6|63&a;return l}}()},function(e,t){var n=void 0!==n?n:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,r=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),o=r&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),i=n&&n.prototype.append&&n.prototype.getBlob;function a(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var n=new Uint8Array(e.byteLength);n.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer}return t}return e}))}function s(e,t){t=t||{};var r=new n;return a(e).forEach((function(e){r.append(e)})),t.type?r.getBlob(t.type):r.getBlob()}function c(e,t){return new Blob(a(e),t||{})}"undefined"!=typeof Blob&&(s.prototype=Blob.prototype,c.prototype=Blob.prototype),e.exports=r?o?Blob:c:i?s:void 0},function(e,t,n){(function(t){var r=n(405),o=n(298);e.exports=l;var i,a=/\n/g,s=/\\n/g;function c(){}function u(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{}}function l(e){if(r.call(this,e),this.query=this.query||{},!i){var t=u();i=t.___eio=t.___eio||[]}this.index=i.length;var n=this;i.push((function(e){n.onData(e)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=c)}),!1)}o(l,r),l.prototype.supportsBinary=!1,l.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),r.prototype.doClose.call(this)},l.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},l.prototype.doWrite=function(e,t){var n=this;if(!this.form){var r,o=document.createElement("form"),i=document.createElement("textarea"),c=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=c,o.method="POST",o.setAttribute("accept-charset","utf-8"),i.name="d",o.appendChild(i),document.body.appendChild(o),this.form=o,this.area=i}function u(){l(),t()}function l(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(e){n.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+n.iframeId+'">';r=document.createElement(e)}catch(e){(r=document.createElement("iframe")).name=n.iframeId,r.src="javascript:0"}r.id=n.iframeId,n.form.appendChild(r),n.iframe=r}this.form.action=this.uri(),l(),e=e.replace(s,"\\\n"),this.area.value=e.replace(a,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&u()}:this.iframe.onload=u}}).call(this,n(95))},function(e,t,n){var r,o,i=n(374),a=n(170),s=n(297),c=n(298),u=n(407),l=n(129)("engine.io-client:websocket");if("undefined"!=typeof WebSocket)r=WebSocket;else if("undefined"!=typeof self)r=self.WebSocket||self.MozWebSocket;else try{o=n(543)}catch(e){}var f=r||o;function p(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=r&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(f=o),i.call(this,e)}e.exports=p,c(p,i),p.prototype.name="websocket",p.prototype.supportsBinary=!0,p.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new f(e,t):new f(e):new f(e,t,n)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},p.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},p.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,r=0,o=n;r<o;r++)!function(e){a.encodePacket(e,t.supportsBinary,(function(r){if(!t.usingBrowserWebSocket){var o={};if(e.options&&(o.compress=e.options.compress),t.perMessageDeflate)("string"==typeof r?Buffer.byteLength(r):r.length)<t.perMessageDeflate.threshold&&(o.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(r):t.ws.send(r,o)}catch(e){l("websocket closed before onclose event")}--n||i()}))}(e[r]);function i(){t.emit("flush"),setTimeout((function(){t.writable=!0,t.emit("drain")}),0)}},p.prototype.onClose=function(){i.prototype.onClose.call(this)},p.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},p.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=u()),this.supportsBinary||(e.b64=1),(e=s.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},p.prototype.check=function(){return!(!f||"__initialize"in f&&this.name===p.prototype.name)}},function(e,t){},function(e,t){e.exports=function(e,t){for(var n=[],r=(t=t||0)||0;r<e.length;r++)n[r-t]=e[r];return n}},function(e,t){function n(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},function(e,t,n){var r=n(547);e.exports=r},function(e,t,n){n(548),n(125),n(80),n(71);var r=n(22);e.exports=r.Map},function(e,t,n){"use strict";var r=n(292),o=n(293);e.exports=r("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),o)},function(e,t,n){var r=n(290);e.exports=r},function(e,t){(function(){!function(e,t){"use strict";var n,r,o,i,a={},s=[],c=!1,u=!1,l=!0,f="__woopraid";!function(e,t){function n(e){var n=t[e];t[e]=function(e){return i(n(e))}}function r(t,n,r){return r=this,a.unshift([r,t,n,function(t){(t=t||e.event).preventDefault=t.preventDefault||function(){t.returnValue=!1},t.stopPropagation=t.stopPropagation||function(){t.cancelBubble=!0},t.currentTarget=r,t.target=t.srcElement||r,n.call(r,t)}]),this.attachEvent("on"+t,a[0][3])}function o(e,t){for(var n,r=0;n=a[r];++r)if(n[0]==this&&n[1]==e&&n[2]==t)return this.detachEvent("on"+e,a.splice(r,1)[0][3])}function i(e,t){if(e&&(t=e.length))for(;t--;)e[t].addEventListener=r,e[t].removeEventListener=o;else e&&(e.addEventListener=r,e.removeEventListener=o);return e}if(!e.addEventListener){var a=[];i([t,e]),"Element"in e?(e.Element.prototype.addEventListener=r,e.Element.prototype.removeEventListener=o):(t.attachEvent("onreadystatechange",(function(){i(t.all)})),n("getElementsByTagName"),n("getElementById"),n("createElement"),i(t.all))}}(e,t),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var n=this.length>>>0;for(t=+t||0,Math.abs(t)===1/0&&(t=0),t<0&&((t+=n)<0&&(t=0));t<n;t++)if(this[t]===e)return t;return-1}),a.extend=function(e,t){for(var n in t)e[n]=t[n]},a.serializeForm=function(e,t){if(e&&"FORM"===e.nodeName){var n,r,o=(t||{}).exclude||[],i={};for(n=e.elements.length-1;n>=0;n-=1)if(!(""===e.elements[n].name||o.indexOf(e.elements[n].name)>-1))switch(e.elements[n].nodeName){case"INPUT":switch(e.elements[n].type){case"text":case"hidden":case"button":case"reset":case"submit":i[e.elements[n].name]=e.elements[n].value;break;case"checkbox":case"radio":e.elements[n].checked&&(i[e.elements[n].name]=e.elements[n].value)}break;case"TEXTAREA":i[e.elements[n].name]=e.elements[n].value;break;case"SELECT":switch(e.elements[n].type){case"select-one":i[e.elements[n].name]=e.elements[n].value;break;case"select-multiple":for(r=e.elements[n].options.length-1;r>=0;r-=1)e.elements[n].options[r].selected&&(i[e.elements[n].name]=e.elements[n].options[r].value)}break;case"BUTTON":switch(e.elements[n].type){case"reset":case"submit":case"button":i[e.elements[n].name]=e.elements[n].value}}return i}};var p={getItem:function(e){return e&&decodeURIComponent(t.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},setItem:function(e,n,r,o,i,a){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var s="";if(r)switch(r.constructor){case Number:s=r===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+r;break;case String:s="; expires="+r;break;case Date:s="; expires="+r.toUTCString()}return t.cookie=encodeURIComponent(e)+"="+encodeURIComponent(n)+s+(i?"; domain="+i:"")+(o?"; path="+o:"")+(a?"; secure":""),!0},removeItem:function(e,n,r){return!!this.hasItem(e)&&(t.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(r?"; domain="+r:"")+(n?"; path="+n:""),!0)},hasItem:function(e){return!!e&&new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(t.cookie)},keys:function(){for(var e=t.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),n=e.length,r=0;r<n;r++)e[r]=decodeURIComponent(e[r]);return e}};a.docCookies=p,a.location=function(t,n){if(void 0!==e.location[t]){if(void 0===n)return e.location[t];e.location[t]=n}},a.getCampaignData=function(){for(var e,t,n=a.getUrlParams(),r={},o=["source","medium","content","campaign","term"],i=0;i<o.length;i++)void 0!==(t=n["utm_"+(e=o[i])]||n["woo_"+e])&&(r["campaign_"+("campaign"===e?"name":e)]=t);return r},a.mapQueryParams=function(e){var t=a.getUrlParams(),n={};for(var r in e){var o=t[r];void 0!==o&&(n[e[r]]=o)}return n},a.getCustomData=function(e,t){var n,r,o,i=a.getUrlParams(),s=t||"wv_";for(n in i)i.hasOwnProperty(n)&&(o=i[n],n.substring(0,s.length)===s&&(r=n.substring(s.length),e.call(this,r,o)))},a.getVisitorUrlData=function(e){a.getCustomData.call(e,e.identify,"wv_")},a.hideCampaignData=function(){return a.hideUrlParams(["wv_","woo_","utm_"])},a.hideCrossDomainId=function(){return a.hideUrlParams([f])},a.hideUrlParams=function(t){var n=new RegExp("[?&]+((?:"+t.join("|")+")[^=&]*)=([^&#]*)","gi"),r=a.location("href").replace(n,"");return e.history&&e.history.replaceState&&e.history.replaceState(null,null,r),r},a.getUrlParams=function(){var e={},t=a.location("href");return t&&t.replace(/[?&]+([^=&]+)=([^&]*)/gi,(function(t,n,r){e[n]=decodeURIComponent(r.split("+").join(" "))})),e},a.buildUrlParams=function(e,t){var n,r=t||"",o=[];if(void 0===e)return e;for(n in e)e.hasOwnProperty(n)&&"undefined"!==e[n]&&"null"!==e[n]&&void 0!==e[n]&&o.push(r+encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return o.join("&")},a.randomString=function(){var e,t,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",r="";for(e=0;e<12;e++)t=Math.floor(Math.random()*n.length),r+=n.substring(t,t+1);return r},a.loadScript=function(e,n){var r,o,i=t.createElement("script");i.type="text/javascript",i.async=!0,n&&"function"==typeof n&&(o=n),void 0!==i.onreadystatechange?i.onreadystatechange=function(){4!==this.readyState&&"complete"!==this.readyState&&"loaded"!==this.readyState||(o&&o(),a.removeScript(i))}:(i.onload=function(){o&&o(),a.removeScript(i)},i.onerror=function(){a.removeScript(i)}),i.src=e,(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(i,r)},a.removeScript=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},a.getElement=function(e,n){var r="string"==typeof e?n||{}:e||{},o=e;if(r.el)return r.el;if("string"==typeof e){if(t.querySelectorAll)return t.querySelectorAll(o);if("#"===e[0])return o=e.substr(1),t.getElementById(o);if("."===e[0])return o=e.substr(1),t.getElementsByClassName(o)}},a.getDomain=function(e){var t=e||a.location("hostname"),n=t.substring(t.lastIndexOf(".",t.lastIndexOf(".")-1)+1);return{"com.au":1,"net.au":1,"org.au":1,"co.hu":1,"com.ru":1,"ac.za":1,"net.za":1,"com.za":1,"co.za":1,"co.uk":1,"org.uk":1,"me.uk":1,"net.uk":1}[n]&&(n=t.substring(t.lastIndexOf(".",t.indexOf(n)-2)+1)),n},a.getHostnameNoWww=function(){var e=a.location("hostname");return 0===e.indexOf("www.")?e.replace("www.",""):e},a.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},a.startsWith=function(e,t){return 0===e.indexOf(t)},n=a._on=function(e,t,n){var r=e.instanceName;s[t]||(s[t]={}),s[t][r]=e,e.__l&&(e.__l[t]||(e.__l[t]=[]),e.__l[t].push(n))},a._fire=function(e){var t,n,r=s[e];if(r)for(var o in r)if(r.hasOwnProperty(o)&&((n=(t=r[o])&&t.__l)&&n[e]))for(var i=0;i<n[e].length;i++)n[e][i].apply(this,Array.prototype.slice.call(arguments,1))},a.attachEvent=function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on"+t,(function(e){(e=e||win.event).preventDefault=e.preventDefault||function(){e.returnValue=!1},e.stopPropagation=e.stopPropagation||function(){e.cancelBubble=!0},n.call(self,e)}))},a.leftClick=function(t){return(void 0!==(t=t||e.event).which&&1===t.which||void 0!==t.button&&0===t.button)&&!t.metaKey&&!t.altKey&&!t.ctrlKey&&!t.shiftKey},a.redirect=function(e){a.location("href",e)},a.isOutgoingLink=function(e){var t=a.location("hostname"),n=a.getDomain(t);return!(e===t||e.replace(/^www\./,"")===t.replace(/^www\./,"")||l&&n===a.getDomain(e)||a.startsWith(e,"javascript")||""===e||"#"===e)},function(n,s){n(t,"mousedown",(function(e){var t;if(s("mousemove",e,new Date),i){for(t=e.srcElement||e.target;null!=t&&(!t.tagName||"a"!==t.tagName.toLowerCase());)t=t.parentNode;null!=t&&s("auto_decorate",t)}})),n(t,"click",(function(t){var n,i,l,f="_blank";if(n=t.srcElement||t.target,a.leftClick(t)&&s("click",t,n),c||u){for(;null!=n&&(!n.tagName||"a"!==n.tagName.toLowerCase());)n=n.parentNode;null==n||n.getAttribute("data-woopra-tracked")||(l=(i=n).pathname.match(/(?:doc|dmg|eps|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3|mp4|m4v)($|\&)/),c&&l&&(s("download",i.href),i.target!==f&&a.leftClick(t)&&(t.preventDefault(),t.stopPropagation(),i.setAttribute("data-woopra-tracked",!0),e.setTimeout((function(){i.click()}),r))),u&&!l&&a.isOutgoingLink(i.hostname)&&(s("outgoing",i.href),i.target!==f&&a.leftClick(t)&&(t.preventDefault(),t.stopPropagation(),i.setAttribute("data-woopra-tracked",!0),e.setTimeout((function(){i.click()}),o))))}})),n(t,"mousemove",(function(e){s("mousemove",e,new Date)})),n(t,"keydown",(function(){s("keydown")}))}(a.attachEvent,a._fire);var d=function(t){this.visitorData={},this.sessionData={},this.options={app:"js-client",use_cookies:!0,ping:!0,ping_interval:12e3,idle_timeout:3e5,idle_threshold:1e4,download_pause:r||200,outgoing_pause:o||200,download_tracking:!1,outgoing_tracking:!1,outgoing_ignore_subdomain:!0,hide_campaign:!1,hide_xdm_data:!1,campaign_once:!1,third_party:!1,save_url_hash:!0,cross_domain:!1,region:null,ignore_query_url:!1,map_query_params:{},cookie_name:"wooTracker",cookie_domain:"."+a.getHostnameNoWww(),cookie_path:"/",cookie_expire:new Date((new Date).setDate((new Date).getDate()+730))},this.instanceName=t||"woopra",this.idle=0,this.cookie="",this.last_activity=new Date,this.loaded=!1,this.dirtyCookie=!1,this.sentCampaign=!1,this.version=11,t&&""!==t&&(e[t]=this)};d.prototype={docCookies:p,init:function(){var e,t=this;this.__l={},this._processQueue("config"),this._setupCookie(),this._bindEvents(),setTimeout((function(){t._processQueue()}),1),this.loaded=!0,(e=this.config("initialized"))&&"function"==typeof e&&e(this.instanceName),this.config("hide_xdm_data")&&a.hideCrossDomainId()},_processQueue:function(t){var n,r,o,i;if(i=e.__woo?e.__woo[this.instanceName]:i,(i=e._w?e._w[this.instanceName]:i)&&i._e)for(o=i._e,n=0;n<o.length;n++)void 0===(r=o[n])||!this[r[0]]||void 0!==t&&t!==r[0]||this[r[0]].apply(this,Array.prototype.slice.call(r,1))},_setupCookie:function(){var e=this.getUrlId();this.cookie=this.getCookie(),e&&(this.cookie=e),(!this.cookie||this.cookie.length<1)&&(this.cookie=a.randomString()),p.setItem(this.config("cookie_name"),this.cookie,this.config("cookie_expire"),this.config("cookie_path"),this.config("cookie_domain")),this.dirtyCookie=!0},_bindEvents:function(){var e=this;n(this,"mousemove",(function(){e.moved.apply(e,arguments)})),n(this,"keydown",(function(){e.typed.apply(e,arguments)})),n(this,"download",(function(){e.downloaded.apply(e,arguments)})),n(this,"outgoing",(function(){e.outgoing.apply(e,arguments)})),n(this,"auto_decorate",(function(){e.autoDecorate.apply(e,arguments)}))},_dataSetter:function(e,t,n){var r;if(void 0===t)return e;if(void 0===n){if("string"==typeof t)return e[t];if("object"==typeof t)for(r in t)t.hasOwnProperty(r)&&("cookie_"===r.substring(0,7)&&(this.dirtyCookie=!0),e[r]=t[r])}else"cookie_"===t.substring(0,7)&&(this.dirtyCookie=!0),e[t]=n;return this},_push:function(e){var t,n,r,o,i,s=e||{},c="ra="+a.randomString(),u=[["visitorData","cv_"],["eventData","ce_"],["sessionData","cs_"]],l=[];for(i in t=this.getEndpoint(s.endpoint),a.getVisitorUrlData(this),this.config("hide_campaign")&&a.hideCampaignData(),l.push(c),l.push(a.buildUrlParams(this.getOptionParams())),s.eventName&&l.push("event="+s.eventName),u)u.hasOwnProperty(i)&&(s[(o=u[i])[0]]&&((n=a.buildUrlParams(s[o[0]],o[1]))&&l.push(n)));r=t+("?"+l.join("&")),a.loadScript(r,s.callback)},getCookie:function(){return p.getItem(this.config("cookie_name"))},getEndpoint:function(e){var t,n=this.config("protocol"),r=e||"",o=(n&&""!==n?n+":":"")+"//",i=this.config("region");if(this.config("third_party")&&!this.config("domain"))throw new Error("Error: `domain` is not set.");return o+=i?i+".t.":"www.",t=this.config("third_party")?"tp/"+this.config("domain"):"",r&&!a.endsWith(r,"/")&&(r+="/"),t&&!a.startsWith(r,"/")&&(t+="/"),o+"woopra.com/track/"+t+r},config:function(e,t){var n=this._dataSetter(this.options,e,t);return n===this&&(this.options.ping_interval<6e3?this.options.ping_interval=6e3:this.options.ping_interval>6e4&&(this.options.ping_interval=6e4),u=this.options.outgoing_tracking,o=this.options.outgoing_pause,c=this.options.download_tracking,r=this.options.download_pause,i=void 0===i&&this.options.cross_domain?this.options.cross_domain:i,l=this.options.outgoing_ignore_subdomain,this.dirtyCookie&&this.loaded&&this._setupCookie()),n},visit:function(e,t){return this._dataSetter(this.sessionData,e,t)},identify:function(e,t){return this._dataSetter(this.visitorData,e,t)},call:function(e){this[e]&&"function"==typeof this[e]&&this[e].apply(this,Array.prototype.slice.call(arguments,1))},track:function(e,t){var n,r,o={},i="",s=arguments[arguments.length-1];this.config("campaign_once")&&this.sentCampaign||(a.extend(o,a.getCampaignData()),this.sentCampaign=!0),a.extend(o,a.mapQueryParams(this.config("map_query_params"))),"function"==typeof s&&(n=s),void 0===e||e===n?i="pv":void 0===t||t===n?("string"==typeof e&&(i=e),"object"==typeof e&&(e.name&&"pv"===e.name&&(i="pv"),this._dataSetter(o,e))):(this._dataSetter(o,t),i=e),"pv"===i&&(o.url=o.url||this.getPageUrl(),o.title=o.title||this.getPageTitle(),o.domain=o.domain||this.getDomainName(),o.uri=o.uri||this.getURI(),this.config("save_url_hash")&&(""!==(r=o.hash||this.getPageHash())&&(o.hash=r))),this._push({endpoint:"ce",visitorData:this.visitorData,sessionData:this.sessionData,eventName:i,eventData:o,callback:n}),this.startPing()},trackForm:function(e,t,n){var r,o,i=e||"Tracked Form",s="string"==typeof t?n||{}:t||{},c=this;if(o=function(e,t,n,r){a.attachEvent(e,"submit",(function(n){c.trackFormHandler(n,e,t,s)}))},(r=s.elements?s.elements:a.getElement(t,s))&&r.length>0)for(var u in r)o(r[u],i)},trackFormHandler:function(e,t,n,r){var o,i,s=!1;t.getAttribute("data-tracked")||(o=a.serializeForm(t,r),r.identify&&"function"==typeof r.identify&&((i=r.identify(o)||{})&&this.identify(i)),r.noSubmit?this.track(n,o,(function(){"function"==typeof r.callback&&r.callback(o)})):(e.preventDefault(),e.stopPropagation(),t.setAttribute("data-tracked",1),this.track(n,o,(function(){s=!0,"function"==typeof r.callback&&r.callback(o),t.submit()})),setTimeout((function(){s||t.submit()}),250)))},trackClick:function(e,t,n,r){var o,i,s,c=r||{},u=e||"Item Clicked",l=this;if(i=function(e,t,n,r){a.attachEvent(e,"click",(function(o){l.trackClickHandler(o,e,t,n,r)}))},s=c.elements?c.elements:a.getElement(t,c))for(o=0;o<s.length;o++)i(s[o],u,n,c)},trackClickHandler:function(e,t,n,r,o){var i=!1;t.getAttribute("data-tracked")||(o.noNav?this.track(n,r):(e.preventDefault(),t.setAttribute("data-tracked",1),this.track(n,r,(function(){i=!0,"function"==typeof o.callback&&o.callback(),t.click()})),setTimeout((function(){i||t.click()}),250)))},startPing:function(){var t=this;void 0===this.pingInterval&&(this.pingInterval=e.setInterval((function(){t.ping()}),this.config("ping_interval")))},stopPing:function(){void 0!==this.pingInterval&&(e.clearInterval(this.pingInterval),delete this.pingInterval)},ping:function(){var e;return this.config("ping")&&this.idle<this.config("idle_timeout")?this._push({endpoint:"ping"}):this.stopPing(),(e=new Date)-this.last_activity>this.config("idle_threshold")&&(this.idle=e-this.last_activity),this},push:function(e){return this._push({endpoint:"identify",visitorData:this.visitorData,sessionData:this.sessionData,callback:e}),this},sleep:function(){},moved:function(e,t){this.last_activity=t,this.idle=0},typed:function(){this.vs=2},downloaded:function(e){this.track("download",{url:e})},outgoing:function(e){this.track("outgoing",{url:e})},autoDecorate:function(e){var t,n,r=this.config("cross_domain");if(r){if("string"==typeof r)n=e.hostname.indexOf(r)>-1;else if(r.push)for(var o=0;o<r.length;o++)if(-1!==e.hostname.indexOf(r[o])){n=!0;break}n&&((t=this.decorate(e))&&(e.href=t))}},reset:function(){p.removeItem(this.config("cookie_name"),this.config("cookie_path"),this.config("cookie_domain")),this.cookie=null,this._setupCookie()},decorate:function(e){var n,r,o,i;if("string"==typeof e?((n=t.createElement("a")).href=e,r=n.search?"&":"?"):e&&e.href&&(n=e),n)return r=n.search?"&":"?",o=n.pathname&&"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname,i=n.hostname+(n.port&&""!==n.port&&"80"!==n.port&&"0"!==n.port?":"+n.port:""),n.protocol+"//"+i+o+n.search+r+f+"="+this.cookie+n.hash},undecorate:function(e){var t=new RegExp("[?&]+(?:"+f+")=([^&#]*)","gi"),n=e;if(e&&e.href&&(n=e.href),n)return n.replace(t,"")},getPageUrl:function(){return this.options.ignore_query_url?a.location("pathname"):a.location("pathname")+a.location("search")},getPageHash:function(){return a.location("hash")},getPageTitle:function(){return 0===t.getElementsByTagName("title").length?"":t.getElementsByTagName("title")[0].innerHTML},getDomainName:function(){return a.location("hostname")},getURI:function(){return a.location("href")},getUrlId:function(e){var t,n=e||a.location("href"),r=new RegExp(f+"=([^&#]+)");if((t=n.match(r))&&t[1])return t[1]},getOptionParams:function(){var n={alias:this.config("domain")||a.getHostnameNoWww(),instance:this.instanceName,ka:this.config("keep_alive")||2*this.config("ping_interval"),meta:p.getItem("wooMeta")||"",screen:e.screen.width+"x"+e.screen.height,language:e.navigator.browserLanguage||e.navigator.language||"",app:this.config("app"),referer:t.referrer,idle:""+parseInt(this.idle/1e3,10),vs:"i"};return this.config("domain")||(n._warn="no_domain",a.getHostnameNoWww()!==a.getDomain()&&(n._warn+=",domain_mismatch")),this.config("use_cookies")&&(n.cookie=this.getCookie()||this.cookie),this.config("ip")&&(n.ip=this.config("ip")),2===this.vs?(n.vs="w",this.vs=0):0===this.idle&&(n.vs="r"),n},dispose:function(){for(var t in this.stopPing(),this.__l)this.__l.hasOwnProperty(t)&&(s[t][this.instanceName]=null);if(this.__l=null,void 0!==e[this.instanceName])try{delete e[this.instanceName]}catch(t){e[this.instanceName]=void 0}}},e.WoopraTracker=d,e.WoopraLoadScript=a.loadScript,void 0!==e.exports&&(a.Tracker=d,e.exports.Woopra=a,"function"==typeof e.woopraLoaded&&(e.woopraLoaded(),e.woopraLoaded=null));var h=e.__woo||e._w;if(void 0!==h)for(var v in h)if(h.hasOwnProperty(v)){var m=new d(v);m.init(),void 0===e.woopraTracker&&(e.woopraTracker=m)}}(onfidoSafeWindow8xmy484y87m239843m20,document)}).call(onfidoSafeWindow8xmy484y87m239843m20)},function(e,t,n){var r,o,i;!function(a){"use strict";o=[n(171),n(552),n(413)],void 0===(i="function"==typeof(r=function(e){var t=e.hasCanvasOption,n=e.hasMetaOption,r=e.transformCoordinates,o=e.getTransformedOptions;i=document.createElement("img"),i.onload=function(){e.orientation=1===i.width&&2===i.height},i.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==",e.hasCanvasOption=function(n){return!0==!!n.orientation&&!e.orientation||n.orientation>1&&n.orientation<9||t.call(e,n)},e.hasMetaOption=function(t){return t&&!0===t.orientation&&!e.orientation||n.call(e,t)},e.transformCoordinates=function(t,n){r.call(e,t,n);var o=t.getContext("2d"),i=t.width,a=t.height,s=t.style.width,c=t.style.height,u=n.orientation;if(u>1&&u<9)switch(u>4&&(t.width=a,t.height=i,t.style.width=c,t.style.height=s),u){case 2:o.translate(i,0),o.scale(-1,1);break;case 3:o.translate(i,a),o.rotate(Math.PI);break;case 4:o.translate(0,a),o.scale(1,-1);break;case 5:o.rotate(.5*Math.PI),o.scale(1,-1);break;case 6:o.rotate(.5*Math.PI),o.translate(0,-a);break;case 7:o.rotate(.5*Math.PI),o.translate(i,-a),o.scale(-1,1);break;case 8:o.rotate(-.5*Math.PI),o.translate(-i,0)}},e.getTransformedOptions=function(t,n,r){var i,a,s=o.call(e,t,n),c=s.orientation;if(!0===c){if(e.orientation)return s;c=r&&r.exif&&r.exif.get("Orientation")}if(!(c>1&&c<9))return s;for(a in i={},s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a]);switch(i.orientation=c,c){case 2:i.left=s.right,i.right=s.left;break;case 3:i.left=s.right,i.top=s.bottom,i.right=s.left,i.bottom=s.top;break;case 4:i.top=s.bottom,i.bottom=s.top;break;case 5:i.left=s.top,i.top=s.left,i.right=s.bottom,i.bottom=s.right;break;case 6:i.left=s.top,i.top=s.right,i.right=s.bottom,i.bottom=s.left;break;case 7:i.left=s.bottom,i.top=s.right,i.right=s.top,i.bottom=s.left;break;case 8:i.left=s.bottom,i.top=s.left,i.right=s.top,i.bottom=s.right}return i.orientation>4&&(i.maxWidth=s.maxHeight,i.maxHeight=s.maxWidth,i.minWidth=s.minHeight,i.minHeight=s.minWidth,i.sourceWidth=s.sourceHeight,i.sourceHeight=s.sourceWidth),i};var i})?r.apply(t,o):r)||(e.exports=i)}()},function(e,t,n){var r,o,i;!function(a){"use strict";o=[n(171)],void 0===(i="function"==typeof(r=function(e){var t=e.transform;e.transform=function(n,r,o,i,a){t.call(e,e.scale(n,r,a),r,o,i,a)},e.transformCoordinates=function(){},e.getTransformedOptions=function(e,t){var n,r,o,i,a=t.aspectRatio;if(!a)return t;for(r in n={},t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n.crop=!0,(o=e.naturalWidth||e.width)/(i=e.naturalHeight||e.height)>a?(n.maxWidth=i*a,n.maxHeight=i):(n.maxWidth=o,n.maxHeight=o/a),n},e.renderImageToCanvas=function(e,t,n,r,o,i,a,s,c,u,l){var f=e.getContext("2d");return!1===l.imageSmoothingEnabled?f.imageSmoothingEnabled=!1:l.imageSmoothingQuality&&(f.imageSmoothingQuality=l.imageSmoothingQuality),f.drawImage(t,n,r,o,i,a,s,c,u),e},e.hasCanvasOption=function(e){return e.canvas||e.crop||!!e.aspectRatio},e.scale=function(t,n,r){n=n||{};var o,i,a,s,c,u,l,f,p,d,h,v=document.createElement("canvas"),m=t.getContext||e.hasCanvasOption(n)&&v.getContext,y=t.naturalWidth||t.width,g=t.naturalHeight||t.height,b=y,_=g;function k(){var e=Math.max((a||b)/b,(s||_)/_);e>1&&(b*=e,_*=e)}function w(){var e=Math.min((o||b)/b,(i||_)/_);e<1&&(b*=e,_*=e)}if(m&&(l=(n=e.getTransformedOptions(t,n,r)).left||0,f=n.top||0,n.sourceWidth?(c=n.sourceWidth,void 0!==n.right&&void 0===n.left&&(l=y-c-n.right)):c=y-l-(n.right||0),n.sourceHeight?(u=n.sourceHeight,void 0!==n.bottom&&void 0===n.top&&(f=g-u-n.bottom)):u=g-f-(n.bottom||0),b=c,_=u),o=n.maxWidth,i=n.maxHeight,a=n.minWidth,s=n.minHeight,m&&o&&i&&n.crop?(b=o,_=i,(h=c/u-o/i)<0?(u=i*c/o,void 0===n.top&&void 0===n.bottom&&(f=(g-u)/2)):h>0&&(c=o*u/i,void 0===n.left&&void 0===n.right&&(l=(y-c)/2))):((n.contain||n.cover)&&(a=o=o||a,s=i=i||s),n.cover?(w(),k()):(k(),w())),m){if((p=n.pixelRatio)>1&&(v.style.width=b+"px",v.style.height=_+"px",b*=p,_*=p,v.getContext("2d").scale(p,p)),(d=n.downsamplingRatio)>0&&d<1&&b<c&&_<u)for(;c*d>b;)v.width=c*d,v.height=u*d,e.renderImageToCanvas(v,t,l,f,c,u,0,0,v.width,v.height,n),l=0,f=0,c=v.width,u=v.height,(t=document.createElement("canvas")).width=c,t.height=u,e.renderImageToCanvas(t,v,0,0,c,u,0,0,c,u,n);return v.width=b,v.height=_,e.transformCoordinates(v,n),e.renderImageToCanvas(v,t,l,f,c,u,0,0,b,_,n)}return t.width=b,t.height=_,t}})?r.apply(t,o):r)||(e.exports=i)}()},function(e,t,n){var r,o,i;!function(a){"use strict";o=[n(171),n(413)],void 0===(i="function"==typeof(r=function(e){e.ExifMap=function(){return this},e.ExifMap.prototype.map={Orientation:274},e.ExifMap.prototype.get=function(e){return this[e]||this[this.map[e]]},e.getExifThumbnail=function(t,n,r){if(r&&!(n+r>t.byteLength))return e.createObjectURL(new Blob([t.buffer.slice(n,n+r)]));console.log("Invalid Exif data: Invalid thumbnail data.")},e.exifTagTypes={1:{getValue:function(e,t){return e.getUint8(t)},size:1},2:{getValue:function(e,t){return String.fromCharCode(e.getUint8(t))},size:1,ascii:!0},3:{getValue:function(e,t,n){return e.getUint16(t,n)},size:2},4:{getValue:function(e,t,n){return e.getUint32(t,n)},size:4},5:{getValue:function(e,t,n){return e.getUint32(t,n)/e.getUint32(t+4,n)},size:8},9:{getValue:function(e,t,n){return e.getInt32(t,n)},size:4},10:{getValue:function(e,t,n){return e.getInt32(t,n)/e.getInt32(t+4,n)},size:8}},e.exifTagTypes[7]=e.exifTagTypes[1],e.getExifValue=function(t,n,r,o,i,a){var s,c,u,l,f,p,d=e.exifTagTypes[o];if(d){if(!((c=(s=d.size*i)>4?n+t.getUint32(r+8,a):r+8)+s>t.byteLength)){if(1===i)return d.getValue(t,c,a);for(u=[],l=0;l<i;l+=1)u[l]=d.getValue(t,c+l*d.size,a);if(d.ascii){for(f="",l=0;l<u.length&&"\0"!==(p=u[l]);l+=1)f+=p;return f}return u}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")},e.parseExifTag=function(t,n,r,o,i){var a=t.getUint16(r,o);i.exif[a]=e.getExifValue(t,n,r,t.getUint16(r+2,o),t.getUint32(r+4,o),o)},e.parseExifTags=function(e,t,n,r,o){var i,a,s;if(n+6>e.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(!((a=n+2+12*(i=e.getUint16(n,r)))+4>e.byteLength)){for(s=0;s<i;s+=1)this.parseExifTag(e,t,n+2+12*s,r,o);return e.getUint32(a,r)}console.log("Invalid Exif data: Invalid directory size.")}},e.parseExifData=function(t,n,r,o,i){if(!i.disableExif){var a,s,c,u=n+10;if(1165519206===t.getUint32(n+4))if(u+8>t.byteLength)console.log("Invalid Exif data: Invalid segment size.");else if(0===t.getUint16(n+8)){switch(t.getUint16(u)){case 18761:a=!0;break;case 19789:a=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}42===t.getUint16(u+2,a)?(s=t.getUint32(u+4,a),o.exif=new e.ExifMap,(s=e.parseExifTags(t,u,u+s,a,o))&&!i.disableExifThumbnail&&(c={exif:{}},s=e.parseExifTags(t,u,u+s,a,c),c.exif[513]&&(o.exif.Thumbnail=e.getExifThumbnail(t,u+c.exif[513],c.exif[514]))),o.exif[34665]&&!i.disableExifSub&&e.parseExifTags(t,u,u+o.exif[34665],a,o),o.exif[34853]&&!i.disableExifGps&&e.parseExifTags(t,u,u+o.exif[34853],a,o)):console.log("Invalid Exif data: Missing TIFF marker.")}else console.log("Invalid Exif data: Missing byte alignment offset.")}},e.metaDataParsers.jpeg[65505].push(e.parseExifData)})?r.apply(t,o):r)||(e.exports=i)}()},function(e,t,n){!function(t){var r=-1,o=function(e){return e.every=function(t,n,o){e._time(),o||(o=n,n=null);var i=r+=1;return e._timers[i]={visible:t,hidden:n,callback:o},e._run(i,!1),e.isSupported()&&e._listen(),i},e.stop=function(t){return!!e._timers[t]&&(e._stop(t),delete e._timers[t],!0)},e._timers={},e._time=function(){e._timed||(e._timed=!0,e._wasHidden=e.hidden(),e.change((function(){e._stopRun(),e._wasHidden=e.hidden()})))},e._run=function(n,r){var o,i=e._timers[n];if(e.hidden()){if(null===i.hidden)return;o=i.hidden}else o=i.visible;var a=function(){i.last=new Date,i.callback.call(t)};if(r){var s=new Date-i.last;o>s?i.delay=setTimeout((function(){i.id=setInterval(a,o),a()}),o-s):(i.id=setInterval(a,o),a())}else i.id=setInterval(a,o)},e._stop=function(t){var n=e._timers[t];clearInterval(n.id),clearTimeout(n.delay),delete n.id,delete n.delay},e._stopRun=function(t){var n=e.hidden(),r=e._wasHidden;if(n&&!r||!n&&r)for(var o in e._timers)e._stop(o),e._run(o,!n)},e};e.exports?e.exports=o(n(414)):o(t.Visibility||n(414))}(window)},function(e,t,n){e.exports=n(556)},function(e,t,n){var r=n(557);e.exports=r},function(e,t,n){var r=n(558),o=Array.prototype;e.exports=function(e){var t=e.splice;return e===o||e instanceof Array&&t===o.splice?r:t}},function(e,t,n){n(559);var r=n(36);e.exports=r("Array").splice},function(e,t,n){"use strict";var r=n(9),o=n(121),i=n(91),a=n(48),s=n(41),c=n(123),u=n(84),l=n(86),f=n(43),p=l("splice"),d=f("splice",{ACCESSORS:!0,0:0,1:2}),h=Math.max,v=Math.min;r({target:"Array",proto:!0,forced:!p||!d},{splice:function(e,t){var n,r,l,f,p,d,m=s(this),y=a(m.length),g=o(e,y),b=arguments.length;if(0===b?n=r=0:1===b?(n=0,r=y-g):(n=b-2,r=v(h(i(t),0),y-g)),y+n-r>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(l=c(m,r),f=0;f<r;f++)(p=g+f)in m&&u(l,f,m[p]);if(l.length=r,n<r){for(f=g;f<y-r;f++)d=f+n,(p=f+r)in m?m[d]=m[p]:delete m[d];for(f=y;f>y-r+n;f--)delete m[f-1]}else if(n>r)for(f=y-r;f>g;f--)d=f+n-1,(p=f+r-1)in m?m[d]=m[p]:delete m[d];for(f=0;f<n;f++)m[f+g]=arguments[f+2];return m.length=y-r+n,l}})},function(e,t,n){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(561),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag",c="object"==typeof e,u=t.regeneratorRuntime;if(u)c&&(e.exports=u);else{(u=t.regeneratorRuntime=c?e.exports:{}).wrap=v;var l={},f={};f[i]=function(){return this};var p=Object.getPrototypeOf,d=p&&p(p(x([])));d&&d!==n&&r.call(d,i)&&(f=d);var h=b.prototype=y.prototype=Object.create(f);g.prototype=h.constructor=b,b.constructor=g,b[s]=g.displayName="GeneratorFunction",u.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},u.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(h),e},u.awrap=function(e){return{__await:e}},_(k.prototype),k.prototype[a]=function(){return this},u.AsyncIterator=k,u.async=function(e,t,n,r){var o=new k(v(e,t,n,r));return u.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},_(h),h[s]="Generator",h[i]=function(){return this},h.toString=function(){return"[object Generator]"},u.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},u.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}}}function v(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new C(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=m(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function y(){}function g(){}function b(){}function _(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function k(e){var t;this._invoke=function(n,o){function i(){return new Promise((function(t,i){!function t(n,o,i,a){var s=m(e[n],e,o);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):Promise.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return t("throw",e,i,a)}))}a(s.arg)}(n,o,t,i)}))}return t=t?t.then(i,i):i()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=m(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function x(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(e,t,n){e.exports=n(377)},function(e,t,n){"use strict";var r,o,i,a,s=n(9),c=n(62),u=n(31),l=n(49),f=n(416),p=n(97),d=n(294),h=n(54),v=n(295),m=n(32),y=n(52),g=n(167),b=n(68),_=n(161),k=n(127),w=n(289),S=n(417),O=n(418).set,C=n(564),x=n(420),E=n(565),j=n(272),A=n(299),P=n(61),T=n(160),D=n(29),I=n(124),N=D("species"),R="Promise",M=P.get,L=P.set,B=P.getterFor(R),F=f,U=u.TypeError,z=u.document,q=u.process,W=l("fetch"),H=j.f,V=H,G="process"==b(q),K=!!(z&&z.createEvent&&u.dispatchEvent),Q=T(R,(function(){if(!(_(F)!==String(F))){if(66===I)return!0;if(!G&&"function"!=typeof PromiseRejectionEvent)return!0}if(c&&!F.prototype.finally)return!0;if(I>=51&&/native code/.test(F))return!1;var e=F.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[N]=t,!(e.then((function(){}))instanceof t)})),$=Q||!w((function(e){F.all(e).catch((function(){}))})),Y=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},J=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;C((function(){for(var o=t.value,i=1==t.state,a=0;r.length>a;){var s,c,u,l=r[a++],f=i?l.ok:l.fail,p=l.resolve,d=l.reject,h=l.domain;try{f?(i||(2===t.rejection&&te(e,t),t.rejection=1),!0===f?s=o:(h&&h.enter(),s=f(o),h&&(h.exit(),u=!0)),s===l.promise?d(U("Promise-chain cycle")):(c=Y(s))?c.call(s,p,d):p(s)):d(o)}catch(e){h&&!u&&h.exit(),d(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Z(e,t)}))}},X=function(e,t,n){var r,o;K?((r=z.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),u.dispatchEvent(r)):r={promise:t,reason:n},(o=u["on"+e])?o(r):"unhandledrejection"===e&&E("Unhandled promise rejection",n)},Z=function(e,t){O.call(u,(function(){var n,r=t.value;if(ee(t)&&(n=A((function(){G?q.emit("unhandledRejection",r,e):X("unhandledrejection",e,r)})),t.rejection=G||ee(t)?2:1,n.error))throw n.value}))},ee=function(e){return 1!==e.rejection&&!e.parent},te=function(e,t){O.call(u,(function(){G?q.emit("rejectionHandled",e):X("rejectionhandled",e,t.value)}))},ne=function(e,t,n,r){return function(o){e(t,n,o,r)}},re=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,J(e,t,!0))},oe=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw U("Promise can't be resolved itself");var o=Y(n);o?C((function(){var r={done:!1};try{o.call(n,ne(oe,e,r,t),ne(re,e,r,t))}catch(n){re(e,r,n,t)}})):(t.value=n,t.state=1,J(e,t,!1))}catch(n){re(e,{done:!1},n,t)}}};Q&&(F=function(e){g(this,F,R),y(e),r.call(this);var t=M(this);try{e(ne(oe,this,t),ne(re,this,t))}catch(e){re(this,t,e)}},(r=function(e){L(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(F.prototype,{then:function(e,t){var n=B(this),r=H(S(this,F));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=G?q.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&J(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r,t=M(e);this.promise=e,this.resolve=ne(oe,e,t),this.reject=ne(re,e,t)},j.f=H=function(e){return e===F||e===i?new o(e):V(e)},c||"function"!=typeof f||(a=f.prototype.then,p(f.prototype,"then",(function(e,t){var n=this;return new F((function(e,t){a.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof W&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return x(F,W.apply(u,arguments))}}))),s({global:!0,wrap:!0,forced:Q},{Promise:F}),h(F,R,!1,!0),v(R),i=l(R),s({target:R,stat:!0,forced:Q},{reject:function(e){var t=H(this);return t.reject.call(void 0,e),t.promise}}),s({target:R,stat:!0,forced:c||Q},{resolve:function(e){return x(c&&this===i?F:this,e)}}),s({target:R,stat:!0,forced:$},{all:function(e){var t=this,n=H(t),r=n.resolve,o=n.reject,i=A((function(){var n=y(t.resolve),i=[],a=0,s=1;k(e,(function(e){var c=a++,u=!1;i.push(void 0),s++,n.call(t,e).then((function(e){u||(u=!0,i[c]=e,--s||r(i))}),o)})),--s||r(i)}));return i.error&&o(i.value),n.promise},race:function(e){var t=this,n=H(t),r=n.reject,o=A((function(){var o=y(t.resolve);k(e,(function(e){o.call(t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},function(e,t,n){var r,o,i,a,s,c,u,l,f=n(31),p=n(67).f,d=n(68),h=n(418).set,v=n(419),m=f.MutationObserver||f.WebKitMutationObserver,y=f.process,g=f.Promise,b="process"==d(y),_=p(f,"queueMicrotask"),k=_&&_.value;k||(r=function(){var e,t;for(b&&(e=y.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?a():i=void 0,e}}i=void 0,e&&e.enter()},b?a=function(){y.nextTick(r)}:m&&!v?(s=!0,c=document.createTextNode(""),new m(r).observe(c,{characterData:!0}),a=function(){c.data=s=!s}):g&&g.resolve?(u=g.resolve(void 0),l=u.then,a=function(){l.call(u,r)}):a=function(){h.call(f,r)}),e.exports=k||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},function(e,t,n){var r=n(31);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},function(e,t,n){"use strict";var r=n(9),o=n(62),i=n(416),a=n(24),s=n(49),c=n(417),u=n(420),l=n(97);r({target:"Promise",proto:!0,real:!0,forced:!!i&&a((function(){i.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c(this,s("Promise")),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then((function(){return n}))}:e,n?function(n){return u(t,e()).then((function(){throw n}))}:e)}}),o||"function"!=typeof i||i.prototype.finally||l(i.prototype,"finally",s("Promise").prototype.finally)},function(e,t,n){"use strict";var r=n(9),o=n(30),i=n(96),a=n(122),s=n(63),c=n(39),u=n(59),l=n(127),f=n(38),p=n(61),d=p.set,h=p.getterFor("AggregateError"),v=function(e,t){var n=this;if(!(n instanceof v))return new v(e,t);a&&(n=a(new Error(t),i(n)));var r=[];return l(e,r.push,r),o?d(n,{errors:r,type:"AggregateError"}):n.errors=r,void 0!==t&&f(n,"message",String(t)),n};v.prototype=s(Error.prototype,{constructor:u(5,v),message:u(5,""),name:u(5,"AggregateError")}),o&&c.f(v.prototype,"errors",{get:function(){return h(this).errors},configurable:!0}),r({global:!0},{AggregateError:v})},function(e,t,n){n(421)},function(e,t,n){"use strict";var r=n(9),o=n(272),i=n(299);r({target:"Promise",stat:!0},{try:function(e){var t=o.f(this),n=i(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},function(e,t,n){"use strict";var r=n(9),o=n(52),i=n(49),a=n(272),s=n(299),c=n(127);r({target:"Promise",stat:!0},{any:function(e){var t=this,n=a.f(t),r=n.resolve,u=n.reject,l=s((function(){var n=o(t.resolve),a=[],s=0,l=1,f=!1;c(e,(function(e){var o=s++,c=!1;a.push(void 0),l++,n.call(t,e).then((function(e){c||f||(f=!0,r(e))}),(function(e){c||f||(c=!0,a[o]=e,--l||u(new(i("AggregateError"))(a,"No one promise resolved")))}))})),--l||u(new(i("AggregateError"))(a,"No one promise resolved"))}));return l.error&&u(l.value),n.promise}})},function(e,t,n){e.exports=n(572)},function(e,t,n){var r=n(573);e.exports=r},function(e,t,n){var r=n(574),o=Array.prototype;e.exports=function(e){var t=e.sort;return e===o||e instanceof Array&&t===o.sort?r:t}},function(e,t,n){n(575);var r=n(36);e.exports=r("Array").sort},function(e,t,n){"use strict";var r=n(9),o=n(52),i=n(41),a=n(24),s=n(79),c=[],u=c.sort,l=a((function(){c.sort(void 0)})),f=a((function(){c.sort(null)})),p=s("sort");r({target:"Array",proto:!0,forced:l||!f||!p},{sort:function(e){return void 0===e?u.call(i(this)):u.call(i(this),o(e))}})},function(e,t,n){e.exports=n(577)},function(e,t,n){var r=n(578);e.exports=r},function(e,t,n){var r=n(579),o=Array.prototype;e.exports=function(e){var t=e.lastIndexOf;return e===o||e instanceof Array&&t===o.lastIndexOf?r:t}},function(e,t,n){n(580);var r=n(36);e.exports=r("Array").lastIndexOf},function(e,t,n){var r=n(9),o=n(581);r({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},function(e,t,n){"use strict";var r=n(37),o=n(91),i=n(48),a=n(79),s=n(43),c=Math.min,u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0,f=a("lastIndexOf"),p=s("indexOf",{ACCESSORS:!0,1:0}),d=l||!f||!p;e.exports=d?function(e){if(l)return u.apply(this,arguments)||0;var t=r(this),n=i(t.length),a=n-1;for(arguments.length>1&&(a=c(a,o(arguments[1]))),a<0&&(a=n+a);a>=0;a--)if(a in t&&t[a]===e)return a||0;return-1}:u},function(e,t,n){n(400);var r=n(22);e.exports=r.setInterval},function(e,t,n){var r=n(415);e.exports=r},function(e,t,n){var r=n(585),o=n(586),i=n(587),a=n(588),s=n(425);function c(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var u=c.prototype;u.addData=function(e){var t=new r(e);this.dataList.push(t),this.dataCache=null},u.isDark=function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},u.getModuleCount=function(){return this.moduleCount},u.make=function(){if(this.typeNumber<1){var e=1;for(e=1;e<40;e++){for(var t=o.getRSBlocks(e,this.errorCorrectLevel),n=new i,r=0,s=0;s<t.length;s++)r+=t[s].dataCount;for(s=0;s<this.dataList.length;s++){var c=this.dataList[s];n.put(c.mode,4),n.put(c.getLength(),a.getLengthInBits(c.mode,e)),c.write(n)}if(n.getLengthInBits()<=8*r)break}this.typeNumber=e}this.makeImpl(!1,this.getBestMaskPattern())},u.makeImpl=function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=c.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},u.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(this.modules[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},u.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=a.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},u.createMovieClip=function(e,t,n){var r=e.createEmptyMovieClip(t,n);this.make();for(var o=0;o<this.modules.length;o++)for(var i=1*o,a=0;a<this.modules[o].length;a++){var s=1*a;this.modules[o][a]&&(r.beginFill(0,100),r.moveTo(s,i),r.lineTo(s+1,i),r.lineTo(s+1,i+1),r.lineTo(s,i+1),r.endFill())}return r},u.setupTimingPattern=function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},u.setupPositionAdjustPattern=function(){for(var e=a.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var n=0;n<e.length;n++){var r=e[t],o=e[n];if(null==this.modules[r][o])for(var i=-2;i<=2;i++)for(var s=-2;s<=2;s++)this.modules[r+i][o+s]=-2==i||2==i||-2==s||2==s||0==i&&0==s}},u.setupTypeNumber=function(e){for(var t=a.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},u.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=a.getBCHTypeInfo(n),o=0;o<15;o++){var i=!e&&1==(r>>o&1);o<6?this.modules[o][8]=i:o<8?this.modules[o+1][8]=i:this.modules[this.moduleCount-15+o][8]=i}for(o=0;o<15;o++){i=!e&&1==(r>>o&1);o<8?this.modules[8][this.moduleCount-o-1]=i:o<9?this.modules[8][15-o-1+1]=i:this.modules[8][15-o-1]=i}this.modules[this.moduleCount-8][8]=!e},u.mapData=function(e,t){for(var n=-1,r=this.moduleCount-1,o=7,i=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var c=0;c<2;c++)if(null==this.modules[r][s-c]){var u=!1;i<e.length&&(u=1==(e[i]>>>o&1)),a.getMask(t,r,s-c)&&(u=!u),this.modules[r][s-c]=u,-1==--o&&(i++,o=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}},c.PAD0=236,c.PAD1=17,c.createData=function(e,t,n){for(var r=o.getRSBlocks(e,t),s=new i,u=0;u<n.length;u++){var l=n[u];s.put(l.mode,4),s.put(l.getLength(),a.getLengthInBits(l.mode,e)),l.write(s)}var f=0;for(u=0;u<r.length;u++)f+=r[u].dataCount;if(s.getLengthInBits()>8*f)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*f+")");for(s.getLengthInBits()+4<=8*f&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*f||(s.put(c.PAD0,8),s.getLengthInBits()>=8*f));)s.put(c.PAD1,8);return c.createBytes(s,r)},c.createBytes=function(e,t){for(var n=0,r=0,o=0,i=new Array(t.length),c=new Array(t.length),u=0;u<t.length;u++){var l=t[u].dataCount,f=t[u].totalCount-l;r=Math.max(r,l),o=Math.max(o,f),i[u]=new Array(l);for(var p=0;p<i[u].length;p++)i[u][p]=255&e.buffer[p+n];n+=l;var d=a.getErrorCorrectPolynomial(f),h=new s(i[u],d.getLength()-1).mod(d);c[u]=new Array(d.getLength()-1);for(p=0;p<c[u].length;p++){var v=p+h.getLength()-c[u].length;c[u][p]=v>=0?h.get(v):0}}var m=0;for(p=0;p<t.length;p++)m+=t[p].totalCount;var y=new Array(m),g=0;for(p=0;p<r;p++)for(u=0;u<t.length;u++)p<i[u].length&&(y[g++]=i[u][p]);for(p=0;p<o;p++)for(u=0;u<t.length;u++)p<c[u].length&&(y[g++]=c[u][p]);return y},e.exports=c},function(e,t,n){var r=n(423);function o(e){this.mode=r.MODE_8BIT_BYTE,this.data=e}o.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t<this.data.length;t++)e.put(this.data.charCodeAt(t),8)}},e.exports=o},function(e,t,n){var r=n(424);function o(e,t){this.totalCount=e,this.dataCount=t}o.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],o.getRSBlocks=function(e,t){var n=o.getRsBlockTable(e,t);if(null==n)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var r=n.length/3,i=new Array,a=0;a<r;a++)for(var s=n[3*a+0],c=n[3*a+1],u=n[3*a+2],l=0;l<s;l++)i.push(new o(c,u));return i},o.getRsBlockTable=function(e,t){switch(t){case r.L:return o.RS_BLOCK_TABLE[4*(e-1)+0];case r.M:return o.RS_BLOCK_TABLE[4*(e-1)+1];case r.Q:return o.RS_BLOCK_TABLE[4*(e-1)+2];case r.H:return o.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},e.exports=o},function(e,t){function n(){this.buffer=new Array,this.length=0}n.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=n},function(e,t,n){var r=n(423),o=n(425),i=n(426),a=0,s=1,c=2,u=3,l=4,f=5,p=6,d=7,h={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;h.getBCHDigit(t)-h.getBCHDigit(h.G15)>=0;)t^=h.G15<<h.getBCHDigit(t)-h.getBCHDigit(h.G15);return(e<<10|t)^h.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;h.getBCHDigit(t)-h.getBCHDigit(h.G18)>=0;)t^=h.G18<<h.getBCHDigit(t)-h.getBCHDigit(h.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return h.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case a:return(t+n)%2==0;case s:return t%2==0;case c:return n%3==0;case u:return(t+n)%3==0;case l:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case f:return t*n%2+t*n%3==0;case p:return(t*n%2+t*n%3)%2==0;case d:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new o([1],0),n=0;n<e;n++)t=t.multiply(new o([1,i.gexp(n)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:case r.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r++)for(var o=0;o<t;o++){for(var i=0,a=e.isDark(r,o),s=-1;s<=1;s++)if(!(r+s<0||t<=r+s))for(var c=-1;c<=1;c++)o+c<0||t<=o+c||0==s&&0==c||a==e.isDark(r+s,o+c)&&i++;i>5&&(n+=3+i-5)}for(r=0;r<t-1;r++)for(o=0;o<t-1;o++){var u=0;e.isDark(r,o)&&u++,e.isDark(r+1,o)&&u++,e.isDark(r,o+1)&&u++,e.isDark(r+1,o+1)&&u++,0!=u&&4!=u||(n+=3)}for(r=0;r<t;r++)for(o=0;o<t-6;o++)e.isDark(r,o)&&!e.isDark(r,o+1)&&e.isDark(r,o+2)&&e.isDark(r,o+3)&&e.isDark(r,o+4)&&!e.isDark(r,o+5)&&e.isDark(r,o+6)&&(n+=40);for(o=0;o<t;o++)for(r=0;r<t-6;r++)e.isDark(r,o)&&!e.isDark(r+1,o)&&e.isDark(r+2,o)&&e.isDark(r+3,o)&&e.isDark(r+4,o)&&!e.isDark(r+5,o)&&e.isDark(r+6,o)&&(n+=40);var l=0;for(o=0;o<t;o++)for(r=0;r<t;r++)e.isDark(r,o)&&l++;return n+=10*(Math.abs(100*l/t/t-50)/5)}};e.exports=h},function(e,t,n){"use strict";n.r(t),n.d(t,"init",(function(){return ou}));var r={};n.r(r),n.d(r,"setIdDocumentType",(function(){return se})),n.d(r,"setPoADocumentType",(function(){return ce})),n.d(r,"setRoomId",(function(){return ue})),n.d(r,"setSocket",(function(){return le})),n.d(r,"setClientSuccess",(function(){return fe})),n.d(r,"setMobileNumber",(function(){return pe})),n.d(r,"mobileConnected",(function(){return de})),n.d(r,"acceptTerms",(function(){return he})),n.d(r,"setNavigationDisabled",(function(){return ve})),n.d(r,"setFullScreen",(function(){return me})),n.d(r,"setDeviceHasCameraSupport",(function(){return ye})),n.d(r,"setUrls",(function(){return ge})),n.d(r,"hideOnfidoLogo",(function(){return be})),n.d(r,"showCobranding",(function(){return _e}));var o={};n.r(o),n.d(o,"createCapture",(function(){return Fc})),n.d(o,"deleteCapture",(function(){return Uc})),n.d(o,"setCaptureMetadata",(function(){return zc}));var i=n(26),a=n.n(i),s=n(27),c=n.n(s),u=n(16),l=n.n(u),f=n(13),p=n.n(f),d=n(17),h=n.n(d),v=n(21),m=n.n(v),y=n(18),g=n.n(y),b=n(15),_=n.n(b),k=n(44),w=n.n(k),S=n(73),O=n.n(S),C=n(33),x=n.n(C),E=n(1),j=n.n(E),A=n(45),P=n.n(A),T=n(98),D=n.n(T),I=n(0),N=n(453),R=n(454),M=(n(455),n(3)),L=n.n(M),B=n(19),F=n.n(B),U=n(7),z=n.n(U),q=n(11),W=n.n(q),H=n(2),V=n.n(H),G=n(8),K=n.n(G),Q=n(10),$=n.n(Q),Y=n(4),J=n.n(Y),X=n(74),Z=n(130),ee=n(427),te=n.n(ee),ne=n(428),re=n.n(ne),oe=n(12),ie=n.n(oe),ae=n(20);function se(e){return{type:"SET_ID_DOCUMENT_TYPE",payload:e}}var ce=function(e){return{type:"SET_POA_DOCUMENT_TYPE",payload:e}};function ue(e){return{type:"SET_ROOM_ID",payload:e}}function le(e){return{type:"SET_SOCKET",payload:e}}function fe(e){return{type:"SET_CLIENT_SUCCESS",payload:e}}function pe(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={number:e,valid:t};return{type:"SET_MOBILE_NUMBER",payload:n}}function de(e){return{type:"MOBILE_CONNECTED",payload:e}}function he(){return{type:"ACCEPT_TERMS"}}function ve(e){return{type:"SET_NAVIGATION_DISABLED",payload:e}}function me(e){return{type:"SET_FULL_SCREEN",payload:e}}var ye=function(e){return{type:"SET_DEVICE_HAS_CAMERA_SUPPORT",payload:e}},ge=function(e){return{type:"SET_URLS",payload:e}},be=function(e){return{type:"HIDE_ONFIDO_LOGO",payload:e}},_e=function(e){return{type:"SHOW_COBRANDING",payload:e}};var ke=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"componentDidMount",value:function(){this.props.setFullScreen(!0)}},{key:"componentWillUnmount",value:function(){this.props.setFullScreen(!1)}},{key:"render",value:function(){return null}}]),n}(I.Component),we=Object(X.connect)((function(e){return{isFullScreen:e.globals.isFullScreen}})),Se=Object(X.connect)(null,(function(e){return{setFullScreen:function(t){return e(me(t))}}})),Oe=Se(ke),Ce=n(23),xe=n(14),Ee=n(116),je=n.n(Ee);var Ae=Object(Ce.h)(je.a.modal_animation_duration),Pe=function(e){var t=e.children;return Object(Ce.o)(je.a.inner,t)},Te=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"render",value:function(){var e=this.props,t=e.translate,n=e.isFullScreen,r=e.containerId,o=e.containerEl,i=e.shouldCloseOnOverlayClick;return Object(I.h)(re.a,{isOpen:this.props.isOpen,onRequestClose:this.props.onRequestClose,portalClassName:je.a.portal,overlayClassName:je.a.overlay,bodyClassName:je.a.modalBody,className:je.a.inner,shouldCloseOnOverlayClick:i,closeTimeoutMS:Ae,appElement:o||document.getElementById(r)},Object(I.h)("button",{type:"button","aria-label":t("accessibility.close_sdk_screen"),onClick:this.props.onRequestClose,className:ie()(je.a.closeButton,j()({},je.a.closeButtonFullScreen,n))},Object(I.h)("span",{className:je.a.closeButtonLabel,"aria-hidden":"true"},t("close"))),this.props.children)}}]),n}(I.Component);j()(Te,"defaultProps",{shouldCloseOnOverlayClick:!0});var De=we(Object(xe.b)(Te)),Ie=function(e){var t=e.useModal,n=e.children,r=P()(e,["useModal","children"]);return t?Object(I.h)(De,r,n):Object(I.h)(Pe,null,n)},Ne=n(440),Re=n.n(Ne),Me=n(65),Le=n.n(Me),Be=n(5),Fe=n.n(Be),Ue=n(64),ze=n.n(Ue),qe=n(87),We=n.n(qe),He=n(75),Ve=n(51),Ge=function(e){var t=e.split(".")[1].replace("-","+").replace("_","/");return JSON.parse(atob(t))},Ke=function(e){try{return Ge(e).enterprise_features}catch(e){console.error("Invalid token:",e.message)}},Qe=n(42),$e=n(441),Ye=n.n($e),Je={path:"/v2/socket.io",upgrade:!1,autoConnect:!1,transports:["websocket","polling"]},Xe=function(e){return Ye()(e,Je)},Ze=n(132),et=n.n(Ze),tt=n(57),nt=n.n(tt),rt=n(157),ot=n.n(rt);var it=we(function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.title,r=t.subTitle;n===e.title&&r===e.subTitle||this.container&&this.container.focus()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.title,o=n.subTitle,i=n.smaller,a=n.isFullScreen,s=n.className;return Object(I.h)("div",{className:ie()(ot.a.titleWrapper,(e={},j()(e,ot.a.smaller,i&&!a),j()(e,ot.a.fullScreen,a),e),s)},Object(I.h)("div",{className:ot.a.title,role:"heading","aria-level":"1","aria-live":"assertive"},Object(I.h)("span",{className:ot.a.titleSpan,tabIndex:-1,ref:function(e){return t.container=e}},r)),o&&Object(I.h)("div",{className:ot.a.subTitle,role:"heading","aria-level":"2"},o))}}]),n}(I.Component)),at=n(154),st=n.n(at),ct=function(e){var t,n=e.className,r=e.textClassName,o=e.variants,i=void 0===o?[]:o,a=e.disabled,s=e.children,c=e.onClick,u=e.ariaLive,l=e.ariaRelevant,f=e.ariaBusy;return Object(I.h)("button",{type:"button","aria-live":u,"aria-relevant":l,"aria-busy":f,disabled:a,onClick:c,className:ie.a.apply(void 0,Fe()(t=[n,st.a.button]).call(t,nt()(x()(i).call(i,(function(e){return st.a["button-"+e]}))),[j()({},st.a.hoverDesktop,Ce.j)]))},Object(I.h)("span",{className:ie()(r,st.a["button-text"])},s))},ut=n(58),lt=n.n(ut),ft=n(375),pt=n.n(ft),dt=n(28),ht=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n]);return e});var vt=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,ht(r,n.prototype),r}return dt.b(t,e),t}(Error),mt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w\.-]+)(?::(\d+))?\/(.+)/,yt=function(){function e(e){"string"==typeof e?this._fromString(e):this._fromComponents(e),this._validate()}return e.prototype.toString=function(e){void 0===e&&(e=!1);var t=this,n=t.host,r=t.path,o=t.pass,i=t.port,a=t.projectId;return t.protocol+"://"+t.user+(e&&o?":"+o:"")+"@"+n+(i?":"+i:"")+"/"+(r?r+"/":r)+a},e.prototype._fromString=function(e){var t=mt.exec(e);if(!t)throw new vt("Invalid Dsn");var n=dt.c(t.slice(1),6),r=n[0],o=n[1],i=n[2],a=void 0===i?"":i,s=n[3],c=n[4],u=void 0===c?"":c,l="",f=n[5],p=f.split("/");p.length>1&&(l=p.slice(0,-1).join("/"),f=p.pop()),this._fromComponents({host:s,pass:a,path:l,projectId:f,port:u,protocol:r,user:o})},e.prototype._fromComponents=function(e){this.protocol=e.protocol,this.user=e.user,this.pass=e.pass||"",this.host=e.host,this.port=e.port||"",this.path=e.path||"",this.projectId=e.projectId},e.prototype._validate=function(){var e=this;if(["protocol","user","host","projectId"].forEach((function(t){if(!e[t])throw new vt("Invalid Dsn")})),"http"!==this.protocol&&"https"!==this.protocol)throw new vt("Invalid Dsn");if(this.port&&isNaN(parseInt(this.port,10)))throw new vt("Invalid Dsn")},e}(),gt=n(595),bt=function(){function e(e){this.dsn=e,this._dsnObject=new yt(e)}return e.prototype.getDsn=function(){return this._dsnObject},e.prototype.getStoreEndpoint=function(){return""+this._getBaseUrl()+this.getStoreEndpointPath()},e.prototype.getStoreEndpointWithUrlEncodedAuth=function(){var e={sentry_key:this._dsnObject.user,sentry_version:"7"};return this.getStoreEndpoint()+"?"+Object(gt.d)(e)},e.prototype._getBaseUrl=function(){var e=this._dsnObject,t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return t+"//"+e.host+n},e.prototype.getStoreEndpointPath=function(){var e=this._dsnObject;return(e.path?"/"+e.path:"")+"/api/"+e.projectId+"/store/"},e.prototype.getRequestHeaders=function(e,t){var n=this._dsnObject,r=["Sentry sentry_version=7"];return r.push("sentry_client="+e+"/"+t),r.push("sentry_key="+n.user),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},e.prototype.getReportDialogEndpoint=function(e){void 0===e&&(e={});var t=this._dsnObject,n=this._getBaseUrl()+(t.path?"/"+t.path:"")+"/api/embed/error-page/",r=[];for(var o in r.push("dsn="+t.toString()),e)if("user"===o){if(!e.user)continue;e.user.name&&r.push("name="+encodeURIComponent(e.user.name)),e.user.email&&r.push("email="+encodeURIComponent(e.user.email))}else r.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return r.length?n+"?"+r.join("&"):n},e}(),_t=n(304),kt=n(66),wt=n(280),St=n(155),Ot=n(50),Ct=n(305),xt=n(596),Et=[];function jt(e){var t={};return function(e){var t=e.defaultIntegrations&&dt.d(e.defaultIntegrations)||[],n=e.integrations,r=[];if(Array.isArray(n)){var o=n.map((function(e){return e.name})),i=[];t.forEach((function(e){-1===o.indexOf(e.name)&&-1===i.indexOf(e.name)&&(r.push(e),i.push(e.name))})),n.forEach((function(e){-1===i.indexOf(e.name)&&(r.push(e),i.push(e.name))}))}else"function"==typeof n?(r=n(t),r=Array.isArray(r)?r:[r]):r=dt.d(t);var a=r.map((function(e){return e.name}));return-1!==a.indexOf("Debug")&&r.push.apply(r,dt.d(r.splice(a.indexOf("Debug"),1))),r}(e).forEach((function(e){t[e.name]=e,function(e){-1===Et.indexOf(e.name)&&(e.setupOnce(Ct.b,xt.b),Et.push(e.name),_t.a.log("Integration installed: "+e.name))}(e)})),t}var At,Pt=function(){function e(e,t){this._integrations={},this._processing=!1,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=new yt(t.dsn)),this._isEnabled()&&(this._integrations=jt(this._options))}return e.prototype.captureException=function(e,t,n){var r=this,o=t&&t.event_id;return this._processing=!0,this._getBackend().eventFromException(e,t).then((function(e){return r._processEvent(e,t,n)})).then((function(e){o=e&&e.event_id,r._processing=!1})).then(null,(function(e){_t.a.error(e),r._processing=!1})),o},e.prototype.captureMessage=function(e,t,n,r){var o=this,i=n&&n.event_id;return this._processing=!0,(Object(kt.i)(e)?this._getBackend().eventFromMessage(""+e,t,n):this._getBackend().eventFromException(e,n)).then((function(e){return o._processEvent(e,n,r)})).then((function(e){i=e&&e.event_id,o._processing=!1})).then(null,(function(e){_t.a.error(e),o._processing=!1})),i},e.prototype.captureEvent=function(e,t,n){var r=this,o=t&&t.event_id;return this._processing=!0,this._processEvent(e,t,n).then((function(e){o=e&&e.event_id,r._processing=!1})).then(null,(function(e){_t.a.error(e),r._processing=!1})),o},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.flush=function(e){var t=this;return this._isClientProcessing(e).then((function(n){return clearInterval(n.interval),t._getBackend().getTransport().close(e).then((function(e){return n.ready&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.getIntegrations=function(){return this._integrations||{}},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){return _t.a.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._isClientProcessing=function(e){var t=this;return new wt.a((function(n){var r=0,o=0;clearInterval(o),o=setInterval((function(){t._processing?(r+=1,e&&r>=e&&n({interval:o,ready:!1})):n({interval:o,ready:!0})}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},e.prototype._prepareEvent=function(e,t,n){var r=this,o=this.getOptions(),i=o.environment,a=o.release,s=o.dist,c=o.maxValueLength,u=void 0===c?250:c,l=o.normalizeDepth,f=void 0===l?3:l,p=dt.a({},e);void 0===p.environment&&void 0!==i&&(p.environment=i),void 0===p.release&&void 0!==a&&(p.release=a),void 0===p.dist&&void 0!==s&&(p.dist=s),p.message&&(p.message=Object(St.b)(p.message,u));var d=p.exception&&p.exception.values&&p.exception.values[0];d&&d.value&&(d.value=Object(St.b)(d.value,u));var h=p.request;h&&h.url&&(h.url=Object(St.b)(h.url,u)),void 0===p.event_id&&(p.event_id=n&&n.event_id?n.event_id:Object(Ot.k)()),this._addIntegrations(p.sdk);var v=wt.a.resolve(p);return t&&(v=t.applyToEvent(p,n)),v.then((function(e){return"number"==typeof f&&f>0?r._normalizeEvent(e,f):e}))},e.prototype._normalizeEvent=function(e,t){return e?dt.a({},e,e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return dt.a({},e,e.data&&{data:Object(gt.b)(e.data,t)})}))},e.user&&{user:Object(gt.b)(e.user,t)},e.contexts&&{contexts:Object(gt.b)(e.contexts,t)},e.extra&&{extra:Object(gt.b)(e.extra,t)}):null},e.prototype._addIntegrations=function(e){var t=Object.keys(this._integrations);e&&t.length>0&&(e.integrations=t)},e.prototype._processEvent=function(e,t,n){var r=this,o=this.getOptions(),i=o.beforeSend,a=o.sampleRate;return this._isEnabled()?"number"==typeof a&&Math.random()>a?wt.a.reject("This event has been sampled, will not send event."):new wt.a((function(o,a){r._prepareEvent(e,n,t).then((function(e){if(null!==e){var n=e;if(t&&t.data&&!0===t.data.__sentry__||!i)return r._getBackend().sendEvent(n),void o(n);var s=i(e,t);if(void 0===s)_t.a.error("`beforeSend` method has to return `null` or a valid event.");else if(Object(kt.m)(s))r._handleAsyncBeforeSend(s,o,a);else{if(null===(n=s))return _t.a.log("`beforeSend` returned `null`, will not send event."),void o(null);r._getBackend().sendEvent(n),o(n)}}else a("An event processor returned null, will not send event.")})).then(null,(function(e){r.captureException(e,{data:{__sentry__:!0},originalException:e}),a("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))})):wt.a.reject("SDK not enabled, will not send event.")},e.prototype._handleAsyncBeforeSend=function(e,t,n){var r=this;e.then((function(e){null!==e?(r._getBackend().sendEvent(e),t(e)):n("`beforeSend` returned `null`, will not send event.")})).then(null,(function(e){n("beforeSend rejected with "+e)}))},e}();!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.Invalid="invalid",e.Failed="failed"}(At||(At={})),function(e){e.fromHttpCode=function(t){return t>=200&&t<300?e.Success:429===t?e.RateLimit:t>=400&&t<500?e.Invalid:t>=500?e.Failed:e.Unknown}}(At||(At={}));var Tt,Dt=function(){function e(){}return e.prototype.sendEvent=function(e){return wt.a.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:At.Skipped})},e.prototype.close=function(e){return wt.a.resolve(!0)},e}(),It=function(){function e(e){this._options=e,this._options.dsn||_t.a.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype._setupTransport=function(){return new Dt},e.prototype.eventFromException=function(e,t){throw new vt("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){throw new vt("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){this._transport.sendEvent(e).then(null,(function(e){_t.a.error("Error while sending event: "+e)}))},e.prototype.getTransport=function(){return this._transport},e}();function Nt(){if(!("fetch"in Object(Ot.f)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function Rt(){if(!Nt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}!function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(Tt||(Tt={})),function(e){e.fromString=function(t){switch(t){case"debug":return e.Debug;case"info":return e.Info;case"warn":case"warning":return e.Warning;case"error":return e.Error;case"fatal":return e.Fatal;case"critical":return e.Critical;case"log":default:return e.Log}}}(Tt||(Tt={}));var Mt=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Lt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,Bt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Ft=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ut=/\((\S*)(?::(\d+))(?::(\d+))\)/;function zt(e){var t=null,n=e&&e.framesToPop;try{if(t=function(e){if(!e||!e.stacktrace)return null;for(var t,n=e.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=n.split("\n"),a=[],s=0;s<i.length;s+=2){var c=null;(t=r.exec(i[s]))?c={url:t[2],func:t[3],args:[],line:+t[1],column:null}:(t=o.exec(i[s]))&&(c={url:t[6],func:t[3]||t[4],args:t[5]?t[5].split(","):[],line:+t[1],column:+t[2]}),c&&(!c.func&&c.line&&(c.func="?"),a.push(c))}if(!a.length)return null;return{message:Wt(e),name:e.name,stack:a}}(e))return qt(t,n)}catch(e){}try{if(t=function(e){if(!e||!e.stack)return null;for(var t,n,r,o=[],i=e.stack.split("\n"),a=0;a<i.length;++a){if(n=Mt.exec(i[a])){var s=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(t=Ut.exec(n[2]))&&(n[2]=t[1],n[3]=t[2],n[4]=t[3]),r={url:n[2]&&0===n[2].indexOf("address at ")?n[2].substr("address at ".length):n[2],func:n[1]||"?",args:s?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=Bt.exec(i[a]))r={url:n[2],func:n[1]||"?",args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=Lt.exec(i[a])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(t=Ft.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]=""):0!==a||n[5]||void 0===e.columnNumber||(o[0].column=e.columnNumber+1),r={url:n[3],func:n[1]||"?",args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func="?"),o.push(r)}if(!o.length)return null;return{message:Wt(e),name:e.name,stack:o}}(e))return qt(t,n)}catch(e){}return{message:Wt(e),name:e&&e.name,stack:[],failed:!0}}function qt(e,t){try{return dt.a({},e,{stack:e.stack.slice(t)})}catch(t){return e}}function Wt(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Ht(e){return{exception:{values:[function(e){var t=Vt(e.stack),n={type:e.name,value:e.message};return t&&t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}(e)]}}}function Vt(e){if(!e||!e.length)return[];var t=e,n=t[0].func||"",r=t[t.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.map((function(e){return{colno:null===e.column?void 0:e.column,filename:e.url||t[0].url,function:e.func||"?",in_app:!0,lineno:null===e.line?void 0:e.line}})).slice(0,50).reverse()}function Gt(e,t,n){var r;if(void 0===n&&(n={}),Object(kt.e)(e)&&e.error)return r=Ht(zt(e=e.error));if(Object(kt.a)(e)||Object(kt.b)(e)){var o=e,i=o.name||(Object(kt.a)(o)?"DOMError":"DOMException"),a=o.message?i+": "+o.message:i;return r=Kt(a,t,n),Object(Ot.b)(r,a),r}return Object(kt.d)(e)?r=Ht(zt(e)):Object(kt.h)(e)||Object(kt.f)(e)?(r=function(e,t,n){var r={exception:{values:[{type:Object(kt.f)(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+Object(gt.a)(e)}]},extra:{__serialized__:Object(gt.c)(e)}};if(t){var o=Vt(zt(t).stack);r.stacktrace={frames:o}}return r}(e,t,n.rejection),Object(Ot.a)(r,{synthetic:!0}),r):(r=Kt(e,t,n),Object(Ot.b)(r,""+e,void 0),Object(Ot.a)(r,{synthetic:!0}),r)}function Kt(e,t,n){void 0===n&&(n={});var r={message:e};if(n.attachStacktrace&&t){var o=Vt(zt(t).stack);r.stacktrace={frames:o}}return r}var Qt=function(){function e(e){this._limit=e,this._buffer=[]}return e.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},e.prototype.add=function(e){var t=this;return this.isReady()?(-1===this._buffer.indexOf(e)&&this._buffer.push(e),e.then((function(){return t.remove(e)})).then(null,(function(){return t.remove(e).then(null,(function(){}))})),e):wt.a.reject(new vt("Not adding Promise due to buffer limit reached."))},e.prototype.remove=function(e){return this._buffer.splice(this._buffer.indexOf(e),1)[0]},e.prototype.length=function(){return this._buffer.length},e.prototype.drain=function(e){var t=this;return new wt.a((function(n){var r=setTimeout((function(){e&&e>0&&n(!1)}),e);wt.a.all(t._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},e}(),$t=function(){function e(e){this.options=e,this._buffer=new Qt(30),this.url=new bt(this.options.dsn).getStoreEndpointWithUrlEncodedAuth()}return e.prototype.sendEvent=function(e){throw new vt("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(e){return this._buffer.drain(e)},e}(),Yt=Object(Ot.f)(),Jt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._disabledUntil=new Date(Date.now()),t}return dt.b(t,e),t.prototype.sendEvent=function(e){var t=this;if(new Date(Date.now())<this._disabledUntil)return Promise.reject({event:e,reason:"Transport locked till "+this._disabledUntil+" due to too many requests.",status:429});var n={body:JSON.stringify(e),method:"POST",referrerPolicy:Rt()?"origin":""};return void 0!==this.options.headers&&(n.headers=this.options.headers),this._buffer.add(new wt.a((function(e,r){Yt.fetch(t.url,n).then((function(n){var o=At.fromHttpCode(n.status);if(o!==At.Success){if(o===At.RateLimit){var i=Date.now();t._disabledUntil=new Date(i+Object(Ot.i)(i,n.headers.get("Retry-After"))),_t.a.warn("Too many requests, backing off till: "+t._disabledUntil)}r(n)}else e({status:o})})).catch(r)})))},t}($t),Xt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._disabledUntil=new Date(Date.now()),t}return dt.b(t,e),t.prototype.sendEvent=function(e){var t=this;return new Date(Date.now())<this._disabledUntil?Promise.reject({event:e,reason:"Transport locked till "+this._disabledUntil+" due to too many requests.",status:429}):this._buffer.add(new wt.a((function(n,r){var o=new XMLHttpRequest;for(var i in o.onreadystatechange=function(){if(4===o.readyState){var e=At.fromHttpCode(o.status);if(e!==At.Success){if(e===At.RateLimit){var i=Date.now();t._disabledUntil=new Date(i+Object(Ot.i)(i,o.getResponseHeader("Retry-After"))),_t.a.warn("Too many requests, backing off till: "+t._disabledUntil)}r(o)}else n({status:e})}},o.open("POST",t.url),t.options.headers)t.options.headers.hasOwnProperty(i)&&o.setRequestHeader(i,t.options.headers[i]);o.send(JSON.stringify(e))})))},t}($t),Zt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return dt.b(t,e),t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=dt.a({},this._options.transportOptions,{dsn:this._options.dsn});return this._options.transport?new this._options.transport(t):Nt()?new Jt(t):new Xt(t)},t.prototype.eventFromException=function(e,t){var n=Gt(e,t&&t.syntheticException||void 0,{attachStacktrace:this._options.attachStacktrace});return Object(Ot.a)(n,{handled:!0,type:"generic"}),n.level=Tt.Error,t&&t.event_id&&(n.event_id=t.event_id),wt.a.resolve(n)},t.prototype.eventFromMessage=function(e,t,n){void 0===t&&(t=Tt.Info);var r=Kt(e,n&&n.syntheticException||void 0,{attachStacktrace:this._options.attachStacktrace});return r.level=t,n&&n.event_id&&(r.event_id=n.event_id),wt.a.resolve(r)},t}(It),en=function(e){function t(t){return void 0===t&&(t={}),e.call(this,Zt,t)||this}return dt.b(t,e),t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",t.sdk=dt.a({},t.sdk,{name:"sentry.javascript.browser",packages:dt.d(t.sdk&&t.sdk.packages||[],[{name:"npm:@sentry/browser",version:"5.14.2"}]),version:"5.14.2"}),e.prototype._prepareEvent.call(this,t,n,r)},t.prototype.showReportDialog=function(e){void 0===e&&(e={});var t=Object(Ot.f)().document;if(t)if(this._isEnabled()){var n=e.dsn||this.getDsn();if(e.eventId)if(n){var r=t.createElement("script");r.async=!0,r.src=new bt(n).getReportDialogEndpoint(e),e.onLoad&&(r.onload=e.onLoad),(t.head||t.body).appendChild(r)}else _t.a.error("Missing `Dsn` option in showReportDialog call");else _t.a.error("Missing `eventId` option in showReportDialog call")}else _t.a.error("Trying to call showReportDialog with Sentry Client is disabled")},t}(Pt),tn=n(442),nn=n.n(tn),rn=function(e){return m()(e).call(e,(function(e){return e}))},on=function(e){return nn()(e)?e:[e]},an=n(278),sn=n.n(an);function cn(){var e=this,t=function(t){a()(e,t,{get:function(){var n=window[t];return"function"==typeof n?sn()(n).call(n,window):"window"===t?e:n},set:function(e){window[t]=e}})};for(var n in window)t(n)}cn.prototype=Window.prototype;var un=window.onfidoSafeWindow8xmy484y87m239843m20=new cn;n(550),delete window.onfidoSafeWindow8xmy484y87m239843m20;var ln=un.WoopraTracker,fn=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)},pn=/([A-Z])/g,dn=function(e){return e.replace(pn," $1").split(" ")},hn=Object(Qe.a)(rn,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ze()(t).call(t,(function(e,t){var n,r;return(n=Fe()(e)).call.apply(n,Fe()(r=[e]).call(r,nt()(on(t))))}),[])})),vn=/[^\s_-]+/g,mn=function(e){return(e||"").toLowerCase()},yn=function(e){return(e||"").toUpperCase()},gn=function(e){var t,n;return x()(t=hn(x()(n=(e||"").match(vn)||[]).call(n,dn))).call(t,mn)},bn=function(e){var t;return ze()(t=gn(e)).call(t,(function(e,t,n){var r;return Fe()(r="".concat(e)).call(r,(n>0?fn:Qe.b)(t))}),"")},_n=function(){return Math.random().toString(36).substring(7)};function kn(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}var wn=!1,Sn=window.location.hostname,On=null,Cn=null,xn=new ln("onfidojssdkwoopra"),En=new pt.a([["screen_welcome","WELCOME"],["screen_document_front_capture_file_upload","DOCUMENT_CAPTURE_FRONT"],["screen_document_front_confirmation","DOCUMENT_CAPTURE_CONFIRMATION_FRONT"],["screen_document_back_capture_file_upload","DOCUMENT_CAPTURE_BACK"],["screen_document_back_confirmation","DOCUMENT_CAPTURE_CONFIRMATION_BACK"],["screen_face_selfie_intro","FACIAL_INTRO"],["screen_face_selfie_capture","FACIAL_CAPTURE"],["screen_face_selfie_confirmation","FACIAL_CAPTURE_CONFIRMATION"],["screen_face_video_intro","VIDEO_FACIAL_INTRO"],["screen_face_video_capture_step_1","VIDEO_FACIAL_CAPTURE_STEP_1"],["screen_face_video_capture_step_2","VIDEO_FACIAL_CAPTURE_STEP_2"],["Starting upload","UPLOAD"],["screen_document_type_select","DOCUMENT_TYPE_SELECT"]]),jn=function(){xn.dispose(),wn=!1},An=function(e,t){En.has(e)&&function(e,t){dispatchEvent(new CustomEvent("userAnalyticsEvent",{detail:{eventName:e,properties:t,isCrossDevice:!1}}))}(En.get(e),t),wn&&xn.track(e,function(e){return e?Object(Ve.d)(e,(function(e){return"object"===D()(e)?lt()(e):e})):null}(t))},Pn=function(e,t){return An(function(e){return"screen_".concat(rn(e).join("_"))}(e),t)},Tn=function(e,t){return function(n){K()(o,n);var r=kn(o);function o(){var n,i;z()(this,o);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return i=r.call.apply(r,Fe()(n=[this]).call(n,s)),j()(V()(i),"trackScreen",(function(e){for(var n,r,o,a=arguments.length,s=new Array(a>1?a-1:0),c=1;c<a;c++)s[c-1]=arguments[c];return(n=i.props).trackScreen.apply(n,Fe()(r=[Fe()(o=[]).call(o,nt()(on(t)),nt()(on(e)))]).call(r,s))})),j()(V()(i),"render",(function(){return Object(I.h)(e,F()({},i.props,{trackScreen:i.trackScreen}))})),i}return o}(I.Component)},Dn=function(e,t){return function(n){K()(o,n);var r=kn(o);function o(){var t,n;z()(this,o);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,Fe()(t=[this]).call(t,a)),j()(V()(n),"render",(function(){return Object(I.h)(e,n.props)})),n}return W()(o,[{key:"componentDidMount",value:function(){this.props.trackScreen(t)}}]),o}(I.Component)},In=function(e,t,n){return Tn(function(e,t){return function(n){K()(o,n);var r=kn(o);function o(){var t,n;z()(this,o);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,Fe()(t=[this]).call(t,a)),j()(V()(n),"render",(function(){return Object(I.h)(e,n.props)})),n}return W()(o,[{key:"componentDidMount",value:function(){this.trackScreen(this.props)}},{key:"trackScreen",value:function(e){var n,r=e[t],o=r?[t,j()({},t,r)]:[];(n=this.props).trackScreen.apply(n,o)}},{key:"componentWillReceiveProps",value:function(e){this.props[t]!==e[t]&&this.trackScreen(e)}}]),o}(I.Component)}(e,n),t)},Nn=function(e,t){Cn.captureException(new Error(e),{extra:t})},Rn=n(6),Mn=n.n(Rn),Ln=n(444),Bn=n.n(Ln),Fn=Dn(Object(xe.b)((function(e){var t=e.title,n=e.descriptions,r=e.nextButton,o=e.nextStep,i=e.translate,a=t||i("welcome.title"),s=n||function(e){return[e("welcome.description_p_1"),e("welcome.description_p_2")]}(i),c=r||i("welcome.next_button");return Object(I.h)("div",null,Object(I.h)(it,{title:a}),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)("div",{className:Bn.a.text},x()(s).call(s,(function(e){return Object(I.h)("p",null,e)}))),Object(I.h)(ct,{onClick:o,variants:["centered","primary","lg"]},c)))}))),Un={passport:{hint:"passport_hint"},driving_licence:{hint:"driving_licence_hint"},national_identity_card:{hint:"national_identity_card_hint"}},zn=_()(Un),qn=function(e){return"GBR"===yn(e)},Wn={bank_building_society_statement:{eStatementAccepted:!0},utility_bill:{hint:"utility_bill_hint",warning:"utility_bill_warning",eStatementAccepted:!0},council_tax:{icon:"icon-letter",checkAvailableInCountry:qn},benefit_letters:{hint:"benefits_letter_hint",icon:"icon-letter",checkAvailableInCountry:qn},government_letter:{hint:"government_letter_hint",icon:"icon-letter",checkAvailableInCountry:function(e){return"GBR"!==yn(e)}}},Hn=_()(Wn),Vn=n(99),Gn=n.n(Vn);function Kn(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qn(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Kn(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Kn(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var $n=function(){return!0},Yn=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"getOptions",(function(){var e,t=r.props,n=t.documentTypes,o=t.defaultOptions,i=t.country,a=void 0===i?"GBR":i,s=m()(e=o()).call(e,(function(e){var t=e.checkAvailableInCountry;return(void 0===t?$n:t)(a)})),c=Object(Ve.c)(n)?$n:function(e){return n[e]},u=m()(s).call(s,(function(e){var t=e.value;return c(t)}));return u.length?u:s})),j()(V()(r),"handleSelect",(function(e){var t=r.props,n=t.group,o=t.actions,i=t.nextStep;"proof_of_address"===n?o.setPoADocumentType(e):o.setIdDocumentType(e),i()})),j()(V()(r),"renderOption",(function(e){var t;return Object(I.h)("li",null,Object(I.h)("button",{type:"button",onClick:function(){return r.handleSelect(e.value)},className:ie()(Gn.a.option,j()({},Gn.a.optionHoverDesktop,Ce.j))},Object(I.h)("div",{className:Fe()(t="".concat(Gn.a.icon," ")).call(t,Gn.a[e.icon])}),Object(I.h)("div",{className:Gn.a.content},Object(I.h)("div",{className:Gn.a.optionMain},Object(I.h)("p",{className:Gn.a.label},e.label),e.hint&&Object(I.h)("div",{className:Gn.a.hint},e.hint),e.warning&&Object(I.h)("div",{className:Gn.a.warning},e.warning)),e.eStatementAccepted&&Object(I.h)("div",{className:Gn.a.tag},r.props.translate("document_selector.proof_of_address.estatements_accepted")))))})),r}return W()(n,[{key:"render",value:function(){var e=this.getOptions(),t=this.props,n=t.className,r=t.translate;return Object(I.h)("ul",{"aria-label":r("accessibility.document_types"),className:ie()(Gn.a.list,n)},x()(e).call(e,this.renderOption))}}]),n}(I.Component),Jn=Object(xe.b)(Yn),Xn=function(e){return function(t){return Object(I.h)(Jn,F()({},t,{defaultOptions:function(){var n=_()(e),r=t.group;return x()(n).call(n,(function(n){var o,i,a=e[n],s=a.icon,c=void 0===s?"icon-".concat(gn(n).join("-")):s,u=a.hint,l=a.warning;return Qn(Qn({},P()(a,["icon","hint","warning"])),{},{icon:c,value:n,label:t.translate(n),hint:u?t.translate(Fe()(o="document_selector.".concat(r,".")).call(o,u)):"",warning:l?t.translate(Fe()(i="document_selector.".concat(r,".")).call(i,l)):""})}))}}))}},Zn=Xn(Un),er=Xn(Wn),tr=n(445),nr=n.n(tr);function rr(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function or(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=rr(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=rr(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var ir,ar=function(e){return function(t){var n=t.translate,r=t.country,o="proof_of_address"===e?er:Zn;return Object(I.h)("div",{className:nr.a.wrapper},Object(I.h)(it,{title:n("document_selector.".concat(e,".title"),{country:r&&"GBR"!==r?"":"UK"}),subTitle:n("document_selector.".concat(e,".hint"))}),Object(I.h)(o,or(or({},t),{},{group:e})))}},sr=Dn(Object(xe.b)(ar("proof_of_address")),"type_select"),cr=Dn(Object(xe.b)(ar("identity")),"type_select"),ur=n(34),lr=n.n(ur),fr={INVALID_CAPTURE:{message:"errors.invalid_capture.message",instruction:"errors.invalid_capture.instruction"},INVALID_TYPE:{message:"errors.invalid_type.message",instruction:"errors.invalid_type.instruction"},UNSUPPORTED_FILE:{message:"errors.unsupported_file.message",instruction:"errors.unsupported_file.instruction"},INVALID_SIZE:{message:"errors.invalid_size.message",instruction:"errors.invalid_size.instruction"},NO_FACE_ERROR:{message:"errors.no_face.message",instruction:"errors.no_face.instruction"},MULTIPLE_FACES_ERROR:{message:"errors.multiple_faces.message",instruction:"errors.multiple_faces.instruction"},SERVER_ERROR:{message:"errors.server_error.message",instruction:"errors.server_error.instruction"},GLARE_DETECTED:{message:"errors.glare_detected.message",instruction:"errors.glare_detected.instruction"},SMS_FAILED:{message:"errors.sms_failed.message",instruction:"errors.sms_failed.instruction"},SMS_OVERUSE:{message:"errors.sms_overuse.message",instruction:"errors.sms_overuse.instruction"},CAMERA_NOT_WORKING:{message:"errors.camera_not_working.message",instruction:"errors.camera_not_working.instruction"},CAMERA_NOT_WORKING_NO_FALLBACK:{message:"errors.camera_not_working.message",instruction:"errors.camera_not_working_no_fallback.instruction"},CAMERA_INACTIVE:{message:"errors.camera_inactive.message",instruction:"errors.camera_inactive.instruction"},CAMERA_INACTIVE_NO_FALLBACK:{message:"errors.camera_inactive.message",instruction:"errors.camera_inactive_no_fallback.instruction"},LIVENESS_TIMEOUT:{message:"errors.liveness_timeout.message",instruction:"errors.liveness_timeout.instruction"},GENERIC_CLIENT_ERROR:{message:"errors.generic_client_error.message",instruction:"errors.generic_client_error.instruction"},FORBIDDEN_CLIENT_ERROR:{message:"errors.forbidden_client_error.message",instruction:"errors.forbidden_client_error.instruction"},INTERRUPTED_FLOW_ERROR:{message:"errors.interrupted_flow_error.message",instruction:"errors.interrupted_flow_error.instruction",icon:"flowInterruptedIcon"},UNSUPPORTED_ANDROID_BROWSER:{message:"errors.unsupported_android_browser.message",instruction:"errors.unsupported_android_browser.instruction",icon:"unsupportedBrowserIcon"},UNSUPPORTED_IOS_BROWSER:{message:"errors.unsupported_ios_browser.message",instruction:"errors.unsupported_ios_browser.instruction",icon:"unsupportedBrowserIcon"}},pr=function(e){var t,n=e.error,r=e.translate,o=fr[n.name],i=o.message,a=o.instruction;return Object(I.h)("div",{className:lr.a.error},Fe()(t="".concat(r(i)," ")).call(t,r(a)))},dr=n(446),hr=n.n(dr),vr=n(171),mr=n.n(vr),yr=(n(551),n(553),function(e){var t=function(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length),o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return{integerArray:r,mimeString:n}}(e);return new Blob([t.integerArray],{type:t.mimeString})}),gr="image/".concat(hr.a?"webp":"jpeg"),br=(ir=gr,function(e,t){return t(e.toDataURL(ir))}),_r=function(e,t,n,r){var o=function(){return function(e,t,n){var r=new FileReader;r.readAsDataURL(e),r.onload=function(){t(r.result)},r.onerror=function(e){console.warn("File Reading Error: ",e),n(e)}}(e,t,n)};return wr(["pdf"],e)?o():function(e,t,n,r){var o=r||{},i=o.maxWidth,a=void 0===i?960:i,s=o.maxHeight,c=void 0===s?960:s,u=o.orientation,l=void 0===u||u,f=o.canvas,p=void 0===f||f;return mr()(e,(function(e){"error"===e.type?n(e):t(e)}),{maxWidth:a,maxHeight:c,orientation:l,canvas:p})}(e,(function(e){return br(e,t)}),o,r)},kr=function(e){return e&&e.type&&e.type.split("/")[1]},wr=function(e,t){return Le()(e).call(e,(function(e){return e===kr(t)}))},Sr=["jpg","jpeg","png","pdf"],Or=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr;return Object(Ve.a)({INVALID_TYPE:function(e){return!wr(t,e)},INVALID_SIZE:function(e){return e.size>1e7}},(function(t){return t(e)}))},Cr=n(379),xr=n.n(Cr);var Er=function(){},jr=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"handleClick",(function(){r.input&&r.input.click(),r.props.onClick()})),j()(V()(r),"handleChange",(function(e){r.input&&r.props.onChange(r.input.files[0]),e.currentTarget.value=""})),j()(V()(r),"render",(function(){var e=r.props,t=e.children,n=e.className,o=(e.onClick,e.onChange,P()(e,["children","className","onClick","onChange"]));return Object(I.h)("span",{onClick:r.handleClick,className:ie()(xr.a.container,n)},t,Object(I.h)("input",F()({type:"file",className:xr.a.input,ref:function(e){return r.input=e},onChange:r.handleChange},o)))})),r}return n}(I.Component);function Ar(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Ar(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Ar(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}j()(jr,"defaultProps",{children:null,className:"",onClick:Er,onChange:Er});var Tr=Object(xe.b)((function(e){var t=e.translate;return Object(I.h)(ct,{variants:["centered","primary","lg"]},t("image_quality_guide.next_step"))})),Dr=Object(xe.b)((function(e){var t,n,r=e.translate,o=e.type,i={not_cut_off:"Cutoff",no_blur:"Blur",no_glare:"Glare",all_good:"Good"};return Object(I.h)("div",{className:lr.a.documentExampleCol},Object(I.h)("div",{role:"img","aria-label":r(Fe()(t="".concat("image_quality_guide",".")).call(t,o,".image_alt_text")),className:ie()(lr.a.documentExampleImg,lr.a["documentExampleImg".concat(i[o])])}),Object(I.h)("div",{className:lr.a.documentExampleLabel,"data-onfido-qa":"documentExampleLabel".concat(i[o])},r(Fe()(n="".concat("image_quality_guide",".")).call(n,o,".label"))))})),Ir=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"setError",(function(e){return r.setState({error:{name:e}})})),j()(V()(r),"createCapture",(function(e){var t={blob:e,sdkMetadata:{captureMethod:"html5"}},n=r.props,o=n.documentType,i=n.actions,a=n.mobileFlow,s=Pr(Pr({},t),{},{sdkMetadata:Object(Ce.a)(t.sdkMetadata,a),method:"document",side:"front",documentType:o,id:_n()});i.createCapture(s)})),j()(V()(r),"handleFileSelected",(function(e){var t=Or(e);t?r.setError(t):(r.createCapture(e),r.props.nextStep())})),r}return W()(n,[{key:"render",value:function(){var e=this.props.translate,t=this.state.error;return Object(I.h)("div",{className:Mn.a.fullHeightContainer},Object(I.h)(it,{title:e("image_quality_guide.title"),subTitle:e("image_quality_guide.sub_title")}),Object(I.h)("div",{className:lr.a.contentWrapper},Object(I.h)("div",{className:Mn.a.scrollableContent},Object(I.h)("div",{className:lr.a.imageQualityGuideRow},Object(I.h)(Dr,{type:"not_cut_off"}),Object(I.h)(Dr,{type:"no_blur"})),Object(I.h)("div",{className:lr.a.imageQualityGuideRow},Object(I.h)(Dr,{type:"no_glare"}),Object(I.h)(Dr,{type:"all_good"}))),Object(I.h)("div",null,t&&Object(I.h)(pr,{error:t,translate:e}),Ce.j?Object(I.h)(jr,{className:ie()(lr.a.desktopUpload,lr.a.passportUploadContainer),onChange:this.handleFileSelected},Object(I.h)(Tr,null)):Object(I.h)(jr,{className:lr.a.buttonContainer,onChange:this.handleFileSelected,accept:"image/*",capture:!0},Object(I.h)(Tr,null)))))}}]),n}(I.Component);j()(Ir,"defaultProps",{onUpload:function(){}});var Nr=In(Object(xe.b)(Ir),"image_quality_guide","error");var Rr=function(e){return function(t){K()(r,t);var n=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(r);function r(){var e,t;z()(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,Fe()(e=[this]).call(e,i)),j()(V()(t),"attemptForwardToCrossDevice",(function(){var e=t.props,n=e.hasCamera,r=e.forceCrossDevice,o=e.changeFlowTo,i="face"===e.componentsList[e.step].step.type&&!n;if(i&&console.warn("Camera required: Either device has no camera or browser is unable to detect camera"),i||r){if(t.props.mobileFlow)return void console.warn("Already on cross device flow but no camera detected");if(t.props.mobileFlow&&!t.props.uploadFallback)return void console.error("Unable to complete the flow: upload fallback not allowed");if(!Ce.j)return;o("crossDeviceSteps",0,!0)}})),t}return W()(r,[{key:"componentDidMount",value:function(){this.attemptForwardToCrossDevice()}},{key:"componentDidUpdate",value:function(e){var t=this,n=["currentStep","mobileFlow","hasCamera","allowCrossDeviceFlow","forceCrossDevice"];Le()(n).call(n,(function(n){return e[n]!==t.props[n]}))&&this.props.allowCrossDeviceFlow&&this.attemptForwardToCrossDevice()}},{key:"render",value:function(){return Object(I.h)(e,this.props)}}]),r}(I.Component)},Mr=n(110),Lr=n.n(Mr);var Br=function(e){var t=e.listScreenReaderText,n=e.instructions;return Object(I.h)("div",{className:ie()(Lr.a.thinWrapper,Lr.a.introCopy)},Object(I.h)("ul",{className:Lr.a.introBullets,"aria-label":t},x()(n).call(n,(function(e){return Object(I.h)("li",{className:Lr.a.introBullet},Object(I.h)("span",{className:ie()(Lr.a.introIcon,Lr.a["".concat(e.key,"Icon")])}),Object(I.h)("span",{className:ie()(Lr.a.bolder,Lr.a.introText)},e.text))}))))},Fr=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"render",value:function(){var e=this.props,t=e.translate,n=e.nextStep,r=[{key:"selfie",text:t("capture.face.intro.selfie_instruction")},{key:"glasses",text:t("capture.face.intro.glasses_instruction")}];return Object(I.h)("div",{className:Mn.a.fullHeightContainer},Object(I.h)(it,{title:t("capture.face.intro.title"),subTitle:t("capture.face.intro.subtitle")}),Object(I.h)(Br,{listScreenReaderText:t("capture.face.intro.accessibility.selfie_capture_tips"),instructions:r}),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)(ct,{variants:["primary","centered","lg"],onClick:function(){Pn(["face_selfie_capture"]),n()}},t("continue"))))}}]),n}(I.Component),Ur=Dn(Object(Qe.a)(xe.b,Rr)(Fr),"selfie_intro"),zr=n(301),qr=n.n(zr),Wr=n(306),Hr=n.n(Wr),Vr=function(e,t,n){if(e){var r=e&&e.getCanvas();if(r){var o=Kr(e.stream);!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png";if(!HTMLCanvasElement.prototype.toBlob){var r=e.toDataURL();return t(yr(r))}e.toBlob(t,n)}(r,(function(e){return t(e,o)}),n)}else console.error("webcam canvas is null")}else console.error("webcam is null")},Gr=function(e,t){t({blob:e.getVideoBlob(),sdkMetadata:Kr(e.stream)})},Kr=function(e){if(e){var t=e.getVideoTracks()[0]||{},n=e.getAudioTracks()[0]||{};return{captureMethod:"live",camera_name:t.label,microphone_name:n.label}}return{}},Qr=n(173),$r=n.n(Qr),Yr=we((function(e){var t=e.isWithoutHole;return Object(I.h)("div",{"data-onfido-qa":"faceOverlay",className:ie()($r.a.faceOverlay,j()({},$r.a.isWithoutHole,t))},Object(I.h)("span",{className:$r.a.face}))})),Jr=function(e){var t=e.documentSize;return Object(I.h)("div",null,Object(I.h)("span",{className:$r.a[t]||$r.a.rectangle}))},Xr=n(447),Zr=n.n(Xr),eo=n(100),to=n.n(eo);var no=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"componentDidMount",value:function(){this.props.focusOnMount&&this.container&&this.container.focus()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.role,o=n.className,i=n.error,a=n.translate,s=n.withArrow,c=n.renderMessage,u=void 0===c?Qe.b:c,l=n.renderInstruction,f=void 0===l?Qe.b:l,p=n.isDismissible,d=n.onDismiss,h=void 0===d?Qe.d:d,v=fr[i.name],m=v.message,y=v.instruction,g="error"===i.type?"error":"warning";return Object(I.h)("div",{role:r,ref:function(e){return t.container=e},tabIndex:-1,className:ie()(to.a.container,to.a["container-".concat(g)],o)},s&&Object(I.h)("div",{className:ie()(to.a.roundedTriangle,to.a["".concat(g,"Triangle")])}),Object(I.h)("div",null,Object(I.h)("div",{className:to.a.title},Object(I.h)("span",{className:ie()(to.a["title-icon"],to.a["title-icon-".concat(g)])}),Object(I.h)("span",{role:"heading",className:to.a["title-text"]},u(a(m)))),Object(I.h)("p",{className:to.a.instruction},Object(I.h)("span",{className:to.a["instruction-text"]},f(a(y))))),p&&Object(I.h)("button",{type:"button","aria-label":a("accessibility.dismiss_alert"),onClick:h,className:Fe()(e="".concat(to.a.dismiss," ")).call(e,Mn.a[g])}))}}]),n}(I.Component),ro=Object(xe.b)(no),oo=n(281),io=n.n(oo);var ao=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"state",{isDimissed:!1}),j()(V()(r),"trackFallbackClick",(function(){"warning"===r.props.error.type&&r.props.trackScreen("fallback_triggered")})),j()(V()(r),"handleDismiss",(function(){return r.setState({isDimissed:!0})})),j()(V()(r),"render",(function(){var e=r.props,t=e.error,n=e.hasBackdrop,o=e.renderFallback,i=e.isDismissible;return!r.state.isDimissed&&Object(I.h)("div",{className:ie()(io.a.errorContainer,io.a["".concat(t.type,"ContainerType")],j()({},io.a.errorHasBackdrop,n))},Object(I.h)(ro,{role:"alertdialog",className:io.a.errorMessage,error:t,focusOnMount:!0,isDismissible:i,onDismiss:r.handleDismiss,renderInstruction:function(e){return Object(Ce.m)(e,(function(e){var t=e.text;return o(t,r.trackFallbackClick)}))}}))})),r}return W()(n,[{key:"componentDidMount",value:function(){"error"===this.props.error.type&&this.props.trackScreen("camera_error")}},{key:"componentDidUpdate",value:function(e){e.error.name!==this.props.error.name&&this.setState({isDimissed:!1})}}]),n}(I.Component);var so=n(174),co=n.n(so),uo=Dn(Object(xe.b)((function(e){var t=e.onNext,n=e.translate;return Object(I.h)("div",{className:Mn.a.fullHeightContainer},Object(I.h)(it,{title:n("webcam_permissions.allow_access"),subTitle:n("webcam_permissions.enable_webcam_for_selfie")}),Object(I.h)("div",{className:ie()(Mn.a.thickWrapper,co.a.bodyWrapper,Mn.a.scrollableContent)},Object(I.h)("div",{className:co.a.image},Object(I.h)("div",{className:co.a.graphic})),Object(I.h)("p",{className:co.a.instructions},n("webcam_permissions.click_allow"))),Object(I.h)("div",{className:ie()(Mn.a.thickWrapper,co.a.actions)},Object(I.h)(ct,{variants:["centered","primary","lg"],onClick:t},n("webcam_permissions.enable_webcam"))))}))),lo=n(158),fo=n.n(lo),po=Dn(Object(xe.b)((function(e){var t,n=e.translate;return Object(I.h)("div",{className:Mn.a.fullHeightContainer},Object(I.h)(it,{title:n("webcam_permissions.access_denied"),subTitle:n("webcam_permissions.recover_access")}),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)("div",{className:fo.a.instructions},Object(I.h)("span",{className:fo.a.recovery},n("webcam_permissions.recovery")),Object(I.h)("p",{className:fo.a.instructionsTitle},n("webcam_permissions.follow_steps")),Object(I.h)("ol",{className:fo.a.steps},x()(t=["grant_access","refresh_page"]).call(t,(function(e){return Object(I.h)("li",{key:e,className:fo.a.step},n("webcam_permissions.".concat(e)))}))))),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)(ct,{className:fo.a.button,variants:["primary","lg"],onClick:function(){return window.location.reload()}},n("webcam_permissions.refresh"))))})));var ho=["PermissionDeniedError","NotAllowedError","NotFoundError"],vo=function(e){var t=e.disableInteraction,n=e.onClick,r=e.ariaLabel,o=e.className;return Object(I.h)("button",{type:"button","aria-label":r,disabled:t,onClick:n,className:o})},mo=n(46),yo=n.n(mo),go=Object(xe.b)((function(e){var t=e.translate,n=e.onStart,r=e.disableInteraction;return Object(I.h)("div",{className:yo.a.actions},Object(I.h)("div",{className:ie()(yo.a.captureActionsHint,yo.a.recordAction)},t("capture.liveness.press_record")),Object(I.h)("button",{type:"button","aria-label":t("accessibility.start_recording"),disabled:r,onClick:n,className:ie()(yo.a.btn,yo.a.startRecording)}))})),bo=n(114),_o=n.n(bo),ko=Object(Qe.a)(xe.b,(function(e){var t,n;return n=t=function(t){K()(r,t);var n=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(r);function r(){var e,t;z()(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,Fe()(e=[this]).call(e,i)),j()(V()(t),"state",{hasError:!1}),j()(V()(t),"handleFailure",(function(e){t.setState({hasError:!0}),t.props.onError(e)})),j()(V()(t),"generalError",(function(){return{name:t.props.isUploadFallbackDisabled?"CAMERA_NOT_WORKING_NO_FALLBACK":"CAMERA_NOT_WORKING",type:"error"}})),t}return W()(r,[{key:"render",value:function(){var t=this.state.hasError;return Object(I.h)(e,F()({},this.props,t?{renderError:Object(I.h)(ao,F()({},this.props,{error:this.generalError()}))}:{},{onFailure:this.handleFailure}))}}]),r}(I.Component),j()(t,"defaultProps",{onError:function(){}}),n}),(function(e){var t,n;return n=t=function(t){K()(r,t);var n=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(r);function r(){var e,t;z()(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,Fe()(e=[this]).call(e,i)),j()(V()(t),"state",{hasGrantedPermission:null,hasSeenPermissionsPrimer:!1,checkingWebcamPermissions:!0}),j()(V()(t),"setPermissionsPrimerSeen",(function(){t.setState({hasSeenPermissionsPrimer:!0})})),j()(V()(t),"handleUserMedia",(function(){t.setState({hasGrantedPermission:!0}),t.props.onUserMedia()})),j()(V()(t),"handleWebcamFailure",(function(e){w()(ho).call(ho,e.name)?t.setState({hasGrantedPermission:!1}):t.props.onFailure()})),t}return W()(r,[{key:"componentDidMount",value:function(){var e=this;Object(Ce.c)((function(t){return e.setState({checkingWebcamPermissions:!1,hasGrantedPermission:t||null})}))}},{key:"render",value:function(){var t=this.state,n=t.hasSeenPermissionsPrimer,r=t.hasGrantedPermission,o=t.checkingWebcamPermissions,i=this.props.trackScreen;return o?null:!1===r?Object(I.h)(po,{trackScreen:i}):r||n?Object(I.h)(e,F()({},this.props,{hasGrantedPermission:r,onUserMedia:this.handleUserMedia,onFailure:this.handleWebcamFailure})):Object(I.h)(uo,F()({trackScreen:i},{onNext:this.setPermissionsPrimerSeen}))}}]),r}(I.Component),j()(t,"defaultProps",{onUserMedia:function(){},onFailure:function(){}}),n}))((function(e){var t=e.className,n=e.containerClassName,r=e.renderTitle,o=e.renderError,i=e.children,a=e.webcamRef,s=e.onUserMedia,c=e.onFailure,u=e.video,l=e.isRecording,f=e.translate,p=e.facing,d=void 0===p?"user":p,h=e.buttonType,v=e.onButtonClick,m=e.isButtonDisabled,y=e.hasGrantedPermission;return Object(I.h)("div",{className:ie()(_o.a.camera,t)},r,Object(I.h)("div",{className:ie()(_o.a.container,n)},Object(I.h)("div",{className:_o.a.webcamContainer,role:"group","aria-describedby":"cameraViewAriaLabel"},Object(I.h)(Zr.a,F()({className:_o.a.video,audio:!!u,height:720,facingMode:d},{onUserMedia:s,ref:a,onFailure:c}))),Object(I.h)("div",{className:_o.a.actions},"photo"===h&&Object(I.h)(vo,{ariaLabel:f("accessibility.shutter"),disableInteraction:!y||m,onClick:v,className:ie()(_o.a.btn,j()({},_o.a.disabled,!y||m))})),"video"===h&&!l&&Object(I.h)(go,{disableInteraction:!y||m,onStart:v}),Object(I.h)("div",{id:"cameraViewAriaLabel","aria-label":f("accessibility.camera_view")}),i,o))})),wo=function(e,t,n){var r=e.payload,o=e.endpoint,i=e.contentType,a=e.token,s=new XMLHttpRequest;s.open("POST",o),i&&s.setRequestHeader("Content-Type",i),s.setRequestHeader("Authorization",a),s.onload=function(){200===s.status||201===s.status?t(JSON.parse(s.response)):n(s)},s.onerror=function(){return n(s)},s.send(r)},So=function(e,t,n,r,o){var i="".concat(t,"/validate_document");wo({payload:e,endpoint:i,token:n,contentType:"application/json"},r,(function(e){return function(e,t){var n,r=e.status,o=e.response;Nn(Fe()(n="".concat(r," - ")).call(n,o)),t({status:r,response:o})}(e,o)}))};var Oo={name:"SERVER_ERROR",type:"error"},Co=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"webcam",null),j()(V()(r),"captureIds",[]),j()(V()(r),"state",{hasError:!1}),j()(V()(r),"screenshot",(function(){r.captureIds.length<3?Vr(r.webcam,(function(e,t){return r.handleScreenshotBlob(e,t)})):console.warn("Screenshotting is slow, waiting for responses before uploading more")})),j()(V()(r),"handleScreenshotBlob",(function(e,t){return _r(e,(function(n){return r.handleScreenshot(e,n,t)}),(function(e){return console.error("Error converting screenshot to base64",e)}),{maxWidth:200})})),j()(V()(r),"handleScreenshot",(function(e,t,n){if(t){var o=_n();r.captureIds.push(o),r.validate(t,o,(function(i){return i?r.props.onValidCapture({blob:e,base64:t,id:o,sdkMetadata:n}):null}))}})),j()(V()(r),"validate",(function(e,t,n){var o=r.props,i=o.urls,a=o.token,s=i.detect_document_url,c=lt()({image:e,id:t});So(c,s,a,(function(e){var o=e.valid;r.setProcessed(t),n(o)}),r.handleValidationError)})),j()(V()(r),"handleValidationError",(function(e){r.setState({hasError:!0}),r.props.triggerOnError(e),r.props.onError()})),r}return W()(n,[{key:"componentDidMount",value:function(){this.start()}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"start",value:function(){this.stop(),this.interval=qr()(Hr.a).call(Hr.a,1e3,this.screenshot)}},{key:"stop",value:function(){Hr.a.stop(this.interval)}},{key:"setProcessed",value:function(e){var t;this.captureIds=m()(t=this.captureIds).call(t,(function(t){return t===e}))}},{key:"render",value:function(){var e=this,t=this.state.hasError,n=this.props,r=n.trackScreen,o=n.renderFallback;return Object(I.h)(ko,F()({},this.props,{className:_o.a.docAutoCaptureFrame,webcamRef:function(t){return e.webcam=t},renderError:t?Object(I.h)(ao,F()({error:Oo},{trackScreen:r,renderFallback:o})):void 0}),Object(I.h)(Jr,null))}}]),n}(I.Component),xo=n(131),Eo=n.n(xo),jo=function(e){return{name:e?"CAMERA_INACTIVE_NO_FALLBACK":"CAMERA_INACTIVE",type:"warning"}},Ao=n(380),Po=n.n(Ao),To=Object(Qe.a)(xe.b)((function(e){var t=e.translate;return Object(I.h)("div",{className:Po.a.loader,"aria-live":"assertive",tabindex:"-1",autoFocus:!0,"aria-label":t("loading")},Object(I.h)("div",{className:Po.a.inner},Object(I.h)("div",null),Object(I.h)("div",null),Object(I.h)("div",null)))}));var Do=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"state",{hasTimedOut:!1}),j()(V()(r),"clearInactivityTimeout",(function(){return clearTimeout(r.timeoutId)})),r}return W()(n,[{key:"componentDidMount",value:function(){var e=this;this.timeoutId||(this.clearInactivityTimeout(),this.timeoutId=We()((function(){return e.setState({hasTimedOut:!0})}),1e3*this.props.seconds))}},{key:"componentWillUnmount",value:function(){this.clearInactivityTimeout()}},{key:"componentDidUpdate",value:function(e,t){!t.hasTimedOut&&this.state.hasTimedOut&&this.props.onTimeout()}},{key:"render",value:function(){return null}}]),n}(I.Component);j()(Do,"defaultProps",{seconds:0,onTimeout:function(){}});var Io=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"webcam",null),j()(V()(r),"state",{hasBecomeInactive:!1,hasCameraError:!1,isCapturing:!1}),j()(V()(r),"handleTimeout",(function(){return r.setState({hasBecomeInactive:!0})})),j()(V()(r),"handleCameraError",(function(){return r.setState({hasCameraError:!0})})),j()(V()(r),"captureDocument",(function(e,t){var n={blob:e,sdkMetadata:t,filename:"document_capture.".concat(kr(e)),isPreviewCropped:!0};r.props.onCapture(n),r.setState({isCapturing:!1})})),j()(V()(r),"captureDocumentPhoto",(function(){r.setState({isCapturing:!0}),An("Taking live photo of document"),Vr(r.webcam,r.captureDocument,"image/jpeg")})),r}return W()(n,[{key:"componentWillUnmount",value:function(){this.setState({isCapturing:!1})}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.translate,o=n.trackScreen,i=n.renderFallback,a=n.isUploadFallbackDisabled,s=n.className,c=n.containerClassName,u=n.renderTitle,l=n.renderError,f=n.documentType,p=this.state,d=p.hasBecomeInactive,h=p.hasCameraError,v=p.isCapturing,m=new Eo.a(["driving_licence","national_identity_card"]).has(f)?"id1Card":"id3Card";return Object(I.h)("div",{className:Lr.a.container},this.state.isCapturing?Object(I.h)(To,null):Object(I.h)(ko,(e={facing:"environment",className:s,containerClassName:c,renderTitle:u,renderError:l,translate:r,webcamRef:function(e){return t.webcam=e},isUploadFallbackDisabled:a,trackScreen:o,onError:this.handleCameraError,renderFallback:i},j()(e,"renderError",d?Object(I.h)(ao,F()({trackScreen:o,renderFallback:i},{error:jo(a),isDismissible:!0})):null),j()(e,"buttonType","photo"),j()(e,"onButtonClick",this.captureDocumentPhoto),j()(e,"isButtonDisabled",h||v),e),!h&&Object(I.h)(Do,{seconds:10,onTimeout:this.handleTimeout}),Object(I.h)(Oe,null),Object(I.h)(Jr,{isFullScreen:!0,documentSize:m})))}}]),n}(I.Component);var No=function(e){var t,n=e.onFileSelected,r=e.children,o=e.isPoA,i=e.translate;return Object(I.h)("div",{className:lr.a.uploadArea},r,Object(I.h)("div",{className:ie()(lr.a.buttons,j()({},lr.a.poaButtons,o))},Object(I.h)(jr,{className:ie()((t={},j()(t,lr.a.buttonContainer,!o),j()(t,lr.a.poaBtnContainer,o),t)),onChange:n,accept:"image/*",capture:!0},Object(I.h)(ct,{variants:o?["secondary","sm"]:["centered","primary","lg"]},i("capture.take_photo"))),o&&Object(I.h)(jr,{onChange:n},Object(I.h)(ct,{variants:["primary","sm"]},i("capture.upload_".concat(Ce.j?"file":"document"))))))},Ro=function(e){var t=e.nextStep,n=e.children,r=e.translate;return Object(I.h)("div",{className:lr.a.uploadArea},n,Object(I.h)("div",{className:lr.a.buttons},Object(I.h)(ct,{variants:["centered","primary","lg"],onClick:t},r("capture.take_photo"))))},Mo=function(e){var t=e.translate,n=e.uploadType,r=e.changeFlowTo,o=e.mobileFlow,i=e.children;return Object(I.h)("div",{className:lr.a.crossDeviceInstructionsContainer},Object(I.h)("div",{className:lr.a.iconContainer},Object(I.h)("i",{className:ie()(Mn.a.icon,lr.a.icon,lr.a["".concat(bn(n),"Icon")])})),Object(I.h)("div",null,!o&&Object(I.h)(ct,{variants:["centered","primary","lg"],className:lr.a.crossDeviceButton,onClick:function(){return r("crossDeviceSteps")}},t("capture.switch_device")),i))},Lo=function(e){var t=e.changeFlowTo,n=e.uploadType,r=e.instructions,o=e.translate,i=e.mobileFlow,a=e.nextStep;return Ce.j?Object(I.h)(Mo,{translate:o,uploadType:n,changeFlowTo:t,mobileFlow:i},Object(I.h)("button",{type:"button",className:Mn.a.link,"data-onfido-qa":"uploaderButtonLink",onClick:a},o("capture.upload_file"))):Object(I.h)(Ro,{nextStep:a,translate:o},Object(I.h)("div",{className:lr.a.instructions},Object(I.h)("div",{className:lr.a.iconContainer},Object(I.h)("span",{className:ie()(Mn.a.icon,lr.a.identityIcon)})),Object(I.h)("div",{className:lr.a.instructionsCopy},r)))},Bo=function(e){var t=e.changeFlowTo,n=e.uploadType,r=e.instructions,o=e.translate,i=e.mobileFlow,a=e.error,s=e.handleFileSelected,c="proof_of_address"===n;return Ce.j?Object(I.h)(Mo,{translate:o,uploadType:n,changeFlowTo:t,mobileFlow:i},Object(I.h)(jr,{onChange:s},a&&Object(I.h)(pr,{error:a,translate:o}),Object(I.h)("button",{type:"button",className:Mn.a.link,"data-onfido-qa":"uploaderButtonLink"},o("capture.upload_file")))):Object(I.h)(No,F()({onFileSelected:s,translate:o},{isPoA:c}),Object(I.h)("div",{className:lr.a.instructions},Object(I.h)("div",{className:ie()(lr.a.iconContainer,j()({},lr.a.poaIconContainer,c))},Object(I.h)("span",{className:ie()(Mn.a.icon,lr.a.icon,lr.a["".concat(bn(n),"Icon")])})),a?Object(I.h)(pr,{error:a,translate:o}):Object(I.h)("div",{className:lr.a.instructionsCopy},r)))},Fo=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"setError",(function(e){return r.setState({error:{name:e}})})),j()(V()(r),"handleFileSelected",(function(e){var t=Or(e);return t?r.setError(t):r.props.onUpload(e)})),r}return W()(n,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.subTitle,r=e.allowCrossDeviceFlow,o=e.translate,i=e.documentType,a="face"!==e.uploadType&&"passport"===i;return Object(I.h)("div",{className:ie()(Mn.a.fullHeightContainer,lr.a.container)},Object(I.h)(it,{title:t,subTitle:r?o("cross_device.switch_device.header"):n}),Object(I.h)("div",{className:ie()(lr.a.uploaderWrapper,j()({},lr.a.crossDeviceClient,!r))},a?Object(I.h)(Lo,this.props):Object(I.h)(Bo,F()({},this.props,{error:this.state.error,handleFileSelected:this.handleFileSelected}))))}}]),n}(I.Component);j()(Fo,"defaultProps",{onUpload:function(){}});var Uo=In(Object(xe.b)(Fo),"file_upload","error"),zo=function(e){var t,n=e.text,r=e.onClick;return Object(I.h)("button",{type:"button",className:Fe()(t="".concat(st.a.fallbackButton," ")).call(t,Mn.a.warning),onClick:r},n)},qo=n(156),Wo=n.n(qo);function Ho(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vo(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Ho(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Ho(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Go=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"handleCapture",(function(e){var t=r.props,n=t.isPoA,o=t.documentType,i=t.poaDocumentType,a=t.actions,s=t.side,c=t.nextStep,u=t.mobileFlow,l=Vo(Vo({},e),{},{sdkMetadata:Object(Ce.a)(e.sdkMetadata,u),method:"document",documentType:n?i:o,side:s,id:e.id||_n()});a.createCapture(l),c()})),j()(V()(r),"handleUpload",(function(e){return r.handleCapture({blob:e,sdkMetadata:{captureMethod:"html5"}})})),j()(V()(r),"handleError",(function(){return r.props.actions.deleteCapture()})),j()(V()(r),"renderUploadFallback",(function(e){return Object(I.h)(jr,{className:Wo.a.uploadFallback,onChange:r.handleUpload,accept:"image/*",capture:!0},e)})),j()(V()(r),"renderCrossDeviceFallback",(function(e){return Object(I.h)(zo,{text:e,onClick:function(){return r.props.changeFlowTo("crossDeviceSteps")}})})),r}return W()(n,[{key:"render",value:function(){var e,t=this.props,n=t.useLiveDocumentCapture,r=t.useWebcam,o=t.hasCamera,i=t.documentType,a=t.poaDocumentType,s=t.isPoA,c=t.side,u=t.translate,l=t.subTitle,f=t.uploadFallback,p=Fe()(e="capture.".concat(s?a:i,".")).call(e,c),d=u("".concat(p,".title")),h=Vo(Vo({},this.props),{},{onError:this.handleError}),v=Object(I.h)(it,F()({title:d,subTitle:l},{smaller:!0})),m=Ce.j?this.renderCrossDeviceFallback:this.renderUploadFallback,y=n&&(!Ce.j||Ce.k);if(o&&r)return Object(I.h)(Co,F()({},h,{renderTitle:v,renderFallback:m,containerClassName:Wo.a.documentContainer,onValidCapture:this.handleCapture}));if(o&&y)return Object(I.h)(Io,F()({},h,{renderTitle:v,renderFallback:m,containerClassName:Wo.a.liveDocumentContainer,onCapture:this.handleCapture,isUploadFallbackDisabled:!f}));var g=function(e){return Object(Ve.a)({proof_of_address:Hn,identity:zn},(function(t){return w()(t).call(t,e)}))}(a||i);return Object(I.h)(Uo,F()({},h,{uploadType:g,onUpload:this.handleUpload,title:u("".concat(p,".upload_title"))||d,instructions:u("".concat(p,".instructions"))}))}}]),n}(I.Component);j()(Go,"defaultProps",{side:"front",forceCrossDevice:!1});var Ko=Object(Qe.a)(Tn,xe.b,Rr)(Go),Qo=n(303),$o=n.n(Qo),Yo=n(88),Jo=n.n(Yo);function Xo(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zo(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Xo(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Xo(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var ei=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"webcam",null),j()(V()(r),"snapshotIntervalId",null),j()(V()(r),"initialSnapshotTimeoutId",null),j()(V()(r),"state",{hasBecomeInactive:!1,hasCameraError:!1,snapshotBuffer:[],isCaptureButtonDisabled:!0}),j()(V()(r),"handleTimeout",(function(){return r.setState({hasBecomeInactive:!0})})),j()(V()(r),"handleCameraError",(function(){return r.setState({hasCameraError:!0,isCaptureButtonDisabled:!0})})),j()(V()(r),"handleSelfie",(function(e,t){var n={blob:e,sdkMetadata:t,filename:"applicant_selfie.".concat(kr(e))},o=r.state.snapshotBuffer[0]||r.state.snapshotBuffer[1],i=r.props.useMultipleSelfieCapture?Zo({snapshot:o},n):n;r.props.onCapture(i),r.setState({isCaptureButtonDisabled:!1})})),j()(V()(r),"handleSnapshot",(function(e){r.setState((function(t){return{snapshotBuffer:[Jo()(t.snapshotBuffer,2)[1],{blob:e,filename:"applicant_snapshot.".concat(kr(e))}]}}))})),j()(V()(r),"takeSnapshot",(function(){return r.webcam&&Vr(r.webcam,r.handleSnapshot)})),j()(V()(r),"takeSelfie",(function(){r.setState({isCaptureButtonDisabled:!0}),Vr(r.webcam,r.handleSelfie)})),j()(V()(r),"onUserMedia",(function(){if(r.props.useMultipleSelfieCapture){r.initialSnapshotTimeoutId=We()((function(){r.takeSnapshot(),r.setState({isCaptureButtonDisabled:!1})}),750),r.snapshotIntervalId=$o()(r.takeSnapshot,r.props.snapshotInterval)}else r.setState({isCaptureButtonDisabled:!1})})),r}return W()(n,[{key:"componentWillUnmount",value:function(){this.snapshotIntervalId&&clearInterval(this.snapshotIntervalId),this.initialSnapshotTimeoutId&&clearTimeout(this.initialSnapshotTimeoutId)}},{key:"render",value:function(){var e=this,t=this.props,n=t.trackScreen,r=t.renderFallback,o=t.inactiveError,i=this.state,a=i.hasBecomeInactive,s=i.hasCameraError,c=i.isCaptureButtonDisabled;return Object(I.h)(ko,F()({},this.props,{webcamRef:function(t){return e.webcam=t},onUserMedia:this.onUserMedia,onError:this.handleCameraError,renderError:a?Object(I.h)(ao,F()({trackScreen:n,renderFallback:r},{error:o,isDismissible:!0})):null,buttonType:"photo",onButtonClick:this.takeSelfie,isButtonDisabled:c}),!s&&Object(I.h)(Do,{seconds:10,onTimeout:this.handleTimeout}),Object(I.h)(Oe,null),Object(I.h)(Yr,null))}}]),n}(I.Component),ti=function(e){var t=e.title,n=e.renderInstructions;return Object(I.h)("div",null,Object(I.h)(it,{title:t,className:yo.a.challengeTitle}),Object(I.h)("div",{"aria-level":"2",className:yo.a.challengeDescription},n()))},ni=Object(xe.b)((function(e){var t=e.translate,n=e.query;return Object(I.h)(ti,{title:t("capture.liveness.challenges.recite"),renderInstructions:function(){return Object(I.h)("span",{className:yo.a.recite},n.join(" – "))}})})),ri=Object(xe.b)((function(e){var t=e.translate,n=e.query,r=void 0===n?"":n,o=r.replace("turn","").toLowerCase();return Object(I.h)(ti,{title:t("capture.liveness.challenges.movement",{side:t("capture.liveness.challenges.".concat(o))}),renderInstructions:function(){return Object(I.h)("span",{className:ie()(yo.a.movement,yo.a["movement-".concat(r)])})}})})),oi=function(e){return Object(Ce.g)(e.type,{recite:function(){return Object(I.h)(ni,e)},movement:function(){return Object(I.h)(ri,e)}})};function ii(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}var ai=Object(xe.b)((function(e){var t=e.onStop,n=e.onNext,r=e.currentChallenge,o=e.isLastChallenge,i=e.disableInteraction,s=e.translate;return Object(I.h)("div",null,Object(I.h)("div",{className:yo.a.caption},Object(I.h)("div",null,Object(I.h)("div",{className:yo.a.recordingIndicator},Object(I.h)("span",{role:"status",className:yo.a.recordingIndicatorText},s("capture.liveness.recording"))),Object(I.h)(oi,function(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=ii(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=ii(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}({},r)))),Object(I.h)("div",{className:yo.a.actions},Object(I.h)("div",{className:yo.a.captureActionsHint},s("capture.liveness.challenges.done_".concat(o?"stop":"next"))),o?Object(I.h)("button",{type:"button","aria-label":s("accessibility.stop_recording"),disabled:i,onClick:t,className:ie()(yo.a.btn,yo.a.stopRecording)}):Object(I.h)(ct,{variants:["centered","primary","lg"],disabled:i,onClick:n},s("capture.liveness.challenges.next"))))})),si=n(448),ci=n.n(si);function ui(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function li(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=ui(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=ui(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var fi=function(e,t){var n=e.response,r=e.status;try{t({status:r,response:JSON.parse(n)})}catch(e){t({status:r,response:{}})}},pi=function(e,t,n,r,o){var i=e.sdkMetadata,a=void 0===i?{}:i,s=P()(e,["sdkMetadata"]),c="".concat(t,"/v3/live_photos");vi(c,li(li({},s),{},{sdk_metadata:lt()(a)}),n,r,o)},di=function(e,t,n,r,o,i,a){var s={file:{blob:e.blob,filename:e.filename}},c=t.blob,u=t.filename,l=t.sdkMetadata;new ci.a((function(e,t){a("Starting snapshot upload"),function(e,t,n,r,o){var i="".concat(t,"/v3/snapshots");vi(i,e,n,r,o)}(s,r,n,e,t)})).then((function(e){a("Snapshot upload completed"),a("Starting live photo upload");var t=lt()([e.uuid]);pi({file:{blob:c,filename:u},sdkMetadata:l,snapshot_uuids:t},r,n,o,i)})).catch((function(e){return i(e)}))},hi=function(e,t,n,r){var o={endpoint:"".concat(e,"/v3/live_video_challenge"),contentType:"application/json",token:"Bearer ".concat(t)};wo(o,n,(function(e){return fi(e,r)}))},vi=function(e,t,n,r,o){t=li(li({},t),{},{sdk_source:"onfido_web_sdk",sdk_version:"5.13.0"});var i,a,s={payload:(i=t,a=new FormData,Object(Ve.b)(i,(function(e,t){"object"===D()(e)&&e.blob&&e.filename?a.append(t,e.blob,e.filename):a.append(t,e)})),a),endpoint:e,token:"Bearer ".concat(n)};wo(s,r,(function(e){return fi(e,o)}))};function mi(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function yi(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=mi(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=mi(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var gi={name:"SERVER_ERROR",type:"error"},bi={challengesId:"",challenges:[],hasLoaded:!1,hasError:!1,challengeRequestedAt:0},_i=function(e){return function(t){K()(r,t);var n=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(r);function r(){var e,t;z()(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,Fe()(e=[this]).call(e,i)),j()(V()(t),"state",yi({},bi)),j()(V()(t),"loadChallenges",(function(){t.setState(yi(yi({},bi),{},{challengeRequestedAt:Object(Ce.e)()}),(function(){var e=t.props.urls.onfido_api_url;hi(e,t.props.token,t.handleResponse,t.handleError),Pn(["face_video_challenge_requested"])}))})),j()(V()(t),"handleResponse",(function(e){var n=e.data.challenge,r=String(e.data.id);t.setState({challenges:n,challengesId:r,hasLoaded:!0}),Pn(["face_video_challenge_loaded"],{challenge_loading_time:t.challengeLoadingTime()})})),j()(V()(t),"handleError",(function(e){t.setState({hasLoaded:!0,hasError:!0}),t.props.triggerOnError(e),Pn(["face_video_challenge_load_failed"],{challenge_loading_time:t.challengeLoadingTime()})})),j()(V()(t),"challengeLoadingTime",(function(){return Object(Ce.e)()-t.state.challengeRequestedAt})),j()(V()(t),"renderError",(function(){var e=t.props,n=e.trackScreen,r=e.renderFallback;return Object(I.h)(ao,F()({trackScreen:n,renderFallback:r},{error:gi,hasBackdrop:!0}))})),t}return W()(r,[{key:"componentDidMount",value:function(){this.loadChallenges()}},{key:"render",value:function(){var t=this.state,n=t.hasLoaded,r=t.hasError,o=t.challenges,i=t.challengesId;return n?Object(I.h)(e,F()({},yi(yi({},this.props),{},{challengesId:i,challenges:o,onRedo:this.loadChallenges}),r?{renderError:this.renderError()}:{})):Object(I.h)(To,null)}}]),r}(I.Component)};function ki(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function wi(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=ki(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=ki(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Si={startedAt:void 0,switchSeconds:void 0,currentIndex:0,isRecording:!1,hasMediaStream:!1,hasBecomeInactive:!1,hasRecordingTakenTooLong:!1,hasCameraError:!1},Oi={name:"LIVENESS_TIMEOUT",type:"warning"},Ci=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"webcam",null),j()(V()(r),"state",wi({},Si)),j()(V()(r),"startRecording",(function(){r.webcam&&r.webcam.startRecording(),r.setState({isRecording:!0,hasBecomeInactive:!1})})),j()(V()(r),"stopRecording",(function(){r.webcam&&r.webcam.stopRecording(),r.setState({isRecording:!1})})),j()(V()(r),"handleRecordingStart",(function(){r.state.hasMediaStream&&(r.startRecording(),r.setState({startedAt:Object(Ce.e)()}),Pn(["face_video_capture_step_1"]))})),j()(V()(r),"handleRecordingStop",(function(){var e=r.state,t=e.switchSeconds,n=e.hasRecordingTakenTooLong,o=r.props,i={challenges:o.challenges,id:o.challengesId,switchSeconds:t};r.stopRecording(),r.webcam&&!n&&Gr(r.webcam,(function(e){return r.props.onVideoCapture(wi(wi({},e),{},{challengeData:i}))}))})),j()(V()(r),"handleNextChallenge",(function(){var e=r.state,t=e.startedAt,n=e.currentIndex;r.setState({currentIndex:n+1}),t&&(r.setState({switchSeconds:Object(Ce.e)()-t}),Pn(["face_video_capture_step_2"]))})),j()(V()(r),"handleMediaStream",(function(){r.setState({hasMediaStream:!0})})),j()(V()(r),"handleInactivityTimeout",(function(){r.setState({hasBecomeInactive:!0})})),j()(V()(r),"handleRecordingTimeout",(function(){r.setState({hasRecordingTakenTooLong:!0}),r.stopRecording()})),j()(V()(r),"handleCameraError",(function(){r.setState({hasCameraError:!0})})),j()(V()(r),"handleFallbackClick",(function(e){r.props.onRedo(),e()})),j()(V()(r),"renderRedoActionsFallback",(function(e,t){return Object(I.h)(zo,{text:e,onClick:function(){return r.handleFallbackClick(t)}})})),j()(V()(r),"renderError",(function(){var e=r.props,t=e.trackScreen,n=e.renderFallback,o=e.inactiveError;return Object(I.h)(ao,F()({trackScreen:t},r.state.hasRecordingTakenTooLong?{error:Oi,renderFallback:r.renderRedoActionsFallback,hasBackdrop:!0}:{error:o,isDismissible:!0,renderFallback:n}))})),j()(V()(r),"renderRecordingTimeoutMessage",(function(){var e=r.state,t=e.hasBecomeInactive,n=e.hasRecordingTakenTooLong;e.hasCameraError;if(!(t||n||r.state.hasCameraError))return Object(I.h)(Do,{key:"recording",seconds:20,onTimeout:r.handleRecordingTimeout})})),j()(V()(r),"renderInactivityTimeoutMessage",(function(){var e=r.state,t=e.hasRecordingTakenTooLong,n=e.hasCameraError;if(!(t||n))return Object(I.h)(Do,{key:"notRecording",seconds:12,onTimeout:r.handleInactivityTimeout})})),j()(V()(r),"render",(function(){var e=r.props,t=e.translate,n=e.challenges,o=void 0===n?[]:n,i=r.state,a=i.isRecording,s=i.currentIndex,c=i.hasBecomeInactive,u=i.hasRecordingTakenTooLong,l=i.hasCameraError,f=i.hasMediaStream,p=o[s]||{},d=s===o.length-1,h=c||u,v=u||l||!f||a;return Object(I.h)(ko,F()({},r.props,{webcamRef:function(e){return r.webcam=e},onUserMedia:r.handleMediaStream,onError:r.handleCameraError,renderTitle:!a&&Object(I.h)(it,{title:t("capture.liveness.challenges.position_face")})},h?{renderError:r.renderError()}:{},{buttonType:"video",isRecording:a,onButtonClick:r.handleRecordingStart,isButtonDisabled:v,video:!0}),Object(I.h)(Oe,null),Object(I.h)(Yr,{isWithoutHole:l||a}),a?r.renderRecordingTimeoutMessage():r.renderInactivityTimeoutMessage(),a&&Object(I.h)(ai,F()({currentChallenge:p,isLastChallenge:d,hasError:h||l,disableInteraction:h||l},{onNext:r.handleNextChallenge,onStop:r.handleRecordingStop,onTimeout:r.handleRecordingTimeout})))})),r}return W()(n,[{key:"componentDidUpdate",value:function(e){e.challenges!==this.props.challenges&&this.setState(wi({},Si))}}]),n}(I.Component),xi=Object(xe.b)(_i(Ci)),Ei=n(449),ji=n.n(Ei);var Ai=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"componentDidMount",value:function(){Pn(["".concat(mn(this.props.error.name))])}},{key:"render",value:function(e){var t,n=e.translate,r=e.error,o=fr[r.name],i=o.message,a=o.instruction,s=o.icon,c=s||"genericErrorIcon";return Object(I.h)("div",null,Object(I.h)(it,{title:n(i),subTitle:n(a)}),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)("span",{className:Fe()(t="".concat(Mn.a.icon," ")).call(t,ji.a[c])})))}}]),n}(I.Component),Pi=Object(xe.b)(Ai);function Ti(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Di(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Ti(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Ti(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Ii={method:"face",variant:"standard",side:null},Ni=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"handleCapture",(function(e){var t=r.props,n=t.actions,o=t.nextStep,i=t.mobileFlow,a=_n(),s=Di(Di(Di({},Ii),e),{},{sdkMetadata:Object(Ce.a)(e.sdkMetadata,i),id:a});n.createCapture(s),o()})),j()(V()(r),"handleVideoCapture",(function(e){return r.handleCapture(Di(Di({},e),{},{variant:"video"}))})),j()(V()(r),"handleUpload",(function(e){return r.handleCapture({blob:e,sdkMetadata:{captureMethod:"html5"}})})),j()(V()(r),"handleError",(function(e){r.props.triggerOnError(e),r.props.actions.deleteCapture()})),j()(V()(r),"handleFallbackClick",(function(e){r.props.changeFlowTo("crossDeviceSteps"),e()})),j()(V()(r),"renderUploadFallback",(function(e){return Object(I.h)(jr,{className:Wo.a.uploadFallback,onChange:r.handleUpload,accept:"image/*",capture:"user"},e)})),j()(V()(r),"renderCrossDeviceFallback",(function(e,t){return Object(I.h)(zo,{text:e,onClick:function(){return r.handleFallbackClick(t)}})})),j()(V()(r),"isUploadFallbackDisabled",(function(){return!Ce.j&&!r.props.uploadFallback})),r}return W()(n,[{key:"render",value:function(){var e=this.props,t=e.hasCamera,n=e.requestedVariant,r=e.translate,o=e.useMultipleSelfieCapture,i=e.snapshotInterval,a=e.uploadFallback,s=r("capture.face.title"),c=Di({onError:this.handleError},this.props),u=Di({renderTitle:Object(I.h)(it,{title:s,smaller:!0}),containerClassName:Wo.a.faceContainer,renderFallback:Ce.j?this.renderCrossDeviceFallback:this.renderUploadFallback,inactiveError:jo(this.isUploadFallbackDisabled()),isUploadFallbackDisabled:this.isUploadFallbackDisabled()},c);if(null!==t){if(t){var l=r("accessibility.selfie_camera_view");if("video"===n)return Object(I.h)(xi,F()({},u,{onVideoCapture:this.handleVideoCapture,ariaLabel:l}));if(!this.props.useUploader)return Object(I.h)(ei,F()({},u,{onCapture:this.handleCapture,useMultipleSelfieCapture:o,snapshotInterval:i,ariaLabel:l}))}return(this.props.useUploader||!1===t)&&a?Object(I.h)(Uo,F()({},c,{uploadType:"face",onUpload:this.handleUpload,title:r("capture.face.upload_title")||s,instructions:r("capture.face.instructions")})):Object(I.h)(Pi,{error:{name:"INTERRUPTED_FLOW_ERROR"}})}}}]),n}(I.Component);j()(Ni,"defaultProps",{useUploader:!1,requestedVariant:"standard",uploadFallback:!0,useMultipleSelfieCapture:!0,snapshotInterval:1e3});var Ri=Object(Qe.a)(Tn,xe.b,Rr)(Ni),Mi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){return Object(I.h)(e,F()({},n,t))}},Li=Tn(Mi(Ko),"front_capture"),Bi=Tn(Mi(Ko,{side:"back"}),"back_capture"),Fi=Tn(Mi(Ri,{requestedVariant:"standard"}),"selfie_capture"),Ui=Tn(Mi(Ri,{requestedVariant:"video"}),"video_capture"),zi=Tn(Mi(Ko,{isPoA:!0,forceCrossDevice:!1}),"poa"),qi=n(133),Wi=n.n(qi),Hi=n(172),Vi=n.n(Hi),Gi=n(115),Ki=n.n(Gi),Qi=Object(xe.b)((function(e){var t=e.retakeAction,n=e.translate,r=e.btnSize;return Object(I.h)(ct,{onClick:t,className:Ki.a["btn-secondary"],variants:["secondary",r]},n("confirm.redo"))})),$i=Object(xe.b)((function(e){var t=e.confirmAction,n=e.isUploading,r=e.translate,o=e.error;return Object(I.h)(ct,{variants:["primary","sm"],onClick:t,disabled:n},"warn"===o.type?r("confirm.continue"):r("confirm.confirm"))})),Yi=function(e){var t=e.retakeAction,n=e.confirmAction,r=e.isUploading,o=e.error;return Object(I.h)("div",{className:Ki.a.actionsContainer},Object(I.h)("div",{className:ie()(Ki.a.actions,j()({},Ki.a.error,"error"===o.type))},Object(I.h)(Qi,F()({retakeAction:t},{btnSize:"error"===o.type?"lg":"sm"})),"error"===o.type?null:Object(I.h)($i,{confirmAction:n,isUploading:r,error:o})))},Ji=n(450),Xi=n.n(Ji),Zi=URL.createObjectURL,ea=URL.revokeObjectURL;function ta(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}var na=function(e){return function(t){K()(r,t);var n=ta(r);function r(e){var t;z()(this,r),t=n.call(this,e),j()(V()(t),"createPreviewUrl",(function(e){return e?Zi(e):null}));var o=e.blob;return t.state={previewUrl:t.createPreviewUrl(o)},t}return W()(r,[{key:"updateBlobPreview",value:function(e){this.revokePreviewURL(),this.setState({previewUrl:this.createPreviewUrl(e)})}},{key:"revokePreviewURL",value:function(){ea(this.state.previewUrl)}},{key:"componentWillReceiveProps",value:function(e){var t=e.blob;this.props.blob!==t&&this.updateBlobPreview(t)}},{key:"componentWillUnmount",value:function(){this.revokePreviewURL()}},{key:"render",value:function(){return Object(I.h)(e,F()({previewUrl:this.state.previewUrl},this.props))}}]),r}(I.Component)},ra=n(93),oa=n.n(ra);function ia(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}var aa=function(e){var t=e.blob;return Object(I.h)("a",{href:"#",onClick:Object(Ce.n)((function(){window.navigator.msSaveOrOpenBlob(t,"document.pdf")})),className:oa.a.pdfIcon})},sa=0,ca=na(function(e){K()(n,e);var t=ia(n);function n(e){var r;return z()(this,n),r=t.call(this,e),j()(V()(r),"options",{width:"100%",height:"18.125em","max-height":"70vh",border:0,fallbackLink:"<a href='[url]' class=".concat(oa.a.pdfIcon," download/>")}),r.id="pdfContainer"+sa++,r}return W()(n,[{key:"embedPDF",value:function(e){Xi.a.embed(e,"#".concat(this.id),this.options)}},{key:"componentDidMount",value:function(){var e=this.props.previewUrl;this.embedPDF(e)}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentWillReceiveProps",value:function(e){var t=e.previewUrl;this.props.pdfPreview!==t&&this.embedPDF(t)}},{key:"render",value:function(){return Object(I.h)("div",{id:this.id})}}]),n}(I.Component)),ua=function(e){K()(n,e);var t=ia(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){var e=this.props.blob;return Object(I.h)("div",{className:oa.a.pdfWrapper},window.navigator.msSaveOrOpenBlob?Object(I.h)(aa,{blob:e}):Object(I.h)(ca,{blob:e}))}}]),n}(I.Component),la=n(451),fa=n.n(la);var pa=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"state",{clientX:0,clientY:0}),j()(V()(r),"handleTouchStart",(function(e){if(1===e.touches.length){var t=e.touches[0],n=t.clientX,o=t.clientY;r.setState({clientX:n,clientY:o})}})),j()(V()(r),"handleTouchMove",(function(e){if(e.preventDefault(),1===e.touches.length){var t=e.touches[0],n=t.clientX,o=t.clientY;r.handlePan(r.state.clientX-n,r.state.clientY-o),r.setState({clientX:n,clientY:o})}})),j()(V()(r),"handlePan",(function(e,t){r.container&&(r.container.scrollLeft+=e,r.container.scrollTop+=t)})),r}return W()(n,[{key:"center",value:function(){if(this.container){var e=this.container,t=e.clientWidth,n=e.scrollWidth,r=e.clientHeight,o=e.scrollHeight;this.container.scrollLeft=(n-t)/2,this.container.scrollTop=(o-r)/2}}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.className;return Object(I.h)("div",{ref:function(t){return e.container=t},className:ie()(fa.a.container,r),onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove},n)}}]),n}(I.Component),da=n(147),ha=n.n(da);var va=Object(X.connect)((function(e){return{isNavigationDisabled:e.globals.isNavigationDisabled}})),ma=Object(X.connect)(null,(function(e){return{setNavigationDisabled:function(t){return e(ve(t))}}})),ya=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"componentDidUpdate",value:function(e){var t=e.id!==this.props.id;this.backBtn&&t&&this.backBtn.focus()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.back,o=n.translate,i=n.disabled,a=n.isFullScreen,s=n.className;return Object(I.h)("div",{className:ie()(s,ha.a.navigation,j()({},ha.a.fullScreenNav,a))},Object(I.h)("button",{type:"button","aria-label":o("back"),ref:function(e){return t.backBtn=e},onClick:r,className:ie()(ha.a.back,(e={},j()(e,ha.a.disabled,i),j()(e,ha.a.backHoverDesktop,Ce.j),e))},Object(I.h)("span",{className:ha.a.iconBack}),Object(I.h)("span",{className:ha.a.label,"aria-hidden":"true"},o("back"))))}}]),n}(I.Component),ga=Object(Qe.a)(we,xe.b)(ya),ba=n(159),_a=n.n(ba);var ka,wa=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"state",{isExpanded:!1}),j()(V()(r),"handleImageLoad",(function(){r.image&&r.image.center()})),j()(V()(r),"toggle",(function(){return r.setState({isExpanded:!r.state.isExpanded},(function(){r.previewContainer&&r.previewContainer.focus()}))})),r}return W()(n,[{key:"componentWillUpdate",value:function(e,t){t.isExpanded!==e.isNavigationDisabled&&this.props.setNavigationDisabled(t.isExpanded),t.isExpanded!==e.isFullScreen&&this.props.setFullScreen(t.isExpanded)}},{key:"componentWillUnmount",value:function(){this.props.setNavigationDisabled(!1),this.props.setFullScreen(!1)}},{key:"render",value:function(){var e=this,t=this.state.isExpanded,n=this.props,r=n.translate,o=n.src,i=n.altTag;return Object(I.h)("div",{className:ie()(j()({},_a.a.expanded,t),_a.a.container)},Object(I.h)("div",{ref:function(t){return e.previewContainer=t},tabIndex:-1,"aria-label":i,"aria-live":t?"assertive":"off","aria-expanded":t.toString(),role:"img"},t&&Object(I.h)(pa,{ref:function(t){return e.image=t},className:_a.a.imageContainer},Object(I.h)("img",{onLoad:this.handleImageLoad,className:_a.a.image,src:o,alt:""}))),Object(I.h)(ct,{className:_a.a.button,textClassName:_a.a["button-text"],variants:["overlay"],onClick:this.toggle},r(t?"confirm.enlarge_image.close":"confirm.enlarge_image.enlarge")))}}]),n}(I.Component),Sa=Object(Qe.a)(va,ma,we,Se,xe.b)(wa),Oa=function(e){var t=e.src,n=e.id,r=e.isDocument,o=e.isFullScreen,i=e.isPreviewCropped,a=e.altTag;return Object(I.h)("span",{className:ie()(i?oa.a.croppedImageWrapper:oa.a.imageWrapper,j()({},oa.a.fullscreenImageWrapper,o))},r&&Object(I.h)(Sa,{src:t,altTag:a}),!o&&Object(I.h)("img",{key:n,className:i?oa.a.croppedDocumentImage:oa.a.image,src:t,alt:a,"aria-hidden":r}))},Ca=na((function(e){var t=e.previewUrl,n=P()(e,["previewUrl"]);return Object(I.h)(Oa,F()({src:t},n))})),xa=(ka=function(e){var t=e.base64,n=P()(e,["base64"]);return Object(I.h)(Oa,F()({src:t},n))},function(e){K()(n,e);var t=ta(n);function n(e){var r;z()(this,n),r=t.call(this,e);var o=e.blob;return r.state={base64:null},r.updateBase64(o),r}return W()(n,[{key:"updateBase64",value:function(e){var t=this;e&&_r(e,(function(e){return t.setState({base64:e})}),(function(){return console.error("An error occurred converting a blob to base64")}))}},{key:"componentWillReceiveProps",value:function(e){var t=e.blob;this.props.blob!==t&&this.updateBase64(t)}},{key:"render",value:function(){return this.state.base64?Object(I.h)(ka,F()({base64:this.state.base64},this.props)):null}}]),n}(I.Component)),Ea=function(e){var t=e.blob,n=P()(e,["blob"]);return t instanceof File?Object(I.h)(xa,F()({blob:t},n)):Object(I.h)(Ca,F()({blob:t},n))},ja=na((function(e){var t=e.ariaLabel,n=e.previewUrl;return Object(I.h)("div",{className:oa.a.videoWrapper},Object(I.h)("video",{"aria-label":t,className:oa.a.video,src:n,controls:!0}))})),Aa=function(e){var t=e.capture,n=t.blob,r=t.id,o=t.variant,i=t.isPreviewCropped,a=e.method,s=e.isFullScreen,c=e.imageAltTag,u=e.videoAriaLabel;return wr(["pdf"],n)?Object(I.h)(ua,{blob:n}):"video"===o?Object(I.h)(ja,{ariaLabel:u,blob:n}):Object(I.h)(Ea,{blob:n,id:r,isDocument:"document"===a,isPreviewCropped:i,isFullScreen:s,altTag:c})},Pa=Object(xe.b)((function(e){var t=e.capture,n=e.retakeAction,r=e.confirmAction,o=e.error,i=e.method,a=e.documentType,s=e.translate,c=e.isFullScreen,u=e.isUploading,l="face"===i?"confirm.face.".concat(t.variant):"confirm.".concat(i),f=s("".concat(l,".title")),p=s("".concat(l,".alt")),d=s("accessibility.replay_video"),h=s("face"===i?"confirm.face.".concat(t.variant,".message"):"confirm.".concat(a,".message"));return Object(I.h)("div",{className:ie()(Ki.a.previewsContainer,Mn.a.fullHeightContainer,j()({},Ki.a.previewsContainerIsFullScreen,c))},c?null:o.type?Object(I.h)(ro,{error:o,withArrow:!0,role:"alert",focusOnMount:!1}):Object(I.h)(it,{title:f,smaller:!0,className:Ki.a.title}),Object(I.h)(Aa,{capture:t,method:i,isFullScreen:c,imageAltTag:p,videoAriaLabel:d}),!c&&Object(I.h)("div",null,Object(I.h)("p",{className:Ki.a.message},h),Object(I.h)(Yi,{retakeAction:n,confirmAction:r,isUploading:u,error:o})))}));function Ta(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Da(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Ta(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Ta(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Ia=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(e){var r;return z()(this,n),r=t.call(this,e),j()(V()(r),"onGlareWarning",(function(){r.setWarning("GLARE_DETECTED")})),j()(V()(r),"setError",(function(e){r.setState({error:{name:e,type:"error"}}),r.props.resetSdkFocus()})),j()(V()(r),"setWarning",(function(e){r.setState({error:{name:e,type:"warn"}}),r.props.resetSdkFocus()})),j()(V()(r),"onfidoErrorFieldMap",(function(e){var t,n=Jo()(e,2),r=n[0],o=n[1];return"document_detection"===r?"INVALID_CAPTURE":"file"===r?"INVALID_TYPE":"attachment"===r||"attachment_content_type"===r?"UNSUPPORTED_FILE":"face_detection"===r?-1===Vi()(t=o[0]).call(t,"Multiple faces")?"NO_FACE_ERROR":"MULTIPLE_FACES_ERROR":void 0})),j()(V()(r),"onfidoErrorReduce",(function(e){var t,n=e.fields,o=x()(t=Wi()(n)).call(t,r.onfidoErrorFieldMap);return Jo()(o,1)[0]})),j()(V()(r),"onApiError",(function(e){var t,n,o=e.status||"",i=e.response||{};if(r.props.mobileFlow&&401===o)return r.props.triggerOnError({status:o,response:i}),r.props.crossDeviceClientError();422===o?t=r.onfidoErrorReduce(i.error):(r.props.triggerOnError({status:o,response:i}),Nn(Fe()(n="".concat(o," - ")).call(n,i)),t="SERVER_ERROR"),r.setState({uploadInProgress:!1}),r.setError(t)})),j()(V()(r),"onApiSuccess",(function(e){var t=r.props,n=t.method,o=t.nextStep,i=t.actions,a=r.state.capture,s=Math.round(performance.now()-r.startTime);An("Completed upload",{duration:s,method:n}),i.setCaptureMetadata({capture:a,apiResponse:e});var c=e.sdk_warnings;c&&!c.detect_glare.valid?(r.setState({uploadInProgress:!1}),r.onGlareWarning()):We()(o,0)})),j()(V()(r),"handleSelfieUpload",(function(e,t){var n=e.snapshot,o=P()(e,["snapshot"]),i=r.props.urls.onfido_api_url;if(n)di(n,o,t,i,r.onApiSuccess,r.onApiError,An);else{var a=o.blob,s=o.filename,c=o.sdkMetadata;pi({file:s?{blob:a,filename:s}:a,sdkMetadata:c},i,t,r.onApiSuccess,r.onApiError)}})),j()(V()(r),"uploadCaptureToOnfido",(function(){var e=r.props,t=e.urls,n=e.capture,o=e.method,i=e.side,a=e.token,s=e.poaDocumentType,c=e.language,u=t.onfido_api_url;r.startTime=performance.now(),An("Starting upload",{method:o}),r.setState({uploadInProgress:!0});var l=n.blob,f=n.documentType,p=n.variant,d=n.challengeData,h=n.sdkMetadata;if(r.setState({capture:n}),"document"===o){var v=w()(Hn).call(Hn,s),m=!wr(["pdf"],l)&&!v,y=Da(Da({},!v?{detect_document:"error"}:{}),m?{detect_glare:"warn"}:{});!function(e,t,n,r,o){var i=e.sdkMetadata,a=void 0===i?{}:i,s=P()(e,["sdkMetadata"]),c=s,u=c.validations;s=li(li({},P()(c,["validations"])),{},{sdk_metadata:lt()(a),sdk_validations:lt()(u)});var l="".concat(t,"/v3/documents");vi(l,s,n,r,o)}(Da({file:l,type:f,side:i,validations:y,sdkMetadata:h},v?{issuing_country:r.props.country||"GBR"}:{}),u,a,r.onApiSuccess,r.onApiError)}else if("face"===o){if("video"===p)!function(e,t,n,r,o){var i=e.challengeData,a=e.blob,s=e.language,c=e.sdkMetadata,u=void 0===c?{}:c,l=i.challenges,f=i.id,p=i.switchSeconds,d={file:a,languages:lt()([{source:"sdk",language_code:s}]),challenge:lt()(l),challenge_id:f,challenge_switch_at:p,sdk_metadata:lt()(u)},h="".concat(t,"/v3/live_videos");vi(h,d,n,r,o)}({challengeData:d,blob:l,language:c,sdkMetadata:h},u,a,r.onApiSuccess,r.onApiError);else r.handleSelfieUpload(n,a)}})),j()(V()(r),"onConfirm",(function(){"warn"===r.state.error.type?r.props.nextStep():r.uploadCaptureToOnfido()})),j()(V()(r),"render",(function(e){var t=e.capture,n=e.previousStep,o=e.method,i=e.documentType,a=e.isFullScreen;return r.state.uploadInProgress?Object(I.h)(To,null):Object(I.h)(Pa,{isFullScreen:a,capture:t,retakeAction:n,confirmAction:r.onConfirm,isUploading:r.state.uploadInProgress,error:r.state.error,method:o,documentType:i})})),r.state={uploadInProgress:!1,error:{},capture:null},r}return n}(I.Component),Na=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return rn(t).join("_")},Ra=In(Ia,"confirmation","error"),Ma=Object(X.connect)((function(e,t){var n=t.method,r=t.side;return{capture:e.captures[Na(n,r)],isFullScreen:e.globals.isFullScreen}}))(Object(xe.b)(Ra)),La=function(e){return Object(I.h)(Ma,F()({},e,{method:"face"}))},Ba=Tn((function(e){return Object(I.h)(Ma,F()({},e,{method:"document",side:"front"}))}),"front"),Fa=Tn((function(e){return Object(I.h)(Ma,F()({},e,{method:"document",side:"back"}))}),"back"),Ua=Tn(La,"selfie"),za=Tn(La,"video"),qa=n(381),Wa=n.n(qa);var Ha=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"componentDidMount",value:function(){this.props.nextStep()}},{key:"render",value:function(e){var t,n=e.message,r=e.submessage,o=e.translate,i=n||o("complete.message"),a=r||o("complete.submessage");return Object(I.h)("div",{className:Wa.a.wrapper},Object(I.h)("span",{className:Fe()(t="".concat(Mn.a.icon," ")).call(t,Wa.a.icon)}),Object(I.h)(it,{title:i,subTitle:a}))}}]),n}(I.Component),Va=Dn(Object(xe.b)(Ha)),Ga=n(307),Ka=n.n(Ga),Qa=Dn(Object(xe.b)((function(e){var t,n,r,o=e.translate,i=e.back;return Object(I.h)("div",null,Object(I.h)(it,{title:o("cross_device.mobile_connected.title.message"),subTitle:o("cross_device.mobile_connected.title.submessage")}),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)("span",{className:Fe()(t="".concat(Mn.a.icon," ")).call(t,Ka.a.icon)}),Object(I.h)("div",{className:Mn.a.header},o("cross_device.tips")),Object(I.h)("div",{className:Fe()(n="".concat(Ka.a.help," ")).call(n,Mn.a.help)},Object(I.h)("ul",{className:Mn.a.helpList,"aria-label":o("cross_device.tips")},Object(I.h)("li",null,o("cross_device.mobile_connected.tips.item_1")),Object(I.h)("li",null,o("cross_device.mobile_connected.tips.item_2")),Object(I.h)("li",null,o("cross_device.mobile_connected.tips.item_3")))),Object(I.h)("a",{href:"#",className:Fe()(r="".concat(Mn.a.link," ")).call(r,Ka.a.cancel),onClick:Object(Ce.n)(i)},o("cancel"))))})),"mobile_connected"),$a=n(117),Ya=n.n($a);var Ja=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e;return z()(this,n),e=t.call(this),j()(V()(e),"hasMultipleDocuments",(function(){var t=e.props.steps;return m()(t).call(t,(function(e){return"document"===e.type})).length>1})),j()(V()(e),"hasFaceCaptureStep",(function(){var t;return Le()(t=e.props.steps).call(t,(function(e){return"face"===e.type}))})),j()(V()(e),"getFaceCaptureVariant",(function(){var t=e.props.captures,n=(void 0===t?{}:t).face,r=void 0===n?{}:n;return r&&r.metadata?r.metadata.variant:"standard"})),j()(V()(e),"handleSubmitButtonClick",(function(){e.setState({isSubmitDisabled:!0}),e.props.nextStep()})),e.state={isSubmitDisabled:!1},e}return W()(n,[{key:"render",value:function(){var e,t,n=this.props.translate,r=this.hasMultipleDocuments()?"cross_device.submit.multiple_docs_uploaded":"cross_device.submit.one_doc_uploaded",o="standard"===this.getFaceCaptureVariant()?"selfie":"video";return Object(I.h)("div",null,Object(I.h)(it,{title:n("cross_device.submit.title"),subTitle:n("cross_device.submit.sub_title")}),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)("ul",{className:Ya.a.uploadList,"aria-label":n("cross_device.tips")},Object(I.h)("li",{className:Ya.a.uploadListItem},Object(I.h)("span",{className:Fe()(e="".concat(Mn.a.icon," ")).call(e,Ya.a.icon)}),Object(I.h)("span",{className:ie()(Ya.a.listText,Ya.a.documentUploadedLabel)},n(r))),this.hasFaceCaptureStep()&&Object(I.h)("li",{className:Ya.a.uploadListItem},Object(I.h)("span",{className:Fe()(t="".concat(Mn.a.icon," ")).call(t,Ya.a.icon)}),Object(I.h)("span",{className:ie()(Ya.a.listText,Ya.a["".concat(o,"UploadedLabel")])},n("cross_device.submit.".concat(o,"_uploaded"))))),Object(I.h)("div",null,Object(I.h)(ct,{variants:["primary","centered","lg"],onClick:this.handleSubmitButtonClick,disabled:this.state.isSubmitDisabled},n("cross_device.submit.action")))))}}]),n}(I.Component),Xa=Object(X.connect)((function(e){return{captures:e.captures}}))(Dn(Object(xe.b)(Ja),"desktop_submit")),Za=n(175),es=n.n(Za),ts=Dn(Object(xe.b)((function(e){var t,n,r,o=e.sms,i=e.translate,a=e.previousStep;return Object(I.h)("div",null,Object(I.h)(it,{title:i("cross_device.mobile_notification_sent.title")}),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)("div",{className:es.a.submessage},i("cross_device.mobile_notification_sent.submessage",{number:o.number})),Object(I.h)("div",{className:es.a.boldMessage},i("cross_device.mobile_notification_sent.bold_message")),Object(I.h)("span",{className:Fe()(t="".concat(Mn.a.icon," ")).call(t,es.a.icon)}),Object(I.h)("div",{className:Mn.a.header},i("cross_device.tips")),Object(I.h)("div",{className:Fe()(n="".concat(es.a.help," ")).call(n,Mn.a.help)},Object(I.h)("ul",{className:Mn.a.helpList,"aria-label":i("cross_device.tips")},Object(I.h)("li",null,i("cross_device.mobile_notification_sent.tips.item_1")),Object(I.h)("li",null,i("cross_device.mobile_notification_sent.tips.item_2")))),Object(I.h)("a",{href:"#",className:Fe()(r="".concat(Mn.a.link," ")).call(r,es.a.cancel),onClick:Object(Ce.n)(a)},i("cross_device.mobile_notification_sent.resend_link"))))})),"mobile_notification_sent");var ns=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"sendConfig",(function(e){var t=r.props,n=t.roomId,o=t.mobileConfig,i=t.socket,a=t.actions;n&&n!==e.roomId&&i.emit("leave",{roomId:n}),a.setRoomId(e.roomId),a.mobileConnected(!0),r.sendMessage("config",e.roomId,o)})),j()(V()(r),"sendMessage",(function(e,t,n){r.props.socket.emit("message",{event:e,payload:n,roomId:t})})),j()(V()(r),"onClientSuccess",(function(e){var t;p()(t=e.captures||[]).call(t,(function(e){return r.props.actions.createCapture(e)})),r.props.actions.setClientSuccess(!0)})),j()(V()(r),"onCrossBrowserStart",(function(){dispatchEvent(new CustomEvent("userAnalyticsEvent",{detail:{eventName:"CROSS_DEVICE_START",isCrossDevice:!0}}))})),j()(V()(r),"onUserAnalyticsEvent",(function(e){dispatchEvent(new CustomEvent("userAnalyticsEvent",e))})),j()(V()(r),"onDisconnectPing",(function(e){r.sendMessage("disconnect pong",e.roomId)})),j()(V()(r),"render",(function(e){return r.props.clientSuccess?Object(I.h)(Xa,e):r.props.mobileConnected?Object(I.h)(Qa,e):Object(I.h)(ts,e)})),r}return W()(n,[{key:"componentDidMount",value:function(){this.props.socket.on("disconnect ping",this.onDisconnectPing),this.props.socket.on("get config",this.sendConfig),this.props.socket.on("client success",this.onClientSuccess),this.props.socket.on("user analytics",this.onUserAnalyticsEvent),this.props.socket.on("cross device start",this.onCrossBrowserStart)}},{key:"componentWillUnmount",value:function(){this.props.socket.off("disconnect ping"),this.props.socket.off("get config"),this.props.socket.off("client success"),this.props.socket.off("user analytics");var e=this.props,t=e.socket,n=e.roomId,r=e.actions;t.emit("disconnecting",{roomId:n}),this.props.socket.off("cross device start"),r.mobileConnected(!1)}}]),n}(I.Component),rs=n(47),os=n.n(rs);var is=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(e){var r;return z()(this,n),r=t.call(this,e),j()(V()(r),"onCopySuccess",(function(){r.setState({copySuccess:!0}),r.clearLinkCopiedTimeout(),r.linkCopiedTimeoutId=We()((function(){r.setState({copySuccess:!1}),r.linkText&&r.linkText.focus()}),5e3)})),j()(V()(r),"clearLinkCopiedTimeout",(function(){r.linkCopiedTimeoutId&&clearTimeout(r.linkCopiedTimeoutId)})),r.state={copySuccess:!1},r}return W()(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.translate,r=t.mobileUrl,o=this.state.copySuccess,i=o?"cross_device.link.copy_link.success":"cross_device.link.copy_link.action";return Object(I.h)("div",{className:os.a.copyLinkSection},Object(I.h)("div",{className:os.a.label},n("cross_device.link.copy_link_label")),Object(I.h)("div",{className:ie()(os.a.linkContainer,o&&os.a.copySuccess)},Object(I.h)("span",{className:os.a.linkText,ref:function(t){return e.linkText=t}},r),document.queryCommandSupported("copy")&&Object(I.h)("div",{className:os.a.actionContainer,"aria-live":"polite","aria-relevant":"text"},Object(I.h)("button",{type:"button",onClick:function(){return Object(Ce.d)(r,e.onCopySuccess)},className:os.a.copyToClipboard},n(i)))),Object(I.h)("hr",{className:os.a.divider}))}}]),n}(I.Component),as=Object(xe.b)(is),ss=n(302),cs=n.n(ss),us=n(376),ls=n.n(us),fs=n(377),ps=n.n(fs);window.Promise||(window.Promise=ps.a);var ds,hs,vs=n(422),ms=n.n(vs),ys=Object(xe.b)((function(e){var t=e.translate;return Object(I.h)("div",{className:ms.a.loading},t("cross_device.loading"))})),gs=(ds=function(){return Promise.all([n.e(4),n.e(0)]).then(n.bind(null,658))},hs=ys,function(e){K()(r,e);var t,n=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(r);function r(e){var t;return z()(this,r),t=n.call(this,e),j()(V()(t),"lazyLoadingError",(function(){return t.props.translate("errors.lazy_loading.message")})),t.state={component:null},t}return W()(r,[{key:"componentDidMount",value:(t=ls()(cs.a.mark((function e(){var t,n;return cs.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ds();case 3:t=e.sent,n=t.default,this.setState({component:n}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),this.setState({component:this.lazyLoadingError});case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.state.component;return e?Object(I.h)(e,this.props):Object(I.h)(hs,null)}}]),r}(I.Component)),bs=Object(xe.b)((function(e){return Object(I.h)(gs,e)})),_s=n(452),ks=n.n(_s),ws=function(e){var t=e.url,n=e.level,r=void 0===n?"Q":n,o=e.size,i=void 0===o?100:o;return Object(I.h)(ks.a,{renderAs:"svg",size:i,level:r,value:t})},Ss=n(282),Os=n.n(Ss);var Cs=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e;return z()(this,n),e=t.call(this),j()(V()(e),"toggleHelpListVisibility",(function(){e.setState({isExpanded:!e.state.isExpanded})})),e.state={isExpanded:!1},e}return W()(n,[{key:"render",value:function(){var e=this.props.translate,t=this.state.isExpanded;return Object(I.h)("div",{className:Os.a.qrCodeHelp},Object(I.h)("i",{className:Os.a.qrCodeHelpIcon}),Object(I.h)("button",{type:"button","aria-atomic":"false","aria-expanded":t,className:ie()(Mn.a.link,Os.a.qrCodeHelpButton),onClick:this.toggleHelpListVisibility},e("cross_device.link.qr_code.help_label")),Object(I.h)("ul",{hidden:!t,className:Os.a.qrCodeHelpList},Object(I.h)("li",{"data-onfido-qa":"qrCodeHowToStep1"},e("cross_device.link.qr_code.help_step_1")),Object(I.h)("li",{"data-onfido-qa":"qrCodeHowToStep2"},e("cross_device.link.qr_code.help_step_2"))))}}]),n}(I.Component),xs=Object(xe.b)(Cs);function Es(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}var js=function(e){K()(n,e);var t=Es(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"render",(function(e){var t=e.error;return Object(I.h)(ro,F()({role:"alert"},{error:t}))})),r}return W()(n,[{key:"componentDidMount",value:function(){var e=this.props.error.name.toLowerCase();this.props.trackScreen([e])}}]),n}(I.Component),As=function(e){K()(n,e);var t=Es(n);function n(e){var r;if(z()(this,n),r=t.call(this,e),j()(V()(r),"unlisten",(function(e){e&&(e.off("get config",r.onGetConfig),e.off("client success",r.onClientSuccess))})),j()(V()(r),"listen",(function(e){e&&(e.on("get config",r.onGetConfig),e.on("client success",r.onClientSuccess))})),j()(V()(r),"onJoined",(function(e){var t=r.props,n=t.actions;t.roomId||n.setRoomId(e.roomId)})),j()(V()(r),"onGetConfig",(function(e){var t=r.props,n=t.roomId,o=t.mobileConfig,i=t.socket,a=t.actions,s=t.nextStep;n&&n!==e.roomId&&i.emit("leave",{roomId:n}),a.mobileConnected(!0),r.sendMessage("config",e.roomId,o),s()})),j()(V()(r),"onClientSuccess",(function(){r.props.actions.setClientSuccess(!0),r.props.nextStep()})),j()(V()(r),"sendMessage",(function(e,t,n){r.props.socket.emit("message",{event:e,payload:n,roomId:t})})),j()(V()(r),"render",(function(){return r.props.roomId?Object(I.h)(Ps,r.props):Object(I.h)(To,null)})),!e.socket){var o=e.urls.sync_url,i=Xe(o);i.on("connect",(function(){var e=r.props.roomId||null;i.emit("join",{roomId:e})})),i.on("joined",r.onJoined),i.open(),e.actions.setSocket(i)}return r}return W()(n,[{key:"componentDidMount",value:function(){this.listen(this.props.socket)}},{key:"componentWillReceiveProps",value:function(e){e.socket!==this.props.socket&&(this.unlisten(this.props.socket),this.listen(e.socket))}},{key:"componentWillUnmount",value:function(){this.unlisten(this.props.socket)}}]),n}(I.Component),Ps=function(e){K()(n,e);var t=Es(n);function n(e){var r,o;return z()(this,n),o=t.call(this,e),j()(V()(o),"linkId",Fe()(r="".concat("BM")).call(r,o.props.roomId)),j()(V()(o),"setError",(function(e){return o.setState({error:{name:e,type:"error"}})})),j()(V()(o),"clearErrors",(function(){o.clearSendLinkClickTimeout(),o.setState({error:{},validNumber:!0})})),j()(V()(o),"handleResponse",(function(e){o.clearSendLinkClickTimeout(),o.setState({sending:!1}),"OK"===e.status?o.props.nextStep():o.setError("SMS_FAILED")})),j()(V()(o),"handleSMSError",(function(e){o.clearSendLinkClickTimeout(),o.setState({sending:!1}),o.props.triggerOnError(e),429===status?o.setError("SMS_OVERUSE"):o.setError("SMS_FAILED")})),j()(V()(o),"handleSendSmsLinkClick",(function(){o.props.sms.valid?o.sendLinkClickTimeoutId||(o.sendLinkClickTimeoutId=We()(o.sendSms,500)):(o.clearSendLinkClickTimeout(),o.setState({validNumber:!1}))})),j()(V()(o),"sendSms",(function(){o.setState({sending:!0});var e=o.props,t=e.language,n=e.sms,r=e.token,i=e.urls.telephony_url,a={payload:lt()({to:n.number,id:o.linkId,language:t.substring(0,2)}),endpoint:"".concat(i,"/v1/cross_device_sms"),contentType:"application/json",token:"Bearer ".concat(r)};wo(a,o.handleResponse,o.handleSMSError)})),j()(V()(o),"getMobileUrl",(function(){var e,t=o.props.urls,n=t.hosted_sdk_url,r=t.cross_device_url||n;return Fe()(e="".concat(r,"/")).call(e,o.linkId)})),j()(V()(o),"renderSmsLinkSection",(function(){var e=o.props.translate,t=o.state,n=t.sending,r=n?"cross_device.link.button_copy.status":"cross_device.link.button_copy.action",i=!t.validNumber;return Object(I.h)("div",null,Object(I.h)("div",{className:os.a.smsSection},Object(I.h)("div",{className:os.a.label},e("cross_device.link.sms_label")),Object(I.h)("div",{className:os.a.numberInputSection},Object(I.h)("div",{className:ie()(os.a.inputContainer,j()({},os.a.fieldError,i))},Object(I.h)(bs,F()({},o.props,{clearErrors:o.clearErrors}))),Object(I.h)(ct,{ariaLive:"polite",ariaRelevant:"text",ariaBusy:n,className:ie()(os.a.btn,j()({},os.a.sending,n)),variants:["primary"],onClick:o.handleSendSmsLinkClick,disabled:n||i},e(r)))),Object(I.h)("div",{role:"alert",hidden:!i},i&&Object(I.h)("div",{className:os.a.numberError},e("errors.invalid_number.message"))))})),j()(V()(o),"renderCopyLinkSection",(function(){return Object(I.h)(as,{mobileUrl:o.getMobileUrl()})})),j()(V()(o),"renderQrCodeSection",(function(){return Object(I.h)("div",{className:os.a.qrCodeSection},Object(I.h)("div",{className:os.a.qrCodeContainer},Object(I.h)(ws,{url:o.getMobileUrl(),size:144})),Object(I.h)(xs,null))})),j()(V()(o),"handleViewOptionSelect",(function(e){An("".concat(e.replace("_"," ")," selected")),o.setState({currentViewId:e}),o.viewOptionBtn.blur()})),o.state={currentViewId:"qr_code",sending:!1,error:{},validNumber:!0},o}return W()(n,[{key:"clearSendLinkClickTimeout",value:function(){this.sendLinkClickTimeoutId&&clearTimeout(this.sendLinkClickTimeoutId)}},{key:"componentWillUnmount",value:function(){this.clearSendLinkClickTimeout()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.translate,o=n.trackScreen,i=this.state,a=i.error,s=i.currentViewId,c=[{id:"qr_code",className:"qrCodeLinkOption",label:"cross_device.link.qr_code_option",render:this.renderQrCodeSection},{id:"sms",className:"smsLinkOption",label:"cross_device.link.sms_option",render:this.renderSmsLinkSection},{id:"copy_link",className:"copyLinkOption",label:"cross_device.link.copy_link_option",render:this.renderCopyLinkSection}],u=O()(c).call(c,(function(e){return e.id===s}));return Object(I.h)("div",{className:os.a.container},a.type?Object(I.h)(js,{error:a,trackScreen:o}):Object(I.h)(it,{title:r("cross_device.link.title"),subTitle:r("cross_device.link.".concat(s,"_sub_title"))}),Object(I.h)("div",{className:ie()(Mn.a.thickWrapper,os.a.secureLinkView)},Object(I.h)("div",{role:"region",id:"selectedLinkView"},u.render()),Object(I.h)("p",{className:os.a.styledLabel},r("cross_device.link.options_divider_label")),Object(I.h)("div",{className:os.a.viewOptions,"aria-controls":"selectedLinkView"},x()(e=m()(c).call(c,(function(e){return e.id!==t.state.currentViewId}))).call(e,(function(e){return Object(I.h)("button",{type:"button",className:ie()(Mn.a.link,os.a.viewOption,os.a[e.className]),ref:function(e){return t.viewOptionBtn=e},onClick:function(){return t.handleViewOptionSelect(e.id)}},r(e.label))})))))}}]),n}(I.Component),Ts=Dn(Object(xe.b)(As),"crossdevice_link"),Ds=n(382),Is=n.n(Ds);var Ns=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){return z()(this,n),t.apply(this,arguments)}return W()(n,[{key:"componentDidMount",value:function(){this.props.sendClientSuccess()}},{key:"render",value:function(){var e,t=this.props.translate;return Object(I.h)("div",null,Object(I.h)(it,{title:t("cross_device.client_success.title"),subTitle:t("cross_device.client_success.sub_title")}),Object(I.h)("div",{class:Mn.a.thickWrapper},Object(I.h)("span",{className:Fe()(e="".concat(Mn.a.icon," ")).call(e,Is.a.icon)}),Object(I.h)("div",{className:Is.a.text},t("cross_device.client_success.body"))))}}]),n}(I.Component),Rs=Dn(Object(xe.b)(Ns),"crossdevice_mobile_success"),Ms=n(118),Ls=n.n(Ms),Bs=function(e,t){var n;return"take-photos"!==e?Fe()(n="".concat("stageIcon","-")).call(n,e):"".concat("stageIcon",t?"-take-selfie":"-take-photos")},Fs=Dn(Object(xe.b)((function(e){var t,n,r,o,i,a,s,c=e.translate,u=e.nextStep,l=e.mobileConfig,f="face"===(n=(t=l).flow,r=void 0===n?"captureSteps":n,o=t.documentType,i=t.poaDocumentType,a=t.steps,s=t.step,Qs({flow:r,documentType:o,poaDocumentType:i,steps:a})[s||0].step.type),p={sms:"description_li_1","take-photos":"description_li_2","return-to-computer":"description_li_3"},d=_()(p);return Object(I.h)("div",{className:ie()(Mn.a.fullHeightMobileContainer,Ls.a.container)},Object(I.h)(it,{title:c("cross_device.intro.title"),subTitle:c("cross_device.intro.sub_title")}),Object(I.h)("ol",{"aria-label":c("accessibility.cross_device_verification"),className:ie()(Mn.a.thickWrapper,Ls.a.content,Ls.a.list)},x()(d).call(d,(function(e){return Object(I.h)("li",{key:e,className:Ls.a.stage},Object(I.h)("div",{className:ie()(Ls.a.stageIcon,Ls.a[Bs(e,f)])}),Object(I.h)("div",{className:ie()(Ls.a.stageMessage,Ls.a["stageMessage-".concat(e)])},c("cross_device.intro.".concat(p[e]))))}))),Object(I.h)("div",{className:ie()(Mn.a.thickWrapper,Ls.a.buttonContainer)},Object(I.h)(ct,{variants:["primary","centered","lg"],onClick:u},c("cross_device.intro.action"))))}))),Us=Dn(Object(Qe.a)(xe.b,Rr)((function(e){var t,n=e.translate,r=e.parseTranslatedTags,o=e.nextStep;return Object(I.h)("div",{className:Mn.a.fullHeightContainer},Object(I.h)(it,{title:n("capture.liveness.intro.title")}),Object(I.h)("div",{className:ie()(Mn.a.thickWrapper,yo.a.introCopy)},Object(I.h)("ul",{className:yo.a.introBullets,"aria-label":n("accessibility.selfie_video_actions")},x()(t=["two_actions","speak_out_loud"]).call(t,(function(e){return Object(I.h)("li",{key:e,className:yo.a.introBullet},Object(I.h)("span",{className:ie()(yo.a.introIcon,yo.a[{two_actions:"twoActionsIcon",speak_out_loud:"speakOutLoudIcon"}[e]])}),r("capture.liveness.intro.".concat(e),(function(e){var t=e.text;return Object(I.h)("span",{className:yo.a.bolder},t)})))})))),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)(ct,{variants:["primary","centered","lg"],onClick:o},n("capture.liveness.intro.continue"))))})),"video_intro"),zs=n(81),qs=n.n(zs),Ws=function(){return Object(I.h)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 272 217",preserveAspectRatio:"xMidYMin meet",className:qs.a.docImage},Object(I.h)("text",{transform:"translate(0 59)",className:qs.a.label},"Full name"),Object(I.h)("text",{transform:"translate(0 90)",className:qs.a.label},"Current"),Object(I.h)("text",{transform:"translate(0 110)",className:qs.a.label},"Address"),Object(I.h)("text",{transform:"translate(0 141)",className:qs.a.label},"Issue date or"),Object(I.h)("text",{transform:"translate(84.314 141)",className:qs.a.label}),Object(I.h)("text",{transform:"translate(0 161)",className:qs.a.label},"Summary period"),Object(I.h)("text",{transform:"translate(0 28)",className:qs.a.label},"Logo"),Object(I.h)("g",{transform:"translate(119)"},Object(I.h)("path",{fill:"#2C3E4F",d:"M8 0h122.79c1.985.002 3.9.744 5.37 2.08l8.65 7.84c.092.084.182.171.27.26l5.57 5.56A8 8 0 0 1 153 21.4V209a8 8 0 0 1-8 8H8a8 8 0 0 1-8-8V8a8 8 0 0 1 8-8z"}),Object(I.h)("path",{fill:"#FFF",d:"M8.03 4.02h126.2a4.002 4.002 0 0 1 2.83 1.17L147.8 15.9a4.005 4.005 0 0 1 1.171 2.83v190.241a4 4 0 0 1-4 4H8.03a4 4 0 0 1-4-4V8.02a4 4 0 0 1 4-4z"}),Object(I.h)("path",{fill:"#2C3E4F",d:"M135.189 2.95L142 9c.034.029.068.059.1.09l7.521 7.6a2 2 0 0 1-1.42 3.4H133.85a2 2 0 0 1-2-2V4.45a2 2 0 0 1 3.33-1.5h.009z"}),Object(I.h)("path",{fill:"#F3F3F4",d:"M101.66 63.29h30.21a1 1 0 0 1 1 1v2.02a1 1 0 0 1-1 1h-30.21a1 1 0 0 1-1-1v-2.02a1 1 0 0 1 1-1z"}),Object(I.h)("path",{fill:"#D8DADC",d:"M101.66 51.24h38.26a1 1 0 0 1 1 1v6.04a1 1 0 0 1-1 1h-38.26a1 1 0 0 1-1-1v-6.04a1 1 0 0 1 1-1zM13.08 99.46h90.609a1 1 0 0 1 1 1v6.04a1 1 0 0 1-1 1H13.08a1 1 0 0 1-1-1v-6.04a1 1 0 0 1 1-1z"}),Object(I.h)("path",{fill:"#F3F3F4","fill-opacity":".5",d:"M13.08 111.51h130.87a1 1 0 0 1 1 1v71.34a1 1 0 0 1-1 1H13.08a1 1 0 0 1-1-1v-71.34a1 1 0 0 1 1-1z"}),Object(I.h)("path",{fill:"#D8DADC",d:"M41.6 79.37v7.03c0 .55-.399 1-.92 1H13c-.5 0-.92-.45-.92-1V64.3c0-.56.41-1 .92-1h42.45c.5 0 .92.44.92 1v14.06c0 .56-.41 1-.92 1H41.6v.01zM13.08 51.24h66.449a1 1 0 0 1 1 1v6.04a1 1 0 0 1-1 1H13.08a1 1 0 0 1-1-1v-6.04a1 1 0 0 1 1-1z"}),Object(I.h)("ellipse",{fill:"#D8DADC",cx:"28.18",cy:"28.13",rx:"16.11",ry:"16.07"})),Object(I.h)("path",{fill:"#8B9094",d:"M36.5 23h102a.5.5 0 0 1 0 1h-102a.5.5 0 0 1 0-1zM68.5 54h70a.5.5 0 0 1 0 1h-70a.5.5 0 0 1 0-1zM55.5 84h83a.5.5 0 0 1 0 1h-83a.5.5 0 0 1 0-1z"}),Object(I.h)("g",{fill:"#8B9094"},Object(I.h)("path",{d:"M89.5 136h142c.275 0 .5.225.5.5s-.225.5-.5.5h-142a.5.5 0 0 1 0-1z"}),Object(I.h)("path",{d:"M139.5 102a.5.5 0 0 1 .5.5v34a.5.5 0 0 1-1 0v-34a.5.5 0 0 1 .5-.5zM231.5 56a.5.5 0 0 1 .5.5v80c0 .275-.225.5-.5.5a.501.501 0 0 1-.5-.5v-80a.5.5 0 0 1 .5-.5z"})))},Hs=Dn(Object(xe.b)((function(e){var t=e.translate,n=e.parseTranslatedTags,r=e.poaDocumentType,o=e.nextStep;return Object(I.h)("div",{className:Mn.a.fullHeightContainer},Object(I.h)(it,{title:t("capture.".concat(r,".front.title")),subTitle:Object(I.h)("span",{className:qs.a.subTitle},n("capture.".concat(r,".front.sub_title"),(function(e){var t=e.text;return Object(I.h)("span",{className:qs.a.bolder},t)})))}),Object(I.h)("div",{className:qs.a.content},Object(I.h)("div",{className:qs.a.makeSure},t("proof_of_address.guidance.make_sure_it_shows")),Object(I.h)("div",{className:qs.a.docImageContainer},Object(I.h)(Ws,null))),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)(ct,{variants:["primary","centered","lg"],onClick:o},t("proof_of_address.guidance.continue"))))}))),Vs=n(283),Gs=n.n(Vs),Ks=Dn(Object(xe.b)((function(e){var t,n=e.country,r=e.translate,o=e.parseTranslatedTags,i=e.nextStep;return Object(I.h)("div",{className:Mn.a.fullHeightContainer},Object(I.h)(it,{title:r("proof_of_address.intro.title",{country:n&&"GBR"!==n?"":"UK"})}),Object(I.h)("div",{className:Gs.a.content},Object(I.h)("p",{className:Gs.a.requirements},r("proof_of_address.intro.requirements")),x()(t=["shows_address","matches_signup","is_recent"]).call(t,(function(e){return Object(I.h)("div",{key:e,className:Gs.a.requirement},Object(I.h)("span",null,o("proof_of_address.intro.".concat(e),(function(e){var t=e.text;return Object(I.h)("span",{className:Gs.a.bolder},t)}))))}))),Object(I.h)("div",{className:Mn.a.thickWrapper},Object(I.h)(ct,{variants:["primary","centered","lg"],onClick:i},r("proof_of_address.intro.start"))))}))),Qs=function(e){var t=e.flow,n=e.documentType,r=e.steps,o=e.mobileFlow,i=e.deviceHasCameraSupport,a=o?Js(r):r;return"captureSteps"===t?ac(Zs(n,o,r,i),a):ac(ic,oc(r))},$s=function(e){return"complete"===e.type},Ys=function(e){return Le()(e).call(e,$s)},Js=function(e){var t;return Ys(e)?e:Fe()(t=[]).call(t,nt()(e),[{type:"complete"}])},Xs=function(e){var t,n=O()(e).call(e,(function(e){return"document"===e.type})),r=n&&n.options&&n.options.documentTypes;return r?m()(t=_()(r)).call(t,(function(e){return r[e]})):[]},Zs=function(e,t,n,r){var o=t?[Rs]:[Va];return{welcome:function(){return[Fn]},face:function(){return ec(n,r,t)},document:function(){return rc(e,function(e){return 1===Xs(e).length}(n),function(e,t){var n=O()(e).call(e,(function(e){return"document"===e.type})).options;return((!Ce.j||Ce.k)&&(null==n?void 0:n.useLiveDocumentCapture)||(null==n?void 0:n.useWebcam))&&t}(n,r))},poa:function(){return[Ks,sr,Hs,zi,Ba]},complete:function(){return o}}},ec=function(e,t,n){var r=m()(e).call(e,(function(e){return"face"===e.type}))[0],o=!(r.options&&r.options.useUploader)&&t;return function(e){return"video"===((O()(e).call(e,(function(e){return"face"===e.type}))||{}).options||{}).requestedVariant&&window.MediaRecorder}(e)?tc(t,n):nc(o)},tc=function(e,t){var n=[Us,Ui,za];return t&&!e?et()(n).call(n,1):n},nc=function(e){var t=[Ur,Fi,Ua];return e?t:et()(t).call(t,1)},rc=function(e,t,n){var r,o,i=["driving_licence","national_identity_card"],a="passport"===e&&!n?[Li,Nr,Ba]:[Li,Ba],s=Fe()(r=[cr]).call(r,a),c=t?a:s;return w()(i).call(i,e)?Fe()(o=[]).call(o,nt()(c),[Bi,Fa]):c},oc=function(e){var t,n=[{type:"crossDevice"}],r=O()(e).call(e,$s);return Ys(e)?Fe()(t=[]).call(t,n,[r]):n},ic={crossDevice:function(){return[Fs,Ts,ns]},complete:function(){return[Va]}},ac=function(e,t){return uc(x()(t).call(t,(function(t,n){return sc(e,t,n)})))},sc=function(e,t,n){var r,o=t.type;return o in e||console.error("No such step: "+o),x()(r=e[o]()).call(r,cc(t,n))},cc=function(e,t){return function(n){return{component:n,step:e,stepIndex:t}}},uc=function(e){var t,n,r;return(n=Fe()(t=[])).call.apply(n,Fe()(r=[t]).call(r,nt()(e)))};function lc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function fc(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=lc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=lc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var pc=we(function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(){var e,r;z()(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,Fe()(e=[this]).call(e,i)),j()(V()(r),"resetSdkFocus",(function(){return r.container.focus()})),j()(V()(r),"trackScreen",(function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.currentComponent(),i=o.step;Pn(Fe()(t=[i.type]).call(t,nt()(on(e))),fc(fc({},n),i.options))})),j()(V()(r),"currentComponent",(function(){return r.props.componentsList[r.props.step]})),j()(V()(r),"render",(function(){var e,t,n,o,i=r.props,a=i.back,s=i.disableNavigation,c=i.isFullScreen,u=i.hideOnfidoLogo,l=i.cobrand,f=i.options,p=f.mobileFlow,d=P()(f,["mobileFlow"]),h=P()(i,["back","disableNavigation","isFullScreen","hideOnfidoLogo","cobrand","options"]),v=r.currentComponent(),m=v.component,y=v.step.options,g="onfido-step".concat(r.props.step),b=(p||(null===(e=d.enterpriseFeatures)||void 0===e?void 0:e.hideOnfidoLogo))&&u,_=(p||(null===(t=d.enterpriseFeatures)||void 0===t?void 0:t.cobrand))&&l;return Object(I.h)("div",{className:ie()(Mn.a.step,(n={},j()(n,Mn.a.fullScreenStep,c),j()(n,Mn.a.noLogo,b),j()(n,Mn.a.cobrandLogo,_),j()(n,Mn.a.defaultLogo,!u&&!l),n)),tabIndex:-1,ref:function(e){return r.container=e}},Object(I.h)(ga,{id:g,back:a,disabled:s,className:Mn.a.navigationBar}),Object(I.h)("div",{className:ie()(Mn.a.content,(o={},j()(o,Mn.a.fullScreenContentWrapper,c),j()(o,Mn.a.scrollableContent,!c),o))},Object(I.h)(m,F()({},fc(fc(fc(fc({},y),d),h),{},{back:a}),{trackScreen:r.trackScreen,resetSdkFocus:r.resetSdkFocus}))),!b&&_?Object(I.h)("div",{className:ie()(j()({},Mn.a.cobrandFooter,_))},Object(I.h)("div",{className:Mn.a.cobrandLabel,"aria-hidden":"true"},Object(I.h)("div",{className:Mn.a.cobrandText},_.text),Object(I.h)("div",{className:Mn.a.poweredBy},"powered by")),Object(I.h)("div",{className:Mn.a.logo})):Object(I.h)("div",{className:Mn.a.footer}))})),r}return n}(I.Component));function dc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function hc(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=dc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=dc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var vc=Object(Z.compose)(Object(X.connect)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return hc({hideOnfidoLogo:e.globals.hideOnfidoLogo,cobrand:e.globals.cobrand},t)})),(function(e){return function(t){var n,r=t.back,o=t.disableNavigation,i=t.hideOnfidoLogo,a=t.cobrand;return Object(I.h)("div",{className:ie()(Mn.a.step,(n={},j()(n,Mn.a.noLogo,i),j()(n,Mn.a.cobrandLogo,a),j()(n,Mn.a.defaultLogo,!i&&!a),n))},Object(I.h)(ga,{back:r,disabled:o,className:Mn.a.navigationBar}),Object(I.h)("div",{className:Mn.a.content},Object(I.h)(e,t)),a&!i?Object(I.h)("div",{className:ie()(j()({},Mn.a.cobrandFooter,a))},Object(I.h)("div",{className:Mn.a.cobrandLabel,"aria-hidden":"true"},Object(I.h)("div",{className:Mn.a.cobrandText},a.text),Object(I.h)("div",{className:Mn.a.poweredBy},"powered by")),Object(I.h)("div",{className:Mn.a.logo})):Object(I.h)("div",{className:Mn.a.footer}))}}));function mc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function yc(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=mc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=mc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}function gc(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}var bc=function(e){var t=e.options;return t&&!1===t.uploadFallback&&("face"===e.type||t.useLiveDocumentCapture)},_c=vc(To),kc=vc(Pi),wc=function(e){K()(n,e);var t=gc(n);function n(e){var r;z()(this,n),r=t.call(this,e),j()(V()(r),"configTimeoutId",null),j()(V()(r),"pingTimeoutId",null),j()(V()(r),"sendMessage",(function(e,t){var n=r.state.roomId;r.state.socket.emit("message",{roomId:n,event:e,payload:t})})),j()(V()(r),"requestMobileConfig",(function(){r.sendMessage("get config"),r.clearConfigTimeout(),r.configTimeoutId=We()((function(){r.state.loading&&r.setError()}),1e4)})),j()(V()(r),"clearConfigTimeout",(function(){return r.configTimeoutId&&clearTimeout(r.configTimeoutId)})),j()(V()(r),"clearPingTimeout",(function(){r.pingTimeoutId&&(clearTimeout(r.pingTimeoutId),r.pingTimeoutId=null)})),j()(V()(r),"setMobileConfig",(function(e){return function(t){var n,o,i,a,s,c=t.token,u=t.urls,l=t.steps,f=t.language,p=t.documentType,d=t.poaDocumentType,h=t.step,v=t.clientStepIndex,m=t.woopraCookie,y=t.disableAnalytics,g=t.enterpriseFeatures;if(y?jn():(n=m,o=xn.config("cookie_name"),i=xn.config("cookie_expire"),a=xn.config("cookie_path"),s=xn.config("cookie_domain"),xn.docCookies.setItem(o,n,i,a,s),xn.cookie=n),!c)return console.error("Desktop did not send token"),Nn("Desktop did not send token"),r.setError();if(function(e){var t=Ge(e).exp;return Object(Ce.f)()>t}(c))return console.error("Desktop token has expired"),Nn("Token has expired: ".concat(c)),r.setError();var b="face"===l[v].type;if(r.setState({token:c,steps:l,step:b?v:h,stepIndexType:b?"client":"user",crossDeviceError:!1,language:f},(function(){return r.setState({loading:!1})})),u&&e.setUrls(u),d?e.setPoADocumentType(d):e.setIdDocumentType(p),g){var _=Ke(c);g.hideOnfidoLogo&&(null==_?void 0:_.hideOnfidoLogo)?e.hideOnfidoLogo(!0):(e.hideOnfidoLogo(!1),g.cobrand&&(null==_?void 0:_.cobrand)&&e.showCobranding(g.cobrand))}else e.hideOnfidoLogo(!1),e.showCobranding(null);e.acceptTerms()}})),j()(V()(r),"setError",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"GENERIC_CLIENT_ERROR";r.setState({crossDeviceError:{name:e},loading:!1})})),j()(V()(r),"onDisconnect",(function(){r.pingTimeoutId=We()(r.setError,3e3),r.sendMessage("disconnect ping")})),j()(V()(r),"onDisconnectPong",(function(){return r.clearPingTimeout()})),j()(V()(r),"sendClientSuccess",(function(){var e;r.state.socket.off("custom disconnect",r.onDisconnect);var t=ze()(e=_()(r.props.captures)).call(e,(function(e,t){return Fe()(e).call(e,Object(Ve.g)(r.props.captures[t],["documentType","poaDocumentType","id","metadata","method","side"]))}),[]);r.sendMessage("client success",{captures:t})})),j()(V()(r),"renderLoadingOrErrors",(function(){var e=r.state.steps,t=e&&Le()(e).call(e,bc),n=r.props.hasCamera;return r.state.loading?Object(I.h)(_c,{disableNavigation:!0}):r.state.crossDeviceError?Object(I.h)(kc,{disableNavigation:!0,error:r.state.crossDeviceError}):!n&&t?Object(I.h)(kc,{disableNavigation:!0,error:{name:Object(Ce.i)()}}):null})),j()(V()(r),"render",(function(){var e=r.state.language;return Object(I.h)(xe.a,{language:e},r.renderLoadingOrErrors()||Object(I.h)(Oc,F()({},r.props,r.state,{sendClientSuccess:r.sendClientSuccess,crossDeviceClientError:r.setError})),")")}));var o=e.urls.sync_url,i=window.location.pathname.substring(3)||e.options.roomId;return r.state={token:null,steps:null,step:null,socket:Xe(o),roomId:i,crossDeviceError:!1,loading:!0},Ce.j?$()(r,r.setError("FORBIDDEN_CLIENT_ERROR")):(r.state.socket.on("config",r.setMobileConfig(e.actions)),r.state.socket.on("connect",(function(){r.state.socket.emit("join",{roomId:r.state.roomId})})),r.state.socket.open(),r.requestMobileConfig(),r.props.options.mobileFlow&&(r.sendMessage("cross device start"),addEventListener("userAnalyticsEvent",(function(e){r.sendMessage("user analytics",{detail:yc(yc({},e.detail),{},{isCrossDevice:!0})})}))),r)}return W()(n,[{key:"componentDidMount",value:function(){this.state.socket.on("custom disconnect",this.onDisconnect),this.state.socket.on("disconnect pong",this.onDisconnectPong)}},{key:"componentWillUnmount",value:function(){this.clearConfigTimeout(),this.clearPingTimeout(),this.state.socket.close()}}]),n}(I.Component),Sc=function(e){K()(n,e);var t=gc(n);function n(e){var r;return z()(this,n),r=t.call(this,e),j()(V()(r),"generateMobileConfig",(function(){var e=r.props,t=e.documentType,n=e.poaDocumentType,o=e.deviceHasCameraSupport,i=e.options,a=e.urls,s=i.steps,c=i.token,u=i.language,l=i.disableAnalytics,f=i.enterpriseFeatures;return{steps:s,token:c,urls:a,language:u,documentType:t,poaDocumentType:n,deviceHasCameraSupport:o,woopraCookie:l?null:xn.cookie,disableAnalytics:l,step:r.state.crossDeviceInitialStep,clientStepIndex:r.state.crossDeviceInitialClientStep,enterpriseFeatures:f}})),j()(V()(r),"onFlowChange",(function(e,t,n,o){var i=o.userStepIndex,a=o.clientStepIndex;"crossDeviceSteps"===e&&r.setState({crossDeviceInitialStep:i,crossDeviceInitialClientStep:a})})),j()(V()(r),"renderUnsupportedBrowserError",(function(){var e=r.props.options.steps,t=e&&Le()(e).call(e,bc),n=r.props.hasCamera;return Ce.j||n||!t?null:Object(I.h)(kc,{disableNavigation:!0,error:{name:Object(Ce.i)()}})})),j()(V()(r),"render",(function(e){return r.renderUnsupportedBrowserError()||Object(I.h)(Oc,F()({},e,{steps:e.options.steps,onFlowChange:r.onFlowChange,mobileConfig:r.generateMobileConfig(e.actions)}))})),r.state={crossDeviceInitialStep:null},r}return n}(I.Component),Oc=function(e){K()(n,e);var t=gc(n);function n(e){var r;z()(this,n),r=t.call(this,e),j()(V()(r),"onHistoryChange",(function(e){var t=e.state;r.setState(yc({},t))})),j()(V()(r),"getStepType",(function(e){var t=r.getComponentsList();return t[e]?t[e].step.type:null})),j()(V()(r),"disableNavigation",(function(){return r.props.isNavigationDisabled||r.initialStep()||"complete"===r.getStepType(r.state.step)})),j()(V()(r),"initialStep",(function(){return r.state.initialStep===r.state.step&&"captureSteps"===r.state.flow})),j()(V()(r),"changeFlowTo",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.state,i=o.flow,a=o.step;if(i!==e){var s=r.getComponentsList()[a];r.props.onFlowChange(e,t,i,{userStepIndex:a,clientStepIndex:s.stepIndex,clientStep:s}),r.setStepIndex(t,e,n)}})),j()(V()(r),"nextStep",(function(){var e=r.state.step+1;r.getComponentsList().length===e?r.triggerOnComplete():r.setStepIndex(e)})),j()(V()(r),"triggerOnComplete",(function(){var e,t=r.props.captures,n=ze()(e=_()(t)).call(e,(function(e,n){return yc(yc({},e),{},j()({},n,t[n].metadata))}),{});r.props.options.events.emit("complete",n)})),j()(V()(r),"formattedError",(function(e,t){if("string"==typeof e){var n;try{var r=JSON.parse(e);n=r.unauthorized||r.error||e}catch(t){n=e}return{type:w()(n).call(n,"expired")?"expired_token":"exception",message:n}}var o=e.error||{};return{type:401===t&&"expired_token"===o.type?"expired_token":"exception",message:o.message||e.reason}})),j()(V()(r),"triggerOnError",(function(e){var t,n=e.status,o=e.response;if(0!==n){var i=r.formattedError(o,n),a=i.type,s=i.message;r.props.options.events.emit("error",{type:a,message:s}),Nn(Fe()(t="".concat(a," - ")).call(t,s))}})),j()(V()(r),"previousStep",(function(){var e=r.state.step;r.setStepIndex(e-1)})),j()(V()(r),"back",(function(){r.history.goBack()})),j()(V()(r),"setStepIndex",(function(e,t,n){var o=r.state.flow,i={step:e,flow:t||o};if(n)r.setState(i);else{var a,s,c=Fe()(a=Fe()(s="".concat(location.pathname)).call(s,location.search)).call(a,location.hash);r.history.push(c,i)}})),j()(V()(r),"getComponentsList",(function(){return r.buildComponentsList(r.state,r.props)})),j()(V()(r),"buildComponentsList",(function(e,t){var n=e.flow,r=t.documentType,o=t.poaDocumentType,i=t.steps,a=t.deviceHasCameraSupport,s=t.options.mobileFlow;return Qs({flow:n,documentType:r,poaDocumentType:o,steps:i,mobileFlow:s,deviceHasCameraSupport:a})})),j()(V()(r),"render",(function(e){return Object(I.h)(pc,F()({},e,{componentsList:r.getComponentsList(),step:r.state.step,disableNavigation:r.disableNavigation(),changeFlowTo:r.changeFlowTo,nextStep:r.nextStep,previousStep:r.previousStep,triggerOnError:r.triggerOnError,back:r.back}))}));var o,i,a=r.buildComponentsList({flow:"captureSteps"},r.props),s="client"===r.props.stepIndexType?(o=a,i=r.props.step||0,Re()(o).call(o,(function(e){return e.stepIndex===i}))):r.props.step||0;return r.state={flow:"captureSteps",step:s,initialStep:s},r.history=r.props.options.useMemoryHistory?Object(He.createMemoryHistory)():Object(He.createBrowserHistory)(),r.unlisten=r.history.listen(r.onHistoryChange),r.setStepIndex(r.state.step,r.state.flow),r}return W()(n,[{key:"componentWillUnmount",value:function(){this.unlisten()}}]),n}(I.Component);Oc.defaultProps={onFlowChange:function(){},stepIndexType:"user"};var Cc=Object(Qe.a)((function(e){return function(t){K()(r,t);var n=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(r);function r(){var e,t;z()(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,Fe()(e=[this]).call(e,i)),j()(V()(t),"state",{hasCamera:null}),j()(V()(t),"checkCameraSupport",(function(){return Object(Ce.b)((function(e){t.props.actions.setDeviceHasCameraSupport(e),t.setState({hasCamera:e})}))})),t}return W()(r,[{key:"componentDidMount",value:function(){Object(Ce.l)()||(this.cameraCheckerIntervalId=$o()(this.checkCameraSupport,2e3)),this.checkCameraSupport()}},{key:"componentWillUnmount",value:function(){this.cameraCheckerIntervalId&&clearInterval(this.cameraCheckerIntervalId)}},{key:"render",value:function(){return null===this.state.hasCamera?null:Object(I.h)(e,F()({},this.props,{hasCamera:this.state.hasCamera}))}}]),r}(ae.PureComponent)}))((function(e){var t=e.options.mobileFlow?wc:Sc;return Object(I.h)(t,F()({},e,{allowCrossDeviceFlow:!e.options.mobileFlow&&Ce.j}))}));function xc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ec(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=xc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=xc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var jc={},Ac=function(e){return rn(e).join("_")},Pc=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return O()(e=_()(t)).call(e,(function(e){return t[e].id===n}))};function Tc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dc(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Tc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Tc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Ic={documentType:null,poaDocumentType:null,roomId:null,socket:null,sms:{number:null,valid:!1},clientSuccess:!1,termsAccepted:!1,isNavigationDisabled:!1,isFullScreen:!1,deviceHasCameraSupport:!1,hideOnfidoLogo:!0,cobrand:null,urls:{onfido_api_url:"".concat("https://api.onfido.com"),telephony_url:"".concat("https://telephony.onfido.com"),hosted_sdk_url:"".concat("https://id.onfido.com"),detect_document_url:"".concat("https://sdk.onfido.com"),sync_url:"".concat("https://sync.onfido.com")}};var Nc=Object(Z.combineReducers)({captures:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jc,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.payload,r=void 0===n?{}:n,o=t.type,i=r.captureId?Pc(e,r.captureId):Ac([r.method,r.side]);switch(o){case"CAPTURE_CREATE":return Ec(Ec({},e),{},j()({},i,r));case"CAPTURE_DELETE":return Object(Ve.e)(e,[i]);case"SET_CAPTURE_METADATA":return Ec(Ec({},e),{},j()({},i,Ec(Ec({},e[i]),{},{metadata:r.metadata})));default:return e}},globals:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ic,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ID_DOCUMENT_TYPE":return Dc(Dc({},e),{},{documentType:t.payload,poaDocumentType:null});case"SET_POA_DOCUMENT_TYPE":return Dc(Dc({},e),{},{poaDocumentType:t.payload});case"SET_ROOM_ID":return Dc(Dc({},e),{},{roomId:t.payload});case"SET_SOCKET":return Dc(Dc({},e),{},{socket:t.payload});case"SET_MOBILE_NUMBER":return Dc(Dc({},e),{},{sms:t.payload});case"SET_CLIENT_SUCCESS":return Dc(Dc({},e),{},{clientSuccess:t.payload});case"MOBILE_CONNECTED":return Dc(Dc({},e),{},{mobileConnected:t.payload});case"ACCEPT_TERMS":return Dc(Dc({},e),{},{termsAccepted:!0});case"SET_NAVIGATION_DISABLED":return Dc(Dc({},e),{},{isNavigationDisabled:!!t.payload});case"SET_FULL_SCREEN":return Dc(Dc({},e),{},{isFullScreen:!!t.payload});case"SET_DEVICE_HAS_CAMERA_SUPPORT":return Dc(Dc({},e),{},{deviceHasCameraSupport:!!t.payload});case"SET_URLS":return Dc(Dc({},e),{},{urls:Dc(Dc({},e.urls),t.payload)});case"HIDE_ONFIDO_LOGO":return Dc(Dc({},e),{},{hideOnfidoLogo:t.payload});case"SHOW_COBRANDING":return Dc(Dc({},e),{},{cobrand:t.payload});default:return e}}}),Rc=function(e,t){return"RESET_STORE"===t.type?Nc({},{}):Nc(e,t)};var Mc=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(e){var r;return z()(this,n),(r=t.call(this,e)).store=Object(Z.createStore)(Rc,window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__():void 0),r}return W()(n,[{key:"render",value:function(){return Object(I.h)(X.Provider,{store:this.store},this.props.children)}}]),n}(I.Component);function Lc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bc(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Lc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Lc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Fc=function(e){return{type:"CAPTURE_CREATE",payload:e}},Uc=function(){return{type:"CAPTURE_DELETE"}},zc=function(e){var t=e.capture,n=e.apiResponse;return{type:"SET_CAPTURE_METADATA",payload:{captureId:t.id,metadata:Object(Ve.f)(Bc(Bc({},Object(Ve.g)(n,["id","side","type"])),{},{variant:"face"===t.method&&t.variant}),(function(e,t){return!t}))}}};function qc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wc(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=qc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=qc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Hc=Wc(Wc(Wc({},r),o),{},{reset:function(e){return{type:"RESET_STORE",payload:e}}});function Vc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Vc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Vc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Kc=function(e){K()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!L.a)return!1;if(L.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(L()(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=J()(e);if(t()){var o=J()(this).constructor;n=L()(r,arguments,o)}else n=r.apply(this,arguments);return $()(this,n)}}(n);function n(e){var r;return z()(this,n),r=t.call(this,e),j()(V()(r),"jwtValidation",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.token!==t.token)try{Ge(t.token)}catch(e){r.onInvalidJWT("Invalid token")}})),j()(V()(r),"onInvalidJWT",(function(e){r.events.emit("error",{type:"exception",message:e})})),j()(V()(r),"onInvalidEnterpriseFeatureException",(function(e){var t="EnterpriseFeatureNotEnabledException: Enterprise feature ".concat(e," not enabled for this account.");r.events.emit("error",{type:"exception",message:t}),Nn(t)})),j()(V()(r),"trackOnComplete",(function(){return An("completed flow")})),j()(V()(r),"bindEvents",(function(e,t){r.events.on("complete",e),r.events.on("error",t)})),j()(V()(r),"rebindEvents",(function(e,t){r.events.off("complete",e.onComplete),r.events.off("error",e.onError),r.bindEvents(t.onComplete,t.onError)})),j()(V()(r),"prepareInitialStore",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.userDetails,o=(n=void 0===n?{}:n).smsNumber,i=t.steps,a=t.token,s=e.userDetails,c=(s=void 0===s?{}:s).smsNumber,u=e.steps,l=e.token;if(o&&o!==c&&r.props.actions.setMobileNumber(o),i&&i!==u){var f=Xs(i);1===f.length&&r.props.actions.setIdDocumentType(f[0])}if(a&&a!==l){var p=!t.mobileFlow;p&&r.setUrls(a);var d=Ke(a);r.setConfiguredEnterpriseFeatures(d,t)}})),j()(V()(r),"setConfiguredEnterpriseFeatures",(function(e,t){var n,o,i=null===(n=t.enterpriseFeatures)||void 0===n?void 0:n.hideOnfidoLogo;i?r.hideDefaultLogoIfClientHasFeature(e.hideOnfidoLogo):t.mobileFlow||r.props.actions.hideOnfidoLogo(!1);var a=null===(o=t.enterpriseFeatures)||void 0===o?void 0:o.cobrand;!i&&a&&r.displayCobrandIfClientHasFeature(e.cobrand,a)})),j()(V()(r),"setUrls",(function(e){var t=function(e){var t={};try{t=Ge(e).urls}catch(e){console.error("Invalid token:",e.message)}return t}(e);t&&r.props.actions.setUrls(t)})),j()(V()(r),"hideDefaultLogoIfClientHasFeature",(function(e){e?r.props.actions.hideOnfidoLogo(!0):(r.props.actions.hideOnfidoLogo(!1),r.onInvalidEnterpriseFeatureException("hideOnfidoLogo"))})),j()(V()(r),"displayCobrandIfClientHasFeature",(function(e,t){e?r.props.actions.showCobranding(t):r.onInvalidEnterpriseFeatureException("cobrand")})),j()(V()(r),"render",(function(e){var t=e.options,n=t.useModal,o=t.isModalOpen,i=t.onModalRequestClose,a=t.containerId,s=t.containerEl,c=t.shouldCloseOnOverlayClick,u=P()(t,["useModal","isModalOpen","onModalRequestClose","containerId","containerEl","shouldCloseOnOverlayClick"]),l=P()(e,["options"]);return Object(I.h)(xe.a,{language:r.props.options.language},Object(I.h)(Ie,{useModal:n,isOpen:o,onRequestClose:i,containerId:a,containerEl:s,shouldCloseOnOverlayClick:c},Object(I.h)(Cc,F()({options:Gc(Gc({},u),{},{events:r.events})},l))))})),r.events=new te.a,r.events.on("complete",r.trackOnComplete),e.options.disableAnalytics||(xn.init(),xn.config({domain:"onfido-js-sdk.com",cookie_name:"onfido-js-sdk-woopra",cookie_domain:location.hostname,referer:location.href}),xn.identify(Sn.match(/^(id|id-dev)\.onfido\.com$/)?{sdk_version:"5.13.0"}:{sdk_version:"5.13.0",client:Sn}),On=new en({dsn:"https://6e3dc0335efc49889187ec90288a84fd@sentry.io/109946",environment:"production",release:"5.13.0",debug:!0,autoBreadcrumbs:{console:!1},whitelistUrls:[/onfido[A-z.]*\.min.js/g],beforeBreadcrumb:function(e){var t,n="xhr"===e.category&&function(e,t){return!!e.match(t)}(e.data.url,/^https:\/\/[A-Za-z0-9.]*\.?onfido\.com$/g),r="ui.click"===e.category&&w()(t=e.message).call(t,".onfido-sdk-ui");return!(!n&&!r)&&e},shouldSendCallback:function(){return!0}}),(Cn=new xt.a(On)).addBreadcrumb({level:"info"}),wn=!0),r.bindEvents(e.options.onComplete,e.options.onError),r}return W()(n,[{key:"componentDidMount",value:function(){this.prepareInitialStore({},this.props.options)}},{key:"componentDidUpdate",value:function(e){this.jwtValidation(e.options,this.props.options),this.prepareInitialStore(e.options,this.props.options),this.rebindEvents(e.options,this.props.options)}},{key:"componentWillUnmount",value:function(){this.props.socket&&this.props.socket.close(),this.events.removeAllListeners("complete","error"),On&&On.close(2e3).then((function(){On=null,Cn=null,process.exit()})),jn()}}]),n}(I.Component),Qc=Object(X.connect)((function(e){return Gc(Gc({},e.globals),{},{captures:e.captures})}),(function(e){return{actions:Object(Z.bindActionCreators)(Hc,e)}}))(Kc),$c=function(e){var t=e.options;return Object(I.h)(Mc,{options:t},Object(I.h)(Qc,{options:t}))};function Yc(e,t){var n=_()(e);if(g.a){var r=g()(e);t&&(r=m()(r).call(r,(function(t){return h()(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jc(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)p()(n=Yc(Object(r),!0)).call(n,(function(t){j()(e,t,r[t])}));else if(l.a)c()(e,l()(r));else{var o;p()(o=Yc(Object(r))).call(o,(function(t){a()(e,t,h()(r,t))}))}}return e}var Xc=function(e,t,n){return Object(I.render)(Object(I.h)($c,{options:e}),t,n)},Zc={token:void 0,containerId:"onfido-mount",onComplete:Qe.d,onError:Qe.d},eu=function(e){return t=e,"object"===D()(t)?e:{type:e};var t},tu=function(e){var t,n=e.steps,r=e.smsNumberCountryCode;return Jc(Jc({},P()(e,["steps","smsNumberCountryCode"])),{},{smsNumberCountryCode:nu(r),steps:x()(t=n||["welcome","document","face","complete"]).call(t,eu)})},nu=function(e){if(!e)return"GB";var t=yn(e);return function(e){var t=Object(N.getCountryCodes)(R),n=w()(t).call(t,e);return n||console.warn("`smsNumberCountryCode` must be a valid two-characters ISO Country Code. 'GB' will be used instead."),n}(t)?t:"GB"},ru=function(e){var t,n=document.getElementById(e);if((t=n)!==document.body&&document.body.contains(t))return n;throw new Error("Element ID ".concat(e," does not exist in current page body"))},ou=function(e){console.log("onfido_sdk_version","5.13.0");var t,n,r,o=tu(Jc(Jc({},Zc),e));return t=o.steps,(n=O()(t).call(t,(function(e){return"document"===e.type})))&&n.options&&n.options.useWebcam&&console.warn("`useWebcam` is an experimental option and is currently discouraged"),n&&n.options&&n.options.useLiveDocumentCapture&&console.warn("`useLiveDocumentCapture` is a beta feature and is still subject to ongoing changes"),o.containerEl?r=o.containerEl:o.containerId&&(r=ru(o.containerId)),{options:o,element:Xc(o,r),setOptions:function(e){return this.options=tu(Jc(Jc({},this.options),e)),this.options.containerEl!==e.containerEl&&e.containerEl?r=e.containerEl:this.containerId!==e.containerId&&e.containerId&&(r=ru(e.containerId)),this.element=Xc(this.options,r,this.element),this.options},tearDown:function(){Object(I.render)(null,r,this.element)}}}},,,,,,function(e,t,n){"use strict";(function(e){n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return h}));n(28);var r=n(66),o=n(443),i=n(50),a=n(155);function s(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function c(e){if(Object(r.d)(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}if(Object(r.f)(e)){var a=e,s={};s.type=a.type;try{s.target=Object(r.c)(a.target)?Object(i.g)(a.target):Object.prototype.toString.call(a.target)}catch(e){s.target="<unknown>"}try{s.currentTarget=Object(r.c)(a.currentTarget)?Object(i.g)(a.currentTarget):Object.prototype.toString.call(a.currentTarget)}catch(e){s.currentTarget="<unknown>"}for(var o in"undefined"!=typeof CustomEvent&&Object(r.g)(e,CustomEvent)&&(s.detail=a.detail),a)Object.prototype.hasOwnProperty.call(a,o)&&(s[o]=a);return s}return e}function u(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function l(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=d(e,t);return u(r)>n?l(e,t-1,n):r}function f(t,n){return"domain"===n&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===n?"[DomainEmitter]":void 0!==e&&t===e?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":Object(r.l)(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+Object(i.e)(t)+"]":t}function p(e,t,n,i){if(void 0===n&&(n=1/0),void 0===i&&(i=new o.a),0===n)return function(e){var t=Object.prototype.toString.call(e);if("string"==typeof e)return e;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=f(e);return Object(r.i)(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var a=f(t,e);if(Object(r.i)(a))return a;var s=c(t),u=Array.isArray(t)?[]:{};if(i.memoize(t))return"[Circular ~]";for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(u[l]=p(l,s[l],n-1,i));return i.unmemoize(t),u}function d(e,t){try{return JSON.parse(JSON.stringify(e,(function(e,n){return p(e,n,t)})))}catch(e){return"**non-serializable**"}}function h(e,t){void 0===t&&(t=40);var n=Object.keys(c(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Object(a.b)(n[0],t);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:Object(a.b)(o,t)}return""}}).call(this,n(95))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return l}));var r=n(28),o=n(50),i=n(304),a=n(305),s=function(){function e(e,t,n){void 0===t&&(t=new a.a),void 0===n&&(n=3),this._version=n,this._stack=[],this._stack.push({client:e,scope:t})}return e.prototype._invokeClient=function(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var i=this.getStackTop();i&&i.client&&i.client[e]&&(t=i.client)[e].apply(t,r.d(n,[i.scope]))},e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e},e.prototype.pushScope=function(){var e=this.getStack(),t=e.length>0?e[e.length-1].scope:void 0,n=a.a.clone(t);return this.getStack().push({client:this.getClient(),scope:n}),n},e.prototype.popScope=function(){return void 0!==this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=Object(o.k)(),i=t;if(!t){var a=void 0;try{throw new Error("Sentry syntheticException")}catch(e){a=e}i={originalException:e,syntheticException:a}}return this._invokeClient("captureException",e,r.a({},i,{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var i=this._lastEventId=Object(o.k)(),a=n;if(!n){var s=void 0;try{throw new Error(e)}catch(e){s=e}a={originalException:e,syntheticException:s}}return this._invokeClient("captureMessage",e,t,r.a({},a,{event_id:i})),i},e.prototype.captureEvent=function(e,t){var n=this._lastEventId=Object(o.k)();return this._invokeClient("captureEvent",e,r.a({},t,{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop();if(n.scope&&n.client){var i=n.client.getOptions&&n.client.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,c=i.maxBreadcrumbs,u=void 0===c?100:c;if(!(u<=0)){var l=Object(o.j)(),f=r.a({timestamp:l},e),p=s?Object(o.c)((function(){return s(f,t)})):f;null!==p&&n.scope.addBreadcrumb(p,Math.min(u,100))}}},e.prototype.setUser=function(e){var t=this.getStackTop();t.scope&&t.scope.setUser(e)},e.prototype.setTags=function(e){var t=this.getStackTop();t.scope&&t.scope.setTags(e)},e.prototype.setExtras=function(e){var t=this.getStackTop();t.scope&&t.scope.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop();t.scope&&t.client&&e(t.scope)},e.prototype.run=function(e){var t=u(this);try{e(this)}finally{u(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return i.a.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e,t){return void 0===t&&(t=!1),this._callExtensionMethod("startSpan",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=c(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[e])return o.extensions[e].apply(this,t);i.a.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function c(){var e=Object(o.f)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function u(e){var t=c(),n=p(t);return d(t,e),n}function l(){var t=c();return f(t)&&!p(t).isOlderThan(3)||d(t,new s),Object(o.h)()?function(t){try{var n=Object(o.d)(e,"domain").active;if(!n)return p(t);if(!f(n)||p(n).isOlderThan(3)){var r=p(t).getStackTop();d(n,new s(r.client,a.a.clone(r.scope)))}return p(n)}catch(e){return p(t)}}(t):p(t)}function f(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function p(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new s),e.__SENTRY__.hub}function d(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}}).call(this,n(412)(e))}])}));
//# sourceMappingURL=onfido.min.js.map
|
import React from "react"
import { Link } from "gatsby"
import {
BaseLayout,
TitleBar,
NavContainer,
Navbar,
LinkList,
Item,
Footer,
} from "../../styles/styles"
export default ({ children }) => (
<BaseLayout>
<div>
<NavContainer>
<Navbar>
<Link style={{ textDecoration: "none" }} to="/">
<TitleBar>Vinicius Costa</TitleBar>
</Link>
<LinkList>
<Link to="/about">
<Item>About</Item>
</Link>
<Link to="/posts">
<Item>Posts</Item>
</Link>
<Link to="/contact">
<Item>Contact</Item>
</Link>
</LinkList>
</Navbar>
</NavContainer>
{children}
</div>
<Footer>
<LinkList>
<a href="https://tinyletter.com/viniciuscosta">
<Item>Newsletter</Item>
</a>
<a href="/rss.xml">
<Item>RSS</Item>
</a>
</LinkList>
</Footer>
</BaseLayout>
)
|
/**
* @param {number[]} prices
* @return {number}
*/
var maxProfit = function(prices) {
let minprice = Infinity;
let maxprofit = 0;
for (let i = 0; i < prices.length; i++) {
if (prices[i] < minprice) minprice = prices[i];
else if (prices[i] - minprice > maxprofit) maxprofit = prices[i] - minprice;
}
return maxprofit;
};
|
const handler = require('@projecttacoma/fhir-response-util');
/**
* @function search
* @param {Function} service
* @return Promise
*/
module.exports.search = function search(service) {
return (req, res, next) => {
return service
.search(req.sanitized_args, { req })
.then((bundle) => handler.read(req, res, bundle))
.catch(next);
};
};
/**
* @function searchById
* @param {Function} service
* @return Promise
*/
module.exports.searchById = function searchById(service) {
return (req, res, next) => {
return service
.searchById(req.sanitized_args, { req })
.then((resource) => handler.readOne(req, res, resource))
.catch(next);
};
};
/**
* @function searchByVersionId
* @param {Function} service
* @return Promise
*/
module.exports.searchByVersionId = function searchByVersionId(service) {
return (req, res, next) => {
return service
.searchByVersionId(req.sanitized_args, { req })
.then((resource) => handler.readOne(req, res, resource))
.catch(next);
};
};
/**
* @function create
* @param {Function} service
* @return Promise
*/
module.exports.create = function create(service) {
let options = { type: 'ImagingStudy' };
return (req, res, next) => {
return service
.create(req.sanitized_args, { req })
.then((json) => handler.create(req, res, json, options))
.catch(next);
};
};
/**
* @function update
* @param {Function} service
* @return Promise
*/
module.exports.update = function update(service) {
let options = { type: 'ImagingStudy' };
return (req, res, next) => {
return service
.update(req.sanitized_args, { req })
.then((json) => handler.update(req, res, json, options))
.catch(next);
};
};
/**
* @function remove
* @param {Function} service
* @return Promise
*/
module.exports.remove = function remove(service) {
return (req, res, next) => {
return service
.remove(req.sanitized_args, { req })
.then((json) => handler.remove(req, res, json))
.catch(next);
};
};
/**
* @function patch
* @param {Function} service
* @return Promise
*/
module.exports.patch = function patch(service) {
let options = { type: 'ImagingStudy' };
return (req, res, next) => {
return service
.patch(req.sanitized_args, { req })
.then((json) => handler.update(req, res, json, options))
.catch(next);
};
};
/**
* @function history
* @param {Function} service
* @return Promise
*/
module.exports.history = function history(service) {
return (req, res, next) => {
return service
.history(req.sanitized_args, { req })
.then((bundle) => handler.history(req, res, bundle))
.catch(next);
};
};
/**
* @function historyById
* @param {Function} service
* @return Promise
*/
module.exports.historyById = function historyById(service) {
return (req, res, next) => {
return service
.historyById(req.sanitized_args, { req })
.then((bundle) => handler.history(req, res, bundle))
.catch(next);
};
};
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.glob = exports.rmdir = exports.writeFile = exports.readFile = exports.mkdtemp = exports.mkdir = exports.unlink = exports.rename = exports.exists = void 0;
const util_1 = require("util");
const fs = require("fs");
const globOrig = require("glob");
exports.exists = util_1.promisify(fs.exists);
exports.rename = util_1.promisify(fs.rename);
exports.unlink = util_1.promisify(fs.unlink);
exports.mkdir = util_1.promisify(fs.mkdir);
exports.mkdtemp = util_1.promisify(fs.mkdtemp);
exports.readFile = util_1.promisify(fs.readFile);
exports.writeFile = util_1.promisify(fs.writeFile);
exports.rmdir = util_1.promisify(fs.rmdir);
exports.glob = util_1.promisify(globOrig);
//# sourceMappingURL=promisified-fs-glob.js.map
|
// flowchart.js, v1.16.0
// Copyright (c)2021 Adriano Raiano (adrai).
// Distributed under MIT license
// http://adrai.github.io/flowchart.js
!function(root, factory) {
if ("object" == typeof exports && "object" == typeof module) module.exports = factory(require("Raphael")); else if ("function" == typeof define && define.amd) define([ "Raphael" ], factory); else {
var a = factory("object" == typeof exports ? require("Raphael") : root.Raphael);
for (var i in a) ("object" == typeof exports ? exports : root)[i] = a[i];
}
}(this, function(__WEBPACK_EXTERNAL_MODULE_16__) {
/******/
return function(modules) {
/******/
/******/
// 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: !1
};
/******/
/******/
// Return the exports of the module
/******/
/******/
/******/
// Execute the module function
/******/
/******/
/******/
// Flag the module as loaded
/******/
return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__),
module.loaded = !0, module.exports;
}
// webpackBootstrap
/******/
// The module cache
/******/
var installedModules = {};
/******/
/******/
// Load entry module and return exports
/******/
/******/
/******/
/******/
// expose the modules object (__webpack_modules__)
/******/
/******/
/******/
// expose the module cache
/******/
/******/
/******/
// __webpack_public_path__
/******/
return __webpack_require__.m = modules, __webpack_require__.c = installedModules,
__webpack_require__.p = "", __webpack_require__(0);
}([ /* 0 */
/*!******************!*\
!*** ./index.js ***!
\******************/
/***/
function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./src/flowchart.shim */ 9);
var parse = __webpack_require__(/*! ./src/flowchart.parse */ 4);
__webpack_require__(/*! ./src/jquery-plugin */ 15);
var FlowChart = {
parse: parse
};
"undefined" != typeof window && (window.flowchart = FlowChart), module.exports = FlowChart;
}, /* 1 */
/*!**********************************!*\
!*** ./src/flowchart.helpers.js ***!
\**********************************/
/***/
function(module, exports) {
function _defaults(options, defaultOptions) {
if (!options || "function" == typeof options) return defaultOptions;
var merged = {};
for (var attrname in defaultOptions) merged[attrname] = defaultOptions[attrname];
for (attrname in options) options[attrname] && ("object" == typeof merged[attrname] ? merged[attrname] = _defaults(merged[attrname], options[attrname]) : merged[attrname] = options[attrname]);
return merged;
}
function _inherits(ctor, superCtor) {
if ("function" == typeof Object.create) // implementation from standard node.js 'util' module
ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: !1,
writable: !0,
configurable: !0
}
}); else {
// old school shim for old browsers
ctor.super_ = superCtor;
var TempCtor = function() {};
TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor(), ctor.prototype.constructor = ctor;
}
}
// move dependent functions to a container so that
// they can be overriden easier in no jquery environment (node.js)
module.exports = {
defaults: _defaults,
inherits: _inherits
};
}, /* 2 */
/*!*********************************!*\
!*** ./src/flowchart.symbol.js ***!
\*********************************/
/***/
function(module, exports, __webpack_require__) {
function Symbol(chart, options, symbol) {
this.chart = chart, this.group = this.chart.paper.set(), this.symbol = symbol, this.connectedTo = [],
this.symbolType = options.symbolType, this.flowstate = options.flowstate || "future",
this.lineStyle = options.lineStyle || {}, this.key = options.key || "", this.leftLines = [],
this.rightLines = [], this.topLines = [], this.bottomLines = [], this.params = options.params,
this.next_direction = options.next && options.direction_next ? options.direction_next : void 0,
this.text = this.chart.paper.text(0, 0, options.text), //Raphael does not support the svg group tag so setting the text node id to the symbol node id plus t
options.key && (this.text.node.id = options.key + "t"), this.text.node.setAttribute("class", this.getAttr("class") + "t"),
this.text.attr({
"text-anchor": "start",
x: this.getAttr("text-margin"),
fill: this.getAttr("font-color"),
"font-size": this.getAttr("font-size")
});
var font = this.getAttr("font"), fontF = this.getAttr("font-family"), fontW = this.getAttr("font-weight");
font && this.text.attr({
font: font
}), fontF && this.text.attr({
"font-family": fontF
}), fontW && this.text.attr({
"font-weight": fontW
}), options.link && this.text.attr("href", options.link), //ndrqu Add click function with event and options params
options.function && (this.text.attr({
cursor: "pointer"
}), this.text.node.addEventListener("click", function(evt) {
window[options.function](evt, options);
}, !1)), options.target && this.text.attr("target", options.target);
var maxWidth = this.getAttr("maxWidth");
if (maxWidth) {
for (var words = options.text.split(" "), tempText = "", i = 0, ii = words.length; i < ii; i++) {
var word = words[i];
this.text.attr("text", tempText + " " + word), tempText += this.text.getBBox().width > maxWidth ? "\n" + word : " " + word;
}
this.text.attr("text", tempText.substring(1));
}
if (this.group.push(this.text), symbol) {
var tmpMargin = this.getAttr("text-margin");
symbol.attr({
fill: this.getAttr("fill"),
stroke: this.getAttr("element-color"),
"stroke-width": this.getAttr("line-width"),
width: this.text.getBBox().width + 2 * tmpMargin,
height: this.text.getBBox().height + 2 * tmpMargin
}), symbol.node.setAttribute("class", this.getAttr("class")), options.link && symbol.attr("href", options.link),
options.target && symbol.attr("target", options.target), //ndrqu Add click function with event and options params
options.function && (symbol.node.addEventListener("click", function(evt) {
window[options.function](evt, options);
}, !1), symbol.attr({
cursor: "pointer"
})), options.key && (symbol.node.id = options.key), this.group.push(symbol), symbol.insertBefore(this.text),
this.text.attr({
y: symbol.getBBox().height / 2
}), this.initialize();
}
}
var drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawLine = drawAPI.drawLine, checkLineIntersection = drawAPI.checkLineIntersection;
/* Gets the attribute based on Flowstate, Symbol-Name and default, first found wins */
Symbol.prototype.getAttr = function(attName) {
if (this.chart) {
var opt1, opt3 = this.chart.options ? this.chart.options[attName] : void 0, opt2 = this.chart.options.symbols ? this.chart.options.symbols[this.symbolType][attName] : void 0;
return this.chart.options.flowstate && this.chart.options.flowstate[this.flowstate] && (opt1 = this.chart.options.flowstate[this.flowstate][attName]),
opt1 || opt2 || opt3;
}
}, Symbol.prototype.initialize = function() {
this.group.transform("t" + this.getAttr("line-width") + "," + this.getAttr("line-width")),
this.width = this.group.getBBox().width, this.height = this.group.getBBox().height;
}, Symbol.prototype.getCenter = function() {
return {
x: this.getX() + this.width / 2,
y: this.getY() + this.height / 2
};
}, Symbol.prototype.getX = function() {
return this.group.getBBox().x;
}, Symbol.prototype.getY = function() {
return this.group.getBBox().y;
}, Symbol.prototype.shiftX = function(x) {
this.group.transform("t" + (this.getX() + x) + "," + this.getY());
}, Symbol.prototype.setX = function(x) {
this.group.transform("t" + x + "," + this.getY());
}, Symbol.prototype.shiftY = function(y) {
this.group.transform("t" + this.getX() + "," + (this.getY() + y));
}, Symbol.prototype.setY = function(y) {
this.group.transform("t" + this.getX() + "," + y);
}, Symbol.prototype.getTop = function() {
var y = this.getY(), x = this.getX() + this.width / 2;
return {
x: x,
y: y
};
}, Symbol.prototype.getBottom = function() {
var y = this.getY() + this.height, x = this.getX() + this.width / 2;
return {
x: x,
y: y
};
}, Symbol.prototype.getLeft = function() {
var y = this.getY() + this.group.getBBox().height / 2, x = this.getX();
return {
x: x,
y: y
};
}, Symbol.prototype.getRight = function() {
var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.group.getBBox().width;
return {
x: x,
y: y
};
}, Symbol.prototype.render = function() {
if (this.next) {
var self = this, lineLength = this.getAttr("line-length");
if ("right" === this.next_direction) {
var rightPoint = this.getRight();
this.next.isPositioned || (this.next.setY(rightPoint.y - this.next.height / 2),
this.next.shiftX(this.group.getBBox().x + this.width + lineLength), function shift() {
for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) {
symb = self.chart.symbols[i];
var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);
if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width / 2) {
hasSymbolUnder = !0;
break;
}
}
if (hasSymbolUnder) {
if ("end" === self.next.symbolType) return;
self.next.setX(symb.getX() + symb.width + lineLength), shift();
}
}(), this.next.isPositioned = !0, this.next.render());
} else if ("left" === this.next_direction) {
var leftPoint = this.getLeft();
this.next.isPositioned || (this.next.setY(leftPoint.y - this.next.height / 2), this.next.shiftX(-(this.group.getBBox().x + this.width + lineLength)),
function shift() {
for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) {
symb = self.chart.symbols[i];
var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);
if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width / 2) {
hasSymbolUnder = !0;
break;
}
}
if (hasSymbolUnder) {
if ("end" === self.next.symbolType) return;
self.next.setX(symb.getX() + symb.width + lineLength), shift();
}
}(), this.next.isPositioned = !0, this.next.render());
} else {
var bottomPoint = this.getBottom();
this.next.isPositioned || (this.next.shiftY(this.getY() + this.height + lineLength),
this.next.setX(bottomPoint.x - this.next.width / 2), this.next.isPositioned = !0,
this.next.render());
}
}
}, Symbol.prototype.renderLines = function() {
this.next && (this.next_direction ? this.drawLineTo(this.next, this.getAttr("arrow-text") || "", this.next_direction) : this.drawLineTo(this.next, this.getAttr("arrow-text") || ""));
}, Symbol.prototype.drawLineTo = function(symbol, text, origin) {
this.connectedTo.indexOf(symbol) < 0 && this.connectedTo.push(symbol);
var line, yOffset, x = this.getCenter().x, y = this.getCenter().y, right = this.getRight(), bottom = this.getBottom(), top = this.getTop(), left = this.getLeft(), symbolX = symbol.getCenter().x, symbolY = symbol.getCenter().y, symbolTop = symbol.getTop(), symbolRight = symbol.getRight(), symbolLeft = symbol.getLeft(), isOnSameColumn = x === symbolX, isOnSameLine = y === symbolY, isUnder = y < symbolY, isUpper = y > symbolY || this === symbol, isLeft = x > symbolX, isRight = x < symbolX, maxX = 0, lineLength = this.getAttr("line-length"), lineWith = this.getAttr("line-width");
if (origin && "bottom" !== origin || !isOnSameColumn || !isUnder) if (origin && "right" !== origin || !isOnSameLine || !isRight) if (origin && "left" !== origin || !isOnSameLine || !isLeft) if (origin && "right" !== origin || !isOnSameColumn || !isUpper) if (origin && "right" !== origin || !isOnSameColumn || !isUnder) if (origin && "bottom" !== origin || !isLeft) if (origin && "bottom" !== origin || !isRight || !isUnder) if (origin && "bottom" !== origin || !isRight) if (origin && "right" === origin && isLeft) yOffset = 10 * Math.max(symbol.topLines.length, this.rightLines.length),
line = drawLine(this.chart, right, [ {
x: right.x + lineLength / 2,
y: right.y
}, {
x: right.x + lineLength / 2,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.rightLines.push(line), symbol.topLines.push(line), this.rightStart = !0,
symbol.topEnd = !0, maxX = right.x + lineLength / 2; else if (origin && "right" === origin && isRight) yOffset = 10 * Math.max(symbol.topLines.length, this.rightLines.length),
line = drawLine(this.chart, right, [ {
x: symbolTop.x,
y: right.y - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - yOffset
} ], text), this.rightLines.push(line), symbol.topLines.push(line), this.rightStart = !0,
symbol.topEnd = !0, maxX = right.x + lineLength / 2; else if (origin && "bottom" === origin && isOnSameColumn && isUpper) yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length),
line = drawLine(this.chart, bottom, [ {
x: bottom.x,
y: bottom.y + lineLength / 2 - yOffset
}, {
x: right.x + lineLength / 2,
y: bottom.y + lineLength / 2 - yOffset
}, {
x: right.x + lineLength / 2,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0,
symbol.topEnd = !0, maxX = bottom.x + lineLength / 2; else if ("left" === origin && isOnSameColumn && isUpper) {
var diffX = left.x - lineLength / 2;
symbolLeft.x < left.x && (diffX = symbolLeft.x - lineLength / 2), yOffset = 10 * Math.max(symbol.topLines.length, this.leftLines.length),
line = drawLine(this.chart, left, [ {
x: diffX,
y: left.y - yOffset
}, {
x: diffX,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.leftLines.push(line), symbol.topLines.push(line), this.leftStart = !0,
symbol.topEnd = !0, maxX = left.x;
} else "left" === origin ? (yOffset = 10 * Math.max(symbol.topLines.length, this.leftLines.length),
line = drawLine(this.chart, left, [ {
x: symbolTop.x + (left.x - symbolTop.x) / 2,
y: left.y
}, {
x: symbolTop.x + (left.x - symbolTop.x) / 2,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.leftLines.push(line), symbol.topLines.push(line), this.leftStart = !0,
symbol.topEnd = !0, maxX = left.x) : "top" === origin && (yOffset = 10 * Math.max(symbol.topLines.length, this.topLines.length),
line = drawLine(this.chart, top, [ {
x: top.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.topLines.push(line), symbol.topLines.push(line), this.topStart = !0,
symbol.topEnd = !0, maxX = top.x); else yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length),
line = drawLine(this.chart, bottom, [ {
x: bottom.x,
y: bottom.y + lineLength / 2 - yOffset
}, {
x: bottom.x + (bottom.x - symbolTop.x) / 2,
y: bottom.y + lineLength / 2 - yOffset
}, {
x: bottom.x + (bottom.x - symbolTop.x) / 2,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0,
symbol.topEnd = !0, maxX = bottom.x + (bottom.x - symbolTop.x) / 2; else yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length),
line = drawLine(this.chart, bottom, [ {
x: bottom.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0,
symbol.topEnd = !0, maxX = bottom.x, symbolTop.x > maxX && (maxX = symbolTop.x); else yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length),
line = this.leftEnd && isUpper ? drawLine(this.chart, bottom, [ {
x: bottom.x,
y: bottom.y + lineLength / 2 - yOffset
}, {
x: bottom.x + (bottom.x - symbolTop.x) / 2,
y: bottom.y + lineLength / 2 - yOffset
}, {
x: bottom.x + (bottom.x - symbolTop.x) / 2,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text) : drawLine(this.chart, bottom, [ {
x: bottom.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0,
symbol.topEnd = !0, maxX = bottom.x + (bottom.x - symbolTop.x) / 2; else yOffset = 10 * Math.max(symbol.topLines.length, this.rightLines.length),
line = drawLine(this.chart, right, [ {
x: right.x + lineLength / 2,
y: right.y - yOffset
}, {
x: right.x + lineLength / 2,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.rightLines.push(line), symbol.topLines.push(line), this.rightStart = !0,
symbol.topEnd = !0, maxX = right.x + lineLength / 2; else yOffset = 10 * Math.max(symbol.topLines.length, this.rightLines.length),
line = drawLine(this.chart, right, [ {
x: right.x + lineLength / 2,
y: right.y - yOffset
}, {
x: right.x + lineLength / 2,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y - lineLength / 2 - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text), this.rightLines.push(line), symbol.topLines.push(line), this.rightStart = !0,
symbol.topEnd = !0, maxX = right.x + lineLength / 2; else 0 === symbol.rightLines.length && 0 === this.leftLines.length ? line = drawLine(this.chart, left, symbolRight, text) : (yOffset = 10 * Math.max(symbol.rightLines.length, this.leftLines.length),
line = drawLine(this.chart, right, [ {
x: right.x,
y: right.y - yOffset
}, {
x: right.x,
y: symbolRight.y - yOffset
}, {
x: symbolRight.x,
y: symbolRight.y - yOffset
}, {
x: symbolRight.x,
y: symbolRight.y
} ], text)), this.leftLines.push(line), symbol.rightLines.push(line), this.leftStart = !0,
symbol.rightEnd = !0, maxX = symbolRight.x; else 0 === symbol.leftLines.length && 0 === this.rightLines.length ? line = drawLine(this.chart, right, symbolLeft, text) : (yOffset = 10 * Math.max(symbol.leftLines.length, this.rightLines.length),
line = drawLine(this.chart, right, [ {
x: right.x,
y: right.y - yOffset
}, {
x: right.x,
y: symbolLeft.y - yOffset
}, {
x: symbolLeft.x,
y: symbolLeft.y - yOffset
}, {
x: symbolLeft.x,
y: symbolLeft.y
} ], text)), this.rightLines.push(line), symbol.leftLines.push(line), this.rightStart = !0,
symbol.leftEnd = !0, maxX = symbolLeft.x; else 0 === symbol.topLines.length && 0 === this.bottomLines.length ? line = drawLine(this.chart, bottom, symbolTop, text) : (yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length),
line = drawLine(this.chart, bottom, [ {
x: symbolTop.x,
y: symbolTop.y - yOffset
}, {
x: symbolTop.x,
y: symbolTop.y
} ], text)), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0,
symbol.topEnd = !0, maxX = bottom.x;
if (//update line style
this.lineStyle[symbol.key] && line && line.attr(this.lineStyle[symbol.key]), line) {
for (var l = 0, llen = this.chart.lines.length; l < llen; l++) for (var otherLine = this.chart.lines[l], ePath = otherLine.attr("path"), lPath = line.attr("path"), iP = 0, lenP = ePath.length - 1; iP < lenP; iP++) {
var newPath = [];
newPath.push([ "M", ePath[iP][1], ePath[iP][2] ]), newPath.push([ "L", ePath[iP + 1][1], ePath[iP + 1][2] ]);
for (var line1_from_x = newPath[0][1], line1_from_y = newPath[0][2], line1_to_x = newPath[1][1], line1_to_y = newPath[1][2], lP = 0, lenlP = lPath.length - 1; lP < lenlP; lP++) {
var newLinePath = [];
newLinePath.push([ "M", lPath[lP][1], lPath[lP][2] ]), newLinePath.push([ "L", lPath[lP + 1][1], lPath[lP + 1][2] ]);
var line2_from_x = newLinePath[0][1], line2_from_y = newLinePath[0][2], line2_to_x = newLinePath[1][1], line2_to_y = newLinePath[1][2], res = checkLineIntersection(line1_from_x, line1_from_y, line1_to_x, line1_to_y, line2_from_x, line2_from_y, line2_to_x, line2_to_y);
if (res.onLine1 && res.onLine2) {
var newSegment;
line2_from_y === line2_to_y ? line2_from_x > line2_to_x ? (newSegment = [ "L", res.x + 2 * lineWith, line2_from_y ],
lPath.splice(lP + 1, 0, newSegment), newSegment = [ "C", res.x + 2 * lineWith, line2_from_y, res.x, line2_from_y - 4 * lineWith, res.x - 2 * lineWith, line2_from_y ],
lPath.splice(lP + 2, 0, newSegment), line.attr("path", lPath)) : (newSegment = [ "L", res.x - 2 * lineWith, line2_from_y ],
lPath.splice(lP + 1, 0, newSegment), newSegment = [ "C", res.x - 2 * lineWith, line2_from_y, res.x, line2_from_y - 4 * lineWith, res.x + 2 * lineWith, line2_from_y ],
lPath.splice(lP + 2, 0, newSegment), line.attr("path", lPath)) : line2_from_y > line2_to_y ? (newSegment = [ "L", line2_from_x, res.y + 2 * lineWith ],
lPath.splice(lP + 1, 0, newSegment), newSegment = [ "C", line2_from_x, res.y + 2 * lineWith, line2_from_x + 4 * lineWith, res.y, line2_from_x, res.y - 2 * lineWith ],
lPath.splice(lP + 2, 0, newSegment), line.attr("path", lPath)) : (newSegment = [ "L", line2_from_x, res.y - 2 * lineWith ],
lPath.splice(lP + 1, 0, newSegment), newSegment = [ "C", line2_from_x, res.y - 2 * lineWith, line2_from_x + 4 * lineWith, res.y, line2_from_x, res.y + 2 * lineWith ],
lPath.splice(lP + 2, 0, newSegment), line.attr("path", lPath)), lP += 2;
}
}
}
this.chart.lines.push(line), (void 0 === this.chart.minXFromSymbols || this.chart.minXFromSymbols > left.x) && (this.chart.minXFromSymbols = left.x);
}
(!this.chart.maxXFromLine || this.chart.maxXFromLine && maxX > this.chart.maxXFromLine) && (this.chart.maxXFromLine = maxX);
}, module.exports = Symbol;
}, /* 3 */
/*!************************************!*\
!*** ./src/flowchart.functions.js ***!
\************************************/
/***/
function(module, exports) {
function drawPath(chart, location, points) {
var i, len, path = "M{0},{1}";
for (i = 2, len = 2 * points.length + 2; i < len; i += 2) path += " L{" + i + "},{" + (i + 1) + "}";
var pathValues = [ location.x, location.y ];
for (i = 0, len = points.length; i < len; i++) pathValues.push(points[i].x), pathValues.push(points[i].y);
var symbol = chart.paper.path(path, pathValues);
symbol.attr("stroke", chart.options["element-color"]), symbol.attr("stroke-width", chart.options["line-width"]);
var font = chart.options.font, fontF = chart.options["font-family"], fontW = chart.options["font-weight"];
return font && symbol.attr({
font: font
}), fontF && symbol.attr({
"font-family": fontF
}), fontW && symbol.attr({
"font-weight": fontW
}), symbol;
}
function drawLine(chart, from, to, text) {
var i, len;
"[object Array]" !== Object.prototype.toString.call(to) && (to = [ to ]);
var path = "M{0},{1}";
for (i = 2, len = 2 * to.length + 2; i < len; i += 2) path += " L{" + i + "},{" + (i + 1) + "}";
var pathValues = [ from.x, from.y ];
for (i = 0, len = to.length; i < len; i++) pathValues.push(to[i].x), pathValues.push(to[i].y);
var line = chart.paper.path(path, pathValues);
line.attr({
stroke: chart.options["line-color"],
"stroke-width": chart.options["line-width"],
"arrow-end": chart.options["arrow-end"]
});
var font = chart.options.font, fontF = chart.options["font-family"], fontW = chart.options["font-weight"];
if (font && line.attr({
font: font
}), fontF && line.attr({
"font-family": fontF
}), fontW && line.attr({
"font-weight": fontW
}), text) {
var centerText = !1, textPath = chart.paper.text(0, 0, text), textAnchor = "start", isHorizontal = !1, firstTo = to[0];
from.y === firstTo.y && (isHorizontal = !0);
var x = 0, y = 0;
centerText ? (x = from.x > firstTo.x ? from.x - (from.x - firstTo.x) / 2 : firstTo.x - (firstTo.x - from.x) / 2,
y = from.y > firstTo.y ? from.y - (from.y - firstTo.y) / 2 : firstTo.y - (firstTo.y - from.y) / 2,
isHorizontal ? (x -= textPath.getBBox().width / 2, y -= chart.options["text-margin"]) : (x += chart.options["text-margin"],
y -= textPath.getBBox().height / 2)) : (x = from.x, y = from.y, isHorizontal ? (from.x > firstTo.x ? (x -= chart.options["text-margin"] / 2,
textAnchor = "end") : x += chart.options["text-margin"] / 2, y -= chart.options["text-margin"]) : (x += chart.options["text-margin"] / 2,
y += chart.options["text-margin"], from.y > firstTo.y && (y -= 2 * chart.options["text-margin"]))),
textPath.attr({
"text-anchor": textAnchor,
"font-size": chart.options["font-size"],
fill: chart.options["font-color"],
x: x,
y: y
}), font && textPath.attr({
font: font
}), fontF && textPath.attr({
"font-family": fontF
}), fontW && textPath.attr({
"font-weight": fontW
});
}
return line;
}
function checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {
// if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point
var denominator, a, b, numerator1, numerator2, result = {
x: null,
y: null,
onLine1: !1,
onLine2: !1
};
// if we cast these lines infinitely in both directions, they intersect here:
/*
// it is worth noting that this should be the same as:
x = line2StartX + (b * (line2EndX - line2StartX));
y = line2StartX + (b * (line2EndY - line2StartY));
*/
// if line1 is a segment and line2 is infinite, they intersect if:
// if line2 is a segment and line1 is infinite, they intersect if:
return denominator = (line2EndY - line2StartY) * (line1EndX - line1StartX) - (line2EndX - line2StartX) * (line1EndY - line1StartY),
0 === denominator ? result : (a = line1StartY - line2StartY, b = line1StartX - line2StartX,
numerator1 = (line2EndX - line2StartX) * a - (line2EndY - line2StartY) * b, numerator2 = (line1EndX - line1StartX) * a - (line1EndY - line1StartY) * b,
a = numerator1 / denominator, b = numerator2 / denominator, result.x = line1StartX + a * (line1EndX - line1StartX),
result.y = line1StartY + a * (line1EndY - line1StartY), a > 0 && a < 1 && (result.onLine1 = !0),
b > 0 && b < 1 && (result.onLine2 = !0), result);
}
module.exports = {
drawPath: drawPath,
drawLine: drawLine,
checkLineIntersection: checkLineIntersection
};
}, /* 4 */
/*!********************************!*\
!*** ./src/flowchart.parse.js ***!
\********************************/
/***/
function(module, exports, __webpack_require__) {
function parse(input) {
function getStyle(s) {
var startIndex = s.indexOf("(") + 1, endIndex = s.indexOf(")");
return startIndex >= 0 && endIndex >= 0 ? s.substring(startIndex, endIndex) : "{}";
}
function getSymbValue(s) {
var startIndex = s.indexOf("(") + 1, endIndex = s.indexOf(")");
return startIndex >= 0 && endIndex >= 0 ? s.substring(startIndex, endIndex) : "";
}
function getSymbol(s) {
var startIndex = s.indexOf("(") + 1, endIndex = s.indexOf(")");
return startIndex >= 0 && endIndex >= 0 ? chart.symbols[s.substring(0, startIndex - 1)] : chart.symbols[s];
}
function getNextPath(s) {
var next = "next", startIndex = s.indexOf("(") + 1, endIndex = s.indexOf(")");
return startIndex >= 0 && endIndex >= 0 && (next = flowSymb.substring(startIndex, endIndex),
next.indexOf(",") < 0 && "yes" !== next && "no" !== next && (next = "next, " + next)),
next;
}
function getAnnotation(s) {
var startIndex = s.indexOf("(") + 1, endIndex = s.indexOf(")"), tmp = s.substring(startIndex, endIndex);
tmp.indexOf(",") > 0 && (tmp = tmp.substring(0, tmp.indexOf(",")));
var tmp_split = tmp.split("@");
if (tmp_split.length > 1) return startIndex >= 0 && endIndex >= 0 ? tmp_split[1] : "";
}
input = input || "", input = input.trim();
for (var chart = {
symbols: {},
start: null,
drawSVG: function(container, options) {
function getDisplaySymbol(s) {
if (dispSymbols[s.key]) return dispSymbols[s.key];
switch (s.symbolType) {
case "start":
dispSymbols[s.key] = new Start(diagram, s);
break;
case "end":
dispSymbols[s.key] = new End(diagram, s);
break;
case "operation":
dispSymbols[s.key] = new Operation(diagram, s);
break;
case "inputoutput":
dispSymbols[s.key] = new InputOutput(diagram, s);
break;
case "subroutine":
dispSymbols[s.key] = new Subroutine(diagram, s);
break;
case "condition":
dispSymbols[s.key] = new Condition(diagram, s);
break;
case "parallel":
dispSymbols[s.key] = new Parallel(diagram, s);
break;
default:
return new Error("Wrong symbol type!");
}
return dispSymbols[s.key];
}
var self = this;
this.diagram && this.diagram.clean();
var diagram = new FlowChart(container, options);
this.diagram = diagram;
var dispSymbols = {};
!function constructChart(s, prevDisp, prev) {
var dispSymb = getDisplaySymbol(s);
return self.start === s ? diagram.startWith(dispSymb) : prevDisp && prev && !prevDisp.pathOk && (prevDisp instanceof Condition ? (prev.yes === s && prevDisp.yes(dispSymb),
prev.no === s && prevDisp.no(dispSymb)) : prevDisp instanceof Parallel ? (prev.path1 === s && prevDisp.path1(dispSymb),
prev.path2 === s && prevDisp.path2(dispSymb), prev.path3 === s && prevDisp.path3(dispSymb)) : prevDisp.then(dispSymb)),
dispSymb.pathOk ? dispSymb : (dispSymb instanceof Condition ? (s.yes && constructChart(s.yes, dispSymb, s),
s.no && constructChart(s.no, dispSymb, s)) : dispSymb instanceof Parallel ? (s.path1 && constructChart(s.path1, dispSymb, s),
s.path2 && constructChart(s.path2, dispSymb, s), s.path3 && constructChart(s.path3, dispSymb, s)) : s.next && constructChart(s.next, dispSymb, s),
dispSymb);
}(this.start), diagram.render();
},
clean: function() {
this.diagram.clean();
},
options: function() {
return this.diagram.options;
}
}, lines = [], prevBreak = 0, i0 = 1, i0len = input.length; i0 < i0len; i0++) if ("\n" === input[i0] && "\\" !== input[i0 - 1]) {
var line0 = input.substring(prevBreak, i0);
prevBreak = i0 + 1, lines.push(line0.replace(/\\\n/g, "\n"));
}
prevBreak < input.length && lines.push(input.substr(prevBreak));
for (var l = 1, len = lines.length; l < len; ) {
var currentLine = lines[l];
currentLine.indexOf("->") < 0 && currentLine.indexOf("=>") < 0 && currentLine.indexOf("@>") < 0 ? (lines[l - 1] += "\n" + currentLine,
lines.splice(l, 1), len--) : l++;
}
for (;lines.length > 0; ) {
var line = lines.splice(0, 1)[0].trim();
if (line.indexOf("=>") >= 0) {
// definition
var parts = line.split("=>"), symbol = {
key: parts[0].replace(/\(.*\)/, ""),
symbolType: parts[1],
text: null,
link: null,
target: null,
flowstate: null,
function: null,
lineStyle: {},
params: {}
}, params = parts[0].match(/\((.*)\)/);
if (params && params.length > 1) for (var entries = params[1].split(","), i = 0; i < entries.length; i++) {
var entry = entries[i].split("=");
2 == entry.length && (symbol.params[entry[0]] = entry[1]);
}
var sub;
/* adding support for links */
if (symbol.symbolType.indexOf(": ") >= 0 && (sub = symbol.symbolType.split(": "),
symbol.symbolType = sub.shift(), symbol.text = sub.join(": ")), symbol.text && symbol.text.indexOf(":$") >= 0 ? (sub = symbol.text.split(":$"),
symbol.text = sub.shift(), symbol.function = sub.join(":$")) : symbol.symbolType.indexOf(":$") >= 0 ? (sub = symbol.symbolType.split(":$"),
symbol.symbolType = sub.shift(), symbol.function = sub.join(":$")) : symbol.text && symbol.text.indexOf(":>") >= 0 ? (sub = symbol.text.split(":>"),
symbol.text = sub.shift(), symbol.link = sub.join(":>")) : symbol.symbolType.indexOf(":>") >= 0 && (sub = symbol.symbolType.split(":>"),
symbol.symbolType = sub.shift(), symbol.link = sub.join(":>")), symbol.symbolType.indexOf("\n") >= 0 && (symbol.symbolType = symbol.symbolType.split("\n")[0]),
symbol.link) {
var startIndex = symbol.link.indexOf("[") + 1, endIndex = symbol.link.indexOf("]");
startIndex >= 0 && endIndex >= 0 && (symbol.target = symbol.link.substring(startIndex, endIndex),
symbol.link = symbol.link.substring(0, startIndex - 1));
}
/* end of link support */
/* adding support for flowstates */
if (symbol.text && symbol.text.indexOf("|") >= 0) {
var txtAndState = symbol.text.split("|");
symbol.flowstate = txtAndState.pop().trim(), symbol.text = txtAndState.join("|");
}
/* end of flowstate support */
chart.symbols[symbol.key] = symbol;
} else if (line.indexOf("->") >= 0) {
var ann = getAnnotation(line);
ann && (line = line.replace("@" + ann, ""));
for (var flowSymbols = line.split("->"), iS = 0, lenS = flowSymbols.length; iS < lenS; iS++) {
var flowSymb = flowSymbols[iS], symbVal = getSymbValue(flowSymb);
"true" !== symbVal && "false" !== symbVal || (// map true or false to yes or no respectively
flowSymb = flowSymb.replace("true", "yes"), flowSymb = flowSymb.replace("false", "no"));
var next = getNextPath(flowSymb), realSymb = getSymbol(flowSymb), direction = null;
if (next.indexOf(",") >= 0) {
var condOpt = next.split(",");
next = condOpt[0], direction = condOpt[1].trim();
}
if (ann && ("condition" === realSymb.symbolType ? "yes" === next || "true" === next ? realSymb.yes_annotation = ann : realSymb.no_annotation = ann : "parallel" === realSymb.symbolType && ("path1" === next ? realSymb.path1_annotation = ann : "path2" === next ? realSymb.path2_annotation = ann : "path3" === next && (realSymb.path3_annotation = ann)),
ann = null), chart.start || (chart.start = realSymb), iS + 1 < lenS) {
var nextSymb = flowSymbols[iS + 1];
realSymb[next] = getSymbol(nextSymb), realSymb["direction_" + next] = direction,
direction = null;
}
}
} else if (line.indexOf("@>") >= 0) for (var lineStyleSymbols = line.split("@>"), iSS = 0, lenSS = lineStyleSymbols.length; iSS < lenSS; iSS++) if (iSS + 1 !== lenSS) {
var curSymb = getSymbol(lineStyleSymbols[iSS]), nextSymbol = getSymbol(lineStyleSymbols[iSS + 1]);
curSymb.lineStyle[nextSymbol.key] = JSON.parse(getStyle(lineStyleSymbols[iSS + 1]));
}
}
return chart;
}
var FlowChart = __webpack_require__(/*! ./flowchart.chart */ 7), Start = __webpack_require__(/*! ./flowchart.symbol.start */ 13), End = __webpack_require__(/*! ./flowchart.symbol.end */ 10), Operation = __webpack_require__(/*! ./flowchart.symbol.operation */ 12), InputOutput = __webpack_require__(/*! ./flowchart.symbol.inputoutput */ 11), Subroutine = __webpack_require__(/*! ./flowchart.symbol.subroutine */ 14), Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5), Parallel = __webpack_require__(/*! ./flowchart.symbol.parallel */ 6);
module.exports = parse;
}, /* 5 */
/*!*******************************************!*\
!*** ./src/flowchart.symbol.condition.js ***!
\*******************************************/
/***/
function(module, exports, __webpack_require__) {
function Condition(chart, options) {
options = options || {}, Symbol.call(this, chart, options), this.yes_annotation = options.yes_annotation,
this.no_annotation = options.no_annotation, this.textMargin = this.getAttr("text-margin"),
this.yes_direction = options.direction_yes, this.no_direction = options.direction_no,
this.no_direction || "right" !== this.yes_direction ? this.yes_direction || "bottom" !== this.no_direction || (this.yes_direction = "right") : this.no_direction = "bottom",
this.yes_direction = this.yes_direction || "bottom", this.no_direction = this.no_direction || "right",
this.text.attr({
x: 2 * this.textMargin
});
var width = this.text.getBBox().width + 3 * this.textMargin;
width += width / 2;
var height = this.text.getBBox().height + 2 * this.textMargin;
height += height / 2, height = Math.max(.5 * width, height);
var startX = width / 4, startY = height / 4;
this.text.attr({
x: startX + this.textMargin / 2
});
var start = {
x: startX,
y: startY
}, points = [ {
x: startX - width / 4,
y: startY + height / 4
}, {
x: startX - width / 4 + width / 2,
y: startY + height / 4 + height / 2
}, {
x: startX - width / 4 + width,
y: startY + height / 4
}, {
x: startX - width / 4 + width / 2,
y: startY + height / 4 - height / 2
}, {
x: startX - width / 4,
y: startY + height / 4
} ], symbol = drawPath(chart, start, points);
symbol.attr({
stroke: this.getAttr("element-color"),
"stroke-width": this.getAttr("line-width"),
fill: this.getAttr("fill")
}), options.link && symbol.attr("href", options.link), options.target && symbol.attr("target", options.target),
options.key && (symbol.node.id = options.key), symbol.node.setAttribute("class", this.getAttr("class")),
this.text.attr({
y: symbol.getBBox().height / 2
}), this.group.push(symbol), symbol.insertBefore(this.text), this.symbol = symbol,
this.initialize();
}
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits, drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawPath = drawAPI.drawPath;
inherits(Condition, Symbol), Condition.prototype.render = function() {
var self = this;
this.yes_direction && (this[this.yes_direction + "_symbol"] = this.yes_symbol),
this.no_direction && (this[this.no_direction + "_symbol"] = this.no_symbol);
var lineLength = this.getAttr("line-length");
if (this.bottom_symbol) {
var bottomPoint = this.getBottom();
this.bottom_symbol.isPositioned || (this.bottom_symbol.shiftY(this.getY() + this.height + lineLength),
this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2), this.bottom_symbol.isPositioned = !0,
this.bottom_symbol.render());
}
if (this.right_symbol) {
var rightPoint = this.getRight();
this.right_symbol.isPositioned || (this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2),
this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength), function shift() {
for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) if (symb = self.chart.symbols[i],
!self.params["align-next"] || "no" !== self.params["align-next"]) {
var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);
if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {
hasSymbolUnder = !0;
break;
}
}
if (hasSymbolUnder) {
if ("end" === self.right_symbol.symbolType) return;
self.right_symbol.setX(symb.getX() + symb.width + lineLength), shift();
}
}(), this.right_symbol.isPositioned = !0, this.right_symbol.render());
}
if (this.left_symbol) {
var leftPoint = this.getLeft();
this.left_symbol.isPositioned || (this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2),
this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength)), function shift() {
for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) if (symb = self.chart.symbols[i],
!self.params["align-next"] || "no" !== self.params["align-next"]) {
var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);
if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {
hasSymbolUnder = !0;
break;
}
}
if (hasSymbolUnder) {
if ("end" === self.left_symbol.symbolType) return;
self.left_symbol.setX(symb.getX() + symb.width + lineLength), shift();
}
}(), this.left_symbol.isPositioned = !0, this.left_symbol.render());
}
}, Condition.prototype.renderLines = function() {
this.yes_symbol && this.drawLineTo(this.yes_symbol, this.yes_annotation ? this.yes_annotation : this.getAttr("yes-text"), this.yes_direction),
this.no_symbol && this.drawLineTo(this.no_symbol, this.no_annotation ? this.no_annotation : this.getAttr("no-text"), this.no_direction);
}, module.exports = Condition;
}, /* 6 */
/*!******************************************!*\
!*** ./src/flowchart.symbol.parallel.js ***!
\******************************************/
/***/
function(module, exports, __webpack_require__) {
function Parallel(chart, options) {
var symbol = chart.paper.rect(0, 0, 0, 0);
options = options || {}, Symbol.call(this, chart, options, symbol), this.path1_annotation = options.path1_annotation || "",
this.path2_annotation = options.path2_annotation || "", this.path3_annotation = options.path3_annotation || "",
this.textMargin = this.getAttr("text-margin"), this.path1_direction = "bottom",
this.path2_direction = "right", this.path3_direction = "top", this.params = options.params,
"path1" === options.direction_next && !options[options.direction_next] && options.next && (options[options.direction_next] = options.next),
"path2" === options.direction_next && !options[options.direction_next] && options.next && (options[options.direction_next] = options.next),
"path3" === options.direction_next && !options[options.direction_next] && options.next && (options[options.direction_next] = options.next),
options.path1 && options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && !options.direction_path3 ? "right" === options.direction_path1 ? (this.path2_direction = "bottom",
this.path1_direction = "right", this.path3_direction = "top") : "top" === options.direction_path1 ? (this.path2_direction = "right",
this.path1_direction = "top", this.path3_direction = "bottom") : "left" === options.direction_path1 ? (this.path2_direction = "right",
this.path1_direction = "left", this.path3_direction = "bottom") : (this.path2_direction = "right",
this.path1_direction = "bottom", this.path3_direction = "top") : options.path1 && !options.direction_path1 && options.path2 && options.direction_path2 && options.path3 && !options.direction_path3 ? "right" === options.direction_path2 ? (this.path1_direction = "bottom",
this.path2_direction = "right", this.path3_direction = "top") : "left" === options.direction_path2 ? (this.path1_direction = "bottom",
this.path2_direction = "left", this.path3_direction = "right") : (this.path1_direction = "right",
this.path2_direction = "bottom", this.path3_direction = "top") : options.path1 && !options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && options.direction_path3 ? "right" === options.direction_path2 ? (this.path1_direction = "bottom",
this.path2_direction = "top", this.path3_direction = "right") : "left" === options.direction_path2 ? (this.path1_direction = "bottom",
this.path2_direction = "right", this.path3_direction = "left") : (this.path1_direction = "right",
this.path2_direction = "bottom", this.path3_direction = "top") : (this.path1_direction = options.direction_path1,
this.path2_direction = options.direction_path2, this.path3_direction = options.direction_path3),
this.path1_direction = this.path1_direction || "bottom", this.path2_direction = this.path2_direction || "right",
this.path3_direction = this.path3_direction || "top", this.initialize();
}
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
inherits(Parallel, Symbol), Parallel.prototype.render = function() {
this.path1_direction && (this[this.path1_direction + "_symbol"] = this.path1_symbol),
this.path2_direction && (this[this.path2_direction + "_symbol"] = this.path2_symbol),
this.path3_direction && (this[this.path3_direction + "_symbol"] = this.path3_symbol);
var lineLength = this.getAttr("line-length");
if (this.bottom_symbol) {
var bottomPoint = this.getBottom();
this.bottom_symbol.isPositioned || (this.bottom_symbol.shiftY(this.getY() + this.height + lineLength),
this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2), this.bottom_symbol.isPositioned = !0,
this.bottom_symbol.render());
}
if (this.top_symbol) {
var topPoint = this.getTop();
this.top_symbol.isPositioned || (this.top_symbol.shiftY(this.getY() - this.top_symbol.height - lineLength),
this.top_symbol.setX(topPoint.x + this.top_symbol.width), this.top_symbol.isPositioned = !0,
this.top_symbol.render());
}
var self = this;
if (this.left_symbol) {
var leftPoint = this.getLeft();
this.left_symbol.isPositioned || (this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2),
this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength)), function shift() {
for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) if (symb = self.chart.symbols[i],
!self.params["align-next"] || "no" !== self.params["align-next"]) {
var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);
if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {
hasSymbolUnder = !0;
break;
}
}
if (hasSymbolUnder) {
if ("end" === self.left_symbol.symbolType) return;
self.left_symbol.setX(symb.getX() + symb.width + lineLength), shift();
}
}(), this.left_symbol.isPositioned = !0, this.left_symbol.render());
}
if (this.right_symbol) {
var rightPoint = this.getRight();
this.right_symbol.isPositioned || (this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2),
this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength), function shift() {
for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) if (symb = self.chart.symbols[i],
!self.params["align-next"] || "no" !== self.params["align-next"]) {
var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);
if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {
hasSymbolUnder = !0;
break;
}
}
if (hasSymbolUnder) {
if ("end" === self.right_symbol.symbolType) return;
self.right_symbol.setX(symb.getX() + symb.width + lineLength), shift();
}
}(), this.right_symbol.isPositioned = !0, this.right_symbol.render());
}
}, Parallel.prototype.renderLines = function() {
this.path1_symbol && this.drawLineTo(this.path1_symbol, this.path1_annotation, this.path1_direction),
this.path2_symbol && this.drawLineTo(this.path2_symbol, this.path2_annotation, this.path2_direction),
this.path3_symbol && this.drawLineTo(this.path3_symbol, this.path3_annotation, this.path3_direction);
}, module.exports = Parallel;
}, /* 7 */
/*!********************************!*\
!*** ./src/flowchart.chart.js ***!
\********************************/
/***/
function(module, exports, __webpack_require__) {
function FlowChart(container, options) {
options = options || {}, this.paper = new Raphael(container), this.options = defaults(options, defaultOptions),
this.symbols = [], this.lines = [], this.start = null;
}
var Raphael = __webpack_require__(/*! raphael */ 16), defaults = __webpack_require__(/*! ./flowchart.helpers */ 1).defaults, defaultOptions = __webpack_require__(/*! ./flowchart.defaults */ 8), Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5), Parallel = __webpack_require__(/*! ./flowchart.symbol.parallel */ 6);
FlowChart.prototype.handle = function(symbol) {
this.symbols.indexOf(symbol) <= -1 && this.symbols.push(symbol);
var flowChart = this;
return symbol instanceof Condition ? (symbol.yes = function(nextSymbol) {
return symbol.yes_symbol = nextSymbol, symbol.no_symbol && (symbol.pathOk = !0),
flowChart.handle(nextSymbol);
}, symbol.no = function(nextSymbol) {
return symbol.no_symbol = nextSymbol, symbol.yes_symbol && (symbol.pathOk = !0),
flowChart.handle(nextSymbol);
}) : symbol instanceof Parallel ? (symbol.path1 = function(nextSymbol) {
return symbol.path1_symbol = nextSymbol, symbol.path2_symbol && (symbol.pathOk = !0),
flowChart.handle(nextSymbol);
}, symbol.path2 = function(nextSymbol) {
return symbol.path2_symbol = nextSymbol, symbol.path3_symbol && (symbol.pathOk = !0),
flowChart.handle(nextSymbol);
}, symbol.path3 = function(nextSymbol) {
return symbol.path3_symbol = nextSymbol, symbol.path1_symbol && (symbol.pathOk = !0),
flowChart.handle(nextSymbol);
}) : symbol.then = function(nextSymbol) {
return symbol.next = nextSymbol, symbol.pathOk = !0, flowChart.handle(nextSymbol);
}, symbol;
}, FlowChart.prototype.startWith = function(symbol) {
return this.start = symbol, this.handle(symbol);
}, FlowChart.prototype.render = function() {
var symbol, line, maxWidth = 0, maxHeight = 0, i = 0, len = 0, maxX = 0, maxY = 0, minX = 0, minY = 0;
for (i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i], symbol.width > maxWidth && (maxWidth = symbol.width),
symbol.height > maxHeight && (maxHeight = symbol.height);
for (i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i], symbol.shiftX(this.options.x + (maxWidth - symbol.width) / 2 + this.options["line-width"]),
symbol.shiftY(this.options.y + (maxHeight - symbol.height) / 2 + this.options["line-width"]);
// for (i = 0, len = this.symbols.length; i < len; i++) {
// symbol = this.symbols[i];
// symbol.render();
// }
for (this.start.render(), i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i],
symbol.renderLines();
maxX = this.maxXFromLine;
var x, y;
for (i = 0, len = this.symbols.length; i < len; i++) {
symbol = this.symbols[i];
var leftX = symbol.getX();
x = leftX + symbol.width, y = symbol.getY() + symbol.height, leftX < minX && (minX = leftX),
x > maxX && (maxX = x), y > maxY && (maxY = y);
}
for (i = 0, len = this.lines.length; i < len; i++) {
line = this.lines[i].getBBox(), x = line.x, y = line.y;
var x2 = line.x2, y2 = line.y2;
x < minX && (minX = x), y < minY && (minY = y), x2 > maxX && (maxX = x2), y2 > maxY && (maxY = y2);
}
var scale = this.options.scale, lineWidth = this.options["line-width"];
this.minXFromSymbols < minX && (minX = this.minXFromSymbols), minX < 0 && (minX -= lineWidth),
minY < 0 && (minY -= lineWidth);
var width = maxX + lineWidth - minX, height = maxY + lineWidth - minY;
this.paper.setSize(width * scale, height * scale), this.paper.setViewBox(minX, minY, width, height, !0);
}, FlowChart.prototype.clean = function() {
if (this.paper) {
var paperDom = this.paper.canvas;
paperDom.parentNode && paperDom.parentNode.removeChild(paperDom);
}
}, module.exports = FlowChart;
}, /* 8 */
/*!***********************************!*\
!*** ./src/flowchart.defaults.js ***!
\***********************************/
/***/
function(module, exports) {
// defaults
module.exports = {
x: 0,
y: 0,
"line-width": 3,
"line-length": 50,
"text-margin": 10,
"font-size": 14,
"font-color": "black",
// 'font': 'normal',
// 'font-family': 'calibri',
// 'font-weight': 'normal',
"line-color": "black",
"element-color": "black",
fill: "white",
"yes-text": "yes",
"no-text": "no",
"arrow-end": "block",
class: "flowchart",
scale: 1,
symbols: {
start: {},
end: {},
condition: {},
inputoutput: {},
operation: {},
subroutine: {},
parallel: {}
}
};
}, /* 9 */
/*!*******************************!*\
!*** ./src/flowchart.shim.js ***!
\*******************************/
/***/
function(module, exports) {
// add indexOf to non ECMA-262 standard compliant browsers
Array.prototype.indexOf || (Array.prototype.indexOf = function(searchElement) {
"use strict";
if (null === this) throw new TypeError();
var t = Object(this), len = t.length >>> 0;
if (0 === len) return -1;
var n = 0;
if (arguments.length > 0 && (n = Number(arguments[1]), n != n ? // shortcut for verifying if it's NaN
n = 0 : 0 !== n && n != 1 / 0 && n != -(1 / 0) && (n = (n > 0 || -1) * Math.floor(Math.abs(n)))),
n >= len) return -1;
for (var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); k < len; k++) if (k in t && t[k] === searchElement) return k;
return -1;
}), // add lastIndexOf to non ECMA-262 standard compliant browsers
Array.prototype.lastIndexOf || (Array.prototype.lastIndexOf = function(searchElement) {
"use strict";
if (null === this) throw new TypeError();
var t = Object(this), len = t.length >>> 0;
if (0 === len) return -1;
var n = len;
arguments.length > 1 && (n = Number(arguments[1]), n != n ? n = 0 : 0 !== n && n != 1 / 0 && n != -(1 / 0) && (n = (n > 0 || -1) * Math.floor(Math.abs(n))));
for (var k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n); k >= 0; k--) if (k in t && t[k] === searchElement) return k;
return -1;
}), String.prototype.trim || (String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, "");
});
}, /* 10 */
/*!*************************************!*\
!*** ./src/flowchart.symbol.end.js ***!
\*************************************/
/***/
function(module, exports, __webpack_require__) {
function End(chart, options) {
var symbol = chart.paper.rect(0, 0, 0, 0, 20);
options = options || {}, options.text = options.text || "End", Symbol.call(this, chart, options, symbol);
}
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
inherits(End, Symbol), module.exports = End;
}, /* 11 */
/*!*********************************************!*\
!*** ./src/flowchart.symbol.inputoutput.js ***!
\*********************************************/
/***/
function(module, exports, __webpack_require__) {
function InputOutput(chart, options) {
options = options || {}, Symbol.call(this, chart, options), this.textMargin = this.getAttr("text-margin"),
this.text.attr({
x: 3 * this.textMargin
});
var width = this.text.getBBox().width + 4 * this.textMargin, height = this.text.getBBox().height + 2 * this.textMargin, startX = this.textMargin, startY = height / 2, start = {
x: startX,
y: startY
}, points = [ {
x: startX - this.textMargin,
y: height
}, {
x: startX - this.textMargin + width,
y: height
}, {
x: startX - this.textMargin + width + 2 * this.textMargin,
y: 0
}, {
x: startX - this.textMargin + 2 * this.textMargin,
y: 0
}, {
x: startX,
y: startY
} ], symbol = drawPath(chart, start, points);
symbol.attr({
stroke: this.getAttr("element-color"),
"stroke-width": this.getAttr("line-width"),
fill: this.getAttr("fill")
}), options.link && symbol.attr("href", options.link), options.target && symbol.attr("target", options.target),
options.key && (symbol.node.id = options.key), symbol.node.setAttribute("class", this.getAttr("class")),
this.text.attr({
y: symbol.getBBox().height / 2
}), this.group.push(symbol), symbol.insertBefore(this.text), this.symbol = symbol,
this.initialize();
}
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits, drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawPath = drawAPI.drawPath;
inherits(InputOutput, Symbol), InputOutput.prototype.getLeft = function() {
var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.textMargin;
return {
x: x,
y: y
};
}, InputOutput.prototype.getRight = function() {
var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.group.getBBox().width - this.textMargin;
return {
x: x,
y: y
};
}, module.exports = InputOutput;
}, /* 12 */
/*!*******************************************!*\
!*** ./src/flowchart.symbol.operation.js ***!
\*******************************************/
/***/
function(module, exports, __webpack_require__) {
function Operation(chart, options) {
var symbol = chart.paper.rect(0, 0, 0, 0);
options = options || {}, Symbol.call(this, chart, options, symbol);
}
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
inherits(Operation, Symbol), module.exports = Operation;
}, /* 13 */
/*!***************************************!*\
!*** ./src/flowchart.symbol.start.js ***!
\***************************************/
/***/
function(module, exports, __webpack_require__) {
function Start(chart, options) {
var symbol = chart.paper.rect(0, 0, 0, 0, 20);
options = options || {}, options.text = options.text || "Start", Symbol.call(this, chart, options, symbol);
}
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
inherits(Start, Symbol), module.exports = Start;
}, /* 14 */
/*!********************************************!*\
!*** ./src/flowchart.symbol.subroutine.js ***!
\********************************************/
/***/
function(module, exports, __webpack_require__) {
function Subroutine(chart, options) {
var symbol = chart.paper.rect(0, 0, 0, 0);
options = options || {}, Symbol.call(this, chart, options, symbol), symbol.attr({
width: this.text.getBBox().width + 4 * this.getAttr("text-margin")
}), this.text.attr({
x: 2 * this.getAttr("text-margin")
});
var innerWrap = chart.paper.rect(0, 0, 0, 0);
innerWrap.attr({
x: this.getAttr("text-margin"),
stroke: this.getAttr("element-color"),
"stroke-width": this.getAttr("line-width"),
width: this.text.getBBox().width + 2 * this.getAttr("text-margin"),
height: this.text.getBBox().height + 2 * this.getAttr("text-margin"),
fill: this.getAttr("fill")
}), options.key && (innerWrap.node.id = options.key + "i");
var font = this.getAttr("font"), fontF = this.getAttr("font-family"), fontW = this.getAttr("font-weight");
font && innerWrap.attr({
font: font
}), fontF && innerWrap.attr({
"font-family": fontF
}), fontW && innerWrap.attr({
"font-weight": fontW
}), options.link && innerWrap.attr("href", options.link), options.target && innerWrap.attr("target", options.target),
this.group.push(innerWrap), innerWrap.insertBefore(this.text), this.initialize();
}
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
inherits(Subroutine, Symbol), module.exports = Subroutine;
}, /* 15 */
/*!******************************!*\
!*** ./src/jquery-plugin.js ***!
\******************************/
/***/
function(module, exports, __webpack_require__) {
if ("undefined" != typeof jQuery) {
var parse = __webpack_require__(/*! ./flowchart.parse */ 4);
!function($) {
function paramFit(needle, haystack) {
return needle == haystack || Array.isArray(haystack) && (haystack.includes(needle) || haystack.includes(Number(needle)));
}
var methods = {
init: function(options) {
return this.each(function() {
var $this = $(this);
this.chart = parse($this.text()), $this.html(""), this.chart.drawSVG(this, options);
});
},
setFlowStateByParam: function(param, paramValue, newFlowState) {
return this.each(function() {
var chart = this.chart, nextSymbolKeys = [ "next", "yes", "no", "path1", "path2", "path3" ];
for (var property in chart.symbols) if (chart.symbols.hasOwnProperty(property)) {
var symbol = chart.symbols[property], val = symbol.params[param];
if (paramFit(val, paramValue)) {
symbol.flowstate = newFlowState;
for (var nski = 0; nski < nextSymbolKeys.length; nski++) {
var nextSymbolKey = nextSymbolKeys[nski];
symbol[nextSymbolKey] && symbol[nextSymbolKey].params && symbol[nextSymbolKey].params[param] && paramFit(symbol[nextSymbolKey].params[param], paramValue) && (symbol.lineStyle[symbol[nextSymbolKey].key] = {
stroke: chart.options().flowstate[newFlowState].fill
});
}
}
}
chart.clean(), chart.drawSVG(this);
});
},
clearFlowState: function() {
return this.each(function() {
var chart = this.chart;
for (var property in chart.symbols) if (chart.symbols.hasOwnProperty(property)) {
var node = chart.symbols[property];
node.flowstate = "";
}
chart.clean(), chart.drawSVG(this);
});
}
};
$.fn.flowChart = function(methodOrOptions) {
return methods[methodOrOptions] ? methods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof methodOrOptions && methodOrOptions ? void $.error("Method " + methodOrOptions + " does not exist on jQuery.flowChart") : methods.init.apply(this, arguments);
};
}(jQuery);
}
}, /* 16 */
/*!**************************!*\
!*** external "Raphael" ***!
\**************************/
/***/
function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_16__;
} ]);
});
//# sourceMappingURL=flowchart.js.map
|
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var _a;
import { isWindows } from './platform.js';
var _schemePattern = /^\w[\w\d+.-]*$/;
var _singleSlashStart = /^\//;
var _doubleSlashStart = /^\/\//;
var _throwOnMissingSchema = true;
function _validateUri(ret) {
// scheme, must be set
if (!ret.scheme) {
if (_throwOnMissingSchema) {
throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}");
}
else {
console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}");
}
}
// scheme, https://tools.ietf.org/html/rfc3986#section-3.1
// ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
if (ret.scheme && !_schemePattern.test(ret.scheme)) {
throw new Error('[UriError]: Scheme contains illegal characters.');
}
// path, http://tools.ietf.org/html/rfc3986#section-3.3
// If a URI contains an authority component, then the path component
// must either be empty or begin with a slash ("/") character. If a URI
// does not contain an authority component, then the path cannot begin
// with two slash characters ("//").
if (ret.path) {
if (ret.authority) {
if (!_singleSlashStart.test(ret.path)) {
throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
}
}
else {
if (_doubleSlashStart.test(ret.path)) {
throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
}
}
}
}
// implements a bit of https://tools.ietf.org/html/rfc3986#section-5
function _referenceResolution(scheme, path) {
// the slash-character is our 'default base' as we don't
// support constructing URIs relative to other URIs. This
// also means that we alter and potentially break paths.
// see https://tools.ietf.org/html/rfc3986#section-5.1.4
switch (scheme) {
case 'https':
case 'http':
case 'file':
if (!path) {
path = _slash;
}
else if (path[0] !== _slash) {
path = _slash + path;
}
break;
}
return path;
}
var _empty = '';
var _slash = '/';
var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
/**
* Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
* This class is a simple parser which creates the basic component parts
* (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
* and encoding.
*
* foo://example.com:8042/over/there?name=ferret#nose
* \_/ \______________/\_________/ \_________/ \__/
* | | | | |
* scheme authority path query fragment
* | _____________________|__
* / \ / \
* urn:example:animal:ferret:nose
*/
var URI = /** @class */ (function () {
/**
* @internal
*/
function URI(schemeOrData, authority, path, query, fragment) {
if (typeof schemeOrData === 'object') {
this.scheme = schemeOrData.scheme || _empty;
this.authority = schemeOrData.authority || _empty;
this.path = schemeOrData.path || _empty;
this.query = schemeOrData.query || _empty;
this.fragment = schemeOrData.fragment || _empty;
// no validation because it's this URI
// that creates uri components.
// _validateUri(this);
}
else {
this.scheme = schemeOrData || _empty;
this.authority = authority || _empty;
this.path = _referenceResolution(this.scheme, path || _empty);
this.query = query || _empty;
this.fragment = fragment || _empty;
_validateUri(this);
}
}
URI.isUri = function (thing) {
if (thing instanceof URI) {
return true;
}
if (!thing) {
return false;
}
return typeof thing.authority === 'string'
&& typeof thing.fragment === 'string'
&& typeof thing.path === 'string'
&& typeof thing.query === 'string'
&& typeof thing.scheme === 'string';
};
Object.defineProperty(URI.prototype, "fsPath", {
// ---- filesystem path -----------------------
/**
* Returns a string representing the corresponding file system path of this URI.
* Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
* platform specific path separator.
*
* * Will *not* validate the path for invalid characters and semantics.
* * Will *not* look at the scheme of this URI.
* * The result shall *not* be used for display purposes but for accessing a file on disk.
*
*
* The *difference* to `URI#path` is the use of the platform specific separator and the handling
* of UNC paths. See the below sample of a file-uri with an authority (UNC path).
*
* ```ts
const u = URI.parse('file://server/c$/folder/file.txt')
u.authority === 'server'
u.path === '/shares/c$/file.txt'
u.fsPath === '\\server\c$\folder\file.txt'
```
*
* Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
* namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
* with URIs that represent files on disk (`file` scheme).
*/
get: function () {
// if (this.scheme !== 'file') {
// console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);
// }
return _makeFsPath(this);
},
enumerable: true,
configurable: true
});
// ---- modify to new -------------------------
URI.prototype.with = function (change) {
if (!change) {
return this;
}
var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;
if (scheme === void 0) {
scheme = this.scheme;
}
else if (scheme === null) {
scheme = _empty;
}
if (authority === void 0) {
authority = this.authority;
}
else if (authority === null) {
authority = _empty;
}
if (path === void 0) {
path = this.path;
}
else if (path === null) {
path = _empty;
}
if (query === void 0) {
query = this.query;
}
else if (query === null) {
query = _empty;
}
if (fragment === void 0) {
fragment = this.fragment;
}
else if (fragment === null) {
fragment = _empty;
}
if (scheme === this.scheme
&& authority === this.authority
&& path === this.path
&& query === this.query
&& fragment === this.fragment) {
return this;
}
return new _URI(scheme, authority, path, query, fragment);
};
// ---- parse & validate ------------------------
/**
* Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,
* `file:///usr/home`, or `scheme:with/path`.
*
* @param value A string which represents an URI (see `URI#toString`).
*/
URI.parse = function (value) {
var match = _regexp.exec(value);
if (!match) {
return new _URI(_empty, _empty, _empty, _empty, _empty);
}
return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty));
};
/**
* Creates a new URI from a file system path, e.g. `c:\my\files`,
* `/usr/home`, or `\\server\share\some\path`.
*
* The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
* as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
* `URI.parse('file://' + path)` because the path might contain characters that are
* interpreted (# and ?). See the following sample:
* ```ts
const good = URI.file('/coding/c#/project1');
good.scheme === 'file';
good.path === '/coding/c#/project1';
good.fragment === '';
const bad = URI.parse('file://' + '/coding/c#/project1');
bad.scheme === 'file';
bad.path === '/coding/c'; // path is now broken
bad.fragment === '/project1';
```
*
* @param path A file system path (see `URI#fsPath`)
*/
URI.file = function (path) {
var authority = _empty;
// normalize to fwd-slashes on windows,
// on other systems bwd-slashes are valid
// filename character, eg /f\oo/ba\r.txt
if (isWindows) {
path = path.replace(/\\/g, _slash);
}
// check for authority as used in UNC shares
// or use the path as given
if (path[0] === _slash && path[1] === _slash) {
var idx = path.indexOf(_slash, 2);
if (idx === -1) {
authority = path.substring(2);
path = _slash;
}
else {
authority = path.substring(2, idx);
path = path.substring(idx) || _slash;
}
}
return new _URI('file', authority, path, _empty, _empty);
};
URI.from = function (components) {
return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);
};
// ---- printing/externalize ---------------------------
/**
* Creates a string presentation for this URI. It's guaranteed that calling
* `URI.parse` with the result of this function creates an URI which is equal
* to this URI.
*
* * The result shall *not* be used for display purposes but for externalization or transport.
* * The result will be encoded using the percentage encoding and encoding happens mostly
* ignore the scheme-specific encoding rules.
*
* @param skipEncoding Do not encode the result, default is `false`
*/
URI.prototype.toString = function (skipEncoding) {
if (skipEncoding === void 0) { skipEncoding = false; }
return _asFormatted(this, skipEncoding);
};
URI.prototype.toJSON = function () {
return this;
};
URI.revive = function (data) {
if (!data) {
return data;
}
else if (data instanceof URI) {
return data;
}
else {
var result = new _URI(data);
result._fsPath = data.fsPath;
result._formatted = data.external;
return result;
}
};
return URI;
}());
export { URI };
// tslint:disable-next-line:class-name
var _URI = /** @class */ (function (_super) {
__extends(_URI, _super);
function _URI() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._formatted = null;
_this._fsPath = null;
return _this;
}
Object.defineProperty(_URI.prototype, "fsPath", {
get: function () {
if (!this._fsPath) {
this._fsPath = _makeFsPath(this);
}
return this._fsPath;
},
enumerable: true,
configurable: true
});
_URI.prototype.toString = function (skipEncoding) {
if (skipEncoding === void 0) { skipEncoding = false; }
if (!skipEncoding) {
if (!this._formatted) {
this._formatted = _asFormatted(this, false);
}
return this._formatted;
}
else {
// we don't cache that
return _asFormatted(this, true);
}
};
_URI.prototype.toJSON = function () {
var res = {
$mid: 1
};
// cached state
if (this._fsPath) {
res.fsPath = this._fsPath;
}
if (this._formatted) {
res.external = this._formatted;
}
// uri components
if (this.path) {
res.path = this.path;
}
if (this.scheme) {
res.scheme = this.scheme;
}
if (this.authority) {
res.authority = this.authority;
}
if (this.query) {
res.query = this.query;
}
if (this.fragment) {
res.fragment = this.fragment;
}
return res;
};
return _URI;
}(URI));
// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2
var encodeTable = (_a = {},
_a[58 /* Colon */] = '%3A',
_a[47 /* Slash */] = '%2F',
_a[63 /* QuestionMark */] = '%3F',
_a[35 /* Hash */] = '%23',
_a[91 /* OpenSquareBracket */] = '%5B',
_a[93 /* CloseSquareBracket */] = '%5D',
_a[64 /* AtSign */] = '%40',
_a[33 /* ExclamationMark */] = '%21',
_a[36 /* DollarSign */] = '%24',
_a[38 /* Ampersand */] = '%26',
_a[39 /* SingleQuote */] = '%27',
_a[40 /* OpenParen */] = '%28',
_a[41 /* CloseParen */] = '%29',
_a[42 /* Asterisk */] = '%2A',
_a[43 /* Plus */] = '%2B',
_a[44 /* Comma */] = '%2C',
_a[59 /* Semicolon */] = '%3B',
_a[61 /* Equals */] = '%3D',
_a[32 /* Space */] = '%20',
_a);
function encodeURIComponentFast(uriComponent, allowSlash) {
var res = undefined;
var nativeEncodePos = -1;
for (var pos = 0; pos < uriComponent.length; pos++) {
var code = uriComponent.charCodeAt(pos);
// unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3
if ((code >= 97 /* a */ && code <= 122 /* z */)
|| (code >= 65 /* A */ && code <= 90 /* Z */)
|| (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */)
|| code === 45 /* Dash */
|| code === 46 /* Period */
|| code === 95 /* Underline */
|| code === 126 /* Tilde */
|| (allowSlash && code === 47 /* Slash */)) {
// check if we are delaying native encode
if (nativeEncodePos !== -1) {
res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
nativeEncodePos = -1;
}
// check if we write into a new string (by default we try to return the param)
if (res !== undefined) {
res += uriComponent.charAt(pos);
}
}
else {
// encoding needed, we need to allocate a new string
if (res === undefined) {
res = uriComponent.substr(0, pos);
}
// check with default table first
var escaped = encodeTable[code];
if (escaped !== undefined) {
// check if we are delaying native encode
if (nativeEncodePos !== -1) {
res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
nativeEncodePos = -1;
}
// append escaped variant to result
res += escaped;
}
else if (nativeEncodePos === -1) {
// use native encode only when needed
nativeEncodePos = pos;
}
}
}
if (nativeEncodePos !== -1) {
res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
}
return res !== undefined ? res : uriComponent;
}
function encodeURIComponentMinimal(path) {
var res = undefined;
for (var pos = 0; pos < path.length; pos++) {
var code = path.charCodeAt(pos);
if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) {
if (res === undefined) {
res = path.substr(0, pos);
}
res += encodeTable[code];
}
else {
if (res !== undefined) {
res += path[pos];
}
}
}
return res !== undefined ? res : path;
}
/**
* Compute `fsPath` for the given uri
* @param uri
*/
function _makeFsPath(uri) {
var value;
if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {
// unc path: file://shares/c$/far/boo
value = "//" + uri.authority + uri.path;
}
else if (uri.path.charCodeAt(0) === 47 /* Slash */
&& (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)
&& uri.path.charCodeAt(2) === 58 /* Colon */) {
// windows drive letter: file:///c:/far/boo
value = uri.path[1].toLowerCase() + uri.path.substr(2);
}
else {
// other path
value = uri.path;
}
if (isWindows) {
value = value.replace(/\//g, '\\');
}
return value;
}
/**
* Create the external version of a uri
*/
function _asFormatted(uri, skipEncoding) {
var encoder = !skipEncoding
? encodeURIComponentFast
: encodeURIComponentMinimal;
var res = '';
var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;
if (scheme) {
res += scheme;
res += ':';
}
if (authority || scheme === 'file') {
res += _slash;
res += _slash;
}
if (authority) {
var idx = authority.indexOf('@');
if (idx !== -1) {
// <user>@<auth>
var userinfo = authority.substr(0, idx);
authority = authority.substr(idx + 1);
idx = userinfo.indexOf(':');
if (idx === -1) {
res += encoder(userinfo, false);
}
else {
// <user>:<pass>@<auth>
res += encoder(userinfo.substr(0, idx), false);
res += ':';
res += encoder(userinfo.substr(idx + 1), false);
}
res += '@';
}
authority = authority.toLowerCase();
idx = authority.indexOf(':');
if (idx === -1) {
res += encoder(authority, false);
}
else {
// <auth>:<port>
res += encoder(authority.substr(0, idx), false);
res += authority.substr(idx);
}
}
if (path) {
// lower-case windows drive letters in /C:/fff or C:/fff
if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) {
var code = path.charCodeAt(1);
if (code >= 65 /* A */ && code <= 90 /* Z */) {
path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3
}
}
else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) {
var code = path.charCodeAt(0);
if (code >= 65 /* A */ && code <= 90 /* Z */) {
path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3
}
}
// encode the rest of the path
res += encoder(path, true);
}
if (query) {
res += '?';
res += encoder(query, false);
}
if (fragment) {
res += '#';
res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;
}
return res;
}
|
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/workAttendance',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/workAttendance/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/workAttendance',
method: 'put',
data
})
}
export function downloadWorkAttendance(params) {
return request({
url: 'api/workAttendance/download',
method: 'get',
params,
responseType: 'blob'
})
}
|
// Requirements
const AdmZip = require('adm-zip')
const async = require('async')
const child_process = require('child_process')
const crypto = require('crypto')
const EventEmitter = require('events')
const fs = require('fs-extra')
const StreamZip = require('node-stream-zip')
const path = require('path')
const Registry = require('winreg')
const request = require('request')
const tar = require('tar-fs')
const zlib = require('zlib')
const ConfigManager = require('./configmanager')
const DistroManager = require('./distromanager')
const isDev = require('./isdev')
// Constants
// const PLATFORM_MAP = {
// win32: '-windows-x64.tar.gz',
// darwin: '-macosx-x64.tar.gz',
// linux: '-linux-x64.tar.gz'
// }
// Classes
/** Class representing a base asset. */
class Asset {
/**
* Create an asset.
*
* @param {any} id The id of the asset.
* @param {string} hash The hash value of the asset.
* @param {number} size The size in bytes of the asset.
* @param {string} from The url where the asset can be found.
* @param {string} to The absolute local file path of the asset.
*/
constructor(id, hash, size, from, to){
this.id = id
this.hash = hash
this.size = size
this.from = from
this.to = to
}
}
/** Class representing a mojang library. */
class Library extends Asset {
/**
* Converts the process.platform OS names to match mojang's OS names.
*/
static mojangFriendlyOS(){
const opSys = process.platform
if (opSys === 'darwin') {
return 'osx'
} else if (opSys === 'win32'){
return 'windows'
} else if (opSys === 'linux'){
return 'linux'
} else {
return 'unknown_os'
}
}
/**
* Checks whether or not a library is valid for download on a particular OS, following
* the rule format specified in the mojang version data index. If the allow property has
* an OS specified, then the library can ONLY be downloaded on that OS. If the disallow
* property has instead specified an OS, the library can be downloaded on any OS EXCLUDING
* the one specified.
*
* If the rules are undefined, the natives property will be checked for a matching entry
* for the current OS.
*
* @param {Array.<Object>} rules The Library's download rules.
* @param {Object} natives The Library's natives object.
* @returns {boolean} True if the Library follows the specified rules, otherwise false.
*/
static validateRules(rules, natives){
if(rules == null) {
if(natives == null) {
return true
} else {
return natives[Library.mojangFriendlyOS()] != null
}
}
for(let rule of rules){
const action = rule.action
const osProp = rule.os
if(action != null && osProp != null){
const osName = osProp.name
const osMoj = Library.mojangFriendlyOS()
if(action === 'allow'){
return osName === osMoj
} else if(action === 'disallow'){
return osName !== osMoj
}
}
}
return true
}
}
class DistroModule extends Asset {
/**
* Create a DistroModule. This is for processing,
* not equivalent to the module objects in the
* distro index.
*
* @param {any} id The id of the asset.
* @param {string} hash The hash value of the asset.
* @param {number} size The size in bytes of the asset.
* @param {string} from The url where the asset can be found.
* @param {string} to The absolute local file path of the asset.
* @param {string} type The the module type.
*/
constructor(id, hash, size, from, to, type){
super(id, hash, size, from, to)
this.type = type
}
}
/**
* Class representing a download tracker. This is used to store meta data
* about a download queue, including the queue itself.
*/
class DLTracker {
/**
* Create a DLTracker
*
* @param {Array.<Asset>} dlqueue An array containing assets queued for download.
* @param {number} dlsize The combined size of each asset in the download queue array.
* @param {function(Asset)} callback Optional callback which is called when an asset finishes downloading.
*/
constructor(dlqueue, dlsize, callback = null){
this.dlqueue = dlqueue
this.dlsize = dlsize
this.callback = callback
}
}
class Util {
/**
* Returns true if the actual version is greater than
* or equal to the desired version.
*
* @param {string} desired The desired version.
* @param {string} actual The actual version.
*/
static mcVersionAtLeast(desired, actual){
const des = desired.split('.')
const act = actual.split('.')
for(let i=0; i<des.length; i++){
if(!(parseInt(act[i]) >= parseInt(des[i]))){
return false
}
}
return true
}
static isForgeGradle3(mcVersion, forgeVersion) {
if(Util.mcVersionAtLeast('1.13', mcVersion)) {
return true
}
try {
const forgeVer = forgeVersion.split('-')[1]
const maxFG2 = [14, 23, 5, 2847]
const verSplit = forgeVer.split('.').map(v => Number(v))
for(let i=0; i<maxFG2.length; i++) {
if(verSplit[i] > maxFG2[i]) {
return true
} else if(verSplit[i] < maxFG2[i]) {
return false
}
}
return false
} catch(err) {
throw new Error('Forge version is complex (changed).. launcher requires a patch.')
}
}
static isAutoconnectBroken(forgeVersion) {
const minWorking = [31, 2, 15]
const verSplit = forgeVersion.split('.').map(v => Number(v))
if(verSplit[0] === 31) {
for(let i=0; i<minWorking.length; i++) {
if(verSplit[i] > minWorking[i]) {
return false
} else if(verSplit[i] < minWorking[i]) {
return true
}
}
}
return false
}
}
class JavaGuard extends EventEmitter {
constructor(mcVersion){
super()
this.mcVersion = mcVersion
}
/**
* @typedef OpenJDKData
* @property {string} uri The base uri of the JRE.
* @property {number} size The size of the download.
* @property {string} name The name of the artifact.
*/
/**
* Fetch the last open JDK binary.
*
* HOTFIX: Uses Corretto 8 for macOS.
* See: https://github.com/dscalzi/HeliosLauncher/issues/70
* See: https://github.com/AdoptOpenJDK/openjdk-support/issues/101
*
* @param {string} major The major version of Java to fetch.
*
* @returns {Promise.<OpenJDKData>} Promise which resolved to an object containing the JRE download data.
*/
static _latestOpenJDK(major = '8'){
if(process.platform === 'darwin') {
return this._latestCorretto(major)
} else {
return this._latestAdoptium(major)
}
}
static _latestAdoptium(major) {
const majorNum = Number(major)
const sanitizedOS = process.platform === 'win32' ? 'windows' : (process.platform === 'darwin' ? 'mac' : process.platform)
const url = `https://api.adoptium.net/v3/assets/latest/${major}/hotspot?vendor=eclipse`
return new Promise((resolve, reject) => {
request({url, json: true}, (err, resp, body) => {
if(!err && body.length > 0){
const targetBinary = body.find(entry => {
return entry.version.major === majorNum
&& entry.binary.os === sanitizedOS
&& entry.binary.image_type === 'jdk'
&& entry.binary.architecture === 'x64'
})
if(targetBinary != null) {
resolve({
uri: targetBinary.binary.package.link,
size: targetBinary.binary.package.size,
name: targetBinary.binary.package.name
})
} else {
resolve(null)
}
} else {
resolve(null)
}
})
})
}
static _latestCorretto(major) {
let sanitizedOS, ext
switch(process.platform) {
case 'win32':
sanitizedOS = 'windows'
ext = 'zip'
break
case 'darwin':
sanitizedOS = 'macos'
ext = 'tar.gz'
break
case 'linux':
sanitizedOS = 'linux'
ext = 'tar.gz'
break
default:
sanitizedOS = process.platform
ext = 'tar.gz'
break
}
const url = `https://corretto.aws/downloads/latest/amazon-corretto-${major}-x64-${sanitizedOS}-jdk.${ext}`
return new Promise((resolve, reject) => {
request.head({url, json: true}, (err, resp) => {
if(!err && resp.statusCode === 200){
resolve({
uri: url,
size: parseInt(resp.headers['content-length']),
name: url.substr(url.lastIndexOf('/')+1)
})
} else {
resolve(null)
}
})
})
}
/**
* Returns the path of the OS-specific executable for the given Java
* installation. Supported OS's are win32, darwin, linux.
*
* @param {string} rootDir The root directory of the Java installation.
* @returns {string} The path to the Java executable.
*/
static javaExecFromRoot(rootDir){
if(process.platform === 'win32'){
return path.join(rootDir, 'bin', 'javaw.exe')
} else if(process.platform === 'darwin'){
return path.join(rootDir, 'Contents', 'Home', 'bin', 'java')
} else if(process.platform === 'linux'){
return path.join(rootDir, 'bin', 'java')
}
return rootDir
}
/**
* Check to see if the given path points to a Java executable.
*
* @param {string} pth The path to check against.
* @returns {boolean} True if the path points to a Java executable, otherwise false.
*/
static isJavaExecPath(pth){
if(process.platform === 'win32'){
return pth.endsWith(path.join('bin', 'javaw.exe'))
} else if(process.platform === 'darwin'){
return pth.endsWith(path.join('bin', 'java'))
} else if(process.platform === 'linux'){
return pth.endsWith(path.join('bin', 'java'))
}
return false
}
/**
* Load Mojang's launcher.json file.
*
* @returns {Promise.<Object>} Promise which resolves to Mojang's launcher.json object.
*/
static loadMojangLauncherData(){
return new Promise((resolve, reject) => {
request.get('https://launchermeta.mojang.com/mc/launcher.json', (err, resp, body) => {
if(err){
resolve(null)
} else {
resolve(JSON.parse(body))
}
})
})
}
/**
* Parses a **full** Java Runtime version string and resolves
* the version information. Dynamically detects the formatting
* to use.
*
* @param {string} verString Full version string to parse.
* @returns Object containing the version information.
*/
static parseJavaRuntimeVersion(verString){
const major = verString.split('.')[0]
if(major == 1){
return JavaGuard._parseJavaRuntimeVersion_8(verString)
} else {
return JavaGuard._parseJavaRuntimeVersion_9(verString)
}
}
/**
* Parses a **full** Java Runtime version string and resolves
* the version information. Uses Java 8 formatting.
*
* @param {string} verString Full version string to parse.
* @returns Object containing the version information.
*/
static _parseJavaRuntimeVersion_8(verString){
// 1.{major}.0_{update}-b{build}
// ex. 1.8.0_152-b16
const ret = {}
let pts = verString.split('-')
ret.build = parseInt(pts[1].substring(1))
pts = pts[0].split('_')
ret.update = parseInt(pts[1])
ret.major = parseInt(pts[0].split('.')[1])
return ret
}
/**
* Parses a **full** Java Runtime version string and resolves
* the version information. Uses Java 9+ formatting.
*
* @param {string} verString Full version string to parse.
* @returns Object containing the version information.
*/
static _parseJavaRuntimeVersion_9(verString){
// {major}.{minor}.{revision}+{build}
// ex. 10.0.2+13
const ret = {}
let pts = verString.split('+')
ret.build = parseInt(pts[1])
pts = pts[0].split('.')
ret.major = parseInt(pts[0])
ret.minor = parseInt(pts[1])
ret.revision = parseInt(pts[2])
return ret
}
/**
* Validates the output of a JVM's properties. Currently validates that a JRE is x64
* and that the major = 8, update > 52.
*
* @param {string} stderr The output to validate.
*
* @returns {Promise.<Object>} A promise which resolves to a meta object about the JVM.
* The validity is stored inside the `valid` property.
*/
_validateJVMProperties(stderr){
const res = stderr
const props = res.split('\n')
const goal = 2
let checksum = 0
const meta = {}
for(let i=0; i<props.length; i++){
if(props[i].indexOf('sun.arch.data.model') > -1){
let arch = props[i].split('=')[1].trim()
arch = parseInt(arch)
console.log(props[i].trim())
if(arch === 64){
meta.arch = arch
++checksum
if(checksum === goal){
break
}
}
} else if(props[i].indexOf('java.runtime.version') > -1){
let verString = props[i].split('=')[1].trim()
console.log(props[i].trim())
const verOb = JavaGuard.parseJavaRuntimeVersion(verString)
if(verOb.major < 9){
// Java 8
if(verOb.major === 8 && verOb.update > 52){
meta.version = verOb
++checksum
if(checksum === goal){
break
}
}
} else {
// Java 9+
if(Util.mcVersionAtLeast('1.13', this.mcVersion)){
console.log('Java 9+ not yet tested.')
/* meta.version = verOb
++checksum
if(checksum === goal){
break
} */
}
}
// Space included so we get only the vendor.
} else if(props[i].lastIndexOf('java.vendor ') > -1) {
let vendorName = props[i].split('=')[1].trim()
console.log(props[i].trim())
meta.vendor = vendorName
}
}
meta.valid = checksum === goal
return meta
}
/**
* Validates that a Java binary is at least 64 bit. This makes use of the non-standard
* command line option -XshowSettings:properties. The output of this contains a property,
* sun.arch.data.model = ARCH, in which ARCH is either 32 or 64. This option is supported
* in Java 8 and 9. Since this is a non-standard option. This will resolve to true if
* the function's code throws errors. That would indicate that the option is changed or
* removed.
*
* @param {string} binaryExecPath Path to the java executable we wish to validate.
*
* @returns {Promise.<Object>} A promise which resolves to a meta object about the JVM.
* The validity is stored inside the `valid` property.
*/
_validateJavaBinary(binaryExecPath){
return new Promise((resolve, reject) => {
if(!JavaGuard.isJavaExecPath(binaryExecPath)){
resolve({valid: false})
} else if(fs.existsSync(binaryExecPath)){
// Workaround (javaw.exe no longer outputs this information.)
console.log(typeof binaryExecPath)
if(binaryExecPath.indexOf('javaw.exe') > -1) {
binaryExecPath.replace('javaw.exe', 'java.exe')
}
child_process.exec('"' + binaryExecPath + '" -XshowSettings:properties', (err, stdout, stderr) => {
try {
// Output is stored in stderr?
resolve(this._validateJVMProperties(stderr))
} catch (err){
// Output format might have changed, validation cannot be completed.
resolve({valid: false})
}
})
} else {
resolve({valid: false})
}
})
}
/**
* Checks for the presence of the environment variable JAVA_HOME. If it exits, we will check
* to see if the value points to a path which exists. If the path exits, the path is returned.
*
* @returns {string} The path defined by JAVA_HOME, if it exists. Otherwise null.
*/
static _scanJavaHome(){
const jHome = process.env.JAVA_HOME
try {
let res = fs.existsSync(jHome)
return res ? jHome : null
} catch (err) {
// Malformed JAVA_HOME property.
return null
}
}
/**
* Scans the registry for 64-bit Java entries. The paths of each entry are added to
* a set and returned. Currently, only Java 8 (1.8) is supported.
*
* @returns {Promise.<Set.<string>>} A promise which resolves to a set of 64-bit Java root
* paths found in the registry.
*/
static _scanRegistry(){
return new Promise((resolve, reject) => {
// Keys for Java v9.0.0 and later:
// 'SOFTWARE\\JavaSoft\\JRE'
// 'SOFTWARE\\JavaSoft\\JDK'
// Forge does not yet support Java 9, therefore we do not.
// Keys for Java 1.8 and prior:
const regKeys = [
'\\SOFTWARE\\JavaSoft\\Java Runtime Environment',
'\\SOFTWARE\\JavaSoft\\Java Development Kit'
]
let keysDone = 0
const candidates = new Set()
for(let i=0; i<regKeys.length; i++){
const key = new Registry({
hive: Registry.HKLM,
key: regKeys[i],
arch: 'x64'
})
key.keyExists((err, exists) => {
if(exists) {
key.keys((err, javaVers) => {
if(err){
keysDone++
console.error(err)
// REG KEY DONE
// DUE TO ERROR
if(keysDone === regKeys.length){
resolve(candidates)
}
} else {
if(javaVers.length === 0){
// REG KEY DONE
// NO SUBKEYS
keysDone++
if(keysDone === regKeys.length){
resolve(candidates)
}
} else {
let numDone = 0
for(let j=0; j<javaVers.length; j++){
const javaVer = javaVers[j]
const vKey = javaVer.key.substring(javaVer.key.lastIndexOf('\\')+1)
// Only Java 8 is supported currently.
if(parseFloat(vKey) === 1.8){
javaVer.get('JavaHome', (err, res) => {
const jHome = res.value
if(jHome.indexOf('(x86)') === -1){
candidates.add(jHome)
}
// SUBKEY DONE
numDone++
if(numDone === javaVers.length){
keysDone++
if(keysDone === regKeys.length){
resolve(candidates)
}
}
})
} else {
// SUBKEY DONE
// NOT JAVA 8
numDone++
if(numDone === javaVers.length){
keysDone++
if(keysDone === regKeys.length){
resolve(candidates)
}
}
}
}
}
}
})
} else {
// REG KEY DONE
// DUE TO NON-EXISTANCE
keysDone++
if(keysDone === regKeys.length){
resolve(candidates)
}
}
})
}
})
}
/**
* See if JRE exists in the Internet Plug-Ins folder.
*
* @returns {string} The path of the JRE if found, otherwise null.
*/
static _scanInternetPlugins(){
// /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
const pth = '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin'
const res = fs.existsSync(JavaGuard.javaExecFromRoot(pth))
return res ? pth : null
}
/**
* Scan a directory for root JVM folders.
*
* @param {string} scanDir The directory to scan.
* @returns {Promise.<Set.<string>>} A promise which resolves to a set of the discovered
* root JVM folders.
*/
static async _scanFileSystem(scanDir){
let res = new Set()
if(await fs.pathExists(scanDir)) {
const files = await fs.readdir(scanDir)
for(let i=0; i<files.length; i++){
const combinedPath = path.join(scanDir, files[i])
const execPath = JavaGuard.javaExecFromRoot(combinedPath)
if(await fs.pathExists(execPath)) {
res.add(combinedPath)
}
}
}
return res
}
/**
*
* @param {Set.<string>} rootSet A set of JVM root strings to validate.
* @returns {Promise.<Object[]>} A promise which resolves to an array of meta objects
* for each valid JVM root directory.
*/
async _validateJavaRootSet(rootSet){
const rootArr = Array.from(rootSet)
const validArr = []
for(let i=0; i<rootArr.length; i++){
const execPath = JavaGuard.javaExecFromRoot(rootArr[i])
const metaOb = await this._validateJavaBinary(execPath)
if(metaOb.valid){
metaOb.execPath = execPath
validArr.push(metaOb)
}
}
return validArr
}
/**
* Sort an array of JVM meta objects. Best candidates are placed before all others.
* Sorts based on version and gives priority to JREs over JDKs if versions match.
*
* @param {Object[]} validArr An array of JVM meta objects.
* @returns {Object[]} A sorted array of JVM meta objects.
*/
static _sortValidJavaArray(validArr){
const retArr = validArr.sort((a, b) => {
if(a.version.major === b.version.major){
if(a.version.major < 9){
// Java 8
if(a.version.update === b.version.update){
if(a.version.build === b.version.build){
// Same version, give priority to JRE.
if(a.execPath.toLowerCase().indexOf('jdk') > -1){
return b.execPath.toLowerCase().indexOf('jdk') > -1 ? 0 : 1
} else {
return -1
}
} else {
return a.version.build > b.version.build ? -1 : 1
}
} else {
return a.version.update > b.version.update ? -1 : 1
}
} else {
// Java 9+
if(a.version.minor === b.version.minor){
if(a.version.revision === b.version.revision){
// Same version, give priority to JRE.
if(a.execPath.toLowerCase().indexOf('jdk') > -1){
return b.execPath.toLowerCase().indexOf('jdk') > -1 ? 0 : 1
} else {
return -1
}
} else {
return a.version.revision > b.version.revision ? -1 : 1
}
} else {
return a.version.minor > b.version.minor ? -1 : 1
}
}
} else {
return a.version.major > b.version.major ? -1 : 1
}
})
return retArr
}
/**
* Attempts to find a valid x64 installation of Java on Windows machines.
* Possible paths will be pulled from the registry and the JAVA_HOME environment
* variable. The paths will be sorted with higher versions preceeding lower, and
* JREs preceeding JDKs. The binaries at the sorted paths will then be validated.
* The first validated is returned.
*
* Higher versions > Lower versions
* If versions are equal, JRE > JDK.
*
* @param {string} dataDir The base launcher directory.
* @returns {Promise.<string>} A Promise which resolves to the executable path of a valid
* x64 Java installation. If none are found, null is returned.
*/
async _win32JavaValidate(dataDir){
// Get possible paths from the registry.
let pathSet1 = await JavaGuard._scanRegistry()
if(pathSet1.size === 0){
// Do a manual file system scan of program files.
pathSet1 = new Set([
...pathSet1,
...(await JavaGuard._scanFileSystem('C:\\Program Files\\Java')),
...(await JavaGuard._scanFileSystem('C:\\Program Files\\Eclipse Foundation')),
...(await JavaGuard._scanFileSystem('C:\\Program Files\\AdoptOpenJDK'))
])
}
// Get possible paths from the data directory.
const pathSet2 = await JavaGuard._scanFileSystem(path.join(dataDir, 'runtime', 'x64'))
// Merge the results.
const uberSet = new Set([...pathSet1, ...pathSet2])
// Validate JAVA_HOME.
const jHome = JavaGuard._scanJavaHome()
if(jHome != null && jHome.indexOf('(x86)') === -1){
uberSet.add(jHome)
}
let pathArr = await this._validateJavaRootSet(uberSet)
pathArr = JavaGuard._sortValidJavaArray(pathArr)
if(pathArr.length > 0){
return pathArr[0].execPath
} else {
return null
}
}
/**
* Attempts to find a valid x64 installation of Java on MacOS.
* The system JVM directory is scanned for possible installations.
* The JAVA_HOME enviroment variable and internet plugins directory
* are also scanned and validated.
*
* Higher versions > Lower versions
* If versions are equal, JRE > JDK.
*
* @param {string} dataDir The base launcher directory.
* @returns {Promise.<string>} A Promise which resolves to the executable path of a valid
* x64 Java installation. If none are found, null is returned.
*/
async _darwinJavaValidate(dataDir){
const pathSet1 = await JavaGuard._scanFileSystem('/Library/Java/JavaVirtualMachines')
const pathSet2 = await JavaGuard._scanFileSystem(path.join(dataDir, 'runtime', 'x64'))
const uberSet = new Set([...pathSet1, ...pathSet2])
// Check Internet Plugins folder.
const iPPath = JavaGuard._scanInternetPlugins()
if(iPPath != null){
uberSet.add(iPPath)
}
// Check the JAVA_HOME environment variable.
let jHome = JavaGuard._scanJavaHome()
if(jHome != null){
// Ensure we are at the absolute root.
if(jHome.contains('/Contents/Home')){
jHome = jHome.substring(0, jHome.indexOf('/Contents/Home'))
}
uberSet.add(jHome)
}
let pathArr = await this._validateJavaRootSet(uberSet)
pathArr = JavaGuard._sortValidJavaArray(pathArr)
if(pathArr.length > 0){
return pathArr[0].execPath
} else {
return null
}
}
/**
* Attempts to find a valid x64 installation of Java on Linux.
* The system JVM directory is scanned for possible installations.
* The JAVA_HOME enviroment variable is also scanned and validated.
*
* Higher versions > Lower versions
* If versions are equal, JRE > JDK.
*
* @param {string} dataDir The base launcher directory.
* @returns {Promise.<string>} A Promise which resolves to the executable path of a valid
* x64 Java installation. If none are found, null is returned.
*/
async _linuxJavaValidate(dataDir){
const pathSet1 = await JavaGuard._scanFileSystem('/usr/lib/jvm')
const pathSet2 = await JavaGuard._scanFileSystem(path.join(dataDir, 'runtime', 'x64'))
const uberSet = new Set([...pathSet1, ...pathSet2])
// Validate JAVA_HOME
const jHome = JavaGuard._scanJavaHome()
if(jHome != null){
uberSet.add(jHome)
}
let pathArr = await this._validateJavaRootSet(uberSet)
pathArr = JavaGuard._sortValidJavaArray(pathArr)
if(pathArr.length > 0){
return pathArr[0].execPath
} else {
return null
}
}
/**
* Retrieve the path of a valid x64 Java installation.
*
* @param {string} dataDir The base launcher directory.
* @returns {string} A path to a valid x64 Java installation, null if none found.
*/
async validateJava(dataDir){
return await this['_' + process.platform + 'JavaValidate'](dataDir)
}
}
/**
* Central object class used for control flow. This object stores data about
* categories of downloads. Each category is assigned an identifier with a
* DLTracker object as its value. Combined information is also stored, such as
* the total size of all the queued files in each category. This event is used
* to emit events so that external modules can listen into processing done in
* this module.
*/
class AssetGuard extends EventEmitter {
/**
* Create an instance of AssetGuard.
* On creation the object's properties are never-null default
* values. Each identifier is resolved to an empty DLTracker.
*
* @param {string} commonPath The common path for shared game files.
* @param {string} javaexec The path to a java executable which will be used
* to finalize installation.
*/
constructor(commonPath, javaexec){
super()
this.totaldlsize = 0
this.progress = 0
this.assets = new DLTracker([], 0)
this.libraries = new DLTracker([], 0)
this.files = new DLTracker([], 0)
this.forge = new DLTracker([], 0)
this.java = new DLTracker([], 0)
this.extractQueue = []
this.commonPath = commonPath
this.javaexec = javaexec
}
// Static Utility Functions
// #region
// Static Hash Validation Functions
// #region
/**
* Calculates the hash for a file using the specified algorithm.
*
* @param {Buffer} buf The buffer containing file data.
* @param {string} algo The hash algorithm.
* @returns {string} The calculated hash in hex.
*/
static _calculateHash(buf, algo){
return crypto.createHash(algo).update(buf).digest('hex')
}
/**
* Used to parse a checksums file. This is specifically designed for
* the checksums.sha1 files found inside the forge scala dependencies.
*
* @param {string} content The string content of the checksums file.
* @returns {Object} An object with keys being the file names, and values being the hashes.
*/
static _parseChecksumsFile(content){
let finalContent = {}
let lines = content.split('\n')
for(let i=0; i<lines.length; i++){
let bits = lines[i].split(' ')
if(bits[1] == null) {
continue
}
finalContent[bits[1]] = bits[0]
}
return finalContent
}
/**
* Validate that a file exists and matches a given hash value.
*
* @param {string} filePath The path of the file to validate.
* @param {string} algo The hash algorithm to check against.
* @param {string} hash The existing hash to check against.
* @returns {boolean} True if the file exists and calculated hash matches the given hash, otherwise false.
*/
static _validateLocal(filePath, algo, hash){
if(fs.existsSync(filePath)){
//No hash provided, have to assume it's good.
if(hash == null){
return true
}
let buf = fs.readFileSync(filePath)
let calcdhash = AssetGuard._calculateHash(buf, algo)
return calcdhash === hash.toLowerCase()
}
return false
}
/**
* Validates a file in the style used by forge's version index.
*
* @param {string} filePath The path of the file to validate.
* @param {Array.<string>} checksums The checksums listed in the forge version index.
* @returns {boolean} True if the file exists and the hashes match, otherwise false.
*/
static _validateForgeChecksum(filePath, checksums){
if(fs.existsSync(filePath)){
if(checksums == null || checksums.length === 0){
return true
}
let buf = fs.readFileSync(filePath)
let calcdhash = AssetGuard._calculateHash(buf, 'sha1')
let valid = checksums.includes(calcdhash)
if(!valid && filePath.endsWith('.jar')){
valid = AssetGuard._validateForgeJar(filePath, checksums)
}
return valid
}
return false
}
/**
* Validates a forge jar file dependency who declares a checksums.sha1 file.
* This can be an expensive task as it usually requires that we calculate thousands
* of hashes.
*
* @param {Buffer} buf The buffer of the jar file.
* @param {Array.<string>} checksums The checksums listed in the forge version index.
* @returns {boolean} True if all hashes declared in the checksums.sha1 file match the actual hashes.
*/
static _validateForgeJar(buf, checksums){
// Double pass method was the quickest I found. I tried a version where we store data
// to only require a single pass, plus some quick cleanup but that seemed to take slightly more time.
const hashes = {}
let expected = {}
const zip = new AdmZip(buf)
const zipEntries = zip.getEntries()
//First pass
for(let i=0; i<zipEntries.length; i++){
let entry = zipEntries[i]
if(entry.entryName === 'checksums.sha1'){
expected = AssetGuard._parseChecksumsFile(zip.readAsText(entry))
}
hashes[entry.entryName] = AssetGuard._calculateHash(entry.getData(), 'sha1')
}
if(!checksums.includes(hashes['checksums.sha1'])){
return false
}
//Check against expected
const expectedEntries = Object.keys(expected)
for(let i=0; i<expectedEntries.length; i++){
if(expected[expectedEntries[i]] !== hashes[expectedEntries[i]]){
return false
}
}
return true
}
// #endregion
// Miscellaneous Static Functions
// #region
/**
* Extracts and unpacks a file from .pack.xz format.
*
* @param {Array.<string>} filePaths The paths of the files to be extracted and unpacked.
* @returns {Promise.<void>} An empty promise to indicate the extraction has completed.
*/
static _extractPackXZ(filePaths, javaExecutable){
console.log('[PackXZExtract] Starting')
return new Promise((resolve, reject) => {
let libPath
if(isDev){
libPath = path.join(process.cwd(), 'libraries', 'java', 'PackXZExtract.jar')
} else {
if(process.platform === 'darwin'){
libPath = path.join(process.cwd(),'Contents', 'Resources', 'libraries', 'java', 'PackXZExtract.jar')
} else {
libPath = path.join(process.cwd(), 'resources', 'libraries', 'java', 'PackXZExtract.jar')
}
}
const filePath = filePaths.join(',')
const child = child_process.spawn(javaExecutable, ['-jar', libPath, '-packxz', filePath])
child.stdout.on('data', (data) => {
console.log('[PackXZExtract]', data.toString('utf8'))
})
child.stderr.on('data', (data) => {
console.log('[PackXZExtract]', data.toString('utf8'))
})
child.on('close', (code, signal) => {
console.log('[PackXZExtract]', 'Exited with code', code)
resolve()
})
})
}
/**
* Function which finalizes the forge installation process. This creates a 'version'
* instance for forge and saves its version.json file into that instance. If that
* instance already exists, the contents of the version.json file are read and returned
* in a promise.
*
* @param {Asset} asset The Asset object representing Forge.
* @param {string} commonPath The common path for shared game files.
* @returns {Promise.<Object>} A promise which resolves to the contents of forge's version.json.
*/
static _finalizeForgeAsset(asset, commonPath){
return new Promise((resolve, reject) => {
fs.readFile(asset.to, (err, data) => {
const zip = new AdmZip(data)
const zipEntries = zip.getEntries()
for(let i=0; i<zipEntries.length; i++){
if(zipEntries[i].entryName === 'version.json'){
const forgeVersion = JSON.parse(zip.readAsText(zipEntries[i]))
const versionPath = path.join(commonPath, 'versions', forgeVersion.id)
const versionFile = path.join(versionPath, forgeVersion.id + '.json')
if(!fs.existsSync(versionFile)){
fs.ensureDirSync(versionPath)
fs.writeFileSync(path.join(versionPath, forgeVersion.id + '.json'), zipEntries[i].getData())
resolve(forgeVersion)
} else {
//Read the saved file to allow for user modifications.
resolve(JSON.parse(fs.readFileSync(versionFile, 'utf-8')))
}
return
}
}
//We didn't find forge's version.json.
reject('Unable to finalize Forge processing, version.json not found! Has forge changed their format?')
})
})
}
// #endregion
// #endregion
// Validation Functions
// #region
/**
* Loads the version data for a given minecraft version.
*
* @param {string} version The game version for which to load the index data.
* @param {boolean} force Optional. If true, the version index will be downloaded even if it exists locally. Defaults to false.
* @returns {Promise.<Object>} Promise which resolves to the version data object.
*/
loadVersionData(version, force = false){
const self = this
return new Promise(async (resolve, reject) => {
const versionPath = path.join(self.commonPath, 'versions', version)
const versionFile = path.join(versionPath, version + '.json')
if(!fs.existsSync(versionFile) || force){
const url = await self._getVersionDataUrl(version)
//This download will never be tracked as it's essential and trivial.
console.log('Preparing download of ' + version + ' assets.')
fs.ensureDirSync(versionPath)
const stream = request(url).pipe(fs.createWriteStream(versionFile))
stream.on('finish', () => {
resolve(JSON.parse(fs.readFileSync(versionFile)))
})
} else {
resolve(JSON.parse(fs.readFileSync(versionFile)))
}
})
}
/**
* Parses Mojang's version manifest and retrieves the url of the version
* data index.
*
* @param {string} version The version to lookup.
* @returns {Promise.<string>} Promise which resolves to the url of the version data index.
* If the version could not be found, resolves to null.
*/
_getVersionDataUrl(version){
return new Promise((resolve, reject) => {
request('https://launchermeta.mojang.com/mc/game/version_manifest.json', (error, resp, body) => {
if(error){
reject(error)
} else {
const manifest = JSON.parse(body)
for(let v of manifest.versions){
if(v.id === version){
resolve(v.url)
}
}
resolve(null)
}
})
})
}
// Asset (Category=''') Validation Functions
// #region
/**
* Public asset validation function. This function will handle the validation of assets.
* It will parse the asset index specified in the version data, analyzing each
* asset entry. In this analysis it will check to see if the local file exists and is valid.
* If not, it will be added to the download queue for the 'assets' identifier.
*
* @param {Object} versionData The version data for the assets.
* @param {boolean} force Optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
*/
validateAssets(versionData, force = false){
const self = this
return new Promise((resolve, reject) => {
self._assetChainIndexData(versionData, force).then(() => {
resolve()
})
})
}
//Chain the asset tasks to provide full async. The below functions are private.
/**
* Private function used to chain the asset validation process. This function retrieves
* the index data.
* @param {Object} versionData
* @param {boolean} force
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
*/
_assetChainIndexData(versionData, force = false){
const self = this
return new Promise((resolve, reject) => {
//Asset index constants.
const assetIndex = versionData.assetIndex
const name = assetIndex.id + '.json'
const indexPath = path.join(self.commonPath, 'assets', 'indexes')
const assetIndexLoc = path.join(indexPath, name)
let data = null
if(!fs.existsSync(assetIndexLoc) || force){
console.log('Downloading ' + versionData.id + ' asset index.')
fs.ensureDirSync(indexPath)
const stream = request(assetIndex.url).pipe(fs.createWriteStream(assetIndexLoc))
stream.on('finish', () => {
data = JSON.parse(fs.readFileSync(assetIndexLoc, 'utf-8'))
self._assetChainValidateAssets(versionData, data).then(() => {
resolve()
})
})
} else {
data = JSON.parse(fs.readFileSync(assetIndexLoc, 'utf-8'))
self._assetChainValidateAssets(versionData, data).then(() => {
resolve()
})
}
})
}
/**
* Private function used to chain the asset validation process. This function processes
* the assets and enqueues missing or invalid files.
* @param {Object} versionData
* @param {boolean} force
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
*/
_assetChainValidateAssets(versionData, indexData){
const self = this
return new Promise((resolve, reject) => {
//Asset constants
const resourceURL = 'https://resources.download.minecraft.net/'
const localPath = path.join(self.commonPath, 'assets')
const objectPath = path.join(localPath, 'objects')
const assetDlQueue = []
let dlSize = 0
let acc = 0
const total = Object.keys(indexData.objects).length
//const objKeys = Object.keys(data.objects)
async.forEachOfLimit(indexData.objects, 10, (value, key, cb) => {
acc++
self.emit('progress', 'assets', acc, total)
const hash = value.hash
const assetName = path.join(hash.substring(0, 2), hash)
const urlName = hash.substring(0, 2) + '/' + hash
const ast = new Asset(key, hash, value.size, resourceURL + urlName, path.join(objectPath, assetName))
if(!AssetGuard._validateLocal(ast.to, 'sha1', ast.hash)){
dlSize += (ast.size*1)
assetDlQueue.push(ast)
}
cb()
}, (err) => {
self.assets = new DLTracker(assetDlQueue, dlSize)
resolve()
})
})
}
// #endregion
// Library (Category=''') Validation Functions
// #region
/**
* Public library validation function. This function will handle the validation of libraries.
* It will parse the version data, analyzing each library entry. In this analysis, it will
* check to see if the local file exists and is valid. If not, it will be added to the download
* queue for the 'libraries' identifier.
*
* @param {Object} versionData The version data for the assets.
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
*/
validateLibraries(versionData){
const self = this
return new Promise((resolve, reject) => {
const libArr = versionData.libraries
const libPath = path.join(self.commonPath, 'libraries')
const libDlQueue = []
let dlSize = 0
//Check validity of each library. If the hashs don't match, download the library.
async.eachLimit(libArr, 5, (lib, cb) => {
if(Library.validateRules(lib.rules, lib.natives)){
let artifact = (lib.natives == null) ? lib.downloads.artifact : lib.downloads.classifiers[lib.natives[Library.mojangFriendlyOS()].replace('${arch}', process.arch.replace('x', ''))]
const libItm = new Library(lib.name, artifact.sha1, artifact.size, artifact.url, path.join(libPath, artifact.path))
if(!AssetGuard._validateLocal(libItm.to, 'sha1', libItm.hash)){
dlSize += (libItm.size*1)
libDlQueue.push(libItm)
}
}
cb()
}, (err) => {
self.libraries = new DLTracker(libDlQueue, dlSize)
resolve()
})
})
}
// #endregion
// Miscellaneous (Category=files) Validation Functions
// #region
/**
* Public miscellaneous mojang file validation function. These files will be enqueued under
* the 'files' identifier.
*
* @param {Object} versionData The version data for the assets.
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
*/
validateMiscellaneous(versionData){
const self = this
return new Promise(async (resolve, reject) => {
await self.validateClient(versionData)
await self.validateLogConfig(versionData)
resolve()
})
}
/**
* Validate client file - artifact renamed from client.jar to '{version}'.jar.
*
* @param {Object} versionData The version data for the assets.
* @param {boolean} force Optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
*/
validateClient(versionData, force = false){
const self = this
return new Promise((resolve, reject) => {
const clientData = versionData.downloads.client
const version = versionData.id
const targetPath = path.join(self.commonPath, 'versions', version)
const targetFile = version + '.jar'
let client = new Asset(version + ' client', clientData.sha1, clientData.size, clientData.url, path.join(targetPath, targetFile))
if(!AssetGuard._validateLocal(client.to, 'sha1', client.hash) || force){
self.files.dlqueue.push(client)
self.files.dlsize += client.size*1
resolve()
} else {
resolve()
}
})
}
/**
* Validate log config.
*
* @param {Object} versionData The version data for the assets.
* @param {boolean} force Optional. If true, the asset index will be downloaded even if it exists locally. Defaults to false.
* @returns {Promise.<void>} An empty promise to indicate the async processing has completed.
*/
validateLogConfig(versionData){
const self = this
return new Promise((resolve, reject) => {
const client = versionData.logging.client
const file = client.file
const targetPath = path.join(self.commonPath, 'assets', 'log_configs')
let logConfig = new Asset(file.id, file.sha1, file.size, file.url, path.join(targetPath, file.id))
if(!AssetGuard._validateLocal(logConfig.to, 'sha1', logConfig.hash)){
self.files.dlqueue.push(logConfig)
self.files.dlsize += logConfig.size*1
resolve()
} else {
resolve()
}
})
}
// #endregion
// Distribution (Category=forge) Validation Functions
// #region
/**
* Validate the distribution.
*
* @param {Server} server The Server to validate.
* @returns {Promise.<Object>} A promise which resolves to the server distribution object.
*/
validateDistribution(server){
const self = this
return new Promise((resolve, reject) => {
self.forge = self._parseDistroModules(server.getModules(), server.getMinecraftVersion(), server.getID())
resolve(server)
})
}
_parseDistroModules(modules, version, servid){
let alist = []
let asize = 0
for(let ob of modules){
let obArtifact = ob.getArtifact()
let obPath = obArtifact.getPath()
let artifact = new DistroModule(ob.getIdentifier(), obArtifact.getHash(), obArtifact.getSize(), obArtifact.getURL(), obPath, ob.getType())
const validationPath = obPath.toLowerCase().endsWith('.pack.xz') ? obPath.substring(0, obPath.toLowerCase().lastIndexOf('.pack.xz')) : obPath
if(!AssetGuard._validateLocal(validationPath, 'MD5', artifact.hash)){
asize += artifact.size*1
alist.push(artifact)
if(validationPath !== obPath) this.extractQueue.push(obPath)
}
//Recursively process the submodules then combine the results.
if(ob.getSubModules() != null){
let dltrack = this._parseDistroModules(ob.getSubModules(), version, servid)
asize += dltrack.dlsize*1
alist = alist.concat(dltrack.dlqueue)
}
}
return new DLTracker(alist, asize)
}
/**
* Loads Forge's version.json data into memory for the specified server id.
*
* @param {string} server The Server to load Forge data for.
* @returns {Promise.<Object>} A promise which resolves to Forge's version.json data.
*/
loadForgeData(server){
const self = this
return new Promise(async (resolve, reject) => {
const modules = server.getModules()
for(let ob of modules){
const type = ob.getType()
if(type === DistroManager.Types.ForgeHosted || type === DistroManager.Types.Forge){
if(Util.isForgeGradle3(server.getMinecraftVersion(), ob.getVersion())){
// Read Manifest
for(let sub of ob.getSubModules()){
if(sub.getType() === DistroManager.Types.VersionManifest){
resolve(JSON.parse(fs.readFileSync(sub.getArtifact().getPath(), 'utf-8')))
return
}
}
reject('No forge version manifest found!')
return
} else {
let obArtifact = ob.getArtifact()
let obPath = obArtifact.getPath()
let asset = new DistroModule(ob.getIdentifier(), obArtifact.getHash(), obArtifact.getSize(), obArtifact.getURL(), obPath, type)
try {
let forgeData = await AssetGuard._finalizeForgeAsset(asset, self.commonPath)
resolve(forgeData)
} catch (err){
reject(err)
}
return
}
}
}
reject('No forge module found!')
})
}
_parseForgeLibraries(){
/* TODO
* Forge asset validations are already implemented. When there's nothing much
* to work on, implement forge downloads using forge's version.json. This is to
* have the code on standby if we ever need it (since it's half implemented already).
*/
}
// #endregion
// Java (Category=''') Validation (download) Functions
// #region
_enqueueOpenJDK(dataDir){
return new Promise((resolve, reject) => {
JavaGuard._latestOpenJDK('8').then(verData => {
if(verData != null){
dataDir = path.join(dataDir, 'runtime', 'x64')
const fDir = path.join(dataDir, verData.name)
const jre = new Asset(verData.name, null, verData.size, verData.uri, fDir)
this.java = new DLTracker([jre], jre.size, (a, self) => {
if(verData.name.endsWith('zip')){
this._extractJdkZip(a.to, dataDir, self)
} else {
// Tar.gz
let h = null
fs.createReadStream(a.to)
.on('error', err => console.log(err))
.pipe(zlib.createGunzip())
.on('error', err => console.log(err))
.pipe(tar.extract(dataDir, {
map: (header) => {
if(h == null){
h = header.name
}
}
}))
.on('error', err => console.log(err))
.on('finish', () => {
fs.unlink(a.to, err => {
if(err){
console.log(err)
}
if(h.indexOf('/') > -1){
h = h.substring(0, h.indexOf('/'))
}
const pos = path.join(dataDir, h)
self.emit('complete', 'java', JavaGuard.javaExecFromRoot(pos))
})
})
}
})
resolve(true)
} else {
resolve(false)
}
})
})
}
async _extractJdkZip(zipPath, runtimeDir, self) {
const zip = new StreamZip.async({
file: zipPath,
storeEntries: true
})
let pos = ''
try {
const entries = await zip.entries()
pos = path.join(runtimeDir, Object.keys(entries)[0])
console.log('Extracting jdk..')
await zip.extract(null, runtimeDir)
console.log('Cleaning up..')
await fs.remove(zipPath)
console.log('Jdk extraction complete.')
} catch(err) {
console.log(err)
} finally {
zip.close()
self.emit('complete', 'java', JavaGuard.javaExecFromRoot(pos))
}
}
// _enqueueMojangJRE(dir){
// return new Promise((resolve, reject) => {
// // Mojang does not host the JRE for linux.
// if(process.platform === 'linux'){
// resolve(false)
// }
// AssetGuard.loadMojangLauncherData().then(data => {
// if(data != null) {
// try {
// const mJRE = data[Library.mojangFriendlyOS()]['64'].jre
// const url = mJRE.url
// request.head(url, (err, resp, body) => {
// if(err){
// resolve(false)
// } else {
// const name = url.substring(url.lastIndexOf('/')+1)
// const fDir = path.join(dir, name)
// const jre = new Asset('jre' + mJRE.version, mJRE.sha1, resp.headers['content-length'], url, fDir)
// this.java = new DLTracker([jre], jre.size, a => {
// fs.readFile(a.to, (err, data) => {
// // Data buffer needs to be decompressed from lzma,
// // not really possible using node.js
// })
// })
// }
// })
// } catch (err){
// resolve(false)
// }
// }
// })
// })
// }
// #endregion
// #endregion
// Control Flow Functions
// #region
/**
* Initiate an async download process for an AssetGuard DLTracker.
*
* @param {string} identifier The identifier of the AssetGuard DLTracker.
* @param {number} limit Optional. The number of async processes to run in parallel.
* @returns {boolean} True if the process began, otherwise false.
*/
startAsyncProcess(identifier, limit = 5){
const self = this
const dlTracker = this[identifier]
const dlQueue = dlTracker.dlqueue
if(dlQueue.length > 0){
console.log('DLQueue', dlQueue)
async.eachLimit(dlQueue, limit, (asset, cb) => {
fs.ensureDirSync(path.join(asset.to, '..'))
let req = request(asset.from)
req.pause()
req.on('response', (resp) => {
if(resp.statusCode === 200){
let doHashCheck = false
const contentLength = parseInt(resp.headers['content-length'])
if(contentLength !== asset.size){
console.log(`WARN: Got ${contentLength} bytes for ${asset.id}: Expected ${asset.size}`)
doHashCheck = true
// Adjust download
this.totaldlsize -= asset.size
this.totaldlsize += contentLength
}
let writeStream = fs.createWriteStream(asset.to)
writeStream.on('close', () => {
if(dlTracker.callback != null){
dlTracker.callback.apply(dlTracker, [asset, self])
}
if(doHashCheck){
const v = AssetGuard._validateLocal(asset.to, asset.type != null ? 'md5' : 'sha1', asset.hash)
if(v){
console.log(`Hashes match for ${asset.id}, byte mismatch is an issue in the distro index.`)
} else {
console.error(`Hashes do not match, ${asset.id} may be corrupted.`)
}
}
cb()
})
req.pipe(writeStream)
req.resume()
} else {
req.abort()
console.log(`Failed to download ${asset.id}(${typeof asset.from === 'object' ? asset.from.url : asset.from}). Response code ${resp.statusCode}`)
self.progress += asset.size*1
self.emit('progress', 'download', self.progress, self.totaldlsize)
cb()
}
})
req.on('error', (err) => {
self.emit('error', 'download', err)
})
req.on('data', (chunk) => {
self.progress += chunk.length
self.emit('progress', 'download', self.progress, self.totaldlsize)
})
}, (err) => {
if(err){
console.log('An item in ' + identifier + ' failed to process')
} else {
console.log('All ' + identifier + ' have been processed successfully')
}
//self.totaldlsize -= dlTracker.dlsize
//self.progress -= dlTracker.dlsize
self[identifier] = new DLTracker([], 0)
if(self.progress >= self.totaldlsize) {
if(self.extractQueue.length > 0){
self.emit('progress', 'extract', 1, 1)
//self.emit('extracting')
AssetGuard._extractPackXZ(self.extractQueue, self.javaexec).then(() => {
self.extractQueue = []
self.emit('complete', 'download')
})
} else {
self.emit('complete', 'download')
}
}
})
return true
} else {
return false
}
}
/**
* This function will initiate the download processed for the specified identifiers. If no argument is
* given, all identifiers will be initiated. Note that in order for files to be processed you need to run
* the processing function corresponding to that identifier. If you run this function without processing
* the files, it is likely nothing will be enqueued in the object and processing will complete
* immediately. Once all downloads are complete, this function will fire the 'complete' event on the
* global object instance.
*
* @param {Array.<{id: string, limit: number}>} identifiers Optional. The identifiers to process and corresponding parallel async task limit.
*/
processDlQueues(identifiers = [{id:'assets', limit:20}, {id:'libraries', limit:5}, {id:'files', limit:5}, {id:'forge', limit:5}]){
return new Promise((resolve, reject) => {
let shouldFire = true
// Assign dltracking variables.
this.totaldlsize = 0
this.progress = 0
for(let iden of identifiers){
this.totaldlsize += this[iden.id].dlsize
}
this.once('complete', (data) => {
resolve()
})
for(let iden of identifiers){
let r = this.startAsyncProcess(iden.id, iden.limit)
if(r) shouldFire = false
}
if(shouldFire){
this.emit('complete', 'download')
}
})
}
async validateEverything(serverid, dev = false){
try {
if(!ConfigManager.isLoaded()){
ConfigManager.load()
}
DistroManager.setDevMode(dev)
const dI = await DistroManager.pullLocal()
const server = dI.getServer(serverid)
// Validate Everything
await this.validateDistribution(server)
this.emit('validate', 'distribution')
const versionData = await this.loadVersionData(server.getMinecraftVersion())
this.emit('validate', 'version')
await this.validateAssets(versionData)
this.emit('validate', 'assets')
await this.validateLibraries(versionData)
this.emit('validate', 'libraries')
await this.validateMiscellaneous(versionData)
this.emit('validate', 'files')
await this.processDlQueues()
//this.emit('complete', 'download')
const forgeData = await this.loadForgeData(server)
return {
versionData,
forgeData
}
} catch (err){
return {
versionData: null,
forgeData: null,
error: err
}
}
}
// #endregion
}
module.exports = {
Util,
AssetGuard,
JavaGuard,
Asset,
Library
}
|
const router = require('express').Router();
const { User } = require('../../models');
router.post('/', async (req, res) => {
try {
const newUser = await User.create({
username: req.body.username,
password: req.body.password,
});
req.session.save(() => {
req.session.userId = newUser.id;
req.session.username = newUser.username;
req.session.loggedIn = true;
res.json(newUser);
});
} catch (err) {
res.status(500).json(err);
}
});
router.post('/login', async (req, res) => {
try {
const user = await User.findOne({
where: {
username: req.body.username,
},
});
if (!user) {
res.status(400).json({ message: 'No user found!' });
return;
}
const validPassword = user.checkPassword(req.body.password);
if (!validPassword) {
res.status(400).json({ message: 'No user found!' });
return;
}
req.session.save(() => {
req.session.userId = user.id;
req.session.username = user.username;
req.session.loggedIn = true;
res.json({ user, message: 'You are logged in!' });
});
} catch (err) {
res.status(400).json({ message: 'No user found!' });
}
});
router.post('/logout', (req, res) => {
if (req.session.loggedIn) {
req.session.destroy(() => {
res.status(204).end();
});
} else {
res.status(404).end();
}
});
module.exports = router;
|
// Generated by BUCKLESCRIPT VERSION 4.0.5, PLEASE EDIT WITH CARE
'use strict';
var ReasonReact = require("reason-react/src/ReasonReact.js");
var GatsbyLink = require("gatsby-link");
function make(to_, children) {
return ReasonReact.wrapJsForReason(GatsbyLink.default, {
to: to_
}, children);
}
exports.make = make;
/* ReasonReact Not a pure module */
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _BaseComponent2 = _interopRequireDefault(require("./BaseComponent"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
var Cursor =
/*#__PURE__*/
function (_BaseComponent) {
_inherits(Cursor, _BaseComponent);
function Cursor(root, props) {
_classCallCheck(this, Cursor);
return _possibleConstructorReturn(this, _getPrototypeOf(Cursor).call(this, root, props));
}
_createClass(Cursor, [{
key: "appendChild",
value: function appendChild(child) {
if (child !== undefined && child !== null) {
// eslint-disable-next-line no-console
console.error('<cursor /> does not accept children! Received:', child);
} // set this.position based off root's current position
this.position = [this.root.position[0], this.root.position[1]];
console.log('cursor position', this.position);
}
}, {
key: "replaceChild",
value: function replaceChild(child) {
if (child !== undefined && child !== null) {
// eslint-disable-next-line no-console
console.error('<cursor /> does not accept children! Received:', child);
}
}
}, {
key: "updatePosition",
value: function updatePosition(deltaRow, deltaCol) {
this.position = [this.position[0] + deltaRow, this.position[1] + deltaCol];
console.log('cursor position', this.position);
}
}, {
key: "removeSelf",
value: function removeSelf() {
/* noop */
}
}]);
return Cursor;
}(_BaseComponent2["default"]);
var _default = Cursor;
exports["default"] = _default;
|
var frank = require('../lib/frank'),
server = frank();
server
.get('/')
.render('jade', './public/text.jade', {
name: 'murilo',
email: 'mvrilo@gmail.com'
});
server
.get('/jade')
.render('./public/text.jade', { // this also works!
name: 'murilo',
email: 'mvrilo@gmail.com'
});
server.listen(8000)
|
/*
An S3 uploader with some useful default settings for Zooniverse static files.
Accepts an S3 path, relative to zooniverse-static, as its only argument.
Usage example: node upload.js preview.zooniverse.org/panoptes-front-end/pr-1234
*/
const Uploader = require('s3-batch-upload').default;
const args = process.argv.slice(2);
const remotePath = args[args.length - 1];
async function uploadBuild() {
const uploader = new Uploader({
bucket: 'zooniverse-static',
localPath: './dist',
remotePath,
concurrency: '200',
cacheControl: {
'**/index.html': 'max-age=60, s-maxage=60',
'**/*.*': 'public, max-age=604800, immutable'
},
accessControlLevel: 'public-read'
})
const files = await uploader.upload()
console.log('Uploaded to S3')
console.log(files.join('\n'))
}
uploadBuild();
|
import React from 'react';
import './Up&BottomMenu.css';
import UpMenu from '../components/SMenuBar';
import ConduMiTaxiAdd from '../components/CConduMiTaxiAdd';
import BottomMenu from '../components/BottomMenuBar';
import { withRouter } from 'react-router-dom';
class ConduMiTaxiAddPage extends React.Component{
render(){
return(
<div className='main-containerBlack'>
<div className='main-container'>
<UpMenu />
<ConduMiTaxiAdd />
</div>
<BottomMenu />
</div>
)
}
}
export default withRouter(ConduMiTaxiAddPage)
|
/*!
* Copyright 2017 Telerik AD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
!function(e){"function"==typeof define&&define.amd?define(["kendo.core.min"],e):e()}(function(){!function(e,M){kendo.cultures["tn-ZA"]={name:"tn-ZA",numberFormat:{pattern:["-n"],decimals:2,",":" ",".":".",groupSize:[3],percent:{pattern:["-n%","n%"],decimals:2,",":" ",".":".",groupSize:[3],symbol:"%"},currency:{name:"South African Rand",abbr:"ZAR",pattern:["-$n","$n"],decimals:2,",":" ",".":".",groupSize:[3],symbol:"R"}},calendars:{standard:{days:{names:["Tshipi","Mosopulogo","Labobedi","Laboraro","Labone","Labotlhano","Matlhatso"],namesAbbr:["Tsh","Mos","Bed","Rar","Ne","Tla","Mat"],namesShort:["Tsh","Mos","Bed","Rar","Ne","Tla","Mat"]},months:{names:["Ferikgong","Tlhakole","Mopitlo","Moranang","Motsheganang","Seetebosigo","Phukwi","Phatwe","Lwetse","Diphalane","Ngwanatsele","Sedimonthole"],namesAbbr:["Fer","Tlh","Mop","Mor","Mot","See","Phu","Pha","Lwe","Dip","Ngw","Sed"]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"yyyy-MM-dd",D:"yyyy MMMM d, dddd",F:"yyyy MMMM d, dddd HH:mm:ss",g:"yyyy-MM-dd HH:mm",G:"yyyy-MM-dd HH:mm:ss",m:"MMMM d",M:"MMMM d",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"HH:mm",T:"HH:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"yyyy MMMM",Y:"yyyy MMMM"},"/":"-",":":":",firstDay:0}}}}(this)});
//# sourceMappingURL=kendo.culture.tn-ZA.min.js.map
|
import React from 'react';
import ReactDOM from 'react-dom';
import './styles/app.css';
import AppRouter from './routers/AppRouter';
ReactDOM.render(
<React.StrictMode>
<AppRouter />
</React.StrictMode>,
document.getElementById('root'),
);
|
/**
@param {object} user - The user being created
@param {string} user.id - user id
@param {string} user.tenant - Auth0 tenant name
@param {string} user.username - user name
@param {string} user.email - email
@param {boolean} user.emailVerified - is e-mail verified?
@param {string} user.phoneNumber - phone number
@param {boolean} user.phoneNumberVerified - is phone number verified?
@param {object} user.user_metadata - user metadata
@param {object} user.app_metadata - application metadata
@param {object} context - Auth0 connection and other context info
@param {string} context.requestLanguage - language of the client agent
@param {object} context.connection - information about the Auth0 connection
@param {object} context.connection.id - connection id
@param {object} context.connection.name - connection name
@param {object} context.connection.tenant - connection tenant
@param {object} context.webtask - webtask context
@param {function} cb - function (error, response)
*/
/*
* We require an email list to be present at Gather already.
* If the list is not there, we do *not* create one.
*
* THIS IS A FEATURE. It prevents Auth0 from creating a new
* partial list if we delete the Gather list on purpose.
*
* NOTE:
* apiKey/spaceId need to match our happy virtual home.
*
* This will fail silently if it doesn't work, with no
* messages apparing in any log. I don't see any
* way to log this, barring send a second message to another server.
* That doesn't seem worth it.
*/
module.exports = function (user, context, cb) {
const request = require('request');
request.post(
{
url: 'https://gather.town/api/setEmailGuestlist',
json: {
"overwrite": false, // list must exist already.
"apiKey": "...",
"spaceId": "aaaaaaaaaaaa\\pldi21",
"guestlist": {
// If we provide the name, then users cant' change it to add
// affiliation, etc. So, provide empty map without the name.
// This seems to work, but watch for issues...
// [user.email] : { name: user.user_metadata.nname }
[user.email] : { }
}
}
},
(err, response, body) => {
console.log(body);
});
cb();
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.