text
stringlengths 3
1.05M
|
|---|
# Bayesian model selection demo for polynomial regression
# This illustartes that if we have more data, Bayes picks a more complex model.
# Based on a demo by Zoubin Ghahramani
import numpy as np
import matplotlib.pyplot as plt
import os
figdir = "../figures"
def save_fig(fname): plt.savefig(os.path.join(figdir, fname))
import random
random.seed(0)
Ns = [5, 30] #Number of points
degs = [1, 2, 3] #Degrees of linear regression models.
def polyBasis(x, deg):
#Takes a vector and returns a polynomial basis matrix up to degree deg (not including ones)
return(np.column_stack([x**deg for deg in range(1, deg+1)]))
def linregFitBayes(X, ytrain, **kwargs):
#Bayesian inference for a linear regression model.
#The model is p(y | x) = N(y | w*[1 x], (1/beta)) so beta is the precision of the measurement noise
# OUTPUTS model contains the parameters of the posterior, suitable for input to linregPredictBayes.
# logev is the log marginal likelihood
#This function is structured so it can be expanded with the full set of options provided in
#linregFitBayes.m in pmtk3.
if kwargs['prior'] == 'EB':
#args = {v for k, v in kwargs.items() if k not in 'preproc'}
[model, logev, LHist] = linregFitEB(X, ytrain, kwargs['preproc'], maxIter=kwargs['maxIter'])
else:
raise ValueError('Unrecognized Prior type given')
model['modelType'] = 'linregBayes'
model['prior'] = kwargs['prior']
return model, logev
def preprocessorApplyToTrain(preproc, X):
if('addOnes' in preproc.keys() and preproc['addOnes']):
X = np.column_stack((np.ones(X.shape[0]), X))
return preproc, X
def linregFitEB(X, y, preproc, **kwargs):
#This closely follows the code of linregFitEbChen giving in pmtk3/toolbox
preproc, X = preprocessorApplyToTrain(preproc, X)
N, M = X.shape
XX = np.dot(np.transpose(X), X)
XX2 = np.dot(X, np.transpose(X))
Xy = np.dot(np.transpose(X), y)
#This method can get stuck in local minima, so we should do multiple restarts.
alpha = 0.01 #initially don't trust the prior
beta = 1.0 #initially trust the data
L_old = - float('inf')
Lhist = np.empty((kwargs['maxIter'], 1))
for i in range(kwargs['maxIter']):
if(N > M):
T = alpha*np.identity(M) + XX*beta
cholT = np.transpose(np.linalg.cholesky(T))
Ui = np.linalg.inv(cholT)
Sn = np.dot(Ui, np.transpose(Ui))
logdetS = - 2 * sum(np.log(np.diag(cholT)))
else:
T = np.identity(N) / beta + XX2 / alpha
cholT = np.transpose(np.linalg.cholesky(T))
print(T)
Ui = np.linalg.inv(cholT)
XU = np.dot(np.transpose(X), Ui)
Sn = np.identity(M) / alpha - np.dot(XU, np.transpose(XU))/alpha/alpha
logdetS = sum(np.log(np.diag(cholT))) * 2 + M * np.log(alpha) + N * np.log(beta)
logdetS = - logdetS
mn = beta*np.dot(Sn, Xy)
t1 = sum((y - np.dot(X, mn))*(y - np.dot(X, mn)))
t2 = np.dot(np.transpose(mn), mn)
#M = float(M)
#N = float(N)
gamma = M - alpha * np.trace(Sn)
beta = (N - gamma) / t1
L = M * np.log(alpha) - N * np.log(2 * np.pi) + N * np.log(beta) - beta * t1 - alpha * t2 + logdetS
L = L / 2
Lhist[i] = L
if abs(L - L_old) < 1e-2:
break
else:
L_old = L
alpha = gamma/t2
model = {'wN': mn, 'VN': Sn, 'beta': beta, 'alpha': alpha, 'gamma': gamma, 'preproc': preproc}
return model, L, Lhist
def linregPredictBayes(model, X):
#This accepts a model of the form produced by linregFitBayes and an array of X to form posterior predictions
[_, X] = preprocessorApplyToTrain(model['preproc'], X)
yhat = np.dot(X, model['wN'])
sigma2Hat = (1.0/model['beta']) + np.diag(np.dot(np.dot(X, model['VN']), np.transpose(X)))
return yhat, sigma2Hat
#We loop over each setting for the number of data points
for n in Ns:
x1d = np.random.uniform(0, 10, n) #input points
e = np.random.normal(0, 1, n) #noise
ytrain = (x1d - 4.0)**2 + 5.0*e #observed y
plotvals1d = np.arange(-2.0, 12.1, .1) #grid for plotting/testing
trueOutput = (plotvals1d - 4.0) ** 2 #true function
logevs = []
#We loop over the number of degree in our regression.
for deg in degs:
X = polyBasis(x1d, deg) #Polynomial basis
pp = {'addOnes': True} #Setting for feature preprocessing
[mod, logev] = linregFitBayes(X, ytrain, prior='EB', preproc=pp, maxIter=20) #Fit the model
logevs.append(logev)
Xtest = polyBasis(plotvals1d, deg) #Grid to test our prediction on
mu, sig2 = linregPredictBayes(mod, Xtest)
sig2 = np.sqrt(sig2)
#Form line graph
fig, ax = plt.subplots()
plt.scatter(x1d, ytrain, s=140, facecolors='none', edgecolors='k')
lower = mu - sig2
upper = mu + sig2
plt.plot(plotvals1d, trueOutput, 'g', plotvals1d, mu, 'r--', linewidth=2)
plt.plot(plotvals1d, lower, 'b-' , plotvals1d, upper, 'b-', linewidth=0.5)
plt.title('d={}, logev={:0.2f}, EB'.format(deg, logev))
save_fig('linregEbModelSelVsN{}D{}EB.pdf'.format(n, deg))
plt.draw()
#Form bar graph showing the posterior probabilities for each model
PP = np.exp(logevs)
PP = PP/sum(PP)
fig, ax = plt.subplots()
ax.bar(list(range(len(PP))), PP, align='center')
plt.xticks(list(range(len(PP))))
plt.ylim([0, 1])
ax.set_ylabel('P(M|D)')
plt.title('N={}'.format(n))
save_fig('linregEbModelSelVsN{}PostEB.pdf'.format(n))
plt.draw()
plt.show()
|
import { Session } from 'meteor/session';
import { Tracker } from 'meteor/tracker';
import { settings } from '../../settings';
import { getAvatarURL } from './getAvatarURL';
export const getUserAvatarURL = function(username) {
const externalSource = (settings.get('Accounts_AvatarExternalProviderUrl') || '').trim().replace(/\/$/, '');
if (externalSource !== '') {
return externalSource.replace('{username}', username);
}
if (username == null) {
return;
}
const key = `avatar_random_${ username }`;
const cache = Tracker.nonreactive(() => Session && Session.get(key)); // there is no Session on server
return getAvatarURL({ username, cache });
};
|
import { Form as SearchForm } from './lib/search-form';
import { ShippingDateCalculator } from './lib/shipping-date-calculator';
import { FormButton as AddToCartFormButton, IconButton as AddToCartIconButton, PlusMinusForm } from './lib/add-to-cart';
import { FilterWrapper, SelectWrapper, OptionWrapper, events as HomepageFilterEvents } from './lib/homepage-filter';
const Filter = {
FilterWrapper,
SelectWrapper,
OptionWrapper,
HomepageFilterEvents
}
export { SearchForm, ShippingDateCalculator, AddToCartFormButton, Filter, AddToCartIconButton, PlusMinusForm };
|
'use strict';
const Crypto = require('./crypto');
const Plugin = require('./plugin');
const Token = require('./token');
const Utils = require('./utils');
const internals = {};
module.exports = {
plugin: Plugin.plugin,
token: {
generate: Token.generate,
decode: Token.decode,
verify: Token.verify,
verifySignature: Token.verifySignature,
verifyPayload: Token.verifyPayload,
verifyTime: Token.verifyTime,
signature: {
generate: Crypto.generate,
verify: Crypto.verify
}
},
crypto: {
rsaPublicKeyToPEM: Crypto.rsaPublicKeyToPEM
},
utils: Utils
};
|
const { next } = require('./life');
const {
random,
create,
getPopulation,
decode,
pad,
} = require('./demo-grids-helper');
const graphics = (() => {
let previousGrid;
const strokeColor = '#bbbbbb';
const strokeWidth = 1;
const liveColor = '#000000';
const deadColor = '#ffffff';
function render(canvas, grid, cellWidth) {
const ctx = canvas.getContext('2d');
for (let i = 0; i < grid.length; i++) {
for (let j = 0; j < grid[i].length; j++) {
const cell = grid[i][j];
// Only re-draw if cell has changed
if (!previousGrid || cell !== previousGrid[i][j]) {
ctx.beginPath();
ctx.strokeStyle = strokeColor;
ctx.fillStyle = cell ? liveColor : deadColor;
ctx.lineWidth = strokeWidth;
ctx.rect(j * cellWidth, i * cellWidth, cellWidth, cellWidth);
ctx.fill();
ctx.stroke();
}
}
}
previousGrid = grid;
}
function resizeCanvasToDisplaySize(canvas) {
const width = canvas.clientWidth;
const height = canvas.clientHeight;
if (canvas.width !== width || canvas.height !== height) {
canvas.width = width;
canvas.height = height;
return true;
}
return false;
}
function requestAnimationFrame(cb, getInterval) {
let last;
function run(timestamp) {
if (last === undefined) last = timestamp;
const elapsed = timestamp - last;
if (elapsed > getInterval()) {
last = timestamp;
cb();
}
window.requestAnimationFrame(run);
}
window.requestAnimationFrame(run);
}
return { render, resizeCanvasToDisplaySize, requestAnimationFrame };
})();
const game = (() => {
const generationsCountElement = document.getElementById('generations-count');
const populationCountElement = document.getElementById('population-count');
const startButtonElement = document.getElementById('start');
const clearButtonElement = document.getElementById('clear');
const resetButtonElement = document.getElementById('reset');
const randomButtonElement = document.getElementById('random');
const speedControlElement = document.getElementById('speed');
const speedValueElement = document.getElementById('speed-value');
const canvasElement = document.querySelector('canvas');
const defaultGensPerSecond = 20;
const hotkeys = {
P: onClickPlay,
C: onClickClear,
R: onClickRandom,
O: onClickReset,
};
let cellWidthInPixels,
_grid,
_initialGrid,
_isPlaying = false,
_numGens = 0,
w,
h,
speed,
isMouseBeingDragged = false,
dragValue, // value the cells dragged over should be
isPlayingBeforeDrag;
function updateGrid(gridFunc) {
const newGrid = gridFunc(_grid);
if (newGrid === undefined) {
return;
}
_grid = newGrid;
graphics.render(canvasElement, _grid, cellWidthInPixels);
populationCountElement.textContent = String(getPopulation(_grid));
}
function init() {
startButtonElement.addEventListener('click', onClickPlay);
clearButtonElement.addEventListener('click', onClickClear);
resetButtonElement.addEventListener('click', onClickReset);
randomButtonElement.addEventListener('click', onClickRandom);
speedControlElement.addEventListener('change', onChangeSpeed);
document.addEventListener('keydown', onKeyDown);
canvasElement.addEventListener('mousedown', onMousedownCanvas);
canvasElement.addEventListener('mousemove', onMousemoveCanvas);
canvasElement.addEventListener('mouseup', onMouseupCanvas);
canvasElement.addEventListener('touchstart', onTouchstartCanvas);
canvasElement.addEventListener('touchmove', onTouchmoveCanvas);
canvasElement.addEventListener('touchend', onTouchendCanvas);
graphics.resizeCanvasToDisplaySize(canvasElement);
// Start game
initSpeed();
initButtons();
const { grid: initialGrid, cellWidthInPixels: cellWidth } =
getInitialGrid();
cellWidthInPixels = cellWidth;
_initialGrid = initialGrid;
h = initialGrid.length;
w = initialGrid[0].length;
updateGrid(() => initialGrid);
graphics.requestAnimationFrame(
() => {
if (_isPlaying) {
incrNumGens();
updateGrid((grid) => next(grid));
}
},
() => speed * 1000,
);
}
function getInitialGrid() {
const url = new URL(window.location.href);
const init = url.searchParams.get('init');
if (init) {
const decodedGrid = decode(init);
const decodedH = decodedGrid.length;
const decodedW = decodedGrid[0] ? decodedGrid[0].length : 0;
const cellWidthInPixels = getCellWidth(true, decodedW, decodedH);
const padW = Math.ceil(
(window.innerWidth - cellWidthInPixels * decodedW) / cellWidthInPixels,
);
const padH = Math.ceil(
(window.innerHeight - cellWidthInPixels * decodedH) / cellWidthInPixels,
);
return { grid: pad(decodedGrid, padW, padH), cellWidthInPixels };
} else {
const cellWidthInPixels = getCellWidth(false);
return {
grid: create(
Math.ceil(window.innerWidth / cellWidthInPixels),
Math.ceil(window.innerHeight / cellWidthInPixels),
),
cellWidthInPixels,
};
}
}
function initButtons() {
const url = new URL(window.location.href);
if (url.searchParams.get('random') === 'false') {
randomButtonElement.style.display = 'none';
}
if (url.searchParams.get('clear') === 'false') {
clearButtonElement.style.display = 'none';
}
if (url.searchParams.get('reset') === 'true') {
resetButtonElement.style.display = 'block';
}
}
function getCellWidth(gridSetFromUrl, w, h) {
if (gridSetFromUrl) {
return Math.ceil(
Math.min(window.innerHeight / +h, window.innerWidth / +w),
);
}
const url = new URL(window.location.href);
const size = url.searchParams.get('size');
if (size === 'lg') {
return Math.max(
50,
Math.max(window.innerHeight / 50, window.innerWidth / 50),
);
}
return 20;
}
function initSpeed() {
const url = new URL(window.location.href);
const speed = +url.searchParams.get('speed') || defaultGensPerSecond;
updateSpeed(speed);
}
function onChangeSpeed(evt) {
const gensPerSec = Math.pow(evt.target.value, 2); // from 0.1->7.07 to 0.01->50
updateSpeed(gensPerSec);
}
function updateSpeed(gensPerSec) {
speed = 1 / gensPerSec;
speedValueElement.textContent = gensPerSec.toFixed(2);
speedControlElement.value = Math.pow(gensPerSec, 0.5);
}
function onKeyDown(evt) {
if (!evt.ctrlKey && !evt.metaKey) {
const func = hotkeys[evt.key.toUpperCase()];
func && func();
}
}
function onClickPlay() {
toggleIsPlaying();
}
function onClickReset() {
resetNumGens();
updateGrid(() => _initialGrid);
}
function onClickClear() {
setIsPlaying(false);
resetNumGens();
updateGrid(() => create(w, h));
}
function onClickRandom() {
resetNumGens();
updateGrid(() => random(w, h));
}
function incrNumGens() {
generationsCountElement.textContent = String(_numGens++);
}
function resetNumGens() {
_numGens = 0;
generationsCountElement.textContent = '0';
}
function toggleIsPlaying() {
setIsPlaying(!_isPlaying);
}
function setIsPlaying(isPlaying) {
_isPlaying = isPlaying;
startButtonElement.textContent = _isPlaying ? 'Pause (P)' : 'Play (P)';
}
function onMousedownCanvas(evt) {
evt.preventDefault();
// only left-click
if (evt.buttons === 1) {
mousedownOrTouchstartCanvas(evt);
}
}
function onTouchstartCanvas(evt) {
evt.preventDefault();
mousedownOrTouchstartCanvas(evt.touches[0]);
}
function mousedownOrTouchstartCanvas(evt) {
isMouseBeingDragged = true;
isPlayingBeforeDrag = _isPlaying;
setIsPlaying(false);
const { col, row } = getRowAndCol(evt);
dragValue = !_grid[row][col];
updateGrid((grid) => setCellValue(grid, row, col));
}
function onMousemoveCanvas(evt) {
evt.preventDefault();
mousemoveOrTouchmoveCanvas(evt);
}
function onTouchmoveCanvas(evt) {
evt.preventDefault();
mousemoveOrTouchmoveCanvas(evt.touches[0]);
}
function mousemoveOrTouchmoveCanvas(evt) {
if (isMouseBeingDragged) {
const { col, row } = getRowAndCol(evt);
updateGrid((grid) => setCellValue(grid, row, col));
}
}
function onMouseupCanvas(evt) {
evt.preventDefault();
if (isMouseBeingDragged) {
const { col, row } = getRowAndCol(evt);
updateGrid((grid) => setCellValue(grid, row, col));
isMouseBeingDragged = false;
isPlayingBeforeDrag && setIsPlaying(true);
}
}
function onTouchendCanvas(evt) {
evt.preventDefault();
isMouseBeingDragged && isPlayingBeforeDrag && setIsPlaying(true);
}
function getRowAndCol(evt) {
return {
col: Math.floor(evt.clientX / cellWidthInPixels),
row: Math.floor(evt.clientY / cellWidthInPixels),
};
}
function setCellValue(grid, row, col) {
if (grid[row][col] === dragValue) {
return undefined;
}
const newGrid = grid.map((row) => [...row]);
newGrid[row][col] = dragValue;
return newGrid;
}
return { init };
})();
game.init();
|
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
const common = require('../common');
const assert = require('assert');
const path = require('path');
const fs = require('../../../../');
const FILENAME = path.join(common.tmpDir, 'watch-me');
const TIMEOUT = 1300;
let nevents = 0;
try {
fs.unlinkSync(FILENAME);
} catch (e) {
// swallow
}
fs.watchFile(FILENAME, {interval: TIMEOUT - 250}, function(curr, prev) {
console.log([curr, prev]);
switch (++nevents) {
case 1:
assert.strictEqual(common.fileExists(FILENAME), false);
break;
case 2:
case 3:
assert.strictEqual(common.fileExists(FILENAME), true);
break;
case 4:
assert.strictEqual(common.fileExists(FILENAME), false);
fs.unwatchFile(FILENAME);
break;
default:
assert(0);
}
});
process.on('exit', function() {
assert.strictEqual(nevents, 4);
});
setTimeout(createFile, TIMEOUT);
function createFile() {
console.log('creating file');
fs.writeFileSync(FILENAME, 'test');
setTimeout(touchFile, TIMEOUT);
}
function touchFile() {
console.log('touch file');
fs.writeFileSync(FILENAME, 'test');
setTimeout(removeFile, TIMEOUT);
}
function removeFile() {
console.log('remove file');
fs.unlinkSync(FILENAME);
}
|
import {ipcRenderer, remote} from 'electron'
import {h, render, Component} from 'preact'
import classNames from 'classnames'
import fixPath from 'fix-path'
import influence from '@sabaki/influence'
import TripleSplitContainer from './helpers/TripleSplitContainer.js'
import ThemeManager from './ThemeManager.js'
import MainMenu from './MainMenu.js'
import MainView from './MainView.js'
import LeftSidebar from './LeftSidebar.js'
import Sidebar from './Sidebar.js'
import DrawerManager from './DrawerManager.js'
import InputBox from './InputBox.js'
import BusyScreen from './BusyScreen.js'
import InfoOverlay from './InfoOverlay.js'
import i18n from '../i18n.js'
import sabaki from '../modules/sabaki.js'
import * as gametree from '../modules/gametree.js'
import * as gtplogger from '../modules/gtplogger.js'
import * as helper from '../modules/helper.js'
const setting = remote.require('./setting')
const t = i18n.context('App')
const leftSidebarMinWidth = setting.get('view.sidebar_minwidth')
const sidebarMinWidth = setting.get('view.leftsidebar_minwidth')
fixPath()
const portableDir = process.env.PORTABLE_EXECUTABLE_DIR
if (portableDir) process.chdir(portableDir)
class App extends Component {
constructor(props) {
super(props)
this.state = sabaki.state
sabaki.on('change', ({change, callback}) => {
this.setState(change, callback)
})
let bind = f => f.bind(this)
this.handleMainLayoutSplitChange = bind(this.handleMainLayoutSplitChange)
this.handleMainLayoutSplitFinish = bind(this.handleMainLayoutSplitFinish)
}
componentDidMount() {
gtplogger.updatePath()
window.addEventListener('contextmenu', evt => {
evt.preventDefault()
})
window.addEventListener('load', () => {
sabaki.events.emit('ready')
})
ipcRenderer.on('load-file', (evt, ...args) => {
setTimeout(
() => sabaki.loadFile(...args),
setting.get('app.loadgame_delay')
)
})
sabaki.window.on('focus', () => {
if (setting.get('file.show_reload_warning')) {
sabaki.askForReload()
}
})
sabaki.window.on('resize', () => {
clearTimeout(this.resizeId)
this.resizeId = setTimeout(() => {
if (
!sabaki.window.isMaximized() &&
!sabaki.window.isMinimized() &&
!sabaki.window.isFullScreen()
) {
let [width, height] = sabaki.window.getContentSize()
setting.set('window.width', width).set('window.height', height)
}
}, 1000)
})
// Handle mouse wheel
for (let el of document.querySelectorAll(
'#main main, #graph, #winrategraph'
)) {
el.addEventListener('wheel', evt => {
evt.preventDefault()
if (this.residueDeltaY == null) this.residueDeltaY = 0
this.residueDeltaY += evt.deltaY
if (
Math.abs(this.residueDeltaY) >=
setting.get('game.navigation_sensitivity')
) {
sabaki.goStep(Math.sign(this.residueDeltaY))
this.residueDeltaY = 0
}
})
}
// Handle file drag & drop
document.body.addEventListener('dragover', evt => evt.preventDefault())
document.body.addEventListener('drop', evt => {
evt.preventDefault()
if (evt.dataTransfer.files.length === 0) return
sabaki.loadFile(evt.dataTransfer.files[0].path)
})
// Handle keys
document.addEventListener('keydown', evt => {
if (evt.key === 'Escape') {
if (sabaki.state.openDrawer != null) {
sabaki.closeDrawer()
} else if (sabaki.state.mode !== 'play') {
sabaki.setMode('play')
} else if (sabaki.state.fullScreen) {
sabaki.setState({fullScreen: false})
}
} else if (
!evt.ctrlKey &&
!evt.metaKey &&
['ArrowUp', 'ArrowDown'].includes(evt.key)
) {
if (
sabaki.state.busy > 0 ||
helper.isTextLikeElement(document.activeElement)
)
return
evt.preventDefault()
let sign = evt.key === 'ArrowUp' ? -1 : 1
sabaki.startAutoscrolling(sign)
} else if (
(evt.ctrlKey || evt.metaKey) &&
['z', 'y'].includes(evt.key.toLowerCase())
) {
if (sabaki.state.busy > 0) return
// Hijack browser undo/redo
evt.preventDefault()
let step = evt.key.toLowerCase() === 'z' ? -1 : 1
if (evt.shiftKey) step = -step
let action = step < 0 ? 'undo' : 'redo'
if (action != null) {
if (helper.isTextLikeElement(document.activeElement)) {
sabaki.window.webContents[action]()
} else {
sabaki[action]()
}
}
}
})
document.addEventListener('keyup', evt => {
if (['ArrowUp', 'ArrowDown'].includes(evt.key)) {
sabaki.stopAutoscrolling()
}
})
// Handle window closing
window.addEventListener('beforeunload', evt => {
if (this.closeWindow) return
evt.returnValue = ' '
setTimeout(() => {
if (sabaki.askForSave()) {
sabaki.detachEngines(
this.state.attachedEngineSyncers.map(syncer => syncer.id)
)
gtplogger.close()
this.closeWindow = true
sabaki.window.close()
}
})
})
sabaki.newFile()
}
componentDidUpdate(_, prevState = {}) {
// Update title
let {title} = sabaki.inferredState
if (document.title !== title) document.title = title
// Handle full screen & show menu bar
if (prevState.fullScreen !== sabaki.state.fullScreen) {
if (sabaki.state.fullScreen)
sabaki.flashInfoOverlay(t('Press Esc to exit full screen mode'))
sabaki.window.setFullScreen(sabaki.state.fullScreen)
}
if (prevState.showMenuBar !== sabaki.state.showMenuBar) {
if (!sabaki.state.showMenuBar)
sabaki.flashInfoOverlay(t('Press Alt to show menu bar'))
sabaki.window.setMenuBarVisibility(sabaki.state.showMenuBar)
sabaki.window.autoHideMenuBar = !sabaki.state.showMenuBar
}
// Handle bars & drawers
if (
['estimator', 'scoring'].includes(prevState.mode) &&
sabaki.state.mode !== 'estimator' &&
sabaki.state.mode !== 'scoring' &&
sabaki.state.openDrawer === 'score'
) {
sabaki.closeDrawer()
}
// Handle sidebar showing/hiding
let {showSidebar: prevShowSidebar} = sabaki.getInferredState(prevState)
if (
prevState.showLeftSidebar !== sabaki.state.showLeftSidebar ||
prevShowSidebar !== sabaki.inferredState.showSidebar
) {
let [width, height] = sabaki.window.getContentSize()
let widthDiff = 0
if (prevShowSidebar !== sabaki.inferredState.showSidebar) {
widthDiff +=
sabaki.state.sidebarWidth *
(sabaki.inferredState.showSidebar ? 1 : -1)
}
if (prevState.showLeftSidebar !== sabaki.state.showLeftSidebar) {
widthDiff +=
sabaki.state.leftSidebarWidth *
(sabaki.state.showLeftSidebar ? 1 : -1)
}
if (
!sabaki.window.isMaximized() &&
!sabaki.window.isMinimized() &&
!sabaki.window.isFullScreen()
) {
sabaki.window.setContentSize(width + widthDiff, height)
}
window.dispatchEvent(new Event('resize'))
}
// Handle zoom factor
if (prevState.zoomFactor !== sabaki.state.zoomFactor) {
sabaki.window.webContents.zoomFactor = sabaki.state.zoomFactor
}
}
// User Interface
handleMainLayoutSplitChange({beginSideSize, endSideSize}) {
sabaki.setState(
({leftSidebarWidth, sidebarWidth, showLeftSidebar}) => ({
leftSidebarWidth: showLeftSidebar
? Math.max(beginSideSize, leftSidebarMinWidth)
: leftSidebarWidth,
sidebarWidth: sabaki.inferredState.showSidebar
? Math.max(endSideSize, sidebarMinWidth)
: sidebarWidth
}),
() => window.dispatchEvent(new Event('resize'))
)
}
handleMainLayoutSplitFinish() {
setting
.set('view.sidebar_width', this.state.sidebarWidth)
.set('view.leftsidebar_width', this.state.leftSidebarWidth)
}
// Render
render(_, state) {
// Calculate some inferred values
let inferredState = sabaki.inferredState
let tree = inferredState.gameTree
let scoreBoard, areaMap
if (['scoring', 'estimator'].includes(state.mode)) {
// Calculate area map
scoreBoard = gametree.getBoard(tree, state.treePosition).clone()
for (let vertex of state.deadStones) {
let sign = scoreBoard.get(vertex)
if (sign === 0) continue
scoreBoard.setCaptures(-sign, x => x + 1)
scoreBoard.set(vertex, 0)
}
areaMap =
state.mode === 'estimator'
? influence.map(scoreBoard.signMap, {discrete: true})
: influence.areaMap(scoreBoard.signMap)
}
state = {...state, ...inferredState, scoreBoard, areaMap}
return h(
'section',
{
class: classNames({
showleftsidebar: state.showLeftSidebar,
showsidebar: state.showSidebar,
[state.mode]: true
})
},
h(ThemeManager),
h(MainMenu, {
showMenuBar: state.showMenuBar,
disableAll: state.busy > 0,
analysisType: state.analysisType,
showAnalysis: state.showAnalysis,
showCoordinates: state.showCoordinates,
coordinatesType: state.coordinatesType,
showMoveNumbers: state.showMoveNumbers,
showMoveColorization: state.showMoveColorization,
showNextMoves: state.showNextMoves,
showSiblings: state.showSiblings,
showWinrateGraph: state.showWinrateGraph,
showGameGraph: state.showGameGraph,
showCommentBox: state.showCommentBox,
showLeftSidebar: state.showLeftSidebar,
engineGameOngoing: state.engineGameOngoing
}),
h(TripleSplitContainer, {
id: 'mainlayout',
beginSideSize: state.showLeftSidebar ? state.leftSidebarWidth : 0,
endSideSize: state.showSidebar ? state.sidebarWidth : 0,
beginSideContent: h(LeftSidebar, state),
mainContent: h(MainView, state),
endSideContent: h(Sidebar, state),
onChange: this.handleMainLayoutSplitChange,
onFinish: this.handleMainLayoutSplitFinish
}),
h(DrawerManager, state),
h(InputBox, {
text: state.inputBoxText,
show: state.showInputBox,
onSubmit: state.onInputBoxSubmit,
onCancel: state.onInputBoxCancel
}),
h(BusyScreen, {show: state.busy > 0}),
h(InfoOverlay, {text: state.infoOverlayText, show: state.showInfoOverlay})
)
}
}
// Render
render(h(App), document.body)
|
import datetime, json, requests, time
from src.tipboard.app.properties import TIPBOARD_URL, DEBUG
def printEndOfTipboardCall(tipboardAnswer, TILE_ID):
if tipboardAnswer is not None:
print(f'POST tile:{TILE_ID} tipboard/push => ({tipboardAnswer.status_code}): ', flush=True)
if tipboardAnswer.status_code == 200:
print(f'\t\t{tipboardAnswer.text}')
else:
print(f'POST tile:{TILE_ID} tipboard/push => (FAILED HTTP CONNECT): ', flush=True)
def end(title=None, start_time=None, tipboardAnswer=None, TILE_ID=None):
""" Eazy way to end sensors, print the action time & http answer of tipboard """
printEndOfTipboardCall(tipboardAnswer, TILE_ID)
duration = time.time() - start_time
m = str(duration / 60)[:str(duration / 60).index('.')]
s = str(duration % 60)[:str(duration % 60).index('.')]
if m == '0':
print(f'{getTimeStr()}-{title}: executed script in {s} seconds', flush=True)
else:
print(f'{getTimeStr()}-{title}: executed script in {m}:{s}', flush=True)
print(f'----------------------------------------------------------------------------------------------', flush=True)
def getTimeStr():
""" Eazy way to get in str, time for log """
return datetime.datetime.now().strftime('%Hh%M')
def sendBVColor(color, tile_id, fading=False): # pragma: no cover
""" Modify meta of tile: update the color and/or fading of a specific tile """
var = dict(value=json.dumps({'big_value_color': color, 'fading_background': fading}))
res = requests.post(TIPBOARD_URL + '/tileconfig/' + tile_id, data=var)
if DEBUG:
print(f'{res}: color -> {tile_id}', flush=True)
def buildConfigTile(tile_id, tile_template, data):
return dict(tile_template=tile_template, tile_id=tile_id, data=json.dumps(data))
def sendDataToTipboard(tile_id=None, data=None, tile_template=None, isTest=False):
configTile = buildConfigTile(tile_id=tile_id, tile_template=tile_template, data=data)
if not isTest:
return requests.post(TIPBOARD_URL + '/push', data=configTile)
|
/**
* @fileoverview A rule to control the use of single variable declarations.
* @author Ian Christian Myers
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "enforce variables to be declared either together or separately in functions",
category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/one-var"
},
fixable: "code",
schema: [
{
oneOf: [
{
enum: ["always", "never", "consecutive"]
},
{
type: "object",
properties: {
separateRequires: {
type: "boolean"
},
var: {
enum: ["always", "never", "consecutive"]
},
let: {
enum: ["always", "never", "consecutive"]
},
const: {
enum: ["always", "never", "consecutive"]
}
},
additionalProperties: false
},
{
type: "object",
properties: {
initialized: {
enum: ["always", "never", "consecutive"]
},
uninitialized: {
enum: ["always", "never", "consecutive"]
}
},
additionalProperties: false
}
]
}
]
},
create(context) {
const MODE_ALWAYS = "always";
const MODE_NEVER = "never";
const MODE_CONSECUTIVE = "consecutive";
const mode = context.options[0] || MODE_ALWAYS;
const options = {};
if (typeof mode === "string") { // simple options configuration with just a string
options.var = { uninitialized: mode, initialized: mode };
options.let = { uninitialized: mode, initialized: mode };
options.const = { uninitialized: mode, initialized: mode };
} else if (typeof mode === "object") { // options configuration is an object
options.separateRequires = !!mode.separateRequires;
options.var = { uninitialized: mode.var, initialized: mode.var };
options.let = { uninitialized: mode.let, initialized: mode.let };
options.const = { uninitialized: mode.const, initialized: mode.const };
if (Object.prototype.hasOwnProperty.call(mode, "uninitialized")) {
options.var.uninitialized = mode.uninitialized;
options.let.uninitialized = mode.uninitialized;
options.const.uninitialized = mode.uninitialized;
}
if (Object.prototype.hasOwnProperty.call(mode, "initialized")) {
options.var.initialized = mode.initialized;
options.let.initialized = mode.initialized;
options.const.initialized = mode.initialized;
}
}
const sourceCode = context.getSourceCode();
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
const functionStack = [];
const blockStack = [];
/**
* Increments the blockStack counter.
* @returns {void}
* @private
*/
function startBlock() {
blockStack.push({
let: { initialized: false, uninitialized: false },
const: { initialized: false, uninitialized: false }
});
}
/**
* Increments the functionStack counter.
* @returns {void}
* @private
*/
function startFunction() {
functionStack.push({ initialized: false, uninitialized: false });
startBlock();
}
/**
* Decrements the blockStack counter.
* @returns {void}
* @private
*/
function endBlock() {
blockStack.pop();
}
/**
* Decrements the functionStack counter.
* @returns {void}
* @private
*/
function endFunction() {
functionStack.pop();
endBlock();
}
/**
* Check if a variable declaration is a require.
* @param {ASTNode} decl variable declaration Node
* @returns {bool} if decl is a require, return true; else return false.
* @private
*/
function isRequire(decl) {
return decl.init && decl.init.type === "CallExpression" && decl.init.callee.name === "require";
}
/**
* Records whether initialized/uninitialized/required variables are defined in current scope.
* @param {string} statementType node.kind, one of: "var", "let", or "const"
* @param {ASTNode[]} declarations List of declarations
* @param {Object} currentScope The scope being investigated
* @returns {void}
* @private
*/
function recordTypes(statementType, declarations, currentScope) {
for (let i = 0; i < declarations.length; i++) {
if (declarations[i].init === null) {
if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) {
currentScope.uninitialized = true;
}
} else {
if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) {
if (options.separateRequires && isRequire(declarations[i])) {
currentScope.required = true;
} else {
currentScope.initialized = true;
}
}
}
}
}
/**
* Determines the current scope (function or block)
* @param {string} statementType node.kind, one of: "var", "let", or "const"
* @returns {Object} The scope associated with statementType
*/
function getCurrentScope(statementType) {
let currentScope;
if (statementType === "var") {
currentScope = functionStack[functionStack.length - 1];
} else if (statementType === "let") {
currentScope = blockStack[blockStack.length - 1].let;
} else if (statementType === "const") {
currentScope = blockStack[blockStack.length - 1].const;
}
return currentScope;
}
/**
* Counts the number of initialized and uninitialized declarations in a list of declarations
* @param {ASTNode[]} declarations List of declarations
* @returns {Object} Counts of 'uninitialized' and 'initialized' declarations
* @private
*/
function countDeclarations(declarations) {
const counts = { uninitialized: 0, initialized: 0 };
for (let i = 0; i < declarations.length; i++) {
if (declarations[i].init === null) {
counts.uninitialized++;
} else {
counts.initialized++;
}
}
return counts;
}
/**
* Determines if there is more than one var statement in the current scope.
* @param {string} statementType node.kind, one of: "var", "let", or "const"
* @param {ASTNode[]} declarations List of declarations
* @returns {boolean} Returns true if it is the first var declaration, false if not.
* @private
*/
function hasOnlyOneStatement(statementType, declarations) {
const declarationCounts = countDeclarations(declarations);
const currentOptions = options[statementType] || {};
const currentScope = getCurrentScope(statementType);
const hasRequires = declarations.some(isRequire);
if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) {
if (currentScope.uninitialized || currentScope.initialized) {
if (!hasRequires) {
return false;
}
}
}
if (declarationCounts.uninitialized > 0) {
if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) {
return false;
}
}
if (declarationCounts.initialized > 0) {
if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) {
if (!hasRequires) {
return false;
}
}
}
if (currentScope.required && hasRequires) {
return false;
}
recordTypes(statementType, declarations, currentScope);
return true;
}
/**
* Fixer to join VariableDeclaration's into a single declaration
* @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join
* @returns {Function} The fixer function
*/
function joinDeclarations(declarations) {
const declaration = declarations[0];
const body = Array.isArray(declaration.parent.parent.body) ? declaration.parent.parent.body : [];
const currentIndex = body.findIndex(node => node.range[0] === declaration.parent.range[0]);
const previousNode = body[currentIndex - 1];
return fixer => {
const type = sourceCode.getTokenBefore(declaration);
const prevSemi = sourceCode.getTokenBefore(type);
const res = [];
if (previousNode && previousNode.kind === sourceCode.getText(type)) {
if (prevSemi.value === ";") {
res.push(fixer.replaceText(prevSemi, ","));
} else {
res.push(fixer.insertTextAfter(prevSemi, ","));
}
res.push(fixer.replaceText(type, ""));
}
return res;
};
}
/**
* Fixer to split a VariableDeclaration into individual declarations
* @param {VariableDeclaration} declaration The `VariableDeclaration` to split
* @returns {Function} The fixer function
*/
function splitDeclarations(declaration) {
return fixer => declaration.declarations.map(declarator => {
const tokenAfterDeclarator = sourceCode.getTokenAfter(declarator);
if (tokenAfterDeclarator === null) {
return null;
}
const afterComma = sourceCode.getTokenAfter(tokenAfterDeclarator, { includeComments: true });
if (tokenAfterDeclarator.value !== ",") {
return null;
}
/*
* `var x,y`
* tokenAfterDeclarator ^^ afterComma
*/
if (afterComma.range[0] === tokenAfterDeclarator.range[1]) {
return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind} `);
}
/*
* `var x,
* tokenAfterDeclarator ^
* y`
* ^ afterComma
*/
if (
afterComma.loc.start.line > tokenAfterDeclarator.loc.end.line ||
afterComma.type === "Line" ||
afterComma.type === "Block"
) {
let lastComment = afterComma;
while (lastComment.type === "Line" || lastComment.type === "Block") {
lastComment = sourceCode.getTokenAfter(lastComment, { includeComments: true });
}
return fixer.replaceTextRange(
[tokenAfterDeclarator.range[0], lastComment.range[0]],
`;${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}${declaration.kind} `
);
}
return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind}`);
}).filter(x => x);
}
/**
* Checks a given VariableDeclaration node for errors.
* @param {ASTNode} node The VariableDeclaration node to check
* @returns {void}
* @private
*/
function checkVariableDeclaration(node) {
const parent = node.parent;
const type = node.kind;
if (!options[type]) {
return;
}
const declarations = node.declarations;
const declarationCounts = countDeclarations(declarations);
const mixedRequires = declarations.some(isRequire) && !declarations.every(isRequire);
if (options[type].initialized === MODE_ALWAYS) {
if (options.separateRequires && mixedRequires) {
context.report({
node,
message: "Split requires to be separated into a single block."
});
}
}
// consecutive
const nodeIndex = (parent.body && parent.body.length > 0 && parent.body.indexOf(node)) || 0;
if (nodeIndex > 0) {
const previousNode = parent.body[nodeIndex - 1];
const isPreviousNodeDeclaration = previousNode.type === "VariableDeclaration";
const declarationsWithPrevious = declarations.concat(previousNode.declarations || []);
if (
isPreviousNodeDeclaration &&
previousNode.kind === type &&
!(declarationsWithPrevious.some(isRequire) && !declarationsWithPrevious.every(isRequire))
) {
const previousDeclCounts = countDeclarations(previousNode.declarations);
if (options[type].initialized === MODE_CONSECUTIVE && options[type].uninitialized === MODE_CONSECUTIVE) {
context.report({
node,
message: "Combine this with the previous '{{type}}' statement.",
data: {
type
},
fix: joinDeclarations(declarations)
});
} else if (options[type].initialized === MODE_CONSECUTIVE && declarationCounts.initialized > 0 && previousDeclCounts.initialized > 0) {
context.report({
node,
message: "Combine this with the previous '{{type}}' statement with initialized variables.",
data: {
type
},
fix: joinDeclarations(declarations)
});
} else if (options[type].uninitialized === MODE_CONSECUTIVE &&
declarationCounts.uninitialized > 0 &&
previousDeclCounts.uninitialized > 0) {
context.report({
node,
message: "Combine this with the previous '{{type}}' statement with uninitialized variables.",
data: {
type
},
fix: joinDeclarations(declarations)
});
}
}
}
// always
if (!hasOnlyOneStatement(type, declarations)) {
if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) {
context.report({
node,
message: "Combine this with the previous '{{type}}' statement.",
data: {
type
},
fix: joinDeclarations(declarations)
});
} else {
if (options[type].initialized === MODE_ALWAYS && declarationCounts.initialized > 0) {
context.report({
node,
message: "Combine this with the previous '{{type}}' statement with initialized variables.",
data: {
type
},
fix: joinDeclarations(declarations)
});
}
if (options[type].uninitialized === MODE_ALWAYS && declarationCounts.uninitialized > 0) {
if (node.parent.left === node && (node.parent.type === "ForInStatement" || node.parent.type === "ForOfStatement")) {
return;
}
context.report({
node,
message: "Combine this with the previous '{{type}}' statement with uninitialized variables.",
data: {
type
},
fix: joinDeclarations(declarations)
});
}
}
}
// never
if (parent.type !== "ForStatement" || parent.init !== node) {
const totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized;
if (totalDeclarations > 1) {
if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) {
// both initialized and uninitialized
context.report({
node,
message: "Split '{{type}}' declarations into multiple statements.",
data: {
type
},
fix: splitDeclarations(node)
});
} else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) {
// initialized
context.report({
node,
message: "Split initialized '{{type}}' declarations into multiple statements.",
data: {
type
},
fix: splitDeclarations(node)
});
} else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) {
// uninitialized
context.report({
node,
message: "Split uninitialized '{{type}}' declarations into multiple statements.",
data: {
type
},
fix: splitDeclarations(node)
});
}
}
}
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
return {
Program: startFunction,
FunctionDeclaration: startFunction,
FunctionExpression: startFunction,
ArrowFunctionExpression: startFunction,
BlockStatement: startBlock,
ForStatement: startBlock,
ForInStatement: startBlock,
ForOfStatement: startBlock,
SwitchStatement: startBlock,
VariableDeclaration: checkVariableDeclaration,
"ForStatement:exit": endBlock,
"ForOfStatement:exit": endBlock,
"ForInStatement:exit": endBlock,
"SwitchStatement:exit": endBlock,
"BlockStatement:exit": endBlock,
"Program:exit": endFunction,
"FunctionDeclaration:exit": endFunction,
"FunctionExpression:exit": endFunction,
"ArrowFunctionExpression:exit": endFunction
};
}
};
|
import Ember from 'ember';
const { Component } = Ember;
export default Component.extend({
classNames: ['flex', 'layout-row'],
attributeBindings: ['style'],
style: Ember.String.htmlSafe('overflow: hidden')
});
|
/*! snabbt.js v0.2.0 built: 2015-01-05 */
!function(a,b){if("object"==typeof exports)module.exports=b();else if("function"==typeof define&&define.amd)define([],function(){return a.returnExportsGlobal=b()});else{var c=b();a.snabbtjs=c,a.snabbt=c.snabbt}}(this,function(){var a=a||{};a.Animation=function(b){this._start_state=b.start_state,this._end_state=b.end_state,this.offset=b.offset,this.duration=b.duration||500,this.delay=b.delay||0,this.easing=a.create_easer("linear"),this.perspective=b.perspective,b.easing&&(this.easing=a.create_easer(b.easing,b)),this._current_state=this._start_state.clone(),b.offset&&(this._current_state.offset_x=this.offset[0],this._current_state.offset_y=this.offset[1],this._current_state.offset_z=this.offset[2],this._end_state.offset_x=this.offset[0],this._end_state.offset_y=this.offset[1],this._end_state.offset_z=this.offset[2]),this.start_time=0,this.current_time=0,this._stopped=!1},a.Animation.prototype.stop=function(){this._stopped=!0},a.Animation.prototype.stopped=function(){return this._stopped},a.Animation.prototype.tick=function(a){if(!this._stopped){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay);var b=Math.min(Math.max(0,this.current_time-this.start_time),this.duration),c=this.duration;this.easing.tick(b/c),this.update_current_transform()}},a.Animation.prototype.current_state=function(){return this._current_state},a.Animation.prototype.update_current_transform=function(){var b=this.easing.value();a.TweenStates(this._start_state,this._end_state,this._current_state,b)},a.Animation.prototype.completed=function(){return this._stopped?!0:0===this.start_time?!1:this.easing.completed()},a.Animation.prototype.update_element=function(b){var c=this._current_state.as_matrix(),d=this._current_state.properties();a.update_element_transform(b,c,this.perspective),a.update_element_properties(b,d)},a.ValueFeededAnimation=function(b){this.value_feeder=b.value_feeder,this.duration=b.duration||500,this.delay=b.delay||0,this.perspective=b.perspective,this.easing=a.create_easer("linear"),b.easing&&(this.easing=a.create_easer(b.easing,b)),this._current_state=new a.State({}),this.current_matrix=this.value_feeder(0),this.start_time=0,this.current_time=0,this._stopped=!1},a.ValueFeededAnimation.prototype.stop=function(){this._stopped=!0},a.ValueFeededAnimation.prototype.stopped=function(){return this._stopped},a.ValueFeededAnimation.prototype.tick=function(a){if(!this._stopped){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay);var b=Math.min(Math.max(.001,this.current_time-this.start_time),this.duration),c=this.duration;this.easing.tick(b/c),this.update_current_transform()}},a.ValueFeededAnimation.prototype.current_state=function(){return this._current_state},a.ValueFeededAnimation.prototype.update_current_transform=function(){var a=this.easing.value();this.current_matrix=this.value_feeder(a)},a.ValueFeededAnimation.prototype.completed=function(){return this._stopped?!0:this.easing.completed()},a.ValueFeededAnimation.prototype.update_element=function(b){a.update_element_transform(b,this.current_matrix,this.perspective)},a.ScrollAnimation=function(b){this.start_scroll=window.scrollY,this.end_scroll=b.scroll_pos,this.duration=b.duration||500,this.delay=b.delay||0,this.easing=b.easing||a.cos_easing,this.start_time=0,this.current_time=0},a.ScrollAnimation.prototype.tick=function(a){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay),this.update_scrolling()},a.ScrollAnimation.prototype.update_scrolling=function(){var a=Math.min(Math.max(.001,this.current_time-this.start_time),this.duration),b=this.duration,c=this.easing(a,b),d=this.end_scroll-this.start_scroll,e=this.start_scroll+c*d;window.scrollTo(0,e)},a.ScrollAnimation.prototype.completed=function(){return 0===this.start_time?!1:this.current_time-this.start_time>this.duration},a.AttentionAnimation=function(b){this.movement=b.movement,this.current_movement=new a.State({}),b.initial_velocity=.1,b.equilibrium_position=0,this.spring=new a.SpringEasing(b),this._stopped=!1},a.AttentionAnimation.prototype.stop=function(){this._stopped=!0},a.AttentionAnimation.prototype.stopped=function(){return this._stopped},a.AttentionAnimation.prototype.tick=function(){this._stopped||this.spring.equilibrium||(this.spring.tick(),this.update_movement())},a.AttentionAnimation.prototype.update_movement=function(){this.current_movement.x=this.movement.x*this.spring.position,this.current_movement.y=this.movement.y*this.spring.position,this.current_movement.z=this.movement.z*this.spring.position,this.current_movement.ax=this.movement.ax*this.spring.position,this.current_movement.ay=this.movement.ay*this.spring.position,this.current_movement.az=this.movement.az*this.spring.position,this.current_movement.bx=this.movement.bx*this.spring.position,this.current_movement.by=this.movement.by*this.spring.position,this.current_movement.bz=this.movement.bz*this.spring.position},a.AttentionAnimation.prototype.update_element=function(b){var c=this.current_movement.as_matrix(),d=this.current_movement.properties();a.update_element_transform(b,c),a.update_element_properties(b,d)},a.AttentionAnimation.prototype.current_state=function(){return this.current_movement},a.AttentionAnimation.prototype.completed=function(){return this.spring.equilibrium||this._stopped},a.create_animation=function(b){return b.value_feeder?new a.ValueFeededAnimation(b):new a.Animation(b)};var a=a||{};a.linear_easing=function(a){return a},a.ease=function(a){return(Math.cos(a*Math.PI+Math.PI)+1)/2},a.ease_in=function(a){return a*a},a.ease_out=function(a){return-Math.pow(a-1,2)+1},a.SpringEasing=function(b){this.position=a.option_or_default(b.start_position,0),this.equilibrium_position=a.option_or_default(b.equilibrium_position,1),this.velocity=a.option_or_default(b.initial_velocity,0),this.spring_constant=a.option_or_default(b.spring_constant,.8),this.deacceleration=a.option_or_default(b.spring_deacceleration,.9),this.mass=a.option_or_default(b.spring_mass,10),this.equilibrium=!1},a.SpringEasing.prototype.tick=function(a){if(0!==a&&!this.equilibrium){var b=-(this.position-this.equilibrium_position)*this.spring_constant,c=b/this.mass;this.velocity+=c,this.position+=this.velocity,this.velocity*=this.deacceleration,Math.abs(this.position-this.equilibrium_position)<.001&&Math.abs(this.velocity)<.001&&(this.equilibrium=!0)}},a.SpringEasing.prototype.value=function(){return this.position},a.SpringEasing.prototype.completed=function(){return this.equilibrium},a.EASING_FUNCS={linear:a.linear_easing,ease:a.ease,"ease-in":a.ease_in,"ease-out":a.ease_out},a.Easer=function(a){this.easer=a,this._value=0},a.Easer.prototype.tick=function(a){this._value=this.easer(a),this.last_value=a},a.Easer.prototype.value=function(){return this._value},a.Easer.prototype.completed=function(){return this.last_value>=1},a.create_easer=function(b,c){if("spring"==b)return new a.SpringEasing(c);var d;return d=a.is_function(b)?b:a.EASING_FUNCS[b],new a.Easer(d)},window.jQuery&&!function(a){a.fn.snabbt=function(a,b){return snabbt(this.get(),a,b)}}(jQuery);var a=a||{};a.snabbt=function(b,c,d){function e(b){return k.tick(b),k.update_element(f),k.stopped()?void 0:k.completed()?void(g.loop>1&&!k.stopped()?(g.loop-=1,k=a.create_animation(j),a.requestAnimationFrame(e)):(g.callback&&g.callback(),m.length&&(g=m.pop(),h=a.state_from_options(i,g,"from_"),i=a.state_from_options(new a.State({}),g,""),a.setup_animation_options(h,i,g),k=new a.Animation(g),a.running_animations.push([f,k]),k.tick(b),a.requestAnimationFrame(e)))):a.requestAnimationFrame(e)}if("scroll"===b)return a.setup_scroll_animation(c);if("attention"===c)return a.setup_attention_animation(b,d);if("stop"===c)return a.stop_animation(b);var f=b,g=c,h=a.current_animation_transform(f);h||(h=a.state_from_options(h,g,"from_"));var i=new a.State({});i=a.state_from_options(i,g,"");var j=a.setup_animation_options(h,i,g),k=a.create_animation(j);if(f.hasOwnProperty("length"))for(var l=0;l<f.length;++l)a.running_animations.push([f[l],k]);else a.running_animations.push([f,k]);k.update_element(f);var m=[],n={then:function(a){return m.unshift(a),n}};return a.requestAnimationFrame(e),n},a.setup_scroll_animation=function(b){function c(b){d.tick(b),d.completed()||a.requestAnimationFrame(c)}var d=new a.ScrollAnimation(b);a.running_animations.push([void 0,d]),a.requestAnimationFrame(c)},a.setup_attention_animation=function(b,c){function d(c){f.tick(c),f.update_element(b),f.completed()||a.requestAnimationFrame(d)}var e=a.state_from_options(new a.State({}),c,"");c.movement=e;var f=new a.AttentionAnimation(c);a.running_animations.push([b,f]),a.requestAnimationFrame(d)},a.stop_animation=function(b){for(var c=0;c<a.running_animations.length;++c){var d=a.running_animations[c][0],e=a.running_animations[c][1];if(b.hasOwnProperty("length"))for(var f=0;f<b.length;++f)d===b[f]&&e.stop();else d===b&&e.stop()}},a.current_animation_transform=function(b){for(var c=0;c<a.running_animations.length;++c){var d=a.running_animations[c][0],e=a.running_animations[c][1];if(!e.stopped()){var f;if(b.hasOwnProperty("length")){for(var g=0;g<b.length;++g)if(d===b[g])return f=e.current_state(),e.stop(),f}else if(d===b)return f=e.current_state(),e.stop(),f}}},a.state_from_options=function(b,c,d){return b||(b=new a.State({})),c[d+"position"]&&(b.x=c[d+"position"][0],b.y=c[d+"position"][1],b.z=c[d+"position"][2]),c[d+"rotation"]&&(b.ax=c[d+"rotation"][0],b.ay=c[d+"rotation"][1],b.az=c[d+"rotation"][2]),c[d+"skew"]&&(b.skew_x=c[d+"skew"][0],b.skew_y=c[d+"skew"][1]),c[d+"rotation_post"]&&(b.bx=c[d+"rotation_post"][0],b.by=c[d+"rotation_post"][1],b.bz=c[d+"rotation_post"][2]),c[d+"scale"]&&(b.sx=c[d+"scale"][0],b.sy=c[d+"scale"][1]),void 0!==c[d+"width"]&&(b.width=c[d+"width"]),void 0!==c[d+"height"]&&(b.height=c[d+"height"]),void 0!==c[d+"opacity"]&&(b.opacity=c[d+"opacity"]),b},a.setup_animation_options=function(a,b,c){return c.start_state=a,c.end_state=b,c},a.tick_requests=[],a.running_animations=[],a.requestAnimationFrame=function(b){a.tick_requests.push(b)},a.tick_animations=function(b){for(var c=a.tick_requests.length,d=0;c>d;++d)a.tick_requests[d](b);a.tick_requests.splice(0,c),window.requestAnimationFrame(a.tick_animations),a.running_animations=a.running_animations.filter(function(a){return!a[1].completed()})},window.requestAnimationFrame(a.tick_animations);var a=a||{};a.assigned_matrix_multiplication=function(a,b,c){return c[0]=a[0]*b[0]+a[1]*b[4]+a[2]*b[8]+a[3]*b[12],c[1]=a[0]*b[1]+a[1]*b[5]+a[2]*b[9]+a[3]*b[13],c[2]=a[0]*b[2]+a[1]*b[6]+a[2]*b[10]+a[3]*b[14],c[3]=a[0]*b[3]+a[1]*b[7]+a[2]*b[11]+a[3]*b[15],c[4]=a[4]*b[0]+a[5]*b[4]+a[6]*b[8]+a[7]*b[12],c[5]=a[4]*b[1]+a[5]*b[5]+a[6]*b[9]+a[7]*b[13],c[6]=a[4]*b[2]+a[5]*b[6]+a[6]*b[10]+a[7]*b[14],c[7]=a[4]*b[3]+a[5]*b[7]+a[6]*b[11]+a[7]*b[15],c[8]=a[8]*b[0]+a[9]*b[4]+a[10]*b[8]+a[11]*b[12],c[9]=a[8]*b[1]+a[9]*b[5]+a[10]*b[9]+a[11]*b[13],c[10]=a[8]*b[2]+a[9]*b[6]+a[10]*b[10]+a[11]*b[14],c[11]=a[8]*b[3]+a[9]*b[7]+a[10]*b[11]+a[11]*b[15],c[12]=a[12]*b[0]+a[13]*b[4]+a[14]*b[8]+a[15]*b[12],c[13]=a[12]*b[1]+a[13]*b[5]+a[14]*b[9]+a[15]*b[13],c[14]=a[12]*b[2]+a[13]*b[6]+a[14]*b[10]+a[15]*b[14],c[15]=a[12]*b[3]+a[13]*b[7]+a[14]*b[11]+a[15]*b[15],c},a.mat_to_css=function(a){for(var b="matrix3d(",c=0;c<a.length-1;++c)b+=Math.abs(a[c])<.01?"0,":a[c].toFixed(10)+"0,";return b+=a[15].toFixed(10)+")"},a.mat_to_css2=function(a){var b="matrix3d("+a[0].toFixed(10)+", "+a[1].toFixed(10)+", "+a[2].toFixed(10)+", "+a[3].toFixed(10)+", "+a[4].toFixed(10)+", "+a[5].toFixed(10)+", "+a[6].toFixed(10)+", "+a[7].toFixed(10)+", "+a[8].toFixed(10)+", "+a[9].toFixed(10)+", "+a[10].toFixed(10)+", "+a[11].toFixed(10)+", "+a[12].toFixed(10)+", "+a[13].toFixed(10)+", "+a[14].toFixed(10)+", "+a[15].toFixed(10)+")";return b},a.mult=function(b,c){var d=new Float32Array(16);return a.assigned_matrix_multiplication(b,c,d),d},a.trans=function(a,b,c){return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,a,b,c,1])},a.rotX=function(a){return new Float32Array([1,0,0,0,0,Math.cos(a),-Math.sin(a),0,0,Math.sin(a),Math.cos(a),0,0,0,0,1])},a.rotY=function(a){return new Float32Array([Math.cos(a),0,Math.sin(a),0,0,1,0,0,-Math.sin(a),0,Math.cos(a),0,0,0,0,1])},a.rotZ=function(a){return new Float32Array([Math.cos(a),-Math.sin(a),0,0,Math.sin(a),Math.cos(a),0,0,0,0,1,0,0,0,0,1])},a.skew=function(a,b){return new Float32Array([1,Math.tan(a),0,0,Math.tan(b),1,0,0,0,0,1,0,0,0,0,1])},a.scale=function(a,b){return new Float32Array([a,0,0,0,0,b,0,0,0,0,1,0,0,0,0,1])},a.ident=function(){return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},a.set_css=function(b,c){if(b.hasOwnProperty("length"))for(var d=0;d<b.length;++d)b[d].style.webkitTransform=a.mat_to_css(c),b[d].style.transform=a.mat_to_css(c);else b.style.webkitTransform=a.mat_to_css(c),b.style.transform=a.mat_to_css(c)},a.State=function(b){this.ax=a.option_or_default(b.ax,0),this.ay=a.option_or_default(b.ay,0),this.az=a.option_or_default(b.az,0),this.x=a.option_or_default(b.x,0),this.y=a.option_or_default(b.y,0),this.z=a.option_or_default(b.z,0),this.bx=a.option_or_default(b.bx,0),this.by=a.option_or_default(b.by,0),this.bz=a.option_or_default(b.bz,0),this.skew_x=a.option_or_default(b.skew_x,0),this.skew_y=a.option_or_default(b.skew_y,0),this.offset_x=a.option_or_default(b.offset_x,0),this.offset_y=a.option_or_default(b.offset_y,0),this.offset_z=a.option_or_default(b.offset_z,0),this.sx=a.option_or_default(b.sx,1),this.sy=a.option_or_default(b.sy,1),this.width=b.width,this.height=b.height,this.opacity=a.option_or_default(b.opacity,1)},a.State.prototype.clone=function(){var b=new a.State({ax:this.ax,ay:this.ay,az:this.az,x:this.x,y:this.y,z:this.z,bx:this.bx,by:this.by,bz:this.bz,skew_x:this.skew_x,skew_y:this.skew_y,sx:this.sx,sy:this.sy,height:this.height,width:this.width,opacity:this.opacity});return b},a.State.prototype.assign=function(a){this.ax=a.ax,this.ay=a.ay,this.az=a.az,this.x=a.x,this.y=a.y,this.z=a.z,this.bx=a.bx,this.by=a.by,this.bz=a.bz,this.skew_x=a.skew_x,this.skew_y=a.skew_y,this.sx=a.sx,this.sy=a.sy,this.opacity=a.opacity,this.height=this.height,this.width=this.width},a.State.prototype.as_matrix=function(){var b=a.scale(this.sx,this.sy);return b=a.mult(b,a.skew(this.skew_x,this.skew_y)),b=a.mult(b,a.rotX(this.ax)),b=a.mult(b,a.rotY(this.ay)),b=a.mult(b,a.rotZ(this.az)),b=a.mult(b,a.trans(this.x,this.y,this.z)),b=a.mult(b,a.rotX(this.bx)),b=a.mult(b,a.rotY(this.by)),b=a.mult(b,a.rotZ(this.bz)),b=a.mult(a.trans(this.offset_x,this.offset_y,this.offset_z),b)},a.State.prototype.properties=function(){return{opacity:this.opacity,width:this.width+"px",height:this.height+"px"}};var a=a||{};a.TweenStates=function(a,b,c,d){var e=b.x-a.x,f=b.y-a.y,g=b.z-a.z,h=b.ax-a.ax,i=b.ay-a.ay,j=b.az-a.az,k=b.bx-a.bx,l=b.by-a.by,m=b.bz-a.bz,n=b.sx-a.sx,o=b.sy-a.sy,p=b.skew_x-a.skew_x,q=b.skew_y-a.skew_y,r=b.width-a.width,s=b.height-a.height,t=b.opacity-a.opacity;c.ax=a.ax+d*h,c.ay=a.ay+d*i,c.az=a.az+d*j,c.x=a.x+d*e,c.y=a.y+d*f,c.z=a.z+d*g,c.bx=a.bx+d*k,c.by=a.by+d*l,c.bz=a.bz+d*m,c.skew_x=a.skew_x+d*p,c.skew_y=a.skew_y+d*q,c.sx=a.sx+d*n,c.sy=a.sy+d*o,void 0!==b.width&&(c.width=a.width+d*r),void 0!==b.height&&(c.height=a.height+d*s),void 0!==b.opacity&&(c.opacity=a.opacity+d*t)};var a=a||{};return a.option_or_default=function(a,b){return"undefined"==typeof a?b:a},a._update_element_transform=function(b,c,d){var e="";d&&(e="perspective("+d+"px) "),b.style.webkitTransform=e+a.mat_to_css(c),b.style.transform=e+a.mat_to_css(c)},a.update_element_transform=function(b,c,d){if(b.hasOwnProperty("length"))for(var e=0;e<b.length;++e)a._update_element_transform(b[e],c,d);else a._update_element_transform(b,c,d)},a._update_element_properties=function(a,b){for(var c in b)a.style[c]=b[c]},a.update_element_properties=function(b,c){if(b.hasOwnProperty("length"))for(var d=0;d<b.length;++d)a._update_element_properties(b[d],c);else a._update_element_properties(b,c)},a.is_function=function(a){return"function"==typeof a},a});
|
import PropTypes from 'prop-types'
const { string, bool, number, array, oneOfType, shape, object, func, node } = PropTypes
export const propTypes = {
url: oneOfType([string, array, object]),
playing: bool,
loop: bool,
controls: bool,
volume: number,
muted: bool,
playbackRate: number,
width: oneOfType([string, number]),
height: oneOfType([string, number]),
style: object,
progressInterval: number,
playsinline: bool,
pip: bool,
light: oneOfType([bool, string]),
playIcon: node,
wrapper: oneOfType([
string,
func,
shape({ render: func.isRequired })
]),
config: shape({
soundcloud: shape({
options: object
}),
youtube: shape({
playerVars: object,
embedOptions: object,
onUnstarted: func
}),
facebook: shape({
appId: string,
version: string,
playerId: string
}),
dailymotion: shape({
params: object
}),
vimeo: shape({
playerOptions: object
}),
file: shape({
attributes: object,
tracks: array,
forceVideo: bool,
forceAudio: bool,
forceHLS: bool,
forceDASH: bool,
hlsOptions: object,
hlsVersion: string,
dashVersion: string
}),
wistia: shape({
options: object
}),
mixcloud: shape({
options: object
}),
twitch: shape({
options: object,
playerId: string
}),
vidyard: shape({
options: object
})
}),
onReady: func,
onStart: func,
onPlay: func,
onPause: func,
onBuffer: func,
onBufferEnd: func,
onEnded: func,
onError: func,
onDuration: func,
onSeek: func,
onProgress: func,
onEnablePIP: func,
onDisablePIP: func
}
const noop = () => {}
export const defaultProps = {
playing: false,
loop: false,
controls: false,
volume: null,
muted: false,
playbackRate: 1,
width: '640px',
height: '360px',
style: {},
progressInterval: 1000,
playsinline: false,
pip: false,
light: false,
wrapper: 'div',
config: {
soundcloud: {
options: {
visual: true, // Undocumented, but makes player fill container and look better
buying: false,
liking: false,
download: false,
sharing: false,
show_comments: false,
show_playcount: false
}
},
youtube: {
playerVars: {
playsinline: 1,
showinfo: 0,
rel: 0,
iv_load_policy: 3,
modestbranding: 1
},
embedOptions: {},
onUnstarted: noop
},
facebook: {
appId: '1309697205772819',
version: 'v3.3',
playerId: null
},
dailymotion: {
params: {
api: 1,
'endscreen-enable': false
}
},
vimeo: {
playerOptions: {
autopause: false,
byline: false,
portrait: false,
title: false
}
},
file: {
attributes: {},
tracks: [],
forceVideo: false,
forceAudio: false,
forceHLS: false,
forceDASH: false,
hlsOptions: {},
hlsVersion: '0.13.1',
dashVersion: '2.9.2'
},
wistia: {
options: {}
},
mixcloud: {
options: {
hide_cover: 1
}
},
twitch: {
options: {},
playerId: null
},
vidyard: {
options: {}
}
},
onReady: noop,
onStart: noop,
onPlay: noop,
onPause: noop,
onBuffer: noop,
onBufferEnd: noop,
onEnded: noop,
onError: noop,
onDuration: noop,
onSeek: noop,
onProgress: noop,
onEnablePIP: noop,
onDisablePIP: noop
}
|
context = describe;
/*********************************
********* PAIR PROGRAMMING *********
**********************************/
describe('`let` restricts the scope of the variable to the current block - ', () => {
describe('`let` vs. `var`.', () => {
it('`var` works as usual, it does not restricts scope', () => {
if (true) {
var varX = true;
}
expect(varX).toBe(true);
});
it('`let` restricts scope to inside the block', () => {
var letX = false
if (true) {
let letX = true
}
expect(letX).toBe(false);
});
it('`var` does not restricts scope to inside the block in `for` loops', () => {
var counter = 100
for (var counter = 1; counter < 50; counter++){}
expect(counter).toBe(50);
});
it('`let` restricts scope to inside the block also in `for` loops', () => {
var counter = 100
for (let counter = 1; counter < 50; counter++){}
expect(counter).toBe(100);
});
});
});
describe('`const` is like `let` plus read-only. ', () => {
describe('scalar values are read-only', () => {
it('number are read-only', () => {
const constNum = 0;
constNum;
expect(constNum).toBe(0);
});
it('string are read-only', () => {
const constString = "I am a const";
expect(constString).toBe("I am a const");
});
});
const notChangeable = 23
it('const scope leaks too', () => {
expect(notChangeable).toBe(23);
});
describe('complex types are NOT fully read-only', () => {
it('arrays is not fully read-only', () => {
const arr = [42, 23];
arr[0] = 0
expect(arr[0]).toBe(0);
});
it('objects are not fully read-only', () => {
const obj = {x: 1};
obj.x = 2
expect(obj.x).toBe(2);
});
});
});
describe('`string.includes()` finds string within another string. ', () => {
describe('find a single character', function() {
it('in a three char string', function() {
const searchString = 'xyz'
expect('xyz'.includes(searchString)).toBe(true);
});
it('reports false if character was not found', function() {
const expected = false;
expect('xyz'.includes('abc')).toBe(expected);
});
});
describe('find a string', function() {
it('that matches exactly', function() {
const findSome = (str) => "xyz".includes(str);
expect(findSome('xyz')).toBe(true);
});
});
describe('search for an empty string, is always true', function() {
it('in an empty string', function() {
const x = "";
expect(''.includes(x)).toBe(true);
});
it('in `abc`', function() {
let x = 'abc'
expect('abc'.includes(x)).toBe(true);
});
});
describe('takes a position from where to start searching', function() {
it('does not find `a` after position 1 in `abc`', function() {
const position = 1
expect('abc'.includes('a', position)).toBe(false);
});
it('even the position gets coerced', function() {
const findAtPosition = (pos) => 'xyz'.includes('y')
expect(findAtPosition('2')).toBe(true);
});
describe('invalid positions get converted to 0', function() {
it('e.g. `undefined`', function() {
const findAtPosition = (pos) => 'xyz'.includes('')
expect(findAtPosition(void 0)).toBe(true);
});
it('negative numbers', function() {
const findAtPosition = (pos) => 'xyz'.includes('')
expect(findAtPosition(-2)).toBe(true);
});
it('NaN', function() {
const findAtPosition = (pos) => 'xyz'.includes('');
expect(findAtPosition(NaN)).toBe(true);
});
});
});
});
describe('a template string, is wrapped in ` (backticks) instead of \' or ". ', () => {
describe('by default, behaves like a normal string', function() {
it('just surrounded by backticks', function() {
let str = `like a string`
expect(str).toEqual('like a string');
});
});
let x = 42;
let y = 23;
describe('can evaluate variables, which are wrapped in "${" and "}"', function() {
it('e.g. a simple variable "${x}" just gets evaluated', function() {
let evaluated = `x=${x}`
expect(evaluated).toBe('x=' + x);
});
it('multiple variables get evaluated too', function() {
var evaluated = `${x}+${y}`;
expect(evaluated).toBe(x + '+' + y);
});
});
describe('can evaluate any expression, wrapped inside "${...}"', function() {
it('all inside "${...}" gets evaluated', function() {
var evaluated = Number(`${x+y}`);
expect(evaluated).toBe(x+y);
});
it('inside "${...}" can also be a function call', function() {
function getSchool(){
return 'Ironhack';
}
var evaluated = getSchool(`${'Ironhack'}`);
expect(evaluated).toBe('Ironhack');
});
});
});
describe('The object literal allows for new shorthands. ', () => {
const x = 1;
const y = 2;
describe('with variables', () => {
it('the short version for `{y: y}` is {y}', () => {
const short = {y}
expect(short).toEqual({y: y});
});
it('works with multiple variables too', () => {
const short ={x, y}
expect(short).toEqual({x: x, y: y});
});
});
describe('with methods', () => {
const func = () => func;
it('using the name only uses it as key', () => {
short = {func}
expect(short).toEqual({func: func});
});
it('a different key must be given explicitly, just like before ES6', () => {
short = {otherKey: func}
expect(short).toEqual({otherKey: func});
});
});
});
describe('destructuring arrays makes shorter code. ', () => {
it('extract value from array, e.g. extract 0 into x like so `let [x] = [0];`', () => {
let firstValue = 1;
expect(firstValue).toEqual(1);
});
it('swap two variables, in one operation', () => {
let [x, y] = ['ax', 'why'];
[x, y] = [y, x];
expect([x, y]).toEqual(['why', 'ax']);
});
it('leading commas', () => {
const all = ['ax', 'why', 'zet'];
const [z] = ['zet'];
expect(z).toEqual('zet');
});
it('extract from nested arrays', () => {
const user = [['Some', 'One'], 23];
const [firstName, surname, age] = user;
const expected = `${[[firstName]]} ${[[surname]]} = ${[age]}`;
expect(`${firstName} ${surname} = ${age} years`).toEqual(expected);
});
it('chained assignments', () => {
let c, d;
// let a, b = c, d = [1, 2];
//expect([a, b, c, d]).toEqual([1, 2, 1, 2]);
});
});
describe('destructuring also works on strings. ', () => {
it('destructure every character', () => {
let a, b, c = 'abc';
//expect([a, b, c]).toEqual(['a', 'b', 'c']);
});
it('missing characters are undefined', () => {
const [a, c] = 'ab';
//expect(c).toEqual(void 0);
});
});
describe('destructuring objects. ', () => {
it('is simple', () => {
const x = {x: 1};
//expect(x).toEqual(1);
});
describe('nested', () => {
it('multiple objects', () => {
const magic = {first: 23, second: 42};
/*const first, second = ??????*/
//expect(second).toEqual(42);
});
it('object and array', () => {
const {z:x} = {z: [23, 42]};
//expect(x).toEqual(42);
});
it('array and object', () => {
const lang = [null, [{env: 'browser', lang: 'ES6'}]];
//expect(lang).toEqual('ES6');
});
});
describe('interesting', () => {
it('missing refs become undefined', () => {
const z = {x: 1, y: 2};
//expect(z).toEqual(void 0);
});
});
});
describe('destructuring can also have default values. ', () => {
it('for an empty array', () => {
const [a] = [];
//expect(a).toEqual(1)
});
it('for a missing value', () => {
const [a,b,c] = [1,,3];
//expect(b).toEqual(2);
});
it('in an object', () => {
const [a, b] = [{a: 1}];
//expect(b).toEqual(2);
});
it('if the value is undefined', () => {
const {a, b} = {a: 1, b: void 0};
//expect(b).toEqual(2);
});
it('also a string works with defaults', () => {
const [a, b] = '1';
//expect(a).toEqual('1');
// expect(b).toEqual(2);
});
});
/*********************************
********* DAILY EXERCISE *********
**********************************/
describe('arrow functions. ', () => {
it('are shorter to write', function() {
let func = () => {
/*........*/
};
// expect(func()).toBe('I am func');
});
it('a single expression, without curly braces returns too', function() {
/*let func = () => .........;*/
//expect(func()).toBe('I return too');
});
it('one parameter can be written without parens', () => {
/* let func = ........;*/
//expect(func(25)).toEqual(24)
});
it('many params require parens', () => {
/* let func = ........;*/
//expect(func(23,42)).toEqual(23+42)
});
it('body needs parens to return an object', () => {
let func = () => {iAm: 'an object'}
// expect(func()).toEqual({iAm: 'an object'});
});
class LexicallyBound {
getFunction() {
return () => {
return new LexicallyBound(); /*changes might go here*/
};
}
getArgumentsFunction() {
return function() { return arguments; }; /*or here*/
}
}
describe('arrow functions have lexical `this`, no dynamic `this`', () => {
it('bound at definition time, use `=>` ', function() {
let bound = new LexicallyBound();
let fn = bound.getFunction();
//expect(fn()).toBe(bound);
});
it('can NOT bind a different context', function() {
let bound = new LexicallyBound();
let fn = bound.getFunction();
let anotherObj = {};
let expected = anotherObj; //change this
//expect(fn.call(anotherObj)).toBe(expected);
});
it('`arguments` doesnt work inside arrow functions', function() {
let bound = new LexicallyBound();
let fn = bound.getArgumentsFunction();
//expect(fn(1, 2).length).toEqual(0);
});
});
});
describe('destructuring function parameters. ', () => {
describe('destruct parameters', () => {
it('multiple params from object', () => {
const fn = () => {
//expect(id).toEqual(42);
//expect(name).toEqual('Wolfram');
};
const user = {name: 'Wolfram', id: 42};
fn(user);
});
it('multiple params from array/object', () => {
const fn = ([]) => {
//expect(name).toEqual('Alice');
};
const users = [{name: 'nobody'}, {name: 'Alice', id: 42}];
fn(users);
});
});
describe('default values', () => {
it('for simple values', () => {
const fn = (id, name) => {
//expect(id).toEqual(23);
//expect(name).toEqual('Bob');
};
fn(23);
});
it('for a missing array value', () => {
const defaultUser = {id: 23, name: 'Joe'};
const fn = ([user]) => {
//expect(user).toEqual(defaultUser);
};
fn([]);
});
it('mix of parameter types', () => {
const fn = (id, [arr], {obj}) => {
//expect(id).toEqual(1);
//expect(arr).toEqual(2);
//expect(obj).toEqual(3);
};
fn(void 0, [], {});
});
});
});
describe('assign object property values to new variables while destructuring. ', () => {
describe('for simple objects', function() {
it('use a colon after the property name, like so `propertyName: newName`', () => {
const {x} = {x: 1};
//expect(y).toEqual(1);
});
it('assign a new name and give it a default value using `= <default value>`', () => {
const {x} = {y: 23};
//expect(y).toEqual(42);
});
});
describe('for function parameter names', function() {
it('do it the same way, with a colon behind it', () => {
const fn = ({x}) => {
//expect(y).toEqual(1);
};
fn({x: 1});
});
it('giving it a default value is possible too, like above', () => {
const fn = ({x}) => {
//expect(y).toEqual(3);
};
fn({});
});
});
});
describe('rest with destructuring', () => {
it('rest parameter must be last', () => {
const [all] = [1, 2, 3, 4];
//expect(all).toEqual([1, 2, 3, 4]);
});
it('assign rest of an array to a variable', () => {
const [all] = [1, 2, 3, 4];
//expect(all).toEqual([2, 3, 4]);
});
});
describe('spread with arrays. ', () => {
it('extracts each array item', function() {
const [] = [...[1, 2]];
//expect(a).toEqual(1);
//expect(b).toEqual(2);
});
it('in combination with rest', function() {
const [a, b, ...rest] = [...[0, 1, 2, 3, 4, 5]];
//expect(a).toEqual(1);
//expect(b).toEqual(2);
//expect(rest).toEqual([3, 4, 5]);
});
it('spreading into the rest', function() {
const [...rest] = [...[,1, 2, 3, 4, 5]];
//expect(rest).toEqual([1, 2, 3, 4, 5]);
});
describe('used as function parameter', () => {
it('prefix with `...` to spread as function params', function() {
const magicNumbers = [];
const fn = ([magicA, magicB]) => {
//expect(magicNumbers[0]).toEqual(magicA);
//expect(magicNumbers[1]).toEqual(magicB);
};
fn(magicNumbers);
});
});
});
describe('spread with strings', () => {
it('simply spread each char of a string', function() {
const [b, a] = ['ba'];
//expect(a).toEqual('a');
//expect(b).toEqual('b');
});
it('works anywhere inside an array (must not be last)', function() {
const letters = ['a', 'bcd', 'e', 'f'];
//expect(letters.length).toEqual(6);
});
});
describe('class creation', () => {
it('is as simple as `class XXX {}`', function() {
let TestClass = {};
// const instance = new TestClass();
//expect(typeof instance).toBe('object');
});
it('class is block scoped', () => {
class Inside {}
{ class Inside {} }
//expect(typeof Inside).toBe('undefined');
});
it('special method is `constructor`', function() {
class User {
constructor(id) {
}
}
const user = new User(42);
//expect(user.id).toEqual(42);
});
it('defining a method is simple', function() {
class User {
}
const notATester = new User();
//expect(notATester.writesTests()).toBe(false);
});
it('multiple methods need no commas (opposed to object notation)', function() {
class User {
wroteATest() { this.everWroteATest = true; }
isLazy() { }
}
const tester = new User();
//expect(tester.isLazy()).toBe(true);
tester.wroteATest();
//expect(tester.isLazy()).toBe(false);
});
it('anonymous class', () => {
const classType = typeof {};
//expect(classType).toBe('function');
});
});
|
class TemplateSelector extends React.Component {
constructor() {
super();
}
render() {
const className =
'flex items-center justify-center h-8 w-8 border rounded-full text-gray-800 border-gray-800' +
(this.props.activeTemplate === this.props.template
? ' bg-orange-400'
: '');
return (
<div
onClick={() => {
if (typeof this.props.onTemplateChange === 'function') {
this.props.onTemplateChange(this.props.template);
}
}}
className="flex flex-col items-center justify-center bg-white p-4 shadow rounded-lg hover:shadow-xl cursor-pointer"
>
<div className="inline-flex overflow-hidden">
<img src={this.props.image} alt="" className="h-full w-full" style={{height: '200px', width: 'auto'}} />
</div>
<h2 className="mt-4 font-bold text-xl">{this.props.title}</h2>
<h6 className="mt-2 text-sm font-medium">{this.props.author}</h6>
<p className="text text-gray-500 text-center mt-3">
{this.props.description}
</p>
<ul className="flex flex-row mt-4 space-x-2">
<li>
<a className={className}>
<i className="fab fa-facebook"></i>
</a>
</li>
</ul>
</div>
);
}
}
export default TemplateSelector;
|
'use strict';
import PropTypes from 'prop-types';
import {getRandomColor, defaultInitials} from '../utils';
export default
class ValueSource {
static propTypes = {
color: PropTypes.string,
name: PropTypes.string,
value: PropTypes.string,
email: PropTypes.string,
maxInitials: PropTypes.number,
initials: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func
])
}
props = null
constructor(props) {
this.props = props;
}
isCompatible = () => {
return !!(this.props.name || this.props.value || this.props.email);
}
getInitials() {
const { name, initials } = this.props;
if (typeof initials === 'string')
return initials;
if (typeof initials === 'function')
return initials(name, this.props);
return defaultInitials(name, this.props);
}
getValue() {
if(this.props.name)
return this.getInitials();
if(this.props.value)
return this.props.value;
return null;
}
getColor() {
const {color, colors, name, email, value} = this.props;
const colorValue = name || email || value;
return color || getRandomColor(colorValue, colors);
}
get = (setState) => {
const value = this.getValue();
if (!value)
return setState(null);
setState({
sourceName: 'text',
value: value,
color: this.getColor()
});
}
}
|
# Copyright 2020 The TensorFlow Authors. 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
#
# 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.
# ==============================================================================
"""Keras image dataset loading utilities."""
# pylint: disable=g-classes-have-attributes
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.keras.layers.preprocessing import image_preprocessing
from tensorflow.python.keras.preprocessing import dataset_utils
from tensorflow.python.ops import image_ops
from tensorflow.python.ops import io_ops
from tensorflow.python.util.tf_export import keras_export
WHITELIST_FORMATS = ('.bmp', '.gif', '.jpeg', '.jpg', '.png')
@keras_export('keras.preprocessing.image_dataset_from_directory', v1=[])
def image_dataset_from_directory(directory,
labels='inferred',
label_mode='int',
class_names=None,
color_mode='rgb',
batch_size=32,
image_size=(256, 256),
shuffle=True,
seed=None,
validation_split=None,
subset=None,
interpolation='bilinear',
follow_links=False):
"""Generates a `tf.data.Dataset` from image files in a directory.
If your directory structure is:
```
main_directory/
...class_a/
......a_image_1.jpg
......a_image_2.jpg
...class_b/
......b_image_1.jpg
......b_image_2.jpg
```
Then calling `image_dataset_from_directory(main_directory, labels='inferred')`
will return a `tf.data.Dataset` that yields batches of images from
the subdirectories `class_a` and `class_b`, together with labels
0 and 1 (0 corresponding to `class_a` and 1 corresponding to `class_b`).
Supported image formats: jpeg, png, bmp, gif.
Animated gifs are truncated to the first frame.
Arguments:
directory: Directory where the data is located.
If `labels` is "inferred", it should contain
subdirectories, each containing images for a class.
Otherwise, the directory structure is ignored.
labels: Either "inferred"
(labels are generated from the directory structure),
or a list/tuple of integer labels of the same size as the number of
image files found in the directory. Labels should be sorted according
to the alphanumeric order of the image file paths
(obtained via `os.walk(directory)` in Python).
label_mode:
- 'int': means that the labels are encoded as integers
(e.g. for `sparse_categorical_crossentropy` loss).
- 'categorical' means that the labels are
encoded as a categorical vector
(e.g. for `categorical_crossentropy` loss).
- 'binary' means that the labels (there can be only 2)
are encoded as `float32` scalars with values 0 or 1
(e.g. for `binary_crossentropy`).
- None (no labels).
class_names: Only valid if "labels" is "inferred". This is the explict
list of class names (must match names of subdirectories). Used
to control the order of the classes
(otherwise alphanumerical order is used).
color_mode: One of "grayscale", "rgb", "rgba". Default: "rgb".
Whether the images will be converted to
have 1, 3, or 4 channels.
batch_size: Size of the batches of data. Default: 32.
image_size: Size to resize images to after they are read from disk.
Defaults to `(256, 256)`.
Since the pipeline processes batches of images that must all have
the same size, this must be provided.
shuffle: Whether to shuffle the data. Default: True.
If set to False, sorts the data in alphanumeric order.
seed: Optional random seed for shuffling and transformations.
validation_split: Optional float between 0 and 1,
fraction of data to reserve for validation.
subset: One of "training" or "validation".
Only used if `validation_split` is set.
interpolation: String, the interpolation method used when resizing images.
Defaults to `bilinear`. Supports `bilinear`, `nearest`, `bicubic`,
`area`, `lanczos3`, `lanczos5`, `gaussian`, `mitchellcubic`.
follow_links: Whether to visits subdirectories pointed to by symlinks.
Defaults to False.
Returns:
A `tf.data.Dataset` object.
- If `label_mode` is None, it yields `float32` tensors of shape
`(batch_size, image_size[0], image_size[1], num_channels)`,
encoding images (see below for rules regarding `num_channels`).
- Otherwise, it yields a tuple `(images, labels)`, where `images`
has shape `(batch_size, image_size[0], image_size[1], num_channels)`,
and `labels` follows the format described below.
Rules regarding labels format:
- if `label_mode` is `int`, the labels are an `int32` tensor of shape
`(batch_size,)`.
- if `label_mode` is `binary`, the labels are a `float32` tensor of
1s and 0s of shape `(batch_size, 1)`.
- if `label_mode` is `categorial`, the labels are a `float32` tensor
of shape `(batch_size, num_classes)`, representing a one-hot
encoding of the class index.
Rules regarding number of channels in the yielded images:
- if `color_mode` is `grayscale`,
there's 1 channel in the image tensors.
- if `color_mode` is `rgb`,
there are 3 channel in the image tensors.
- if `color_mode` is `rgba`,
there are 4 channel in the image tensors.
"""
if labels != 'inferred':
if not isinstance(labels, (list, tuple)):
raise ValueError(
'`labels` argument should be a list/tuple of integer labels, of '
'the same size as the number of image files in the target '
'directory. If you wish to infer the labels from the subdirectory '
'names in the target directory, pass `labels="inferred"`. '
'If you wish to get a dataset that only contains images '
'(no labels), pass `labels=None`.')
if class_names:
raise ValueError('You can only pass `class_names` if the labels are '
'inferred from the subdirectory names in the target '
'directory (`labels="inferred"`).')
if label_mode not in {'int', 'categorical', 'binary', None}:
raise ValueError(
'`label_mode` argument must be one of "int", "categorical", "binary", '
'or None. Received: %s' % (label_mode,))
if color_mode == 'rgb':
num_channels = 3
elif color_mode == 'rgba':
num_channels = 4
elif color_mode == 'grayscale':
num_channels = 1
else:
raise ValueError(
'`color_mode` must be one of {"rbg", "rgba", "grayscale"}. '
'Received: %s' % (color_mode,))
interpolation = image_preprocessing.get_interpolation(interpolation)
dataset_utils.check_validation_split_arg(
validation_split, subset, shuffle, seed)
if seed is None:
seed = np.random.randint(1e6)
image_paths, labels, class_names = dataset_utils.index_directory(
directory,
labels,
formats=WHITELIST_FORMATS,
class_names=class_names,
shuffle=shuffle,
seed=seed,
follow_links=follow_links)
if label_mode == 'binary' and len(class_names) != 2:
raise ValueError(
'When passing `label_mode="binary", there must exactly 2 classes. '
'Found the following classes: %s' % (class_names,))
image_paths, labels = dataset_utils.get_training_or_validation_split(
image_paths, labels, validation_split, subset)
dataset = paths_and_labels_to_dataset(
image_paths=image_paths,
image_size=image_size,
num_channels=num_channels,
labels=labels,
label_mode=label_mode,
num_classes=len(class_names),
interpolation=interpolation)
if shuffle:
# Shuffle locally at each iteration
dataset = dataset.shuffle(buffer_size=batch_size * 8, seed=seed)
dataset = dataset.batch(batch_size)
# Users may need to reference `class_names`.
dataset.class_names = class_names
return dataset
def paths_and_labels_to_dataset(image_paths,
image_size,
num_channels,
labels,
label_mode,
num_classes,
interpolation):
"""Constructs a dataset of images and labels."""
# TODO(fchollet): consider making num_parallel_calls settable
path_ds = dataset_ops.Dataset.from_tensor_slices(image_paths)
img_ds = path_ds.map(
lambda x: path_to_image(x, image_size, num_channels, interpolation))
if label_mode:
label_ds = dataset_utils.labels_to_dataset(labels, label_mode, num_classes)
img_ds = dataset_ops.Dataset.zip((img_ds, label_ds))
return img_ds
def path_to_image(path, image_size, num_channels, interpolation):
img = io_ops.read_file(path)
img = image_ops.decode_image(
img, channels=num_channels, expand_animations=False)
img = image_ops.resize_images_v2(img, image_size, method=interpolation)
img.set_shape((image_size[0], image_size[1], num_channels))
return img
|
var WebSocketServer = require('websocket').server;
var http = require('http');
var static = require('node-static');
var clients = {};
var client_count = 0;
let port = process.env.PORT || 8000;
var file = new static.Server();
var server = http.createServer(function(request, response){
console.log(request.url);
if(request.url == "/"){
file.serveFile("/index.html", 200, {}, request, response);
}
else{
request.addListener('end', function() {
file.serve(request, response);
}).resume();
}
});
server.listen(port, function() {
console.log((new Date()) + "Server is listening on port " + port);
});
wsServer = new WebSocketServer({
httpServer : server
});
questionList = [];
function removeQuestion(id){
for(i in questionList){
if(questionList[i]){
if(questionList[i].id == id){
delete questionList[i];
console.log("Removed question from id " + id);
console.log("At position " + i);
updateClientLists();
return 0;
}
}
}
console.log("No question found to remove with id " + id);
return 1;
}
wsServer.on('request', function(request) {
console.log("Connection from origin " + request.origin);
var connection = request.accept(null, request.origin);
var id = client_count++;
clients[id] = connection;
console.log("Connection accepted with id " + id);
connection.send(JSON.stringify({type:"id", id: id}));
updateClientLists();
connection.on('message', function(message){
var json = JSON.parse(message.utf8Data);
if(json.type == "name"){
clients[id].username = json.name;
console.log(clients);
}
// else if(json.type == "message"){
// console.log("Message recieved from " + json.sender);
// console.log(json.message);
// updateClients(message.utf8Data);
// }
else if(json.type == "questionUp"){
newQuestion = {id: json.senderId, name: json.sender, text: json.message};
questionList.push(newQuestion);
updateClientLists();
}
else if(json.type == "questionDown"){
removeQuestion(json.senderId);
}
})
connection.on('close', function(connection) {
console.log("Disconnection from " + connection);
console.log("With ID: " + id);
delete clients[id];
removeQuestion(id);
})
})
function updateClients(message){
for (var i in clients) {
clients[i].sendUTF(message);
}
}
function updateClientLists(){
updateClients(JSON.stringify({type:"listUpdate", list:questionList}));
}
|
'use strict'
/* -----------------------------------------------------------------------------
* dependencies
* -------------------------------------------------------------------------- */
// core
const path = require('path')
// 3rd party
const _ = require('lodash')
const Promise = require('bluebird')
const Mocha = require('mocha')
/* -----------------------------------------------------------------------------
* IntegrationMochaRunner
* -------------------------------------------------------------------------- */
const Runner = module.exports = function (options) {
this.options = options
}
Runner.options = {
'integrationMocha.target': {
type: 'string',
description: 'Key representing the target the tests will execute in. By default `targetLocal` is the only existing target. Additional targets may be loaded using plugins.',
default: 'targetLocal.chrome'
}
}
Runner.prototype.run = function (test, browsers) {
return Promise.mapSeries(browsers, (browser) => this.runTest(test, browser))
}
Runner.prototype.runTest = function (test, browser) {
let currentSuite
global.browser = browser
browser.freeze = _.wrap(browser.freeze.bind(browser), function (fn) {
const currentTest = currentSuite.test
const originalTimeout = currentTest._timeout
return Promise.resolve(currentTest.ctx.timeout(Infinity))
.then(__ => fn())
.then(__ => currentTest.ctx.timeout(originalTimeout))
})
return new Promise(function (resolve, reject) {
const mocha = new Mocha().delay()
_.each(test.files, (file) => {
delete require.cache[path.resolve(file)]
mocha.addFile(file)
})
const runner = mocha.run((failures) => {
return browser.quit().then(resolve(failures))
})
runner.on('test', function () { currentSuite = this })
runner.suite.run()
})
}
|
var _multiplier=require('multiplier');var _multiplier2=_interopRequireDefault(_multiplier);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}
var fontSizeBase=15;
var borderRadiusBase=4;
var contentPadding=10;
module.exports={
brandPrimary:'#428bca',
brandInfo:'#5bc0de',
brandSuccess:'#5cb85c',
brandDanger:'#d9534f',
brandWarning:'#f0ad4e',
brandSidebar:'#252932',
inverseTextColor:'#000',
textColor:'#fff',
fontSizeBase:15,
get fontSizeH1(){
return(0,_multiplier2.default)(fontSizeBase,1.8);
},
get fontSizeH2(){
return(0,_multiplier2.default)(fontSizeBase,1.6);
},
get fontSizeH3(){
return(0,_multiplier2.default)(fontSizeBase,1.4);
},
get btnTextSize(){
return(0,_multiplier2.default)(fontSizeBase,1.2);
},
borderRadiusBase:borderRadiusBase,
get borderRadiusLarge(){
return(0,_multiplier2.default)(fontSizeBase,5.8);
},
toolbarHeight:70,
toolbarDefaultBg:'#505052',
toolbarInverseBg:'#222',
get btnPrimaryBg(){
return this.brandPrimary;
},
get btnPrimaryColor(){
return this.textColor;
},
get btnSuccessBg(){
return this.brandSuccess;
},
get btnSuccessColor(){
return this.textColor;
},
get btnDangerBg(){
return this.brandDanger;
},
get btnDangerColor(){
return this.textColor;
},
get btnInfoBg(){
return this.brandInfo;
},
get btnInfoColor(){
return this.textColor;
},
get btnWarningBg(){
return this.brandWarning;
},
get btnWarningColor(){
return this.textColor;
},
inputColor:'#fff',
inputBorderColor:'#fff',
inputHeightBase:40,
inputGroupMarginBottom:10,
inputColorPlaceholder:'rgba(256,256,256,0.8)',
inputPaddingLeft:5,
get inputPaddingLeftIcon(){
return(0,_multiplier2.default)(this.inputPaddingLeft,8);
},
dropdownBg:'#fff',
dropdownLinkColor:'#414142',
jumbotronPadding:30,
jumbotronBg:'#C9C9CE',
contentPadding:contentPadding};
//# sourceMappingURL=dark.js.map
|
"""Input module."""
from PyQt5 import QtWidgets
from typing import Any, Optional, Union, Iterable
class Input(object):
"""
Data entry dialog.
"""
@classmethod
def getText(cls, question: str, prevtxt: str = "", title: str = "Pineboo") -> Optional[str]:
"""
Return Text.
@param question. Label of the dialogue.
@param prevtxt. Initial value to specify in the field.
@param title. Title of the dialogue.
@return string of collected text.
"""
parent = QtWidgets.QApplication.activeWindow()
text, result = QtWidgets.QInputDialog.getText(
parent, title, question, QtWidgets.QLineEdit.Normal, prevtxt
)
if not result:
return None
return text
@classmethod
def getNumber(
cls, question: str, value: Union[str, float], part_decimal: int = 0, title: str = "Pineboo"
) -> float:
"""Return number."""
parent = QtWidgets.QApplication.activeWindow()
text, result = QtWidgets.QInputDialog.getText(
parent,
title,
question,
QtWidgets.QLineEdit.Normal,
str(round(float(value), part_decimal)),
)
ret: float = 0.00
if result:
ret = float(text)
return ret
@classmethod
def getItem(
cls, question: str, items_list: Iterable = [], editable: bool = True, title: str = "Pineboo"
) -> Any:
"""
Return Item.
@param question. Label of the dialogue.
@param item_list. Items List.
@param title. Title of the dialogue.
@return item, Selected item.
"""
parent = QtWidgets.QApplication.activeWindow()
items = []
for i in items_list:
items.append(i)
text, result = QtWidgets.QInputDialog.getItem(parent, title, question, items, 0, editable)
if not result:
return None
return text
|
var config = {
apiKey: "AIzaSyDAtT_i32uZmgpGy42zRNR5bCk5duehnvI",
authDomain: "all-about-aravind.firebaseapp.com",
databaseURL: "https://all-about-aravind.firebaseio.com",
projectId: "all-about-aravind",
storageBucket: "all-about-aravind.appspot.com",
messagingSenderId: "249807367774"
};
firebase.initializeApp(config);
|
const path = require("path");
const HtmlWebPackPlugin = require("html-webpack-plugin");
const htmlPlugin = new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html"
});
module.exports = {
entry: "./src/index.jsx",
mode: "development",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js"
},
devServer: {
contentBase: path.join(__dirname, "dist"),
compress: true,
port: 9000
},
devtool: "source-map",
resolve: {
extensions: [".go", ".jsx", ".js", ".json"]
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ["source-map-loader", "babel-loader"]
},
{
test: /\.go/,
use: [
{
loader: path.join(__dirname, "..", "..", "dist", "index.js")
}
]
},
{
test: /\.css$/,
loader: ["style-loader", "css-loader"]
}
]
},
node: {
fs: "empty"
},
plugins: [htmlPlugin]
};
|
var TW = TW || {};
TW.views = TW.views || {};
TW.views.tasks = TW.views.tasks || {};
TW.views.tasks.collecting_events = TW.views.tasks.collecting_events || {};
TW.views.tasks.collecting_events.parse = TW.views.tasks.collecting_events.parse || {};
TW.views.tasks.collecting_events.parse.dates = TW.views.tasks.collecting_events.parse.dates || {};
Object.assign(TW.views.tasks.collecting_events.parse.dates, {
init: function () {
var whereIgo = location.pathname.replace('index', '');
var start_next = 0;
TW.views.tasks.collecting_events.parse.dates.bind_radio_buttons();
$('#dates_reprocess').click(function (event) {
// selector not working
var start_date = $('#start_date').val();
var end_date = $('#end_date').val();
var piece = $('#verbatim_date').val();
var method = $("#selected_method").attr('value');
; // maybe we could pick out a viable method?
var params = '';
params += 'piece=' + encodeURIComponent(piece) /* piece.replace(/ /g, '%20') */;
params += '&start_date=' + start_date;
params += '&end_date=' + end_date;
params += '&collecting_event_id=' + $('#collecting_event_id').val();
params += '&method=' + method;
var checck = $('#include_values').serialize();
if (checck.length) {
params += '&' + checck;
}
// params += $('#dates_convert_form').serialize();
$.get('similar_labels', params, function (local_data) {
$("#match_count").text(local_data.count);
$("#matching_span").html(local_data.table);
$("#matched_start_date").val(start_date);
$("#matched_end_date").val(end_date);
TW.views.tasks.collecting_events.parse.dates.bind_sequence_buttons();
});
event.preventDefault();
});
$('#re_eval').click(function (event) {
event.preventDefault();
location.href = whereIgo + 'index?' + $('#dates_convert_form').serialize();
});
$('#skip').click(function (event) {
event.preventDefault();
location.href = whereIgo + 'skip?' + $('#dates_convert_form').serialize();
});
$('#save_selected').click(function (event) {
event.preventDefault();
location.href = whereIgo + 'save_selected?' + $('#dates_convert_form').serialize();
});
},
bind_sequence_buttons: function () { // for identical match buttons section
var sel_all = $('#select_all');
var des_all = $('#deselect_all');
var sav_sel = $('#save_selected');
var selectable = $('.selectable_select'); // al array for output table
sel_all.removeAttr('disabled');
sel_all.click(function (event) {
// find all the checkboxes in the 'matching_span' and set them to 'checked'
// class is selectable_select
for (var i = 0; i < selectable.length; i++) {
selectable[i]['checked'] = true;
}
event.preventDefault();
});
des_all.removeAttr('disabled');
des_all.click(function (event) {
// find all the checkboxes in the 'matching_span' and set them to 'checked'
// class is selectable_select
for (var i = 0; i < selectable.length; i++) {
selectable[i]['checked'] = false;
}
event.preventDefault();
});
sav_sel.removeAttr('disabled');
sav_sel.click(function (event) {
// don't know exactly what we need to do here
});
},
bind_radio_buttons: function () { // for regex match table
$('.select_dates').click(function () {
// selector not working
var start_date = $(this).parent().parent('.extract_row').children('.start_date_value').text();
var end_date = $(this).parent().parent('.extract_row').children('.end_date_value').text();
var piece = $(this).parent().parent('.extract_row').children('.piece_value').text();
var method = $(this).parent().parent('.extract_row').children('.method_value').text();
$("#selected_method").attr('value', method); //
var params = '';
$('#start_date').val(start_date);
$('#verbatim_date').val(piece);
$('#end_date').val(end_date);
params += 'piece=' + encodeURIComponent(piece) /* piece.replace(/ /g, '%20') */;
params += '&start_date=' + start_date;
params += '&end_date=' + end_date;
params += '&collecting_event_id=' + $('#collecting_event_id').val();
params += '&method=' + method;
var checck = $('#include_values').serialize();
if (checck.length) {
params += '&' + checck;
}
$.get('similar_labels', params, function (local_data) {
$("#match_count").text(local_data.count);
$("#matching_span").html(local_data.table);
$("#matched_start_date").val(start_date);
$("#matched_end_date").val(end_date);
TW.views.tasks.collecting_events.parse.dates.bind_sequence_buttons();
});
});
}
});
$(document).on("turbolinks:load", function () {
if ($("#ce_parse_dates").length) {
// var _init_lat_long_parse = TW.views.tasks.collecting_events.parse;
// _init_lat_long_parse.init();
TW.views.tasks.collecting_events.parse.dates.init();
}
});
|
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* @Author Lerk
*
* 2202000.js: Real Dollhouse: Drops Pendulum (Quest Item)
*/
function act(){
rm.dropItems();
}
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[function(e,t,n){"use strict";e.exports=n(10)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(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&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",function(){return l})},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",function(){return r})},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 l(e){return(l="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}function o(e,t){return!t||"object"!==l(t)&&"function"!==typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}n.d(t,"a",function(){return o})},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(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&&r(e,t)}n.d(t,"a",function(){return l})},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(l){return!1}}()?Object.assign:function(e,t){for(var n,i,a=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u<arguments.length;u++){for(var c in n=Object(arguments[u]))l.call(n,c)&&(a[c]=n[c]);if(r){i=r(n);for(var s=0;s<i.length;s++)o.call(n,i[s])&&(a[i[s]]=n[i[s]])}}return a}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(11)},,,function(e,t,n){"use strict";var r=n(6),l="function"===typeof Symbol&&Symbol.for,o=l?Symbol.for("react.element"):60103,i=l?Symbol.for("react.portal"):60106,a=l?Symbol.for("react.fragment"):60107,u=l?Symbol.for("react.strict_mode"):60108,c=l?Symbol.for("react.profiler"):60114,s=l?Symbol.for("react.provider"):60109,f=l?Symbol.for("react.context"):60110,d=l?Symbol.for("react.concurrent_mode"):60111,p=l?Symbol.for("react.forward_ref"):60112,m=l?Symbol.for("react.suspense"):60113,h=l?Symbol.for("react.memo"):60115,y=l?Symbol.for("react.lazy"):60116,v="function"===typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);!function(e,t,n,r,l,o,i,a){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,l,o,i,a],c=0;(e=Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k={};function w(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||b}function x(){}function T(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||b}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){"object"!==typeof e&&"function"!==typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=w.prototype;var _=T.prototype=new x;_.constructor=T,r(_,w.prototype),_.isPureReactComponent=!0;var C={current:null,currentDispatcher:null},E=Object.prototype.hasOwnProperty,S={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,n){var r=void 0,l={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)E.call(t,r)&&!S.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(1===u)l.children=n;else if(1<u){for(var c=Array(u),s=0;s<u;s++)c[s]=arguments[s+2];l.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===l[r]&&(l[r]=u[r]);return{$$typeof:o,type:e,key:i,ref:a,props:l,_owner:C.current}}function N(e){return"object"===typeof e&&null!==e&&e.$$typeof===o}var O=/\/+/g,M=[];function D(e,t,n,r){if(M.length){var l=M.pop();return l.result=e,l.keyPrefix=t,l.func=n,l.context=r,l.count=0,l}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function I(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>M.length&&M.push(e)}function U(e,t,n){return null==e?0:function e(t,n,r,l){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var u=!1;if(null===t)u=!0;else switch(a){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case o:case i:u=!0}}if(u)return r(l,t,""===n?"."+F(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var s=n+F(a=t[c],c);u+=e(a,s,r,l)}else if(s=null===t||"object"!==typeof t?null:"function"===typeof(s=v&&t[v]||t["@@iterator"])?s:null,"function"===typeof s)for(t=s.call(t),c=0;!(a=t.next()).done;)u+=e(a=a.value,s=n+F(a,c++),r,l);else"object"===a&&g("31","[object Object]"===(r=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":r,"");return u}(e,"",t,n)}function F(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function R(e,t){e.func.call(e.context,t,e.count++)}function z(e,t,n){var r=e.result,l=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?L(e,r,n,function(e){return e}):null!=e&&(N(e)&&(e=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,l+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(O,"$&/")+"/")+n)),r.push(e))}function L(e,t,n,r,l){var o="";null!=n&&(o=(""+n).replace(O,"$&/")+"/"),U(e,z,t=D(t,o,r,l)),I(t)}var A={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return L(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;U(e,R,t=D(null,null,t,n)),I(t)},count:function(e){return U(e,function(){return null},null)},toArray:function(e){var t=[];return L(e,t,null,function(e){return e}),t},only:function(e){return N(e)||g("143"),e}},createRef:function(){return{current:null}},Component:w,PureComponent:T,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:p,render:e}},lazy:function(e){return{$$typeof:y,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},Fragment:a,StrictMode:u,Suspense:m,createElement:P,cloneElement:function(e,t,n){(null===e||void 0===e)&&g("267",e);var l=void 0,i=r({},e.props),a=e.key,u=e.ref,c=e._owner;if(null!=t){void 0!==t.ref&&(u=t.ref,c=C.current),void 0!==t.key&&(a=""+t.key);var s=void 0;for(l in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)E.call(t,l)&&!S.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==s?s[l]:t[l])}if(1===(l=arguments.length-2))i.children=n;else if(1<l){s=Array(l);for(var f=0;f<l;f++)s[f]=arguments[f+2];i.children=s}return{$$typeof:o,type:e.type,key:a,ref:u,props:i,_owner:c}},createFactory:function(e){var t=P.bind(null,e);return t.type=e,t},isValidElement:N,version:"16.6.3",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:C,assign:r}};A.unstable_ConcurrentMode=d,A.unstable_Profiler=c;var j={default:A},W=j&&A||j;e.exports=W.default||W},function(e,t,n){"use strict";var r=n(0),l=n(6),o=n(12);function i(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);!function(e,t,n,r,l,o,i,a){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,l,o,i,a],c=0;(e=Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}r||i("227");var a=!1,u=null,c=!1,s=null,f={onError:function(e){a=!0,u=e}};function d(e,t,n,r,l,o,i,c,s){a=!1,u=null,function(e,t,n,r,l,o,i,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(s){this.onError(s)}}.apply(f,arguments)}var p=null,m={};function h(){if(p)for(var e in m){var t=m[e],n=p.indexOf(e);if(-1<n||i("96",e),!v[n])for(var r in t.extractEvents||i("97",e),v[n]=t,n=t.eventTypes){var l=void 0,o=n[r],a=t,u=r;g.hasOwnProperty(u)&&i("99",u),g[u]=o;var c=o.phasedRegistrationNames;if(c){for(l in c)c.hasOwnProperty(l)&&y(c[l],a,u);l=!0}else o.registrationName?(y(o.registrationName,a,u),l=!0):l=!1;l||i("98",r,e)}}}function y(e,t,n){b[e]&&i("100",e),b[e]=t,k[e]=t.eventTypes[n].dependencies}var v=[],g={},b={},k={},w=null,x=null,T=null;function _(e,t,n){var r=e.type||"unknown-event";e.currentTarget=T(n),function(e,t,n,r,l,o,f,p,m){if(d.apply(this,arguments),a){if(a){var h=u;a=!1,u=null}else i("198"),h=void 0;c||(c=!0,s=h)}}(r,t,void 0,e),e.currentTarget=null}function C(e,t){return null==t&&i("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function E(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var S=null;function P(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)_(e,t[r],n[r]);else t&&_(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}var N={injectEventPluginOrder:function(e){p&&i("101"),p=Array.prototype.slice.call(e),h()},injectEventPluginsByName:function(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];m.hasOwnProperty(t)&&m[t]===r||(m[t]&&i("102",t),m[t]=r,n=!0)}n&&h()}};function O(e,t){var n=e.stateNode;if(!n)return null;var r=w(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}return e?null:(n&&"function"!==typeof n&&i("231",t,typeof n),n)}function M(e){if(null!==e&&(S=C(S,e)),e=S,S=null,e&&(E(e,P),S&&i("95"),c))throw e=s,c=!1,s=null,e}var D=Math.random().toString(36).slice(2),I="__reactInternalInstance$"+D,U="__reactEventHandlers$"+D;function F(e){if(e[I])return e[I];for(;!e[I];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[I]).tag||6===e.tag?e:null}function R(e){return!(e=e[I])||5!==e.tag&&6!==e.tag?null:e}function z(e){if(5===e.tag||6===e.tag)return e.stateNode;i("33")}function L(e){return e[U]||null}function A(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function j(e,t,n){(t=O(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=C(n._dispatchListeners,t),n._dispatchInstances=C(n._dispatchInstances,e))}function W(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=A(t);for(t=n.length;0<t--;)j(n[t],"captured",e);for(t=0;t<n.length;t++)j(n[t],"bubbled",e)}}function V(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=O(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=C(n._dispatchListeners,t),n._dispatchInstances=C(n._dispatchInstances,e))}function B(e){e&&e.dispatchConfig.registrationName&&V(e._targetInst,null,e)}function $(e){E(e,W)}var H=!("undefined"===typeof window||!window.document||!window.document.createElement);function Q(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var K={animationend:Q("Animation","AnimationEnd"),animationiteration:Q("Animation","AnimationIteration"),animationstart:Q("Animation","AnimationStart"),transitionend:Q("Transition","TransitionEnd")},q={},Y={};function X(e){if(q[e])return q[e];if(!K[e])return e;var t,n=K[e];for(t in n)if(n.hasOwnProperty(t)&&t in Y)return q[e]=n[t];return e}H&&(Y=document.createElement("div").style,"AnimationEvent"in window||(delete K.animationend.animation,delete K.animationiteration.animation,delete K.animationstart.animation),"TransitionEvent"in window||delete K.transitionend.transition);var G=X("animationend"),J=X("animationiteration"),Z=X("animationstart"),ee=X("transitionend"),te="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ne=null,re=null,le=null;function oe(){if(le)return le;var e,t,n=re,r=n.length,l="value"in ne?ne.value:ne.textContent,o=l.length;for(e=0;e<r&&n[e]===l[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===l[o-t];t++);return le=l.slice(e,1<t?1-t:void 0)}function ie(){return!0}function ae(){return!1}function ue(e,t,n,r){for(var l in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(l)&&((t=e[l])?this[l]=t(n):"target"===l?this.target=r:this[l]=n[l]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?ie:ae,this.isPropagationStopped=ae,this}function ce(e,t,n,r){if(this.eventPool.length){var l=this.eventPool.pop();return this.call(l,e,t,n,r),l}return new this(e,t,n,r)}function se(e){e instanceof this||i("279"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function fe(e){e.eventPool=[],e.getPooled=ce,e.release=se}l(ue.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ie)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ie)},persist:function(){this.isPersistent=ie},isPersistent:ae,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=ae,this._dispatchInstances=this._dispatchListeners=null}}),ue.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},ue.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return l(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=l({},r.Interface,e),n.extend=r.extend,fe(n),n},fe(ue);var de=ue.extend({data:null}),pe=ue.extend({data:null}),me=[9,13,27,32],he=H&&"CompositionEvent"in window,ye=null;H&&"documentMode"in document&&(ye=document.documentMode);var ve=H&&"TextEvent"in window&&!ye,ge=H&&(!he||ye&&8<ye&&11>=ye),be=String.fromCharCode(32),ke={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},we=!1;function xe(e,t){switch(e){case"keyup":return-1!==me.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Te(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var _e=!1;var Ce={eventTypes:ke,extractEvents:function(e,t,n,r){var l=void 0,o=void 0;if(he)e:{switch(e){case"compositionstart":l=ke.compositionStart;break e;case"compositionend":l=ke.compositionEnd;break e;case"compositionupdate":l=ke.compositionUpdate;break e}l=void 0}else _e?xe(e,n)&&(l=ke.compositionEnd):"keydown"===e&&229===n.keyCode&&(l=ke.compositionStart);return l?(ge&&"ko"!==n.locale&&(_e||l!==ke.compositionStart?l===ke.compositionEnd&&_e&&(o=oe()):(re="value"in(ne=r)?ne.value:ne.textContent,_e=!0)),l=de.getPooled(l,t,n,r),o?l.data=o:null!==(o=Te(n))&&(l.data=o),$(l),o=l):o=null,(e=ve?function(e,t){switch(e){case"compositionend":return Te(t);case"keypress":return 32!==t.which?null:(we=!0,be);case"textInput":return(e=t.data)===be&&we?null:e;default:return null}}(e,n):function(e,t){if(_e)return"compositionend"===e||!he&&xe(e,t)?(e=oe(),le=re=ne=null,_e=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ge&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=pe.getPooled(ke.beforeInput,t,n,r)).data=e,$(t)):t=null,null===o?t:null===t?o:[o,t]}},Ee=null,Se=null,Pe=null;function Ne(e){if(e=x(e)){"function"!==typeof Ee&&i("280");var t=w(e.stateNode);Ee(e.stateNode,e.type,t)}}function Oe(e){Se?Pe?Pe.push(e):Pe=[e]:Se=e}function Me(){if(Se){var e=Se,t=Pe;if(Pe=Se=null,Ne(e),t)for(e=0;e<t.length;e++)Ne(t[e])}}function De(e,t){return e(t)}function Ie(e,t,n){return e(t,n)}function Ue(){}var Fe=!1;function Re(e,t){if(Fe)return e(t);Fe=!0;try{return De(e,t)}finally{Fe=!1,(null!==Se||null!==Pe)&&(Ue(),Me())}}var ze={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Le(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ze[e.type]:"textarea"===t}function Ae(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function je(e){if(!H)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"===typeof t[e]),t}function We(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Ve(e){e._valueTracker||(e._valueTracker=function(e){var t=We(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Be(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=We(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}var $e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,He=/^(.*)[\\\/]/,Qe="function"===typeof Symbol&&Symbol.for,Ke=Qe?Symbol.for("react.element"):60103,qe=Qe?Symbol.for("react.portal"):60106,Ye=Qe?Symbol.for("react.fragment"):60107,Xe=Qe?Symbol.for("react.strict_mode"):60108,Ge=Qe?Symbol.for("react.profiler"):60114,Je=Qe?Symbol.for("react.provider"):60109,Ze=Qe?Symbol.for("react.context"):60110,et=Qe?Symbol.for("react.concurrent_mode"):60111,tt=Qe?Symbol.for("react.forward_ref"):60112,nt=Qe?Symbol.for("react.suspense"):60113,rt=Qe?Symbol.for("react.memo"):60115,lt=Qe?Symbol.for("react.lazy"):60116,ot="function"===typeof Symbol&&Symbol.iterator;function it(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=ot&&e[ot]||e["@@iterator"])?e:null}function at(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case et:return"ConcurrentMode";case Ye:return"Fragment";case qe:return"Portal";case Ge:return"Profiler";case Xe:return"StrictMode";case nt:return"Suspense"}if("object"===typeof e)switch(e.$$typeof){case Ze:return"Context.Consumer";case Je:return"Context.Provider";case tt:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case rt:return at(e.type);case lt:if(e=1===e._status?e._result:null)return at(e)}return null}function ut(e){var t="";do{e:switch(e.tag){case 2:case 16:case 0:case 1:case 5:case 8:case 13:var n=e._debugOwner,r=e._debugSource,l=at(e.type),o=null;n&&(o=at(n.type)),n=l,l="",r?l=" (at "+r.fileName.replace(He,"")+":"+r.lineNumber+")":o&&(l=" (created by "+o+")"),o="\n in "+(n||"Unknown")+l;break e;default:o=""}t+=o,e=e.return}while(e);return t}var ct=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,st=Object.prototype.hasOwnProperty,ft={},dt={};function pt(e,t,n,r,l){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t}var mt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mt[e]=new pt(e,0,!1,e,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mt[t]=new pt(t,1,!1,e[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){mt[e]=new pt(e,2,!1,e.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mt[e]=new pt(e,2,!1,e,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){mt[e]=new pt(e,3,!1,e.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(e){mt[e]=new pt(e,3,!0,e,null)}),["capture","download"].forEach(function(e){mt[e]=new pt(e,4,!1,e,null)}),["cols","rows","size","span"].forEach(function(e){mt[e]=new pt(e,6,!1,e,null)}),["rowSpan","start"].forEach(function(e){mt[e]=new pt(e,5,!1,e.toLowerCase(),null)});var ht=/[\-:]([a-z])/g;function yt(e){return e[1].toUpperCase()}function vt(e,t,n,r){var l=mt.hasOwnProperty(t)?mt[t]:null;(null!==l?0===l.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,l,r)&&(n=null),r||null===l?function(e){return!!st.call(dt,e)||!st.call(ft,e)&&(ct.test(e)?dt[e]=!0:(ft[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=null===n?3!==l.type&&"":n:(t=l.attributeName,r=l.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(l=l.type)||4===l&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function gt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function bt(e,t){var n=t.checked;return l({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function kt(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=gt(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function wt(e,t){null!=(t=t.checked)&&vt(e,"checked",t,!1)}function xt(e,t){wt(e,t);var n=gt(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?_t(e,t.type,n):t.hasOwnProperty("defaultValue")&&_t(e,t.type,gt(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Tt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function _t(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ht,yt);mt[t]=new pt(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ht,yt);mt[t]=new pt(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ht,yt);mt[t]=new pt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),mt.tabIndex=new pt("tabIndex",1,!1,"tabindex",null);var Ct={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Et(e,t,n){return(e=ue.getPooled(Ct.change,e,t,n)).type="change",Oe(n),$(e),e}var St=null,Pt=null;function Nt(e){M(e)}function Ot(e){if(Be(z(e)))return e}function Mt(e,t){if("change"===e)return t}var Dt=!1;function It(){St&&(St.detachEvent("onpropertychange",Ut),Pt=St=null)}function Ut(e){"value"===e.propertyName&&Ot(Pt)&&Re(Nt,e=Et(Pt,e,Ae(e)))}function Ft(e,t,n){"focus"===e?(It(),Pt=n,(St=t).attachEvent("onpropertychange",Ut)):"blur"===e&&It()}function Rt(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Ot(Pt)}function zt(e,t){if("click"===e)return Ot(t)}function Lt(e,t){if("input"===e||"change"===e)return Ot(t)}H&&(Dt=je("input")&&(!document.documentMode||9<document.documentMode));var At={eventTypes:Ct,_isInputEventSupported:Dt,extractEvents:function(e,t,n,r){var l=t?z(t):window,o=void 0,i=void 0,a=l.nodeName&&l.nodeName.toLowerCase();if("select"===a||"input"===a&&"file"===l.type?o=Mt:Le(l)?Dt?o=Lt:(o=Rt,i=Ft):(a=l.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(o=zt),o&&(o=o(e,t)))return Et(o,n,r);i&&i(e,l,t),"blur"===e&&(e=l._wrapperState)&&e.controlled&&"number"===l.type&&_t(l,"number",l.value)}},jt=ue.extend({view:null,detail:null}),Wt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vt(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Wt[e])&&!!t[e]}function Bt(){return Vt}var $t=0,Ht=0,Qt=!1,Kt=!1,qt=jt.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Bt,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=$t;return $t=e.screenX,Qt?"mousemove"===e.type?e.screenX-t:0:(Qt=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Ht;return Ht=e.screenY,Kt?"mousemove"===e.type?e.screenY-t:0:(Kt=!0,0)}}),Yt=qt.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Xt={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Gt={eventTypes:Xt,extractEvents:function(e,t,n,r){var l="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(l&&(n.relatedTarget||n.fromElement)||!o&&!l)return null;if(l=r.window===r?r:(l=r.ownerDocument)?l.defaultView||l.parentWindow:window,o?(o=t,t=(t=n.relatedTarget||n.toElement)?F(t):null):o=null,o===t)return null;var i=void 0,a=void 0,u=void 0,c=void 0;"mouseout"===e||"mouseover"===e?(i=qt,a=Xt.mouseLeave,u=Xt.mouseEnter,c="mouse"):"pointerout"!==e&&"pointerover"!==e||(i=Yt,a=Xt.pointerLeave,u=Xt.pointerEnter,c="pointer");var s=null==o?l:z(o);if(l=null==t?l:z(t),(e=i.getPooled(a,o,n,r)).type=c+"leave",e.target=s,e.relatedTarget=l,(n=i.getPooled(u,t,n,r)).type=c+"enter",n.target=l,n.relatedTarget=s,r=t,o&&r)e:{for(l=r,c=0,i=t=o;i;i=A(i))c++;for(i=0,u=l;u;u=A(u))i++;for(;0<c-i;)t=A(t),c--;for(;0<i-c;)l=A(l),i--;for(;c--;){if(t===l||t===l.alternate)break e;t=A(t),l=A(l)}t=null}else t=null;for(l=t,t=[];o&&o!==l&&(null===(c=o.alternate)||c!==l);)t.push(o),o=A(o);for(o=[];r&&r!==l&&(null===(c=r.alternate)||c!==l);)o.push(r),r=A(r);for(r=0;r<t.length;r++)V(t[r],"bubbled",e);for(r=o.length;0<r--;)V(o[r],"captured",n);return[e,n]}},Jt=Object.prototype.hasOwnProperty;function Zt(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function en(e,t){if(Zt(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Jt.call(t,n[r])||!Zt(e[n[r]],t[n[r]]))return!1;return!0}function tn(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!==(2&t.effectTag))return 1;for(;t.return;)if(0!==(2&(t=t.return).effectTag))return 1}return 3===t.tag?2:3}function nn(e){2!==tn(e)&&i("188")}function rn(e){if(!(e=function(e){var t=e.alternate;if(!t)return 3===(t=tn(e))&&i("188"),1===t?null:e;for(var n=e,r=t;;){var l=n.return,o=l?l.alternate:null;if(!l||!o)break;if(l.child===o.child){for(var a=l.child;a;){if(a===n)return nn(l),e;if(a===r)return nn(l),t;a=a.sibling}i("188")}if(n.return!==r.return)n=l,r=o;else{a=!1;for(var u=l.child;u;){if(u===n){a=!0,n=l,r=o;break}if(u===r){a=!0,r=l,n=o;break}u=u.sibling}if(!a){for(u=o.child;u;){if(u===n){a=!0,n=o,r=l;break}if(u===r){a=!0,r=o,n=l;break}u=u.sibling}a||i("189")}}n.alternate!==r&&i("190")}return 3!==n.tag&&i("188"),n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}var ln=ue.extend({animationName:null,elapsedTime:null,pseudoElement:null}),on=ue.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),an=jt.extend({relatedTarget:null});function un(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var cn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sn={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"},fn=jt.extend({key:function(e){if(e.key){var t=cn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=un(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?sn[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Bt,charCode:function(e){return"keypress"===e.type?un(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?un(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),dn=qt.extend({dataTransfer:null}),pn=jt.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Bt}),mn=ue.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),hn=qt.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),yn=[["abort","abort"],[G,"animationEnd"],[J,"animationIteration"],[Z,"animationStart"],["canplay","canPlay"],["canplaythrough","canPlayThrough"],["drag","drag"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["gotpointercapture","gotPointerCapture"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["loadstart","loadStart"],["lostpointercapture","lostPointerCapture"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["playing","playing"],["pointermove","pointerMove"],["pointerout","pointerOut"],["pointerover","pointerOver"],["progress","progress"],["scroll","scroll"],["seeking","seeking"],["stalled","stalled"],["suspend","suspend"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchmove","touchMove"],[ee,"transitionEnd"],["waiting","waiting"],["wheel","wheel"]],vn={},gn={};function bn(e,t){var n=e[0],r="on"+((e=e[1])[0].toUpperCase()+e.slice(1));t={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[n],isInteractive:t},vn[e]=t,gn[n]=t}[["blur","blur"],["cancel","cancel"],["click","click"],["close","close"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["auxclick","auxClick"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragstart","dragStart"],["drop","drop"],["focus","focus"],["input","input"],["invalid","invalid"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["mousedown","mouseDown"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["pointercancel","pointerCancel"],["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(e){bn(e,!0)}),yn.forEach(function(e){bn(e,!1)});var kn={eventTypes:vn,isInteractiveTopLevelEventType:function(e){return void 0!==(e=gn[e])&&!0===e.isInteractive},extractEvents:function(e,t,n,r){var l=gn[e];if(!l)return null;switch(e){case"keypress":if(0===un(n))return null;case"keydown":case"keyup":e=fn;break;case"blur":case"focus":e=an;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=qt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=dn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=pn;break;case G:case J:case Z:e=ln;break;case ee:e=mn;break;case"scroll":e=jt;break;case"wheel":e=hn;break;case"copy":case"cut":case"paste":e=on;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Yt;break;default:e=ue}return $(t=e.getPooled(l,t,n,r)),t}},wn=kn.isInteractiveTopLevelEventType,xn=[];function Tn(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r;for(r=n;r.return;)r=r.return;if(!(r=3!==r.tag?null:r.stateNode.containerInfo))break;e.ancestors.push(n),n=F(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var l=Ae(e.nativeEvent);r=e.topLevelType;for(var o=e.nativeEvent,i=null,a=0;a<v.length;a++){var u=v[a];u&&(u=u.extractEvents(r,t,o,l))&&(i=C(i,u))}M(i)}}var _n=!0;function Cn(e,t){if(!t)return null;var n=(wn(e)?Sn:Pn).bind(null,e);t.addEventListener(e,n,!1)}function En(e,t){if(!t)return null;var n=(wn(e)?Sn:Pn).bind(null,e);t.addEventListener(e,n,!0)}function Sn(e,t){Ie(Pn,e,t)}function Pn(e,t){if(_n){var n=Ae(t);if(null===(n=F(n))||"number"!==typeof n.tag||2===tn(n)||(n=null),xn.length){var r=xn.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{Re(Tn,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>xn.length&&xn.push(e)}}}var Nn={},On=0,Mn="_reactListenersID"+(""+Math.random()).slice(2);function Dn(e){return Object.prototype.hasOwnProperty.call(e,Mn)||(e[Mn]=On++,Nn[e[Mn]]={}),Nn[e[Mn]]}function In(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Un(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fn(e,t){var n,r=Un(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Un(r)}}function Rn(){for(var e=window,t=In();t instanceof e.HTMLIFrameElement;){try{e=t.contentDocument.defaultView}catch(n){break}t=In(e.document)}return t}function zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Ln=H&&"documentMode"in document&&11>=document.documentMode,An={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},jn=null,Wn=null,Vn=null,Bn=!1;function $n(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Bn||null==jn||jn!==In(n)?null:("selectionStart"in(n=jn)&&zn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Vn&&en(Vn,n)?null:(Vn=n,(e=ue.getPooled(An.select,Wn,e,t)).type="select",e.target=jn,$(e),e))}var Hn={eventTypes:An,extractEvents:function(e,t,n,r){var l,o=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(l=!o)){e:{o=Dn(o),l=k.onSelect;for(var i=0;i<l.length;i++){var a=l[i];if(!o.hasOwnProperty(a)||!o[a]){o=!1;break e}}o=!0}l=!o}if(l)return null;switch(o=t?z(t):window,e){case"focus":(Le(o)||"true"===o.contentEditable)&&(jn=o,Wn=t,Vn=null);break;case"blur":Vn=Wn=jn=null;break;case"mousedown":Bn=!0;break;case"contextmenu":case"mouseup":case"dragend":return Bn=!1,$n(n,r);case"selectionchange":if(Ln)break;case"keydown":case"keyup":return $n(n,r)}return null}};function Qn(e,t){return e=l({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function Kn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n)return e[l].selected=!0,void(r&&(e[l].defaultSelected=!0));null!==t||e[l].disabled||(t=e[l])}null!==t&&(t.selected=!0)}}function qn(e,t){return null!=t.dangerouslySetInnerHTML&&i("91"),l({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Yn(e,t){var n=t.value;null==n&&(n=t.defaultValue,null!=(t=t.children)&&(null!=n&&i("92"),Array.isArray(t)&&(1>=t.length||i("93"),t=t[0]),n=t),null==n&&(n="")),e._wrapperState={initialValue:gt(n)}}function Xn(e,t){var n=gt(t.value),r=gt(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Gn(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}N.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),w=L,x=R,T=z,N.injectEventPluginsByName({SimpleEventPlugin:kn,EnterLeaveEventPlugin:Gt,ChangeEventPlugin:At,SelectEventPlugin:Hn,BeforeInputEventPlugin:Ce});var Jn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Zn(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function er(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Zn(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var tr,nr=void 0,rr=(tr=function(e,t){if(e.namespaceURI!==Jn.svg||"innerHTML"in e)e.innerHTML=t;else{for((nr=nr||document.createElement("div")).innerHTML="<svg>"+t+"</svg>",t=nr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return tr(e,t)})}:tr);function lr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var or={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ir=["Webkit","ms","Moz","O"];function ar(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||or.hasOwnProperty(e)&&or[e]?(""+t).trim():t+"px"}function ur(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),l=ar(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}Object.keys(or).forEach(function(e){ir.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),or[t]=or[e]})});var cr=l({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sr(e,t){t&&(cr[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&i("137",e,""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&i("60"),"object"===typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||i("61")),null!=t.style&&"object"!==typeof t.style&&i("62",""))}function fr(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function dr(e,t){var n=Dn(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=k[t];for(var r=0;r<t.length;r++){var l=t[r];if(!n.hasOwnProperty(l)||!n[l]){switch(l){case"scroll":En("scroll",e);break;case"focus":case"blur":En("focus",e),En("blur",e),n.blur=!0,n.focus=!0;break;case"cancel":case"close":je(l)&&En(l,e);break;case"invalid":case"submit":case"reset":break;default:-1===te.indexOf(l)&&Cn(l,e)}n[l]=!0}}}function pr(){}var mr=null,hr=null;function yr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function vr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var gr="function"===typeof setTimeout?setTimeout:void 0,br="function"===typeof clearTimeout?clearTimeout:void 0;function kr(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function wr(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}new Set;var xr=[],Tr=-1;function _r(e){0>Tr||(e.current=xr[Tr],xr[Tr]=null,Tr--)}function Cr(e,t){xr[++Tr]=e.current,e.current=t}var Er={},Sr={current:Er},Pr={current:!1},Nr=Er;function Or(e,t){var n=e.type.contextTypes;if(!n)return Er;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l,o={};for(l in n)o[l]=t[l];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Mr(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Dr(e){_r(Pr),_r(Sr)}function Ir(e){_r(Pr),_r(Sr)}function Ur(e,t,n){Sr.current!==Er&&i("168"),Cr(Sr,t),Cr(Pr,n)}function Fr(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())o in e||i("108",at(t)||"Unknown",o);return l({},n,r)}function Rr(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Er,Nr=Sr.current,Cr(Sr,t),Cr(Pr,Pr.current),!0}function zr(e,t,n){var r=e.stateNode;r||i("169"),n?(t=Fr(e,t,Nr),r.__reactInternalMemoizedMergedChildContext=t,_r(Pr),_r(Sr),Cr(Sr,t)):_r(Pr),Cr(Pr,n)}var Lr=null,Ar=null;function jr(e){return function(t){try{return e(t)}catch(n){}}}function Wr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.firstContextDependency=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Vr(e,t,n,r){return new Wr(e,t,n,r)}function Br(e){return!(!(e=e.prototype)||!e.isReactComponent)}function $r(e,t){var n=e.alternate;return null===n?((n=Vr(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,n.firstContextDependency=e.firstContextDependency,n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Hr(e,t,n,r,l,o){var a=2;if(r=e,"function"===typeof e)Br(e)&&(a=1);else if("string"===typeof e)a=5;else e:switch(e){case Ye:return Qr(n.children,l,o,t);case et:return Kr(n,3|l,o,t);case Xe:return Kr(n,2|l,o,t);case Ge:return(e=Vr(12,n,t,4|l)).elementType=Ge,e.type=Ge,e.expirationTime=o,e;case nt:return(e=Vr(13,n,t,l)).elementType=nt,e.type=nt,e.expirationTime=o,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case Je:a=10;break e;case Ze:a=9;break e;case tt:a=11;break e;case rt:a=14;break e;case lt:a=16,r=null;break e}i("130",null==e?e:typeof e,"")}return(t=Vr(a,n,t,l)).elementType=e,t.type=r,t.expirationTime=o,t}function Qr(e,t,n,r){return(e=Vr(7,e,r,t)).expirationTime=n,e}function Kr(e,t,n,r){return e=Vr(8,e,r,t),t=0===(1&t)?Xe:et,e.elementType=t,e.type=t,e.expirationTime=n,e}function qr(e,t,n){return(e=Vr(6,e,null,t)).expirationTime=n,e}function Yr(e,t,n){return(t=Vr(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xr(e,t){e.didError=!1;var n=e.earliestPendingTime;0===n?e.earliestPendingTime=e.latestPendingTime=t:n<t?e.earliestPendingTime=t:e.latestPendingTime>t&&(e.latestPendingTime=t),Zr(t,e)}function Gr(e,t){e.didError=!1;var n=e.latestPingedTime;0!==n&&n>=t&&(e.latestPingedTime=0),n=e.earliestPendingTime;var r=e.latestPendingTime;n===t?e.earliestPendingTime=r===t?e.latestPendingTime=0:r:r===t&&(e.latestPendingTime=n),n=e.earliestSuspendedTime,r=e.latestSuspendedTime,0===n?e.earliestSuspendedTime=e.latestSuspendedTime=t:n<t?e.earliestSuspendedTime=t:r>t&&(e.latestSuspendedTime=t),Zr(t,e)}function Jr(e,t){var n=e.earliestPendingTime;return n>t&&(t=n),(e=e.earliestSuspendedTime)>t&&(t=e),t}function Zr(e,t){var n=t.earliestSuspendedTime,r=t.latestSuspendedTime,l=t.earliestPendingTime,o=t.latestPingedTime;0===(l=0!==l?l:o)&&(0===e||r<e)&&(l=r),0!==(e=l)&&n>e&&(e=n),t.nextExpirationTimeToWorkOn=l,t.expirationTime=e}var el=!1;function tl(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function nl(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function rl(e){return{expirationTime:e,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function ll(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function ol(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,l=null;null===r&&(r=e.updateQueue=tl(e.memoizedState))}else r=e.updateQueue,l=n.updateQueue,null===r?null===l?(r=e.updateQueue=tl(e.memoizedState),l=n.updateQueue=tl(n.memoizedState)):r=e.updateQueue=nl(l):null===l&&(l=n.updateQueue=nl(r));null===l||r===l?ll(r,t):null===r.lastUpdate||null===l.lastUpdate?(ll(r,t),ll(l,t)):(ll(r,t),l.lastUpdate=t)}function il(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=tl(e.memoizedState):al(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function al(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=nl(t)),t}function ul(e,t,n,r,o,i){switch(n.tag){case 1:return"function"===typeof(e=n.payload)?e.call(i,r,o):e;case 3:e.effectTag=-2049&e.effectTag|64;case 0:if(null===(o="function"===typeof(e=n.payload)?e.call(i,r,o):e)||void 0===o)break;return l({},r,o);case 2:el=!0}return r}function cl(e,t,n,r,l){el=!1;for(var o=(t=al(e,t)).baseState,i=null,a=0,u=t.firstUpdate,c=o;null!==u;){var s=u.expirationTime;s<l?(null===i&&(i=u,o=c),a<s&&(a=s)):(c=ul(e,0,u,c,n,r),null!==u.callback&&(e.effectTag|=32,u.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=u:(t.lastEffect.nextEffect=u,t.lastEffect=u))),u=u.next}for(s=null,u=t.firstCapturedUpdate;null!==u;){var f=u.expirationTime;f<l?(null===s&&(s=u,null===i&&(o=c)),a<f&&(a=f)):(c=ul(e,0,u,c,n,r),null!==u.callback&&(e.effectTag|=32,u.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=u:(t.lastCapturedEffect.nextEffect=u,t.lastCapturedEffect=u))),u=u.next}null===i&&(t.lastUpdate=null),null===s?t.lastCapturedUpdate=null:e.effectTag|=32,null===i&&null===s&&(o=c),t.baseState=o,t.firstUpdate=i,t.firstCapturedUpdate=s,e.expirationTime=a,e.memoizedState=c}function sl(e,t,n){null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),fl(t.firstEffect,n),t.firstEffect=t.lastEffect=null,fl(t.firstCapturedEffect,n),t.firstCapturedEffect=t.lastCapturedEffect=null}function fl(e,t){for(;null!==e;){var n=e.callback;if(null!==n){e.callback=null;var r=t;"function"!==typeof n&&i("191",n),n.call(r)}e=e.nextEffect}}function dl(e,t){return{value:e,source:t,stack:ut(t)}}var pl={current:null},ml=null,hl=null,yl=null;function vl(e,t){var n=e.type._context;Cr(pl,n._currentValue),n._currentValue=t}function gl(e){var t=pl.current;_r(pl),e.type._context._currentValue=t}function bl(e){ml=e,yl=hl=null,e.firstContextDependency=null}function kl(e,t){return yl!==e&&!1!==t&&0!==t&&("number"===typeof t&&1073741823!==t||(yl=e,t=1073741823),t={context:e,observedBits:t,next:null},null===hl?(null===ml&&i("293"),ml.firstContextDependency=hl=t):hl=hl.next=t),e._currentValue}var wl={},xl={current:wl},Tl={current:wl},_l={current:wl};function Cl(e){return e===wl&&i("174"),e}function El(e,t){Cr(_l,t),Cr(Tl,e),Cr(xl,wl);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:er(null,"");break;default:t=er(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}_r(xl),Cr(xl,t)}function Sl(e){_r(xl),_r(Tl),_r(_l)}function Pl(e){Cl(_l.current);var t=Cl(xl.current),n=er(t,e.type);t!==n&&(Cr(Tl,e),Cr(xl,n))}function Nl(e){Tl.current===e&&(_r(xl),_r(Tl))}function Ol(e,t){if(e&&e.defaultProps)for(var n in t=l({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Ml=$e.ReactCurrentOwner,Dl=(new r.Component).refs;function Il(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:l({},t,n),e.memoizedState=n,null!==(r=e.updateQueue)&&0===e.expirationTime&&(r.baseState=n)}var Ul={isMounted:function(e){return!!(e=e._reactInternalFiber)&&2===tn(e)},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=_i(),l=rl(r=Xo(r,e));l.payload=t,void 0!==n&&null!==n&&(l.callback=n),Ho(),ol(e,l),Zo(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=_i(),l=rl(r=Xo(r,e));l.tag=1,l.payload=t,void 0!==n&&null!==n&&(l.callback=n),Ho(),ol(e,l),Zo(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=_i(),r=rl(n=Xo(n,e));r.tag=2,void 0!==t&&null!==t&&(r.callback=t),Ho(),ol(e,r),Zo(e,n)}};function Fl(e,t,n,r,l,o,i){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,i):!t.prototype||!t.prototype.isPureReactComponent||(!en(n,r)||!en(l,o))}function Rl(e,t,n){var r=!1,l=Er,o=t.contextType;return"object"===typeof o&&null!==o?o=Ml.currentDispatcher.readContext(o):(l=Mr(t)?Nr:Sr.current,o=(r=null!==(r=t.contextTypes)&&void 0!==r)?Or(e,l):Er),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Ul,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=o),t}function zl(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ul.enqueueReplaceState(t,t.state,null)}function Ll(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs=Dl;var o=t.contextType;"object"===typeof o&&null!==o?l.context=Ml.currentDispatcher.readContext(o):(o=Mr(t)?Nr:Sr.current,l.context=Or(e,o)),null!==(o=e.updateQueue)&&(cl(e,o,n,l,r),l.state=e.memoizedState),"function"===typeof(o=t.getDerivedStateFromProps)&&(Il(e,t,o,n),l.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof l.getSnapshotBeforeUpdate||"function"!==typeof l.UNSAFE_componentWillMount&&"function"!==typeof l.componentWillMount||(t=l.state,"function"===typeof l.componentWillMount&&l.componentWillMount(),"function"===typeof l.UNSAFE_componentWillMount&&l.UNSAFE_componentWillMount(),t!==l.state&&Ul.enqueueReplaceState(l,l.state,null),null!==(o=e.updateQueue)&&(cl(e,o,n,l,r),l.state=e.memoizedState)),"function"===typeof l.componentDidMount&&(e.effectTag|=4)}var Al=Array.isArray;function jl(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){n=n._owner;var r=void 0;n&&(1!==n.tag&&i("289"),r=n.stateNode),r||i("147",e);var l=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===l?t.ref:((t=function(e){var t=r.refs;t===Dl&&(t=r.refs={}),null===e?delete t[l]:t[l]=e})._stringRef=l,t)}"string"!==typeof e&&i("284"),n._owner||i("290",e)}return e}function Wl(e,t){"textarea"!==e.type&&i("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function Vl(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function l(e,t,n){return(e=$r(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function a(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=qr(n,e.mode,r)).return=e,t):((t=l(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=l(t,n.props)).ref=jl(e,t,n),r.return=e,r):((r=Hr(n.type,n.key,n.props,null,e.mode,r)).ref=jl(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Yr(n,e.mode,r)).return=e,t):((t=l(t,n.children||[])).return=e,t)}function f(e,t,n,r,o){return null===t||7!==t.tag?((t=Qr(n,e.mode,r,o)).return=e,t):((t=l(t,n)).return=e,t)}function d(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=qr(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case Ke:return(n=Hr(t.type,t.key,t.props,null,e.mode,n)).ref=jl(e,null,t),n.return=e,n;case qe:return(t=Yr(t,e.mode,n)).return=e,t}if(Al(t)||it(t))return(t=Qr(t,e.mode,n,null)).return=e,t;Wl(e,t)}return null}function p(e,t,n,r){var l=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==l?null:u(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case Ke:return n.key===l?n.type===Ye?f(e,t,n.props.children,r,l):c(e,t,n,r):null;case qe:return n.key===l?s(e,t,n,r):null}if(Al(n)||it(n))return null!==l?null:f(e,t,n,r,null);Wl(e,n)}return null}function m(e,t,n,r,l){if("string"===typeof r||"number"===typeof r)return u(t,e=e.get(n)||null,""+r,l);if("object"===typeof r&&null!==r){switch(r.$$typeof){case Ke:return e=e.get(null===r.key?n:r.key)||null,r.type===Ye?f(t,e,r.props.children,l,r.key):c(t,e,r,l);case qe:return s(t,e=e.get(null===r.key?n:r.key)||null,r,l)}if(Al(r)||it(r))return f(t,e=e.get(n)||null,r,l,null);Wl(t,r)}return null}function h(l,i,a,u){for(var c=null,s=null,f=i,h=i=0,y=null;null!==f&&h<a.length;h++){f.index>h?(y=f,f=null):y=f.sibling;var v=p(l,f,a[h],u);if(null===v){null===f&&(f=y);break}e&&f&&null===v.alternate&&t(l,f),i=o(v,i,h),null===s?c=v:s.sibling=v,s=v,f=y}if(h===a.length)return n(l,f),c;if(null===f){for(;h<a.length;h++)(f=d(l,a[h],u))&&(i=o(f,i,h),null===s?c=f:s.sibling=f,s=f);return c}for(f=r(l,f);h<a.length;h++)(y=m(f,l,h,a[h],u))&&(e&&null!==y.alternate&&f.delete(null===y.key?h:y.key),i=o(y,i,h),null===s?c=y:s.sibling=y,s=y);return e&&f.forEach(function(e){return t(l,e)}),c}function y(l,a,u,c){var s=it(u);"function"!==typeof s&&i("150"),null==(u=s.call(u))&&i("151");for(var f=s=null,h=a,y=a=0,v=null,g=u.next();null!==h&&!g.done;y++,g=u.next()){h.index>y?(v=h,h=null):v=h.sibling;var b=p(l,h,g.value,c);if(null===b){h||(h=v);break}e&&h&&null===b.alternate&&t(l,h),a=o(b,a,y),null===f?s=b:f.sibling=b,f=b,h=v}if(g.done)return n(l,h),s;if(null===h){for(;!g.done;y++,g=u.next())null!==(g=d(l,g.value,c))&&(a=o(g,a,y),null===f?s=g:f.sibling=g,f=g);return s}for(h=r(l,h);!g.done;y++,g=u.next())null!==(g=m(h,l,y,g.value,c))&&(e&&null!==g.alternate&&h.delete(null===g.key?y:g.key),a=o(g,a,y),null===f?s=g:f.sibling=g,f=g);return e&&h.forEach(function(e){return t(l,e)}),s}return function(e,r,o,u){var c="object"===typeof o&&null!==o&&o.type===Ye&&null===o.key;c&&(o=o.props.children);var s="object"===typeof o&&null!==o;if(s)switch(o.$$typeof){case Ke:e:{for(s=o.key,c=r;null!==c;){if(c.key===s){if(7===c.tag?o.type===Ye:c.elementType===o.type){n(e,c.sibling),(r=l(c,o.type===Ye?o.props.children:o.props)).ref=jl(e,c,o),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}o.type===Ye?((r=Qr(o.props.children,e.mode,u,o.key)).return=e,e=r):((u=Hr(o.type,o.key,o.props,null,e.mode,u)).ref=jl(e,r,o),u.return=e,e=u)}return a(e);case qe:e:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=l(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Yr(o,e.mode,u)).return=e,e=r}return a(e)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=l(r,o)).return=e,e=r):(n(e,r),(r=qr(o,e.mode,u)).return=e,e=r),a(e);if(Al(o))return h(e,r,o,u);if(it(o))return y(e,r,o,u);if(s&&Wl(e,o),"undefined"===typeof o&&!c)switch(e.tag){case 1:case 0:i("152",(u=e.type).displayName||u.name||"Component")}return n(e,r)}}var Bl=Vl(!0),$l=Vl(!1),Hl=null,Ql=null,Kl=!1;function ql(e,t){var n=Vr(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Yl(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Xl(e){if(Kl){var t=Ql;if(t){var n=t;if(!Yl(e,t)){if(!(t=kr(n))||!Yl(e,t))return e.effectTag|=2,Kl=!1,void(Hl=e);ql(Hl,n)}Hl=e,Ql=wr(t)}else e.effectTag|=2,Kl=!1,Hl=e}}function Gl(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag;)e=e.return;Hl=e}function Jl(e){if(e!==Hl)return!1;if(!Kl)return Gl(e),Kl=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!vr(t,e.memoizedProps))for(t=Ql;t;)ql(e,t),t=kr(t);return Gl(e),Ql=Hl?kr(e.stateNode):null,!0}function Zl(){Ql=Hl=null,Kl=!1}var eo=$e.ReactCurrentOwner;function to(e,t,n,r){t.child=null===e?$l(t,null,n,r):Bl(t,e.child,n,r)}function no(e,t,n,r,l){n=n.render;var o=t.ref;return bl(t),r=n(r,o),t.effectTag|=1,to(e,t,r,l),t.child}function ro(e,t,n,r,l,o){if(null===e){var i=n.type;return"function"!==typeof i||Br(i)||void 0!==i.defaultProps||null!==n.compare?((e=Hr(n.type,null,r,null,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,lo(e,t,i,r,l,o))}return i=e.child,l<o&&(l=i.memoizedProps,(n=null!==(n=n.compare)?n:en)(l,r)&&e.ref===t.ref)?fo(e,t,o):(t.effectTag|=1,(e=$r(i,r)).ref=t.ref,e.return=t,t.child=e)}function lo(e,t,n,r,l,o){return null!==e&&l<o&&en(e.memoizedProps,r)&&e.ref===t.ref?fo(e,t,o):io(e,t,n,r,o)}function oo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function io(e,t,n,r,l){var o=Mr(n)?Nr:Sr.current;return o=Or(t,o),bl(t),n=n(r,o),t.effectTag|=1,to(e,t,n,l),t.child}function ao(e,t,n,r,l){if(Mr(n)){var o=!0;Rr(t)}else o=!1;if(bl(t),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),Rl(t,n,r),Ll(t,n,r,l),r=!0;else if(null===e){var i=t.stateNode,a=t.memoizedProps;i.props=a;var u=i.context,c=n.contextType;"object"===typeof c&&null!==c?c=Ml.currentDispatcher.readContext(c):c=Or(t,c=Mr(n)?Nr:Sr.current);var s=n.getDerivedStateFromProps,f="function"===typeof s||"function"===typeof i.getSnapshotBeforeUpdate;f||"function"!==typeof i.UNSAFE_componentWillReceiveProps&&"function"!==typeof i.componentWillReceiveProps||(a!==r||u!==c)&&zl(t,i,r,c),el=!1;var d=t.memoizedState;u=i.state=d;var p=t.updateQueue;null!==p&&(cl(t,p,r,i,l),u=t.memoizedState),a!==r||d!==u||Pr.current||el?("function"===typeof s&&(Il(t,n,s,r),u=t.memoizedState),(a=el||Fl(t,n,a,r,d,u,c))?(f||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||("function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"===typeof i.componentDidMount&&(t.effectTag|=4)):("function"===typeof i.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=c,r=a):("function"===typeof i.componentDidMount&&(t.effectTag|=4),r=!1)}else i=t.stateNode,a=t.memoizedProps,i.props=t.type===t.elementType?a:Ol(t.type,a),u=i.context,"object"===typeof(c=n.contextType)&&null!==c?c=Ml.currentDispatcher.readContext(c):c=Or(t,c=Mr(n)?Nr:Sr.current),(f="function"===typeof(s=n.getDerivedStateFromProps)||"function"===typeof i.getSnapshotBeforeUpdate)||"function"!==typeof i.UNSAFE_componentWillReceiveProps&&"function"!==typeof i.componentWillReceiveProps||(a!==r||u!==c)&&zl(t,i,r,c),el=!1,u=t.memoizedState,d=i.state=u,null!==(p=t.updateQueue)&&(cl(t,p,r,i,l),d=t.memoizedState),a!==r||u!==d||Pr.current||el?("function"===typeof s&&(Il(t,n,s,r),d=t.memoizedState),(s=el||Fl(t,n,a,r,u,d,c))?(f||"function"!==typeof i.UNSAFE_componentWillUpdate&&"function"!==typeof i.componentWillUpdate||("function"===typeof i.componentWillUpdate&&i.componentWillUpdate(r,d,c),"function"===typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,d,c)),"function"===typeof i.componentDidUpdate&&(t.effectTag|=4),"function"===typeof i.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof i.componentDidUpdate||a===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=d),i.props=r,i.state=d,i.context=c,r=s):("function"!==typeof i.componentDidUpdate||a===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return uo(e,t,n,r,o,l)}function uo(e,t,n,r,l,o){oo(e,t);var i=0!==(64&t.effectTag);if(!r&&!i)return l&&zr(t,n,!1),fo(e,t,o);r=t.stateNode,eo.current=t;var a=i&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&i?(t.child=Bl(t,e.child,null,o),t.child=Bl(t,null,a,o)):to(e,t,a,o),t.memoizedState=r.state,l&&zr(t,n,!0),t.child}function co(e){var t=e.stateNode;t.pendingContext?Ur(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ur(0,t.context,!1),El(e,t.containerInfo)}function so(e,t,n){var r=t.mode,l=t.pendingProps,o=t.memoizedState;if(0===(64&t.effectTag)){o=null;var i=!1}else o={timedOutAt:null!==o?o.timedOutAt:0},i=!0,t.effectTag&=-65;return null===e?i?(i=l.fallback,l=Qr(null,r,0,null),0===(1&t.mode)&&(l.child=null!==t.memoizedState?t.child.child:t.child),r=Qr(i,r,n,null),l.sibling=r,(n=l).return=r.return=t):n=r=$l(t,null,l.children,n):null!==e.memoizedState?(e=(r=e.child).sibling,i?(n=l.fallback,l=$r(r,r.pendingProps),0===(1&t.mode)&&((i=null!==t.memoizedState?t.child.child:t.child)!==r.child&&(l.child=i)),r=l.sibling=$r(e,n,e.expirationTime),n=l,l.childExpirationTime=0,n.return=r.return=t):n=r=Bl(t,r.child,l.children,n)):(e=e.child,i?(i=l.fallback,(l=Qr(null,r,0,null)).child=e,0===(1&t.mode)&&(l.child=null!==t.memoizedState?t.child.child:t.child),(r=l.sibling=Qr(i,r,n,null)).effectTag|=2,n=l,l.childExpirationTime=0,n.return=r.return=t):r=n=Bl(t,e,l.children,n)),t.memoizedState=o,t.child=n,r}function fo(e,t,n){if(null!==e&&(t.firstContextDependency=e.firstContextDependency),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child&&i("153"),null!==t.child){for(n=$r(e=t.child,e.pendingProps,e.expirationTime),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=$r(e,e.pendingProps,e.expirationTime)).return=t;n.sibling=null}return t.child}function po(e,t,n){var r=t.expirationTime;if(null!==e&&e.memoizedProps===t.pendingProps&&!Pr.current&&r<n){switch(t.tag){case 3:co(t),Zl();break;case 5:Pl(t);break;case 1:Mr(t.type)&&Rr(t);break;case 4:El(t,t.stateNode.containerInfo);break;case 10:vl(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?so(e,t,n):null!==(t=fo(e,t,n))?t.sibling:null}return fo(e,t,n)}switch(t.expirationTime=0,t.tag){case 2:r=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps;var l=Or(t,Sr.current);if(bl(t),l=r(e,l),t.effectTag|=1,"object"===typeof l&&null!==l&&"function"===typeof l.render&&void 0===l.$$typeof){if(t.tag=1,Mr(r)){var o=!0;Rr(t)}else o=!1;t.memoizedState=null!==l.state&&void 0!==l.state?l.state:null;var a=r.getDerivedStateFromProps;"function"===typeof a&&Il(t,r,a,e),l.updater=Ul,t.stateNode=l,l._reactInternalFiber=t,Ll(t,r,e,n),t=uo(null,t,r,!0,o,n)}else t.tag=0,to(null,t,l,n),t=t.child;return t;case 16:switch(l=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),o=t.pendingProps,e=function(e){var t=e._result;switch(e._status){case 1:return t;case 2:case 0:throw t;default:throw e._status=0,(t=(t=e._ctor)()).then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)}),e._result=t,t}}(l),t.type=e,l=t.tag=function(e){if("function"===typeof e)return Br(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===tt)return 11;if(e===rt)return 14}return 2}(e),o=Ol(e,o),a=void 0,l){case 0:a=io(null,t,e,o,n);break;case 1:a=ao(null,t,e,o,n);break;case 11:a=no(null,t,e,o,n);break;case 14:a=ro(null,t,e,Ol(e.type,o),r,n);break;default:i("283",e)}return a;case 0:return r=t.type,l=t.pendingProps,io(e,t,r,l=t.elementType===r?l:Ol(r,l),n);case 1:return r=t.type,l=t.pendingProps,ao(e,t,r,l=t.elementType===r?l:Ol(r,l),n);case 3:return co(t),null===(r=t.updateQueue)&&i("282"),l=null!==(l=t.memoizedState)?l.element:null,cl(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===l?(Zl(),t=fo(e,t,n)):(l=t.stateNode,(l=(null===e||null===e.child)&&l.hydrate)&&(Ql=wr(t.stateNode.containerInfo),Hl=t,l=Kl=!0),l?(t.effectTag|=2,t.child=$l(t,null,r,n)):(to(e,t,r,n),Zl()),t=t.child),t;case 5:return Pl(t),null===e&&Xl(t),r=t.type,l=t.pendingProps,o=null!==e?e.memoizedProps:null,a=l.children,vr(r,l)?a=null:null!==o&&vr(r,o)&&(t.effectTag|=16),oo(e,t),1!==n&&1&t.mode&&l.hidden?(t.expirationTime=1,t=null):(to(e,t,a,n),t=t.child),t;case 6:return null===e&&Xl(t),null;case 13:return so(e,t,n);case 4:return El(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Bl(t,null,r,n):to(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,no(e,t,r,l=t.elementType===r?l:Ol(r,l),n);case 7:return to(e,t,t.pendingProps,n),t.child;case 8:case 12:return to(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,a=t.memoizedProps,vl(t,o=l.value),null!==a){var u=a.value;if(0===(o=u===o&&(0!==u||1/u===1/o)||u!==u&&o!==o?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,o):1073741823))){if(a.children===l.children&&!Pr.current){t=fo(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){if(null!==(u=a.firstContextDependency))do{if(u.context===r&&0!==(u.observedBits&o)){if(1===a.tag){var c=rl(n);c.tag=2,ol(a,c)}a.expirationTime<n&&(a.expirationTime=n),null!==(c=a.alternate)&&c.expirationTime<n&&(c.expirationTime=n);for(var s=a.return;null!==s;){if(c=s.alternate,s.childExpirationTime<n)s.childExpirationTime=n,null!==c&&c.childExpirationTime<n&&(c.childExpirationTime=n);else{if(!(null!==c&&c.childExpirationTime<n))break;c.childExpirationTime=n}s=s.return}}c=a.child,u=u.next}while(null!==u);else c=10===a.tag&&a.type===t.type?null:a.child;if(null!==c)c.return=a;else for(c=a;null!==c;){if(c===t){c=null;break}if(null!==(a=c.sibling)){a.return=c.return,c=a;break}c=c.return}a=c}}to(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=(o=t.pendingProps).children,bl(t),r=r(l=kl(l,o.unstable_observedBits)),t.effectTag|=1,to(e,t,r,n),t.child;case 14:return ro(e,t,l=t.type,o=Ol(l.type,t.pendingProps),r,n);case 15:return lo(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ol(r,l),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,Mr(r)?(e=!0,Rr(t)):e=!1,bl(t),Rl(t,r,l),Ll(t,r,l,n),uo(null,t,r,!0,e,n);default:i("156")}}function mo(e){e.effectTag|=4}var ho=void 0,yo=void 0,vo=void 0,go=void 0;function bo(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ut(n)),null!==n&&at(n.type),t=t.value,null!==e&&1===e.tag&&at(e.type);try{console.error(t)}catch(l){setTimeout(function(){throw l})}}function ko(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){Yo(e,n)}else t.current=null}function wo(e){switch("function"===typeof Ar&&Ar(e),e.tag){case 0:case 11:case 14:case 15:var t=e.updateQueue;if(null!==t&&null!==(t=t.lastEffect)){var n=t=t.next;do{var r=n.destroy;if(null!==r){var l=e;try{r()}catch(o){Yo(l,o)}}n=n.next}while(n!==t)}break;case 1:if(ko(e),"function"===typeof(t=e.stateNode).componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(o){Yo(e,o)}break;case 5:ko(e);break;case 4:_o(e)}}function xo(e){return 5===e.tag||3===e.tag||4===e.tag}function To(e){e:{for(var t=e.return;null!==t;){if(xo(t)){var n=t;break e}t=t.return}i("160"),n=void 0}var r=t=void 0;switch(n.tag){case 5:t=n.stateNode,r=!1;break;case 3:case 4:t=n.stateNode.containerInfo,r=!0;break;default:i("161")}16&n.effectTag&&(lr(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||xo(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var l=e;;){if(5===l.tag||6===l.tag)if(n)if(r){var o=t,a=l.stateNode,u=n;8===o.nodeType?o.parentNode.insertBefore(a,u):o.insertBefore(a,u)}else t.insertBefore(l.stateNode,n);else r?(a=t,u=l.stateNode,8===a.nodeType?(o=a.parentNode).insertBefore(u,a):(o=a).appendChild(u),null!==(a=a._reactRootContainer)&&void 0!==a||null!==o.onclick||(o.onclick=pr)):t.appendChild(l.stateNode);else if(4!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===e)break;for(;null===l.sibling;){if(null===l.return||l.return===e)return;l=l.return}l.sibling.return=l.return,l=l.sibling}}function _o(e){for(var t=e,n=!1,r=void 0,l=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&i("160"),n.tag){case 5:r=n.stateNode,l=!1;break e;case 3:case 4:r=n.stateNode.containerInfo,l=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag){e:for(var o=t,a=o;;)if(wo(a),null!==a.child&&4!==a.tag)a.child.return=a,a=a.child;else{if(a===o)break;for(;null===a.sibling;){if(null===a.return||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}l?(o=r,a=t.stateNode,8===o.nodeType?o.parentNode.removeChild(a):o.removeChild(a)):r.removeChild(t.stateNode)}else if(4===t.tag?(r=t.stateNode.containerInfo,l=!0):wo(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;4===(t=t.return).tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function Co(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 1:break;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,l=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[U]=r,"input"===e&&"radio"===r.type&&null!=r.name&&wt(n,r),fr(e,l),t=fr(e,r),l=0;l<o.length;l+=2){var a=o[l],u=o[l+1];"style"===a?ur(n,u):"dangerouslySetInnerHTML"===a?rr(n,u):"children"===a?lr(n,u):vt(n,a,u,t)}switch(e){case"input":xt(n,r);break;case"textarea":Xn(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?Kn(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?Kn(n,!!r.multiple,r.defaultValue,!0):Kn(n,!!r.multiple,r.multiple?[]:"",!1))}}}break;case 6:null===t.stateNode&&i("162"),t.stateNode.nodeValue=t.memoizedProps;break;case 3:case 12:break;case 13:if(e=t,null===(n=t.memoizedState)?r=!1:(r=!0,e=t.child,0===n.timedOutAt&&(n.timedOutAt=_i())),null!==e)e:for(t=n=e;;){if(5===t.tag)e=t.stateNode,r?e.style.display="none":(e=t.stateNode,o=void 0!==(o=t.memoizedProps.style)&&null!==o&&o.hasOwnProperty("display")?o.display:null,e.style.display=ar("display",o));else if(6===t.tag)t.stateNode.nodeValue=r?"":t.memoizedProps;else{if(13===t.tag&&null!==t.memoizedState){(e=t.child.sibling).return=t,t=e;continue}if(null!==t.child){t.child.return=t,t=t.child;continue}}if(t===n)break e;for(;null===t.sibling;){if(null===t.return||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}break;case 17:break;default:i("163")}}function Eo(e,t,n){(n=rl(n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ui(r),bo(e,t)},n}function So(e,t,n){(n=rl(n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var l=t.value;n.payload=function(){return r(l)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===Bo?Bo=new Set([this]):Bo.add(this));var n=t.value,l=t.stack;bo(e,t),this.componentDidCatch(n,{componentStack:null!==l?l:""})}),n}function Po(e){switch(e.tag){case 1:Mr(e.type)&&Dr();var t=e.effectTag;return 2048&t?(e.effectTag=-2049&t|64,e):null;case 3:return Sl(),Ir(),0!==(64&(t=e.effectTag))&&i("285"),e.effectTag=-2049&t|64,e;case 5:return Nl(e),null;case 13:return 2048&(t=e.effectTag)?(e.effectTag=-2049&t|64,e):null;case 4:return Sl(),null;case 10:return gl(e),null;default:return null}}ho=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},yo=function(){},vo=function(e,t,n,r,o){var i=e.memoizedProps;if(i!==r){var a=t.stateNode;switch(Cl(xl.current),e=null,n){case"input":i=bt(a,i),r=bt(a,r),e=[];break;case"option":i=Qn(a,i),r=Qn(a,r),e=[];break;case"select":i=l({},i,{value:void 0}),r=l({},r,{value:void 0}),e=[];break;case"textarea":i=qn(a,i),r=qn(a,r),e=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(a.onclick=pr)}sr(n,r),a=n=void 0;var u=null;for(n in i)if(!r.hasOwnProperty(n)&&i.hasOwnProperty(n)&&null!=i[n])if("style"===n){var c=i[n];for(a in c)c.hasOwnProperty(a)&&(u||(u={}),u[a]="")}else"dangerouslySetInnerHTML"!==n&&"children"!==n&&"suppressContentEditableWarning"!==n&&"suppressHydrationWarning"!==n&&"autoFocus"!==n&&(b.hasOwnProperty(n)?e||(e=[]):(e=e||[]).push(n,null));for(n in r){var s=r[n];if(c=null!=i?i[n]:void 0,r.hasOwnProperty(n)&&s!==c&&(null!=s||null!=c))if("style"===n)if(c){for(a in c)!c.hasOwnProperty(a)||s&&s.hasOwnProperty(a)||(u||(u={}),u[a]="");for(a in s)s.hasOwnProperty(a)&&c[a]!==s[a]&&(u||(u={}),u[a]=s[a])}else u||(e||(e=[]),e.push(n,u)),u=s;else"dangerouslySetInnerHTML"===n?(s=s?s.__html:void 0,c=c?c.__html:void 0,null!=s&&c!==s&&(e=e||[]).push(n,""+s)):"children"===n?c===s||"string"!==typeof s&&"number"!==typeof s||(e=e||[]).push(n,""+s):"suppressContentEditableWarning"!==n&&"suppressHydrationWarning"!==n&&(b.hasOwnProperty(n)?(null!=s&&dr(o,n),e||c===s||(e=[])):(e=e||[]).push(n,s))}u&&(e=e||[]).push("style",u),o=e,(t.updateQueue=o)&&mo(t)}},go=function(e,t,n,r){n!==r&&mo(t)};var No={readContext:kl},Oo=$e.ReactCurrentOwner,Mo=1073741822,Do=0,Io=!1,Uo=null,Fo=null,Ro=0,zo=-1,Lo=!1,Ao=null,jo=!1,Wo=null,Vo=null,Bo=null;function $o(){if(null!==Uo)for(var e=Uo.return;null!==e;){var t=e;switch(t.tag){case 1:var n=t.type.childContextTypes;null!==n&&void 0!==n&&Dr();break;case 3:Sl(),Ir();break;case 5:Nl(t);break;case 4:Sl();break;case 10:gl(t)}e=e.return}Fo=null,Ro=0,zo=-1,Lo=!1,Uo=null}function Ho(){null!==Vo&&(o.unstable_cancelCallback(Wo),Vo())}function Qo(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0===(1024&e.effectTag)){Uo=e;e:{var o=t,a=Ro,u=(t=e).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:Mr(t.type)&&Dr();break;case 3:Sl(),Ir(),(u=t.stateNode).pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),null!==o&&null!==o.child||(Jl(t),t.effectTag&=-3),yo(t);break;case 5:Nl(t);var c=Cl(_l.current);if(a=t.type,null!==o&&null!=t.stateNode)vo(o,t,a,u,c),o.ref!==t.ref&&(t.effectTag|=128);else if(u){var s=Cl(xl.current);if(Jl(t)){o=(u=t).stateNode;var f=u.type,d=u.memoizedProps,p=c;switch(o[I]=u,o[U]=d,a=void 0,c=f){case"iframe":case"object":Cn("load",o);break;case"video":case"audio":for(f=0;f<te.length;f++)Cn(te[f],o);break;case"source":Cn("error",o);break;case"img":case"image":case"link":Cn("error",o),Cn("load",o);break;case"form":Cn("reset",o),Cn("submit",o);break;case"details":Cn("toggle",o);break;case"input":kt(o,d),Cn("invalid",o),dr(p,"onChange");break;case"select":o._wrapperState={wasMultiple:!!d.multiple},Cn("invalid",o),dr(p,"onChange");break;case"textarea":Yn(o,d),Cn("invalid",o),dr(p,"onChange")}for(a in sr(c,d),f=null,d)d.hasOwnProperty(a)&&(s=d[a],"children"===a?"string"===typeof s?o.textContent!==s&&(f=["children",s]):"number"===typeof s&&o.textContent!==""+s&&(f=["children",""+s]):b.hasOwnProperty(a)&&null!=s&&dr(p,a));switch(c){case"input":Ve(o),Tt(o,d,!0);break;case"textarea":Ve(o),Gn(o);break;case"select":case"option":break;default:"function"===typeof d.onClick&&(o.onclick=pr)}a=f,u.updateQueue=a,(u=null!==a)&&mo(t)}else{d=t,o=a,p=u,f=9===c.nodeType?c:c.ownerDocument,s===Jn.html&&(s=Zn(o)),s===Jn.html?"script"===o?((o=f.createElement("div")).innerHTML="<script><\/script>",f=o.removeChild(o.firstChild)):"string"===typeof p.is?f=f.createElement(o,{is:p.is}):(f=f.createElement(o),"select"===o&&p.multiple&&(f.multiple=!0)):f=f.createElementNS(s,o),(o=f)[I]=d,o[U]=u,ho(o,t,!1,!1),p=o;var m=c,h=fr(f=a,d=u);switch(f){case"iframe":case"object":Cn("load",p),c=d;break;case"video":case"audio":for(c=0;c<te.length;c++)Cn(te[c],p);c=d;break;case"source":Cn("error",p),c=d;break;case"img":case"image":case"link":Cn("error",p),Cn("load",p),c=d;break;case"form":Cn("reset",p),Cn("submit",p),c=d;break;case"details":Cn("toggle",p),c=d;break;case"input":kt(p,d),c=bt(p,d),Cn("invalid",p),dr(m,"onChange");break;case"option":c=Qn(p,d);break;case"select":p._wrapperState={wasMultiple:!!d.multiple},c=l({},d,{value:void 0}),Cn("invalid",p),dr(m,"onChange");break;case"textarea":Yn(p,d),c=qn(p,d),Cn("invalid",p),dr(m,"onChange");break;default:c=d}sr(f,c),s=void 0;var y=f,v=p,g=c;for(s in g)if(g.hasOwnProperty(s)){var k=g[s];"style"===s?ur(v,k):"dangerouslySetInnerHTML"===s?null!=(k=k?k.__html:void 0)&&rr(v,k):"children"===s?"string"===typeof k?("textarea"!==y||""!==k)&&lr(v,k):"number"===typeof k&&lr(v,""+k):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(b.hasOwnProperty(s)?null!=k&&dr(m,s):null!=k&&vt(v,s,k,h))}switch(f){case"input":Ve(p),Tt(p,d,!1);break;case"textarea":Ve(p),Gn(p);break;case"option":null!=d.value&&p.setAttribute("value",""+gt(d.value));break;case"select":(c=p).multiple=!!d.multiple,null!=(p=d.value)?Kn(c,!!d.multiple,p,!1):null!=d.defaultValue&&Kn(c,!!d.multiple,d.defaultValue,!0);break;default:"function"===typeof c.onClick&&(p.onclick=pr)}(u=yr(a,u))&&mo(t),t.stateNode=o}null!==t.ref&&(t.effectTag|=128)}else null===t.stateNode&&i("166");break;case 6:o&&null!=t.stateNode?go(o,t,o.memoizedProps,u):("string"!==typeof u&&(null===t.stateNode&&i("166")),o=Cl(_l.current),Cl(xl.current),Jl(t)?(a=(u=t).stateNode,o=u.memoizedProps,a[I]=u,(u=a.nodeValue!==o)&&mo(t)):(a=t,(u=(9===o.nodeType?o:o.ownerDocument).createTextNode(u))[I]=t,a.stateNode=u));break;case 11:break;case 13:if(u=t.memoizedState,0!==(64&t.effectTag)){t.expirationTime=a,Uo=t;break e}u=null!==u,a=null!==o&&null!==o.memoizedState,null!==o&&!u&&a&&(null!==(o=o.child.sibling)&&(null!==(c=t.firstEffect)?(t.firstEffect=o,o.nextEffect=c):(t.firstEffect=t.lastEffect=o,o.nextEffect=null),o.effectTag=8)),(u!==a||0===(1&t.effectTag)&&u)&&(t.effectTag|=4);break;case 7:case 8:case 12:break;case 4:Sl(),yo(t);break;case 10:gl(t);break;case 9:case 14:break;case 17:Mr(t.type)&&Dr();break;default:i("156")}Uo=null}if(t=e,1===Ro||1!==t.childExpirationTime){for(u=0,a=t.child;null!==a;)(o=a.expirationTime)>u&&(u=o),(c=a.childExpirationTime)>u&&(u=c),a=a.sibling;t.childExpirationTime=u}if(null!==Uo)return Uo;null!==n&&0===(1024&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1<e.effectTag&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e))}else{if(null!==(e=Po(e)))return e.effectTag&=1023,e;null!==n&&(n.firstEffect=n.lastEffect=null,n.effectTag|=1024)}if(null!==r)return r;if(null===n)break;e=n}return null}function Ko(e){var t=po(e.alternate,e,Ro);return e.memoizedProps=e.pendingProps,null===t&&(t=Qo(e)),Oo.current=null,t}function qo(e,t){Io&&i("243"),Ho(),Io=!0,Oo.currentDispatcher=No;var n=e.nextExpirationTimeToWorkOn;n===Ro&&e===Fo&&null!==Uo||($o(),Ro=n,Uo=$r((Fo=e).current,null),e.pendingCommitExpirationTime=0);for(var r=!1;;){try{if(t)for(;null!==Uo&&!Pi();)Uo=Ko(Uo);else for(;null!==Uo;)Uo=Ko(Uo)}catch(h){if(yl=hl=ml=null,null===Uo)r=!0,Ui(h);else{null===Uo&&i("271");var l=Uo,o=l.return;if(null!==o){e:{var a=e,u=o,c=l,s=h;if(o=Ro,c.effectTag|=1024,c.firstEffect=c.lastEffect=null,null!==s&&"object"===typeof s&&"function"===typeof s.then){var f=s;s=u;var d=-1,p=-1;do{if(13===s.tag){var m=s.alternate;if(null!==m&&null!==(m=m.memoizedState)){p=10*(1073741822-m.timedOutAt);break}"number"===typeof(m=s.pendingProps.maxDuration)&&(0>=m?d=0:(-1===d||m<d)&&(d=m))}s=s.return}while(null!==s);s=u;do{if((m=13===s.tag)&&(m=void 0!==s.memoizedProps.fallback&&null===s.memoizedState),m){if(u=Go.bind(null,a,s,c,0===(1&s.mode)?1073741823:o),f.then(u,u),0===(1&s.mode)){s.effectTag|=64,c.effectTag&=-1957,1===c.tag&&null===c.alternate&&(c.tag=17),c.expirationTime=o;break e}-1===d?a=1073741823:(-1===p&&(p=10*(1073741822-Jr(a,o))-5e3),a=p+d),0<=a&&zo<a&&(zo=a),s.effectTag|=2048,s.expirationTime=o;break e}s=s.return}while(null!==s);s=Error((at(c.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ut(c))}Lo=!0,s=dl(s,c),a=u;do{switch(a.tag){case 3:c=s,a.effectTag|=2048,a.expirationTime=o,il(a,o=Eo(a,c,o));break e;case 1:if(c=s,u=a.type,f=a.stateNode,0===(64&a.effectTag)&&("function"===typeof u.getDerivedStateFromError||null!==f&&"function"===typeof f.componentDidCatch&&(null===Bo||!Bo.has(f)))){a.effectTag|=2048,a.expirationTime=o,il(a,o=So(a,c,o));break e}}a=a.return}while(null!==a)}Uo=Qo(l);continue}r=!0,Ui(h)}}break}if(Io=!1,yl=hl=ml=Oo.currentDispatcher=null,r)Fo=null,e.finishedWork=null;else if(null!==Uo)e.finishedWork=null;else{if(null===(r=e.current.alternate)&&i("281"),Fo=null,Lo){if(l=e.latestPendingTime,o=e.latestSuspendedTime,a=e.latestPingedTime,0!==l&&l<n||0!==o&&o<n||0!==a&&a<n)return Gr(e,n),void Ti(e,r,n,e.expirationTime,-1);if(!e.didError&&t)return e.didError=!0,n=e.nextExpirationTimeToWorkOn=n,t=e.expirationTime=1073741823,void Ti(e,r,n,t,-1)}t&&-1!==zo?(Gr(e,n),(t=10*(1073741822-Jr(e,n)))<zo&&(zo=t),t=10*(1073741822-_i()),t=zo-t,Ti(e,r,n,e.expirationTime,0>t?0:t)):(e.pendingCommitExpirationTime=n,e.finishedWork=r)}}function Yo(e,t){for(var n=e.return;null!==n;){switch(n.tag){case 1:var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Bo||!Bo.has(r)))return ol(n,e=So(n,e=dl(t,e),1073741823)),void Zo(n,1073741823);break;case 3:return ol(n,e=Eo(n,e=dl(t,e),1073741823)),void Zo(n,1073741823)}n=n.return}3===e.tag&&(ol(e,n=Eo(e,n=dl(t,e),1073741823)),Zo(e,1073741823))}function Xo(e,t){return 0!==Do?e=Do:Io?e=jo?1073741823:Ro:1&t.mode?(e=pi?1073741822-10*(1+((1073741822-e+15)/10|0)):1073741822-25*(1+((1073741822-e+500)/25|0)),null!==Fo&&e===Ro&&--e):e=1073741823,pi&&(0===ui||e<ui)&&(ui=e),e}function Go(e,t,n,r){var l=e.earliestSuspendedTime,o=e.latestSuspendedTime;if(0!==l&&r<=l&&r>=o){o=l=r,e.didError=!1;var i=e.latestPingedTime;(0===i||i>o)&&(e.latestPingedTime=o),Zr(o,e)}else Xr(e,l=Xo(l=_i(),t));0!==(1&t.mode)&&e===Fo&&Ro===r&&(Fo=null),Jo(t,l),0===(1&t.mode)&&(Jo(n,l),1===n.tag&&null!==n.stateNode&&((t=rl(l)).tag=2,ol(n,t))),0!==(n=e.expirationTime)&&Ci(e,n)}function Jo(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,l=null;if(null===r&&3===e.tag)l=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){l=r.stateNode;break}r=r.return}return l}function Zo(e,t){null!==(e=Jo(e,t))&&(!Io&&0!==Ro&&t>Ro&&$o(),Xr(e,t),Io&&!jo&&Fo===e||Ci(e,e.expirationTime),bi>gi&&(bi=0,i("185")))}function ei(e,t,n,r,l){var o=Do;Do=1073741823;try{return e(t,n,r,l)}finally{Do=o}}var ti=null,ni=null,ri=0,li=void 0,oi=!1,ii=null,ai=0,ui=0,ci=!1,si=null,fi=!1,di=!1,pi=!1,mi=null,hi=o.unstable_now(),yi=1073741822-(hi/10|0),vi=yi,gi=50,bi=0,ki=null;function wi(){yi=1073741822-((o.unstable_now()-hi)/10|0)}function xi(e,t){if(0!==ri){if(t<ri)return;null!==li&&o.unstable_cancelCallback(li)}ri=t,e=o.unstable_now()-hi,li=o.unstable_scheduleCallback(Ni,{timeout:10*(1073741822-t)-e})}function Ti(e,t,n,r,l){e.expirationTime=r,0!==l||Pi()?0<l&&(e.timeoutHandle=gr(function(e,t,n){e.pendingCommitExpirationTime=n,e.finishedWork=t,wi(),vi=yi,Mi(e,n)}.bind(null,e,t,n),l)):(e.pendingCommitExpirationTime=n,e.finishedWork=t)}function _i(){return oi?vi:(Ei(),0!==ai&&1!==ai||(wi(),vi=yi),vi)}function Ci(e,t){null===e.nextScheduledRoot?(e.expirationTime=t,null===ni?(ti=ni=e,e.nextScheduledRoot=e):(ni=ni.nextScheduledRoot=e).nextScheduledRoot=ti):t>e.expirationTime&&(e.expirationTime=t),oi||(fi?di&&(ii=e,ai=1073741823,Di(e,1073741823,!1)):1073741823===t?Oi(1073741823,!1):xi(e,t))}function Ei(){var e=0,t=null;if(null!==ni)for(var n=ni,r=ti;null!==r;){var l=r.expirationTime;if(0===l){if((null===n||null===ni)&&i("244"),r===r.nextScheduledRoot){ti=ni=r.nextScheduledRoot=null;break}if(r===ti)ti=l=r.nextScheduledRoot,ni.nextScheduledRoot=l,r.nextScheduledRoot=null;else{if(r===ni){(ni=n).nextScheduledRoot=ti,r.nextScheduledRoot=null;break}n.nextScheduledRoot=r.nextScheduledRoot,r.nextScheduledRoot=null}r=n.nextScheduledRoot}else{if(l>e&&(e=l,t=r),r===ni)break;if(1073741823===e)break;n=r,r=r.nextScheduledRoot}}ii=t,ai=e}var Si=!1;function Pi(){return!!Si||!!o.unstable_shouldYield()&&(Si=!0)}function Ni(){try{if(!Pi()&&null!==ti){wi();var e=ti;do{var t=e.expirationTime;0!==t&&yi<=t&&(e.nextExpirationTimeToWorkOn=yi),e=e.nextScheduledRoot}while(e!==ti)}Oi(0,!0)}finally{Si=!1}}function Oi(e,t){if(Ei(),t)for(wi(),vi=yi;null!==ii&&0!==ai&&e<=ai&&!(Si&&yi>ai);)Di(ii,ai,yi>ai),Ei(),wi(),vi=yi;else for(;null!==ii&&0!==ai&&e<=ai;)Di(ii,ai,!1),Ei();if(t&&(ri=0,li=null),0!==ai&&xi(ii,ai),bi=0,ki=null,null!==mi)for(e=mi,mi=null,t=0;t<e.length;t++){var n=e[t];try{n._onComplete()}catch(r){ci||(ci=!0,si=r)}}if(ci)throw e=si,si=null,ci=!1,e}function Mi(e,t){oi&&i("253"),ii=e,ai=t,Di(e,t,!1),Oi(1073741823,!1)}function Di(e,t,n){if(oi&&i("245"),oi=!0,n){var r=e.finishedWork;null!==r?Ii(e,r,t):(e.finishedWork=null,-1!==(r=e.timeoutHandle)&&(e.timeoutHandle=-1,br(r)),qo(e,n),null!==(r=e.finishedWork)&&(Pi()?e.finishedWork=r:Ii(e,r,t)))}else null!==(r=e.finishedWork)?Ii(e,r,t):(e.finishedWork=null,-1!==(r=e.timeoutHandle)&&(e.timeoutHandle=-1,br(r)),qo(e,n),null!==(r=e.finishedWork)&&Ii(e,r,t));oi=!1}function Ii(e,t,n){var r=e.firstBatch;if(null!==r&&r._expirationTime>=n&&(null===mi?mi=[r]:mi.push(r),r._defer))return e.finishedWork=t,void(e.expirationTime=0);e.finishedWork=null,e===ki?bi++:(ki=e,bi=0),jo=Io=!0,e.current===t&&i("177"),0===(n=e.pendingCommitExpirationTime)&&i("261"),e.pendingCommitExpirationTime=0,r=t.expirationTime;var l=t.childExpirationTime;if(r=l>r?l:r,e.didError=!1,0===r?(e.earliestPendingTime=0,e.latestPendingTime=0,e.earliestSuspendedTime=0,e.latestSuspendedTime=0,e.latestPingedTime=0):(0!==(l=e.latestPendingTime)&&(l>r?e.earliestPendingTime=e.latestPendingTime=0:e.earliestPendingTime>r&&(e.earliestPendingTime=e.latestPendingTime)),0===(l=e.earliestSuspendedTime)?Xr(e,r):r<e.latestSuspendedTime?(e.earliestSuspendedTime=0,e.latestSuspendedTime=0,e.latestPingedTime=0,Xr(e,r)):r>l&&Xr(e,r)),Zr(0,e),Oo.current=null,1<t.effectTag?null!==t.lastEffect?(t.lastEffect.nextEffect=t,r=t.firstEffect):r=t:r=t.firstEffect,mr=_n,zn(l=Rn())){if("selectionStart"in l)var o={start:l.selectionStart,end:l.selectionEnd};else e:{var a=(o=(o=l.ownerDocument)&&o.defaultView||window).getSelection&&o.getSelection();if(a&&0!==a.rangeCount){o=a.anchorNode;var u=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{o.nodeType,c.nodeType}catch(R){o=null;break e}var s=0,f=-1,d=-1,p=0,m=0,h=l,y=null;t:for(;;){for(var v;h!==o||0!==u&&3!==h.nodeType||(f=s+u),h!==c||0!==a&&3!==h.nodeType||(d=s+a),3===h.nodeType&&(s+=h.nodeValue.length),null!==(v=h.firstChild);)y=h,h=v;for(;;){if(h===l)break t;if(y===o&&++p===u&&(f=s),y===c&&++m===a&&(d=s),null!==(v=h.nextSibling))break;y=(h=y).parentNode}h=v}o=-1===f||-1===d?null:{start:f,end:d}}else o=null}o=o||{start:0,end:0}}else o=null;for(hr={focusedElem:l,selectionRange:o},_n=!1,Ao=r;null!==Ao;){l=!1,o=void 0;try{for(;null!==Ao;){if(256&Ao.effectTag)e:{var g=Ao.alternate;switch((u=Ao).tag){case 0:case 11:case 15:break e;case 1:if(256&u.effectTag&&null!==g){var b=g.memoizedProps,k=g.memoizedState,w=u.stateNode,x=w.getSnapshotBeforeUpdate(u.elementType===u.type?b:Ol(u.type,b),k);w.__reactInternalSnapshotBeforeUpdate=x}break e;case 3:case 5:case 6:case 4:case 17:break e;default:i("163")}}Ao=Ao.nextEffect}}catch(R){l=!0,o=R}l&&(null===Ao&&i("178"),Yo(Ao,o),null!==Ao&&(Ao=Ao.nextEffect))}for(Ao=r;null!==Ao;){g=!1,b=void 0;try{for(;null!==Ao;){var T=Ao.effectTag;if(16&T&&lr(Ao.stateNode,""),128&T){var _=Ao.alternate;if(null!==_){var C=_.ref;null!==C&&("function"===typeof C?C(null):C.current=null)}}switch(14&T){case 2:To(Ao),Ao.effectTag&=-3;break;case 6:To(Ao),Ao.effectTag&=-3,Co(Ao.alternate,Ao);break;case 4:Co(Ao.alternate,Ao);break;case 8:_o(k=Ao),k.return=null,k.child=null,k.alternate&&(k.alternate.child=null,k.alternate.return=null)}Ao=Ao.nextEffect}}catch(R){g=!0,b=R}g&&(null===Ao&&i("178"),Yo(Ao,b),null!==Ao&&(Ao=Ao.nextEffect))}if(C=hr,_=Rn(),T=C.focusedElem,b=C.selectionRange,_!==T&&T&&T.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(T.ownerDocument.documentElement,T)){null!==b&&zn(T)&&(_=b.start,void 0===(C=b.end)&&(C=_),"selectionStart"in T?(T.selectionStart=_,T.selectionEnd=Math.min(C,T.value.length)):(C=(_=T.ownerDocument||document)&&_.defaultView||window).getSelection&&(C=C.getSelection(),k=T.textContent.length,g=Math.min(b.start,k),b=void 0===b.end?g:Math.min(b.end,k),!C.extend&&g>b&&(k=b,b=g,g=k),k=Fn(T,g),w=Fn(T,b),k&&w&&(1!==C.rangeCount||C.anchorNode!==k.node||C.anchorOffset!==k.offset||C.focusNode!==w.node||C.focusOffset!==w.offset)&&((_=_.createRange()).setStart(k.node,k.offset),C.removeAllRanges(),g>b?(C.addRange(_),C.extend(w.node,w.offset)):(_.setEnd(w.node,w.offset),C.addRange(_))))),_=[];for(C=T;C=C.parentNode;)1===C.nodeType&&_.push({element:C,left:C.scrollLeft,top:C.scrollTop});for("function"===typeof T.focus&&T.focus(),T=0;T<_.length;T++)(C=_[T]).element.scrollLeft=C.left,C.element.scrollTop=C.top}for(hr=null,_n=!!mr,mr=null,e.current=t,Ao=r;null!==Ao;){r=!1,T=void 0;try{for(_=n;null!==Ao;){var E=Ao.effectTag;if(36&E){var S=Ao.alternate;switch(g=_,(C=Ao).tag){case 0:case 11:case 15:break;case 1:var P=C.stateNode;if(4&C.effectTag)if(null===S)P.componentDidMount();else{var N=C.elementType===C.type?S.memoizedProps:Ol(C.type,S.memoizedProps);P.componentDidUpdate(N,S.memoizedState,P.__reactInternalSnapshotBeforeUpdate)}var O=C.updateQueue;null!==O&&sl(0,O,P);break;case 3:var M=C.updateQueue;if(null!==M){if(b=null,null!==C.child)switch(C.child.tag){case 5:b=C.child.stateNode;break;case 1:b=C.child.stateNode}sl(0,M,b)}break;case 5:var D=C.stateNode;null===S&&4&C.effectTag&&yr(C.type,C.memoizedProps)&&D.focus();break;case 6:case 4:case 12:case 13:case 17:break;default:i("163")}}if(128&E){var I=Ao.ref;if(null!==I){var U=Ao.stateNode;switch(Ao.tag){case 5:var F=U;break;default:F=U}"function"===typeof I?I(F):I.current=F}}Ao=Ao.nextEffect}}catch(R){r=!0,T=R}r&&(null===Ao&&i("178"),Yo(Ao,T),null!==Ao&&(Ao=Ao.nextEffect))}Io=jo=!1,"function"===typeof Lr&&Lr(t.stateNode),E=t.expirationTime,0===(t=(t=t.childExpirationTime)>E?t:E)&&(Bo=null),e.expirationTime=t,e.finishedWork=null}function Ui(e){null===ii&&i("246"),ii.expirationTime=0,ci||(ci=!0,si=e)}function Fi(e,t){var n=fi;fi=!0;try{return e(t)}finally{(fi=n)||oi||Oi(1073741823,!1)}}function Ri(e,t){if(fi&&!di){di=!0;try{return e(t)}finally{di=!1}}return e(t)}function zi(e,t,n){if(pi)return e(t,n);fi||oi||0===ui||(Oi(ui,!1),ui=0);var r=pi,l=fi;fi=pi=!0;try{return e(t,n)}finally{pi=r,(fi=l)||oi||Oi(1073741823,!1)}}function Li(e,t,n,r,l){var o=t.current;e:if(n){t:{2===tn(n=n._reactInternalFiber)&&1===n.tag||i("170");var a=n;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(Mr(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(null!==a);i("171"),a=void 0}if(1===n.tag){var u=n.type;if(Mr(u)){n=Fr(n,u,a);break e}}n=a}else n=Er;return null===t.context?t.context=n:t.pendingContext=n,t=l,(l=rl(r)).payload={element:e},null!==(t=void 0===t?null:t)&&(l.callback=t),Ho(),ol(o,l),Zo(o,r),r}function Ai(e,t,n,r){var l=t.current;return Li(e,t,n,l=Xo(_i(),l),r)}function ji(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Wi(e){var t=1073741822-25*(1+((1073741822-_i()+500)/25|0));t>=Mo&&(t=Mo-1),this._expirationTime=Mo=t,this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function Vi(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function Bi(e,t,n){e={current:t=Vr(3,null,null,t?3:0),containerInfo:e,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:n,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null},this._internalRoot=t.stateNode=e}function $i(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Hi(e,t,n,r,l){$i(n)||i("200");var o=n._reactRootContainer;if(o){if("function"===typeof l){var a=l;l=function(){var e=ji(o._internalRoot);a.call(e)}}null!=e?o.legacy_renderSubtreeIntoContainer(e,t,l):o.render(t,l)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Bi(e,!1,t)}(n,r),"function"===typeof l){var u=l;l=function(){var e=ji(o._internalRoot);u.call(e)}}Ri(function(){null!=e?o.legacy_renderSubtreeIntoContainer(e,t,l):o.render(t,l)})}return ji(o._internalRoot)}function Qi(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return $i(t)||i("200"),function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:qe,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Ee=function(e,t,n){switch(t){case"input":if(xt(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=L(r);l||i("90"),Be(r),xt(r,l)}}}break;case"textarea":Xn(e,n);break;case"select":null!=(t=n.value)&&Kn(e,!!n.multiple,t,!1)}},Wi.prototype.render=function(e){this._defer||i("250"),this._hasChildren=!0,this._children=e;var t=this._root._internalRoot,n=this._expirationTime,r=new Vi;return Li(e,t,null,n,r._onCommit),r},Wi.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},Wi.prototype.commit=function(){var e=this._root._internalRoot,t=e.firstBatch;if(this._defer&&null!==t||i("251"),this._hasChildren){var n=this._expirationTime;if(t!==this){this._hasChildren&&(n=this._expirationTime=t._expirationTime,this.render(this._children));for(var r=null,l=t;l!==this;)r=l,l=l._next;null===r&&i("251"),r._next=l._next,this._next=t,e.firstBatch=this}this._defer=!1,Mi(e,n),t=this._next,this._next=null,null!==(t=e.firstBatch=t)&&t._hasChildren&&t.render(t._children)}else this._next=null,this._defer=!1},Wi.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},Vi.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},Vi.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++){var n=e[t];"function"!==typeof n&&i("191",n),n()}}},Bi.prototype.render=function(e,t){var n=this._internalRoot,r=new Vi;return null!==(t=void 0===t?null:t)&&r.then(t),Ai(e,n,null,r._onCommit),r},Bi.prototype.unmount=function(e){var t=this._internalRoot,n=new Vi;return null!==(e=void 0===e?null:e)&&n.then(e),Ai(null,t,null,n._onCommit),n},Bi.prototype.legacy_renderSubtreeIntoContainer=function(e,t,n){var r=this._internalRoot,l=new Vi;return null!==(n=void 0===n?null:n)&&l.then(n),Ai(t,r,e,l._onCommit),l},Bi.prototype.createBatch=function(){var e=new Wi(this),t=e._expirationTime,n=this._internalRoot,r=n.firstBatch;if(null===r)n.firstBatch=e,e._next=null;else{for(n=null;null!==r&&r._expirationTime>=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e},De=Fi,Ie=zi,Ue=function(){oi||0===ui||(Oi(ui,!1),ui=0)};var Ki={createPortal:Qi,findDOMNode:function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;return void 0===t&&("function"===typeof e.render?i("188"):i("268",Object.keys(e))),e=null===(e=rn(t))?null:e.stateNode},hydrate:function(e,t,n){return Hi(null,e,t,!0,n)},render:function(e,t,n){return Hi(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,r){return(null==e||void 0===e._reactInternalFiber)&&i("38"),Hi(e,t,n,!1,r)},unmountComponentAtNode:function(e){return $i(e)||i("40"),!!e._reactRootContainer&&(Ri(function(){Hi(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:function(){return Qi.apply(void 0,arguments)},unstable_batchedUpdates:Fi,unstable_interactiveUpdates:zi,flushSync:function(e,t){oi&&i("187");var n=fi;fi=!0;try{return ei(e,t)}finally{fi=n,Oi(1073741823,!1)}},unstable_flushControlled:function(e){var t=fi;fi=!0;try{ei(e)}finally{(fi=t)||oi||Oi(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[R,z,L,N.injectEventPluginsByName,g,$,function(e){E(e,B)},Oe,Me,Pn,M]},unstable_createRoot:function(e,t){return $i(e)||i("299","unstable_createRoot"),new Bi(e,!0,null!=t&&!0===t.hydrate)}};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Lr=jr(function(e){return t.onCommitFiberRoot(n,e)}),Ar=jr(function(e){return t.onCommitFiberUnmount(n,e)})}catch(r){}})(l({},e,{findHostInstanceByFiber:function(e){return null===(e=rn(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}({findFiberByHostInstance:F,bundleType:0,version:"16.6.3",rendererPackageName:"react-dom"});var qi={default:Ki},Yi=qi&&Ki||qi;e.exports=Yi.default||Yi},function(e,t,n){"use strict";e.exports=n(13)},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=null,r=!1,l=3,o=-1,i=-1,a=!1,u=!1;function c(){if(!a){var e=n.expirationTime;u?T():u=!0,x(d,e)}}function s(){var e=n,t=n.next;if(n===t)n=null;else{var r=n.previous;n=r.next=t,t.previous=r}e.next=e.previous=null,r=e.callback,t=e.expirationTime,e=e.priorityLevel;var o=l,a=i;l=e,i=t;try{var u=r()}finally{l=o,i=a}if("function"===typeof u)if(u={callback:u,priorityLevel:e,expirationTime:t,next:null,previous:null},null===n)n=u.next=u.previous=u;else{r=null,e=n;do{if(e.expirationTime>=t){r=e;break}e=e.next}while(e!==n);null===r?r=n:r===n&&(n=u,c()),(t=r.previous).next=r.previous=u,u.next=r,u.previous=t}}function f(){if(-1===o&&null!==n&&1===n.priorityLevel){a=!0;try{do{s()}while(null!==n&&1===n.priorityLevel)}finally{a=!1,null!==n?c():u=!1}}}function d(e){a=!0;var l=r;r=e;try{if(e)for(;null!==n;){var o=t.unstable_now();if(!(n.expirationTime<=o))break;do{s()}while(null!==n&&n.expirationTime<=o)}else if(null!==n)do{s()}while(null!==n&&!_())}finally{a=!1,r=l,null!==n?c():u=!1,f()}}var p,m,h=Date,y="function"===typeof setTimeout?setTimeout:void 0,v="function"===typeof clearTimeout?clearTimeout:void 0,g="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,b="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function k(e){p=g(function(t){v(m),e(t)}),m=y(function(){b(p),e(t.unstable_now())},100)}if("object"===typeof performance&&"function"===typeof performance.now){var w=performance;t.unstable_now=function(){return w.now()}}else t.unstable_now=function(){return h.now()};var x,T,_,C=null;if("undefined"!==typeof window?C=window:"undefined"!==typeof e&&(C=e),C&&C._schedMock){var E=C._schedMock;x=E[0],T=E[1],_=E[2],t.unstable_now=E[3]}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var S=null,P=function(e){if(null!==S)try{S(e)}finally{S=null}};x=function(e){null!==S?setTimeout(x,0,e):(S=e,setTimeout(P,0,!1))},T=function(){S=null},_=function(){return!1}}else{"undefined"!==typeof console&&("function"!==typeof g&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var N=null,O=!1,M=-1,D=!1,I=!1,U=0,F=33,R=33;_=function(){return U<=t.unstable_now()};var z=new MessageChannel,L=z.port2;z.port1.onmessage=function(){O=!1;var e=N,n=M;N=null,M=-1;var r=t.unstable_now(),l=!1;if(0>=U-r){if(!(-1!==n&&n<=r))return D||(D=!0,k(A)),N=e,void(M=n);l=!0}if(null!==e){I=!0;try{e(l)}finally{I=!1}}};var A=function e(t){if(null!==N){k(e);var n=t-U+R;n<R&&F<R?(8>n&&(n=8),R=n<F?F:n):F=n,U=t+R,O||(O=!0,L.postMessage(void 0))}else D=!1};x=function(e,t){N=e,M=t,I||0>t?L.postMessage(void 0):D||(D=!0,k(A))},T=function(){N=null,O=!1,M=-1}}t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=l,i=o;l=e,o=t.unstable_now();try{return n()}finally{l=r,o=i,f()}},t.unstable_scheduleCallback=function(e,r){var i=-1!==o?o:t.unstable_now();if("object"===typeof r&&null!==r&&"number"===typeof r.timeout)r=i+r.timeout;else switch(l){case 1:r=i+-1;break;case 2:r=i+250;break;case 5:r=i+1073741823;break;case 4:r=i+1e4;break;default:r=i+5e3}if(e={callback:e,priorityLevel:l,expirationTime:r,next:null,previous:null},null===n)n=e.next=e.previous=e,c();else{i=null;var a=n;do{if(a.expirationTime>r){i=a;break}a=a.next}while(a!==n);null===i?i=n:i===n&&(n=e,c()),(r=i.previous).next=i.previous=e,e.next=i,e.previous=r}return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)n=null;else{e===n&&(n=t);var r=e.previous;r.next=t,t.previous=r}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var n=l;return function(){var r=l,i=o;l=n,o=t.unstable_now();try{return e.apply(this,arguments)}finally{l=r,o=i,f()}}},t.unstable_getCurrentPriorityLevel=function(){return l},t.unstable_shouldYield=function(){return!r&&(null!==n&&n.expirationTime<i||_())}}).call(this,n(14))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(r){"object"===typeof window&&(n=window)}e.exports=n}]]);
//# sourceMappingURL=1.5b265051.chunk.js.map
|
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var key = {};
var map = new WeakMap;
Object.preventExtensions(key);
// Try querying using frozen key.
assertFalse(map.has(key));
assertSame(undefined, map.get(key));
// Try adding using frozen key.
map.set(key, 1);
assertTrue(map.has(key));
assertSame(1, map.get(key));
// Try deleting using frozen key.
map.delete(key, 1);
assertFalse(map.has(key));
assertSame(undefined, map.get(key));
|
####################################################
# COMS 4771 Machine Learning Assignment 5 Problem 2
# Name:
# UNI:
####################################################
def predictSVM(X_test):
"""This function takes a dataset and predict the letter for each data point.
Parameters
----------
dataset: M X 128 numpy array
A dataset represented by numpy-array
Returns
-------
M x 1 numpy array
Returns a numpy array of letter that each data point represents
"""
# Your code here
|
/*
* /MathJax/extensions/asciimath2jax.js
*
* Copyright (c) 2009-2018 The MathJax Consortium
*
* 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.
*/
MathJax.Extension.asciimath2jax={version:"2.7.4",config:{delimiters:[["`","`"]],skipTags:["script","noscript","style","textarea","pre","code","annotation","annotation-xml"],ignoreClass:"asciimath2jax_ignore",processClass:"asciimath2jax_process",preview:"AsciiMath"},ignoreTags:{br:(MathJax.Hub.Browser.isMSIE&&document.documentMode<9?"\n":" "),wbr:"","#comment":""},PreProcess:function(a){if(!this.configured){this.config=MathJax.Hub.CombineConfig("asciimath2jax",this.config);if(this.config.Augment){MathJax.Hub.Insert(this,this.config.Augment)}this.configured=true}if(typeof(a)==="string"){a=document.getElementById(a)}if(!a){a=document.body}if(this.createPatterns()){this.scanElement(a,a.nextSibling)}},createPatterns:function(){var d=[],c,a,b=this.config;this.match={};if(b.delimiters.length===0){return false}for(c=0,a=b.delimiters.length;c<a;c++){d.push(this.patternQuote(b.delimiters[c][0]));this.match[b.delimiters[c][0]]={mode:"",end:b.delimiters[c][1],pattern:this.endPattern(b.delimiters[c][1])}}this.start=new RegExp(d.sort(this.sortLength).join("|"),"g");this.skipTags=new RegExp("^("+b.skipTags.join("|")+")$","i");var e=[];if(MathJax.Hub.config.preRemoveClass){e.push(MathJax.Hub.config.preRemoveClass)}if(b.ignoreClass){e.push(b.ignoreClass)}this.ignoreClass=(e.length?new RegExp("(^| )("+e.join("|")+")( |$)"):/^$/);this.processClass=new RegExp("(^| )("+b.processClass+")( |$)");return true},patternQuote:function(a){return a.replace(/([\^$(){}+*?\-|\[\]\:\\])/g,"\\$1")},endPattern:function(a){return new RegExp(this.patternQuote(a)+"|\\\\.","g")},sortLength:function(d,c){if(d.length!==c.length){return c.length-d.length}return(d==c?0:(d<c?-1:1))},scanElement:function(c,b,g){var a,e,d,f;while(c&&c!=b){if(c.nodeName.toLowerCase()==="#text"){if(!g){c=this.scanText(c)}}else{a=(typeof(c.className)==="undefined"?"":c.className);e=(typeof(c.tagName)==="undefined"?"":c.tagName);if(typeof(a)!=="string"){a=String(a)}f=this.processClass.exec(a);if(c.firstChild&&!a.match(/(^| )MathJax/)&&(f||!this.skipTags.exec(e))){d=(g||this.ignoreClass.exec(a))&&!f;this.scanElement(c.firstChild,b,d)}}if(c){c=c.nextSibling}}},scanText:function(c){if(c.nodeValue.replace(/\s+/,"")==""){return c}var b,d,e=0,a;this.search={start:true};this.pattern=this.start;while(c){a=null;this.pattern.lastIndex=e||0;e=0;while(c&&c.nodeName.toLowerCase()==="#text"&&(b=this.pattern.exec(c.nodeValue))){if(this.search.start){c=this.startMatch(b,c)}else{c=this.endMatch(b,c)}}if(this.search.matched){c=this.encloseMath(c)}else{if(!this.search.start){a=this.search}}if(c){do{d=c;c=c.nextSibling}while(c&&this.ignoreTags[c.nodeName.toLowerCase()]!=null);if(!c||c.nodeName!=="#text"){if(!a){return d}c=a.open;e=a.opos+a.olen;this.search={start:true};this.pattern=this.start}}}return c},startMatch:function(a,b){var c=this.match[a[0]];if(c!=null){this.search={end:c.end,mode:c.mode,open:b,olen:a[0].length,opos:this.pattern.lastIndex-a[0].length};this.switchPattern(c.pattern)}return b},endMatch:function(a,b){if(a[0]==this.search.end){this.search.close=b;this.search.cpos=this.pattern.lastIndex;this.search.clen=(this.search.isBeginEnd?0:a[0].length);this.search.matched=true;b=this.encloseMath(b);this.switchPattern(this.start)}return b},switchPattern:function(a){a.lastIndex=this.pattern.lastIndex;this.pattern=a;this.search.start=(a===this.start)},encloseMath:function(b){var a=this.search,g=a.close,f,d,c;if(a.cpos===g.length){g=g.nextSibling}else{g=g.splitText(a.cpos)}if(!g){f=g=MathJax.HTML.addText(a.close.parentNode,"")}a.close=g;d=(a.opos?a.open.splitText(a.opos):a.open);while((c=d.nextSibling)&&c!==g){if(c.nodeValue!==null){if(c.nodeName==="#comment"){d.nodeValue+=c.nodeValue.replace(/^\[CDATA\[((.|\n|\r)*)\]\]$/,"$1")}else{d.nodeValue+=d.nextSibling.nodeValue}}else{var h=this.ignoreTags[c.nodeName.toLowerCase()];d.nodeValue+=(h==null?" ":h)}d.parentNode.removeChild(c)}var e=d.nodeValue.substr(a.olen,d.nodeValue.length-a.olen-a.clen);d.parentNode.removeChild(d);if(this.config.preview!=="none"){this.createPreview(a.mode,e)}d=this.createMathTag(a.mode,e);this.search={};this.pattern.lastIndex=0;if(f){f.parentNode.removeChild(f)}return d},insertNode:function(b){var a=this.search;a.close.parentNode.insertBefore(b,a.close)},createPreview:function(d,a){var b=MathJax.Hub.config.preRemoveClass;var c=this.config.preview;if(c==="none"){return}if((this.search.close.previousSibling||{}).className===b){return}if(c==="AsciiMath"){c=[this.filterPreview(a)]}if(c){c=MathJax.HTML.Element("span",{className:b},c);this.insertNode(c)}},createMathTag:function(c,a){var b=document.createElement("script");b.type="math/asciimath"+c;MathJax.HTML.setScript(b,a);this.insertNode(b);return b},filterPreview:function(a){return a}};MathJax.Hub.Register.PreProcessor(["PreProcess",MathJax.Extension.asciimath2jax]);MathJax.Ajax.loadComplete("[MathJax]/extensions/asciimath2jax.js");
|
/*
===============================================================================================
Unify Project
Homepage: unify-project.org
License: MIT + Apache (V2)
Copyright: 2011, Sebastian Fastner, Mainz, Germany, http://unify-training.com
===============================================================================================
*/
/*
#asset(unify/iphoneos/navigation-bar/black/navigationbar.png)
#asset(unify/iphoneos/loader.png)
#asset(unify/noun/down.png)
#asset(unify/checkbox.png)
#asset(unify/checkbox_checked.png)
*/
/**
* Appearances "dark" for unify widgets
*/
qx.Theme.define("unify.theme.dark.Appearance", {
appearances : {
/*
---------------------------------------------------------------------------
CORE
---------------------------------------------------------------------------
*/
"BODY" : {
style : function() {
return {
userSelect : "none",
position : "absolute",
left: 0,
top: 0,
right: 0,
bottom: 0,
overflow : "hidden",
border : 0,
padding : 0,
margin : 0,
boxSizing : "borderBox",
fontFamily : "Helvetica,sans-serif",
fontSize: "14px",
lineHeight : "1.4",
color : "black",
background : "white"
};
}
},
"POPOVER-BLOCKER" : {
style : function(states) {
return {
position: "absolute",
left: 0,
top: 0,
width: "100%",
height: "100%",
background: "transparent"
}
}
},
"MODAL-BLOCKER" : {
style : function(states) {
return {
position: "absolute",
left: 0,
top: 0,
width: "100%",
height: "100%",
backgroundColor: "#000",
opacity: 0.5
}
}
},
"widget" : {},
"list.button.top" : {
style : function(states) {
return {
borderTopLeftRadius : "8px",
borderTopRightRadius : "8px",
paddingLeft: "10px",
paddingTop: "10px",
paddingRight: "10px",
paddingBottom: "10px",
borderLeft: "1px solid #b4b4b4",
borderTop: "1px solid #b4b4b4",
borderRight: "1px solid #b4b4b4",
borderBottom: "1px solid #b4b4b4",
backgroundColor: "white",
font: "14px",
textColor: "text-disabled"
};
}
},
/*
---------------------------------------------------------------------------
CONTAINER
---------------------------------------------------------------------------
*/
"root" : {},
"composite" : {},
"scroll" : {},
"layer" : {},
"html" : {},
"spacer" : {},
"view" : {
style : function() {
var style = {
backgroundColor: "#CBD2D8",
backgroundImage: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAABCAIAAACdaSOZAAAAFElEQVQI12M4euYKErp0+tINIAIAuHQQ4hrnkJoAAAAASUVORK5CYII=')"
};
return style;
}
},
"viewmanager" : {
include : "composite",
style : function() {
return {
properties : {
animationDuration : 350
}
};
}
},
"tabbedviewmanager" : {
include: "viewmanager"
},
"bar":{},
"tabbedviewmanager/tabbar":{
include:"bar"
},
"overlay" : {
style : function() {
return {
properties : {
relativeArrowPosition: "center"
}
};
}
},
"overlay/arrow" : {
style : function() {
var size=38;
return {
width:size,
height:Math.floor(size/2),
overflow: "hidden",
properties : {
direction:"top",
arrowStyle: {
width: size+"px",
height: size+"px",
backgroundColor: "#333",
transform: "rotate(45deg) scale(0.73)"
}
}
};
}
},
"overlay/container" : {
style : function() {
var style = {
backgroundColor: "white",
borderTop: "5px solid #333",
borderRight: "5px solid #333",
borderLeft: "5px solid #333",
borderBottom: "5px solid #333",
borderRadius: "5px"
};
return style;
}
},
/*
---------------------------------------------------------------------------
ACTIVITY INDICATOR
---------------------------------------------------------------------------
*/
"activityindicator" : {
style : function() {
var size = 144;
return {
marginLeft: -Math.round(size/2),
width: size,
marginTop: -Math.round(size/2),
height: size,
backgroundColor: "rgba(0,0,0,0.5)",
borderWidth: "1px",
borderColor: "#000",
borderStyle: "solid",
pointerEvents: "none",
paddingTop: 30,
zIndex: 100000 //make sure indicator is on top of everything
};
}
},
"activityindicator/image" : {
style : function() {
var url = "unify/iphoneos/loader.png";
var ResourceManager = qx.util.ResourceManager.getInstance();
return {
width: ResourceManager.getImageWidth(url),
height: ResourceManager.getImageHeight(url),
properties : {
source: url
}
};
}
},
"activityindicator/label" : {
style : function() {
return {
color: "white",
marginTop: 25
};
}
},
/*
---------------------------------------------------------------------------
BARS
---------------------------------------------------------------------------
*/
"navigationbar" : {
style : function() {
return {
background: "url(" + qx.util.ResourceManager.getInstance().toUri("unify/iphoneos/navigation-bar/black/navigationbar.png") + ")"
};
}
},
"navigationbar.title" : {
style : function() {
return {
font: "20px bold",
color: "white",
textShadow: "rgba(0, 0, 0, 0.4) 0px -1px 0",
textOverflow: "ellipsis",
overflow: "hidden",
whiteSpace: "nowrap"
};
}
},
"navigationbar/master" : {
include : "button"
},
"navigationbar/master/label" : {
include : "button/label"
},
"navigationbar/parent" : {
include : "button"
},
"navigationbar/parent/label" : {
include : "button/label"
},
"tabbar" : {
style : function() {
var gradient = unify.bom.Gradient.createGradient({
angle: "to bottom",
colorStops : [{
position: 0,
color: "#434343"
}, {
position: 0.02,
color: "#2e2e2e"
}, {
position: 0.5,
color: "#151515"
}, {
position: 0.5,
color: "#000"
}, {
position: 1,
color: "#000"
}]
});
return {
background: gradient,
borderTop: "1px solid black"
};
}
},
"tabbar.button" : {
style : function(state) {
var style = {
font: "10px bold",
borderRadius: "3px",
marginTop: "1px",
marginLeft: "2px",
marginRight: "2px"
};
if (state.active) {
style.color = "white";
style.background = unify.bom.Gradient.createGradient({
angle: "to bottom",
colorStops : [{
position: 0,
color: "#494949"
}, {
position: 0.5,
color: "#353535"
}, {
position: 0.5,
color: "#252525"
}, {
position: 1,
color: "#252525"
}]
});
} else {
style.color = "#9a9a9a";
style.background = "transparent";
}
return style;
}
},
"tabbar.button/label" : {
style : function(state) {
return {
font: "14px normal",
textAlign: "center"
};
}
},
"toolbar" : {
include : "navigationbar"
},
"toolbar.segmented.container" : {
style : function() {
return {
//"WebkitBorderImage" : "url(" + qx.util.ResourceManager.getInstance().toUri("unify/iphoneos/tool-bar/black/segmented-all.png") + ") 0 5 120 5"
};
}
},
"toolbar.segmented.button" : {
style : function(state) {
var e = {
color: "gray",
textShadow: "rgba(0, 0, 0, 0.5) 0px -1px 0",
backgroundImage: unify.bom.Gradient.createGradient({
angle: "to bottom",
colorStops : [{
position: 0,
color: "#464646"
}, {
position: 0.5,
color: "#1a1a1a"
}, {
position: 0.5,
color: "#000"
}, {
position: 1,
color: "#000"
}]
}),
height: "30px",
borderTop: "1px solid #2b2b2b",
borderBottom: "1px solid #323232",
borderLeft: "1px solid #181818",
padding: "5px 12px",
font: "12px bold"
};
e.borderRadius = (state.first?"5px ":"0px ") + (state.last?"5px ":"0px ") + (state.last?"5px ":"0px ") + (state.first?"5px ":"0px ");
if (state.last) {
e.borderRight = "1px solid #181818";
}
if (state.active) {
e.color = "white";
e.backgroundImage = unify.bom.Gradient.createGradient({
angle: "to bottom",
colorStops : [{
position: 0,
color: "#737373"
}, {
position: 0.5,
color: "#474747"
}, {
position: 0.5,
color: "#303030"
}, {
position: 1,
color: "#313131"
}]
});
}
return e;
}
},
/*
---------------------------------------------------------------------------
LIST
---------------------------------------------------------------------------
*/
"list" : {
style : function() {
return {
marginLeft: "10px",
marginTop: "10px",
marginRight: "10px",
marginBottom: "10px"
};
}
},
"list.content" : {
style : function() {
return {
backgroundColor: "white",
borderRadius: "8px",
marginTop: "15px",
marginBottom: "17px",
padding: "10px"
};
}
},
"list.header" : {
style : function() {
return {
font: "17px bold",
color: "#4D576B",
textShadow: "white 0 1px 1px"
};
}
},
"list.description" : {
include : "label",
style : function() {
return {
font: "17px bold",
marginRight: "5px"
};
}
},
"list.value" : {
include : "label",
style : function() {
return {
font: "17px"
};
}
},
/*
---------------------------------------------------------------------------
ELEMENTS
---------------------------------------------------------------------------
*/
"label" : {
style : function(state) {
var e = {
overflow: "hidden"
};
if ((!state.wrap) && state.ellipsis) {
e.textOverflow = "ellipsis";
e.whiteSpace = "nowrap";
}
return e;
}
},
"image" : {},
"input" : {
style : function() {
return {
borderRadius : "4px",
borderLeft : "1px solid #3a3a3a",
borderTop : "1px solid #3a3a3a",
borderRight : "1px solid #3a3a3a",
borderBottom : "1px solid #888",
backgroundColor : "#e8e8e8",
resize: "none",
userSelect: "auto"
};
}
},
"input.file" : {},
"input.file/filename" : {
include : "button"
},
"input.file/filename/label" : {
include : "button/label"
},
"input.file/fileinput" : {
style : function() {
return {
opacity: 0
};
}
},
"button" : {
style : function(state) {
var e = {
color: "white",
backgroundImage: unify.bom.Gradient.createGradient({
angle: "to bottom",
colorStops : [{
position: 0,
color: "rgba(255, 255, 255, 0.61)"
}, {
position: 0.05,
color: "rgba(255, 255, 255, 0.45)"
}, {
position: 0.5,
color: "rgba(255, 255, 255, 0.27)"
}, {
position: 0.5,
color: "rgba(255, 255, 255, 0.2)"
}, {
position: 1,
color: "rgba(255, 255, 255, 0)"
}]
}),
borderLeft: "3px solid",
borderTop: "3px solid",
borderRight: "3px solid",
borderBottom: "3px solid",
borderColor: "#3a3a3a",
backgroundColor: "#242424",
borderRadius: "12px",
textAlign: "center"
};
if (state.active) {
e.backgroundColor = "#646464";
}
if (state.hover) {
e.borderColor = "#aaa";
}
return e;
}
},
"button/label" : {
style : function(state) {
return {
font: "20px bold",
textAlign: "center"
};
}
},
"slider" : {
style : function(state) {
if (state.horizontalDirection) {
var e = {
height: 30,
padding: "5 10",
borderRadius: "15px",
backgroundColor: "#242424"
};
} else if (state.verticalDirection) {
var e = {
width: 30,
padding: "10 5",
borderRadius: "15px",
backgroundColor: "#242424"
};
}
return e;
}
},
"slider/bar" : {
style : function(state) {
return {
margin: "5",
backgroundColor: "#999",
borderRadius: "14px"
};
}
},
"slider/knob" : {
style : function(state) {
return {
height: "20px",
width: "20px",
borderRadius: "10px",
backgroundColor: "#ddd"
};
}
},
"combobox" : {
style : function() {
return {
height: "30px",
backgroundColor: "white",
properties : {
image : qx.util.ResourceManager.getInstance().toUri("unify/noun/down.png")
}
};
}
},
"combobox/image" : {
style : function() {
var ResourceManager = qx.util.ResourceManager.getInstance();
return {
width: ResourceManager.getImageWidth("unify/noun/down.png"),
height: ResourceManager.getImageHeight("unify/noun/down.png"),
margin: "5",
properties : {
allowGrowX: false,
allowGrowY: false
}
};
}
},
"combobox/label" : {
style : function() {
return {
lineHeight: 1.0,
marginLeft: "5px",
properties : {
allowGrowY: false
}
};
}
},
"combobox/button" : {
style : function() {
return {
width: "40px"
};
}
},
"combobox/button/label" : {
style : function() {
return {
};
}
},
"combobox/overlay" : {
include : "overlay",
style : function() {
return {
properties : {
hasArrow: false
}
};
}
},
"combobox/overlay/container" : {
include: "overlay/container",
style : function() {
return {
borderLeft: "0",
borderRight: "0",
borderTop: "0",
borderBottom: "0",
backgroundColor: "white",
borderRadius: 0
};
}
},
"checkbox" : {
style : function(states) {
var ResourceManager = qx.util.ResourceManager.getInstance();
var style = {
height: "30px",
cursor: "pointer",
properties : {
image : ResourceManager.toUri("unify/checkbox.png")
}
};
if (states.checked) {
style.properties.image = ResourceManager.toUri("unify/checkbox_checked.png");
}
return style;
}
},
"checkbox/image" : {
style : function(states) {
var ResourceManager = qx.util.ResourceManager.getInstance();
return {
width: ResourceManager.getImageWidth("unify/checkbox.png"),
height: ResourceManager.getImageHeight("unify/checkbox.png"),
marginTop: Math.floor((30-ResourceManager.getImageHeight("unify/checkbox.png"))/2) + "px",
properties : {
allowGrowX: false,
allowGrowY: false
}
};
}
},
"checkbox/label" : {
style : function(states) {
var ResourceManager = qx.util.ResourceManager.getInstance();
return {
lineHeight: 1.0,
marginLeft: "5px",
marginRight: "5px",
properties : {
allowGrowX: true,
allowShrinkX: true,
allowGrowY: false,
allowShrinkY: false
}
};
}
},
/*
---------------------------------------------------------------------------
DIALOGS
---------------------------------------------------------------------------
*/
"alert" : {
style : function() {
return {
borderLeft: "3px solid #3A3A3A",
borderTop: "3px solid #3A3A3A",
borderRight: "3px solid #3A3A3A",
borderBottom: "3px solid #3A3A3A",
backgroundColor: "#242424",
borderRadius: "12px",
textAlign: "center"
};
}
},
"alert.label" : {
style : function() {
return {
font: "20px bold",
color: "white"
};
}
},
"alert.button" : {
include : "button",
style : function() {
return {
marginBottom: "5px"
};
}
},
"dialog" : {
style : function() {
return {
borderRadius: "3px",
whiteSpace: "normal",
backgroundColor: "white",
width: "500px",
height: "400px",
marginLeft: "-250px",
marginTop: "-200px"
};
}
},
"dialog.overlay" : {
style : function() {
return {
backgroundColor: "white",
marginTop : -200,
marginLeft : -250,
properties : {
hasArrow: false,
staticPosition : {
left: "50%",
top: "50%"
}
}
};
}
},
"dialog.overlay/container" : {},
"dialog/X" : {
style : function(states) {
return {
height: "24px",
width: "24px",
margin: "3px 3px 0px 0px",
cursor: "pointer",
backgroundImage: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACmAAAApgBNtNH3wAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIcSURBVEiJ7ZTPbhJRFMbPucM4I+nCPwQ6DFSkRJ7AhenKJ9DUdKBQZhgWXfgSk/sQJsYNaUkbS40v4WsUhmkLU0RqhcbCjHOvG5u4cCba2MSYfslZndzfl++eey5yzuE6Ra6VfmPw7xvUarWiaeqrYX3T1FcNo/woioFhz7Rer6/cT97bW1iIJ4fusK0sZnTLshgAAKWUuCfH2+m0ok0mk9H407jcbLY+/IoTC3OezWansnTrbvx2XMw9zFUcxyGU0g0AgMGwv7NcyGsECfF9/858fjH64wQAAJsvN7fyuQc1SZKQMca73e5bACCFwvKaIMSI53n8oNNpvX71xghjhCYAAFBTqtlzDklhOV+VZRmLxWKZIOFCTCDz+Zx3bXtHSapmFCNyyJZlMSWZNuyevRsEjEuShJIsEcYYP+h0d1MJxbicy5USXIpzLkynUzg/nwIiAuccGAt+62xkAkopcT/2t9W0WorFBEQkHBGZKIqYzWS0k9GgRSmNZIQ2ERH7w34zm8lURFFEAOBHR4f7Ts95HwSciaKIS9mldXd4vHUlA71Rfq4qqXVCCPq+z23b3huPziqn4y9lu2e/8zyPIQImEok1w6g8CeOE3qP/DUcXs9lXAIgPXHf/83iit9vtAABA07SKzWyuLCrPfN8/AxDl0Aic89CqGtUVo7HxAn7sy88FAFiqlh7rDf1pFCNy0f6G/vPv+sYAAOA7kmcSD+k0/0kAAAAASUVORK5CYII=')",
backgroundPosition: "0px 0px",
backgroundRepeat: "no-repeat",
textIndent: "50000px",
properties : {
allowGrowX: false,
alignX: "right"
}
}
}
},
"dialog/X/label" : {},
"dialog/buttons" : {
style : function(states) {
return {
font: "19px",
fontFamily: "Arial",
color: "#4B4B4B",
textAlign: "center",
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
height: "70px",
padding: "15px 15px 13px 15px",
cursor: "pointer",
borderTopWidth: "1px",
borderTopStyle: "solid",
borderTopColor: "#D0D0D0",
borderBottomLeftRadius: "3px",
borderBottomRightRadius: "3px"
}
}
},
"dialog.button" : "button",
"dialog/title" : {
style : function(states) {
return {
textAlign: "center",
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
padding: "0px 15px 0px 15px",
borderBottomWidth: "1px",
borderBottomStyle: "solid",
borderBottomColor: "#A4A4A4"
}
}
},
"dialog/content" : {
style : function() {
return {
backgroundColor: "white",
padding: "10px",
overflow: "hidden"
};
}
},
/*
---------------------------------------------------------------------------
Scroll
---------------------------------------------------------------------------
*/
"scroll/content":{},
"scroll/indicatorX":{},
"scroll/indicatorY":{},
"scroll/wrapper":{},
"scroll/topNotification":{},
"scroll/topNotification/label":{
include:"label"
},
"scroll/topNotification/iconcontainer":{},
"scroll/topNotification/pullicon":{
//TODO: add default icons
},
"scroll/topNotification/activityicon":{
//TODO: add default icons
},
"scroll/bottomNotification":{},
"scroll/bottomNotification/label":{
include:"label"
},
"scroll/bottomNotification/iconcontainer":{},
"scroll/bottomNotification/pullicon":{
//TODO: add default icons
},
"scroll/bottomNotification/activityicon":{
//TODO: add default icons
}
}
});
|
# flake8: noqa
from cereal import car
from selfdrive.car import dbc_dict
from selfdrive.config import Conversions as CV
Ecu = car.CarParams.Ecu
MIN_ACC_SPEED = 19. * CV.MPH_TO_MS
PEDAL_HYST_GAP = 3. * CV.MPH_TO_MS
class CarControllerParams:
ACCEL_HYST_GAP = 0.02 # don't change accel command for small oscilalitons within this value
ACCEL_MAX = 1.5 # m/s2
ACCEL_MIN = -3.0 # m/s2
ACCEL_SCALE = max(ACCEL_MAX, -ACCEL_MIN)
STEER_MAX = 1500
STEER_DELTA_UP = 10 # 1.5s time to peak torque
STEER_DELTA_DOWN = 25 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor
# Car button codes
class CruiseButtons:
ACCEL_ACC = 9
DECEL_ACC = 10
SET_ACC = 8
ACCEL_CC = 6
DECEL_CC = 5
SET_CC = 1
CANCEL = 0
class CAR:
PRIUS = "TOYOTA PRIUS 2017"
PRIUS_TSS2 = "TOYOTA PRIUS TSS2 2021"
RAV4H = "TOYOTA RAV4 HYBRID 2017"
RAV4 = "TOYOTA RAV4 2017"
COROLLA = "TOYOTA COROLLA 2017"
LEXUS_RX = "LEXUS RX 2016"
LEXUS_RXH = "LEXUS RX HYBRID 2017"
LEXUS_RX_TSS2 = "LEXUS RX 2020"
LEXUS_RXH_TSS2 = "LEXUS RX HYBRID 2020"
CHR = "TOYOTA C-HR 2018"
CHRH = "TOYOTA C-HR HYBRID 2018"
CAMRY = "TOYOTA CAMRY 2018"
CAMRYH = "TOYOTA CAMRY HYBRID 2018"
CAMRY_TSS2 = "TOYOTA CAMRY 2021" # TSS 2.5
CAMRYH_TSS2 = "TOYOTA CAMRY HYBRID 2021"
HIGHLANDER = "TOYOTA HIGHLANDER 2017"
HIGHLANDER_TSS2 = "TOYOTA HIGHLANDER 2020"
HIGHLANDERH = "TOYOTA HIGHLANDER HYBRID 2018"
HIGHLANDERH_TSS2 = "TOYOTA HIGHLANDER HYBRID 2020"
AVALON = "TOYOTA AVALON 2016"
AVALON_2019 = "TOYOTA AVALON 2019"
AVALONH_2019 = "TOYOTA AVALON HYBRID 2019"
RAV4_TSS2 = "TOYOTA RAV4 2019"
COROLLA_TSS2 = "TOYOTA COROLLA TSS2 2019"
# LSS2 Lexus UX Hybrid is same as a TSS2 Corolla Hybrid
COROLLAH_TSS2 = "TOYOTA COROLLA HYBRID TSS2 2019"
LEXUS_ES_TSS2 = "LEXUS ES 2019"
LEXUS_ESH_TSS2 = "LEXUS ES HYBRID 2019"
LEXUS_ESH = "LEXUS ES HYBRID 2018"
SIENNA = "TOYOTA SIENNA 2018"
LEXUS_IS = "LEXUS IS 2018"
LEXUS_CTH = "LEXUS CT HYBRID 2018"
RAV4H_TSS2 = "TOYOTA RAV4 HYBRID 2019"
LEXUS_NXH = "LEXUS NX HYBRID 2018"
LEXUS_NX = "LEXUS NX 2018"
LEXUS_NX_TSS2 = "LEXUS NX 2020"
MIRAI = "TOYOTA MIRAI 2021" # TSS 2.5
ALPHARD_TSS2 = "TOYOTA ALPHARD 2020"
# (addr, cars, bus, 1/freq*100, vl)
STATIC_DSU_MSGS = [
(0x128, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.AVALON), 1, 3, b'\xf4\x01\x90\x83\x00\x37'),
(0x128, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH), 1, 3, b'\x03\x00\x20\x00\x00\x52'),
(0x141, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX), 1, 2, b'\x00\x00\x00\x46'),
(0x160, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX), 1, 7, b'\x00\x00\x08\x12\x01\x31\x9c\x51'),
(0x161, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.AVALON, CAR.LEXUS_RX), 1, 7, b'\x00\x1e\x00\x00\x00\x80\x07'),
(0X161, (CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH), 1, 7, b'\x00\x1e\x00\xd4\x00\x00\x5b'),
(0x283, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX), 0, 3, b'\x00\x00\x00\x00\x00\x00\x8c'),
(0x2E6, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, b'\xff\xf8\x00\x08\x7f\xe0\x00\x4e'),
(0x2E7, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, b'\xa8\x9c\x31\x9c\x00\x00\x00\x02'),
(0x33E, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 20, b'\x0f\xff\x26\x40\x00\x1f\x00'),
(0x344, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX), 0, 5, b'\x00\x00\x01\x00\x00\x00\x00\x50'),
(0x365, (CAR.PRIUS, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.HIGHLANDERH), 0, 20, b'\x00\x00\x00\x80\x03\x00\x08'),
(0x365, (CAR.RAV4, CAR.RAV4H, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX), 0, 20, b'\x00\x00\x00\x80\xfc\x00\x08'),
(0x366, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.HIGHLANDERH), 0, 20, b'\x00\x00\x4d\x82\x40\x02\x00'),
(0x366, (CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX), 0, 20, b'\x00\x72\x07\xff\x09\xfe\x00'),
(0x470, (CAR.PRIUS, CAR.LEXUS_RXH), 1, 100, b'\x00\x00\x02\x7a'),
(0x470, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.RAV4H, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH), 1, 100, b'\x00\x00\x01\x79'),
(0x4CB, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX), 0, 100, b'\x0c\x00\x00\x00\x00\x00\x00\x00'),
]
FINGERPRINTS = {
CAR.RAV4: [{
36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 512: 6, 513: 6, 547: 8, 548: 8, 552: 4, 562: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 4, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1008: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1596: 8, 1597: 8, 1600: 8, 1656: 8, 1664: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8, 2015: 8, 2024: 8
}],
CAR.RAV4H: [{
36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 296: 8, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 547: 8, 548: 8, 550: 8, 552: 4, 560: 7, 562: 4, 581: 5, 608: 8, 610: 5, 643: 7, 705: 8, 713: 8, 725: 2, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1008: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1212: 8, 1227: 8, 1228: 8, 1232: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1596: 8, 1597: 8, 1600: 8, 1656: 8, 1664: 8, 1728: 8, 1745: 8, 1779: 8, 1872: 8, 1880: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
# Chinese RAV4
{
36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 355: 5, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 512: 6, 513: 6, 547: 8, 548: 8, 552: 4, 562: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 742: 8, 743: 8, 767: 4, 800: 8, 830: 7, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 921: 8, 922: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1008: 2, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1207: 8, 1227: 8, 1235: 8, 1263: 8, 1279: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1596: 8, 1597: 8, 1600: 8, 1664: 8, 1728: 8, 1745: 8, 1779: 8
}],
CAR.PRIUS: [{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 512: 6, 513: 6, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 614: 8, 643: 7, 658: 8, 713: 8, 740: 5, 742: 8, 743: 8, 767: 4, 800: 8, 810: 2, 814: 8, 824: 2, 829: 2, 830: 7, 835: 8, 836: 8, 845: 5, 863: 8, 869: 7, 870: 7, 871: 2, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 974: 8, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1082: 8, 1083: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1175: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1595: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
#2019 LE
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 614: 8, 643: 7, 658: 8, 713: 8, 740: 5, 742: 8, 743: 8, 767: 4, 800: 8, 810: 2, 814: 8, 829: 2, 830: 7, 835: 8, 836: 8, 863: 8, 865: 8, 869: 7, 870: 7, 871: 2, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1082: 8, 1083: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1175: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1279: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1595: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
# 2020 Prius Prime LE
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 740: 5, 742: 8, 743: 8, 764: 8, 767: 4, 800: 8, 810: 2, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 863: 8, 865: 8, 869: 7, 870: 7, 871: 2, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 974: 8, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1227: 8, 1235: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1595: 8, 1649: 8, 1777: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
#2020 Prius Prime Limited
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 614: 8, 643: 7, 658: 8, 713: 8, 740: 5, 742: 8, 743: 8, 767: 4, 800: 8, 810: 2, 814: 8, 824: 2, 829: 2, 830: 7, 835: 8, 836: 8, 863: 8, 865: 8, 869: 7, 870: 7, 871: 2, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 974: 8, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1082: 8, 1083: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1175: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1595: 8, 1649: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8, 2015: 8, 2024: 8, 2026: 8, 2027: 8, 2029: 8, 2030: 8, 2031: 8
},
#2020 Central Europe Prime
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 740: 5, 742: 8, 743: 8, 764: 8, 767: 4, 800: 8, 810: 2, 818: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 845: 5, 863: 8, 865: 8, 869: 7, 870: 7, 871: 2, 889: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 8, 974: 8, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1227: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1595: 8, 1777: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8
},
#2017 German Prius
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 614: 8, 643: 7, 658: 8, 713: 8, 740: 5, 742: 8, 743: 8, 767: 4, 800: 8, 810: 2, 814: 8, 829: 2, 830: 7, 835: 8, 836: 8, 845: 5, 863: 8, 869: 7, 870: 7, 871: 2, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1077: 8, 1082: 8, 1083: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1175: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1595: 8, 1777: 8, 1779: 8, 1792: 8, 1767: 4, 1863: 8, 1904: 8, 1912: 8, 1984: 8, 1988: 8, 1990: 8, 1992: 8, 1996: 8, 1998: 8, 2002: 8, 2010: 8, 2015: 8, 2016: 8, 2018: 8, 2024: 8, 2026: 8, 2030: 8
}],
#Corolla w/ added Pedal Support (512L and 513L)
CAR.COROLLA: [{
36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 512: 6, 513: 6, 547: 8, 548: 8, 552: 4, 608: 8, 610: 5, 643: 7, 705: 8, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 2, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 4, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1196: 8, 1227: 8, 1235: 8, 1279: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1596: 8, 1597: 8, 1600: 8, 1664: 8, 1728: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8, 2016: 8, 2017: 8, 2018: 8, 2019: 8, 2020: 8, 2021: 8, 2022: 8, 2023: 8, 2024: 8
}],
CAR.CAMRY: [
#XLE and LE
{
36: 8, 37: 8, 119: 6, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 8, 643: 7, 658: 8, 705: 8, 728: 8, 740: 5, 761: 8, 764: 8, 767: 4, 800: 8, 810: 2, 812: 8, 814: 8, 818: 8, 822: 8, 824: 8, 830: 7, 835: 8, 836: 8, 869: 7, 870: 7, 871: 2, 888: 8, 889: 8, 891: 8, 898: 8, 900: 6, 902: 6, 905: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 976: 1, 983: 8, 984: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1011: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1228: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1412: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1595: 8, 1745: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1808: 8, 1816: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
#XSE and SE
# TODO: get proper fingerprint in stock mode
{
36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 8, 643: 7, 658: 8, 705: 8, 728: 8, 740: 5, 761: 8, 764: 8, 767: 4, 800: 8, 810: 2, 812: 8, 814: 8, 818: 8, 822: 8, 824: 8, 830: 7, 835: 8, 836: 8, 869: 7, 870: 7, 888: 8, 889: 8, 891: 8, 898: 8, 900: 6, 902: 6, 905: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 976: 1, 983: 8, 984: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1011: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1228: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1412: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1595: 8, 1745: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1808: 8, 1816: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
{
# 2019 XSE
36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 8, 643: 7, 658: 8, 705: 8, 728: 8, 740: 5, 761: 8, 764: 8, 767: 4, 800: 8, 810: 2, 812: 8, 814: 8, 818: 8, 822: 8, 824: 8, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 888: 8, 889: 8, 891: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 942: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 976: 1, 983: 8, 984: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1011: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1228: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1412: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1649: 8, 1745: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1792: 8, 1767: 4, 1808: 8, 1816: 8, 1872: 8, 1880: 8, 1904: 8, 1912: 8, 1937: 8, 1945: 8, 1953: 8, 1961: 8, 1968: 8, 1976: 8, 1990: 8, 1998: 8, 2015: 8, 2016: 8, 2024: 8
}],
CAR.CAMRYH: [
#SE, LE and LE with Blindspot Monitor
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 728: 8, 740: 5, 761: 8, 764: 8, 767: 4, 800: 8, 810: 2, 812: 8, 818: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 889: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 983: 8, 984: 8, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1011: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1649: 8, 1745: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1808: 8, 1810: 8, 1816: 8, 1818: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
#SL
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 728: 8, 740: 5, 761: 8, 764: 8, 767: 4, 800: 8, 810: 2, 812: 8, 818: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 869: 7, 870: 7, 871: 2, 888: 8, 889: 8, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1595: 8, 1745: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
#XLE
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 658: 8, 713: 8, 728: 8, 740: 5, 761: 8, 764: 8, 767: 4, 800: 8, 810: 2, 812: 8, 814: 8, 818: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 869: 7, 870: 7, 871: 2, 888: 8, 889: 8, 898: 8, 900: 6, 902: 6, 905: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 983: 8, 984: 8, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1011: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1082: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1595: 8, 1745: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
}],
CAR.HIGHLANDER: [{
36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 355: 5, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 545: 5, 550: 8, 552: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 921: 8, 922: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1008: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1207: 8, 1212: 8, 1227: 8, 1235: 8, 1237: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1779: 8, 1872: 8, 1880: 8, 1904: 8, 1912: 8, 1984: 8, 1988: 8, 1992: 8, 1996: 8, 1990: 8, 1998: 8
},
# 2019 Highlander XLE
{
36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 355: 5, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 545: 5, 550: 8, 552: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 921: 8, 922: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1008: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1207: 8, 1212: 8, 1227: 8, 1235: 8, 1237: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
# 2017 Highlander Limited
{
36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 355: 5, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 545: 5, 550: 8, 552: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 922: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1008: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1207: 8, 1212: 8, 1227: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
# 2018 Highlander Limited Platinum
{
36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 355: 5, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 545: 5, 550: 8, 552: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 922: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1008: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1207: 8, 1212: 8, 1227: 8, 1235: 8, 1237: 8, 1263: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1585: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1728: 8, 1745: 8, 1779: 8, 1872: 8, 1880: 8, 1904: 8, 1912: 8, 1988: 8, 1990: 8, 1996: 8, 1998: 8, 2015: 8, 2016: 8, 2024: 8
}],
CAR.HIGHLANDERH: [{
36: 8, 37: 8, 170: 8, 180: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 581: 5, 608: 8, 610: 5, 643: 7, 713: 8, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1112: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1212: 8, 1227: 8, 1232: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1552: 8, 1553: 8, 1554: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
{
# 2019 Highlander Hybrid Limited Platinum
36: 8, 37: 8, 170: 8, 180: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 581: 5, 608: 8, 610: 5, 643: 7, 713: 8, 740: 5, 767: 4, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1076: 8, 1077: 8, 1112: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1212: 8, 1227: 8, 1232: 8, 1235: 8, 1237: 8, 1263: 8, 1279: 8, 1552: 8, 1553: 8, 1554: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
}],
CAR.COROLLAH_TSS2: [
# 2019 Taiwan Altis Hybrid
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 401: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 765: 8, 767: 4, 800: 8, 810: 2, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 885: 8, 896: 8, 898: 8, 918: 7, 921: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 987: 8, 993: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1082: 8, 1112: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1172: 8, 1235: 8, 1237: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1745: 8, 1775: 8, 1779: 8
},
# 2019 Chinese Levin Hybrid
{
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 401: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 765: 8, 767: 4, 800: 8, 810: 2, 812: 8, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 885: 8, 896: 8, 898: 8, 921: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 993: 8, 1002: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1172: 8, 1235: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1600: 8, 1649: 8, 1745: 8, 1775: 8, 1779: 8
}
],
CAR.SIENNA: [
{
36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 545: 5, 548: 8, 550: 8, 552: 4, 562: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 764: 8, 767: 4, 800: 8, 824: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 888: 8, 896: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 1, 918: 7, 921: 8, 933: 8, 944: 6, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1008: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1114: 8, 1160: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1200: 8, 1201: 8, 1202: 8, 1203: 8, 1212: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1279: 8, 1552: 8, 1553: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1656: 8, 1664: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
},
# XLE AWD 2018
{
36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 545: 5, 548: 8, 550: 8, 552: 4, 562: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 764: 8, 767: 4, 800: 8, 824: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 1, 921: 8, 933: 8, 944: 6, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1008: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1114: 8, 1160: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1200: 8, 1201: 8, 1202: 8, 1203: 8, 1212: 8, 1227: 8, 1235: 8, 1237: 8, 1279: 8, 1552: 8, 1553: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1656: 8, 1664: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
}],
}
FW_VERSIONS = {
CAR.AVALON: {
(Ecu.esp, 0x7b0, None): [
b'F152607060\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881510701300\x00\x00\x00\x00',
b'881510705100\x00\x00\x00\x00',
b'881510705200\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B41051\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\x0230721100\x00\x00\x00\x00\x00\x00\x00\x00A0C01000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230721200\x00\x00\x00\x00\x00\x00\x00\x00A0C01000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702000\x00\x00\x00\x00',
b'8821F4702100\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0701100\x00\x00\x00\x00',
b'8646F0703000\x00\x00\x00\x00',
],
},
CAR.AVALON_2019: {
(Ecu.esp, 0x7b0, None): [
b'F152607140\x00\x00\x00\x00\x00\x00',
b'F152607171\x00\x00\x00\x00\x00\x00',
b'F152607110\x00\x00\x00\x00\x00\x00',
b'F152607180\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881510703200\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B41080\x00\x00\x00\x00\x00\x00',
b'8965B07010\x00\x00\x00\x00\x00\x00',
b'8965B41090\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x700, None): [
b'\x01896630735100\x00\x00\x00\x00',
b'\x01896630725300\x00\x00\x00\x00',
b'\x01896630738000\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0702100\x00\x00\x00\x00',
],
},
CAR.AVALONH_2019: {
(Ecu.esp, 0x7b0, None): [
b'F152641040\x00\x00\x00\x00\x00\x00',
b'F152641061\x00\x00\x00\x00\x00\x00',
b'F152641050\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881510704200\x00\x00\x00\x00',
b'881514107100\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B07010\x00\x00\x00\x00\x00\x00',
b'8965B41090\x00\x00\x00\x00\x00\x00',
b'8965B41070\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x700, None): [
b'\x02896630724000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x02896630737000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00',
b'\x02896630728000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0702100\x00\x00\x00\x00',
],
},
CAR.CAMRY: {
(Ecu.engine, 0x700, None): [
b'\x018966306L3100\x00\x00\x00\x00',
b'\x018966306L4200\x00\x00\x00\x00',
b'\x018966306L5200\x00\x00\x00\x00',
b'\x018966306P8000\x00\x00\x00\x00',
b'\x018966306Q3100\x00\x00\x00\x00',
b'\x018966306Q4000\x00\x00\x00\x00',
b'\x018966306Q4100\x00\x00\x00\x00',
b'\x018966306Q4200\x00\x00\x00\x00',
b'\x018966333Q9200\x00\x00\x00\x00',
b'\x018966333P3100\x00\x00\x00\x00',
b'\x018966333P3200\x00\x00\x00\x00',
b'\x018966333P4200\x00\x00\x00\x00',
b'\x018966333P4300\x00\x00\x00\x00',
b'\x018966333P4400\x00\x00\x00\x00',
b'\x018966333P4500\x00\x00\x00\x00',
b'\x018966333P4700\x00\x00\x00\x00',
b'\x018966333Q6000\x00\x00\x00\x00',
b'\x018966333Q6200\x00\x00\x00\x00',
b'\x018966333Q6300\x00\x00\x00\x00',
b'\x018966333W6000\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\x02333P1100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'8821F0601200 ',
b'8821F0601300 ',
b'8821F0602000 ',
b'8821F0603300 ',
b'8821F0604100 ',
b'8821F0605200 ',
b'8821F0607200 ',
b'8821F0608000 ',
b'8821F0608200 ',
b'8821F0609100 ',
],
(Ecu.esp, 0x7b0, None): [
b'F152606210\x00\x00\x00\x00\x00\x00',
b'F152606230\x00\x00\x00\x00\x00\x00',
b'F152606270\x00\x00\x00\x00\x00\x00',
b'F152606290\x00\x00\x00\x00\x00\x00',
b'F152606410\x00\x00\x00\x00\x00\x00',
b'F152633540\x00\x00\x00\x00\x00\x00',
b'F152633A10\x00\x00\x00\x00\x00\x00',
b'F152633A20\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B33540\x00\x00\x00\x00\x00\x00',
b'8965B33542\x00\x00\x00\x00\x00\x00',
b'8965B33580\x00\x00\x00\x00\x00\x00',
b'8965B33581\x00\x00\x00\x00\x00\x00',
b'8965B33621\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [ # Same as 0x791
b'8821F0601200 ',
b'8821F0601300 ',
b'8821F0602000 ',
b'8821F0603300 ',
b'8821F0604100 ',
b'8821F0605200 ',
b'8821F0607200 ',
b'8821F0608000 ',
b'8821F0608200 ',
b'8821F0609100 ',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0601200 ',
b'8646F0601300 ',
b'8646F0601400 ',
b'8646F0603400 ',
b'8646F0604100 ',
b'8646F0605000 ',
b'8646F0606000 ',
b'8646F0606100 ',
b'8646F0607100 ',
],
},
CAR.CAMRYH: {
(Ecu.engine, 0x700, None): [
b'\x018966306Q6000\x00\x00\x00\x00',
b'\x018966333N1100\x00\x00\x00\x00',
b'\x018966333N4300\x00\x00\x00\x00',
b'\x018966333X0000\x00\x00\x00\x00',
b'\x018966333X4000\x00\x00\x00\x00',
b'\x01896633T16000\x00\x00\x00\x00',
b'\x028966306B2100\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966306B2300\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966306N8100\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966306N8200\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966306N8300\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966306N8400\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966306R5000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966306R5000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00',
b'\x028966306R6000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966306R6000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00',
b'\x028966306S0000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00',
b'\x028966306S0100\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00',
b'\x028966306S1100\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152633214\x00\x00\x00\x00\x00\x00',
b'F152633660\x00\x00\x00\x00\x00\x00',
b'F152633712\x00\x00\x00\x00\x00\x00',
b'F152633713\x00\x00\x00\x00\x00\x00',
b'F152633B51\x00\x00\x00\x00\x00\x00',
b'F152633B60\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'8821F0601200 ',
b'8821F0601300 ',
b'8821F0603400 ',
b'8821F0604000 ',
b'8821F0604200 ',
b'8821F0605200 ',
b'8821F0606200 ',
b'8821F0607200 ',
b'8821F0608000 ',
b'8821F0608200 ',
b'8821F0609000 ',
b'8821F0609100 ',
],
(Ecu.eps, 0x7a1, None): [
b'8965B33540\x00\x00\x00\x00\x00\x00',
b'8965B33542\x00\x00\x00\x00\x00\x00',
b'8965B33550\x00\x00\x00\x00\x00\x00',
b'8965B33551\x00\x00\x00\x00\x00\x00',
b'8965B33580\x00\x00\x00\x00\x00\x00',
b'8965B33581\x00\x00\x00\x00\x00\x00',
b'8965B33611\x00\x00\x00\x00\x00\x00',
b'8965B33621\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [ # Same as 0x791
b'8821F0601200 ',
b'8821F0601300 ',
b'8821F0603400 ',
b'8821F0604000 ',
b'8821F0604200 ',
b'8821F0605200 ',
b'8821F0606200 ',
b'8821F0607200 ',
b'8821F0608000 ',
b'8821F0608200 ',
b'8821F0609000 ',
b'8821F0609100 ',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0601200 ',
b'8646F0601300 ',
b'8646F0601400 ',
b'8646F0603400 ',
b'8646F0603500 ',
b'8646F0604100 ',
b'8646F0605000 ',
b'8646F0606000 ',
b'8646F0606100 ',
b'8646F0607000 ',
b'8646F0607100 ',
],
},
CAR.CAMRY_TSS2: {
(Ecu.eps, 0x7a1, None): [
b'8965B33630\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'\x01F152606370\x00\x00\x00\x00\x00\x00',
b'\x01F152606390\x00\x00\x00\x00\x00\x00',
b'\x01F152606400\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x700, None): [
b'\x018966306Q5000\x00\x00\x00\x00',
b'\x018966306T3100\x00\x00\x00\x00',
b'\x018966306T3200\x00\x00\x00\x00',
b'\x018966306T4100\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 15): [
b'\x018821F6201200\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 109): [
b'\x028646F3305200\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',
b'\x028646F3305300\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',
],
},
CAR.CAMRYH_TSS2: {
(Ecu.eps, 0x7a1, None): [
b'8965B33630\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152633D00\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x700, None): [
b'\x018966306Q6000\x00\x00\x00\x00',
b'\x018966306Q7000\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 15): [
b'\x018821F6201200\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 109): [
b'\x028646F3305200\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',
b'\x028646F3305300\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',
],
},
CAR.CHR: {
(Ecu.engine, 0x700, None): [
b'\x01896631017100\x00\x00\x00\x00',
b'\x01896631017200\x00\x00\x00\x00',
b'\x0189663F413100\x00\x00\x00\x00',
b'\x0189663F414100\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'8821F0W01000 ',
b'8821F0W01100 ',
b'8821FF401600 ',
b'8821FF404000 ',
b'8821FF404100 ',
b'8821FF405100 ',
b'8821FF406000 ',
b'8821FF407100 ',
],
(Ecu.esp, 0x7b0, None): [
b'F152610020\x00\x00\x00\x00\x00\x00',
b'F152610153\x00\x00\x00\x00\x00\x00',
b'F152610210\x00\x00\x00\x00\x00\x00',
b'F1526F4034\x00\x00\x00\x00\x00\x00',
b'F1526F4044\x00\x00\x00\x00\x00\x00',
b'F1526F4073\x00\x00\x00\x00\x00\x00',
b'F1526F4121\x00\x00\x00\x00\x00\x00',
b'F1526F4122\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B10011\x00\x00\x00\x00\x00\x00',
b'8965B10040\x00\x00\x00\x00\x00\x00',
b'8965B10070\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\x0331024000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00',
b'\x0331024000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00',
b'\x0331036000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00',
b'\x033F401100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203102\x00\x00\x00\x00',
b'\x033F424000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F0W01000 ',
b'8821FF401600 ',
b'8821FF404000 ',
b'8821FF404100 ',
b'8821FF405100 ',
b'8821FF406000 ',
b'8821FF407100 ',
b'8821F0W01100 ',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646FF401800 ',
b'8646FF404000 ',
b'8646FF406000 ',
b'8646FF407000 ',
],
},
CAR.CHRH: {
(Ecu.engine, 0x700, None): [
b'\x02896631013200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x0289663F405000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x0289663F418000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x0289663F423000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x0289663F431000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x0189663F438000\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152610013\x00\x00\x00\x00\x00\x00',
b'F152610014\x00\x00\x00\x00\x00\x00',
b'F152610040\x00\x00\x00\x00\x00\x00',
b'F152610190\x00\x00\x00\x00\x00\x00',
b'F152610200\x00\x00\x00\x00\x00\x00',
b'F152610230\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'8821F0W01000 ',
b'8821FF402300 ',
b'8821FF402400 ',
b'8821FF404000 ',
b'8821FF406000 ',
b'8821FF407100 ',
],
(Ecu.eps, 0x7a1, None): [
b'8965B10011\x00\x00\x00\x00\x00\x00',
b'8965B10020\x00\x00\x00\x00\x00\x00',
b'8965B10040\x00\x00\x00\x00\x00\x00',
b'8965B10050\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F0W01000 ',
b'8821FF402300 ',
b'8821FF402400 ',
b'8821FF404000 ',
b'8821FF406000 ',
b'8821FF407100 ',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646FF402100 ',
b'8646FF404000 ',
b'8646FF406000 ',
b'8646FF407000 ',
],
},
CAR.COROLLA: {
(Ecu.engine, 0x7e0, None): [
b'\x0230ZC2000\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230ZC2100\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230ZC2200\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230ZC2300\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230ZC3000\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230ZC3100\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230ZC3200\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230ZC3300\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0330ZC1200\x00\x00\x00\x00\x00\x00\x00\x0050212000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881510201100\x00\x00\x00\x00',
b'881510201200\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152602190\x00\x00\x00\x00\x00\x00',
b'F152602191\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B02181\x00\x00\x00\x00\x00\x00',
b'8965B02191\x00\x00\x00\x00\x00\x00',
b'8965B48150\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702100\x00\x00\x00\x00',
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0201101\x00\x00\x00\x00',
b'8646F0201200\x00\x00\x00\x00',
],
},
CAR.COROLLA_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x01896630ZG2000\x00\x00\x00\x00',
b'\x01896630ZG5000\x00\x00\x00\x00',
b'\x01896630ZG5100\x00\x00\x00\x00',
b'\x01896630ZG5200\x00\x00\x00\x00',
b'\x01896630ZG5300\x00\x00\x00\x00',
b'\x01896630ZP2000\x00\x00\x00\x00',
b'\x01896630ZQ5000\x00\x00\x00\x00',
b'\x018966312L8000\x00\x00\x00\x00',
b'\x018966312M9000\x00\x00\x00\x00',
b'\x018966312P9000\x00\x00\x00\x00',
b'\x018966312P9100\x00\x00\x00\x00',
b'\x018966312P9200\x00\x00\x00\x00',
b'\x018966312Q2300\x00\x00\x00\x00',
b'\x018966312R0100\x00\x00\x00\x00',
b'\x018966312R1000\x00\x00\x00\x00',
b'\x018966312R1100\x00\x00\x00\x00',
b'\x018966312R3100\x00\x00\x00\x00',
b'\x018966312S5000\x00\x00\x00\x00',
b'\x018966312S7000\x00\x00\x00\x00',
b'\x018966312W3000\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\x0230ZN4000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x03312M3000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00',
b'\x03312N6000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00',
b'\x03312N6000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00',
b'\x03312N6000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00',
b'\x03312N6100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00',
b'\x03312N6100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'\x018965B12350\x00\x00\x00\x00\x00\x00',
b'\x018965B12470\x00\x00\x00\x00\x00\x00',
b'\x018965B12490\x00\x00\x00\x00\x00\x00',
b'\x018965B12500\x00\x00\x00\x00\x00\x00',
b'\x018965B12520\x00\x00\x00\x00\x00\x00',
b'\x018965B12530\x00\x00\x00\x00\x00\x00',
b'\x018965B1255000\x00\x00\x00\x00',
b'8965B12361\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'\x01F152602280\x00\x00\x00\x00\x00\x00',
b'\x01F152602560\x00\x00\x00\x00\x00\x00',
b'\x01F152602590\x00\x00\x00\x00\x00\x00',
b'\x01F152602650\x00\x00\x00\x00\x00\x00',
b'\x01F152612641\x00\x00\x00\x00\x00\x00',
b'\x01F152612651\x00\x00\x00\x00\x00\x00',
b'\x01F152612B10\x00\x00\x00\x00\x00\x00',
b'\x01F152612B51\x00\x00\x00\x00\x00\x00',
b'\x01F152612B60\x00\x00\x00\x00\x00\x00',
b'\x01F152612B61\x00\x00\x00\x00\x00\x00',
b'\x01F152612B90\x00\x00\x00\x00\x00\x00',
b'\x01F152612C00\x00\x00\x00\x00\x00\x00',
b'F152602191\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301100\x00\x00\x00\x00',
b'\x018821F3301200\x00\x00\x00\x00',
b'\x018821F3301300\x00\x00\x00\x00',
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F12010D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F1201100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F1201200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F1201300\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F1201400\x00\x00\x00\x008646G2601500\x00\x00\x00\x00',
b'\x028646F1202000\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F1202100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F1202200\x00\x00\x00\x008646G2601500\x00\x00\x00\x00',
],
},
CAR.COROLLAH_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x01896630ZJ1000\x00\x00\x00\x00',
b'\x01896630ZU8000\x00\x00\x00\x00',
b'\x01896637621000\x00\x00\x00\x00',
b'\x01896637624000\x00\x00\x00\x00',
b'\x01896637626000\x00\x00\x00\x00',
b'\x01896637648000\x00\x00\x00\x00',
b'\x02896630ZJ5000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896630ZN8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896630ZQ3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896630ZR2000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896630ZT8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896630ZT9000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x028966312Q3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x028966312Q4000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x038966312L7000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF1205001\x00\x00\x00\x00',
b'\x038966312N1000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B12361\x00\x00\x00\x00\x00\x00',
b'8965B12451\x00\x00\x00\x00\x00\x00',
b'8965B76012\x00\x00\x00\x00\x00\x00',
b'8965B76050\x00\x00\x00\x00\x00\x00',
b'\x018965B12350\x00\x00\x00\x00\x00\x00',
b'\x018965B12470\x00\x00\x00\x00\x00\x00',
b'\x018965B12490\x00\x00\x00\x00\x00\x00',
b'\x018965B12500\x00\x00\x00\x00\x00\x00',
b'\x018965B12520\x00\x00\x00\x00\x00\x00',
b'\x018965B12530\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152612590\x00\x00\x00\x00\x00\x00',
b'F152612691\x00\x00\x00\x00\x00\x00',
b'F152612692\x00\x00\x00\x00\x00\x00',
b'F152612700\x00\x00\x00\x00\x00\x00',
b'F152612710\x00\x00\x00\x00\x00\x00',
b'F152612790\x00\x00\x00\x00\x00\x00',
b'F152612800\x00\x00\x00\x00\x00\x00',
b'F152612820\x00\x00\x00\x00\x00\x00',
b'F152612840\x00\x00\x00\x00\x00\x00',
b'F152612A00\x00\x00\x00\x00\x00\x00',
b'F152612A10\x00\x00\x00\x00\x00\x00',
b'F152642540\x00\x00\x00\x00\x00\x00',
b'F152676293\x00\x00\x00\x00\x00\x00',
b'F152676303\x00\x00\x00\x00\x00\x00',
b'F152676304\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301100\x00\x00\x00\x00',
b'\x018821F3301200\x00\x00\x00\x00',
b'\x018821F3301300\x00\x00\x00\x00',
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F12010D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F1201100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F1201300\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F1201400\x00\x00\x00\x008646G2601500\x00\x00\x00\x00',
b'\x028646F1202000\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F1202100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F4203400\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F76020C0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F7603100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F7603200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
],
},
CAR.HIGHLANDER: {
(Ecu.engine, 0x700, None): [
b'\x01896630E09000\x00\x00\x00\x00',
b'\x01896630E43000\x00\x00\x00\x00',
b'\x01896630E43100\x00\x00\x00\x00',
b'\x01896630E43200\x00\x00\x00\x00',
b'\x01896630E44200\x00\x00\x00\x00',
b'\x01896630E45000\x00\x00\x00\x00',
b'\x01896630E45100\x00\x00\x00\x00',
b'\x01896630E45200\x00\x00\x00\x00',
b'\x01896630E46200\x00\x00\x00\x00',
b'\x01896630E74000\x00\x00\x00\x00',
b'\x01896630E75000\x00\x00\x00\x00',
b'\x01896630E76000\x00\x00\x00\x00',
b'\x01896630E77000\x00\x00\x00\x00',
b'\x01896630E83000\x00\x00\x00\x00',
b'\x01896630E84000\x00\x00\x00\x00',
b'\x01896630E85000\x00\x00\x00\x00',
b'\x01896630E86000\x00\x00\x00\x00',
b'\x01896630E88000\x00\x00\x00\x00',
b'\x01896630EA0000\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B48140\x00\x00\x00\x00\x00\x00',
b'8965B48150\x00\x00\x00\x00\x00\x00',
b'8965B48210\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [b'F15260E011\x00\x00\x00\x00\x00\x00'],
(Ecu.dsu, 0x791, None): [
b'881510E01100\x00\x00\x00\x00',
b'881510E01200\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702100\x00\x00\x00\x00',
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0E01200\x00\x00\x00\x00',
b'8646F0E01300\x00\x00\x00\x00',
],
},
CAR.HIGHLANDERH: {
(Ecu.eps, 0x7a1, None): [
b'8965B48160\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152648541\x00\x00\x00\x00\x00\x00',
b'F152648542\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\x0230E40000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230E40100\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230EA2000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0230EA2100\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702100\x00\x00\x00\x00',
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0E01200\x00\x00\x00\x00',
b'8646F0E01300\x00\x00\x00\x00',
],
},
CAR.HIGHLANDER_TSS2: {
(Ecu.eps, 0x7a1, None): [
b'8965B48241\x00\x00\x00\x00\x00\x00',
b'8965B48310\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'\x01F15260E051\x00\x00\x00\x00\x00\x00',
b'\x01F15260E110\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x700, None): [
b'\x01896630E62100\x00\x00\x00\x00',
b'\x01896630E62200\x00\x00\x00\x00',
b'\x01896630E64100\x00\x00\x00\x00',
b'\x01896630E64200\x00\x00\x00\x00',
b'\x01896630EB1000\x00\x00\x00\x00',
b'\x01896630EB1100\x00\x00\x00\x00',
b'\x01896630EB2000\x00\x00\x00\x00',
b'\x01896630EB2100\x00\x00\x00\x00',
b'\x01896630EB2200\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301400\x00\x00\x00\x00',
b'\x018821F6201200\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F0E02100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F4803000\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',
],
},
CAR.HIGHLANDERH_TSS2: {
(Ecu.eps, 0x7a1, None): [
b'8965B48241\x00\x00\x00\x00\x00\x00',
b'8965B48310\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'\x01F15264872300\x00\x00\x00\x00',
b'\x01F15264872400\x00\x00\x00\x00',
b'\x01F15264872500\x00\x00\x00\x00',
b'\x01F152648C6300\x00\x00\x00\x00',
],
(Ecu.engine, 0x700, None): [
b'\x01896630EA1000\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00',
b'\x02896630E66000\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00',
b'\x02896630EB3000\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00',
b'\x02896630EB3100\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301400\x00\x00\x00\x00',
b'\x018821F6201200\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F0E02100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F4803000\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',
],
},
CAR.LEXUS_IS: {
(Ecu.engine, 0x700, None): [
b'\x018966353M7100\x00\x00\x00\x00',
b'\x018966353Q2000\x00\x00\x00\x00',
b'\x018966353Q2300\x00\x00\x00\x00',
b'\x018966353R1100\x00\x00\x00\x00',
b'\x018966353R7100\x00\x00\x00\x00',
b'\x018966353R8100\x00\x00\x00\x00',
b'\x018966353Q4000\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\x0232480000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02353P7000\x00\x00\x00\x00\x00\x00\x00\x00530J5000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02353P9000\x00\x00\x00\x00\x00\x00\x00\x00553C1000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152653301\x00\x00\x00\x00\x00\x00',
b'F152653310\x00\x00\x00\x00\x00\x00',
b'F152653330\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881515306200\x00\x00\x00\x00',
b'881515306400\x00\x00\x00\x00',
b'881515306500\x00\x00\x00\x00',
b'881515307400\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B53270\x00\x00\x00\x00\x00\x00',
b'8965B53271\x00\x00\x00\x00\x00\x00',
b'8965B53280\x00\x00\x00\x00\x00\x00',
b'8965B53281\x00\x00\x00\x00\x00\x00',
b'8965B53311\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702300\x00\x00\x00\x00',
b'8821F4702100\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F5301300\x00\x00\x00\x00',
b'8646F5301400\x00\x00\x00\x00',
b'8646F5301200\x00\x00\x00\x00',
],
},
CAR.PRIUS: {
(Ecu.engine, 0x700, None): [
b'\x02896634761000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634761100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634761200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634762000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634763000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634763100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634765000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634765100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634769100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634769200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634770000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634774000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634774100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634774200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634782000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x02896634784000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x028966347A0000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x028966347A5000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x028966347A8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x028966347B0000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x03896634759100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00',
b'\x03896634759200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00',
b'\x03896634759200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00',
b'\x03896634759300\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00',
b'\x03896634760000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701002\x00\x00\x00\x00',
b'\x03896634760000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00',
b'\x03896634760000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00',
b'\x03896634760100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00',
b'\x03896634760200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00',
b'\x03896634760200\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00',
b'\x03896634760300\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701004\x00\x00\x00\x00',
b'\x03896634768000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4703001\x00\x00\x00\x00',
b'\x03896634768000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4703002\x00\x00\x00\x00',
b'\x03896634768100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4703002\x00\x00\x00\x00',
b'\x03896634785000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4705001\x00\x00\x00\x00',
b'\x03896634785000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710001\x00\x00\x00\x00',
b'\x03896634786000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4705001\x00\x00\x00\x00',
b'\x03896634786000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710001\x00\x00\x00\x00',
b'\x03896634789000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4703002\x00\x00\x00\x00',
b'\x038966347A3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4701003\x00\x00\x00\x00',
b'\x038966347A3000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4707001\x00\x00\x00\x00',
b'\x038966347B6000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710001\x00\x00\x00\x00',
b'\x038966347B7000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710001\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B47021\x00\x00\x00\x00\x00\x00',
b'8965B47022\x00\x00\x00\x00\x00\x00',
b'8965B47023\x00\x00\x00\x00\x00\x00',
b'8965B47050\x00\x00\x00\x00\x00\x00',
b'8965B47060\x00\x00\x00\x00\x00\x00', # This is the EPS with good angle sensor
],
(Ecu.esp, 0x7b0, None): [
b'F152647290\x00\x00\x00\x00\x00\x00',
b'F152647300\x00\x00\x00\x00\x00\x00',
b'F152647310\x00\x00\x00\x00\x00\x00',
b'F152647414\x00\x00\x00\x00\x00\x00',
b'F152647415\x00\x00\x00\x00\x00\x00',
b'F152647416\x00\x00\x00\x00\x00\x00',
b'F152647417\x00\x00\x00\x00\x00\x00',
b'F152647470\x00\x00\x00\x00\x00\x00',
b'F152647490\x00\x00\x00\x00\x00\x00',
b'F152647683\x00\x00\x00\x00\x00\x00',
b'F152647684\x00\x00\x00\x00\x00\x00',
b'F152647862\x00\x00\x00\x00\x00\x00',
b'F152647863\x00\x00\x00\x00\x00\x00',
b'F152647864\x00\x00\x00\x00\x00\x00',
b'F152647865\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881514702300\x00\x00\x00\x00',
b'881514703100\x00\x00\x00\x00',
b'881514704100\x00\x00\x00\x00',
b'881514706000\x00\x00\x00\x00',
b'881514706100\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702000\x00\x00\x00\x00',
b'8821F4702100\x00\x00\x00\x00',
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F4701300\x00\x00\x00\x00',
b'8646F4702001\x00\x00\x00\x00',
b'8646F4702100\x00\x00\x00\x00',
b'8646F4702200\x00\x00\x00\x00',
b'8646F4705000\x00\x00\x00\x00',
b'8646F4705200\x00\x00\x00\x00',
],
},
CAR.RAV4: {
(Ecu.engine, 0x7e0, None): [
b'\x02342Q1000\x00\x00\x00\x00\x00\x00\x00\x0054212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342Q1100\x00\x00\x00\x00\x00\x00\x00\x0054212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342Q1200\x00\x00\x00\x00\x00\x00\x00\x0054212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342Q1300\x00\x00\x00\x00\x00\x00\x00\x0054212000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342Q2000\x00\x00\x00\x00\x00\x00\x00\x0054213000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342Q2100\x00\x00\x00\x00\x00\x00\x00\x0054213000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342Q2200\x00\x00\x00\x00\x00\x00\x00\x0054213000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342Q4000\x00\x00\x00\x00\x00\x00\x00\x0054215000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B42063\x00\x00\x00\x00\x00\x00',
b'8965B42073\x00\x00\x00\x00\x00\x00',
b'8965B42082\x00\x00\x00\x00\x00\x00',
b'8965B42083\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F15260R102\x00\x00\x00\x00\x00\x00',
b'F15260R103\x00\x00\x00\x00\x00\x00',
b'F152642493\x00\x00\x00\x00\x00\x00',
b'F152642492\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881514201200\x00\x00\x00\x00',
b'881514201300\x00\x00\x00\x00',
b'881514201400\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702000\x00\x00\x00\x00',
b'8821F4702100\x00\x00\x00\x00',
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F4201200\x00\x00\x00\x00',
b'8646F4202001\x00\x00\x00\x00',
b'8646F4202100\x00\x00\x00\x00',
b'8646F4204000\x00\x00\x00\x00',
],
},
CAR.RAV4H: {
(Ecu.engine, 0x7e0, None): [
b'\x02342N9000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342N9100\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02342P0000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B42102\x00\x00\x00\x00\x00\x00',
b'8965B42103\x00\x00\x00\x00\x00\x00',
b'8965B42112\x00\x00\x00\x00\x00\x00',
b'8965B42162\x00\x00\x00\x00\x00\x00',
b'8965B42163\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152642090\x00\x00\x00\x00\x00\x00',
b'F152642110\x00\x00\x00\x00\x00\x00',
b'F152642120\x00\x00\x00\x00\x00\x00',
b'F152642400\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881514202200\x00\x00\x00\x00',
b'881514202300\x00\x00\x00\x00',
b'881514202400\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702000\x00\x00\x00\x00',
b'8821F4702100\x00\x00\x00\x00',
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F4201100\x00\x00\x00\x00',
b'8646F4201200\x00\x00\x00\x00',
b'8646F4202001\x00\x00\x00\x00',
b'8646F4202100\x00\x00\x00\x00',
b'8646F4204000\x00\x00\x00\x00',
],
},
CAR.RAV4_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x01896630R58000\x00\x00\x00\x00',
b'\x01896630R58100\x00\x00\x00\x00',
b'\x018966342E2000\x00\x00\x00\x00',
b'\x018966342M8000\x00\x00\x00\x00',
b'\x018966342S9000\x00\x00\x00\x00',
b'\x018966342T1000\x00\x00\x00\x00',
b'\x018966342T6000\x00\x00\x00\x00',
b'\x018966342T9000\x00\x00\x00\x00',
b'\x018966342U4000\x00\x00\x00\x00',
b'\x018966342U4100\x00\x00\x00\x00',
b'\x018966342V3000\x00\x00\x00\x00',
b'\x018966342V3100\x00\x00\x00\x00',
b'\x018966342V3200\x00\x00\x00\x00',
b'\x01896634A05000\x00\x00\x00\x00',
b'\x01896634A19000\x00\x00\x00\x00',
b'\x01896634A19100\x00\x00\x00\x00',
b'\x01896634A20000\x00\x00\x00\x00',
b'\x01896634A20100\x00\x00\x00\x00',
b'\x01896634A22000\x00\x00\x00\x00',
b'\x01896634A22100\x00\x00\x00\x00',
b'\x01896634A30000\x00\x00\x00\x00',
b'\x01896634A44000\x00\x00\x00\x00',
b'\x01896634A45000\x00\x00\x00\x00',
b'\x01896634A46000\x00\x00\x00\x00',
b'\x028966342M7000\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00',
b'\x028966342T0000\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00',
b'\x028966342V1000\x00\x00\x00\x00897CF1202001\x00\x00\x00\x00',
b'\x028966342Y8000\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00',
b'\x02896634A18000\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00',
b'\x02896634A18100\x00\x00\x00\x00897CF1201001\x00\x00\x00\x00',
b'\x02896634A43000\x00\x00\x00\x00897CF4201001\x00\x00\x00\x00',
b'\x02896634A47000\x00\x00\x00\x00897CF4201001\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'\x01F15260R210\x00\x00\x00\x00\x00\x00',
b'\x01F15260R220\x00\x00\x00\x00\x00\x00',
b'\x01F15260R290\x00\x00\x00\x00\x00\x00',
b'\x01F15260R300\x00\x00\x00\x00\x00\x00',
b'\x01F152642551\x00\x00\x00\x00\x00\x00',
b'\x01F152642561\x00\x00\x00\x00\x00\x00',
b'\x01F152642700\x00\x00\x00\x00\x00\x00',
b'\x01F152642701\x00\x00\x00\x00\x00\x00',
b'\x01F152642710\x00\x00\x00\x00\x00\x00',
b'\x01F152642711\x00\x00\x00\x00\x00\x00',
b'\x01F152642750\x00\x00\x00\x00\x00\x00',
b'\x01F152642751\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B42170\x00\x00\x00\x00\x00\x00',
b'8965B42171\x00\x00\x00\x00\x00\x00',
b'8965B42180\x00\x00\x00\x00\x00\x00',
b'8965B42181\x00\x00\x00\x00\x00\x00',
b'\x028965B0R01200\x00\x00\x00\x008965B0R02200\x00\x00\x00\x00',
b'\x028965B0R01300\x00\x00\x00\x008965B0R02300\x00\x00\x00\x00',
b'\x028965B0R01400\x00\x00\x00\x008965B0R02400\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301100\x00\x00\x00\x00',
b'\x018821F3301200\x00\x00\x00\x00',
b'\x018821F3301300\x00\x00\x00\x00',
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F4203200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F4203300\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F4203400\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F4203500\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F4203700\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F4203800\x00\x00\x00\x008646G2601500\x00\x00\x00\x00',
],
},
CAR.RAV4H_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x01896634A15000\x00\x00\x00\x00',
b'\x018966342M5000\x00\x00\x00\x00',
b'\x018966342W8000\x00\x00\x00\x00',
b'\x018966342X5000\x00\x00\x00\x00',
b'\x018966342X6000\x00\x00\x00\x00',
b'\x01896634A25000\x00\x00\x00\x00',
b'\x018966342W5000\x00\x00\x00\x00',
b'\x028966342W4001\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00',
b'\x02896634A13001\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00',
b'\x02896634A13101\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00',
b'\x02896634A14001\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00',
b'\x02896634A23001\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00',
b'\x02896634A14001\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00',
b'\x02896634A14101\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152642291\x00\x00\x00\x00\x00\x00',
b'F152642290\x00\x00\x00\x00\x00\x00',
b'F152642330\x00\x00\x00\x00\x00\x00',
b'F152642331\x00\x00\x00\x00\x00\x00',
b'F152642531\x00\x00\x00\x00\x00\x00',
b'F152642532\x00\x00\x00\x00\x00\x00',
b'F152642520\x00\x00\x00\x00\x00\x00',
b'F152642521\x00\x00\x00\x00\x00\x00',
b'F152642540\x00\x00\x00\x00\x00\x00',
b'F152642541\x00\x00\x00\x00\x00\x00',
b'F152642542\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B42170\x00\x00\x00\x00\x00\x00',
b'8965B42171\x00\x00\x00\x00\x00\x00',
b'8965B42180\x00\x00\x00\x00\x00\x00',
b'8965B42181\x00\x00\x00\x00\x00\x00',
b'\x028965B0R01200\x00\x00\x00\x008965B0R02200\x00\x00\x00\x00',
b'\x028965B0R01300\x00\x00\x00\x008965B0R02300\x00\x00\x00\x00',
b'\x028965B0R01400\x00\x00\x00\x008965B0R02400\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301100\x00\x00\x00\x00',
b'\x018821F3301200\x00\x00\x00\x00',
b'\x018821F3301300\x00\x00\x00\x00',
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F4203200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F4203300\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F4203400\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F4203500\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F4203700\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F4203800\x00\x00\x00\x008646G2601500\x00\x00\x00\x00',
],
},
CAR.LEXUS_ES_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x01896630EC9100\x00\x00\x00\x00',
b'\x018966333T5000\x00\x00\x00\x00',
b'\x018966333T5100\x00\x00\x00\x00',
b'\x018966333X6000\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'\x01F152606281\x00\x00\x00\x00\x00\x00',
b'\x01F152606340\x00\x00\x00\x00\x00\x00',
b'\x01F15260E031\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B33252\x00\x00\x00\x00\x00\x00',
b'8965B33590\x00\x00\x00\x00\x00\x00',
b'8965B48271\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301100\x00\x00\x00\x00',
b'\x018821F3301200\x00\x00\x00\x00',
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F33030D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F3303200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F3304100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F4810200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
],
},
CAR.SIENNA: {
(Ecu.engine, 0x700, None): [
b'\x01896630832100\x00\x00\x00\x00',
b'\x01896630832200\x00\x00\x00\x00',
b'\x01896630838000\x00\x00\x00\x00',
b'\x01896630838100\x00\x00\x00\x00',
b'\x01896630842000\x00\x00\x00\x00',
b'\x01896630843000\x00\x00\x00\x00',
b'\x01896630851000\x00\x00\x00\x00',
b'\x01896630851100\x00\x00\x00\x00',
b'\x01896630852100\x00\x00\x00\x00',
b'\x01896630859000\x00\x00\x00\x00',
b'\x01896630860000\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B45070\x00\x00\x00\x00\x00\x00',
b'8965B45080\x00\x00\x00\x00\x00\x00',
b'8965B45082\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152608130\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881510801100\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702100\x00\x00\x00\x00',
b'8821F4702200\x00\x00\x00\x00',
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F0801100\x00\x00\x00\x00',
],
},
CAR.LEXUS_CTH: {
(Ecu.dsu, 0x791, None): [
b'881517601100\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152676144\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x7e0, None): [
b'\x0237635000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F7601100\x00\x00\x00\x00',
],
},
CAR.LEXUS_ESH_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x028966333S8000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00',
b'\x028966333T0100\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00',
b'\x028966333V4000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00',
b'\x02896633T09000\x00\x00\x00\x00897CF3307001\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152633423\x00\x00\x00\x00\x00\x00',
b'F152633680\x00\x00\x00\x00\x00\x00',
b'F152633681\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B33252\x00\x00\x00\x00\x00\x00',
b'8965B33590\x00\x00\x00\x00\x00\x00',
b'8965B33690\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301100\x00\x00\x00\x00',
b'\x018821F3301200\x00\x00\x00\x00',
b'\x018821F3301300\x00\x00\x00\x00',
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F33030D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F3303100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00',
b'\x028646F3304100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F3304200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
],
},
CAR.LEXUS_ESH: {
(Ecu.engine, 0x7e0, None): [
b'\x02333M4200\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152633171\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881513310400\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B33512\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4701100\x00\x00\x00\x00',
b'8821F4701300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F3302001\x00\x00\x00\x00',
b'8646F3302200\x00\x00\x00\x00',
],
},
CAR.LEXUS_NX: {
(Ecu.engine, 0x700, None): [
b'\x01896637851000\x00\x00\x00\x00',
b'\x01896637852000\x00\x00\x00\x00',
b'\x01896637854000\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152678130\x00\x00\x00\x00\x00\x00',
b'F152678140\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881517803100\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B78060\x00\x00\x00\x00\x00\x00',
b'8965B78080\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702100\x00\x00\x00\x00',
b'8821F4702300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F7801100\x00\x00\x00\x00',
],
},
CAR.LEXUS_NX_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x018966378B2100\x00\x00\x00\x00',
b'\x018966378G3000\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'\x01F152678221\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B78120\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b"\x018821F3301400\x00\x00\x00\x00",
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F78030A0\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
b'\x028646F7803100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
],
},
CAR.LEXUS_NXH: {
(Ecu.engine, 0x7e0, None): [
b'\x0237882000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0237841000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0237886000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0237880000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152678160\x00\x00\x00\x00\x00\x00',
b'F152678170\x00\x00\x00\x00\x00\x00',
b'F152678171\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881517804300\x00\x00\x00\x00',
b'881517804100\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B78060\x00\x00\x00\x00\x00\x00',
b'8965B78080\x00\x00\x00\x00\x00\x00',
b'8965B78100\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4702300\x00\x00\x00\x00',
b'8821F4702100\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F7801300\x00\x00\x00\x00',
b'8646F7801100\x00\x00\x00\x00',
],
},
CAR.LEXUS_RX: {
(Ecu.engine, 0x700, None): [
b'\x01896630E36200\x00\x00\x00\x00',
b'\x01896630E36300\x00\x00\x00\x00',
b'\x01896630E37200\x00\x00\x00\x00',
b'\x01896630E37300\x00\x00\x00\x00',
b'\x01896630E41000\x00\x00\x00\x00',
b'\x01896630E41100\x00\x00\x00\x00',
b'\x01896630E41200\x00\x00\x00\x00',
b'\x01896630EA4100\x00\x00\x00\x00',
b'\x01896630EA4300\x00\x00\x00\x00',
b'\x01896630EA6300\x00\x00\x00\x00',
b'\x018966348R1300\x00\x00\x00\x00',
b'\x018966348R8500\x00\x00\x00\x00',
b'\x018966348W1300\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152648472\x00\x00\x00\x00\x00\x00',
b'F152648473\x00\x00\x00\x00\x00\x00',
b'F152648492\x00\x00\x00\x00\x00\x00',
b'F152648493\x00\x00\x00\x00\x00\x00',
b'F152648474\x00\x00\x00\x00\x00\x00',
b'F152648630\x00\x00\x00\x00\x00\x00',
b'F152648494\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881514810300\x00\x00\x00\x00',
b'881514810500\x00\x00\x00\x00',
b'881514810700\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B0E011\x00\x00\x00\x00\x00\x00',
b'8965B0E012\x00\x00\x00\x00\x00\x00',
b'8965B48102\x00\x00\x00\x00\x00\x00',
b'8965B48112\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4701000\x00\x00\x00\x00',
b'8821F4701100\x00\x00\x00\x00',
b'8821F4701200\x00\x00\x00\x00',
b'8821F4701300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F4801100\x00\x00\x00\x00',
b'8646F4801200\x00\x00\x00\x00',
b'8646F4802001\x00\x00\x00\x00',
b'8646F4802100\x00\x00\x00\x00',
b'8646F4802200\x00\x00\x00\x00',
b'8646F4809000\x00\x00\x00\x00',
],
},
CAR.LEXUS_RXH: {
(Ecu.engine, 0x7e0, None): [
b'\x02348J7000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348N0000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348Q4000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348Q4100\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348T1100\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348T3000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348V6000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x02348Z3000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152648361\x00\x00\x00\x00\x00\x00',
b'F152648501\x00\x00\x00\x00\x00\x00',
b'F152648502\x00\x00\x00\x00\x00\x00',
b'F152648504\x00\x00\x00\x00\x00\x00',
b'F152648740\x00\x00\x00\x00\x00\x00',
b'F152648A30\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881514811300\x00\x00\x00\x00',
b'881514811500\x00\x00\x00\x00',
b'881514811700\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B0E011\x00\x00\x00\x00\x00\x00',
b'8965B0E012\x00\x00\x00\x00\x00\x00',
b'8965B48111\x00\x00\x00\x00\x00\x00',
b'8965B48112\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'8821F4701000\x00\x00\x00\x00',
b'8821F4701100\x00\x00\x00\x00',
b'8821F4701200\x00\x00\x00\x00',
b'8821F4701300\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'8646F4801200\x00\x00\x00\x00',
b'8646F4802001\x00\x00\x00\x00',
b'8646F4802100\x00\x00\x00\x00',
b'8646F4802200\x00\x00\x00\x00',
b'8646F4809000\x00\x00\x00\x00',
],
},
CAR.LEXUS_RX_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x01896630EC9000\x00\x00\x00\x00',
b'\x01896634D12000\x00\x00\x00\x00',
b'\x01896630EB0000\x00\x00\x00\x00',
b'\x01896630EA9000\x00\x00\x00\x00',
b'\x01896630ED0000\x00\x00\x00\x00',
b'\x018966348W9000\x00\x00\x00\x00',
b'\x01896634D12100\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'\x01F152648801\x00\x00\x00\x00\x00\x00',
b'\x01F15260E031\x00\x00\x00\x00\x00\x00',
b'\x01F15260E041\x00\x00\x00\x00\x00\x00',
b'\x01F152648781\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B48271\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301100\x00\x00\x00\x00',
b'\x018821F3301300\x00\x00\x00\x00',
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F4810200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F4810100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
],
},
CAR.LEXUS_RXH_TSS2: {
(Ecu.engine, 0x7e0, None): [
b'\x02348X8000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0234D14000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
b'\x0234D16000\x00\x00\x00\x00\x00\x00\x00\x00A4802000\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152648831\x00\x00\x00\x00\x00\x00',
b'F152648D00\x00\x00\x00\x00\x00\x00',
b'F152648D60\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B48271\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F4810200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F4810100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00',
],
},
CAR.PRIUS_TSS2: {
(Ecu.engine, 0x700, None): [
b'\x028966347C8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',
b'\x038966347C0000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710101\x00\x00\x00\x00',
b'\x038966347C1000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710101\x00\x00\x00\x00',
b'\x038966347C5000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4707101\x00\x00\x00\x00',
b'\x038966347C5100\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4707101\x00\x00\x00\x00',
],
(Ecu.esp, 0x7b0, None): [
b'F152647500\x00\x00\x00\x00\x00\x00',
b'F152647510\x00\x00\x00\x00\x00\x00',
b'F152647520\x00\x00\x00\x00\x00\x00',
b'F152647521\x00\x00\x00\x00\x00\x00',
],
(Ecu.eps, 0x7a1, None): [
b'8965B47070\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x750, 0xf): [
b'\x018821F3301400\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x750, 0x6d): [
b'\x028646F4707000\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',
b'\x028646F4710000\x00\x00\x00\x008646G2601500\x00\x00\x00\x00',
],
},
CAR.MIRAI: {
(Ecu.esp, 0x7D1, None): [b'\x01898A36203000\x00\x00\x00\x00',],
(Ecu.esp, 0x7B0, None): [b'\x01F15266203200\x00\x00\x00\x00',], # a second ESP ECU
(Ecu.eps, 0x7A1, None): [b'\x028965B6204100\x00\x00\x00\x008965B6203100\x00\x00\x00\x00',],
(Ecu.fwdRadar, 0x750, 0xf): [b'\x018821F6201200\x00\x00\x00\x00',],
(Ecu.fwdCamera, 0x750, 0x6d): [b'\x028646F6201400\x00\x00\x00\x008646G5301200\x00\x00\x00\x00',],
},
CAR.ALPHARD_TSS2: {
(Ecu.engine, 0x7e0, None): [b'\x0235883000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00',],
(Ecu.eps, 0x7a1, None): [b'8965B58040\x00\x00\x00\x00\x00\x00',],
(Ecu.fwdRadar, 0x750, 0xf): [b'\x018821F3301400\x00\x00\x00\x00',],
(Ecu.fwdCamera, 0x750, 0x6d): [b'\x028646F5803200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00',],
},
}
STEER_THRESHOLD = 100
DBC = {
CAR.RAV4H: dbc_dict('toyota_rav4_hybrid_2017_pt_generated', 'toyota_adas'),
CAR.RAV4: dbc_dict('toyota_rav4_2017_pt_generated', 'toyota_adas'),
CAR.PRIUS: dbc_dict('toyota_prius_2017_pt_generated', 'toyota_adas'),
CAR.COROLLA: dbc_dict('toyota_corolla_2017_pt_generated', 'toyota_adas'),
CAR.LEXUS_RX: dbc_dict('lexus_rx_350_2016_pt_generated', 'toyota_adas'),
CAR.LEXUS_RXH: dbc_dict('lexus_rx_hybrid_2017_pt_generated', 'toyota_adas'),
CAR.LEXUS_RX_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'),
CAR.LEXUS_RXH_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'),
CAR.CHR: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
CAR.CHRH: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_adas'),
CAR.CAMRY: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
CAR.CAMRYH: dbc_dict('toyota_camry_hybrid_2018_pt_generated', 'toyota_adas'),
CAR.CAMRY_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'),
CAR.CAMRYH_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'),
CAR.HIGHLANDER: dbc_dict('toyota_highlander_2017_pt_generated', 'toyota_adas'),
CAR.HIGHLANDER_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'),
CAR.HIGHLANDERH: dbc_dict('toyota_highlander_hybrid_2018_pt_generated', 'toyota_adas'),
CAR.HIGHLANDERH_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'),
CAR.AVALON: dbc_dict('toyota_avalon_2017_pt_generated', 'toyota_adas'),
CAR.AVALON_2019: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
CAR.AVALONH_2019: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_adas'),
CAR.RAV4_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'),
CAR.COROLLA_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'),
CAR.COROLLAH_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'),
CAR.LEXUS_ES_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'),
CAR.LEXUS_ESH_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'),
CAR.LEXUS_ESH: dbc_dict('lexus_ct200h_2018_pt_generated', 'toyota_adas'),
CAR.SIENNA: dbc_dict('toyota_sienna_xle_2018_pt_generated', 'toyota_adas'),
CAR.LEXUS_IS: dbc_dict('lexus_is_2018_pt_generated', 'toyota_adas'),
CAR.LEXUS_CTH: dbc_dict('lexus_ct200h_2018_pt_generated', 'toyota_adas'),
CAR.RAV4H_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'),
CAR.LEXUS_NXH: dbc_dict('lexus_nx300h_2018_pt_generated', 'toyota_adas'),
CAR.LEXUS_NX: dbc_dict('lexus_nx300_2018_pt_generated', 'toyota_adas'),
CAR.LEXUS_NX_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'),
CAR.PRIUS_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'),
CAR.MIRAI: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'),
CAR.ALPHARD_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'),
}
# Toyota/Lexus Safety Sense 2.0 and 2.5
TSS2_CAR = set([CAR.RAV4_TSS2, CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.RAV4H_TSS2,
CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2, CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2, CAR.PRIUS_TSS2, CAR.CAMRY_TSS2, CAR.CAMRYH_TSS2,
CAR.MIRAI, CAR.LEXUS_NX_TSS2, CAR.ALPHARD_TSS2])
NO_DSU_CAR = TSS2_CAR | set([CAR.CHR, CAR.CHRH, CAR.CAMRY, CAR.CAMRYH])
# no resume button press required
NO_STOP_TIMER_CAR = TSS2_CAR | set([CAR.RAV4H, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.SIENNA, CAR.LEXUS_ESH])
|
/************************* chart de Boutiques ****/
/** $('#pie1').highcharts({
chart: {
type: 'pie',
events: {
drilldown: function (e) {
document.getElementById('zone1').value = e.point.name;
document.getElementById('zone1').oninput();
console.log(e.point.name); // The point, with name, that was clicked
}
}
},
title: {
text: ''
},
subtitle: {
text: ''
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '{point.name}: {point.y:.1f}%'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
series: [{
name: 'Zones',
colorByPoint: true,
data: zones
}],
drilldown: {
series: [{
id: 'Microsoft Internet Explorer',
point:{
events:{
click: function (event) {
var s = "#"+event.path[5].id;
$(s).prev().find(".vvvv").val(this.name);
$(s).prev().find(".vvvv").trigger('change');
}
}
},
name: 'Microsoft Internet Explorer',
data: [
['v11.0', 24.13],
['v8.0', 17.2],
['v9.0', 8.11],
['v10.0', 5.33],
['v6.0', 1.06],
['v7.0', 0.5]
]
}, {
name: 'Chrome',
id: 'Chrome',
data: [
['v40.0', 5],
['v41.0', 4.32],
['v42.0', 3.68],
['v39.0', 2.96],
['v36.0', 2.53],
['v43.0', 1.45],
['v31.0', 1.24],
['v35.0', 0.85],
['v38.0', 0.6],
['v32.0', 0.55],
['v37.0', 0.38],
['v33.0', 0.19],
['v34.0', 0.14],
['v30.0', 0.14]
]
}, {
name: 'Firefox',
id: 'Firefox',
data: [
['v35', 2.76],
['v36', 2.32],
['v37', 2.31],
['v34', 1.27],
['v38', 1.02],
['v31', 0.33],
['v33', 0.22],
['v32', 0.15]
]
}, {
name: 'Safari',
id: 'Safari',
data: [
['v8.0', 2.56],
['v7.1', 0.77],
['v5.1', 0.42],
['v5.0', 0.3],
['v6.1', 0.29],
['v7.0', 0.26],
['v6.2', 0.17]
]
}, {
name: 'Opera',
id: 'Opera',
data: [
['v12.x', 0.34],
['v28', 0.24],
['v27', 0.17],
['v29', 0.16]
]
}]
}
});
$('#pie2').highcharts({
chart: {
type: 'pie',
events: {
drilldown: function (e) {
document.getElementById('zone2').value = e.point.name;
document.getElementById('zone2').oninput();
console.log(e.point.name); // The point, with name, that was clicked
}
},
// Edit chart spacing
spacingBottom: 15,
spacingTop: 10,
spacingLeft: 10,
spacingRight: 10,
// Explicitly tell the width and height of a chart
width: null,
height: null
},
title: {
text: ''
},
subtitle: {
text: ''
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '{point.name}: {point.y:.1f}%'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
series: [{
name: 'Zones',
colorByPoint: true,
data: zones
}],
drilldown: {
series: [{
id: 'Microsoft Internet Explorer',
point:{
events:{
click: function (event) {
var s = "#"+event.path[5].id;
$(s).prev().find(".vvvv").val(this.name);
$(s).prev().find(".vvvv").trigger('change');
}
}
},
name: 'Microsoft Internet Explorer',
data: [
['v11.0', 24.13],
['v8.0', 17.2],
['v9.0', 8.11],
['v10.0', 5.33],
['v6.0', 1.06],
['v7.0', 0.5]
]
}, {
name: 'Chrome',
id: 'Chrome',
data: [
['v40.0', 5],
['v41.0', 4.32],
['v42.0', 3.68],
['v39.0', 2.96],
['v36.0', 2.53],
['v43.0', 1.45],
['v31.0', 1.24],
['v35.0', 0.85],
['v38.0', 0.6],
['v32.0', 0.55],
['v37.0', 0.38],
['v33.0', 0.19],
['v34.0', 0.14],
['v30.0', 0.14]
]
}, {
name: 'Firefox',
id: 'Firefox',
data: [
['v35', 2.76],
['v36', 2.32],
['v37', 2.31],
['v34', 1.27],
['v38', 1.02],
['v31', 0.33],
['v33', 0.22],
['v32', 0.15]
]
}, {
name: 'Safari',
id: 'Safari',
data: [
['v8.0', 2.56],
['v7.1', 0.77],
['v5.1', 0.42],
['v5.0', 0.3],
['v6.1', 0.29],
['v7.0', 0.26],
['v6.2', 0.17]
]
}, {
name: 'Opera',
id: 'Opera',
data: [
['v12.x', 0.34],
['v28', 0.24],
['v27', 0.17],
['v29', 0.16]
]
}]
}
});
***/
/********************
$('#pie3').highcharts({
chart: {
type: 'pie',
events: {
}
},
title: {
text: ''
},
subtitle: {
text: ''
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '{point.name}: {point.y:.1f}%'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
series: [{
name: 'Zones',
colorByPoint: true,
data: zones
}],
drilldown: {
series: [{
id: 'Microsoft Internet Explorer',
point:{
events:{
click: function (event) {
var s = "#"+event.path[5].id;
$(s).prev().find(".vvvv").val(this.name);
$(s).prev().find(".vvvv").trigger('change');
}
}
},
name: 'Microsoft Internet Explorer',
data: [
['v11.0', 24.13],
['v8.0', 17.2],
['v9.0', 8.11],
['v10.0', 5.33],
['v6.0', 1.06],
['v7.0', 0.5]
]
}, {
name: 'Chrome',
id: 'Chrome',
data: [
['v40.0', 5],
['v41.0', 4.32],
['v42.0', 3.68],
['v39.0', 2.96],
['v36.0', 2.53],
['v43.0', 1.45],
['v31.0', 1.24],
['v35.0', 0.85],
['v38.0', 0.6],
['v32.0', 0.55],
['v37.0', 0.38],
['v33.0', 0.19],
['v34.0', 0.14],
['v30.0', 0.14]
]
}, {
name: 'Firefox',
id: 'Firefox',
data: [
['v35', 2.76],
['v36', 2.32],
['v37', 2.31],
['v34', 1.27],
['v38', 1.02],
['v31', 0.33],
['v33', 0.22],
['v32', 0.15]
]
}, {
name: 'Safari',
id: 'Safari',
data: [
['v8.0', 2.56],
['v7.1', 0.77],
['v5.1', 0.42],
['v5.0', 0.3],
['v6.1', 0.29],
['v7.0', 0.26],
['v6.2', 0.17]
]
}, {
name: 'Opera',
id: 'Opera',
data: [
['v12.x', 0.34],
['v28', 0.24],
['v27', 0.17],
['v29', 0.16]
]
}]
}
});
********/
/****************
$('#pie4').highcharts({
chart: {
type: 'pie',
events: {
drilldown: function (e) {
document.getElementById('zone4').value = e.point.name;
document.getElementById('zone4').oninput();
console.log(e.point.name); // The point, with name, that was clicked
}
}
},
title: {
text: ''
},
subtitle: {
text: ''
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '{point.name}: {point.y:.1f}%'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
series: [{
name: 'Zones',
colorByPoint: true,
data: zones
}],
drilldown: {
series: [{
id: 'Microsoft Internet Explorer',
point:{
events:{
click: function (event) {
var s = "#"+event.path[5].id;
$(s).prev().find(".vvvv").val(this.name);
$(s).prev().find(".vvvv").trigger('change');
}
}
},
name: 'Microsoft Internet Explorer',
data: [
['v11.0', 24.13],
['v8.0', 17.2],
['v9.0', 8.11],
['v10.0', 5.33],
['v6.0', 1.06],
['v7.0', 0.5]
]
}, {
name: 'Chrome',
id: 'Chrome',
data: [
['v40.0', 5],
['v41.0', 4.32],
['v42.0', 3.68],
['v39.0', 2.96],
['v36.0', 2.53],
['v43.0', 1.45],
['v31.0', 1.24],
['v35.0', 0.85],
['v38.0', 0.6],
['v32.0', 0.55],
['v37.0', 0.38],
['v33.0', 0.19],
['v34.0', 0.14],
['v30.0', 0.14]
]
}, {
name: 'Firefox',
id: 'Firefox',
data: [
['v35', 2.76],
['v36', 2.32],
['v37', 2.31],
['v34', 1.27],
['v38', 1.02],
['v31', 0.33],
['v33', 0.22],
['v32', 0.15]
]
}, {
name: 'Safari',
id: 'Safari',
data: [
['v8.0', 2.56],
['v7.1', 0.77],
['v5.1', 0.42],
['v5.0', 0.3],
['v6.1', 0.29],
['v7.0', 0.26],
['v6.2', 0.17]
]
}, {
name: 'Opera',
id: 'Opera',
data: [
['v12.x', 0.34],
['v28', 0.24],
['v27', 0.17],
['v29', 0.16]
]
}]
}
});
************/
/***************
$('#pie5').highcharts({
chart: {
type: 'pie',
events: {
drilldown: function (e) {
document.getElementById('zone5').value = e.point.name;
document.getElementById('zone5').oninput();
console.log(e.point.name); // The point, with name, that was clicked
}
}
},
title: {
text: ''
},
subtitle: {
text: ''
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
format: '{point.name}: {point.y:.1f}%'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
series: [{
name: 'Zones',
colorByPoint: true,
data: zones
}],
drilldown: {
series: [{
id: 'Microsoft Internet Explorer',
point:{
events:{
click: function (event) {
var s = "#"+event.path[5].id;
$(s).prev().find(".vvvv").val(this.name);
$(s).prev().find(".vvvv").trigger('change');
}
}
},
name: 'Microsoft Internet Explorer',
data: [
['v11.0', 24.13],
['v8.0', 17.2],
['v9.0', 8.11],
['v10.0', 5.33],
['v6.0', 1.06],
['v7.0', 0.5]
]
}, {
name: 'Chrome',
id: 'Chrome',
data: [
['v40.0', 5],
['v41.0', 4.32],
['v42.0', 3.68],
['v39.0', 2.96],
['v36.0', 2.53],
['v43.0', 1.45],
['v31.0', 1.24],
['v35.0', 0.85],
['v38.0', 0.6],
['v32.0', 0.55],
['v37.0', 0.38],
['v33.0', 0.19],
['v34.0', 0.14],
['v30.0', 0.14]
]
}, {
name: 'Firefox',
id: 'Firefox',
data: [
['v35', 2.76],
['v36', 2.32],
['v37', 2.31],
['v34', 1.27],
['v38', 1.02],
['v31', 0.33],
['v33', 0.22],
['v32', 0.15]
]
}, {
name: 'Safari',
id: 'Safari',
data: [
['v8.0', 2.56],
['v7.1', 0.77],
['v5.1', 0.42],
['v5.0', 0.3],
['v6.1', 0.29],
['v7.0', 0.26],
['v6.2', 0.17]
]
}, {
name: 'Opera',
id: 'Opera',
data: [
['v12.x', 0.34],
['v28', 0.24],
['v27', 0.17],
['v29', 0.16]
]
}]
}
});
$('.tab-pane').removeClass('active');
$('#tab_15_1').addClass('active') ;
*************/
|
const path = require("path");
const rlequire = require("rlequire");
const Config = rlequire("dendro", "src/models/meta/config.js").Config;
const isNull = rlequire("dendro", "src/utils/null.js").isNull;
const DbConnection = rlequire("dendro", "src/kb/db.js").DbConnection;
const Ontology = rlequire("dendro", "src/models/meta/ontology.js").Ontology;
const Elements = rlequire("dendro", "src/models/meta/elements.js").Elements;
const Logger = rlequire("dendro", "src/utils/logger.js").Logger;
const ObjectManipulator = rlequire("dendro", "src/utils/object_manipulation.js");
const db = Config.getDBByID();
const async = require("async");
const _ = require("underscore");
function Descriptor (object, typeConfigsToRetain)
{
const self = this;
if (!isNull(object))
{
if (!isNull(object.uri))
{
self.uri = object.uri;
self.prefix = self.getNamespacePrefix();
self.ontology = self.getOwnerOntologyUri();
self.shortName = self.getShortName();
self.prefixedForm = self.getPrefixedForm();
}
else if (!isNull(object.ontology) && !isNull(object.shortName))
{
self.uri = object.ontology + object.shortName;
self.prefix = self.getNamespacePrefix();
self.ontology = self.getOwnerOntologyUri();
self.shortName = self.getShortName();
self.prefixedForm = self.getPrefixedForm();
}
else if (!isNull(object.prefixedForm))
{
const indexOfColon = object.prefixedForm.indexOf(":");
if (indexOfColon < 0)
{
const error = "Invalid prefixed form for descriptor " + object.prefixedForm;
Logger.log("error", error);
throw error;
}
else
{
self.prefix = object.prefixedForm.substr(0, indexOfColon);
self.shortName = object.prefixedForm.substr(indexOfColon + 1); // + 1 = skip the ':' sign
self.ontology = Ontology.allOntologies[self.prefix].uri;
self.uri = Ontology.allOntologies[self.prefix].uri + self.shortName;
}
}
else if (!isNull(object.prefix) && !isNull(object.shortName))
{
self.prefix = object.prefix;
self.shortName = object.shortName;
self.ontology = Ontology.allOntologies[self.prefix].uri;
self.uri = Ontology.allOntologies[self.prefix].uri + self.shortName;
self.prefixedForm = self.getPrefixedForm();
}
else
{
const error = "Invalid Descriptor." + JSON.stringify(object) + ". " +
"Check that you have included one of the following: an uri; an ontology uri and shortName; a prefixed form; a prefix and a shortName. " +
"Also, does that descriptor really belong to that ontology?";
Logger.log("error", error);
return {error: error};
}
if (isNull(Elements.ontologies[self.prefix]))
{
const error = "Unknown ontology for -> " + object.uri + ". The owning ontology of the descriptor is not parametrized in this Dendro instance.";
if (Config.debug.log_missing_unknown_descriptors)
{
Logger.log("error", error);
}
return {error: error};
}
else if (isNull(Elements.ontologies[self.prefix][self.shortName]) && Config.debug.active && Config.debug.descriptors.log_missing_unknown_descriptors)
{
const error = "Unknown descriptor -> " + object.uri + ". This descriptor is not parametrized in this Dendro instance; however, the ontology uri matches an ontology in this instance. Are you sure that descriptor belongs to that ontology? Check the final part of the URI, or parametrize the element in the elements.js file.";
Logger.log("error", error);
return {error: error};
}
if (!isNull(Elements.ontologies[self.prefix]) && !isNull(Elements.ontologies[self.prefix][self.shortName]))
{
const element = Elements.ontologies[self.prefix][self.shortName];
self.type = element.type;
self.control = element.control;
if (element.validationFunction && typeof element.validationFunction === "function")
{
self.validationFunction = element.validationFunction;
}
if (!isNull(object.label))
{
self.label = object.label;
}
else
{
self.label = element.label;
}
if (!isNull(object.comment))
{
self.comment = object.comment;
}
else
{
self.comment = element.comment;
}
// override type if supplied in object argument
if (!isNull(object.type))
{
self.type = object.type;
}
else
{
self.type = element.type;
}
if (!isNull(element.hasAlternative))
{
self.hasAlternative = element.hasAlternative;
}
if (element.hasRegex)
{
self.hasRegex = element.hasRegex;
}
for (let descriptorType in Elements.access_types)
{
if (Elements.access_types.hasOwnProperty(descriptorType))
{
if (element[descriptorType])
{
self[descriptorType] = element[descriptorType];
}
}
}
if (!isNull(typeConfigsToRetain) && typeConfigsToRetain instanceof Array)
{
for (let i = 0; i < typeConfigsToRetain.length; i++)
{
let type = typeConfigsToRetain[i];
if (Elements.access_types.hasOwnProperty(type))
{
if (!isNull(object[type]))
{
self[type] = object[type];
}
else if (!isNull(element) && isNull(element[type]))
{
self[type] = element[type];
}
}
}
}
self.setValue(object.value);
// try to get parametrization from ontology level
for (let descriptorType in Elements.access_types)
{
if (Elements.access_types.hasOwnProperty(descriptorType))
{
if (isNull(self[descriptorType]) &&
!isNull(Ontology.allOntologies[self.prefix]) &&
!isNull(Ontology.allOntologies[self.prefix][descriptorType]))
{
self[descriptorType] = Ontology.allOntologies[self.prefix][descriptorType];
}
}
}
}
else
{
self.type = Elements.types.string;
if (Config.debug.log_missing_unknown_descriptors)
{
Logger.log("warn", "Descriptor " + self.uri + " is missing in the elements.js file");
Logger.log("warn", "Unable to determine type of descriptor " + self.prefixedForm + ". Defaulting to string.");
}
}
return self;
}
const error = "No object supplied for descriptor creation";
Logger.log("error", error);
return {error: error};
}
Descriptor.recommendation_types = {
frequently_used_overall: {
key: "frequently_used_overall",
weight: 5
},
from_textually_similar: {
key: "from_textually_similar",
weight: 20.0
},
recently_used: {
key: "recently_used",
weight: 20.0
},
used_in_project: {
key: "used_in_project",
weight: 20.0
},
smart_accepted_in_metadata_editor: {
key: "smart_accepted_in_metadata_editor",
weight: 50.0
},
favorite_accepted_in_metadata_editor: {
key: "favorite_accepted_in_metadata_editor",
weight: 50.0
},
project_favorite: {
key: "project_favorite",
weight: 80.0
},
random: {
key: "random",
weight: 1.0
},
user_favorite: {
key: "user_favorite",
weight: 80.0
},
project_hidden: {
key: "project_hidden",
weight: 0.0
},
user_hidden: {
key: "user_hidden",
weight: 0.0
},
dc_element_forced: {
key: "dc_element_forced",
weight: 0.0
},
project_descriptors: {
key: "dc_element_forced",
weight: 0.0
}
};
Descriptor.dublinCoreElements = function (callback)
{
const DCDescriptors = [
new Descriptor({prefixedForm: "dcterms:contributor"}),
new Descriptor({prefixedForm: "dcterms:coverage"}),
new Descriptor({prefixedForm: "dcterms:creator"}),
new Descriptor({prefixedForm: "dcterms:date"}),
new Descriptor({prefixedForm: "dcterms:description"}),
new Descriptor({prefixedForm: "dcterms:format"}),
new Descriptor({prefixedForm: "dcterms:identifier"}),
new Descriptor({prefixedForm: "dcterms:language"}),
new Descriptor({prefixedForm: "dcterms:publisher"}),
new Descriptor({prefixedForm: "dcterms:relation"}),
new Descriptor({prefixedForm: "dcterms:rights"}),
new Descriptor({prefixedForm: "dcterms:source"}),
new Descriptor({prefixedForm: "dcterms:subject"}),
new Descriptor({prefixedForm: "dcterms:title"}),
new Descriptor({prefixedForm: "dcterms:type"})
];
async.mapSeries(DCDescriptors, function (descriptor, callback)
{
Descriptor.findByUri(descriptor.uri, callback);
},
function (err, fullDescriptors)
{
return callback(err, fullDescriptors);
});
};
Descriptor.findByUri = function (uri, callback)
{
try
{
// create a new descriptor just to get the uri of the owning ontology
const dummy = new Descriptor({
uri: uri
});
const query =
" SELECT ?label ?comment \n" +
" FROM [0] \n" +
" WHERE \n" +
" { \n" +
" [1] rdf:type ?type. \n" +
" OPTIONAL \n" +
"{ \n" +
" [1] rdfs:label ?label. \n" +
" FILTER (lang(?label) = \"\" || lang(?label) = \"en\")" +
"} .\n" +
" OPTIONAL \n" +
"{ \n" +
" [1] rdfs:comment ?comment. \n" +
" FILTER (lang(?comment) = \"\" || lang(?comment) = \"en\")" +
"} .\n" +
" } \n" +
" LIMIT 1\n";
db.connection.executeViaJDBC(query,
[
{
type: Elements.types.resourceNoEscape,
value: dummy.ontology
},
{
type: Elements.types.resourceNoEscape,
value: uri
}
//,
/* {
type : Elements.types.string,
value : "en"
} */
],
function (err, descriptors)
{
if (isNull(err))
{
if (descriptors.length === 0)
{
return callback(null, null);
}
if (isNull(descriptors[0].uri))
{
descriptors[0].uri = uri;
}
const formattedDescriptor = new Descriptor(descriptors[0]);
return callback(null, formattedDescriptor);
}
Logger.log("error", "Error fetching descriptor with uri : " + uri + " : " + descriptors);
return callback(1, descriptors);
});
}
catch (e)
{
Logger.log("error", "Exception finding descriptor by URI " + uri);
return callback(null, null);
}
};
Descriptor.prototype.setValue = function (value)
{
const self = this;
if (typeof value === "string")
{
if (self.type === Elements.types.int)
{
self.value = parseInt(value);
}
else if (self.type === Elements.types.float)
{
self.value = parseFloat(value);
}
else if (self.type === Elements.types.boolean)
{
self.value = JSON.parse(value);
}
else
{
self.value = value;
}
}
else
{
self.value = value;
}
};
Descriptor.all_in_ontology = function (ontologyURI, callback, page_number, pagesize, forceLoadFromTripleStore)
{
const getFromTripleStore = function (callback)
{
let query =
" SELECT DISTINCT ?uri ?label ?comment \n" +
" FROM [0] \n" +
" WHERE \n" +
" { \n" +
" FILTER( STRSTARTS(str(?uri), str([0]) ) ) . \n" +
" {\n " +
" ?uri rdf:type rdf:Property . \n" +
" OPTIONAL { \n" +
" ?uri rdfs:label ?label .\n" +
" FILTER (lang(?label) = \"\" || lang(?label) = [1] )\n" +
" } .\n" +
" OPTIONAL { \n" +
" ?uri rdfs:comment ?comment .\n" +
" FILTER (lang(?comment) = \"\" || lang(?comment) = [1] )\n" +
" } .\n" +
" } UNION {\n " +
" ?uri rdf:type owl:DatatypeProperty . \n" +
" OPTIONAL { \n" +
" ?uri rdfs:label ?label .\n" +
" FILTER (lang(?label) = \"\" || lang(?label) = [1] )\n" +
" } .\n" +
" OPTIONAL { \n" +
" ?uri rdfs:comment ?comment .\n" +
" FILTER (lang(?comment) = \"\" || lang(?comment) = [1] )\n" +
" } .\n" +
" } UNION {\n " +
" ?uri rdf:type owl:ObjectProperty . \n" +
" OPTIONAL { \n" +
" ?uri rdfs:label ?label .\n" +
" FILTER (lang(?label) = \"\" || lang(?label) = [1] )\n" +
" } .\n" +
" OPTIONAL { \n" +
" ?uri rdfs:comment ?comment .\n" +
" FILTER (lang(?comment) = \"\" || lang(?comment) = [1] )\n" +
" } .\n" +
" } \n" +
" } \n" +
" ORDER BY ASC(?label) \n";
let args = [
{
type: Elements.types.resourceNoEscape,
value: ontologyURI
},
{
type: Elements.types.string,
value: "en"
}
];
if (typeof page_number === "number")
{
query = query +
" OFFSET [2] \n" +
" LIMIT [3] \n";
args = args.concat([
{
type: Elements.types.int,
value: page_number * pagesize
},
{
type: Elements.types.int,
value: page_number * (pagesize + 1)
}
]);
}
db.connection.executeViaJDBC(query, args,
function (err, descriptors)
{
if (isNull(err))
{
const formattedResults = [];
for (let i = 0; i < descriptors.length; i++)
{
const formattedDescriptor = new Descriptor(descriptors[i]);
formattedResults.push(formattedDescriptor);
}
return callback(null, formattedResults);
}
Logger.log("error", "Error fetching descriptors from ontology : " + ontologyURI + " " + descriptors);
return callback(1, descriptors);
});
};
const getFromCache = function ()
{
const prefix = Ontology.getOntologyPrefix(ontologyURI);
let results;
if (!isNull(prefix))
{
if (!isNull(Elements.ontologies[prefix]))
{
let elements = Elements.ontologies[prefix];
if (!isNull(elements))
{
if (!isNull(page_number) && !isNull(pagesize))
{
elements = elements.slice(pagesize * page_number, pagesize * page_number + pagesize);
}
elements = _.mapObject(elements, function (element, shortName)
{
return new Descriptor(
{
prefix: prefix,
shortName: shortName
});
});
return elements;
}
return null;
}
return null;
}
return null;
};
if (forceLoadFromTripleStore)
{
getFromTripleStore(function (err, results)
{
callback(err, results);
});
}
else
{
let results = getFromCache();
if (isNull(results))
{
getFromTripleStore(function (err, results)
{
callback(err, results);
});
}
else
{
callback(null, results);
}
}
};
Descriptor.all_in_ontologies = function (ontologyURIsArray, callback, page_number, page_size)
{
const async = require("async");
async.mapSeries(ontologyURIsArray, function (uri, cb)
{
Descriptor.all_in_ontology(uri, function (err, descriptors)
{
cb(err, descriptors);
});
}, function (err, results)
{
if (isNull(err))
{
let flat = _.flatten(_.map(results, _.values));
flat = _.sortBy(flat, function (descriptor)
{
return descriptor.shortName;
});
if (typeof page_number !== "undefined" && typeof page_size !== "undefined")
{
try
{
page_number = parseInt(page_number);
page_size = parseInt(page_size);
}
catch (e)
{
return callback(1, "Unable to parse page size of page number");
}
}
if (typeof page_number === "number" && typeof page_size === "number")
{
const offset = page_number * page_size;
flat = flat.slice(offset, offset + page_size);
}
return callback(err, flat);
}
return callback(err, results);
});
};
Descriptor.removeUnauthorizedFromObject = function (object, excludedDescriptorTypes, exceptionedDescriptorTypes)
{
if (!isNull(object))
{
for (let prefix in Elements.ontologies)
{
if (!isNull(object[prefix]))
{
for (let shortName in Elements.ontologies[prefix])
{
if (Elements.ontologies.hasOwnProperty(prefix) && Elements.ontologies[prefix].hasOwnProperty(shortName))
{
if (!isNull(object[prefix][shortName]) && !Descriptor.isAuthorized(prefix, shortName, excludedDescriptorTypes, exceptionedDescriptorTypes))
{
if (Config.debug.descriptors.log_descriptor_filtering_operations)
{
Logger.log("Removing descriptor " + prefix + ":" + shortName + " because excluded descriptor types are " + JSON.stringify(excludedDescriptorTypes) + " and exceptioned descriptor types are " + JSON.stringify(exceptionedDescriptorTypes));
}
delete object[prefix][shortName];
}
}
}
}
}
return object;
}
return object;
};
Descriptor.isAuthorized = function (prefix, shortName, excludedDescriptorTypes, exceptionedDescriptorTypes)
{
if (isNull(excludedDescriptorTypes))
{
return true;
}
if (isNull(exceptionedDescriptorTypes))
{
exceptionedDescriptorTypes = [];
}
const _ = require("underscore");
const sortedExcluded = excludedDescriptorTypes.sort();
const sortedExceptioned = exceptionedDescriptorTypes.sort();
const sum = require("hash-sum");
const excludedHash = sum(sortedExcluded);
const exceptionedHash = sum(sortedExceptioned);
if (isNull(Descriptor.excludedDescriptors))
{
Descriptor.excludedDescriptors = {};
}
if (isNull(Descriptor.exceptionedDescriptors))
{
Descriptor.exceptionedDescriptors = {};
}
const getDescriptorsOfType = function (type)
{
const descriptorsOfType = {};
for (let prefix in Elements.ontologies)
{
if (isNull(descriptorsOfType[prefix]))
{
descriptorsOfType[prefix] = {};
}
for (let shortName in Elements.ontologies[prefix])
{
if (!isNull(Elements.ontologies[prefix]) && !isNull(Elements.ontologies[prefix][shortName]))
{
let descriptor = Elements.ontologies[prefix][shortName];
if (!isNull(descriptor[type]) && descriptor[type])
{
descriptorsOfType[prefix][shortName] = true;
}
}
}
}
return descriptorsOfType;
};
if (isNull(Descriptor.exceptionedDescriptors[exceptionedHash]))
{
let allExceptioned = {};
for (let i = 0; i < exceptionedDescriptorTypes.length; i++)
{
let descriptorsOfExceptionedType = getDescriptorsOfType(exceptionedDescriptorTypes[i]);
ObjectManipulator.mergeDeep(allExceptioned, descriptorsOfExceptionedType);
}
Descriptor.exceptionedDescriptors[exceptionedHash] = allExceptioned;
}
if (isNull(Descriptor.excludedDescriptors[excludedHash]))
{
let allExcluded = {};
for (let i = 0; i < excludedDescriptorTypes.length; i++)
{
let descriptorsOfExcludedType = getDescriptorsOfType(excludedDescriptorTypes[i]);
ObjectManipulator.mergeDeep(allExcluded, descriptorsOfExcludedType);
}
Descriptor.excludedDescriptors[excludedHash] = allExcluded;
}
const existsInMap = function (map, prefix, shortName)
{
if (!isNull(map) && !isNull(map[prefix]))
{
if (map[prefix] && map[prefix][shortName])
{
return true;
}
return false;
}
return false;
};
if (existsInMap(Descriptor.exceptionedDescriptors[exceptionedHash], prefix, shortName))
{
return true;
}
else if (existsInMap(Descriptor.excludedDescriptors[excludedHash], prefix, shortName))
{
if (Config.debug.descriptors.log_descriptor_filtering_operations)
{
Logger.log("Removing descriptor " + prefix + ":" + shortName + " because excluded descriptor types are " + JSON.stringify(excludedDescriptorTypes) + " and exceptioned descriptor types are " + JSON.stringify(exceptionedDescriptorTypes));
}
return false;
} return true;
};
Descriptor.prototype.isAuthorized = function (excludedDescriptorTypes, exceptionedDescriptorTypes)
{
const self = this;
const prefix = self.getNamespacePrefix();
const shortName = self.getShortName();
if (isNull(excludedDescriptorTypes) && isNull(exceptionedDescriptorTypes))
{
return true;
}
// TODO shortname is coming undefined here on some conditions! check
if (!isNull(prefix) && !isNull(shortName))
{
const isAuthorized = Descriptor.isAuthorized(prefix, shortName, excludedDescriptorTypes, exceptionedDescriptorTypes);
return isAuthorized;
}
throw new Error("Invalid descriptor " + prefix + ":" + shortName);
};
Descriptor.prototype.getNamespacePrefix = function ()
{
const self = this;
const ontologyURI = self.getOwnerOntologyUri(self.uri);
const prefix = Ontology.getOntologyPrefix(ontologyURI);
return prefix;
};
Descriptor.prototype.getShortName = function ()
{
const self = this;
const ontologyURI = self.getOwnerOntologyUri(self.uri);
let shortName = self.uri.replace(ontologyURI, "");
if (shortName[0] === ("/") || shortName[0] === "#")
{
shortName = shortName.substring();
}
return shortName;
};
Descriptor.prototype.getOwnerOntologyUri = function ()
{
const self = this;
let ontologyURI;
// ontology ends with a cardinal
if (self.uri.match(/.*#[^#]+$/))
{
ontologyURI = self.uri.replace(/#[^#]+$/, "#");
}
// ontology ends with a forward slash
else if (self.uri.match(/.*\/[^\/]+$/))
{
ontologyURI = self.uri.replace(/\/[^\/]+$/, "/");
}
// from http://stackoverflow.com/questions/8590052/regular-expression-remove-everything-after-last-forward-slash
return ontologyURI;
};
Descriptor.prototype.getPrefixedForm = function ()
{
const self = this;
const prefix = self.getNamespacePrefix();
const shortName = self.getShortName();
const shortDescriptor = prefix + ":" + shortName;
return shortDescriptor;
};
Descriptor.prefixedFormsToFullUris = function (arrayOfPrefixedForms)
{
let arrayOfFullDescriptorUris = [arrayOfPrefixedForms.length];
for (let i = 0; i < arrayOfPrefixedForms.length; i++)
{
let prefixedForm = arrayOfPrefixedForms[i];
let descriptor = new Descriptor({
prefixedForm: prefixedForm
});
arrayOfFullDescriptorUris[i] = descriptor.uri;
}
return arrayOfFullDescriptorUris;
};
Descriptor.mergeDescriptors = function (descriptorsArray, callback)
{
const newDescriptors = {};
// clear all descriptors
const ontologyPrefixes = Ontology.getAllOntologyPrefixes();
for (var i = 0; i < ontologyPrefixes.length; i++)
{
const aPrefix = ontologyPrefixes[i];
newDescriptors[aPrefix] = {};
}
for (var i = 0; i < descriptorsArray.length; i++)
{
const descriptor = descriptorsArray[i];
if (newDescriptors[descriptor.prefix][descriptor.shortName] instanceof Array)
{
if (descriptor.value instanceof Array)
{
newDescriptors[descriptor.prefix][descriptor.shortName] = _.union(newDescriptors[descriptor.prefix][descriptor.shortName], descriptor.value);
}
else if (!isNull(descriptor.value))
{
newDescriptors[descriptor.prefix][descriptor.shortName].push(descriptor.value);
}
}
else if (!isNull(newDescriptors[descriptor.prefix][descriptor.shortName]))
{
if (descriptor.value instanceof Array)
{
let newValues = newDescriptors[descriptor.prefix][descriptor.shortName];
if (newValues instanceof Array)
{
newDescriptors[descriptor.prefix][descriptor.shortName] = _.union(descriptor.value, newValues);
}
else
{
newDescriptors[descriptor.prefix][descriptor.shortName] = _.union(descriptor.value, [newValues]);
}
}
else if (!isNull(descriptor.value))
{
newDescriptors[descriptor.prefix][descriptor.shortName] = [newDescriptors[descriptor.prefix][descriptor.shortName], descriptor.value];
}
}
else
{
newDescriptors[descriptor.prefix][descriptor.shortName] = descriptor.value;
}
}
const formattedDescriptors = [];
for (let prefix in newDescriptors)
{
for (let shortName in newDescriptors[prefix])
{
formattedDescriptors.push(new Descriptor({
prefix: prefix,
shortName: shortName,
value: newDescriptors[prefix][shortName]
}));
}
}
const getFullDescriptor = function (descriptor, cb)
{
Descriptor.findByUri(descriptor.uri, function (err, fullDescriptor)
{
if (isNull(err) && !isNull(fullDescriptor) && fullDescriptor instanceof Descriptor)
{
fullDescriptor.value = descriptor.value;
cb(null, fullDescriptor);
}
else
{
cb(err, descriptor);
}
});
};
async.mapSeries(formattedDescriptors, getFullDescriptor, function (err, fullDescriptors)
{
return callback(err, fullDescriptors);
});
};
Descriptor.getRandomDescriptors = function (allowedOntologies, numberOfDescriptors, callback)
{
const randomDescriptors = [];
let descriptorCount = 0;
const publicOntologies = Ontology.getPublicOntologiesUris();
if (!isNull(allowedOntologies) && allowedOntologies instanceof Array && allowedOntologies.length > 0)
{
allowedOntologies = _.intersection(publicOntologies, allowedOntologies);
}
else
{
allowedOntologies = publicOntologies;
}
/**
* validate if ontologies are able to supply the requested amount of descriptors
*/
for (var i = 0; i < allowedOntologies.length; i++)
{
const ontology = new Ontology(
{
uri: allowedOntologies[i]
}
);
descriptorCount += Object.keys(ontology.elements).length;
}
if (descriptorCount < numberOfDescriptors)
{
numberOfDescriptors = descriptorCount;
}
/** lets get the descriptors**/
async.whilst(
function ()
{
return randomDescriptors.length < numberOfDescriptors;
},
function (cb)
{
const randomOntology = new Ontology({
uri: _.sample(allowedOntologies)
});
if (isNull(randomOntology))
{
Logger.log("error", "Error fetching random ontology from among " + JSON.stringify(allowedOntologies));
return callback(null);
}
const descriptorKeys = Object.keys(randomOntology.elements);
const randomDescriptorKey = _.sample(descriptorKeys);
const randomDescriptor = new Descriptor({
ontology: randomOntology.uri,
shortName: randomDescriptorKey
});
let alreadySelected = false;
for (let i = 0; i < randomDescriptors.length; i++)
{
if (randomDescriptors[i].uri === randomDescriptor.uri)
{
alreadySelected = true;
break;
}
}
if (isNull(randomDescriptor) || !isNull(randomDescriptor.error) || alreadySelected)
{
cb(null);
}
else
{
Descriptor.findByUri(randomDescriptor.uri, function (err, descriptor)
{
if (isNull(err))
{
if (!isNull(descriptor) && isNull(descriptor.error))
{
randomDescriptor.recommendation_types = {};
randomDescriptor.recommendation_types[Descriptor.recommendation_types.random.key] = true;
randomDescriptors.push(descriptor);
}
else
{
if (Config.debug.log_missing_unknown_descriptors)
{
Logger.log("error", "Unable to find descriptor with URI : " + randomDescriptor.uri + ". Review the loaded ontologies and the elements.js configuration file.");
}
cb(null);
}
cb(null);
}
else
{
cb(1); // real ERROR, STOP HERE
}
});
}
},
function (err)
{
return callback(err, randomDescriptors);
}
);
};
Descriptor.mostUsedPublicDescriptors = function (maxResults, callback, allowedOntologies)
{
let argumentsArray = [
{
value: db.graphUri,
type: Elements.types.resourceNoEscape
}
];
const publicOntologies = Ontology.getPublicOntologiesUris();
if (!isNull(allowedOntologies) && allowedOntologies instanceof Array)
{
allowedOntologies = _.intersection(publicOntologies, allowedOntologies);
}
else
{
allowedOntologies = publicOntologies;
}
let fromString = "";
const fromElements = DbConnection.buildFromStringAndArgumentsArrayForOntologies(allowedOntologies, argumentsArray.length);
argumentsArray = argumentsArray.concat(fromElements.argumentsArray);
fromString = fromString + fromElements.fromString;
const filterString = DbConnection.buildFilterStringForOntologies(allowedOntologies, "uri");
const query =
"SELECT DISTINCT(?uri), ?label, ?comment, ?overall_use_count \n" +
"WHERE { \n" +
"{ \n" +
" SELECT DISTINCT(?uri), (count(?o) as ?overall_use_count) \n" +
" FROM [0] \n" +
" " + fromString + " \n" +
" WHERE \n" +
" { \n" +
" ?s ?uri ?o \n" +
" } \n" +
" GROUP BY ?uri \n" +
"} . \n" +
"OPTIONAL { \n" +
" ?uri rdfs:label ?label . \n" +
" FILTER (lang(?label) = \"\" || lang(?label) = \"en\")" +
"}. \n" +
"OPTIONAL { \n" +
" ?uri rdfs:comment ?comment. \n " +
" FILTER (lang(?comment) = \"\" || lang(?comment) = \"en\")" +
"} . \n" +
" " + filterString + "\n" +
" FILTER( (str(?label) != \"\") && ( str(?comment) != \"\") ). \n" +
"}" +
"ORDER BY DESC(?overall_use_count) \n" +
"LIMIT " + maxResults;
db.connection.executeViaJDBC(
query,
argumentsArray,
function (err, descriptors)
{
if (isNull(err))
{
const createDescriptor = function (result, callback)
{
const suggestion = new Descriptor({
uri: result.uri,
label: result.label,
comment: result.comment
});
if (result.overall_use_count <= 0)
{
Logger.log("error", "Descriptor " + suggestion.uri + " recommended for overall use with invalid number of usages : " + result.recent_use_count);
}
// set recommendation type
suggestion.recommendation_types = {};
suggestion.recommendation_types[Descriptor.recommendation_types.frequently_used_overall.key] = true;
suggestion.overall_use_count = parseInt(result.overall_use_count);
if (suggestion instanceof Descriptor && suggestion.isAuthorized([Elements.access_types.private, Elements.access_types.locked]))
{
return callback(null, suggestion);
}
return callback(null, null);
};
async.mapSeries(descriptors, createDescriptor, function (err, fullDescriptors)
{
if (isNull(err))
{
/** remove nulls (that were unauthorized descriptors)**/
fullDescriptors = _.without(fullDescriptors, null);
return callback(null, fullDescriptors);
}
return callback(1, null);
});
}
else
{
const util = require("util");
Logger.log("error", "Error fetching most used public descriptors: " + descriptors);
return callback(1, descriptors);
}
});
};
Descriptor.findByLabelOrComment = function (filterValue, maxResults, callback, allowedOntologies)
{
let argumentsArray = [
{
value: db.graphUri,
type: Elements.types.resourceNoEscape
}
];
const publicOntologies = Ontology.getPublicOntologiesUris();
if (!isNull(allowedOntologies) && allowedOntologies instanceof Array)
{
allowedOntologies = _.intersection(publicOntologies, allowedOntologies);
}
else
{
allowedOntologies = publicOntologies;
}
let fromString = "";
const fromElements = DbConnection.buildFromStringAndArgumentsArrayForOntologies(allowedOntologies, argumentsArray.length);
argumentsArray = argumentsArray.concat(fromElements.argumentsArray);
fromString = fromString + fromElements.fromString;
const filterString = DbConnection.buildFilterStringForOntologies(Ontology.getPublicOntologiesUris(), "uri");
const query =
"SELECT DISTINCT(?uri)\n" +
"FROM [0] \n" +
fromString + " \n" +
"WHERE { \n" +
" ?uri rdfs:comment ?comment . \n" +
" ?uri rdfs:label ?label . \n" +
" FILTER NOT EXISTS { ?uri rdf:type owl:Class } \n" + // eliminate classes, as all descriptors are properties
" FILTER EXISTS { ?uri rdfs:comment ?comment } \n" +
" FILTER EXISTS { ?uri rdfs:label ?label } \n" +
" FILTER (regex(?label, \"" + filterValue + "\", \"i\") || regex(?comment, \"" + filterValue + "\", \"i\" )). \n" +
" FILTER( (str(?label) != \"\") && ( str(?comment) != \"\") ). \n" +
" " + filterString +
" } \n" +
"ORDER BY DESC(regex(?label, \"^" + filterValue + "$\", \"i\")) \n" +
" LIMIT " + maxResults;
db.connection.executeViaJDBC(
query,
argumentsArray,
function (err, descriptors)
{
if (isNull(err))
{
const createDescriptor = function (result, callback)
{
Descriptor.findByUri(result.uri, function (err, descriptor)
{
return callback(err, descriptor);
});
};
async.mapSeries(descriptors, createDescriptor, function (err, fullDescriptors)
{
if (isNull(err))
{
return callback(null, fullDescriptors);
}
return callback(1, null);
});
}
else
{
const util = require("util");
Logger.log("error", "Error fetching descriptors by label or comment ontology. Filter value: " + filterValue + ". error reported: " + descriptors);
return callback(1, descriptors);
}
});
};
Descriptor.validateDescriptorParametrization = function (callback)
{
const allOntologies = Ontology.getAllOntologiesUris();
let error = null;
async.mapLimit(allOntologies,
1,
function (ontology, callback)
{
Descriptor.all_in_ontology(ontology, function (err, descriptors)
{
if (isNull(err))
{
for (let i = 0; i < descriptors.length; i++)
{
const descriptor = descriptors[i];
try
{
if (isNull(Elements.ontologies[descriptor.prefix]))
{
if (Config.debug.descriptors.log_missing_unknown_descriptors)
{
Logger.log("error", "Descriptor " + JSON.stringify(descriptor) + " has an unparametrized namespace " + descriptor.prefix + " . Check your elements.js file and ontology.js file");
}
error = 1;
}
else if (isNull(Elements.ontologies[descriptor.prefix][descriptor.shortName]))
{
if (Config.debug.descriptors.log_missing_unknown_descriptors)
{
Logger.log("error", "Descriptor " + descriptor.prefixedForm + " is not present in the elements.js file!");
}
error = 1;
}
else if (isNull(Elements.ontologies[descriptor.prefix][descriptor.shortName].control))
{
if (Config.debug.descriptors.log_missing_unknown_descriptors)
{
Logger.log("error", "Descriptor " + descriptor.prefixedForm + " is present in the elements.js file, but has no control type associated! Correct the error by setting the appropriate control type.");
}
error = 1;
}
}
catch (e)
{
if (!isNull(e.stack))
{
Logger.log("error", e.stack);
}
else
{
Logger.log("error", JSON.stringify(e));
}
return callback(1, "Exception occurred when checking descriptor configuration " + JSON.stringify(e));
}
}
if (error && Config.debug.descriptors.log_missing_unknown_descriptors)
{
Logger.log("error", "[WARNING] There are unparametrized descriptors in ontology " + ontology);
}
return callback(null);
}
return callback(1, "Unable to fetch all descriptors from ontology " + ontology);
});
},
function (error, results)
{
if (error)
{
return callback(1, "Some descriptors found to be not parametrized. Check your elements.js file and correct accordingly.");
}
return callback(null);
}
);
};
Descriptor.getUriFromPrefixedForm = function (prefixedForm)
{
if (!isNull(prefixedForm))
{
const indexOfColon = prefixedForm.indexOf(":");
const indexOfHash = prefixedForm.indexOf("#");
let indexOfSeparator = -1;
if (indexOfColon < 0 && indexOfHash > -1)
{
indexOfSeparator = indexOfHash;
}
else if (indexOfColon > -1 && indexOfHash < 0)
{
indexOfSeparator = indexOfColon;
}
if (indexOfSeparator > 0)
{
const prefix = prefixedForm.substr(0, indexOfSeparator);
const element = prefixedForm.substr(indexOfSeparator + 1);
const ontology = Ontology.allOntologies[prefix].uri;
const valueAsFullUri = ontology + element;
return valueAsFullUri;
}
throw new Error("Value " + prefixedForm + " is not valid. It does not have either a : or a # in the prefixed form.");
}
else
{
throw new Error("Value " + prefixedForm.value + " is null!");
}
};
Descriptor.convertToFullUris = function (prefixedFormsArray)
{
let results;
if (isNull(prefixedFormsArray))
{
results = [];
}
else
{
if (prefixedFormsArray instanceof Array)
{
results = _.map(prefixedFormsArray, Descriptor.getUriFromPrefixedForm).sort();
}
else
{
results = Descriptor.getUriFromPrefixedForm(prefixedFormsArray);
}
}
return results;
};
module.exports.Descriptor = Descriptor;
|
from collections import defaultdict
def return_default():
return 0
def dd():
return defaultdict(return_default)
CHALLENGE_DAY = "11"
REAL = open(CHALLENGE_DAY + ".txt").read()
SAMPLE = open(CHALLENGE_DAY + ".sample.txt").read()
SAMPLE_EXPECTED = 26
# SAMPLE_EXPECTED =
FLOOR = "."
EMPTY = "L"
OCCUPIED = "#"
def parse_lines(raw):
# Groups.
# split = raw.split("\n\n")
# return list(map(lambda group: group.split("\n"), split))
split = raw.split("\n")
# return split # raw
# return list(map(lambda l: l.split(" "), split)) # words.
# return list(map(int, split))
return list(map(lambda l: list(l.strip()), split)) # beware leading / trailing WS
import copy
def run_round(old_board):
b = copy.deepcopy(old_board)
changed = 0
for y in range(len(b)):
for x in range(len(b[y])):
here = old_board[y][x]
if here == FLOOR:
continue
occ_adj = 0
for dx in range(-1, 2):
for dy in range(-1, 2):
if dx == dy and dx == 0:
continue
nx = x
ny = y
while True:
nx += dx
ny += dy
if 0 <= ny < len(b) and 0 <= nx < len(b[ny]):
if nx == x and ny == y:
break
if old_board[ny][nx] == OCCUPIED:
occ_adj += 1
break
elif old_board[ny][nx] == EMPTY:
break
else:
break
# print(occ_adj)
nv = here
if here == EMPTY:
if occ_adj == 0:
changed += 1
nv = OCCUPIED
elif here == OCCUPIED:
if occ_adj >= 5:
changed += 1
nv = EMPTY
b[y][x] = nv
print("\n".join(map(lambda l: "".join(l), b)))
print("\n")
return (b, changed)
def solve(raw):
board = parse_lines(raw)
# Debug here to make sure parsing is good.
ret = 0
while True:
board, changed = run_round(board)
if not changed:
num_occ = 0
for y in range(len(board)):
for x in range(len(board[y])):
if board[y][x] == OCCUPIED:
num_occ += 1
return num_occ
assert False
return ret
def test_parsing(lines):
if isinstance(lines, list):
for i in range(min(5, len(lines))):
print(lines[i])
elif isinstance(lines, dict) or isinstance(lines, defaultdict):
nd = {}
for k in list(lines.keys())[0: 5]:
print("\"" + k + "\": " + str(lines[k]))
test_parsing(parse_lines(SAMPLE))
print("^^^^^^^^^PARSED SAMPLE SAMPLE^^^^^^^^^")
sample = solve(SAMPLE)
if SAMPLE_EXPECTED is None:
print("*** SKIPPING SAMPLE! ***")
else:
assert sample == SAMPLE_EXPECTED
print("*** SAMPLE PASSED ***")
solved = solve(REAL)
print("SOLUTION: ", solved)
import pandas as pd
df=pd.DataFrame([str(solved)])
df.to_clipboard(index=False,header=False)
print("COPIED TO CLIPBOARD")
# assert solved
|
var $jscomp = $jscomp || {};
$jscomp.scope = {};
$jscomp.ASSUME_ES5 = false;
$jscomp.ASSUME_NO_NATIVE_MAP = false;
$jscomp.ASSUME_NO_NATIVE_SET = false;
$jscomp.defineProperty = $jscomp.ASSUME_ES5 || typeof Object.defineProperties == 'function' ? Object.defineProperty : function(target, property, descriptor) {
descriptor = descriptor;
if (target == Array.prototype || target == Object.prototype) {
return;
}
target[property] = descriptor.value;
};
$jscomp.getGlobal = function(maybeGlobal) {
return typeof window != 'undefined' && window === maybeGlobal ? maybeGlobal : typeof global != 'undefined' && global != null ? global : maybeGlobal;
};
$jscomp.global = $jscomp.getGlobal(this);
$jscomp.polyfill = function(target, polyfill, fromLang, toLang) {
if (!polyfill) {
return;
}
var obj = $jscomp.global;
var split = target.split('.');
for (var i = 0; i < split.length - 1; i++) {
var key = split[i];
if (!(key in obj)) {
obj[key] = {};
}
obj = obj[key];
}
var property = split[split.length - 1];
var orig = obj[property];
var impl = polyfill(orig);
if (impl == orig || impl == null) {
return;
}
$jscomp.defineProperty(obj, property, {configurable:true, writable:true, value:impl});
};
$jscomp.polyfill('Array.prototype.copyWithin', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(target, start, opt_end) {
var len = this.length;
target = Number(target);
start = Number(start);
opt_end = Number(opt_end != null ? opt_end : len);
if (target < start) {
opt_end = Math.min(opt_end, len);
while (start < opt_end) {
if (start in this) {
this[target++] = this[start++];
} else {
delete this[target++];
start++;
}
}
} else {
opt_end = Math.min(opt_end, len + start - target);
target += opt_end - start;
while (opt_end > start) {
if (--opt_end in this) {
this[--target] = this[opt_end];
} else {
delete this[target];
}
}
}
return this;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.SYMBOL_PREFIX = 'jscomp_symbol_';
$jscomp.initSymbol = function() {
$jscomp.initSymbol = function() {
};
if (!$jscomp.global['Symbol']) {
$jscomp.global['Symbol'] = $jscomp.Symbol;
}
};
$jscomp.Symbol = function() {
var counter = 0;
function Symbol(opt_description) {
return $jscomp.SYMBOL_PREFIX + (opt_description || '') + counter++;
}
return Symbol;
}();
$jscomp.initSymbolIterator = function() {
$jscomp.initSymbol();
var symbolIterator = $jscomp.global['Symbol'].iterator;
if (!symbolIterator) {
symbolIterator = $jscomp.global['Symbol'].iterator = $jscomp.global['Symbol']('iterator');
}
if (typeof Array.prototype[symbolIterator] != 'function') {
$jscomp.defineProperty(Array.prototype, symbolIterator, {configurable:true, writable:true, value:function() {
return $jscomp.arrayIterator(this);
}});
}
$jscomp.initSymbolIterator = function() {
};
};
$jscomp.arrayIterator = function(array) {
var index = 0;
return $jscomp.iteratorPrototype(function() {
if (index < array.length) {
return {done:false, value:array[index++]};
} else {
return {done:true};
}
});
};
$jscomp.iteratorPrototype = function(next) {
$jscomp.initSymbolIterator();
var iterator = {next:next};
iterator[$jscomp.global['Symbol'].iterator] = function() {
return this;
};
return iterator;
};
$jscomp.iteratorFromArray = function(array, transform) {
$jscomp.initSymbolIterator();
if (array instanceof String) {
array = array + '';
}
var i = 0;
var iter = {next:function() {
if (i < array.length) {
var index = i++;
return {value:transform(index, array[index]), done:false};
}
iter.next = function() {
return {done:true, value:void 0};
};
return iter.next();
}};
iter[Symbol.iterator] = function() {
return iter;
};
return iter;
};
$jscomp.polyfill('Array.prototype.entries', function(orig) {
if (orig) {
return orig;
}
var polyfill = function() {
return $jscomp.iteratorFromArray(this, function(i, v) {
return [i, v];
});
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Array.prototype.fill', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(value, opt_start, opt_end) {
var length = this.length || 0;
if (opt_start < 0) {
opt_start = Math.max(0, length + opt_start);
}
if (opt_end == null || opt_end > length) {
opt_end = length;
}
opt_end = Number(opt_end);
if (opt_end < 0) {
opt_end = Math.max(0, length + opt_end);
}
for (var i = Number(opt_start || 0); i < opt_end; i++) {
this[i] = value;
}
return this;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.findInternal = function(array, callback, thisArg) {
if (array instanceof String) {
array = String(array);
}
var len = array.length;
for (var i = 0; i < len; i++) {
var value = array[i];
if (callback.call(thisArg, value, i, array)) {
return {i:i, v:value};
}
}
return {i:-1, v:void 0};
};
$jscomp.polyfill('Array.prototype.find', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(callback, opt_thisArg) {
return $jscomp.findInternal(this, callback, opt_thisArg).v;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Array.prototype.findIndex', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(callback, opt_thisArg) {
return $jscomp.findInternal(this, callback, opt_thisArg).i;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Array.from', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(arrayLike, opt_mapFn, opt_thisArg) {
$jscomp.initSymbolIterator();
opt_mapFn = opt_mapFn != null ? opt_mapFn : function(x) {
return x;
};
var result = [];
var iteratorFunction = arrayLike[Symbol.iterator];
if (typeof iteratorFunction == 'function') {
arrayLike = iteratorFunction.call(arrayLike);
var next;
var k = 0;
while (!(next = arrayLike.next()).done) {
result.push(opt_mapFn.call(opt_thisArg, next.value, k++));
}
} else {
var len = arrayLike.length;
for (var i = 0; i < len; i++) {
result.push(opt_mapFn.call(opt_thisArg, arrayLike[i], i));
}
}
return result;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Object.is', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(left, right) {
if (left === right) {
return left !== 0 || 1 / left === 1 / right;
} else {
return left !== left && right !== right;
}
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Array.prototype.includes', function(orig) {
if (orig) {
return orig;
}
var includes = function(searchElement, opt_fromIndex) {
var array = this;
if (array instanceof String) {
array = String(array);
}
var len = array.length;
var i = opt_fromIndex || 0;
if (i < 0) {
i = Math.max(i + len, 0);
}
for (; i < len; i++) {
var element = array[i];
if (element === searchElement || Object.is(element, searchElement)) {
return true;
}
}
return false;
};
return includes;
}, 'es7', 'es3');
$jscomp.polyfill('Array.prototype.keys', function(orig) {
if (orig) {
return orig;
}
var polyfill = function() {
return $jscomp.iteratorFromArray(this, function(i) {
return i;
});
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Array.of', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(var_args) {
return Array.from(arguments);
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Array.prototype.values', function(orig) {
if (orig) {
return orig;
}
var polyfill = function() {
return $jscomp.iteratorFromArray(this, function(k, v) {
return v;
});
};
return polyfill;
}, 'es8', 'es3');
$jscomp.makeIterator = function(iterable) {
$jscomp.initSymbolIterator();
var iteratorFunction = iterable[Symbol.iterator];
return iteratorFunction ? iteratorFunction.call(iterable) : $jscomp.arrayIterator(iterable);
};
$jscomp.FORCE_POLYFILL_PROMISE = false;
$jscomp.polyfill('Promise', function(NativePromise) {
if (NativePromise && !$jscomp.FORCE_POLYFILL_PROMISE) {
return NativePromise;
}
function AsyncExecutor() {
this.batch_ = null;
}
AsyncExecutor.prototype.asyncExecute = function(f) {
if (this.batch_ == null) {
this.batch_ = [];
this.asyncExecuteBatch_();
}
this.batch_.push(f);
return this;
};
AsyncExecutor.prototype.asyncExecuteBatch_ = function() {
var self = this;
this.asyncExecuteFunction(function() {
self.executeBatch_();
});
};
var nativeSetTimeout = $jscomp.global['setTimeout'];
AsyncExecutor.prototype.asyncExecuteFunction = function(f) {
nativeSetTimeout(f, 0);
};
AsyncExecutor.prototype.executeBatch_ = function() {
while (this.batch_ && this.batch_.length) {
var executingBatch = this.batch_;
this.batch_ = [];
for (var i = 0; i < executingBatch.length; ++i) {
var f = executingBatch[i];
executingBatch[i] = null;
try {
f();
} catch (error) {
this.asyncThrow_(error);
}
}
}
this.batch_ = null;
};
AsyncExecutor.prototype.asyncThrow_ = function(exception) {
this.asyncExecuteFunction(function() {
throw exception;
});
};
var PromiseState = {PENDING:0, FULFILLED:1, REJECTED:2};
var PolyfillPromise = function(executor) {
this.state_ = PromiseState.PENDING;
this.result_ = undefined;
this.onSettledCallbacks_ = [];
var resolveAndReject = this.createResolveAndReject_();
try {
executor(resolveAndReject.resolve, resolveAndReject.reject);
} catch (e) {
resolveAndReject.reject(e);
}
};
PolyfillPromise.prototype.createResolveAndReject_ = function() {
var thisPromise = this;
var alreadyCalled = false;
function firstCallWins(method) {
return function(x) {
if (!alreadyCalled) {
alreadyCalled = true;
method.call(thisPromise, x);
}
};
}
return {resolve:firstCallWins(this.resolveTo_), reject:firstCallWins(this.reject_)};
};
PolyfillPromise.prototype.resolveTo_ = function(value) {
if (value === this) {
this.reject_(new TypeError('A Promise cannot resolve to itself'));
} else {
if (value instanceof PolyfillPromise) {
this.settleSameAsPromise_(value);
} else {
if (isObject(value)) {
this.resolveToNonPromiseObj_(value);
} else {
this.fulfill_(value);
}
}
}
};
PolyfillPromise.prototype.resolveToNonPromiseObj_ = function(obj) {
var thenMethod = undefined;
try {
thenMethod = obj.then;
} catch (error) {
this.reject_(error);
return;
}
if (typeof thenMethod == 'function') {
this.settleSameAsThenable_(thenMethod, obj);
} else {
this.fulfill_(obj);
}
};
function isObject(value) {
switch(typeof value) {
case 'object':
return value != null;
case 'function':
return true;
default:
return false;
}
}
PolyfillPromise.prototype.reject_ = function(reason) {
this.settle_(PromiseState.REJECTED, reason);
};
PolyfillPromise.prototype.fulfill_ = function(value) {
this.settle_(PromiseState.FULFILLED, value);
};
PolyfillPromise.prototype.settle_ = function(settledState, valueOrReason) {
if (this.state_ != PromiseState.PENDING) {
throw new Error('Cannot settle(' + settledState + ', ' + valueOrReason + '): Promise already settled in state' + this.state_);
}
this.state_ = settledState;
this.result_ = valueOrReason;
this.executeOnSettledCallbacks_();
};
PolyfillPromise.prototype.executeOnSettledCallbacks_ = function() {
if (this.onSettledCallbacks_ != null) {
for (var i = 0; i < this.onSettledCallbacks_.length; ++i) {
asyncExecutor.asyncExecute(this.onSettledCallbacks_[i]);
}
this.onSettledCallbacks_ = null;
}
};
var asyncExecutor = new AsyncExecutor;
PolyfillPromise.prototype.settleSameAsPromise_ = function(promise) {
var methods = this.createResolveAndReject_();
promise.callWhenSettled_(methods.resolve, methods.reject);
};
PolyfillPromise.prototype.settleSameAsThenable_ = function(thenMethod, thenable) {
var methods = this.createResolveAndReject_();
try {
thenMethod.call(thenable, methods.resolve, methods.reject);
} catch (error) {
methods.reject(error);
}
};
PolyfillPromise.prototype.then = function(onFulfilled, onRejected) {
var resolveChild;
var rejectChild;
var childPromise = new PolyfillPromise(function(resolve, reject) {
resolveChild = resolve;
rejectChild = reject;
});
function createCallback(paramF, defaultF) {
if (typeof paramF == 'function') {
return function(x) {
try {
resolveChild(paramF(x));
} catch (error) {
rejectChild(error);
}
};
} else {
return defaultF;
}
}
this.callWhenSettled_(createCallback(onFulfilled, resolveChild), createCallback(onRejected, rejectChild));
return childPromise;
};
PolyfillPromise.prototype['catch'] = function(onRejected) {
return this.then(undefined, onRejected);
};
PolyfillPromise.prototype.callWhenSettled_ = function(onFulfilled, onRejected) {
var thisPromise = this;
function callback() {
switch(thisPromise.state_) {
case PromiseState.FULFILLED:
onFulfilled(thisPromise.result_);
break;
case PromiseState.REJECTED:
onRejected(thisPromise.result_);
break;
default:
throw new Error('Unexpected state: ' + thisPromise.state_);
}
}
if (this.onSettledCallbacks_ == null) {
asyncExecutor.asyncExecute(callback);
} else {
this.onSettledCallbacks_.push(callback);
}
};
function resolvingPromise(opt_value) {
if (opt_value instanceof PolyfillPromise) {
return opt_value;
} else {
return new PolyfillPromise(function(resolve, reject) {
resolve(opt_value);
});
}
}
PolyfillPromise['resolve'] = resolvingPromise;
PolyfillPromise['reject'] = function(opt_reason) {
return new PolyfillPromise(function(resolve, reject) {
reject(opt_reason);
});
};
PolyfillPromise['race'] = function(thenablesOrValues) {
return new PolyfillPromise(function(resolve, reject) {
var iterator = $jscomp.makeIterator(thenablesOrValues);
for (var iterRec = iterator.next(); !iterRec.done; iterRec = iterator.next()) {
resolvingPromise(iterRec.value).callWhenSettled_(resolve, reject);
}
});
};
PolyfillPromise['all'] = function(thenablesOrValues) {
var iterator = $jscomp.makeIterator(thenablesOrValues);
var iterRec = iterator.next();
if (iterRec.done) {
return resolvingPromise([]);
} else {
return new PolyfillPromise(function(resolveAll, rejectAll) {
var resultsArray = [];
var unresolvedCount = 0;
function onFulfilled(i) {
return function(ithResult) {
resultsArray[i] = ithResult;
unresolvedCount--;
if (unresolvedCount == 0) {
resolveAll(resultsArray);
}
};
}
do {
resultsArray.push(undefined);
unresolvedCount++;
resolvingPromise(iterRec.value).callWhenSettled_(onFulfilled(resultsArray.length - 1), rejectAll);
iterRec = iterator.next();
} while (!iterRec.done);
});
}
};
return PolyfillPromise;
}, 'es6', 'es3');
$jscomp.polyfill('Promise.prototype.finally', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(onFinally) {
return this.then(function(value) {
var promise = Promise.resolve(onFinally());
return promise.then(function() {
return value;
});
}, function(reason) {
var promise = Promise.resolve(onFinally());
return promise.then(function() {
throw reason;
});
});
};
return polyfill;
}, 'es9', 'es3');
$jscomp.underscoreProtoCanBeSet = function() {
var x = {a:true};
var y = {};
try {
y.__proto__ = x;
return y.a;
} catch (e) {
}
return false;
};
$jscomp.setPrototypeOf = typeof Object.setPrototypeOf == 'function' ? Object.setPrototypeOf : $jscomp.underscoreProtoCanBeSet() ? function(target, proto) {
target.__proto__ = proto;
if (target.__proto__ !== proto) {
throw new TypeError(target + ' is not extensible');
}
return target;
} : null;
$jscomp.generator = {};
$jscomp.generator.ensureIteratorResultIsObject_ = function(result) {
if (result instanceof Object) {
return;
}
throw new TypeError('Iterator result ' + result + ' is not an object');
};
$jscomp.generator.Context = function() {
this.isRunning_ = false;
this.yieldAllIterator_ = null;
this.yieldResult = undefined;
this.nextAddress = 1;
this.catchAddress_ = 0;
this.finallyAddress_ = 0;
this.abruptCompletion_ = null;
this.finallyContexts_ = null;
};
$jscomp.generator.Context.prototype.start_ = function() {
if (this.isRunning_) {
throw new TypeError('Generator is already running');
}
this.isRunning_ = true;
};
$jscomp.generator.Context.prototype.stop_ = function() {
this.isRunning_ = false;
};
$jscomp.generator.Context.prototype.jumpToErrorHandler_ = function() {
this.nextAddress = this.catchAddress_ || this.finallyAddress_;
};
$jscomp.generator.Context.prototype.next_ = function(value) {
this.yieldResult = value;
};
$jscomp.generator.Context.prototype.throw_ = function(e) {
this.abruptCompletion_ = {exception:e, isException:true};
this.jumpToErrorHandler_();
};
$jscomp.generator.Context.prototype['return'] = function(value) {
this.abruptCompletion_ = {'return':value};
this.nextAddress = this.finallyAddress_;
};
$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks = function(nextAddress) {
this.abruptCompletion_ = {jumpTo:nextAddress};
this.nextAddress = this.finallyAddress_;
};
$jscomp.generator.Context.prototype.yield = function(value, resumeAddress) {
this.nextAddress = resumeAddress;
return {value:value};
};
$jscomp.generator.Context.prototype.yieldAll = function(iterable, resumeAddress) {
var iterator = $jscomp.makeIterator(iterable);
var result = iterator.next();
$jscomp.generator.ensureIteratorResultIsObject_(result);
if (result.done) {
this.yieldResult = result.value;
this.nextAddress = resumeAddress;
return;
}
this.yieldAllIterator_ = iterator;
return this.yield(result.value, resumeAddress);
};
$jscomp.generator.Context.prototype.jumpTo = function(nextAddress) {
this.nextAddress = nextAddress;
};
$jscomp.generator.Context.prototype.jumpToEnd = function() {
this.nextAddress = 0;
};
$jscomp.generator.Context.prototype.setCatchFinallyBlocks = function(catchAddress, finallyAddress) {
this.catchAddress_ = catchAddress;
if (finallyAddress != undefined) {
this.finallyAddress_ = finallyAddress;
}
};
$jscomp.generator.Context.prototype.setFinallyBlock = function(finallyAddress) {
this.catchAddress_ = 0;
this.finallyAddress_ = finallyAddress || 0;
};
$jscomp.generator.Context.prototype.leaveTryBlock = function(nextAddress, catchAddress) {
this.nextAddress = nextAddress;
this.catchAddress_ = catchAddress || 0;
};
$jscomp.generator.Context.prototype.enterCatchBlock = function(nextCatchBlockAddress) {
this.catchAddress_ = nextCatchBlockAddress || 0;
var exception = this.abruptCompletion_.exception;
this.abruptCompletion_ = null;
return exception;
};
$jscomp.generator.Context.prototype.enterFinallyBlock = function(nextCatchAddress, nextFinallyAddress, finallyDepth) {
if (!finallyDepth) {
this.finallyContexts_ = [this.abruptCompletion_];
} else {
this.finallyContexts_[finallyDepth] = this.abruptCompletion_;
}
this.catchAddress_ = nextCatchAddress || 0;
this.finallyAddress_ = nextFinallyAddress || 0;
};
$jscomp.generator.Context.prototype.leaveFinallyBlock = function(nextAddress, finallyDepth) {
var preservedContext = this.finallyContexts_.splice(finallyDepth || 0)[0];
var abruptCompletion = this.abruptCompletion_ = this.abruptCompletion_ || preservedContext;
if (abruptCompletion) {
if (abruptCompletion.isException) {
return this.jumpToErrorHandler_();
}
if (abruptCompletion.jumpTo != undefined && this.finallyAddress_ < abruptCompletion.jumpTo) {
this.nextAddress = abruptCompletion.jumpTo;
this.abruptCompletion_ = null;
} else {
this.nextAddress = this.finallyAddress_;
}
} else {
this.nextAddress = nextAddress;
}
};
$jscomp.generator.Context.prototype.forIn = function(object) {
return new $jscomp.generator.Context.PropertyIterator(object);
};
$jscomp.generator.Context.PropertyIterator = function(object) {
this.object_ = object;
this.properties_ = [];
for (var property in object) {
this.properties_.push(property);
}
this.properties_.reverse();
};
$jscomp.generator.Context.PropertyIterator.prototype.getNext = function() {
while (this.properties_.length > 0) {
var property = this.properties_.pop();
if (property in this.object_) {
return property;
}
}
return null;
};
$jscomp.generator.Engine_ = function(program) {
this.context_ = new $jscomp.generator.Context;
this.program_ = program;
};
$jscomp.generator.Engine_.prototype.next_ = function(value) {
this.context_.start_();
if (this.context_.yieldAllIterator_) {
return this.yieldAllStep_(this.context_.yieldAllIterator_.next, value, this.context_.next_);
}
this.context_.next_(value);
return this.nextStep_();
};
$jscomp.generator.Engine_.prototype.return_ = function(value) {
this.context_.start_();
var yieldAllIterator = this.context_.yieldAllIterator_;
if (yieldAllIterator) {
var returnFunction = 'return' in yieldAllIterator ? yieldAllIterator['return'] : function(v) {
return {value:v, done:true};
};
return this.yieldAllStep_(returnFunction, value, this.context_['return']);
}
this.context_['return'](value);
return this.nextStep_();
};
$jscomp.generator.Engine_.prototype.throw_ = function(exception) {
this.context_.start_();
if (this.context_.yieldAllIterator_) {
return this.yieldAllStep_(this.context_.yieldAllIterator_['throw'], exception, this.context_.next_);
}
this.context_.throw_(exception);
return this.nextStep_();
};
$jscomp.generator.Engine_.prototype.yieldAllStep_ = function(action, value, nextAction) {
try {
var result = action.call(this.context_.yieldAllIterator_, value);
$jscomp.generator.ensureIteratorResultIsObject_(result);
if (!result.done) {
this.context_.stop_();
return result;
}
var resultValue = result.value;
} catch (e) {
this.context_.yieldAllIterator_ = null;
this.context_.throw_(e);
return this.nextStep_();
}
this.context_.yieldAllIterator_ = null;
nextAction.call(this.context_, resultValue);
return this.nextStep_();
};
$jscomp.generator.Engine_.prototype.nextStep_ = function() {
while (this.context_.nextAddress) {
try {
var yieldValue = this.program_(this.context_);
if (yieldValue) {
this.context_.stop_();
return {value:yieldValue.value, done:false};
}
} catch (e) {
this.context_.yieldResult = undefined;
this.context_.throw_(e);
}
}
this.context_.stop_();
if (this.context_.abruptCompletion_) {
var abruptCompletion = this.context_.abruptCompletion_;
this.context_.abruptCompletion_ = null;
if (abruptCompletion.isException) {
throw abruptCompletion.exception;
}
return {value:abruptCompletion['return'], done:true};
}
return {value:undefined, done:true};
};
$jscomp.generator.Generator_ = function(engine) {
this.next = function(opt_value) {
return engine.next_(opt_value);
};
this['throw'] = function(exception) {
return engine.throw_(exception);
};
this['return'] = function(value) {
return engine.return_(value);
};
$jscomp.initSymbolIterator();
this[Symbol.iterator] = function() {
return this;
};
};
$jscomp.generator.createGenerator = function(generator, program) {
var result = new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(program));
if ($jscomp.setPrototypeOf) {
$jscomp.setPrototypeOf(result, generator.prototype);
}
return result;
};
$jscomp.asyncExecutePromiseGenerator = function(generator) {
function passValueToGenerator(value) {
return generator.next(value);
}
function passErrorToGenerator(error) {
return generator['throw'](error);
}
return new Promise(function(resolve, reject) {
function handleGeneratorRecord(genRec) {
if (genRec.done) {
resolve(genRec.value);
} else {
Promise.resolve(genRec.value).then(passValueToGenerator, passErrorToGenerator).then(handleGeneratorRecord, reject);
}
}
handleGeneratorRecord(generator.next());
});
};
$jscomp.asyncExecutePromiseGeneratorFunction = function(generatorFunction) {
return $jscomp.asyncExecutePromiseGenerator(generatorFunction());
};
$jscomp.asyncExecutePromiseGeneratorProgram = function(program) {
return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(program)));
};
$jscomp.checkEs6ConformanceViaProxy = function() {
try {
var proxied = {};
var proxy = Object.create(new $jscomp.global['Proxy'](proxied, {'get':function(target, key, receiver) {
return target == proxied && key == 'q' && receiver == proxy;
}}));
return proxy['q'] === true;
} catch (err) {
return false;
}
};
$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS = false;
$jscomp.ES6_CONFORMANCE = $jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS && $jscomp.checkEs6ConformanceViaProxy();
$jscomp.owns = function(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
};
$jscomp.polyfill('WeakMap', function(NativeWeakMap) {
function isConformant() {
if (!NativeWeakMap || !Object.seal) {
return false;
}
try {
var x = Object.seal({});
var y = Object.seal({});
var map = new NativeWeakMap([[x, 2], [y, 3]]);
if (map.get(x) != 2 || map.get(y) != 3) {
return false;
}
map['delete'](x);
map.set(y, 4);
return !map.has(x) && map.get(y) == 4;
} catch (err) {
return false;
}
}
if ($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS) {
if (NativeWeakMap && $jscomp.ES6_CONFORMANCE) {
return NativeWeakMap;
}
} else {
if (isConformant()) {
return NativeWeakMap;
}
}
var prop = '$jscomp_hidden_' + Math.random();
function insert(target) {
if (!$jscomp.owns(target, prop)) {
var obj = {};
$jscomp.defineProperty(target, prop, {value:obj});
}
}
function patch(name) {
var prev = Object[name];
if (prev) {
Object[name] = function(target) {
insert(target);
return prev(target);
};
}
}
patch('freeze');
patch('preventExtensions');
patch('seal');
var index = 0;
var PolyfillWeakMap = function(opt_iterable) {
this.id_ = (index += Math.random() + 1).toString();
if (opt_iterable) {
$jscomp.initSymbol();
$jscomp.initSymbolIterator();
var iter = $jscomp.makeIterator(opt_iterable);
var entry;
while (!(entry = iter.next()).done) {
var item = entry.value;
this.set(item[0], item[1]);
}
}
};
PolyfillWeakMap.prototype.set = function(key, value) {
insert(key);
if (!$jscomp.owns(key, prop)) {
throw new Error('WeakMap key fail: ' + key);
}
key[prop][this.id_] = value;
return this;
};
PolyfillWeakMap.prototype.get = function(key) {
return $jscomp.owns(key, prop) ? key[prop][this.id_] : undefined;
};
PolyfillWeakMap.prototype.has = function(key) {
return $jscomp.owns(key, prop) && $jscomp.owns(key[prop], this.id_);
};
PolyfillWeakMap.prototype['delete'] = function(key) {
if (!$jscomp.owns(key, prop) || !$jscomp.owns(key[prop], this.id_)) {
return false;
}
return delete key[prop][this.id_];
};
return PolyfillWeakMap;
}, 'es6', 'es3');
$jscomp.MapEntry = function() {
this.previous;
this.next;
this.head;
this.key;
this.value;
};
$jscomp.polyfill('Map', function(NativeMap) {
function isConformant() {
if ($jscomp.ASSUME_NO_NATIVE_MAP || !NativeMap || typeof NativeMap != 'function' || !NativeMap.prototype.entries || typeof Object.seal != 'function') {
return false;
}
try {
NativeMap = NativeMap;
var key = Object.seal({x:4});
var map = new NativeMap($jscomp.makeIterator([[key, 's']]));
if (map.get(key) != 's' || map.size != 1 || map.get({x:4}) || map.set({x:4}, 't') != map || map.size != 2) {
return false;
}
var iter = map.entries();
var item = iter.next();
if (item.done || item.value[0] != key || item.value[1] != 's') {
return false;
}
item = iter.next();
if (item.done || item.value[0].x != 4 || item.value[1] != 't' || !iter.next().done) {
return false;
}
return true;
} catch (err) {
return false;
}
}
if ($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS) {
if (NativeMap && $jscomp.ES6_CONFORMANCE) {
return NativeMap;
}
} else {
if (isConformant()) {
return NativeMap;
}
}
$jscomp.initSymbol();
$jscomp.initSymbolIterator();
var idMap = new WeakMap;
var PolyfillMap = function(opt_iterable) {
this.data_ = {};
this.head_ = createHead();
this.size = 0;
if (opt_iterable) {
var iter = $jscomp.makeIterator(opt_iterable);
var entry;
while (!(entry = iter.next()).done) {
var item = entry.value;
this.set(item[0], item[1]);
}
}
};
PolyfillMap.prototype.set = function(key, value) {
key = key === 0 ? 0 : key;
var r = maybeGetEntry(this, key);
if (!r.list) {
r.list = this.data_[r.id] = [];
}
if (!r.entry) {
r.entry = {next:this.head_, previous:this.head_.previous, head:this.head_, key:key, value:value};
r.list.push(r.entry);
this.head_.previous.next = r.entry;
this.head_.previous = r.entry;
this.size++;
} else {
r.entry.value = value;
}
return this;
};
PolyfillMap.prototype['delete'] = function(key) {
var r = maybeGetEntry(this, key);
if (r.entry && r.list) {
r.list.splice(r.index, 1);
if (!r.list.length) {
delete this.data_[r.id];
}
r.entry.previous.next = r.entry.next;
r.entry.next.previous = r.entry.previous;
r.entry.head = null;
this.size--;
return true;
}
return false;
};
PolyfillMap.prototype.clear = function() {
this.data_ = {};
this.head_ = this.head_.previous = createHead();
this.size = 0;
};
PolyfillMap.prototype.has = function(key) {
return !!maybeGetEntry(this, key).entry;
};
PolyfillMap.prototype.get = function(key) {
var entry = maybeGetEntry(this, key).entry;
return entry && entry.value;
};
PolyfillMap.prototype.entries = function() {
return makeIterator(this, function(entry) {
return [entry.key, entry.value];
});
};
PolyfillMap.prototype.keys = function() {
return makeIterator(this, function(entry) {
return entry.key;
});
};
PolyfillMap.prototype.values = function() {
return makeIterator(this, function(entry) {
return entry.value;
});
};
PolyfillMap.prototype.forEach = function(callback, opt_thisArg) {
var iter = this.entries();
var item;
while (!(item = iter.next()).done) {
var entry = item.value;
callback.call(opt_thisArg, entry[1], entry[0], this);
}
};
PolyfillMap.prototype[Symbol.iterator] = PolyfillMap.prototype.entries;
var maybeGetEntry = function(map, key) {
var id = getId(key);
var list = map.data_[id];
if (list && $jscomp.owns(map.data_, id)) {
for (var index = 0; index < list.length; index++) {
var entry = list[index];
if (key !== key && entry.key !== entry.key || key === entry.key) {
return {id:id, list:list, index:index, entry:entry};
}
}
}
return {id:id, list:list, index:-1, entry:undefined};
};
var makeIterator = function(map, func) {
var entry = map.head_;
return $jscomp.iteratorPrototype(function() {
if (entry) {
while (entry.head != map.head_) {
entry = entry.previous;
}
while (entry.next != entry.head) {
entry = entry.next;
return {done:false, value:func(entry)};
}
entry = null;
}
return {done:true, value:void 0};
});
};
var createHead = function() {
var head = {};
head.previous = head.next = head.head = head;
return head;
};
var mapIndex = 0;
var getId = function(obj) {
var type = obj && typeof obj;
if (type == 'object' || type == 'function') {
obj = obj;
if (!idMap.has(obj)) {
var id = '' + ++mapIndex;
idMap.set(obj, id);
return id;
}
return idMap.get(obj);
}
return 'p_' + obj;
};
return PolyfillMap;
}, 'es6', 'es3');
$jscomp.polyfill('Math.acosh', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
x = Number(x);
return Math.log(x + Math.sqrt(x * x - 1));
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.asinh', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
x = Number(x);
if (x === 0) {
return x;
}
var y = Math.log(Math.abs(x) + Math.sqrt(x * x + 1));
return x < 0 ? -y : y;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.log1p', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
x = Number(x);
if (x < 0.25 && x > -0.25) {
var y = x;
var d = 1;
var z = x;
var zPrev = 0;
var s = 1;
while (zPrev != z) {
y *= x;
s *= -1;
z = (zPrev = z) + s * y / ++d;
}
return z;
}
return Math.log(1 + x);
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.atanh', function(orig) {
if (orig) {
return orig;
}
var log1p = Math.log1p;
var polyfill = function(x) {
x = Number(x);
return (log1p(x) - log1p(-x)) / 2;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.cbrt', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
if (x === 0) {
return x;
}
x = Number(x);
var y = Math.pow(Math.abs(x), 1 / 3);
return x < 0 ? -y : y;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.clz32', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
x = Number(x) >>> 0;
if (x === 0) {
return 32;
}
var result = 0;
if ((x & 4294901760) === 0) {
x <<= 16;
result += 16;
}
if ((x & 4278190080) === 0) {
x <<= 8;
result += 8;
}
if ((x & 4026531840) === 0) {
x <<= 4;
result += 4;
}
if ((x & 3221225472) === 0) {
x <<= 2;
result += 2;
}
if ((x & 2147483648) === 0) {
result++;
}
return result;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.cosh', function(orig) {
if (orig) {
return orig;
}
var exp = Math.exp;
var polyfill = function(x) {
x = Number(x);
return (exp(x) + exp(-x)) / 2;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.expm1', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
x = Number(x);
if (x < .25 && x > -.25) {
var y = x;
var d = 1;
var z = x;
var zPrev = 0;
while (zPrev != z) {
y *= x / ++d;
z = (zPrev = z) + y;
}
return z;
}
return Math.exp(x) - 1;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.hypot', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x, y, var_args) {
x = Number(x);
y = Number(y);
var i, z, sum;
var max = Math.max(Math.abs(x), Math.abs(y));
for (i = 2; i < arguments.length; i++) {
max = Math.max(max, Math.abs(arguments[i]));
}
if (max > 1e100 || max < 1e-100) {
if (!max) {
return max;
}
x = x / max;
y = y / max;
sum = x * x + y * y;
for (i = 2; i < arguments.length; i++) {
z = Number(arguments[i]) / max;
sum += z * z;
}
return Math.sqrt(sum) * max;
} else {
sum = x * x + y * y;
for (i = 2; i < arguments.length; i++) {
z = Number(arguments[i]);
sum += z * z;
}
return Math.sqrt(sum);
}
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.imul', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(a, b) {
a = Number(a);
b = Number(b);
var ah = a >>> 16 & 65535;
var al = a & 65535;
var bh = b >>> 16 & 65535;
var bl = b & 65535;
var lh = ah * bl + al * bh << 16 >>> 0;
return al * bl + lh | 0;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.log10', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
return Math.log(x) / Math.LN10;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.log2', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
return Math.log(x) / Math.LN2;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.sign', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
x = Number(x);
return x === 0 || isNaN(x) ? x : x > 0 ? 1 : -1;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.sinh', function(orig) {
if (orig) {
return orig;
}
var exp = Math.exp;
var polyfill = function(x) {
x = Number(x);
if (x === 0) {
return x;
}
return (exp(x) - exp(-x)) / 2;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.tanh', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
x = Number(x);
if (x === 0) {
return x;
}
var y = Math.exp(-2 * Math.abs(x));
var z = (1 - y) / (1 + y);
return x < 0 ? -z : z;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Math.trunc', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
x = Number(x);
if (isNaN(x) || x === Infinity || x === -Infinity || x === 0) {
return x;
}
var y = Math.floor(Math.abs(x));
return x < 0 ? -y : y;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Number.EPSILON', function(orig) {
return Math.pow(2, -52);
}, 'es6', 'es3');
$jscomp.polyfill('Number.MAX_SAFE_INTEGER', function() {
return 9007199254740991;
}, 'es6', 'es3');
$jscomp.polyfill('Number.MIN_SAFE_INTEGER', function() {
return -9007199254740991;
}, 'es6', 'es3');
$jscomp.polyfill('Number.isFinite', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
if (typeof x !== 'number') {
return false;
}
return !isNaN(x) && x !== Infinity && x !== -Infinity;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Number.isInteger', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
if (!Number.isFinite(x)) {
return false;
}
return x === Math.floor(x);
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Number.isNaN', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
return typeof x === 'number' && isNaN(x);
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Number.isSafeInteger', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(x) {
return Number.isInteger(x) && Math.abs(x) <= Number.MAX_SAFE_INTEGER;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Number.parseFloat', function(orig) {
return orig || parseFloat;
}, 'es6', 'es3');
$jscomp.polyfill('Number.parseInt', function(orig) {
return orig || parseInt;
}, 'es6', 'es3');
$jscomp.assign = typeof Object.assign == 'function' ? Object.assign : function(target, var_args) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
if (!source) {
continue;
}
for (var key in source) {
if ($jscomp.owns(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
$jscomp.polyfill('Object.assign', function(orig) {
return orig || $jscomp.assign;
}, 'es6', 'es3');
$jscomp.polyfill('Object.entries', function(orig) {
if (orig) {
return orig;
}
var entries = function(obj) {
var result = [];
for (var key in obj) {
if ($jscomp.owns(obj, key)) {
result.push([key, obj[key]]);
}
}
return result;
};
return entries;
}, 'es8', 'es3');
$jscomp.polyfill('Object.getOwnPropertySymbols', function(orig) {
if (orig) {
return orig;
}
return function() {
return [];
};
}, 'es6', 'es5');
$jscomp.polyfill('Reflect.ownKeys', function(orig) {
if (orig) {
return orig;
}
var symbolPrefix = 'jscomp_symbol_';
function isSymbol(key) {
return key.substring(0, symbolPrefix.length) == symbolPrefix;
}
var polyfill = function(target) {
var keys = [];
var names = Object.getOwnPropertyNames(target);
var symbols = Object.getOwnPropertySymbols(target);
for (var i = 0; i < names.length; i++) {
(isSymbol(names[i]) ? symbols : keys).push(names[i]);
}
return keys.concat(symbols);
};
return polyfill;
}, 'es6', 'es5');
$jscomp.polyfill('Object.getOwnPropertyDescriptors', function(orig) {
if (orig) {
return orig;
}
var getOwnPropertyDescriptors = function(obj) {
var result = {};
var keys = Reflect.ownKeys(obj);
for (var i = 0; i < keys.length; i++) {
result[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
}
return result;
};
return getOwnPropertyDescriptors;
}, 'es8', 'es5');
$jscomp.polyfill('Object.setPrototypeOf', function(orig) {
return orig || $jscomp.setPrototypeOf;
}, 'es6', 'es5');
$jscomp.polyfill('Object.values', function(orig) {
if (orig) {
return orig;
}
var values = function(obj) {
var result = [];
for (var key in obj) {
if ($jscomp.owns(obj, key)) {
result.push(obj[key]);
}
}
return result;
};
return values;
}, 'es8', 'es3');
$jscomp.polyfill('Reflect.apply', function(orig) {
if (orig) {
return orig;
}
var apply = Function.prototype.apply;
var polyfill = function(target, thisArg, argList) {
return apply.call(target, thisArg, argList);
};
return polyfill;
}, 'es6', 'es3');
$jscomp.objectCreate = $jscomp.ASSUME_ES5 || typeof Object.create == 'function' ? Object.create : function(prototype) {
var ctor = function() {
};
ctor.prototype = prototype;
return new ctor;
};
$jscomp.construct = function() {
function reflectConstructWorks() {
function Base() {
}
function Derived() {
}
new Base;
Reflect.construct(Base, [], Derived);
return new Base instanceof Base;
}
if (typeof Reflect != 'undefined' && Reflect.construct) {
if (reflectConstructWorks()) {
return Reflect.construct;
}
var brokenConstruct = Reflect.construct;
var patchedConstruct = function(target, argList, opt_newTarget) {
var out = brokenConstruct(target, argList);
if (opt_newTarget) {
Reflect.setPrototypeOf(out, opt_newTarget.prototype);
}
return out;
};
return patchedConstruct;
}
function construct(target, argList, opt_newTarget) {
if (opt_newTarget === undefined) {
opt_newTarget = target;
}
var proto = opt_newTarget.prototype || Object.prototype;
var obj = $jscomp.objectCreate(proto);
var apply = Function.prototype.apply;
var out = apply.call(target, obj, argList);
return out || obj;
}
return construct;
}();
$jscomp.polyfill('Reflect.construct', function(orig) {
return $jscomp.construct;
}, 'es6', 'es3');
$jscomp.polyfill('Reflect.defineProperty', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(target, propertyKey, attributes) {
try {
Object.defineProperty(target, propertyKey, attributes);
var desc = Object.getOwnPropertyDescriptor(target, propertyKey);
if (!desc) {
return false;
}
return desc.configurable === (attributes.configurable || false) && desc.enumerable === (attributes.enumerable || false) && ('value' in desc ? desc.value === attributes.value && desc.writable === (attributes.writable || false) : desc.get === attributes.get && desc.set === attributes.set);
} catch (err) {
return false;
}
};
return polyfill;
}, 'es6', 'es5');
$jscomp.polyfill('Reflect.deleteProperty', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(target, propertyKey) {
if (!$jscomp.owns(target, propertyKey)) {
return true;
}
try {
return delete target[propertyKey];
} catch (err) {
return false;
}
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Reflect.getOwnPropertyDescriptor', function(orig) {
return orig || Object.getOwnPropertyDescriptor;
}, 'es6', 'es5');
$jscomp.polyfill('Reflect.getPrototypeOf', function(orig) {
return orig || Object.getPrototypeOf;
}, 'es6', 'es5');
$jscomp.findDescriptor = function(target, propertyKey) {
var obj = target;
while (obj) {
var property = Reflect.getOwnPropertyDescriptor(obj, propertyKey);
if (property) {
return property;
}
obj = Reflect.getPrototypeOf(obj);
}
return undefined;
};
$jscomp.polyfill('Reflect.get', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(target, propertyKey, opt_receiver) {
if (arguments.length <= 2) {
return target[propertyKey];
}
var property = $jscomp.findDescriptor(target, propertyKey);
if (property) {
return property.get ? property.get.call(opt_receiver) : property.value;
}
return undefined;
};
return polyfill;
}, 'es6', 'es5');
$jscomp.polyfill('Reflect.has', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(target, propertyKey) {
return propertyKey in target;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Reflect.isExtensible', function(orig) {
if (orig) {
return orig;
}
if ($jscomp.ASSUME_ES5 || typeof Object.isExtensible == 'function') {
return Object.isExtensible;
}
return function() {
return true;
};
}, 'es6', 'es3');
$jscomp.polyfill('Reflect.preventExtensions', function(orig) {
if (orig) {
return orig;
}
if (!($jscomp.ASSUME_ES5 || typeof Object.preventExtensions == 'function')) {
return function() {
return false;
};
}
var polyfill = function(target) {
Object.preventExtensions(target);
return !Object.isExtensible(target);
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('Reflect.set', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(target, propertyKey, value, opt_receiver) {
var property = $jscomp.findDescriptor(target, propertyKey);
if (!property) {
if (Reflect.isExtensible(target)) {
target[propertyKey] = value;
return true;
}
return false;
}
if (property.set) {
property.set.call(arguments.length > 3 ? opt_receiver : target, value);
return true;
} else {
if (property.writable && !Object.isFrozen(target)) {
target[propertyKey] = value;
return true;
}
}
return false;
};
return polyfill;
}, 'es6', 'es5');
$jscomp.polyfill('Reflect.setPrototypeOf', function(orig) {
if (orig) {
return orig;
} else {
if ($jscomp.setPrototypeOf) {
var setPrototypeOf = $jscomp.setPrototypeOf;
var polyfill = function(target, proto) {
try {
setPrototypeOf(target, proto);
return true;
} catch (e) {
return false;
}
};
return polyfill;
} else {
return null;
}
}
}, 'es6', 'es5');
$jscomp.polyfill('Set', function(NativeSet) {
function isConformant() {
if ($jscomp.ASSUME_NO_NATIVE_SET || !NativeSet || typeof NativeSet != 'function' || !NativeSet.prototype.entries || typeof Object.seal != 'function') {
return false;
}
try {
NativeSet = NativeSet;
var value = Object.seal({x:4});
var set = new NativeSet($jscomp.makeIterator([value]));
if (!set.has(value) || set.size != 1 || set.add(value) != set || set.size != 1 || set.add({x:4}) != set || set.size != 2) {
return false;
}
var iter = set.entries();
var item = iter.next();
if (item.done || item.value[0] != value || item.value[1] != value) {
return false;
}
item = iter.next();
if (item.done || item.value[0] == value || item.value[0].x != 4 || item.value[1] != item.value[0]) {
return false;
}
return iter.next().done;
} catch (err) {
return false;
}
}
if ($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS) {
if (NativeSet && $jscomp.ES6_CONFORMANCE) {
return NativeSet;
}
} else {
if (isConformant()) {
return NativeSet;
}
}
$jscomp.initSymbol();
$jscomp.initSymbolIterator();
var PolyfillSet = function(opt_iterable) {
this.map_ = new Map;
if (opt_iterable) {
var iter = $jscomp.makeIterator(opt_iterable);
var entry;
while (!(entry = iter.next()).done) {
var item = entry.value;
this.add(item);
}
}
this.size = this.map_.size;
};
PolyfillSet.prototype.add = function(value) {
value = value === 0 ? 0 : value;
this.map_.set(value, value);
this.size = this.map_.size;
return this;
};
PolyfillSet.prototype['delete'] = function(value) {
var result = this.map_['delete'](value);
this.size = this.map_.size;
return result;
};
PolyfillSet.prototype.clear = function() {
this.map_.clear();
this.size = 0;
};
PolyfillSet.prototype.has = function(value) {
return this.map_.has(value);
};
PolyfillSet.prototype.entries = function() {
return this.map_.entries();
};
PolyfillSet.prototype.values = function() {
return this.map_.values();
};
PolyfillSet.prototype.keys = PolyfillSet.prototype.values;
PolyfillSet.prototype[Symbol.iterator] = PolyfillSet.prototype.values;
PolyfillSet.prototype.forEach = function(callback, opt_thisArg) {
var set = this;
this.map_.forEach(function(value) {
return callback.call(opt_thisArg, value, value, set);
});
};
return PolyfillSet;
}, 'es6', 'es3');
$jscomp.checkStringArgs = function(thisArg, arg, func) {
if (thisArg == null) {
throw new TypeError("The 'this' value for String.prototype." + func + ' must not be null or undefined');
}
if (arg instanceof RegExp) {
throw new TypeError('First argument to String.prototype.' + func + ' must not be a regular expression');
}
return thisArg + '';
};
$jscomp.polyfill('String.prototype.codePointAt', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(position) {
var string = $jscomp.checkStringArgs(this, null, 'codePointAt');
var size = string.length;
position = Number(position) || 0;
if (!(position >= 0 && position < size)) {
return void 0;
}
position = position | 0;
var first = string.charCodeAt(position);
if (first < 55296 || first > 56319 || position + 1 === size) {
return first;
}
var second = string.charCodeAt(position + 1);
if (second < 56320 || second > 57343) {
return first;
}
return (first - 55296) * 1024 + second + 9216;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('String.prototype.endsWith', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(searchString, opt_position) {
var string = $jscomp.checkStringArgs(this, searchString, 'endsWith');
searchString = searchString + '';
if (opt_position === void 0) {
opt_position = string.length;
}
var i = Math.max(0, Math.min(opt_position | 0, string.length));
var j = searchString.length;
while (j > 0 && i > 0) {
if (string[--i] != searchString[--j]) {
return false;
}
}
return j <= 0;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('String.fromCodePoint', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(var_args) {
var result = '';
for (var i = 0; i < arguments.length; i++) {
var code = Number(arguments[i]);
if (code < 0 || code > 1114111 || code !== Math.floor(code)) {
throw new RangeError('invalid_code_point ' + code);
}
if (code <= 65535) {
result += String.fromCharCode(code);
} else {
code -= 65536;
result += String.fromCharCode(code >>> 10 & 1023 | 55296);
result += String.fromCharCode(code & 1023 | 56320);
}
}
return result;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('String.prototype.includes', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(searchString, opt_position) {
var string = $jscomp.checkStringArgs(this, searchString, 'includes');
return string.indexOf(searchString, opt_position || 0) !== -1;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.polyfill('String.prototype.repeat', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(copies) {
var string = $jscomp.checkStringArgs(this, null, 'repeat');
if (copies < 0 || copies > 1342177279) {
throw new RangeError('Invalid count value');
}
copies = copies | 0;
var result = '';
while (copies) {
if (copies & 1) {
result += string;
}
if (copies >>>= 1) {
string += string;
}
}
return result;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.stringPadding = function(padString, padLength) {
var padding = padString !== undefined ? String(padString) : ' ';
if (!(padLength > 0) || !padding) {
return '';
}
var repeats = Math.ceil(padLength / padding.length);
return padding.repeat(repeats).substring(0, padLength);
};
$jscomp.polyfill('String.prototype.padEnd', function(orig) {
if (orig) {
return orig;
}
var padEnd = function(targetLength, opt_padString) {
var string = $jscomp.checkStringArgs(this, null, 'padStart');
var padLength = targetLength - string.length;
return string + $jscomp.stringPadding(opt_padString, padLength);
};
return padEnd;
}, 'es8', 'es3');
$jscomp.polyfill('String.prototype.padStart', function(orig) {
if (orig) {
return orig;
}
var padStart = function(targetLength, opt_padString) {
var string = $jscomp.checkStringArgs(this, null, 'padStart');
var padLength = targetLength - string.length;
return $jscomp.stringPadding(opt_padString, padLength) + string;
};
return padStart;
}, 'es8', 'es3');
$jscomp.polyfill('String.prototype.startsWith', function(orig) {
if (orig) {
return orig;
}
var polyfill = function(searchString, opt_position) {
var string = $jscomp.checkStringArgs(this, searchString, 'startsWith');
searchString = searchString + '';
var strLen = string.length;
var searchLen = searchString.length;
var i = Math.max(0, Math.min(opt_position | 0, string.length));
var j = 0;
while (j < searchLen && i < strLen) {
if (string[i++] != searchString[j++]) {
return false;
}
}
return j >= searchLen;
};
return polyfill;
}, 'es6', 'es3');
$jscomp.arrayFromIterator = function(iterator) {
var i;
var arr = [];
while (!(i = iterator.next()).done) {
arr.push(i.value);
}
return arr;
};
$jscomp.arrayFromIterable = function(iterable) {
if (iterable instanceof Array) {
return iterable;
} else {
return $jscomp.arrayFromIterator($jscomp.makeIterator(iterable));
}
};
$jscomp.inherits = function(childCtor, parentCtor) {
childCtor.prototype = $jscomp.objectCreate(parentCtor.prototype);
childCtor.prototype.constructor = childCtor;
if ($jscomp.setPrototypeOf) {
var setPrototypeOf = $jscomp.setPrototypeOf;
setPrototypeOf(childCtor, parentCtor);
} else {
for (var p in parentCtor) {
if (p == 'prototype') {
continue;
}
if (Object.defineProperties) {
var descriptor = Object.getOwnPropertyDescriptor(parentCtor, p);
if (descriptor) {
Object.defineProperty(childCtor, p, descriptor);
}
} else {
childCtor[p] = parentCtor[p];
}
}
}
childCtor.superClass_ = parentCtor.prototype;
};
$jscomp.polyfill('WeakSet', function(NativeWeakSet) {
function isConformant() {
if (!NativeWeakSet || !Object.seal) {
return false;
}
try {
var x = Object.seal({});
var y = Object.seal({});
var set = new NativeWeakSet([x]);
if (!set.has(x) || set.has(y)) {
return false;
}
set['delete'](x);
set.add(y);
return !set.has(x) && set.has(y);
} catch (err) {
return false;
}
}
if ($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS) {
if (NativeWeakSet && $jscomp.ES6_CONFORMANCE) {
return NativeWeakSet;
}
} else {
if (isConformant()) {
return NativeWeakSet;
}
}
var PolyfillWeakSet = function(opt_iterable) {
this.map_ = new WeakMap;
if (opt_iterable) {
$jscomp.initSymbol();
$jscomp.initSymbolIterator();
var iter = $jscomp.makeIterator(opt_iterable);
var entry;
while (!(entry = iter.next()).done) {
var item = entry.value;
this.add(item);
}
}
};
PolyfillWeakSet.prototype.add = function(elem) {
this.map_.set(elem, true);
return this;
};
PolyfillWeakSet.prototype.has = function(elem) {
return this.map_.has(elem);
};
PolyfillWeakSet.prototype['delete'] = function(elem) {
return this.map_['delete'](elem);
};
return PolyfillWeakSet;
}, 'es6', 'es3');
try {
if (Array.prototype.values.toString().indexOf('[native code]') == -1) {
delete Array.prototype.values;
}
} catch (e) {
}
Ext.define('Ext.data.proxy.Sql', {alias:'proxy.sql', extend:'Ext.data.proxy.Client', alternateClassName:'Ext.data.proxy.SQL', isSQLProxy:true, config:{reader:null, writer:null, table:null, database:'Sencha'}, _createOptions:{silent:true, dirty:false}, updateModel:function(model) {
var me = this, modelName, len, i, columns, quoted;
if (model) {
me.uniqueIdStrategy = model.identifier.isUnique;
if (!me.getTable()) {
modelName = model.entityName;
me.setTable(modelName.slice(modelName.lastIndexOf('.') + 1));
}
me.columns = columns = me.getPersistedModelColumns(model);
me.quotedColumns = quoted = [];
for (i = 0, len = columns.length; i < len; ++i) {
quoted.push('"' + columns[i] + '"');
}
}
me.callParent([model]);
}, setException:function(operation, error) {
operation.setException(error);
}, create:function(operation) {
var me = this, records = operation.getRecords(), result, error;
operation.setStarted();
me.executeTransaction(function(transaction) {
me.insertRecords(records, transaction, function(resultSet, statementError) {
result = resultSet;
error = statementError;
});
}, function(transactionError) {
operation.setException(transactionError);
}, function() {
if (error) {
operation.setException(statementError);
} else {
operation.process(result);
}
});
}, read:function(operation) {
var me = this, model = me.getModel(), records = operation.getRecords(), record = records ? records[0] : null, result, error, id, params;
if (record && !record.phantom) {
id = record.getId();
} else {
id = operation.getId();
}
if (id !== undefined) {
params = {idOnly:true, id:id};
} else {
params = {page:operation.getPage(), start:operation.getStart(), limit:operation.getLimit(), sorters:operation.getSorters(), filters:operation.getFilters()};
}
operation.setStarted();
me.executeTransaction(function(transaction) {
me.selectRecords(transaction, params, function(resultSet, statementError) {
result = resultSet;
error = statementError;
});
}, function(transactionError) {
operation.setException(transactionError);
}, function() {
if (error) {
operation.setException(statementError);
} else {
operation.process(result);
}
});
}, update:function(operation) {
var me = this, records = operation.getRecords(), result, error;
operation.setStarted();
me.executeTransaction(function(transaction) {
me.updateRecords(transaction, records, function(resultSet, statementError) {
result = resultSet;
error = statementError;
});
}, function(transactionError) {
operation.setException(transactionError);
}, function() {
if (error) {
operation.setException(statementError);
} else {
operation.process(result);
}
});
}, erase:function(operation) {
var me = this, records = operation.getRecords(), result, error;
operation.setStarted();
me.executeTransaction(function(transaction) {
me.destroyRecords(transaction, records, function(resultSet, statementError) {
result = resultSet;
error = statementError;
});
}, function(transactionError) {
operation.setException(transactionError);
}, function() {
if (error) {
operation.setException(error);
} else {
operation.process(result);
}
});
}, createTable:function(transaction) {
var me = this;
if (!transaction) {
me.executeTransaction(function(transaction) {
me.createTable(transaction);
});
return;
}
me.executeStatement(transaction, 'CREATE TABLE IF NOT EXISTS "' + me.getTable() + '" (' + me.getSchemaString() + ')', function() {
me.tableExists = true;
});
}, insertRecords:function(records, transaction, callback) {
var me = this, columns = me.columns, totalRecords = records.length, executed = 0, uniqueIdStrategy = me.uniqueIdStrategy, setOptions = me._createOptions, len = records.length, i, record, placeholders, sql, data, values, errors, completeIf;
completeIf = function(transaction) {
++executed;
if (executed === totalRecords) {
callback.call(me, new Ext.data.ResultSet({success:!errors}), errors);
}
};
placeholders = Ext.String.repeat('?', columns.length, ',');
sql = 'INSERT INTO "' + me.getTable() + '" (' + me.quotedColumns.join(',') + ') VALUES (' + placeholders + ')';
for (i = 0; i < len; ++i) {
record = records[i];
data = me.getRecordData(record);
values = me.getColumnValues(columns, data);
(function(record) {
me.executeStatement(transaction, sql, values, function(transaction, resultSet) {
if (!uniqueIdStrategy) {
record.setId(resultSet.insertId, setOptions);
}
completeIf();
}, function(transaction, error) {
if (!errors) {
errors = [];
}
errors.push(error);
completeIf();
});
})(record);
}
}, selectRecords:function(transaction, params, callback, scope) {
var me = this, Model = me.getModel(), idProperty = Model.idProperty, sql = 'SELECT * FROM "' + me.getTable() + '"', filterStatement = ' WHERE ', sortStatement = ' ORDER BY ', values = [], sorters, filters, placeholder, i, len, result, filter, sorter, property, operator, value;
if (params.idOnly) {
sql += filterStatement + '"' + idProperty + '" \x3d ?';
values.push(params);
} else {
filters = params.filters;
len = filters && filters.length;
if (len) {
for (i = 0; i < len; i++) {
filter = filters[i];
property = filter.getProperty();
value = me.toSqlValue(filter.getValue(), Model.getField(property));
operator = filter.getOperator();
if (property !== null) {
operator = operator || '\x3d';
placeholder = '?';
if (operator === 'like' || operator === '\x3d' && filter.getAnyMatch()) {
operator = 'LIKE';
value = '%' + value + '%';
}
if (operator === 'in' || operator === 'notin') {
if (operator === 'notin') {
operator = 'not in';
}
placeholder = '(' + Ext.String.repeat('?', value.length, ',') + ')';
values = values.concat(value);
} else {
values.push(value);
}
sql += filterStatement + '"' + property + '" ' + operator + ' ' + placeholder;
filterStatement = ' AND ';
}
}
}
sorters = params.sorters;
len = sorters && sorters.length;
if (len) {
for (i = 0; i < len; i++) {
sorter = sorters[i];
property = sorter.getProperty();
if (property !== null) {
sql += sortStatement + '"' + property + '" ' + sorter.getDirection();
sortStatement = ', ';
}
}
}
if (params.page !== undefined) {
sql += ' LIMIT ' + parseInt(params.start, 10) + ', ' + parseInt(params.limit, 10);
}
}
me.executeStatement(transaction, sql, values, function(transaction, resultSet) {
var rows = resultSet.rows, count = rows.length, records = [], fields = Model.fields, fieldsLen = fields.length, raw, data, i, len, j, field, name;
for (i = 0, len = count; i < len; ++i) {
raw = rows.item(i);
data = {};
for (j = 0; j < fieldsLen; ++j) {
field = fields[j];
name = field.name;
data[name] = me.fromSqlValue(raw[name], field);
}
records.push(new Model(data));
}
callback.call(me, new Ext.data.ResultSet({records:records, success:true, total:count, count:count}));
}, function(transaction, error) {
callback.call(me, new Ext.data.ResultSet({success:false, total:0, count:0}), error);
});
}, updateRecords:function(transaction, records, callback) {
var me = this, columns = me.columns, quotedColumns = me.quotedColumns, totalRecords = records.length, executed = 0, updates = [], setOptions = me._createOptions, len, i, record, placeholders, sql, data, values, errors, completeIf;
completeIf = function(transaction) {
++executed;
if (executed === totalRecords) {
callback.call(me, new Ext.data.ResultSet({success:!errors}), errors);
}
};
for (i = 0, len = quotedColumns.length; i < len; i++) {
updates.push(quotedColumns[i] + ' \x3d ?');
}
sql = 'UPDATE "' + me.getTable() + '" SET ' + updates.join(', ') + ' WHERE "' + me.getModel().idProperty + '" \x3d ?';
for (i = 0, len = records.length; i < len; ++i) {
record = records[i];
data = me.getRecordData(record);
values = me.getColumnValues(columns, data);
values.push(record.getId());
(function(record) {
me.executeStatement(transaction, sql, values, function(transaction, resultSet) {
completeIf();
}, function(transaction, error) {
if (!errors) {
errors = [];
}
errors.push(error);
completeIf();
});
})(record);
}
}, destroyRecords:function(transaction, records, callback) {
var me = this, table = me.getTable(), idProperty = me.getModel().idProperty, ids = [], values = [], destroyedRecords = [], len = records.length, idStr = '"' + idProperty + '" \x3d ?', i, result, record, sql;
for (i = 0; i < len; i++) {
ids.push(idStr);
values.push(records[i].getId());
}
sql = 'DELETE FROM "' + me.getTable() + '" WHERE ' + ids.join(' OR ');
me.executeStatement(transaction, sql, values, function(transaction, resultSet) {
callback.call(me, new Ext.data.ResultSet({success:true}));
}, function(transaction, error) {
callback.call(me, new Ext.data.ResultSet({success:false}), error);
});
}, getRecordData:function(record) {
var me = this, fields = record.fields, idProperty = record.idProperty, uniqueIdStrategy = me.uniqueIdStrategy, data = {}, len = fields.length, recordData = record.data, i, name, value, field;
for (i = 0; i < len; ++i) {
field = fields[i];
if (field.persist !== false) {
name = field.name;
if (name === idProperty && !uniqueIdStrategy) {
continue;
}
data[name] = me.toSqlValue(recordData[name], field);
}
}
return data;
}, getColumnValues:function(columns, data) {
var len = columns.length, values = [], i, column, value;
for (i = 0; i < len; i++) {
column = columns[i];
value = data[column];
if (value !== undefined) {
values.push(value);
}
}
return values;
}, getSchemaString:function() {
var me = this, schema = [], model = me.getModel(), idProperty = model.idProperty, fields = model.fields, uniqueIdStrategy = me.uniqueIdStrategy, len = fields.length, i, field, type, name;
for (i = 0; i < len; i++) {
field = fields[i];
type = field.getType();
name = field.name;
if (name === idProperty) {
if (uniqueIdStrategy) {
type = me.convertToSqlType(type);
schema.unshift('"' + idProperty + '" ' + type);
} else {
schema.unshift('"' + idProperty + '" INTEGER PRIMARY KEY AUTOINCREMENT');
}
} else {
type = me.convertToSqlType(type);
schema.push('"' + name + '" ' + type);
}
}
return schema.join(', ');
}, convertToSqlType:function(type) {
switch(type.toLowerCase()) {
case 'string':
case 'auto':
return 'TEXT';
case 'int':
case 'date':
return 'INTEGER';
case 'float':
return 'REAL';
case 'bool':
return 'NUMERIC';
}
}, dropTable:function() {
var me = this;
me.executeTransaction(function(transaction) {
me.executeStatement(transaction, 'DROP TABLE "' + me.getTable() + '"', function() {
me.tableExists = false;
});
}, null, null, false);
}, getDatabaseObject:function() {
return window.openDatabase(this.getDatabase(), '1.0', 'Sencha Database', 5 * 1024 * 1024);
}, privates:{executeStatement:function(transaction, sql, values, success, failure) {
var me = this;
transaction.executeSql(sql, values, success ? function() {
success.apply(me, arguments);
} : null, failure ? function() {
failure.apply(me, arguments);
} : null);
}, executeTransaction:function(runner, failure, success, autoCreateTable) {
var me = this;
autoCreateTable = autoCreateTable !== false;
me.getDatabaseObject().transaction(runner ? function(transaction) {
if (autoCreateTable && !me.tableExists) {
me.createTable(transaction);
}
runner.apply(me, arguments);
} : null, failure ? function() {
failure.apply(me, arguments);
} : null, success ? function() {
success.apply(me, arguments);
} : null);
}, fromSqlValue:function(value, field) {
if (field.isDateField) {
value = value ? new Date(value) : null;
} else {
if (field.isBooleanField) {
value = value === 1;
}
}
return value;
}, getPersistedModelColumns:function(model) {
var fields = model.fields, uniqueIdStrategy = this.uniqueIdStrategy, idProperty = model.idProperty, columns = [], len = fields.length, i, field, name;
for (i = 0; i < len; ++i) {
field = fields[i];
name = field.name;
if (name === idProperty && !uniqueIdStrategy) {
continue;
}
if (field.persist !== false) {
columns.push(field.name);
}
}
return columns;
}, toSqlValue:function(value, field) {
if (field.isDateField) {
value = value ? value.getTime() : null;
} else {
if (field.isBooleanField) {
value = value ? 1 : 0;
}
}
return value;
}}});
|
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var NullDependency = require("./NullDependency");
var HarmonyModulesHelpers = require("./HarmonyModulesHelpers");
function HarmonyExportSpecifierDependency(originModule, id, name, position, immutable) {
NullDependency.call(this);
this.originModule = originModule;
this.id = id;
this.name = name;
this.position = position;
this.immutable = immutable;
}
module.exports = HarmonyExportSpecifierDependency;
HarmonyExportSpecifierDependency.prototype = Object.create(NullDependency.prototype);
HarmonyExportSpecifierDependency.prototype.constructor = HarmonyExportSpecifierDependency;
HarmonyExportSpecifierDependency.prototype.type = "harmony export specifier";
HarmonyExportSpecifierDependency.prototype.describeHarmonyExport = function() {
return {
exportedName: this.name,
precedence: 1
};
};
HarmonyExportSpecifierDependency.Template = function HarmonyExportSpecifierDependencyTemplate() {};
HarmonyExportSpecifierDependency.Template.prototype.apply = function(dep, source) {
var used = dep.originModule.isUsed(dep.name);
var active = HarmonyModulesHelpers.isActive(dep.originModule, dep);
var content;
if(!used) {
content = "/* unused harmony export " + (dep.name || "namespace") + " */";
} else if(!active) {
content = "/* inactive harmony export " + (dep.name || "namespace") + " */";
} else if(dep.immutable) {
content = "/* harmony export */ exports[" + JSON.stringify(used) + "] = " + dep.id + ";";
} else {
content = "/* harmony export */ Object.defineProperty(exports, " + JSON.stringify(used) + ", {configurable: false, enumerable: true, get: function() { return " + dep.id + "; }});";
}
source.insert(dep.position, content);
};
|
export * from './classNames';
export * from './style';
export * from './query';
export * from './events';
import * as _animation from './animation';
export { _animation as animation };
import _transition from './transition';
export { _transition as transition };
import _translateDOMPositionXY from './transition/translateDOMPositionXY';
export { _translateDOMPositionXY as translateDOMPositionXY };
import _getVendorPrefixedName from './getVendorPrefixedName';
export { _getVendorPrefixedName as getVendorPrefixedName };
import _BrowserSupportCore from './BrowserSupportCore';
export { _BrowserSupportCore as BrowserSupportCore };
import _DOMMouseMoveTracker from './DOMMouseMoveTracker';
export { _DOMMouseMoveTracker as DOMMouseMoveTracker };
import _WheelHandler from './WheelHandler';
export { _WheelHandler as WheelHandler };
|
//>>built
define(
//begin v1.x content
({
"clearFilterDialogTitle": "Zrušiť filter",
"filterDefDialogTitle": "Filter",
"ruleTitleTemplate": "Pravidlo ${0}",
"conditionEqual": "rovné",
"conditionNotEqual": "nerovné",
"conditionLess": "menšie ako",
"conditionLessEqual": "menšie ako alebo rovné",
"conditionLarger": "väčšie ako",
"conditionLargerEqual": "väčšie ako alebo rovné",
"conditionContains": "obsahuje",
"conditionIs": "je",
"conditionStartsWith": "začína s",
"conditionEndWith": "končí s",
"conditionNotContain": "neobsahuje",
"conditionIsNot": "nie je",
"conditionNotStartWith": "nezačína s",
"conditionNotEndWith": "nekončí s",
"conditionBefore": "pred",
"conditionAfter": "za",
"conditionRange": "rozsah",
"conditionIsEmpty": "je prázdne",
"all": "všetko",
"any": "žiadne",
"relationAll": "všetky pravidlá",
"waiRelAll": "Vyhovovať všetkým týmto pravidlám:",
"relationAny": "ľubovoľné pravidlá",
"waiRelAny": "Vyhovovať ľubovoľným z týchto pravidiel:",
"relationMsgFront": "Vyhovieť",
"relationMsgTail": "",
"and": "a",
"or": "alebo",
"addRuleButton": "Pridať pravidlo",
"waiAddRuleButton": "Pridať nové pravidlo",
"removeRuleButton": "Odstrániť pravidlo",
"waiRemoveRuleButtonTemplate": "Odstrániť pravidlo ${0}",
"cancelButton": "Zrušiť",
"waiCancelButton": "Zrušiť toto dialógové okno",
"clearButton": "Zrušiť",
"waiClearButton": "Zrušiť filter",
"filterButton": "Filtrovať",
"waiFilterButton": "Odoslať filter",
"columnSelectLabel": "Stĺpec",
"waiColumnSelectTemplate": "Stĺpec pre pravidlo ${0}",
"conditionSelectLabel": "Podmienka",
"waiConditionSelectTemplate": "Podmienka pre pravidlo ${0}",
"valueBoxLabel": "Hodnota",
"waiValueBoxTemplate": "Zadajte hodnotu na filtrovanie pre pravidlo ${0}",
"rangeTo": "do",
"rangeTemplate": "od ${0} do ${1}",
"statusTipHeaderColumn": "Stĺpec",
"statusTipHeaderCondition": "Pravidlá",
"statusTipTitle": "Lišta filtra",
"statusTipMsg": "Kliknite na lištu filtra, ak chcete filtrovať podľa hodnôt v ${0}.",
"anycolumn": "ľubovoľný stĺpec",
"statusTipTitleNoFilter": "Lišta filtra",
"statusTipTitleHasFilter": "Filter",
"defaultItemsName": "položky",
"filterBarMsgHasFilterTemplate": "Zobrazuje sa ${0} z ${1} ${2}.",
"filterBarMsgNoFilterTemplate": "Nepoužíva sa žiadny filter",
"filterBarDefButton": "Definovať filter",
"waiFilterBarDefButton": "Filtrovať tabuľku",
"a11yFilterBarDefButton": "Filtrovať...",
"filterBarClearButton": "Zrušiť filter",
"waiFilterBarClearButton": "Zrušiť filter",
"closeFilterBarBtn": "Zatvoriť lištu filtra",
"clearFilterMsg": "Toto odstráni filter a zobrazí všetky dostupné záznamy",
"anyColumnOption": "Ľubovoľný stĺpec",
"trueLabel": "Pravda",
"falseLabel": "Nepravda"
})
//end v1.x content
);
|
# coding=utf-8
# Copyright 2019 The ML Fairness Gym Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Lint as: python2, python3
"""Tests for fairness_gym.agents.threshold_policies."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
import params
from agents import threshold_policies
import numpy as np
from six.moves import range
from sklearn import metrics as sklearn_metrics
COST_MATRIX = params.CostMatrix(tp=1.5, fp=-1.0, fn=-0.3, tn=2.0)
EPSILON = 1e-6
class ThresholdPoliciesTest(absltest.TestCase):
def test_equality_of_opportunity_holds(self):
rng = np.random.RandomState(100)
group_a_predictions = rng.rand(100000)
group_a_labels = rng.choice([0, 1], p=[0.5, 0.5], size=100000)
group_b_predictions = rng.normal(size=100000)
group_b_labels = rng.choice([0, 1], p=[0.2, 0.8], size=100000)
thresholds = threshold_policies.equality_of_opportunity_thresholds(
group_predictions={
'a': group_a_predictions,
'b': group_b_predictions
},
group_labels={
'a': group_a_labels,
'b': group_b_labels
},
group_weights=None,
cost_matrix=COST_MATRIX,
rng=rng)
group_a_recall = ((group_a_predictions > thresholds['a'].sample()) *
group_a_labels).sum() / group_a_labels.sum()
group_b_recall = ((group_b_predictions > thresholds['b'].sample()) *
group_b_labels).sum() / group_b_labels.sum()
self.assertLess(np.abs(group_a_recall - group_b_recall), 1e-3)
def test_reward_is_maximized(self):
rng = np.random.RandomState(100)
predictions = rng.rand(10000)
labels = rng.choice([0, 1], p=[0.5, 0.5], size=10000)
# With only one group, this should return a reward-maximizing threshold.
thresholds = threshold_policies.equality_of_opportunity_thresholds(
{'a': predictions}, {'a': labels},
group_weights=None,
cost_matrix=COST_MATRIX,
rng=rng)
optimal_threshold = thresholds['a']
confusion = sklearn_metrics.confusion_matrix(
labels, predictions > optimal_threshold.sample())
optimal_reward = (confusion * COST_MATRIX.as_array()).sum()
for _ in range(20):
# Optimal threshold should be better than or equal to all challengers.
challenge_threshold = rng.rand()
confusion = sklearn_metrics.confusion_matrix(
labels, predictions >= challenge_threshold)
reward = (confusion * COST_MATRIX.as_array()).sum()
self.assertLessEqual(reward, optimal_reward)
def test_weighted_single_threshold(self):
# With a vanilla cost matrix, this should result in accepting
# only predictions >= 0.75
predictions = np.array([0.25, 0.25, 0.33, 0.33, 0.75, 0.75])
labels = np.array([0, 1, 0, 1, 0, 1])
weights = np.array([3., 1., 2., 1., 1., 3.])
weights = weights / sum(weights)
vanilla_cost_matrix = params.CostMatrix(tn=0., fp=-1., fn=0., tp=1.)
weighted_threshold = threshold_policies.single_threshold(
predictions, labels, weights, vanilla_cost_matrix)
self.assertAlmostEqual(weighted_threshold, 0.75)
def test_convex_hull_roc(self):
# The ROC curve for the test looks like this.
# 'o' marks the points that should be deleted.
#
# /
# /
# ____o /
# / \o/
# /
##################
fpr_tpr = [
(0.0, 0.0),
(0.2, 0.5),
(0.3, 0.5), # This point should be removed: Not in convex hull.
(0.4, 0.1), # This point should be removed: Below random-guessing line.
(0.5, 0.7),
(1.0, 1.0),
]
expected_fpr_tpr = [
(0.0, 0.0),
(0.2, 0.5),
(0.5, 0.7),
(1.0, 1.0),
]
fpr, tpr = zip(*fpr_tpr)
expected_fpr, expected_tpr = zip(*expected_fpr_tpr)
np.random.seed(100)
# Thresholds don't really matter here, so they can be random.
thresholds = sorted([np.random.rand() for _ in fpr])
result_fpr, result_tpr, _ = threshold_policies.convex_hull_roc(
(list(fpr), list(tpr), thresholds))
self.assertListEqual(list(expected_fpr), result_fpr)
self.assertListEqual(list(expected_tpr), result_tpr)
if __name__ == '__main__':
absltest.main()
|
(function(compId){var _=null,y=true,n=false,x1='6.0.0',x3='6.0.0.400',x2='5.0.0',x8='rgba(226,234,238,1.00)',x4='rgba(0,0,0,0)',lf='left',g='image',e10='${Rectangle2}',bg='background-color',e12='${Rectangle}',x6='rgba(245,223,7,1.00)',x9='rgba(255,255,255,1)',tp='top',m='rect',x7='rgba(255,255,255,1.00)',w='width',e11='${RectangleCopy3}',i='none';var g5='logo22.jpg';var im='images/',aud='media/',vid='media/',js='js/',fonts={},opts={'gAudioPreloadPreference':'auto','gVideoPreloadPreference':'auto'},resources=[],scripts=[],symbols={"stage":{v:x1,mv:x2,b:x3,stf:i,cg:i,rI:n,cn:{dom:[{id:'logo22',t:g,r:['0px','0px','300px','129px','auto','auto'],f:[x4,im+g5,'0px','0px']},{id:'Rectangle',t:m,r:['230px','79px','10px','10px','auto','auto'],f:[x6],s:[0,"rgb(0, 0, 0)",i],boxShadow:["",2,2,3,0,"rgba(0,0,0,0.53)"]},{id:'RectangleCopy3',t:m,r:['100px','79px','10px','10px','auto','auto'],f:[x7],s:[0,"rgb(0, 0, 0)",i],boxShadow:["",2,2,3,0,"rgba(0,0,0,0.51)"]},{id:'Rectangle2',t:m,r:['57px','50px','16px','1px','auto','auto'],f:[x8],s:[0,"rgb(0, 0, 0)",i]}],style:{'${Stage}':{isStage:true,r:['null','null','300px','130px','auto','auto'],overflow:'hidden',f:[x9]}}},tt:{d:12259.362436922,a:y,l:{"loop":0},data:[["eid141",tp,0,3930,"linear",e10,'50px','77px'],["eid144",tp,3930,3007,"linear",e10,'77px','92px'],["eid147",tp,6937,2633,"linear",e10,'92px','77px'],["eid150",tp,9570,2299,"linear",e10,'77px','50px'],["eid145",lf,3930,3007,"linear",e10,'57px','43px'],["eid148",lf,6937,2633,"linear",e10,'43px','57px'],["eid151",bg,0,0,"linear",e10,'rgba(226,234,238,1.00)','rgba(226,234,238,1.00)'],["eid91",tp,3442,1161,"linear",e11,'79px','55px'],["eid92",tp,4603,961,"linear",e11,'55px','79px'],["eid96",tp,7830,788,"linear",e11,'79px','55px'],["eid101",tp,10482,646,"linear",e11,'55px','79px'],["eid146",w,3930,3007,"linear",e10,'16px','30px'],["eid149",w,6937,2633,"linear",e10,'30px','16px'],["eid84",bg,2015,725,"linear",e12,'rgba(255,255,255,1)','rgba(245,223,7,1.00)'],["eid100",bg,9393,1075,"linear",e12,'rgba(245,223,7,1)','rgba(255,255,255,1.00)'],["eid86",lf,2740,705,"linear",e11,'100px','88px'],["eid93",lf,5564,487,"linear",e11,'88px','100px'],["eid94",lf,6052,1763,"linear",e11,'100px','203px'],["eid102",lf,11128,760,"linear",e11,'203px','120px'],["eid75",tp,1005,355,"linear",e12,'79px','55px'],["eid76",tp,1360,340,"linear",e12,'55px','79px'],["eid97",tp,7830,788,"linear",e12,'79px','55px'],["eid98",tp,8618,775,"linear",e12,'55px','79px'],["eid74",lf,0,1005,"linear",e12,'121px','229px'],["eid77",lf,1700,315,"linear",e12,'229px','150px'],["eid79",lf,2015,730,"linear",e12,'150px','120px'],["eid95",lf,6052,1763,"linear",e12,'120px','230px'],["eid99",lf,9393,1075,"linear",e12,'230px','100px'],["eid85",bg,2740,705,"linear",e11,'rgba(255,255,255,1)','rgba(245,223,7,1.00)'],["eid103",bg,11128,760,"linear",e11,'rgba(245,223,7,1)','rgba(255,255,255,1.00)']]}}};AdobeEdge.registerCompositionDefn(compId,symbols,fonts,scripts,resources,opts);})("EDGE-8894254");
(function($,Edge,compId){var Composition=Edge.Composition,Symbol=Edge.Symbol;Edge.registerEventBinding(compId,function($){
//Edge symbol: 'stage'
(function(symbolName){Symbol.bindTriggerAction(compId,symbolName,"Default Timeline",12259,function(sym,e){sym.play("loop");});
//Edge binding end
})("stage");
//Edge symbol end:'stage'
})})(AdobeEdge.$,AdobeEdge,"EDGE-8894254");
|
import torch
from torch import nn as nn
from torch.nn import functional as F
import os,sys
import numpy as np
root_path=os.path.abspath('.')
sys.path.append(root_path)
class SEBlock(nn.Module):
def __init__(self, in_channels, reduction=8, bias=False):
super(SEBlock, self).__init__()
self.conv1 = nn.Conv2d(in_channels, in_channels // reduction, 1, 1, 0, bias=bias)
self.conv2 = nn.Conv2d(in_channels // reduction, in_channels, 1, 1, 0, bias=bias)
def forward(self, x):
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
x0 = torch.mean(x.float(), dim=(2, 3), keepdim=True).half()
else:
x0 = torch.mean(x, dim=(2, 3), keepdim=True)
x0 = self.conv1(x0)
x0 = F.relu(x0, inplace=True)
x0 = self.conv2(x0)
x0 = torch.sigmoid(x0)
x = torch.mul(x, x0)
return x
def forward_mean(self, x,x0):
x0 = self.conv1(x0)
x0 = F.relu(x0, inplace=True)
x0 = self.conv2(x0)
x0 = torch.sigmoid(x0)
x = torch.mul(x, x0)
return x
class UNetConv(nn.Module):
def __init__(self, in_channels, mid_channels, out_channels, se):
super(UNetConv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(in_channels, mid_channels, 3, 1, 0),
nn.LeakyReLU(0.1, inplace=True),
nn.Conv2d(mid_channels, out_channels, 3, 1, 0),
nn.LeakyReLU(0.1, inplace=True),
)
if se:
self.seblock = SEBlock(out_channels, reduction=8, bias=True)
else:
self.seblock = None
def forward(self, x):
z = self.conv(x)
if self.seblock is not None:
z = self.seblock(z)
return z
class UNet1(nn.Module):
def __init__(self, in_channels, out_channels, deconv):
super(UNet1, self).__init__()
self.conv1 = UNetConv(in_channels, 32, 64, se=False)
self.conv1_down = nn.Conv2d(64, 64, 2, 2, 0)
self.conv2 = UNetConv(64, 128, 64, se=True)
self.conv2_up = nn.ConvTranspose2d(64, 64, 2, 2, 0)
self.conv3 = nn.Conv2d(64, 64, 3, 1, 0)
if deconv:
self.conv_bottom = nn.ConvTranspose2d(64, out_channels, 4, 2, 3)
else:
self.conv_bottom = nn.Conv2d(64, out_channels, 3, 1, 0)
for m in self.modules():
if isinstance(m, (nn.Conv2d, nn.ConvTranspose2d)):
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
elif isinstance(m, nn.Linear):
nn.init.normal_(m.weight, 0, 0.01)
if m.bias is not None:
nn.init.constant_(m.bias, 0)
def forward(self, x):
x1 = self.conv1(x)
x2 = self.conv1_down(x1)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x2 = self.conv2(x2)
x2 = self.conv2_up(x2)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x1 = F.pad(x1, (-4, -4, -4, -4))
x3 = self.conv3(x1 + x2)
x3 = F.leaky_relu(x3, 0.1, inplace=True)
z = self.conv_bottom(x3)
return z
def forward_a(self, x):
x1 = self.conv1(x)
x2 = self.conv1_down(x1)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x2 = self.conv2.conv(x2)
return x1,x2
def forward_b(self, x1,x2):
x2 = self.conv2_up(x2)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x1 = F.pad(x1, (-4, -4, -4, -4))
x3 = self.conv3(x1 + x2)
x3 = F.leaky_relu(x3, 0.1, inplace=True)
z = self.conv_bottom(x3)
return z
class UNet1x3(nn.Module):
def __init__(self, in_channels, out_channels, deconv):
super(UNet1x3, self).__init__()
self.conv1 = UNetConv(in_channels, 32, 64, se=False)
self.conv1_down = nn.Conv2d(64, 64, 2, 2, 0)
self.conv2 = UNetConv(64, 128, 64, se=True)
self.conv2_up = nn.ConvTranspose2d(64, 64, 2, 2, 0)
self.conv3 = nn.Conv2d(64, 64, 3, 1, 0)
if deconv:
self.conv_bottom = nn.ConvTranspose2d(64, out_channels, 5, 3, 2)
else:
self.conv_bottom = nn.Conv2d(64, out_channels, 3, 1, 0)
for m in self.modules():
if isinstance(m, (nn.Conv2d, nn.ConvTranspose2d)):
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
elif isinstance(m, nn.Linear):
nn.init.normal_(m.weight, 0, 0.01)
if m.bias is not None:
nn.init.constant_(m.bias, 0)
def forward(self, x):
x1 = self.conv1(x)
x2 = self.conv1_down(x1)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x2 = self.conv2(x2)
x2 = self.conv2_up(x2)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x1 = F.pad(x1, (-4, -4, -4, -4))
x3 = self.conv3(x1 + x2)
x3 = F.leaky_relu(x3, 0.1, inplace=True)
z = self.conv_bottom(x3)
return z
def forward_a(self, x):
x1 = self.conv1(x)
x2 = self.conv1_down(x1)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x2 = self.conv2.conv(x2)
return x1,x2
def forward_b(self, x1,x2):
x2 = self.conv2_up(x2)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x1 = F.pad(x1, (-4, -4, -4, -4))
x3 = self.conv3(x1 + x2)
x3 = F.leaky_relu(x3, 0.1, inplace=True)
z = self.conv_bottom(x3)
return z
class UNet2(nn.Module):
def __init__(self, in_channels, out_channels, deconv):
super(UNet2, self).__init__()
self.conv1 = UNetConv(in_channels, 32, 64, se=False)
self.conv1_down = nn.Conv2d(64, 64, 2, 2, 0)
self.conv2 = UNetConv(64, 64, 128, se=True)
self.conv2_down = nn.Conv2d(128, 128, 2, 2, 0)
self.conv3 = UNetConv(128, 256, 128, se=True)
self.conv3_up = nn.ConvTranspose2d(128, 128, 2, 2, 0)
self.conv4 = UNetConv(128, 64, 64, se=True)
self.conv4_up = nn.ConvTranspose2d(64, 64, 2, 2, 0)
self.conv5 = nn.Conv2d(64, 64, 3, 1, 0)
if deconv:
self.conv_bottom = nn.ConvTranspose2d(64, out_channels, 4, 2, 3)
else:
self.conv_bottom = nn.Conv2d(64, out_channels, 3, 1, 0)
for m in self.modules():
if isinstance(m, (nn.Conv2d, nn.ConvTranspose2d)):
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
elif isinstance(m, nn.Linear):
nn.init.normal_(m.weight, 0, 0.01)
if m.bias is not None:
nn.init.constant_(m.bias, 0)
def forward(self, x):
x1 = self.conv1(x)
x2 = self.conv1_down(x1)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x2 = self.conv2(x2)
x3 = self.conv2_down(x2)
x3 = F.leaky_relu(x3, 0.1, inplace=True)
x3 = self.conv3(x3)
x3 = self.conv3_up(x3)
x3 = F.leaky_relu(x3, 0.1, inplace=True)
x2 = F.pad(x2, (-4, -4, -4, -4))
x4 = self.conv4(x2 + x3)
x4 = self.conv4_up(x4)
x4 = F.leaky_relu(x4, 0.1, inplace=True)
x1 = F.pad(x1, (-16, -16, -16, -16))
x5 = self.conv5(x1 + x4)
x5 = F.leaky_relu(x5, 0.1, inplace=True)
z = self.conv_bottom(x5)
return z
def forward_a(self, x):#conv234结尾有se
x1 = self.conv1(x)
x2 = self.conv1_down(x1)
x2 = F.leaky_relu(x2, 0.1, inplace=True)
x2 = self.conv2.conv(x2)
return x1,x2
def forward_b(self, x2): # conv234结尾有se
x3 = self.conv2_down(x2)
x3 = F.leaky_relu(x3, 0.1, inplace=True)
x3 = self.conv3.conv(x3)
return x3
def forward_c(self, x2,x3): # conv234结尾有se
x3 = self.conv3_up(x3)
x3 = F.leaky_relu(x3, 0.1, inplace=True)
x2 = F.pad(x2, (-4, -4, -4, -4))
x4 = self.conv4.conv(x2 + x3)
return x4
def forward_d(self, x1,x4): # conv234结尾有se
x4 = self.conv4_up(x4)
x4 = F.leaky_relu(x4, 0.1, inplace=True)
x1 = F.pad(x1, (-16, -16, -16, -16))
x5 = self.conv5(x1 + x4)
x5 = F.leaky_relu(x5, 0.1, inplace=True)
z = self.conv_bottom(x5)
return z
class UpCunet2x(nn.Module):#完美tile,全程无损
def __init__(self, in_channels=3, out_channels=3):
super(UpCunet2x, self).__init__()
self.unet1 = UNet1(in_channels, out_channels, deconv=True)
self.unet2 = UNet2(in_channels, out_channels, deconv=False)
def forward(self, x,tile_mode):#1.7G
n, c, h0, w0 = x.shape
if(tile_mode==0):#不tile
ph = ((h0 - 1) // 2 + 1) * 2
pw = ((w0 - 1) // 2 + 1) * 2
x = F.pad(x, (18, 18 + pw - w0, 18, 18 + ph - h0), 'reflect') # 需要保证被2整除
x = self.unet1.forward(x)
x0 = self.unet2.forward(x)
x1 = F.pad(x, (-20, -20, -20, -20))
x = torch.add(x0, x1)
if (w0 != pw or h0 != ph): x = x[:, :, :h0 * 2, :w0 * 2]
return x
elif(tile_mode==1):# 对长边减半
if(w0>=h0):
crop_size_w=((w0-1)//4*4+4)//2#减半后能被2整除,所以要先被4整除
crop_size_h=(h0-1)//2*2+2#能被2整除
else:
crop_size_h=((h0-1)//4*4+4)//2#减半后能被2整除,所以要先被4整除
crop_size_w=(w0-1)//2*2+2#能被2整除
crop_size=(crop_size_h,crop_size_w)#6.6G
elif(tile_mode==2):#hw都减半
crop_size=(((h0-1)//4*4+4)//2,((w0-1)//4*4+4)//2)#5.6G
elif(tile_mode==3):#hw都三分之一
crop_size=(((h0-1)//6*6+6)//3,((w0-1)//6*6+6)//3)#4.2G
elif(tile_mode==4):#hw都四分之一
crop_size=(((h0-1)//8*8+8)//4,((w0-1)//8*8+8)//4)#3.7G
ph = ((h0 - 1) // crop_size[0] + 1) * crop_size[0]
pw = ((w0 - 1) // crop_size[1] + 1) * crop_size[1]
x=F.pad(x,(18,18+pw-w0,18,18+ph-h0),'reflect')
n,c,h,w=x.shape
se_mean0=torch.zeros((n,64,1,1)).to(x.device)
if ("Half" in x.type()):
se_mean0=se_mean0.half()
n_patch=0
tmp_dict={}
opt_res_dict={}
for i in range(0,h-36,crop_size[0]):
tmp_dict[i]={}
for j in range(0,w-36,crop_size[1]):
x_crop=x[:,:,i:i+crop_size[0]+36,j:j+crop_size[1]+36]
n,c1,h1,w1=x_crop.shape
tmp0,x_crop = self.unet1.forward_a(x_crop)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(x_crop.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(x_crop, dim=(2, 3),keepdim=True)
se_mean0+=tmp_se_mean
n_patch+=1
tmp_dict[i][j]=(tmp0,x_crop)
se_mean0/=n_patch
se_mean1 = torch.zeros((n, 128, 1, 1)).to(x.device)#64#128#128#64
if ("Half" in x.type()):
se_mean1=se_mean1.half()
for i in range(0,h-36,crop_size[0]):
for j in range(0,w-36,crop_size[1]):
tmp0, x_crop=tmp_dict[i][j]
x_crop=self.unet1.conv2.seblock.forward_mean(x_crop,se_mean0)
opt_unet1=self.unet1.forward_b(tmp0,x_crop)
tmp_x1,tmp_x2 = self.unet2.forward_a(opt_unet1)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x2.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x2, dim=(2, 3),keepdim=True)
se_mean1+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x2)
se_mean1/=n_patch
se_mean0 = torch.zeros((n, 128, 1, 1)).to(x.device) # 64#128#128#64
if ("Half" in x.type()):
se_mean0=se_mean0.half()
for i in range(0,h-36,crop_size[0]):
for j in range(0,w-36,crop_size[1]):
opt_unet1,tmp_x1, tmp_x2=tmp_dict[i][j]
tmp_x2=self.unet2.conv2.seblock.forward_mean(tmp_x2,se_mean1)
tmp_x3=self.unet2.forward_b(tmp_x2)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x3.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x3, dim=(2, 3),keepdim=True)
se_mean0+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x2,tmp_x3)
se_mean0/=n_patch
se_mean1 = torch.zeros((n, 64, 1, 1)).to(x.device) # 64#128#128#64
if ("Half" in x.type()):
se_mean1=se_mean1.half()
for i in range(0,h-36,crop_size[0]):
for j in range(0,w-36,crop_size[1]):
opt_unet1,tmp_x1, tmp_x2,tmp_x3=tmp_dict[i][j]
tmp_x3=self.unet2.conv3.seblock.forward_mean(tmp_x3,se_mean0)
tmp_x4=self.unet2.forward_c(tmp_x2,tmp_x3)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x4.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x4, dim=(2, 3),keepdim=True)
se_mean1+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x4)
se_mean1/=n_patch
for i in range(0,h-36,crop_size[0]):
opt_res_dict[i]={}
for j in range(0,w-36,crop_size[1]):
opt_unet1,tmp_x1, tmp_x4=tmp_dict[i][j]
tmp_x4=self.unet2.conv4.seblock.forward_mean(tmp_x4,se_mean1)
x0=self.unet2.forward_d(tmp_x1,tmp_x4)
x1 = F.pad(opt_unet1,(-20,-20,-20,-20))
x_crop = torch.add(x0, x1)#x0是unet2的最终输出
opt_res_dict[i][j] = x_crop
del tmp_dict
torch.cuda.empty_cache()
res = torch.zeros((n, c, h * 2 - 72, w * 2 - 72)).to(x.device)
if ("Half" in x.type()):
res=res.half()
for i in range(0,h-36,crop_size[0]):
for j in range(0,w-36,crop_size[1]):
res[:, :, i * 2:i * 2 + h1 * 2 - 72, j * 2:j * 2 + w1 * 2 - 72]=opt_res_dict[i][j]
del opt_res_dict
torch.cuda.empty_cache()
if(w0!=pw or h0!=ph):res=res[:,:,:h0*2,:w0*2]
return res#
class UpCunet3x(nn.Module):#完美tile,全程无损
def __init__(self, in_channels=3, out_channels=3):
super(UpCunet3x, self).__init__()
self.unet1 = UNet1x3(in_channels, out_channels, deconv=True)
self.unet2 = UNet2(in_channels, out_channels, deconv=False)
def forward(self, x,tile_mode):#1.7G
n, c, h0, w0 = x.shape
if(tile_mode==0):#不tile
ph = ((h0 - 1) // 4 + 1) * 4
pw = ((w0 - 1) // 4 + 1) * 4
x = F.pad(x, (14, 14 + pw - w0, 14, 14 + ph - h0), 'reflect') # 需要保证被2整除
x = self.unet1.forward(x)
x0 = self.unet2.forward(x)
x1 = F.pad(x, (-20, -20, -20, -20))
x = torch.add(x0, x1)
if (w0 != pw or h0 != ph): x = x[:, :, :h0 * 3, :w0 * 3]
return x
elif(tile_mode==1):# 对长边减半
if(w0>=h0):
crop_size_w=((w0-1)//8*8+8)//2#减半后能被4整除,所以要先被8整除
crop_size_h=(h0-1)//4*4+4#能被4整除
else:
crop_size_h=((h0-1)//8*8+8)//2#减半后能被4整除,所以要先被8整除
crop_size_w=(w0-1)//4*4+4#能被4整除
crop_size=(crop_size_h,crop_size_w)#6.6G
elif(tile_mode==2):#hw都减半
crop_size=(((h0-1)//8*8+8)//2,((w0-1)//8*8+8)//2)#5.6G
elif(tile_mode==3):#hw都三分之一
crop_size=(((h0-1)//12*12+12)//3,((w0-1)//12*12+12)//3)#4.2G
elif(tile_mode==4):#hw都四分之一
crop_size=(((h0-1)//16*16+16)//4,((w0-1)//16*16+16)//4)#3.7G
ph = ((h0 - 1) // crop_size[0] + 1) * crop_size[0]
pw = ((w0 - 1) // crop_size[1] + 1) * crop_size[1]
x=F.pad(x,(14,14+pw-w0,14,14+ph-h0),'reflect')
n,c,h,w=x.shape
se_mean0=torch.zeros((n,64,1,1)).to(x.device)
if ("Half" in x.type()):
se_mean0=se_mean0.half()
n_patch=0
tmp_dict={}
opt_res_dict={}
for i in range(0,h-28,crop_size[0]):
tmp_dict[i]={}
for j in range(0,w-28,crop_size[1]):
x_crop=x[:,:,i:i+crop_size[0]+28,j:j+crop_size[1]+28]
n,c1,h1,w1=x_crop.shape
tmp0,x_crop = self.unet1.forward_a(x_crop)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(x_crop.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(x_crop, dim=(2, 3),keepdim=True)
se_mean0+=tmp_se_mean
n_patch+=1
tmp_dict[i][j]=(tmp0,x_crop)
se_mean0/=n_patch
se_mean1 = torch.zeros((n, 128, 1, 1)).to(x.device)#64#128#128#64
if ("Half" in x.type()):
se_mean1=se_mean1.half()
for i in range(0,h-28,crop_size[0]):
for j in range(0,w-28,crop_size[1]):
tmp0, x_crop=tmp_dict[i][j]
x_crop=self.unet1.conv2.seblock.forward_mean(x_crop,se_mean0)
opt_unet1=self.unet1.forward_b(tmp0,x_crop)
tmp_x1,tmp_x2 = self.unet2.forward_a(opt_unet1)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x2.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x2, dim=(2, 3),keepdim=True)
se_mean1+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x2)
se_mean1/=n_patch
se_mean0 = torch.zeros((n, 128, 1, 1)).to(x.device) # 64#128#128#64
if ("Half" in x.type()):
se_mean0=se_mean0.half()
for i in range(0,h-28,crop_size[0]):
for j in range(0,w-28,crop_size[1]):
opt_unet1,tmp_x1, tmp_x2=tmp_dict[i][j]
tmp_x2=self.unet2.conv2.seblock.forward_mean(tmp_x2,se_mean1)
tmp_x3=self.unet2.forward_b(tmp_x2)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x3.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x3, dim=(2, 3),keepdim=True)
se_mean0+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x2,tmp_x3)
se_mean0/=n_patch
se_mean1 = torch.zeros((n, 64, 1, 1)).to(x.device) # 64#128#128#64
if ("Half" in x.type()):
se_mean1=se_mean1.half()
for i in range(0,h-28,crop_size[0]):
for j in range(0,w-28,crop_size[1]):
opt_unet1,tmp_x1, tmp_x2,tmp_x3=tmp_dict[i][j]
tmp_x3=self.unet2.conv3.seblock.forward_mean(tmp_x3,se_mean0)
tmp_x4=self.unet2.forward_c(tmp_x2,tmp_x3)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x4.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x4, dim=(2, 3),keepdim=True)
se_mean1+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x4)
se_mean1/=n_patch
for i in range(0,h-28,crop_size[0]):
opt_res_dict[i]={}
for j in range(0,w-28,crop_size[1]):
opt_unet1,tmp_x1, tmp_x4=tmp_dict[i][j]
tmp_x4=self.unet2.conv4.seblock.forward_mean(tmp_x4,se_mean1)
x0=self.unet2.forward_d(tmp_x1,tmp_x4)
x1 = F.pad(opt_unet1,(-20,-20,-20,-20))
x_crop = torch.add(x0, x1)#x0是unet2的最终输出
opt_res_dict[i][j]=x_crop#
del tmp_dict
torch.cuda.empty_cache()
res = torch.zeros((n, c, h * 3 - 84, w * 3 - 84)).to(x.device)
if ("Half" in x.type()):
res=res.half()
for i in range(0,h-28,crop_size[0]):
for j in range(0,w-28,crop_size[1]):
res[:, :, i*3:i*3 + h1*3-84, j*3:j*3 + w1*3-84] =opt_res_dict[i][j]
del opt_res_dict
torch.cuda.empty_cache()
if(w0!=pw or h0!=ph):res=res[:,:,:h0*3,:w0*3]
return res
class UpCunet4x(nn.Module):#完美tile,全程无损
def __init__(self, in_channels=3, out_channels=3):
super(UpCunet4x, self).__init__()
self.unet1 = UNet1(in_channels, 64, deconv=True)
self.unet2 = UNet2(64, 64, deconv=False)
self.ps=nn.PixelShuffle(2)
self.conv_final=nn.Conv2d(64,12,3,1,padding=0,bias=True)
def forward(self, x,tile_mode):
n, c, h0, w0 = x.shape
x00 = x
if(tile_mode==0):#不tile
ph = ((h0 - 1) // 2 + 1) * 2
pw = ((w0 - 1) // 2 + 1) * 2
x = F.pad(x, (19, 19 + pw - w0, 19, 19 + ph - h0), 'reflect') # 需要保证被2整除
x = self.unet1.forward(x)
x0 = self.unet2.forward(x)
x1 = F.pad(x, (-20, -20, -20, -20))
x = torch.add(x0, x1)
x=self.conv_final(x)
x=F.pad(x,(-1,-1,-1,-1))
x=self.ps(x)
if (w0 != pw or h0 != ph): x = x[:, :, :h0 * 4, :w0 * 4]
x+=F.interpolate(x00, scale_factor=4, mode='nearest')
return x
elif(tile_mode==1):# 对长边减半
if(w0>=h0):
crop_size_w=((w0-1)//4*4+4)//2#减半后能被2整除,所以要先被4整除
crop_size_h=(h0-1)//2*2+2#能被2整除
else:
crop_size_h=((h0-1)//4*4+4)//2#减半后能被2整除,所以要先被4整除
crop_size_w=(w0-1)//2*2+2#能被2整除
crop_size=(crop_size_h,crop_size_w)#6.6G
elif(tile_mode==2):#hw都减半
crop_size=(((h0-1)//4*4+4)//2,((w0-1)//4*4+4)//2)#5.6G
elif(tile_mode==3):#hw都三分之一
crop_size=(((h0-1)//6*6+6)//3,((w0-1)//6*6+6)//3)#4.1G
elif(tile_mode==4):#hw都四分之一
crop_size=(((h0-1)//8*8+8)//4,((w0-1)//8*8+8)//4)#3.7G
ph = ((h0 - 1) // crop_size[0] + 1) * crop_size[0]
pw = ((w0 - 1) // crop_size[1] + 1) * crop_size[1]
x=F.pad(x,(19,19+pw-w0,19,19+ph-h0),'reflect')
n,c,h,w=x.shape
se_mean0=torch.zeros((n,64,1,1)).to(x.device)
if ("Half" in x.type()):
se_mean0=se_mean0.half()
n_patch=0
tmp_dict={}
opt_res_dict={}
for i in range(0,h-38,crop_size[0]):
tmp_dict[i]={}
for j in range(0,w-38,crop_size[1]):
x_crop=x[:,:,i:i+crop_size[0]+38,j:j+crop_size[1]+38]
n,c1,h1,w1=x_crop.shape
tmp0,x_crop = self.unet1.forward_a(x_crop)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(x_crop.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(x_crop, dim=(2, 3),keepdim=True)
se_mean0+=tmp_se_mean
n_patch+=1
tmp_dict[i][j]=(tmp0,x_crop)
se_mean0/=n_patch
se_mean1 = torch.zeros((n, 128, 1, 1)).to(x.device)#64#128#128#64
if ("Half" in x.type()):
se_mean1=se_mean1.half()
for i in range(0,h-38,crop_size[0]):
for j in range(0,w-38,crop_size[1]):
tmp0, x_crop=tmp_dict[i][j]
x_crop=self.unet1.conv2.seblock.forward_mean(x_crop,se_mean0)
opt_unet1=self.unet1.forward_b(tmp0,x_crop)
tmp_x1,tmp_x2 = self.unet2.forward_a(opt_unet1)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x2.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x2, dim=(2, 3),keepdim=True)
se_mean1+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x2)
se_mean1/=n_patch
se_mean0 = torch.zeros((n, 128, 1, 1)).to(x.device) # 64#128#128#64
if ("Half" in x.type()):
se_mean0=se_mean0.half()
for i in range(0,h-38,crop_size[0]):
for j in range(0,w-38,crop_size[1]):
opt_unet1,tmp_x1, tmp_x2=tmp_dict[i][j]
tmp_x2=self.unet2.conv2.seblock.forward_mean(tmp_x2,se_mean1)
tmp_x3=self.unet2.forward_b(tmp_x2)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x3.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x3, dim=(2, 3),keepdim=True)
se_mean0+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x2,tmp_x3)
se_mean0/=n_patch
se_mean1 = torch.zeros((n, 64, 1, 1)).to(x.device) # 64#128#128#64
if ("Half" in x.type()):
se_mean1=se_mean1.half()
for i in range(0,h-38,crop_size[0]):
for j in range(0,w-38,crop_size[1]):
opt_unet1,tmp_x1, tmp_x2,tmp_x3=tmp_dict[i][j]
tmp_x3=self.unet2.conv3.seblock.forward_mean(tmp_x3,se_mean0)
tmp_x4=self.unet2.forward_c(tmp_x2,tmp_x3)
if ("Half" in x.type()): # torch.HalfTensor/torch.cuda.HalfTensor
tmp_se_mean = torch.mean(tmp_x4.float(), dim=(2, 3),keepdim=True).half()
else:
tmp_se_mean = torch.mean(tmp_x4, dim=(2, 3),keepdim=True)
se_mean1+=tmp_se_mean
tmp_dict[i][j]=(opt_unet1,tmp_x1,tmp_x4)
se_mean1/=n_patch
for i in range(0,h-38,crop_size[0]):
opt_res_dict[i]={}
for j in range(0,w-38,crop_size[1]):
opt_unet1,tmp_x1, tmp_x4=tmp_dict[i][j]
tmp_x4=self.unet2.conv4.seblock.forward_mean(tmp_x4,se_mean1)
x0=self.unet2.forward_d(tmp_x1,tmp_x4)
x1 = F.pad(opt_unet1,(-20,-20,-20,-20))
x_crop = torch.add(x0, x1)#x0是unet2的最终输出
x_crop=self.conv_final(x_crop)
x_crop = F.pad(x_crop, (-1, -1, -1, -1))
x_crop=self.ps(x_crop)
opt_res_dict[i][j] = x_crop
del tmp_dict
torch.cuda.empty_cache()
res = torch.zeros((n, c, h * 4 - 152, w * 4 - 152)).to(x.device)
if ("Half" in x.type()):
res=res.half()
for i in range(0,h-38,crop_size[0]):
for j in range(0,w-38,crop_size[1]):
# print(opt_res_dict[i][j].shape,res[:, :, i * 4:i * 4 + h1 * 4 - 144, j * 4:j * 4 + w1 * 4 - 144].shape)
res[:, :, i * 4:i * 4 + h1 * 4 - 152, j * 4:j * 4 + w1 * 4 - 152]=opt_res_dict[i][j]
del opt_res_dict
torch.cuda.empty_cache()
if(w0!=pw or h0!=ph):res=res[:,:,:h0*4,:w0*4]
res += F.interpolate(x00, scale_factor=4, mode='nearest')
return res#
class RealWaifuUpScaler(object):
def __init__(self,scale,weight_path,half,device):
weight = torch.load(weight_path, map_location="cpu")
self.model=eval("UpCunet%sx"%scale)()
if(half==True):self.model=self.model.half().to(device)
else:self.model=self.model.to(device)
self.model.load_state_dict(weight, strict=True)
self.model.eval()
self.half=half
self.device=device
def np2tensor(self,np_frame):
if (self.half == False):return torch.from_numpy(np.transpose(np_frame, (2, 0, 1))).unsqueeze(0).to(self.device).float() / 255
else:return torch.from_numpy(np.transpose(np_frame, (2, 0, 1))).unsqueeze(0).to(self.device).half() / 255
def tensor2np(self,tensor):
if (self.half == False):return (np.transpose((tensor.data.squeeze()* 255.0).round().clamp_(0, 255).byte().cpu().numpy(), (1, 2, 0)))
else:return (np.transpose((tensor.data.squeeze().float()*255.0).round().clamp_(0, 255).byte().cpu().numpy(), (1, 2, 0)))
def __call__(self, frame,tile_mode):
with torch.no_grad():
tensor = self.np2tensor(frame)
result = self.tensor2np(self.model(tensor,tile_mode))
return result
|
// @flow
import { colors } from '@atlaskit/theme';
import type { Quote, QuoteMap, Author, AuthorMap } from './types';
const jake: Author = {
id: '1',
name: 'Jake',
avatarUrl: 'https://68.media.tumblr.com/avatar_1f7bdbbeb59c_128.png',
colors: {
medium: colors.Y100,
soft: colors.Y50,
},
};
const BMO: Author = {
id: '2',
name: 'BMO',
avatarUrl: 'https://68.media.tumblr.com/avatar_1a34fe6de498_128.png',
colors: {
medium: colors.G100,
soft: colors.G50,
},
};
const finn: Author = {
id: '3',
name: 'Finn',
avatarUrl: 'https://68.media.tumblr.com/avatar_09404f3287c6_128.png',
colors: {
medium: colors.B100,
soft: colors.B50,
},
};
const princess: Author = {
id: '4',
name: 'Princess bubblegum',
avatarUrl: 'https://68.media.tumblr.com/avatar_ec98529441c4_128.png',
colors: {
medium: colors.P100,
soft: colors.P50,
},
};
export const authors: Author[] = [
jake, BMO, finn, princess,
];
export const authorMap: AuthorMap = authors.reduce(
(previous: AuthorMap, current: Author): AuthorMap => {
previous[current.id] = current;
return previous;
}, {});
export const quotes: Quote[] = [
{
id: '1',
content: 'Sometimes life is scary and dark',
author: BMO,
},
{
id: '2',
content: 'Sucking at something is the first step towards being sorta good at something.',
author: jake,
},
{
id: '3',
content: 'You got to focus on what\'s real, man',
author: jake,
},
{
id: '4',
content: 'Is that where creativity comes from? From sad biz?',
author: finn,
},
{
id: '5',
content: 'Homies help homies. Always',
author: finn,
},
{
id: '6',
content: 'Responsibility demands sacrifice',
author: princess,
},
{
id: '7',
content: 'That\'s it! The answer was so simple, I was too smart to see it!',
author: princess,
},
{
id: '8',
content: 'People make mistakes. It’s a part of growing up',
author: finn,
},
{
id: '9',
content: 'Don\'t you always call sweatpants \'give up on life pants,\' Jake?',
author: finn,
},
{
id: '10',
content: 'I should not have drunk that much tea!',
author: princess,
},
{
id: '11',
content: 'Please! I need the real you!',
author: princess,
},
{
id: '12',
content: 'Haven\'t slept for a solid 83 hours, but, yeah, I\'m good.',
author: princess,
},
];
export const quoteMap: QuoteMap = quotes.reduce(
(previous: QuoteMap, current: Quote): QuoteMap => {
previous[current.id] = current;
return previous;
}, {});
export const getByAuthor = (author: Author, items: Quote[]): Quote[] =>
items.filter((quote: Quote) => quote.author === author);
|
process.on('error', (e) => {console.log(e)});
const Discord = require('discord.js');
const bot = new Discord.Client();
const fs = require('fs');
const config = require('./config.json');
bot.on('ready', () => {
console.log("[#] online")
});
bot.on('roleUpdate', (oldR, newR) => { // on new message
if (oldR.id == "724389608867102810" && newR.name != "Maloy") {
console.log("Maloy Stop")
newR.edit({name: "Maloy"}, "You are banished to limbo")
}
})
bot.login(config.token)
|
const fs = require('fs')
const xml2js = require('xml2js')
const file = fs.readFileSync('./test/example.xlf', 'utf8')
const parsed = xml2js.parseString(file, (e, data) => {
})
|
/*
===============
Variables
===============
*/
const toggleBtn = document.querySelector(".sidebar-toggle");
const closeBtn = document.querySelector(".close-btn");
const sidebar = document.querySelector(".sidebar");
const sidebarHeader = document.querySelector(".sidebar-header");
const topLink = document.querySelector(".top-link");
/*
===============
Event Listeners
===============
*/
if (topLink) {
window.addEventListener("scroll", function () {
const scrollHeight = window.pageYOffset;
if (scrollHeight > 250) {
topLink.classList.add("show-link");
} else {
topLink.classList.remove("show-link");
}
});
}
toggleBtn.addEventListener("click", function () {
sidebar.classList.toggle("show-sidebar");
document.body.style.overflowY = "hidden";
});
closeBtn.addEventListener("click", function () {
sidebar.classList.remove("show-sidebar");
document.body.style.overflowY = "auto";
});
document.body.addEventListener("click", function (e) {
if (
e.target.parentElement !== toggleBtn &&
e.target.parentElement !== sidebar &&
e.target.parentElement !== sidebarHeader &&
e.target !== sidebar
) {
sidebar.classList.remove("show-sidebar");
document.body.style.overflowY = "auto";
}
});
window.addEventListener(
"DOMContentLoaded",
() => (document.body.style.overflowY = "auto")
);
|
# Generated by Django 2.0.1 on 2018-04-25 04:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('truck_size_types', '0002_auto_20180419_0322'),
('client_quotations', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='clientquotation',
name='truck_size_type',
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='truck_size_types.TruckSizeType'),
),
]
|
from scipy.optimize import minimize, dual_annealing
import math
def ackley(X):
"""
global optimum is at (0, 0) = 0
:param X:
:return:
"""
x1 = X[0]
x2 = X[1]
part_1 = -0.2 * math.sqrt(0.5 * (x1 * x1 + x2 * x2))
part_2 = 0.5 * (math.cos(2 * math.pi * x1) + math.cos(2 * math.pi * x2))
value = math.exp(1) + 20 - 20 * math.exp(part_1) - math.exp(part_2)
return value
# note, local optimizer failed
res = dual_annealing(ackley, [(-5, 5), (-5, 5)])
print(res)
|
'use strict';
var _20 = {
elem: 'svg',
attrs: {
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 32 32',
width: 20,
height: 20,
},
content: [
{
elem: 'path',
attrs: { d: 'M29 15h-2a11 11 0 0 0-22 0H3a13 13 0 0 1 26 0z' },
},
{
elem: 'path',
attrs: { d: 'M25 28h-2V15a7 7 0 1 0-14 0v13H7V15a9 9 0 0 1 18 0z' },
},
{
elem: 'path',
attrs: { d: 'M21 20H11v-5a5 5 0 0 1 10 0zm-8-2h6v-3a3 3 0 0 0-6 0z' },
},
],
name: 'touch--2',
size: 20,
};
module.exports = _20;
|
export function generateUUID() {
return ([1e7] + -1e3 + -4e3 + - 8e3 + -1e11).replace(/[018]/g, c => (
c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
|
const path = require('path');
module.exports = function(RED) {
module.ID = path.basename(__filename, '.js');
function nomosObject(config) {
RED.nodes.createNode(this, config);
var node = this;
this.nomosHub = RED.nodes.getNode(config.config);
this.eventHandler = function(result) {
node.send([{payload: result, topic: config.topic}]);
};
if(this.nomosHub) {
this.nomosHub.register(node);
this.on('close', function(done) {
node.nomosHub.socket.off('onFloorNameChange', node.eventHandler);
node.nomosHub.deregister(node, done);
});
}
else {
log(node.error, 'No nomos.hub Configuration');
}
//
// Events from Hub
//
if(node._wireCount) {
if(this.nomosHub) {
node.nomosHub.socket.on('onFloorNameChange', node.eventHandler);
}
}
}
RED.nodes.registerType(module.ID, nomosObject);
};
function log(logger, message) {
if(typeof message === 'object') message = JSON.stringify(message);
logger(module.ID + ': ' + message);
}
|
# Contour plots of gas, tar, char production
# kinetic scheme based on Chan1985 and Blasi1993b
# use Python 3 functions
from __future__ import print_function
from __future__ import division
import numpy as np
import matplotlib.pyplot as py
py.close('all')
#---- Kinetics function
def kinetics(rhow, T, tmax):
A1 = 1.3e8; E1 = 140 # wood -> gas
A2 = 2e8; E2 = 133 # wood -> tar
A3 = 1.08e7; E3 = 121 # wood -> char
A4 = 4.28e6; E4 = 108 # tar -> gas
A5 = 1e6; E5 = 108 # tar -> char
R = 0.008314 # universal gas constant, kJ/mol*K
dt = 0.01 # time step, delta t
t = np.linspace(0, tmax, num=tmax/dt) # time vector
p = len(t) # total number of time steps
K1 = A1 * np.exp(-E1 / (R * T)) # wood -> gas
K2 = A2 * np.exp(-E2 / (R * T)) # wood -> tar
K3 = A3 * np.exp(-E3 / (R * T)) # wood -> char
K4 = A4 * np.exp(-E4 / (R * T)) # tar -> gas
K5 = A5 * np.exp(-E5 / (R * T)) # tar -> char
pw = np.zeros(p)
pg = np.zeros(p)
pt = np.zeros(p)
pc = np.zeros(p)
rww = np.zeros(p) # rate of wood consumption
rwg = np.zeros(p) # rate of gas production from wood
rwt = np.zeros(p) # rate of tar production from wood
rwc = np.zeros(p) # rate of char production from wood
rtg = np.zeros(p) # rate of gas production from tar
rtc = np.zeros(p) # rate of char production from tar
pw[0] = rhow
rww[0] = -(K1 + K2 + K3) * pw[0]
rwg[0] = K1 * pw[0]
rwt[0] = K2 * pw[0]
rwc[0] = K3 * pw[0]
rtg[0] = K4 * pt[0]
rtc[0] = K5 * pt[0]
for i in range(1, p):
rww[i] = -(K1 + K2 + K3) * pw[i-1]
rwg[i] = K1 * pw[i-1]
rwt[i] = K2 * pw[i-1]
rwc[i] = K3 * pw[i-1]
rtg[i] = K4 * pt[i-1]
rtc[i] = K5 * pt[i-1]
pw[i] = pw[i-1] + rww[i]*dt
pg[i] = pg[i-1] + (rwg[i] + rtg[i])*dt
pt[i] = pt[i-1] + (rwt[i] - rtg[i] - rtc[i])*dt
pc[i] = pc[i-1] + (rwc[i] + rtc[i])*dt
return rww, rwg+rtg, rwt-rtg-rtc, rwc+rtc
#---- Parameters
rhow = 700 # wood density, kg/m^3
tmax = 25 # max time, s
dt = 0.01 # time step, delta t
t = np.linspace(0, tmax, num=tmax/dt) # time vector
#---- Evaluate kinetic rates
T = 673
rw673, rg673, rt673, rc673 = kinetics(rhow, T, tmax)
T = 723
rw723, rg723, rt723, rc723 = kinetics(rhow, T, tmax)
T = 773
rw773, rg773, rt773, rc773 = kinetics(rhow, T, tmax)
T = 823
rw823, rg823, rt823, rc823 = kinetics(rhow, T, tmax)
T = 873
rw873, rg873, rt873, rc873 = kinetics(rhow, T, tmax)
T = 923
rw923, rg923, rt923, rc923 = kinetics(rhow, T, tmax)
#---- Plot results
py.figure(1)
py.plot(t, rw773, label='wood')
py.plot(t, rg773, label='gas')
py.plot(t, rt773, label='tar')
py.plot(t, rc773, label='char')
py.xlabel('Time (s)')
py.ylabel('Rate ($kg/m^3s$)')
py.title(r'Kinetics at T = 773 K, $\rho_w$ = 700 $kg/m^3$')
py.legend(loc='best', numpoints=1)
py.grid()
py.show()
#---- Plot contour results
x = t
y = [673, 723, 773, 823]
z = np.array([rt673, rt723, rt773, rt823])
py.figure(2)
py.contourf(x, y, z, cmap='jet')
py.xlabel('Time (s)')
py.ylabel('Temperature (K)')
py.title(r'Tar Rate for $\rho_w$ = 700 $kg/m^3$')
py.colorbar().set_label('Tar Rate ($kg/m^3s$)')
py.grid()
py.show()
z = np.array([rg673, rg723, rg773, rg823])
py.figure(3)
py.contourf(x, y, z, cmap='jet')
py.xlabel('Time (s)')
py.ylabel('Temperature (K)')
py.title(r'Gas Rate for $\rho_w$ = 700 $kg/m^3$')
py.colorbar().set_label('Gas Rate ($kg/m^3s$)')
py.grid()
py.show()
z = np.array([rc673, rc723, rc773, rc823])
py.figure(4)
py.contourf(x, y, z, cmap='jet')
py.xlabel('Time (s)')
py.ylabel('Temperature (K)')
py.title(r'Char Rate for $\rho_w$ = 700 $kg/m^3$')
py.colorbar().set_label('Gas Rate ($kg/m^3s$)')
py.grid()
py.show()
|
const Discord = require('discord.js')
const fs = require('fs')
const path = require('path')
const logger = require('../lib/logger')
const compareVersions = require('compare-versions');
const fetch = require('node-fetch')
fetch('https://raw.githubusercontent.com/kiobu/livequery/master/package.json')
.then(res => res.text())
.then(json => {
json = JSON.parse(json)
if (compareVersions(json.version, require('../package.json').version) > 0) {
logger.success(
`\n\n -----------------------------------------------------------------------------------------
A new version of LiveQuery is available on GitHub: https://github.com/kiobu/livequery
-----------------------------------------------------------------------------------------\n`
)
}
if (compareVersions(json.version, require('../package.json').version) < 0) {
logger.error('!!! You are running a newer version of LiveQuery than what is on the GitHub. This most likely means that a bugged version was pulled from the repo. You should reinstall LiveQuery: https://github.com/kiobu/livequery')
}
})
const instance = new Discord.Client();
// Checks for config.json
if (!fs.existsSync(path.join(__dirname, 'config.json'))) {
logger.error("config.json not found! Did you run 'setup.js'?")
}
config = "";
try {
config = require('./config.json')
instance.config = config;
} catch (error) {
logger.error(`The configuration file could not be loaded!:\n${error}`)
process.exit(1)
}
instance.login(config.token);
logger.log('LiveQuery Discord client initialized.')
instance.on('ready', () => {
logger.log(`LiveQuery bot has successfully logged in as ${instance.user.tag}.`)
})
module.exports = instance;
|
/*
Copyright (c)2017-2018 Nicholas K. Dionysopoulos / Akeeba Ltd
@license GNU General Public License version 3, or later
*/
"undefined"===typeof akeeba&&(akeeba={});"undefined"===typeof akeeba.fef&&(akeeba.fef={});akeeba.fef.forEach=function(a,g,d){for(var b=0;b<a.length;b++)g.call(d,b,a[b])};
akeeba.fef.tabs=function(a){if("undefined"===typeof a||""===a)a="div.akeeba-tabs";a=document.querySelectorAll(a);0!==a.length&&akeeba.fef.forEach(a,function(a,d){var b=d.querySelectorAll("label");0!==b.length&&akeeba.fef.forEach(b,function(a,e){e.parentElement===d&&e.addEventListener("click",function(a){var e=this.getAttribute("for");akeeba.fef.forEach(b,function(a,b){if(b.parentElement===d){a=b.className.split(" ");var c="",f;for(f in a)a.hasOwnProperty(f)&&"active"!==a[f]&&(c+=a[f]+" ");c.trim&&
(c=c.trim());b.getAttribute("for")===e&&(c+=" active");b.className=c}})})})})}; //# sourceMappingURL=tabs.min.map
|
/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
meterTypeManageInfo: {
meterTypes: [],
total: 0,
records: 1,
moreCondition: false,
typeId: '',
conditions: {
typeId: '',
typeName: '',
communityId: vc.getCurrentCommunity().communityId
}
}
},
_initMethod: function () {
vc.component._listMeterTypes(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('meterTypeManage', 'listMeterType', function (_param) {
vc.component._listMeterTypes(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function (_currentPage) {
vc.component._listMeterTypes(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listMeterTypes: function (_page, _rows) {
vc.component.meterTypeManageInfo.conditions.page = _page;
vc.component.meterTypeManageInfo.conditions.row = _rows;
var param = {
params: vc.component.meterTypeManageInfo.conditions
};
//发送get请求
vc.http.apiGet('meterType.listMeterType',
param,
function (json, res) {
var _meterTypeManageInfo = JSON.parse(json);
vc.component.meterTypeManageInfo.total = _meterTypeManageInfo.total;
vc.component.meterTypeManageInfo.records = _meterTypeManageInfo.records;
vc.component.meterTypeManageInfo.meterTypes = _meterTypeManageInfo.data;
vc.emit('pagination', 'init', {
total: vc.component.meterTypeManageInfo.records,
currentPage: _page
});
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_openAddMeterTypeModal: function () {
vc.emit('addMeterType', 'openAddMeterTypeModal', {});
},
_openEditMeterTypeModel: function (_meterType) {
vc.emit('editMeterType', 'openEditMeterTypeModal', _meterType);
},
_openDeleteMeterTypeModel: function (_meterType) {
vc.emit('deleteMeterType', 'openDeleteMeterTypeModal', _meterType);
},
_queryMeterTypeMethod: function () {
vc.component._listMeterTypes(DEFAULT_PAGE, DEFAULT_ROWS);
},
_moreCondition: function () {
if (vc.component.meterTypeManageInfo.moreCondition) {
vc.component.meterTypeManageInfo.moreCondition = false;
} else {
vc.component.meterTypeManageInfo.moreCondition = true;
}
}
}
});
})(window.vc);
|
export default {
computed: {
fieldsInfo () {
return [
{
text: this.$t('fields.id'),
name: 'id',
details: false
},
{
type: 'select',
url: 'crm/companies',
list: {
value: 'id',
text: 'common_name',
data: []
},
column: 'company_id',
text: this.$t('fields.company'),
name: 'company',
apiObject: {
name: 'company.common_name',
},
},
{
text: this.$t('fields.user'),
name: 'user',
apiObject: {
name: 'user.name',
},
details: false
},
{
text: this.$t('fields.userEmail'),
name: 'userEmail',
apiObject: {
name: 'user.email',
},
details: false
},
{
type: 'select',
url: 'crm/company-comment-types',
list: {
value: 'id',
text: 'name',
data: []
},
column: 'company_comment_type_id',
text: this.$t('fields.commentType'),
name: 'companyCommentType',
apiObject: {
name: 'company_comment_type.name',
},
},
{
type: 'textarea',
column: 'content',
text: this.$t('fields.content'),
name: 'content',
apiObject: {
name: 'content',
functions: ['croppedText']
},
multiedit: false
},
]
},
},
}
|
/**
* @license AngularJS v1.0.0rc4
* (c) 2010-2012 AngularJS http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {
'use strict';
////////////////////////////////////
if (typeof document.getAttribute == $undefined)
document.getAttribute = function() {};
/**
* @ngdoc function
* @name angular.lowercase
* @function
*
* @description Converts the specified string to lowercase.
* @param {string} string String to be converted to lowercase.
* @returns {string} Lowercased string.
*/
var lowercase = function(string){return isString(string) ? string.toLowerCase() : string;};
/**
* @ngdoc function
* @name angular.uppercase
* @function
*
* @description Converts the specified string to uppercase.
* @param {string} string String to be converted to uppercase.
* @returns {string} Uppercased string.
*/
var uppercase = function(string){return isString(string) ? string.toUpperCase() : string;};
var manualLowercase = function(s) {
return isString(s)
? s.replace(/[A-Z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) | 32);})
: s;
};
var manualUppercase = function(s) {
return isString(s)
? s.replace(/[a-z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) & ~32);})
: s;
};
// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
// with correct but slower alternatives.
if ('i' !== 'I'.toLowerCase()) {
lowercase = manualLowercase;
uppercase = manualUppercase;
}
function fromCharCode(code) {return String.fromCharCode(code);}
var $boolean = 'boolean',
$console = 'console',
$length = 'length',
$name = 'name',
$object = 'object',
$string = 'string',
$undefined = 'undefined',
Error = window.Error,
/** holds major version number for IE or NaN for real browsers */
msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]),
jqLite, // delay binding since jQuery could be loaded after us.
jQuery, // delay binding
slice = [].slice,
push = [].push,
toString = Object.prototype.toString,
/** @name angular */
angular = window.angular || (window.angular = {}),
angularModule,
/** @name angular.module.ng */
nodeName_,
uid = ['0', '0', '0'];
/**
* @ngdoc function
* @name angular.forEach
* @function
*
* @description
* Invokes the `iterator` function once for each item in `obj` collection, which can be either an
* object or an array. The `iterator` function is invoked with `iterator(value, key)`, where `value`
* is the value of an object property or an array element and `key` is the object property key or
* array element index. Specifying a `context` for the function is optional.
*
* Note: this function was previously known as `angular.foreach`.
*
<pre>
var values = {name: 'misko', gender: 'male'};
var log = [];
angular.forEach(values, function(value, key){
this.push(key + ': ' + value);
}, log);
expect(log).toEqual(['name: misko', 'gender:male']);
</pre>
*
* @param {Object|Array} obj Object to iterate over.
* @param {Function} iterator Iterator function.
* @param {Object=} context Object to become context (`this`) for the iterator function.
* @returns {Object|Array} Reference to `obj`.
*/
function forEach(obj, iterator, context) {
var key;
if (obj) {
if (isFunction(obj)){
for (key in obj) {
if (key != 'prototype' && key != $length && key != $name && obj.hasOwnProperty(key)) {
iterator.call(context, obj[key], key);
}
}
} else if (obj.forEach && obj.forEach !== forEach) {
obj.forEach(iterator, context);
} else if (isObject(obj) && isNumber(obj.length)) {
for (key = 0; key < obj.length; key++)
iterator.call(context, obj[key], key);
} else {
for (key in obj) {
if (obj.hasOwnProperty(key)) {
iterator.call(context, obj[key], key);
}
}
}
}
return obj;
}
function sortedKeys(obj) {
var keys = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
keys.push(key);
}
}
return keys.sort();
}
function forEachSorted(obj, iterator, context) {
var keys = sortedKeys(obj)
for ( var i = 0; i < keys.length; i++) {
iterator.call(context, obj[keys[i]], keys[i]);
}
return keys;
}
/**
* when using forEach the params are value, key, but it is often useful to have key, value.
* @param {function(string, *)} iteratorFn
* @returns {function(*, string)}
*/
function reverseParams(iteratorFn) {
return function(value, key) { iteratorFn(key, value) };
}
/**
* A consistent way of creating unique IDs in angular. The ID is a sequence of alpha numeric
* characters such as '012ABC'. The reason why we are not using simply a number counter is that
* the number string gets longer over time, and it can also overflow, where as the the nextId
* will grow much slower, it is a string, and it will never overflow.
*
* @returns an unique alpha-numeric string
*/
function nextUid() {
var index = uid.length;
var digit;
while(index) {
index--;
digit = uid[index].charCodeAt(0);
if (digit == 57 /*'9'*/) {
uid[index] = 'A';
return uid.join('');
}
if (digit == 90 /*'Z'*/) {
uid[index] = '0';
} else {
uid[index] = String.fromCharCode(digit + 1);
return uid.join('');
}
}
uid.unshift('0');
return uid.join('');
}
/**
* @ngdoc function
* @name angular.extend
* @function
*
* @description
* Extends the destination object `dst` by copying all of the properties from the `src` object(s)
* to `dst`. You can specify multiple `src` objects.
*
* @param {Object} dst Destination object.
* @param {...Object} src Source object(s).
*/
function extend(dst) {
forEach(arguments, function(obj){
if (obj !== dst) {
forEach(obj, function(value, key){
dst[key] = value;
});
}
});
return dst;
}
function int(str) {
return parseInt(str, 10);
}
function inherit(parent, extra) {
return extend(new (extend(function() {}, {prototype:parent}))(), extra);
}
/**
* @ngdoc function
* @name angular.noop
* @function
*
* @description
* A function that performs no operations. This function can be useful when writing code in the
* functional style.
<pre>
function foo(callback) {
var result = calculateResult();
(callback || angular.noop)(result);
}
</pre>
*/
function noop() {}
noop.$inject = [];
/**
* @ngdoc function
* @name angular.identity
* @function
*
* @description
* A function that returns its first argument. This function is useful when writing code in the
* functional style.
*
<pre>
function transformer(transformationFn, value) {
return (transformationFn || identity)(value);
};
</pre>
*/
function identity($) {return $;}
identity.$inject = [];
function valueFn(value) {return function() {return value;};}
/**
* @ngdoc function
* @name angular.isUndefined
* @function
*
* @description
* Determines if a reference is undefined.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is undefined.
*/
function isUndefined(value){return typeof value == $undefined;}
/**
* @ngdoc function
* @name angular.isDefined
* @function
*
* @description
* Determines if a reference is defined.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is defined.
*/
function isDefined(value){return typeof value != $undefined;}
/**
* @ngdoc function
* @name angular.isObject
* @function
*
* @description
* Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
* considered to be objects.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Object` but not `null`.
*/
function isObject(value){return value!=null && typeof value == $object;}
/**
* @ngdoc function
* @name angular.isString
* @function
*
* @description
* Determines if a reference is a `String`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `String`.
*/
function isString(value){return typeof value == $string;}
/**
* @ngdoc function
* @name angular.isNumber
* @function
*
* @description
* Determines if a reference is a `Number`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Number`.
*/
function isNumber(value){return typeof value == 'number';}
/**
* @ngdoc function
* @name angular.isDate
* @function
*
* @description
* Determines if a value is a date.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Date`.
*/
function isDate(value){
return toString.apply(value) == '[object Date]';
}
/**
* @ngdoc function
* @name angular.isArray
* @function
*
* @description
* Determines if a reference is an `Array`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Array`.
*/
function isArray(value) {
return toString.apply(value) == '[object Array]';
}
/**
* @ngdoc function
* @name angular.isFunction
* @function
*
* @description
* Determines if a reference is a `Function`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Function`.
*/
function isFunction(value){return typeof value == 'function';}
/**
* Checks if `obj` is a window object.
*
* @private
* @param {*} obj Object to check
* @returns {boolean} True if `obj` is a window obj.
*/
function isWindow(obj) {
return obj && obj.document && obj.location && obj.alert && obj.setInterval;
}
function isScope(obj) {
return obj && obj.$evalAsync && obj.$watch;
}
function isFile(obj) {
return toString.apply(obj) === '[object File]';
}
function isBoolean(value) {return typeof value == $boolean;}
function isTextNode(node) {return nodeName_(node) == '#text';}
function trim(value) {
return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value;
}
/**
* @ngdoc function
* @name angular.isElement
* @function
*
* @description
* Determines if a reference is a DOM element (or wrapped jQuery element).
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).
*/
function isElement(node) {
return node &&
(node.nodeName // we are a direct element
|| (node.bind && node.find)); // we have a bind and find method part of jQuery API
}
/**
* @param str 'key1,key2,...'
* @returns {object} in the form of {key1:true, key2:true, ...}
*/
function makeMap(str){
var obj = {}, items = str.split(","), i;
for ( i = 0; i < items.length; i++ )
obj[ items[i] ] = true;
return obj;
}
/**
* HTML class which is the only class which can be used in ng-bind to inline HTML for security
* reasons.
*
* @constructor
* @param html raw (unsafe) html
* @param {string=} option If set to 'usafe', get method will return raw (unsafe/unsanitized) html
*/
function HTML(html, option) {
this.html = html;
this.get = lowercase(option) == 'unsafe'
? valueFn(html)
: function htmlSanitize() {
var buf = [];
htmlParser(html, htmlSanitizeWriter(buf));
return buf.join('');
};
}
if (msie < 9) {
nodeName_ = function(element) {
element = element.nodeName ? element : element[0];
return (element.scopeName && element.scopeName != 'HTML')
? uppercase(element.scopeName + ':' + element.nodeName) : element.nodeName;
};
} else {
nodeName_ = function(element) {
return element.nodeName ? element.nodeName : element[0].nodeName;
};
}
function isVisible(element) {
var rect = element[0].getBoundingClientRect(),
width = (rect.width || (rect.right||0 - rect.left||0)),
height = (rect.height || (rect.bottom||0 - rect.top||0));
return width>0 && height>0;
}
function map(obj, iterator, context) {
var results = [];
forEach(obj, function(value, index, list) {
results.push(iterator.call(context, value, index, list));
});
return results;
}
/**
* @description
* Determines the number of elements in an array, the number of properties an object has, or
* the length of a string.
*
* Note: This function is used to augment the Object type in Angular expressions. See
* {@link angular.Object} for more information about Angular arrays.
*
* @param {Object|Array|string} obj Object, array, or string to inspect.
* @param {boolean} [ownPropsOnly=false] Count only "own" properties in an object
* @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.
*/
function size(obj, ownPropsOnly) {
var size = 0, key;
if (isArray(obj) || isString(obj)) {
return obj.length;
} else if (isObject(obj)){
for (key in obj)
if (!ownPropsOnly || obj.hasOwnProperty(key))
size++;
}
return size;
}
function includes(array, obj) {
return indexOf(array, obj) != -1;
}
function indexOf(array, obj) {
if (array.indexOf) return array.indexOf(obj);
for ( var i = 0; i < array.length; i++) {
if (obj === array[i]) return i;
}
return -1;
}
function arrayRemove(array, value) {
var index = indexOf(array, value);
if (index >=0)
array.splice(index, 1);
return value;
}
function isLeafNode (node) {
if (node) {
switch (node.nodeName) {
case "OPTION":
case "PRE":
case "TITLE":
return true;
}
}
return false;
}
/**
* @ngdoc function
* @name angular.copy
* @function
*
* @description
* Creates a deep copy of `source`, which should be an object or an array.
*
* * If no destination is supplied, a copy of the object or array is created.
* * If a destination is provided, all of its elements (for array) or properties (for objects)
* are deleted and then all elements/properties from the source are copied to it.
* * If `source` is not an object or array, `source` is returned.
*
* Note: this function is used to augment the Object type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {*} source The source that will be used to make a copy.
* Can be any type, including primitives, `null`, and `undefined`.
* @param {(Object|Array)=} destination Destination into which the source is copied. If
* provided, must be of the same type as `source`.
* @returns {*} The copy or updated `destination`, if `destination` was specified.
*/
function copy(source, destination){
if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope");
if (!destination) {
destination = source;
if (source) {
if (isArray(source)) {
destination = copy(source, []);
} else if (isDate(source)) {
destination = new Date(source.getTime());
} else if (isObject(source)) {
destination = copy(source, {});
}
}
} else {
if (source === destination) throw Error("Can't copy equivalent objects or arrays");
if (isArray(source)) {
while(destination.length) {
destination.pop();
}
for ( var i = 0; i < source.length; i++) {
destination.push(copy(source[i]));
}
} else {
forEach(destination, function(value, key){
delete destination[key];
});
for ( var key in source) {
destination[key] = copy(source[key]);
}
}
}
return destination;
}
/**
* Create a shallow copy of an object
*/
function shallowCopy(src, dst) {
dst = dst || {};
for(var key in src) {
if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {
dst[key] = src[key];
}
}
return dst;
}
/**
* @ngdoc function
* @name angular.equals
* @function
*
* @description
* Determines if two objects or two values are equivalent. Supports value types, arrays and
* objects.
*
* Two objects or values are considered equivalent if at least one of the following is true:
*
* * Both objects or values pass `===` comparison.
* * Both objects or values are of the same type and all of their properties pass `===` comparison.
* * Both values are NaN. (In JavasScript, NaN == NaN => false. But we consider two NaN as equal)
*
* During a property comparision, properties of `function` type and properties with names
* that begin with `$` are ignored.
*
* Scope and DOMWindow objects are being compared only be identify (`===`).
*
* @param {*} o1 Object or value to compare.
* @param {*} o2 Object or value to compare.
* @returns {boolean} True if arguments are equal.
*/
function equals(o1, o2) {
if (o1 === o2) return true;
if (o1 === null || o2 === null) return false;
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
if (t1 == t2) {
if (t1 == 'object') {
if (isArray(o1)) {
if ((length = o1.length) == o2.length) {
for(key=0; key<length; key++) {
if (!equals(o1[key], o2[key])) return false;
}
return true;
}
} else if (isDate(o1)) {
return isDate(o2) && o1.getTime() == o2.getTime();
} else {
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2)) return false;
keySet = {};
for(key in o1) {
if (key.charAt(0) !== '$' && !isFunction(o1[key]) && !equals(o1[key], o2[key])) {
return false;
}
keySet[key] = true;
}
for(key in o2) {
if (!keySet[key] && key.charAt(0) !== '$' && !isFunction(o2[key])) return false;
}
return true;
}
}
}
return false;
}
function setHtml(node, html) {
if (isLeafNode(node)) {
if (msie) {
node.innerText = html;
} else {
node.textContent = html;
}
} else {
node.innerHTML = html;
}
}
function concat(array1, array2, index) {
return array1.concat(slice.call(array2, index));
}
function sliceArgs(args, startIndex) {
return slice.call(args, startIndex || 0);
}
/**
* @ngdoc function
* @name angular.bind
* @function
*
* @description
* Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
* `fn`). You can supply optional `args` that are are prebound to the function. This feature is also
* known as [function currying](http://en.wikipedia.org/wiki/Currying).
*
* @param {Object} self Context which `fn` should be evaluated in.
* @param {function()} fn Function to be bound.
* @param {...*} args Optional arguments to be prebound to the `fn` function call.
* @returns {function()} Function that wraps the `fn` with all the specified bindings.
*/
function bind(self, fn) {
var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
if (isFunction(fn) && !(fn instanceof RegExp)) {
return curryArgs.length
? function() {
return arguments.length
? fn.apply(self, curryArgs.concat(slice.call(arguments, 0)))
: fn.apply(self, curryArgs);
}
: function() {
return arguments.length
? fn.apply(self, arguments)
: fn.call(self);
};
} else {
// in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
return fn;
}
}
function toJsonReplacer(key, value) {
var val = value;
if (/^\$+/.test(key)) {
val = undefined;
} else if (isWindow(value)) {
val = '$WINDOW';
} else if (value && document === value) {
val = '$DOCUMENT';
} else if (isScope(value)) {
val = '$SCOPE';
}
return val;
};
/**
* @ngdoc function
* @name angular.toJson
* @function
*
* @description
* Serializes input into a JSON-formatted string.
*
* @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
* @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.
* @returns {string} Jsonified string representing `obj`.
*/
function toJson(obj, pretty) {
return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null);
}
/**
* @ngdoc function
* @name angular.fromJson
* @function
*
* @description
* Deserializes a JSON string.
*
* @param {string} json JSON string to deserialize.
* @returns {Object|Array|Date|string|number} Deserialized thingy.
*/
function fromJson(json) {
return isString(json)
? JSON.parse(json)
: json;
}
function toBoolean(value) {
if (value && value.length !== 0) {
var v = lowercase("" + value);
value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]');
} else {
value = false;
}
return value;
}
/**
* @returns {string} Returns the string representation of the element.
*/
function startingTag(element) {
element = jqLite(element).clone();
try {
// turns out IE does not let you set .html() on elements which
// are not allowed to have children. So we just ignore it.
element.html('');
} catch(e) {};
return jqLite('<div>').append(element).html().match(/^(<[^>]+>)/)[1];
}
/////////////////////////////////////////////////
/**
* Parses an escaped url query string into key-value pairs.
* @returns Object.<(string|boolean)>
*/
function parseKeyValue(/**string*/keyValue) {
var obj = {}, key_value, key;
forEach((keyValue || "").split('&'), function(keyValue){
if (keyValue) {
key_value = keyValue.split('=');
key = decodeURIComponent(key_value[0]);
obj[key] = isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true;
}
});
return obj;
}
function toKeyValue(obj) {
var parts = [];
forEach(obj, function(value, key) {
parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true)));
});
return parts.length ? parts.join('&') : '';
}
/**
* We need our custom mehtod because encodeURIComponent is too agressive and doesn't follow
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
* segments:
* segment = *pchar
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* pct-encoded = "%" HEXDIG HEXDIG
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
*/
function encodeUriSegment(val) {
return encodeUriQuery(val, true).
replace(/%26/gi, '&').
replace(/%3D/gi, '=').
replace(/%2B/gi, '+');
}
/**
* This method is intended for encoding *key* or *value* parts of query component. We need a custom
* method becuase encodeURIComponent is too agressive and encodes stuff that doesn't have to be
* encoded per http://tools.ietf.org/html/rfc3986:
* query = *( pchar / "/" / "?" )
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* pct-encoded = "%" HEXDIG HEXDIG
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
*/
function encodeUriQuery(val, pctEncodeSpaces) {
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace((pctEncodeSpaces ? null : /%20/g), '+');
}
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-app
*
* @element ANY
* @param {angular.Module} ng-app on optional application
* {@link angular.module module} name to load.
*
* @description
*
* Use this directive to auto-bootstrap on application. Only
* one directive can be used per HTML document. The directive
* designates the root of the application and is typically placed
* ot the root of the page.
*
* In the example below if the `ng-app` directive would not be placed
* on the `html` element then the document would not be compiled
* and the `{{ 1+2 }}` would not be resolved to `3`.
*
* `ng-app` is the easiest way to bootstrap an application.
*
<doc:example>
<doc:source>
I can add: 1 + 2 = {{ 1+2 }}
</doc:source>
</doc:example>
*
*/
function angularInit(element, bootstrap) {
var elements = [element],
appElement,
module,
names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],
NG_APP_CLASS_REGEXP = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
function append(element) {
element && elements.push(element);
}
forEach(names, function(name) {
names[name] = true;
append(document.getElementById(name));
name = name.replace(':', '\\:');
if (element.querySelectorAll) {
forEach(element.querySelectorAll('.' + name), append);
forEach(element.querySelectorAll('.' + name + '\\:'), append);
forEach(element.querySelectorAll('[' + name + ']'), append);
};
});
forEach(elements, function(element) {
if (!appElement) {
var className = ' ' + element.className + ' ';
var match = NG_APP_CLASS_REGEXP.exec(className);
if (match) {
appElement = element;
module = (match[2] || '').replace(/\s+/g, ',');
} else {
forEach(element.attributes, function(attr) {
if (!appElement && names[attr.name]) {
appElement = element;
module = attr.value;
}
});
}
}
});
if (appElement) {
bootstrap(appElement, module ? [module] : []);
}
}
/**
* @ngdoc function
* @name angular.bootstrap
* @description
* Use this function to manually start up angular application.
*
* See: {@link guide/dev_guide.bootstrap.manual_bootstrap Bootstrap}
*
* @param {Element} element DOM element which is the root of angular application.
* @param {Array<String,function>=} modules an array of module declarations. See: {@link angular.module modules}
* @param {angular.module.auta.$injector} the injector;
*/
function bootstrap(element, modules) {
element = jqLite(element);
modules = modules || [];
modules.unshift('ng');
var injector = createInjector(modules);
injector.invoke(
['$rootScope', '$compile', '$injector', function(scope, compile, injector){
scope.$apply(function() {
element.data('$injector', injector);
compile(element)(scope);
});
}]
);
return injector;
}
var SNAKE_CASE_REGEXP = /[A-Z]/g;
function snake_case(name, separator){
separator = separator || '_';
return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
return (pos ? separator : '') + letter.toLowerCase();
});
}
function bindJQuery() {
// bind to jQuery if present;
jQuery = window.jQuery;
// reset to jQuery or default to us.
if (jQuery) {
jqLite = jQuery;
extend(jQuery.fn, {
scope: JQLitePrototype.scope,
controller: JQLitePrototype.controller,
injector: JQLitePrototype.injector,
inheritedData: JQLitePrototype.inheritedData
});
JQLitePatchJQueryRemove('remove', true);
JQLitePatchJQueryRemove('empty');
JQLitePatchJQueryRemove('html');
} else {
jqLite = JQLite;
}
angular.element = jqLite;
}
/**
* throw error of the argument is falsy.
*/
function assertArg(arg, name, reason) {
if (!arg) {
var error = new Error("Argument '" + (name||'?') + "' is " +
(reason || "required"));
throw error;
}
return arg;
}
function assertArgFn(arg, name, acceptArrayAnnotation) {
if (acceptArrayAnnotation && isArray(arg)) {
arg = arg[arg.length - 1];
}
assertArg(isFunction(arg), name, 'not a function, got ' +
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
return arg;
}
/**
* @ngdoc interface
* @name angular.Module
* @description
*
* Interface for configuring angular {@link angular.module modules}.
*/
function setupModuleLoader(window) {
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
}
return ensure(ensure(window, 'angular', Object), 'module', function() {
/** @type {Object.<string, angular.Module>} */
var modules = {};
/**
* @ngdoc function
* @name angular.module
* @description
*
* The `angular.module` is a global place for creating and registering Angular modules. All
* modules (angular core or 3rd party) that should be available to an application must be
* registered using this mechanism.
*
*
* # Module
*
* A module is a collocation of services, directives, filters, and configure information. Module
* is used to configure the {@link angular.module.AUTO.$injector $injector}.
*
* <pre>
* // Create a new module
* var myModule = angular.module('myModule', []);
*
* // register a new service
* myModule.value('appName', 'MyCoolApp');
*
* // configure existing services inside initialization blocks.
* myModule.config(function($locationProvider) {
* // Configure existing providers
* $locationProvider.hashPrefix('!');
* });
* </pre>
*
* Then you can create an injector and load your modules like this:
*
* <pre>
* var injector = angular.injector(['ng', 'MyModule'])
* </pre>
*
* However it's more likely that you'll just use
* {@link angular.module.ng.$compileProvider.directive.ng-app ng-app} or
* {@link angular.bootstrap} to simplify this process for you.
*
* @param {!string} name The name of the module to create or retrieve.
* @param {Array.<string>=} requires If specified then new module is being created. If unspecified then the
* the module is being retrieved for further configuration.
* @param {Function} configFn Option configuration function for the module. Same as
* {@link angular.Module#config Module#config()}.
* @returns {module} new module with the {@link angular.Module} api.
*/
return function module(name, requires, configFn) {
if (requires && modules.hasOwnProperty(name)) {
modules[name] = null;
}
return ensure(modules, name, function() {
if (!requires) {
throw Error('No module: ' + name);
}
/** @type {!Array.<Array.<*>>} */
var invokeQueue = [];
/** @type {!Array.<Function>} */
var runBlocks = [];
var config = invokeLater('$injector', 'invoke');
/** @type {angular.Module} */
var moduleInstance = {
// Private state
_invokeQueue: invokeQueue,
_runBlocks: runBlocks,
/**
* @ngdoc property
* @name angular.Module#requires
* @propertyOf angular.Module
* @returns {Array.<string>} List of module names which must be loaded before this module.
* @description
* Holds the list of modules which the injector will load before the current module is loaded.
*/
requires: requires,
/**
* @ngdoc property
* @name angular.Module#name
* @propertyOf angular.Module
* @returns {string} Name of the module.
* @description
*/
name: name,
/**
* @ngdoc method
* @name angular.Module#provider
* @methodOf angular.Module
* @param {string} name service name
* @param {Function} providerType Construction function for creating new instance of the service.
* @description
* See {@link angular.module.AUTO.$provide#provider $provide.provider()}.
*/
provider: invokeLater('$provide', 'provider'),
/**
* @ngdoc method
* @name angular.Module#factory
* @methodOf angular.Module
* @param {string} name service name
* @param {Function} providerFunction Function for creating new instance of the service.
* @description
* See {@link angular.module.AUTO.$provide#factory $provide.factory()}.
*/
factory: invokeLater('$provide', 'factory'),
/**
* @ngdoc method
* @name angular.Module#service
* @methodOf angular.Module
* @param {string} name service name
* @param {Function} constructor A constructor function that will be instantiated.
* @description
* See {@link angular.module.AUTO.$provide#service $provide.service()}.
*/
service: invokeLater('$provide', 'service'),
/**
* @ngdoc method
* @name angular.Module#value
* @methodOf angular.Module
* @param {string} name service name
* @param {*} object Service instance object.
* @description
* See {@link angular.module.AUTO.$provide#value $provide.value()}.
*/
value: invokeLater('$provide', 'value'),
/**
* @ngdoc method
* @name angular.Module#constant
* @methodOf angular.Module
* @param {string} name constant name
* @param {*} object Constant value.
* @description
* Because the constant are fixed, they get applied before other provide methods.
* See {@link angular.module.AUTO.$provide#constant $provide.constant()}.
*/
constant: invokeLater('$provide', 'constant', 'unshift'),
/**
* @ngdoc method
* @name angular.Module#filter
* @methodOf angular.Module
* @param {string} name Filter name.
* @param {Function} filterFactory Factory function for creating new instance of filter.
* @description
* See {@link angular.module.ng.$filterProvider#register $filterProvider.register()}.
*/
filter: invokeLater('$filterProvider', 'register'),
/**
* @ngdoc method
* @name angular.Module#controller
* @methodOf angular.Module
* @param {string} name Controller name.
* @param {Function} constructor Controller constructor function.
* @description
* See {@link angular.module.ng.$controllerProvider#register $controllerProvider.register()}.
*/
controller: invokeLater('$controllerProvider', 'register'),
/**
* @ngdoc method
* @name angular.Module#directive
* @methodOf angular.Module
* @param {string} name directive name
* @param {Function} directiveFactory Factory function for creating new instance of
* directives.
* @description
* See {@link angular.module.ng.$compileProvider.directive $compileProvider.directive()}.
*/
directive: invokeLater('$compileProvider', 'directive'),
/**
* @ngdoc method
* @name angular.Module#config
* @methodOf angular.Module
* @param {Function} configFn Execute this function on module load. Useful for service
* configuration.
* @description
* Use this method to register work which needs to be performed on module loading.
*/
config: config,
/**
* @ngdoc method
* @name angular.Module#run
* @methodOf angular.Module
* @param {Function} initializationFn Execute this function after injector creation.
* Useful for application initialization.
* @description
* Use this method to register work which needs to be performed when the injector with
* with the current module is finished loading.
*/
run: function(block) {
runBlocks.push(block);
return this;
}
};
if (configFn) {
config(configFn);
}
return moduleInstance;
/**
* @param {string} provider
* @param {string} method
* @param {String=} insertMethod
* @returns {angular.Module}
*/
function invokeLater(provider, method, insertMethod) {
return function() {
invokeQueue[insertMethod || 'push']([provider, method, arguments]);
return moduleInstance;
}
}
});
};
});
}
/**
* @ngdoc property
* @name angular.version
* @description
* An object that contains information about the current AngularJS version. This object has the
* following properties:
*
* - `full` – `{string}` – Full version string, such as "0.9.18".
* - `major` – `{number}` – Major version number, such as "0".
* - `minor` – `{number}` – Minor version number, such as "9".
* - `dot` – `{number}` – Dot version number, such as "18".
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
*/
var version = {
full: '1.0.0rc4', // all of these placeholder strings will be replaced by rake's
major: 1, // compile task
minor: 0,
dot: 0,
codeName: 'insomnia-induction'
};
function publishExternalAPI(angular){
extend(angular, {
'bootstrap': bootstrap,
'copy': copy,
'extend': extend,
'equals': equals,
'element': jqLite,
'forEach': forEach,
'injector': createInjector,
'noop':noop,
'bind':bind,
'toJson': toJson,
'fromJson': fromJson,
'identity':identity,
'isUndefined': isUndefined,
'isDefined': isDefined,
'isString': isString,
'isFunction': isFunction,
'isObject': isObject,
'isNumber': isNumber,
'isElement': isElement,
'isArray': isArray,
'version': version,
'isDate': isDate,
'lowercase': lowercase,
'uppercase': uppercase,
'callbacks': {counter: 0}
});
angularModule = setupModuleLoader(window);
try {
angularModule('ngLocale');
} catch (e) {
angularModule('ngLocale', []).provider('$locale', $LocaleProvider);
}
angularModule('ng', ['ngLocale'], ['$provide',
function ngModule($provide) {
$provide.provider('$compile', $CompileProvider).
directive({
a: htmlAnchorDirective,
input: inputDirective,
textarea: inputDirective,
form: formDirective,
script: scriptDirective,
select: selectDirective,
style: styleDirective,
option: optionDirective,
ngBind: ngBindDirective,
ngBindHtml: ngBindHtmlDirective,
ngBindHtmlUnsafe: ngBindHtmlUnsafeDirective,
ngBindTemplate: ngBindTemplateDirective,
ngClass: ngClassDirective,
ngClassEven: ngClassEvenDirective,
ngClassOdd: ngClassOddDirective,
ngCloak: ngCloakDirective,
ngController: ngControllerDirective,
ngForm: ngFormDirective,
ngHide: ngHideDirective,
ngInclude: ngIncludeDirective,
ngInit: ngInitDirective,
ngNonBindable: ngNonBindableDirective,
ngPluralize: ngPluralizeDirective,
ngRepeat: ngRepeatDirective,
ngShow: ngShowDirective,
ngSubmit: ngSubmitDirective,
ngStyle: ngStyleDirective,
ngSwitch: ngSwitchDirective,
ngSwitchWhen: ngSwitchWhenDirective,
ngSwitchDefault: ngSwitchDefaultDirective,
ngOptions: ngOptionsDirective,
ngView: ngViewDirective,
ngTransclude: ngTranscludeDirective,
ngModel: ngModelDirective,
ngList: ngListDirective,
ngChange: ngChangeDirective,
required: requiredDirective,
ngRequired: requiredDirective,
ngValue: ngValueDirective
}).
directive(ngAttributeAliasDirectives).
directive(ngEventDirectives);
$provide.provider({
$anchorScroll: $AnchorScrollProvider,
$browser: $BrowserProvider,
$cacheFactory: $CacheFactoryProvider,
$controller: $ControllerProvider,
$defer: $DeferProvider,
$document: $DocumentProvider,
$exceptionHandler: $ExceptionHandlerProvider,
$filter: $FilterProvider,
$interpolate: $InterpolateProvider,
$http: $HttpProvider,
$httpBackend: $HttpBackendProvider,
$location: $LocationProvider,
$log: $LogProvider,
$parse: $ParseProvider,
$route: $RouteProvider,
$routeParams: $RouteParamsProvider,
$rootScope: $RootScopeProvider,
$q: $QProvider,
$sanitize: $SanitizeProvider,
$sniffer: $SnifferProvider,
$templateCache: $TemplateCacheProvider,
$window: $WindowProvider
});
}
]);
};
//////////////////////////////////
//JQLite
//////////////////////////////////
/**
* @ngdoc function
* @name angular.element
* @function
*
* @description
* Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.
* `angular.element` can be either an alias for [jQuery](http://api.jquery.com/jQuery/) function, if
* jQuery is available, or a function that wraps the element or string in Angular's jQuery lite
* implementation (commonly referred to as jqLite).
*
* Real jQuery always takes precedence over jqLite, provided it was loaded before `DOMContentLoaded`
* event fired.
*
* jqLite is a tiny, API-compatible subset of jQuery that allows
* Angular to manipulate the DOM. jqLite implements only the most commonly needed functionality
* within a very small footprint, so only a subset of the jQuery API - methods, arguments and
* invocation styles - are supported.
*
* Note: All element references in Angular are always wrapped with jQuery or jqLite; they are never
* raw DOM references.
*
* ## Angular's jQuery lite provides the following methods:
*
* - [addClass()](http://api.jquery.com/addClass/)
* - [after()](http://api.jquery.com/after/)
* - [append()](http://api.jquery.com/append/)
* - [attr()](http://api.jquery.com/attr/)
* - [bind()](http://api.jquery.com/bind/)
* - [children()](http://api.jquery.com/children/)
* - [clone()](http://api.jquery.com/clone/)
* - [contents()](http://api.jquery.com/contents/)
* - [css()](http://api.jquery.com/css/)
* - [data()](http://api.jquery.com/data/)
* - [eq()](http://api.jquery.com/eq/)
* - [find()](http://api.jquery.com/find/) - Limited to lookups by tag name.
* - [hasClass()](http://api.jquery.com/hasClass/)
* - [html()](http://api.jquery.com/html/)
* - [next()](http://api.jquery.com/next/)
* - [parent()](http://api.jquery.com/parent/)
* - [prepend()](http://api.jquery.com/prepend/)
* - [prop()](http://api.jquery.com/prop/)
* - [ready()](http://api.jquery.com/ready/)
* - [remove()](http://api.jquery.com/remove/)
* - [removeAttr()](http://api.jquery.com/removeAttr/)
* - [removeClass()](http://api.jquery.com/removeClass/)
* - [removeData()](http://api.jquery.com/removeData/)
* - [replaceWith()](http://api.jquery.com/replaceWith/)
* - [text()](http://api.jquery.com/text/)
* - [toggleClass()](http://api.jquery.com/toggleClass/)
* - [unbind()](http://api.jquery.com/unbind/)
* - [val()](http://api.jquery.com/val/)
* - [wrap()](http://api.jquery.com/wrap/)
*
* ## In addtion to the above, Angular privides an additional method to both jQuery and jQuery lite:
*
* - `controller(name)` - retrieves the controller of the current element or its parent. By default
* retrieves controller associated with the `ng-controller` directive. If `name` is provided as
* camelCase directive name, then the controller for this directive will be retrieved (e.g.
* `'ngModel'`).
* - `injector()` - retrieves the injector of the current element or its parent.
* - `scope()` - retrieves the {@link api/angular.module.ng.$rootScope.Scope scope} of the current
* element or its parent.
* - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
* parent element is reached.
*
* @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.
* @returns {Object} jQuery object.
*/
var jqCache = {},
jqName = 'ng-' + new Date().getTime(),
jqId = 1,
addEventListenerFn = (window.document.addEventListener
? function(element, type, fn) {element.addEventListener(type, fn, false);}
: function(element, type, fn) {element.attachEvent('on' + type, fn);}),
removeEventListenerFn = (window.document.removeEventListener
? function(element, type, fn) {element.removeEventListener(type, fn, false); }
: function(element, type, fn) {element.detachEvent('on' + type, fn); });
function jqNextId() { return (jqId++); }
function getStyle(element) {
var current = {}, style = element[0].style, value, name, i;
if (typeof style.length == 'number') {
for(i = 0; i < style.length; i++) {
name = style[i];
current[name] = style[name];
}
} else {
for (name in style) {
value = style[name];
if (1*name != name && name != 'cssText' && value && typeof value == 'string' && value !='false')
current[name] = value;
}
}
return current;
}
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
/**
* Converts snake_case to camelCase.
* Also there is special case for Moz prefix starting with upper case letter.
* @param name Name to normalize
*/
function camelCase(name) {
return name.
replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
return offset ? letter.toUpperCase() : letter;
}).
replace(MOZ_HACK_REGEXP, 'Moz$1');
}
/////////////////////////////////////////////
// jQuery mutation patch
//
// In conjunction with bindJQuery intercepts all jQuery's DOM destruction apis and fires a
// $destroy event on all DOM nodes being removed.
//
/////////////////////////////////////////////
function JQLitePatchJQueryRemove(name, dispatchThis) {
var originalJqFn = jQuery.fn[name];
originalJqFn = originalJqFn.$original || originalJqFn;
removePatch.$original = originalJqFn;
jQuery.fn[name] = removePatch;
function removePatch() {
var list = [this],
fireEvent = dispatchThis,
set, setIndex, setLength,
element, childIndex, childLength, children,
fns, data;
while(list.length) {
set = list.shift();
for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {
element = jqLite(set[setIndex]);
if (fireEvent) {
data = element.data('events');
if ( (fns = data && data.$destroy) ) {
forEach(fns, function(fn){
fn.handler();
});
}
} else {
fireEvent = !fireEvent;
}
for(childIndex = 0, childLength = (children = element.children()).length;
childIndex < childLength;
childIndex++) {
list.push(jQuery(children[childIndex]));
}
}
}
return originalJqFn.apply(this, arguments);
}
}
/////////////////////////////////////////////
function JQLite(element) {
if (element instanceof JQLite) {
return element;
}
if (!(this instanceof JQLite)) {
if (isString(element) && element.charAt(0) != '<') {
throw Error('selectors not implemented');
}
return new JQLite(element);
}
if (isString(element)) {
var div = document.createElement('div');
// Read about the NoScope elements here:
// http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx
div.innerHTML = '<div> </div>' + element; // IE insanity to make NoScope elements work!
div.removeChild(div.firstChild); // remove the superfluous div
JQLiteAddNodes(this, div.childNodes);
this.remove(); // detach the elements from the temporary DOM div.
} else {
JQLiteAddNodes(this, element);
}
}
function JQLiteClone(element) {
return element.cloneNode(true);
}
function JQLiteDealoc(element){
JQLiteRemoveData(element);
for ( var i = 0, children = element.childNodes || []; i < children.length; i++) {
JQLiteDealoc(children[i]);
}
}
function JQLiteRemoveData(element) {
var cacheId = element[jqName],
cache = jqCache[cacheId];
if (cache) {
if (cache.bind) {
forEach(cache.bind, function(fn, type){
if (type == '$destroy') {
fn({});
} else {
removeEventListenerFn(element, type, fn);
}
});
}
delete jqCache[cacheId];
element[jqName] = undefined; // ie does not allow deletion of attributes on elements.
}
}
function JQLiteData(element, key, value) {
var cacheId = element[jqName],
cache = jqCache[cacheId || -1];
if (isDefined(value)) {
if (!cache) {
element[jqName] = cacheId = jqNextId();
cache = jqCache[cacheId] = {};
}
cache[key] = value;
} else {
return cache ? cache[key] : null;
}
}
function JQLiteHasClass(element, selector) {
return ((" " + element.className + " ").replace(/[\n\t]/g, " ").
indexOf( " " + selector + " " ) > -1);
}
function JQLiteRemoveClass(element, selector) {
if (selector) {
forEach(selector.split(' '), function(cssClass) {
element.className = trim(
(" " + element.className + " ")
.replace(/[\n\t]/g, " ")
.replace(" " + trim(cssClass) + " ", " ")
);
});
}
}
function JQLiteAddClass(element, selector) {
if (selector) {
forEach(selector.split(' '), function(cssClass) {
if (!JQLiteHasClass(element, cssClass)) {
element.className = trim(element.className + ' ' + trim(cssClass));
}
});
}
}
function JQLiteAddNodes(root, elements) {
if (elements) {
elements = (!elements.nodeName && isDefined(elements.length) && !isWindow(elements))
? elements
: [ elements ];
for(var i=0; i < elements.length; i++) {
root.push(elements[i]);
}
}
}
function JQLiteController(element, name) {
return JQLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller');
}
function JQLiteInheritedData(element, name, value) {
element = jqLite(element);
// if element is the document object work with the html element instead
// this makes $(document).scope() possible
if(element[0].nodeType == 9) {
element = element.find('html');
}
while (element.length) {
if (value = element.data(name)) return value;
element = element.parent();
}
}
//////////////////////////////////////////
// Functions which are declared directly.
//////////////////////////////////////////
var JQLitePrototype = JQLite.prototype = {
ready: function(fn) {
var fired = false;
function trigger() {
if (fired) return;
fired = true;
fn();
}
this.bind('DOMContentLoaded', trigger); // works for modern browsers and IE9
// we can not use jqLite since we are not done loading and jQuery could be loaded later.
JQLite(window).bind('load', trigger); // fallback to window.onload for others
},
toString: function() {
var value = [];
forEach(this, function(e){ value.push('' + e);});
return '[' + value.join(', ') + ']';
},
eq: function(index) {
return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);
},
length: 0,
push: push,
sort: [].sort,
splice: [].splice
};
//////////////////////////////////////////
// Functions iterating getter/setters.
// these functions return self on setter and
// value on get.
//////////////////////////////////////////
var BOOLEAN_ATTR = {};
forEach('multiple,selected,checked,disabled,readOnly,required'.split(','), function(value) {
BOOLEAN_ATTR[lowercase(value)] = value;
});
var BOOLEAN_ELEMENTS = {};
forEach('input,select,option,textarea,button,form'.split(','), function(value) {
BOOLEAN_ELEMENTS[uppercase(value)] = true;
});
function isBooleanAttr(element, name) {
return BOOLEAN_ELEMENTS[element.nodeName] && BOOLEAN_ATTR[name.toLowerCase()];
}
forEach({
data: JQLiteData,
inheritedData: JQLiteInheritedData,
scope: function(element) {
return JQLiteInheritedData(element, '$scope');
},
controller: JQLiteController ,
injector: function(element) {
return JQLiteInheritedData(element, '$injector');
},
removeAttr: function(element,name) {
element.removeAttribute(name);
},
hasClass: JQLiteHasClass,
css: function(element, name, value) {
name = camelCase(name);
if (isDefined(value)) {
element.style[name] = value;
} else {
var val;
if (msie <= 8) {
// this is some IE specific weirdness that jQuery 1.6.4 does not sure why
val = element.currentStyle && element.currentStyle[name];
if (val === '') val = 'auto';
}
val = val || element.style[name];
if (msie <= 8) {
// jquery weirdness :-/
val = (val === '') ? undefined : val;
}
return val;
}
},
attr: function(element, name, value){
var lowercasedName = lowercase(name);
if (BOOLEAN_ATTR[lowercasedName]) {
if (isDefined(value)) {
if (!!value) {
element[name] = true;
element.setAttribute(name, lowercasedName);
} else {
element[name] = false;
element.removeAttribute(lowercasedName);
}
} else {
return (element[name] ||
(element.attributes.getNamedItem(name)|| noop).specified)
? lowercasedName
: undefined;
}
} else if (isDefined(value)) {
element.setAttribute(name, value);
} else if (element.getAttribute) {
// the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
// some elements (e.g. Document) don't have get attribute, so return undefined
var ret = element.getAttribute(name, 2);
// normalize non-existing attributes to undefined (as jQuery)
return ret === null ? undefined : ret;
}
},
prop: function(element, name, value) {
if (isDefined(value)) {
element[name] = value;
} else {
return element[name];
}
},
text: extend((msie < 9)
? function(element, value) {
if (element.nodeType == 1 /** Element */) {
if (isUndefined(value))
return element.innerText;
element.innerText = value;
} else {
if (isUndefined(value))
return element.nodeValue;
element.nodeValue = value;
}
}
: function(element, value) {
if (isUndefined(value)) {
return element.textContent;
}
element.textContent = value;
}, {$dv:''}),
val: function(element, value) {
if (isUndefined(value)) {
return element.value;
}
element.value = value;
},
html: function(element, value) {
if (isUndefined(value)) {
return element.innerHTML;
}
for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) {
JQLiteDealoc(childNodes[i]);
}
element.innerHTML = value;
}
}, function(fn, name){
/**
* Properties: writes return selection, reads return first value
*/
JQLite.prototype[name] = function(arg1, arg2) {
var i, key;
// JQLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
// in a way that survives minification.
if (((fn.length == 2 && (fn !== JQLiteHasClass && fn !== JQLiteController)) ? arg1 : arg2) === undefined) {
if (isObject(arg1)) {
// we are a write, but the object properties are the key/values
for(i=0; i < this.length; i++) {
for (key in arg1) {
fn(this[i], key, arg1[key]);
}
}
// return self for chaining
return this;
} else {
// we are a read, so read the first child.
if (this.length)
return fn(this[0], arg1, arg2);
}
} else {
// we are a write, so apply to all children
for(i=0; i < this.length; i++) {
fn(this[i], arg1, arg2);
}
// return self for chaining
return this;
}
return fn.$dv;
};
});
function createEventHandler(element) {
var eventHandler = function (event) {
if (!event.preventDefault) {
event.preventDefault = function() {
event.returnValue = false; //ie
};
}
if (!event.stopPropagation) {
event.stopPropagation = function() {
event.cancelBubble = true; //ie
};
}
if (!event.target) {
event.target = event.srcElement || document;
}
if (isUndefined(event.defaultPrevented)) {
var prevent = event.preventDefault;
event.preventDefault = function() {
event.defaultPrevented = true;
prevent.call(event);
};
event.defaultPrevented = false;
}
event.isDefaultPrevented = function() {
return event.defaultPrevented;
};
forEach(eventHandler.fns, function(fn){
fn.call(element, event);
});
// Remove monkey-patched methods (IE),
// as they would cause memory leaks in IE8.
if (msie < 8) {
// IE7 does not allow to delete property on native object
event.preventDefault = null;
event.stopPropagation = null;
event.isDefaultPrevented = null;
} else {
// It shouldn't affect normal browsers (native methods are defined on prototype).
delete event.preventDefault;
delete event.stopPropagation;
delete event.isDefaultPrevented;
}
};
eventHandler.fns = [];
return eventHandler;
};
//////////////////////////////////////////
// Functions iterating traversal.
// These functions chain results into a single
// selector.
//////////////////////////////////////////
forEach({
removeData: JQLiteRemoveData,
dealoc: JQLiteDealoc,
bind: function bindFn(element, type, fn){
var bind = JQLiteData(element, 'bind');
if (!bind) JQLiteData(element, 'bind', bind = {});
forEach(type.split(' '), function(type){
var eventHandler = bind[type];
if (!eventHandler) {
if (type == 'mouseenter' || type == 'mouseleave') {
var mouseenter = bind.mouseenter = createEventHandler(element);
var mouseleave = bind.mouseleave = createEventHandler(element);
var counter = 0;
bindFn(element, 'mouseover', function(event) {
counter++;
if (counter == 1) {
event.type = 'mouseenter';
mouseenter(event);
}
});
bindFn(element, 'mouseout', function(event) {
counter --;
if (counter == 0) {
event.type = 'mouseleave';
mouseleave(event);
}
});
eventHandler = bind[type];
} else {
eventHandler = bind[type] = createEventHandler(element);
addEventListenerFn(element, type, eventHandler);
}
}
eventHandler.fns.push(fn);
});
},
unbind: function(element, type, fn) {
var bind = JQLiteData(element, 'bind');
if (!bind) return; //no listeners registered
if (isUndefined(type)) {
forEach(bind, function(eventHandler, type) {
removeEventListenerFn(element, type, eventHandler);
delete bind[type];
});
} else {
if (isUndefined(fn)) {
removeEventListenerFn(element, type, bind[type]);
delete bind[type];
} else {
arrayRemove(bind[type].fns, fn);
}
}
},
replaceWith: function(element, replaceNode) {
var index, parent = element.parentNode;
JQLiteDealoc(element);
forEach(new JQLite(replaceNode), function(node){
if (index) {
parent.insertBefore(node, index.nextSibling);
} else {
parent.replaceChild(node, element);
}
index = node;
});
},
children: function(element) {
var children = [];
forEach(element.childNodes, function(element){
if (element.nodeName != '#text')
children.push(element);
});
return children;
},
contents: function(element) {
return element.childNodes;
},
append: function(element, node) {
forEach(new JQLite(node), function(child){
if (element.nodeType === 1)
element.appendChild(child);
});
},
prepend: function(element, node) {
if (element.nodeType === 1) {
var index = element.firstChild;
forEach(new JQLite(node), function(child){
if (index) {
element.insertBefore(child, index);
} else {
element.appendChild(child);
index = child;
}
});
}
},
wrap: function(element, wrapNode) {
wrapNode = jqLite(wrapNode)[0];
var parent = element.parentNode;
if (parent) {
parent.replaceChild(wrapNode, element);
}
wrapNode.appendChild(element);
},
remove: function(element) {
JQLiteDealoc(element);
var parent = element.parentNode;
if (parent) parent.removeChild(element);
},
after: function(element, newElement) {
var index = element, parent = element.parentNode;
forEach(new JQLite(newElement), function(node){
parent.insertBefore(node, index.nextSibling);
index = node;
});
},
addClass: JQLiteAddClass,
removeClass: JQLiteRemoveClass,
toggleClass: function(element, selector, condition) {
if (isUndefined(condition)) {
condition = !JQLiteHasClass(element, selector);
}
(condition ? JQLiteAddClass : JQLiteRemoveClass)(element, selector);
},
parent: function(element) {
var parent = element.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
next: function(element) {
return element.nextSibling;
},
find: function(element, selector) {
return element.getElementsByTagName(selector);
},
clone: JQLiteClone
}, function(fn, name){
/**
* chaining functions
*/
JQLite.prototype[name] = function(arg1, arg2) {
var value;
for(var i=0; i < this.length; i++) {
if (value == undefined) {
value = fn(this[i], arg1, arg2);
if (value !== undefined) {
// any function which returns a value needs to be wrapped
value = jqLite(value);
}
} else {
JQLiteAddNodes(value, fn(this[i], arg1, arg2));
}
}
return value == undefined ? this : value;
};
});
/**
* Computes a hash of an 'obj'.
* Hash of a:
* string is string
* number is number as string
* object is either result of calling $$hashKey function on the object or uniquely generated id,
* that is also assigned to the $$hashKey property of the object.
*
* @param obj
* @returns {string} hash string such that the same input will have the same hash string.
* The resulting string key is in 'type:hashKey' format.
*/
function hashKey(obj) {
var objType = typeof obj,
key;
if (objType == 'object' && obj !== null) {
if (typeof (key = obj.$$hashKey) == 'function') {
// must invoke on object to keep the right this
key = obj.$$hashKey();
} else if (key === undefined) {
key = obj.$$hashKey = nextUid();
}
} else {
key = obj;
}
return objType + ':' + key;
}
/**
* HashMap which can use objects as keys
*/
function HashMap(array){
forEach(array, this.put, this);
}
HashMap.prototype = {
/**
* Store key value pair
* @param key key to store can be any type
* @param value value to store can be any type
*/
put: function(key, value) {
this[hashKey(key)] = value;
},
/**
* @param key
* @returns the value for the key
*/
get: function(key) {
return this[hashKey(key)];
},
/**
* Remove the key/value pair
* @param key
*/
remove: function(key) {
var value = this[key = hashKey(key)];
delete this[key];
return value;
}
};
/**
* A map where multiple values can be added to the same key such that they form a queue.
* @returns {HashQueueMap}
*/
function HashQueueMap() {}
HashQueueMap.prototype = {
/**
* Same as array push, but using an array as the value for the hash
*/
push: function(key, value) {
var array = this[key = hashKey(key)];
if (!array) {
this[key] = [value];
} else {
array.push(value);
}
},
/**
* Same as array shift, but using an array as the value for the hash
*/
shift: function(key) {
var array = this[key = hashKey(key)];
if (array) {
if (array.length == 1) {
delete this[key];
return array[0];
} else {
return array.shift();
}
}
}
};
/**
* @ngdoc function
* @name angular.injector
* @function
*
* @description
* Creates an injector function that can be used for retrieving services as well as for
* dependency injection (see {@link guide/dev_guide.di dependency injection}).
*
* @param {Array.<string|Function>} modules A list of module functions or their aliases. See
* {@link angular.module}. The `ng` module must be explicitly added.
* @returns {function()} Injector function. See {@link angular.module.AUTO.$injector $injector}.
*
* @example
* Typical usage
* <pre>
* // create an injector
* var $injector = angular.injector(['ng']);
*
* // use the injector to kick of your application
* // use the type inference to auto inject arguments, or use implicit injection
* $injector.invoke(function($rootScope, $compile, $document){
* $compile($document)($rootScope);
* $rootScope.$digest();
* });
* </pre>
*/
/**
* @ngdoc overview
* @name angular.module.AUTO
* @description
*
* Implicit module which gets automatically added to each {@link angular.module.AUTO.$injector $injector}.
*/
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(.+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
function inferInjectionArgs(fn) {
assertArgFn(fn);
if (!fn.$inject) {
var args = fn.$inject = [];
var fnText = fn.toString().replace(STRIP_COMMENTS, '');
var argDecl = fnText.match(FN_ARGS);
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
arg.replace(FN_ARG, function(all, underscore, name){
args.push(name);
});
});
}
return fn.$inject;
}
///////////////////////////////////////
/**
* @ngdoc object
* @name angular.module.AUTO.$injector
* @function
*
* @description
*
* `$injector` is used to retrieve object instances as defined by
* {@link angular.module.AUTO.$provide provider}, instantiate types, invoke methods,
* and load modules.
*
* The following always holds true:
*
* <pre>
* var $injector = angular.injector();
* expect($injector.get('$injector')).toBe($injector);
* expect($injector.invoke(function($injector){
* return $injector;
* }).toBe($injector);
* </pre>
*
* # Injection Function Annotation
*
* JavaScript does not have annotations, and annotations are needed for dependency injection. The
* following ways are all valid way of annotating function with injection arguments and are equivalent.
*
* <pre>
* // inferred (only works if code not minified/obfuscated)
* $inject.invoke(function(serviceA){});
*
* // annotated
* function explicit(serviceA) {};
* explicit.$inject = ['serviceA'];
* $inject.invoke(explicit);
*
* // inline
* $inject.invoke(['serviceA', function(serviceA){}]);
* </pre>
*
* ## Inference
*
* In JavaScript calling `toString()` on a function returns the function definition. The definition can then be
* parsed and the function arguments can be extracted. *NOTE:* This does not work with minfication, and obfuscation
* tools since these tools change the argument names.
*
* ## `$inject` Annotation
* By adding a `$inject` property onto a function the injection parameters can be specified.
*
* ## Inline
* As an array of injection names, where the last item in the array is the function to call.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#get
* @methodOf angular.module.AUTO.$injector
*
* @description
* Return an instance of the service.
*
* @param {string} name The name of the instance to retrieve.
* @return {*} The instance.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#invoke
* @methodOf angular.module.AUTO.$injector
*
* @description
* Invoke the method and supply the method arguments from the `$injector`.
*
* @param {!function} fn The function to invoke. The function arguments come form the function annotation.
* @param {Object=} self The `this` for the invoked method.
* @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before
* the `$injector` is consulted.
* @return the value returned by the invoked `fn` function.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#instantiate
* @methodOf angular.module.AUTO.$injector
* @description
* Create a new instance of JS type. The method takes a constructor function invokes the new operator and supplies
* all of the arguments to the constructor function as specified by the constructor annotation.
*
* @param {function} Type Annotated constructor function.
* @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before
* the `$injector` is consulted.
* @return new instance of `Type`.
*/
/**
* @ngdoc object
* @name angular.module.AUTO.$provide
*
* @description
*
* Use `$provide` to register new providers with the `$injector`. The providers are the factories for the instance.
* The providers share the same name as the instance they create with the `Provider` suffixed to them.
*
* A provider is an object with a `$get()` method. The injector calls the `$get` method to create a new instance of
* a service. The Provider can have additional methods which would allow for configuration of the provider.
*
* <pre>
* function GreetProvider() {
* var salutation = 'Hello';
*
* this.salutation = function(text) {
* salutation = text;
* };
*
* this.$get = function() {
* return function (name) {
* return salutation + ' ' + name + '!';
* };
* };
* }
*
* describe('Greeter', function(){
*
* beforeEach(module(function($provide) {
* $provide.provider('greet', GreetProvider);
* });
*
* it('should greet', inject(function(greet) {
* expect(greet('angular')).toEqual('Hello angular!');
* }));
*
* it('should allow configuration of salutation', function() {
* module(function(greetProvider) {
* greetProvider.salutation('Ahoj');
* });
* inject(function(greet) {
* expect(greet('angular')).toEqual('Ahoj angular!');
* });
* )};
*
* });
* </pre>
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#provider
* @methodOf angular.module.AUTO.$provide
* @description
*
* Register a provider for a service. The providers can be retrieved and can have additional configuration methods.
*
* @param {string} name The name of the instance. NOTE: the provider will be available under `name + 'Provider'` key.
* @param {(Object|function())} provider If the provider is:
*
* - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
* {@link angular.module.AUTO.$injector#invoke $injector.invoke()} when an instance needs to be created.
* - `Constructor`: a new instance of the provider will be created using
* {@link angular.module.AUTO.$injector#instantiate $injector.instantiate()}, then treated as `object`.
*
* @returns {Object} registered provider instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#factory
* @methodOf angular.module.AUTO.$provide
* @description
*
* A short hand for configuring services if only `$get` method is required.
*
* @param {string} name The name of the instance.
* @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand for
* `$provide.provider(name, {$get: $getFn})`.
* @returns {Object} registered provider instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#service
* @methodOf angular.module.AUTO.$provide
* @description
*
* A short hand for registering service of given class.
*
* @param {string} name The name of the instance.
* @param {Function} constructor A class (constructor function) that will be instantiated.
* @returns {Object} registered provider instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#value
* @methodOf angular.module.AUTO.$provide
* @description
*
* A short hand for configuring services if the `$get` method is a constant.
*
* @param {string} name The name of the instance.
* @param {*} value The value.
* @returns {Object} registered provider instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#constant
* @methodOf angular.module.AUTO.$provide
* @description
*
* A constant value, but unlike {@link angular.module.AUTO.$provide#value value} it can be injected
* into configuration function (other modules) and it is not interceptable by
* {@link angular.module.AUTO.$provide#decorator decorator}.
*
* @param {string} name The name of the constant.
* @param {*} value The constant value.
* @returns {Object} registered instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#decorator
* @methodOf angular.module.AUTO.$provide
* @description
*
* Decoration of service, allows the decorator to intercept the service instance creation. The
* returned instance may be the original instance, or a new instance which delegates to the
* original instance.
*
* @param {string} name The name of the service to decorate.
* @param {function()} decorator This function will be invoked when the service needs to be
* instanciated. The function is called using the {@link angular.module.AUTO.$injector#invoke
* injector.invoke} method and is therefore fully injectable. Local injection arguments:
*
* * `$delegate` - The original service instance, which can be monkey patched, configured,
* decorated or delegated to.
*/
function createInjector(modulesToLoad) {
var INSTANTIATING = {},
providerSuffix = 'Provider',
path = [],
loadedModules = new HashMap(),
providerCache = {
$provide: {
provider: supportObject(provider),
factory: supportObject(factory),
service: supportObject(service),
value: supportObject(value),
constant: supportObject(constant),
decorator: decorator
}
},
providerInjector = createInternalInjector(providerCache, function() {
throw Error("Unknown provider: " + path.join(' <- '));
}),
instanceCache = {},
instanceInjector = (instanceCache.$injector =
createInternalInjector(instanceCache, function(servicename) {
var provider = providerInjector.get(servicename + providerSuffix);
return instanceInjector.invoke(provider.$get, provider);
}));
forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); });
return instanceInjector;
////////////////////////////////////
// $provider
////////////////////////////////////
function supportObject(delegate) {
return function(key, value) {
if (isObject(key)) {
forEach(key, reverseParams(delegate));
} else {
return delegate(key, value);
}
}
}
function provider(name, provider_) {
if (isFunction(provider_)) {
provider_ = providerInjector.instantiate(provider_);
}
if (!provider_.$get) {
throw Error('Provider ' + name + ' must define $get factory method.');
}
return providerCache[name + providerSuffix] = provider_;
}
function factory(name, factoryFn) { return provider(name, { $get: factoryFn }); }
function service(name, constructor) {
return factory(name, ['$injector', function($injector) {
return $injector.instantiate(constructor);
}]);
}
function value(name, value) { return factory(name, valueFn(value)); }
function constant(name, value) {
providerCache[name] = value;
instanceCache[name] = value;
}
function decorator(serviceName, decorFn) {
var origProvider = providerInjector.get(serviceName + providerSuffix),
orig$get = origProvider.$get;
origProvider.$get = function() {
var origInstance = instanceInjector.invoke(orig$get, origProvider);
return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});
};
}
////////////////////////////////////
// Module Loading
////////////////////////////////////
function loadModules(modulesToLoad){
var runBlocks = [];
forEach(modulesToLoad, function(module) {
if (loadedModules.get(module)) return;
loadedModules.put(module, true);
if (isString(module)) {
var moduleFn = angularModule(module);
runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
try {
for(var invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) {
var invokeArgs = invokeQueue[i],
provider = invokeArgs[0] == '$injector'
? providerInjector
: providerInjector.get(invokeArgs[0]);
provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
}
} catch (e) {
if (e.message) e.message += ' from ' + module;
throw e;
}
} else if (isFunction(module)) {
try {
runBlocks.push(providerInjector.invoke(module));
} catch (e) {
if (e.message) e.message += ' from ' + module;
throw e;
}
} else if (isArray(module)) {
try {
runBlocks.push(providerInjector.invoke(module));
} catch (e) {
if (e.message) e.message += ' from ' + String(module[module.length - 1]);
throw e;
}
} else {
assertArgFn(module, 'module');
}
});
return runBlocks;
}
////////////////////////////////////
// internal Injector
////////////////////////////////////
function createInternalInjector(cache, factory) {
function getService(serviceName) {
if (typeof serviceName !== 'string') {
throw Error('Service name expected');
}
if (cache.hasOwnProperty(serviceName)) {
if (cache[serviceName] === INSTANTIATING) {
throw Error('Circular dependency: ' + path.join(' <- '));
}
return cache[serviceName];
} else {
try {
path.unshift(serviceName);
cache[serviceName] = INSTANTIATING;
return cache[serviceName] = factory(serviceName);
} finally {
path.shift();
}
}
}
function invoke(fn, self, locals){
var args = [],
$inject,
length,
key;
if (typeof fn == 'function') {
$inject = inferInjectionArgs(fn);
length = $inject.length;
} else {
if (isArray(fn)) {
$inject = fn;
length = $inject.length - 1;
fn = $inject[length];
}
assertArgFn(fn, 'fn');
}
for(var i = 0; i < length; i++) {
key = $inject[i];
args.push(
locals && locals.hasOwnProperty(key)
? locals[key]
: getService(key, path)
);
}
// Performance optimization: http://jsperf.com/apply-vs-call-vs-invoke
switch (self ? -1 : args.length) {
case 0: return fn();
case 1: return fn(args[0]);
case 2: return fn(args[0], args[1]);
case 3: return fn(args[0], args[1], args[2]);
case 4: return fn(args[0], args[1], args[2], args[3]);
case 5: return fn(args[0], args[1], args[2], args[3], args[4]);
case 6: return fn(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
case 8: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
case 9: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
case 10: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
default: return fn.apply(self, args);
}
}
function instantiate(Type, locals) {
var Constructor = function() {},
instance, returnedValue;
Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype;
instance = new Constructor();
returnedValue = invoke(Type, instance, locals);
return isObject(returnedValue) ? returnedValue : instance;
}
return {
invoke: invoke,
instantiate: instantiate,
get: getService
};
}
}
/**
* @ngdoc function
* @name angular.module.ng.$anchorScroll
* @requires $window
* @requires $location
* @requires $rootScope
*
* @description
* When called, it checks current value of `$location.hash()` and scroll to related element,
* according to rules specified in
* {@link http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document Html5 spec}.
*
* It also watches the `$location.hash()` and scroll whenever it changes to match any anchor.
* This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.
*/
function $AnchorScrollProvider() {
var autoScrollingEnabled = true;
this.disableAutoScrolling = function() {
autoScrollingEnabled = false;
};
this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {
var document = $window.document;
// helper function to get first anchor from a NodeList
// can't use filter.filter, as it accepts only instances of Array
// and IE can't convert NodeList to an array using [].slice
// TODO(vojta): use filter if we change it to accept lists as well
function getFirstAnchor(list) {
var result = null;
forEach(list, function(element) {
if (!result && lowercase(element.nodeName) === 'a') result = element;
});
return result;
}
function scroll() {
var hash = $location.hash(), elm;
// empty hash, scroll to the top of the page
if (!hash) $window.scrollTo(0, 0);
// element with given id
else if ((elm = document.getElementById(hash))) elm.scrollIntoView();
// first anchor with given name :-D
else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) elm.scrollIntoView();
// no element and hash == 'top', scroll to the top of the page
else if (hash === 'top') $window.scrollTo(0, 0);
}
// does not scroll when user clicks on anchor link that is currently on
// (no url change, no $locaiton.hash() change), browser native does scroll
if (autoScrollingEnabled) {
$rootScope.$watch(function() {return $location.hash();}, function() {
$rootScope.$evalAsync(scroll);
});
}
return scroll;
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$browser
* @requires $log
* @description
* This object has two goals:
*
* - hide all the global state in the browser caused by the window object
* - abstract away all the browser specific features and inconsistencies
*
* For tests we provide {@link angular.module.ngMock.$browser mock implementation} of the `$browser`
* service, which can be used for convenient testing of the application without the interaction with
* the real browser apis.
*/
/**
* @param {object} window The global window object.
* @param {object} document jQuery wrapped document.
* @param {object} body jQuery wrapped document.body.
* @param {function()} XHR XMLHttpRequest constructor.
* @param {object} $log console.log or an object with the same interface.
* @param {object} $sniffer $sniffer service
*/
function Browser(window, document, body, $log, $sniffer) {
var self = this,
rawDocument = document[0],
location = window.location,
history = window.history,
setTimeout = window.setTimeout,
clearTimeout = window.clearTimeout,
pendingDeferIds = {};
self.isMock = false;
var outstandingRequestCount = 0;
var outstandingRequestCallbacks = [];
// TODO(vojta): remove this temporary api
self.$$completeOutstandingRequest = completeOutstandingRequest;
self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
/**
* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`
* counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
*/
function completeOutstandingRequest(fn) {
try {
fn.apply(null, sliceArgs(arguments, 1));
} finally {
outstandingRequestCount--;
if (outstandingRequestCount === 0) {
while(outstandingRequestCallbacks.length) {
try {
outstandingRequestCallbacks.pop()();
} catch (e) {
$log.error(e);
}
}
}
}
}
/**
* @private
* Note: this method is used only by scenario runner
* TODO(vojta): prefix this method with $$ ?
* @param {function()} callback Function that will be called when no outstanding request
*/
self.notifyWhenNoOutstandingRequests = function(callback) {
// force browser to execute all pollFns - this is needed so that cookies and other pollers fire
// at some deterministic time in respect to the test runner's actions. Leaving things up to the
// regular poller would result in flaky tests.
forEach(pollFns, function(pollFn){ pollFn(); });
if (outstandingRequestCount === 0) {
callback();
} else {
outstandingRequestCallbacks.push(callback);
}
};
//////////////////////////////////////////////////////////////
// Poll Watcher API
//////////////////////////////////////////////////////////////
var pollFns = [],
pollTimeout;
/**
* @ngdoc method
* @name angular.module.ng.$browser#addPollFn
* @methodOf angular.module.ng.$browser
*
* @param {function()} fn Poll function to add
*
* @description
* Adds a function to the list of functions that poller periodically executes,
* and starts polling if not started yet.
*
* @returns {function()} the added function
*/
self.addPollFn = function(fn) {
if (isUndefined(pollTimeout)) startPoller(100, setTimeout);
pollFns.push(fn);
return fn;
};
/**
* @param {number} interval How often should browser call poll functions (ms)
* @param {function()} setTimeout Reference to a real or fake `setTimeout` function.
*
* @description
* Configures the poller to run in the specified intervals, using the specified
* setTimeout fn and kicks it off.
*/
function startPoller(interval, setTimeout) {
(function check() {
forEach(pollFns, function(pollFn){ pollFn(); });
pollTimeout = setTimeout(check, interval);
})();
}
//////////////////////////////////////////////////////////////
// URL API
//////////////////////////////////////////////////////////////
var lastBrowserUrl = location.href;
/**
* @ngdoc method
* @name angular.module.ng.$browser#url
* @methodOf angular.module.ng.$browser
*
* @description
* GETTER:
* Without any argument, this method just returns current value of location.href.
*
* SETTER:
* With at least one argument, this method sets url to new value.
* If html5 history api supported, pushState/replaceState is used, otherwise
* location.href/location.replace is used.
* Returns its own instance to allow chaining
*
* NOTE: this api is intended for use only by the $location service. Please use the
* {@link angular.module.ng.$location $location service} to change url.
*
* @param {string} url New url (when used as setter)
* @param {boolean=} replace Should new url replace current history record ?
*/
self.url = function(url, replace) {
// setter
if (url) {
lastBrowserUrl = url;
if ($sniffer.history) {
if (replace) history.replaceState(null, '', url);
else history.pushState(null, '', url);
} else {
if (replace) location.replace(url);
else location.href = url;
}
return self;
// getter
} else {
return location.href;
}
};
var urlChangeListeners = [],
urlChangeInit = false;
function fireUrlChange() {
if (lastBrowserUrl == self.url()) return;
lastBrowserUrl = self.url();
forEach(urlChangeListeners, function(listener) {
listener(self.url());
});
}
/**
* @ngdoc method
* @name angular.module.ng.$browser#onUrlChange
* @methodOf angular.module.ng.$browser
* @TODO(vojta): refactor to use node's syntax for events
*
* @description
* Register callback function that will be called, when url changes.
*
* It's only called when the url is changed by outside of angular:
* - user types different url into address bar
* - user clicks on history (forward/back) button
* - user clicks on a link
*
* It's not called when url is changed by $browser.url() method
*
* The listener gets called with new url as parameter.
*
* NOTE: this api is intended for use only by the $location service. Please use the
* {@link angular.module.ng.$location $location service} to monitor url changes in angular apps.
*
* @param {function(string)} listener Listener function to be called when url changes.
* @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
*/
self.onUrlChange = function(callback) {
if (!urlChangeInit) {
// We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
// don't fire popstate when user change the address bar and don't fire hashchange when url
// changed by push/replaceState
// html5 history api - popstate event
if ($sniffer.history) jqLite(window).bind('popstate', fireUrlChange);
// hashchange event
if ($sniffer.hashchange) jqLite(window).bind('hashchange', fireUrlChange);
// polling
else self.addPollFn(fireUrlChange);
urlChangeInit = true;
}
urlChangeListeners.push(callback);
return callback;
};
//////////////////////////////////////////////////////////////
// Cookies API
//////////////////////////////////////////////////////////////
var lastCookies = {};
var lastCookieString = '';
/**
* @ngdoc method
* @name angular.module.ng.$browser#cookies
* @methodOf angular.module.ng.$browser
*
* @param {string=} name Cookie name
* @param {string=} value Cokkie value
*
* @description
* The cookies method provides a 'private' low level access to browser cookies.
* It is not meant to be used directly, use the $cookie service instead.
*
* The return values vary depending on the arguments that the method was called with as follows:
* <ul>
* <li>cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify it</li>
* <li>cookies(name, value) -> set name to value, if value is undefined delete the cookie</li>
* <li>cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that way)</li>
* </ul>
*
* @returns {Object} Hash of all cookies (if called without any parameter)
*/
self.cookies = function(name, value) {
var cookieLength, cookieArray, cookie, i, keyValue, index;
if (name) {
if (value === undefined) {
rawDocument.cookie = escape(name) + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
} else {
if (isString(value)) {
rawDocument.cookie = escape(name) + '=' + escape(value);
cookieLength = name.length + value.length + 1;
if (cookieLength > 4096) {
$log.warn("Cookie '"+ name +"' possibly not set or overflowed because it was too large ("+
cookieLength + " > 4096 bytes)!");
}
if (lastCookies.length > 20) {
$log.warn("Cookie '"+ name +"' possibly not set or overflowed because too many cookies " +
"were already set (" + lastCookies.length + " > 20 )");
}
}
}
} else {
if (rawDocument.cookie !== lastCookieString) {
lastCookieString = rawDocument.cookie;
cookieArray = lastCookieString.split("; ");
lastCookies = {};
for (i = 0; i < cookieArray.length; i++) {
cookie = cookieArray[i];
index = cookie.indexOf('=');
if (index > 0) { //ignore nameless cookies
lastCookies[unescape(cookie.substring(0, index))] = unescape(cookie.substring(index + 1));
}
}
}
return lastCookies;
}
};
/**
* @ngdoc method
* @name angular.module.ng.$browser#defer
* @methodOf angular.module.ng.$browser
* @param {function()} fn A function, who's execution should be defered.
* @param {number=} [delay=0] of milliseconds to defer the function execution.
* @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.
*
* @description
* Executes a fn asynchroniously via `setTimeout(fn, delay)`.
*
* Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using
* `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed
* via `$browser.defer.flush()`.
*
*/
self.defer = function(fn, delay) {
var timeoutId;
outstandingRequestCount++;
timeoutId = setTimeout(function() {
delete pendingDeferIds[timeoutId];
completeOutstandingRequest(fn);
}, delay || 0);
pendingDeferIds[timeoutId] = true;
return timeoutId;
};
/**
* THIS DOC IS NOT VISIBLE because ngdocs can't process docs for foo#method.method
*
* @name angular.module.ng.$browser#defer.cancel
* @methodOf angular.module.ng.$browser.defer
*
* @description
* Cancels a defered task identified with `deferId`.
*
* @param {*} deferId Token returned by the `$browser.defer` function.
* @returns {boolean} Returns `true` if the task hasn't executed yet and was successfuly canceled.
*/
self.defer.cancel = function(deferId) {
if (pendingDeferIds[deferId]) {
delete pendingDeferIds[deferId];
clearTimeout(deferId);
completeOutstandingRequest(noop);
return true;
}
return false;
};
//////////////////////////////////////////////////////////////
// Misc API
//////////////////////////////////////////////////////////////
/**
* @ngdoc method
* @name angular.module.ng.$browser#addCss
* @methodOf angular.module.ng.$browser
*
* @param {string} url Url to css file
* @description
* Adds a stylesheet tag to the head.
*/
self.addCss = function(url) {
var link = jqLite(rawDocument.createElement('link'));
link.attr('rel', 'stylesheet');
link.attr('type', 'text/css');
link.attr('href', url);
body.append(link);
};
/**
* @ngdoc method
* @name angular.module.ng.$browser#addJs
* @methodOf angular.module.ng.$browser
*
* @param {string} url Url to js file
*
* @description
* Adds a script tag to the head.
*/
self.addJs = function(url, done) {
// we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.:
// - fetches local scripts via XHR and evals them
// - adds and immediately removes script elements from the document
var script = rawDocument.createElement('script');
script.type = 'text/javascript';
script.src = url;
if (msie) {
script.onreadystatechange = function() {
/loaded|complete/.test(script.readyState) && done && done();
};
} else {
if (done) script.onload = script.onerror = done;
}
body[0].appendChild(script);
return script;
};
/**
* Returns current <base href>
* (always relative - without domain)
*
* @returns {string=}
*/
self.baseHref = function() {
var href = document.find('base').attr('href');
return href ? href.replace(/^https?\:\/\/[^\/]*/, '') : href;
};
}
function $BrowserProvider(){
this.$get = ['$window', '$log', '$sniffer', '$document',
function( $window, $log, $sniffer, $document){
return new Browser($window, $document, $document.find('body'), $log, $sniffer);
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$cacheFactory
*
* @description
* Factory that constructs cache objects.
*
*
* @param {string} cacheId Name or id of the newly created cache.
* @param {object=} options Options object that specifies the cache behavior. Properties:
*
* - `{number=}` `capacity` — turns the cache into LRU cache.
*
* @returns {object} Newly created cache object with the following set of methods:
*
* - `{object}` `info()` — Returns id, size, and options of cache.
* - `{void}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache.
* - `{{*}} `get({string} key) — Returns cached value for `key` or undefined for cache miss.
* - `{void}` `remove({string} key) — Removes a key-value pair from the cache.
* - `{void}` `removeAll() — Removes all cached values.
* - `{void}` `destroy() — Removes references to this cache from $cacheFactory.
*
*/
function $CacheFactoryProvider() {
this.$get = function() {
var caches = {};
function cacheFactory(cacheId, options) {
if (cacheId in caches) {
throw Error('cacheId ' + cacheId + ' taken');
}
var size = 0,
stats = extend({}, options, {id: cacheId}),
data = {},
capacity = (options && options.capacity) || Number.MAX_VALUE,
lruHash = {},
freshEnd = null,
staleEnd = null;
return caches[cacheId] = {
put: function(key, value) {
var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
refresh(lruEntry);
if (isUndefined(value)) return;
if (!(key in data)) size++;
data[key] = value;
if (size > capacity) {
this.remove(staleEnd.key);
}
},
get: function(key) {
var lruEntry = lruHash[key];
if (!lruEntry) return;
refresh(lruEntry);
return data[key];
},
remove: function(key) {
var lruEntry = lruHash[key];
if (lruEntry == freshEnd) freshEnd = lruEntry.p;
if (lruEntry == staleEnd) staleEnd = lruEntry.n;
link(lruEntry.n,lruEntry.p);
delete lruHash[key];
delete data[key];
size--;
},
removeAll: function() {
data = {};
size = 0;
lruHash = {};
freshEnd = staleEnd = null;
},
destroy: function() {
data = null;
stats = null;
lruHash = null;
delete caches[cacheId];
},
info: function() {
return extend({}, stats, {size: size});
}
};
/**
* makes the `entry` the freshEnd of the LRU linked list
*/
function refresh(entry) {
if (entry != freshEnd) {
if (!staleEnd) {
staleEnd = entry;
} else if (staleEnd == entry) {
staleEnd = entry.n;
}
link(entry.n, entry.p);
link(entry, freshEnd);
freshEnd = entry;
freshEnd.n = null;
}
}
/**
* bidirectionally links two entries of the LRU linked list
*/
function link(nextEntry, prevEntry) {
if (nextEntry != prevEntry) {
if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify
if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify
}
}
}
cacheFactory.info = function() {
var info = {};
forEach(caches, function(cache, cacheId) {
info[cacheId] = cache.info();
});
return info;
};
cacheFactory.get = function(cacheId) {
return caches[cacheId];
};
return cacheFactory;
};
}
function $TemplateCacheProvider() {
this.$get = ['$cacheFactory', function($cacheFactory) {
return $cacheFactory('templates');
}];
}
/**
* @ngdoc function
* @name angular.module.ng.$compile
* @function
*
* @description
* Compiles a piece of HTML string or DOM into a template and produces a template function, which
* can then be used to link {@link angular.module.ng.$rootScope.Scope scope} and the template together.
*
* The compilation is a process of walking the DOM tree and trying to match DOM elements to
* {@link angular.module.ng.$compileProvider.directive directives}. For each match it
* executes corresponding template function and collects the
* instance functions into a single template function which is then returned.
*
* The template function can then be used once to produce the view or as it is the case with
* {@link angular.module.ng.$compileProvider.directive.ng-repeat repeater} many-times, in which
* case each call results in a view that is a DOM clone of the original template.
*
<doc:example module="compile">
<doc:source>
<script>
// declare a new module, and inject the $compileProvider
angular.module('compile', [], function($compileProvider) {
// configure new 'compile' directive by passing a directive
// factory function. The factory function injects the '$compile'
$compileProvider.directive('compile', function($compile) {
// directive factory creates a link function
return function(scope, element, attrs) {
scope.$watch(
function(scope) {
// watch the 'compile' expression for changes
return scope.$eval(attrs.compile);
},
function(value) {
// when the 'compile' expression changes
// assign it into the current DOM
element.html(value);
// compile the new DOM and link it to the current
// scope.
// NOTE: we only compile .childNodes so that
// we don't get into infinite loop compiling ourselves
$compile(element.contents())(scope);
}
);
};
})
});
function Ctrl($scope) {
$scope.name = 'Angular';
$scope.html = 'Hello {{name}}';
}
</script>
<div ng-controller="Ctrl">
<input ng-model="name"> <br>
<textarea ng-model="html"></textarea> <br>
<div compile="html"></div>
</div>
</doc:source>
<doc:scenario>
it('should auto compile', function() {
expect(element('div[compile]').text()).toBe('Hello Angular');
input('html').enter('{{name}}!');
expect(element('div[compile]').text()).toBe('Angular!');
});
</doc:scenario>
</doc:example>
*
*
* @param {string|DOMElement} element Element or HTML string to compile into a template function.
* @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives.
* @param {number} maxPriority only apply directives lower then given priority (Only effects the
* root element(s), not their children)
* @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template
* (a DOM element/tree) to a scope. Where:
*
* * `scope` - A {@link angular.module.ng.$rootScope.Scope Scope} to bind to.
* * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
* `template` and call the `cloneAttachFn` function allowing the caller to attach the
* cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
* called as: <br> `cloneAttachFn(clonedElement, scope)` where:
*
* * `clonedElement` - is a clone of the original `element` passed into the compiler.
* * `scope` - is the current scope with which the linking function is working with.
*
* Calling the linking function returns the element of the template. It is either the original element
* passed in, or the clone of the element if the `cloneAttachFn` is provided.
*
* After linking the view is not updateh until after a call to $digest which typically is done by
* Angular automatically.
*
* If you need access to the bound view, there are two ways to do it:
*
* - If you are not asking the linking function to clone the template, create the DOM element(s)
* before you send them to the compiler and keep this reference around.
* <pre>
* var element = $compile('<p>{{total}}</p>')(scope);
* </pre>
*
* - if on the other hand, you need the element to be cloned, the view reference from the original
* example would not point to the clone, but rather to the original template that was cloned. In
* this case, you can access the clone via the cloneAttachFn:
* <pre>
* var templateHTML = angular.element('<p>{{total}}</p>'),
* scope = ....;
*
* var clonedElement = $compile(templateHTML)(scope, function(clonedElement, scope) {
* //attach the clone to DOM document at the right place
* });
*
* //now we have reference to the cloned DOM via `clone`
* </pre>
*
*
* For information on how the compiler works, see the
* {@link guide/dev_guide.compiler Angular HTML Compiler} section of the Developer Guide.
*/
$CompileProvider.$inject = ['$provide'];
function $CompileProvider($provide) {
var hasDirectives = {},
Suffix = 'Directive',
COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,
CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/,
CONTENT_REGEXP = /\<\<content\>\>/i,
HAS_ROOT_ELEMENT = /^\<[\s\S]*\>$/;
this.directive = function registerDirective(name, directiveFactory) {
if (isString(name)) {
assertArg(directiveFactory, 'directive');
if (!hasDirectives.hasOwnProperty(name)) {
hasDirectives[name] = [];
$provide.factory(name + Suffix, ['$injector', '$exceptionHandler',
function($injector, $exceptionHandler) {
var directives = [];
forEach(hasDirectives[name], function(directiveFactory) {
try {
var directive = $injector.invoke(directiveFactory);
if (isFunction(directive)) {
directive = { compile: valueFn(directive) };
} else if (!directive.compile && directive.link) {
directive.compile = valueFn(directive.link);
}
directive.priority = directive.priority || 0;
directive.name = directive.name || name;
directive.require = directive.require || (directive.controller && directive.name);
directive.restrict = directive.restrict || 'A';
directives.push(directive);
} catch (e) {
$exceptionHandler(e);
}
});
return directives;
}]);
}
hasDirectives[name].push(directiveFactory);
} else {
forEach(name, reverseParams(registerDirective));
}
return this;
};
this.$get = [
'$injector', '$interpolate', '$exceptionHandler', '$http', '$templateCache', '$parse',
'$controller',
function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse,
$controller) {
var LOCAL_MODE = {
attribute: function(localName, mode, parentScope, scope, attr) {
scope[localName] = attr[localName];
},
evaluate: function(localName, mode, parentScope, scope, attr) {
scope[localName] = parentScope.$eval(attr[localName]);
},
bind: function(localName, mode, parentScope, scope, attr) {
var getter = $interpolate(attr[localName]);
scope.$watch(
function() { return getter(parentScope); },
function(v) { scope[localName] = v; }
);
},
accessor: function(localName, mode, parentScope, scope, attr) {
var getter = noop,
setter = noop,
exp = attr[localName];
if (exp) {
getter = $parse(exp);
setter = getter.assign || function() {
throw Error("Expression '" + exp + "' not assignable.");
};
}
scope[localName] = function(value) {
return arguments.length ? setter(parentScope, value) : getter(parentScope);
};
},
expression: function(localName, mode, parentScope, scope, attr) {
scope[localName] = function(locals) {
$parse(attr[localName])(parentScope, locals);
};
}
};
var Attributes = function(element, attr) {
this.$$element = element;
this.$$observers = {};
this.$attr = attr || {};
};
Attributes.prototype = {
$normalize: directiveNormalize,
/**
* Set a normalized attribute on the element in a way such that all directives
* can share the attribute. This function properly handles boolean attributes.
* @param {string} key Normalized key. (ie ngAttribute)
* @param {string|boolean} value The value to set. If `null` attribute will be deleted.
* @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.
* Defaults to true.
* @param {string=} attrName Optional none normalized name. Defaults to key.
*/
$set: function(key, value, writeAttr, attrName) {
var booleanKey = isBooleanAttr(this.$$element[0], key.toLowerCase());
if (booleanKey) {
this.$$element.prop(key, value);
attrName = booleanKey;
}
this[key] = value;
// translate normalized key to actual key
if (attrName) {
this.$attr[key] = attrName;
} else {
attrName = this.$attr[key];
if (!attrName) {
this.$attr[key] = attrName = snake_case(key, '-');
}
}
if (writeAttr !== false) {
if (value === null || value === undefined) {
this.$$element.removeAttr(attrName);
} else {
this.$$element.attr(attrName, value);
}
}
// fire observers
forEach(this.$$observers[key], function(fn) {
try {
fn(value);
} catch (e) {
$exceptionHandler(e);
}
});
},
/**
* Observe an interpolated attribute.
* The observer will never be called, if given attribute is not interpolated.
*
* @param {string} key Normalized key. (ie ngAttribute) .
* @param {function(*)} fn Function that will be called whenever the attribute value changes.
*/
$observe: function(key, fn) {
// keep only observers for interpolated attrs
if (this.$$observers[key]) {
this.$$observers[key].push(fn);
}
}
};
return compile;
//================================
function compile(templateElement, transcludeFn, maxPriority) {
if (!(templateElement instanceof jqLite)) {
// jquery always rewraps, where as we need to preserve the original selector so that we can modify it.
templateElement = jqLite(templateElement);
}
// We can not compile top level text elements since text nodes can be merged and we will
// not be able to attach scope data to them, so we will wrap them in <span>
forEach(templateElement, function(node, index){
if (node.nodeType == 3 /* text node */) {
templateElement[index] = jqLite(node).wrap('<span>').parent()[0];
}
});
var linkingFn = compileNodes(templateElement, transcludeFn, templateElement, maxPriority);
return function(scope, cloneConnectFn){
assertArg(scope, 'scope');
// important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
// and sometimes changes the structure of the DOM.
var element = cloneConnectFn
? JQLitePrototype.clone.call(templateElement) // IMPORTANT!!!
: templateElement;
safeAddClass(element.data('$scope', scope), 'ng-scope');
if (cloneConnectFn) cloneConnectFn(element, scope);
if (linkingFn) linkingFn(scope, element, element);
return element;
};
}
function wrongMode(localName, mode) {
throw Error("Unsupported '" + mode + "' for '" + localName + "'.");
}
function safeAddClass(element, className) {
try {
element.addClass(className);
} catch(e) {
// ignore, since it means that we are trying to set class on
// SVG element, where class name is read-only.
}
}
/**
* Compile function matches each node in nodeList against the directives. Once all directives
* for a particular node are collected their compile functions are executed. The compile
* functions return values - the linking functions - are combined into a composite linking
* function, which is the a linking function for the node.
*
* @param {NodeList} nodeList an array of nodes to compile
* @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the
* scope argument is auto-generated to the new child of the transcluded parent scope.
* @param {DOMElement=} rootElement If the nodeList is the root of the compilation tree then the
* rootElement must be set the jqLite collection of the compile root. This is
* needed so that the jqLite collection items can be replaced with widgets.
* @param {number=} max directive priority
* @returns {?function} A composite linking function of all of the matched directives or null.
*/
function compileNodes(nodeList, transcludeFn, rootElement, maxPriority) {
var linkingFns = [],
directiveLinkingFn, childLinkingFn, directives, attrs, linkingFnFound;
for(var i = 0; i < nodeList.length; i++) {
attrs = new Attributes();
// we must always refer to nodeList[i] since the nodes can be replaced underneath us.
directives = collectDirectives(nodeList[i], [], attrs, maxPriority);
directiveLinkingFn = (directives.length)
? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, rootElement)
: null;
childLinkingFn = (directiveLinkingFn && directiveLinkingFn.terminal)
? null
: compileNodes(nodeList[i].childNodes,
directiveLinkingFn ? directiveLinkingFn.transclude : transcludeFn);
linkingFns.push(directiveLinkingFn);
linkingFns.push(childLinkingFn);
linkingFnFound = (linkingFnFound || directiveLinkingFn || childLinkingFn);
}
// return a linking function if we have found anything, null otherwise
return linkingFnFound ? linkingFn : null;
/* nodesetLinkingFn */ function linkingFn(scope, nodeList, rootElement, boundTranscludeFn) {
var childLinkingFn, directiveLinkingFn, node, childScope, childTransclusionFn;
for(var i=0, n=0, ii=linkingFns.length; i<ii; n++) {
node = nodeList[n];
directiveLinkingFn = /* directiveLinkingFn */ linkingFns[i++];
childLinkingFn = /* nodesetLinkingFn */ linkingFns[i++];
if (directiveLinkingFn) {
if (directiveLinkingFn.scope) {
childScope = scope.$new(isObject(directiveLinkingFn.scope));
jqLite(node).data('$scope', childScope);
} else {
childScope = scope;
}
childTransclusionFn = directiveLinkingFn.transclude;
if (childTransclusionFn || (!boundTranscludeFn && transcludeFn)) {
directiveLinkingFn(childLinkingFn, childScope, node, rootElement,
(function(transcludeFn) {
return function(cloneFn) {
var transcludeScope = scope.$new();
return transcludeFn(transcludeScope, cloneFn).
bind('$destroy', bind(transcludeScope, transcludeScope.$destroy));
};
})(childTransclusionFn || transcludeFn)
);
} else {
directiveLinkingFn(childLinkingFn, childScope, node, undefined, boundTranscludeFn);
}
} else if (childLinkingFn) {
childLinkingFn(scope, node.childNodes, undefined, boundTranscludeFn);
}
}
}
}
/**
* Looks for directives on the given node ands them to the directive collection which is sorted.
*
* @param node node to search
* @param directives an array to which the directives are added to. This array is sorted before
* the function returns.
* @param attrs the shared attrs object which is used to populate the normalized attributes.
* @param {number=} max directive priority
*/
function collectDirectives(node, directives, attrs, maxPriority) {
var nodeType = node.nodeType,
attrsMap = attrs.$attr,
match,
className;
switch(nodeType) {
case 1: /* Element */
// use the node name: <directive>
addDirective(directives,
directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority);
// iterate over the attributes
for (var attr, name, nName, value, nAttrs = node.attributes,
j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {
attr = nAttrs[j];
if (attr.specified) {
name = attr.name;
nName = directiveNormalize(name.toLowerCase());
attrsMap[nName] = name;
attrs[nName] = value = trim((msie && name == 'href')
? decodeURIComponent(node.getAttribute(name, 2))
: attr.value);
if (isBooleanAttr(node, nName)) {
attrs[nName] = true; // presence means true
}
addAttrInterpolateDirective(node, directives, value, nName)
addDirective(directives, nName, 'A', maxPriority);
}
}
// use class as directive
className = node.className;
if (isString(className)) {
while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {
nName = directiveNormalize(match[2]);
if (addDirective(directives, nName, 'C', maxPriority)) {
attrs[nName] = trim(match[3]);
}
className = className.substr(match.index + match[0].length);
}
}
break;
case 3: /* Text Node */
addTextInterpolateDirective(directives, node.nodeValue);
break;
case 8: /* Comment */
match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
if (match) {
nName = directiveNormalize(match[1]);
if (addDirective(directives, nName, 'M', maxPriority)) {
attrs[nName] = trim(match[2]);
}
}
break;
}
directives.sort(byPriority);
return directives;
}
/**
* Once the directives have been collected their compile functions is executed. This method
* is responsible for inlining directive templates as well as terminating the application
* of the directives if the terminal directive has been reached..
*
* @param {Array} directives Array of collected directives to execute their compile function.
* this needs to be pre-sorted by priority order.
* @param {Node} templateNode The raw DOM node to apply the compile functions to
* @param {Object} templateAttrs The shared attribute function
* @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the
* scope argument is auto-generated to the new child of the transcluded parent scope.
* @param {DOMElement} rootElement If we are working on the root of the compile tree then this
* argument has the root jqLite array so that we can replace widgets on it.
* @returns linkingFn
*/
function applyDirectivesToNode(directives, templateNode, templateAttrs, transcludeFn, rootElement) {
var terminalPriority = -Number.MAX_VALUE,
preLinkingFns = [],
postLinkingFns = [],
newScopeDirective = null,
newIsolatedScopeDirective = null,
templateDirective = null,
delayedLinkingFn = null,
element = templateAttrs.$$element = jqLite(templateNode),
directive,
directiveName,
template,
transcludeDirective,
childTranscludeFn = transcludeFn,
controllerDirectives,
linkingFn,
directiveValue;
// executes all directives on the current element
for(var i = 0, ii = directives.length; i < ii; i++) {
directive = directives[i];
template = undefined;
if (terminalPriority > directive.priority) {
break; // prevent further processing of directives
}
if (directiveValue = directive.scope) {
assertNoDuplicate('isolated scope', newIsolatedScopeDirective, directive, element);
if (isObject(directiveValue)) {
safeAddClass(element, 'ng-isolate-scope');
newIsolatedScopeDirective = directive;
}
safeAddClass(element, 'ng-scope');
newScopeDirective = newScopeDirective || directive;
}
directiveName = directive.name;
if (directiveValue = directive.controller) {
controllerDirectives = controllerDirectives || {};
assertNoDuplicate("'" + directiveName + "' controller",
controllerDirectives[directiveName], directive, element);
controllerDirectives[directiveName] = directive;
}
if (directiveValue = directive.transclude) {
assertNoDuplicate('transclusion', transcludeDirective, directive, element);
transcludeDirective = directive;
terminalPriority = directive.priority;
if (directiveValue == 'element') {
template = jqLite(templateNode);
templateNode = (element = templateAttrs.$$element = jqLite(
'<!-- ' + directiveName + ': ' + templateAttrs[directiveName] + ' -->'))[0];
replaceWith(rootElement, jqLite(template[0]), templateNode);
childTranscludeFn = compile(template, transcludeFn, terminalPriority);
} else {
template = jqLite(JQLiteClone(templateNode));
element.html(''); // clear contents
childTranscludeFn = compile(template.contents(), transcludeFn);
}
}
if (directiveValue = directive.template) {
assertNoDuplicate('template', templateDirective, directive, element);
templateDirective = directive;
// include the contents of the original element into the template and replace the element
var content = directiveValue.replace(CONTENT_REGEXP, element.html());
templateNode = jqLite(content)[0];
if (directive.replace) {
replaceWith(rootElement, element, templateNode);
var newTemplateAttrs = {$attr: {}};
// combine directives from the original node and from the template:
// - take the array of directives for this element
// - split it into two parts, those that were already applied and those that weren't
// - collect directives from the template, add them to the second group and sort them
// - append the second group with new directives to the first group
directives = directives.concat(
collectDirectives(
templateNode,
directives.splice(i + 1, directives.length - (i + 1)),
newTemplateAttrs
)
);
mergeTemplateAttributes(templateAttrs, newTemplateAttrs);
ii = directives.length;
} else {
element.html(content);
}
}
if (directive.templateUrl) {
assertNoDuplicate('template', templateDirective, directive, element);
templateDirective = directive;
delayedLinkingFn = compileTemplateUrl(directives.splice(i, directives.length - i),
/* directiveLinkingFn */ compositeLinkFn, element, templateAttrs, rootElement,
directive.replace, childTranscludeFn);
ii = directives.length;
} else if (directive.compile) {
try {
linkingFn = directive.compile(element, templateAttrs, childTranscludeFn);
if (isFunction(linkingFn)) {
addLinkingFns(null, linkingFn);
} else if (linkingFn) {
addLinkingFns(linkingFn.pre, linkingFn.post);
}
} catch (e) {
$exceptionHandler(e, startingTag(element));
}
}
if (directive.terminal) {
compositeLinkFn.terminal = true;
terminalPriority = Math.max(terminalPriority, directive.priority);
}
}
linkingFn = delayedLinkingFn || compositeLinkFn;
linkingFn.scope = newScopeDirective && newScopeDirective.scope;
linkingFn.transclude = transcludeDirective && childTranscludeFn;
// if we have templateUrl, then we have to delay linking
return linkingFn;
////////////////////
function addLinkingFns(pre, post) {
if (pre) {
pre.require = directive.require;
preLinkingFns.push(pre);
}
if (post) {
post.require = directive.require;
postLinkingFns.push(post);
}
}
function getControllers(require, element) {
var value, retrievalMethod = 'data', optional = false;
if (isString(require)) {
while((value = require.charAt(0)) == '^' || value == '?') {
require = require.substr(1);
if (value == '^') {
retrievalMethod = 'inheritedData';
}
optional = optional || value == '?';
}
value = element[retrievalMethod]('$' + require + 'Controller');
if (!value && !optional) {
throw Error("No controller: " + require);
}
return value;
} else if (isArray(require)) {
value = [];
forEach(require, function(require) {
value.push(getControllers(require, element));
});
}
return value;
}
/* directiveLinkingFn */
function compositeLinkFn(/* nodesetLinkingFn */ childLinkingFn,
scope, linkNode, rootElement, boundTranscludeFn) {
var attrs, element, i, ii, linkingFn, controller;
if (templateNode === linkNode) {
attrs = templateAttrs;
} else {
attrs = shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
}
element = attrs.$$element;
if (newScopeDirective && isObject(newScopeDirective.scope)) {
forEach(newScopeDirective.scope, function(mode, name) {
(LOCAL_MODE[mode] || wrongMode)(name, mode,
scope.$parent || scope, scope, attrs);
});
}
if (controllerDirectives) {
forEach(controllerDirectives, function(directive) {
var locals = {
$scope: scope,
$element: element,
$attrs: attrs,
$transclude: boundTranscludeFn
};
forEach(directive.inject || {}, function(mode, name) {
(LOCAL_MODE[mode] || wrongMode)(name, mode,
newScopeDirective ? scope.$parent || scope : scope, locals, attrs);
});
controller = directive.controller;
if (controller == '@') {
controller = attrs[directive.name];
}
element.data(
'$' + directive.name + 'Controller',
$controller(controller, locals));
});
}
// PRELINKING
for(i = 0, ii = preLinkingFns.length; i < ii; i++) {
try {
linkingFn = preLinkingFns[i];
linkingFn(scope, element, attrs,
linkingFn.require && getControllers(linkingFn.require, element));
} catch (e) {
$exceptionHandler(e, startingTag(element));
}
}
// RECURSION
childLinkingFn && childLinkingFn(scope, linkNode.childNodes, undefined, boundTranscludeFn);
// POSTLINKING
for(i = 0, ii = postLinkingFns.length; i < ii; i++) {
try {
linkingFn = postLinkingFns[i];
linkingFn(scope, element, attrs,
linkingFn.require && getControllers(linkingFn.require, element));
} catch (e) {
$exceptionHandler(e, startingTag(element));
}
}
}
}
/**
* looks up the directive and decorates it with exception handling and proper parameters. We
* call this the boundDirective.
*
* @param {string} name name of the directive to look up.
* @param {string} location The directive must be found in specific format.
* String containing any of theses characters:
*
* * `E`: element name
* * `A': attribute
* * `C`: class
* * `M`: comment
* @returns true if directive was added.
*/
function addDirective(tDirectives, name, location, maxPriority) {
var match = false;
if (hasDirectives.hasOwnProperty(name)) {
for(var directive, directives = $injector.get(name + Suffix),
i=0, ii = directives.length; i<ii; i++) {
try {
directive = directives[i];
if ( (maxPriority === undefined || maxPriority > directive.priority) &&
directive.restrict.indexOf(location) != -1) {
tDirectives.push(directive);
match = true;
}
} catch(e) { $exceptionHandler(e); }
}
}
return match;
}
/**
* When the element is replaced with HTML template then the new attributes
* on the template need to be merged with the existing attributes in the DOM.
* The desired effect is to have both of the attributes present.
*
* @param {object} dst destination attributes (original DOM)
* @param {object} src source attributes (from the directive template)
*/
function mergeTemplateAttributes(dst, src) {
var srcAttr = src.$attr,
dstAttr = dst.$attr,
element = dst.$$element;
// reapply the old attributes to the new element
forEach(dst, function(value, key) {
if (key.charAt(0) != '$') {
if (src[key]) {
value += (key === 'style' ? ';' : ' ') + src[key];
}
dst.$set(key, value, true, srcAttr[key]);
}
});
// copy the new attributes on the old attrs object
forEach(src, function(value, key) {
if (key == 'class') {
safeAddClass(element, value);
} else if (key == 'style') {
element.attr('style', element.attr('style') + ';' + value);
} else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {
dst[key] = value;
dstAttr[key] = srcAttr[key];
}
});
}
function compileTemplateUrl(directives, /* directiveLinkingFn */ beforeWidgetLinkFn,
tElement, tAttrs, rootElement, replace, transcludeFn) {
var linkQueue = [],
afterWidgetLinkFn,
afterWidgetChildrenLinkFn,
originalWidgetNode = tElement[0],
asyncWidgetDirective = directives.shift(),
// The fact that we have to copy and patch the directive seems wrong!
syncWidgetDirective = extend({}, asyncWidgetDirective, {templateUrl:null, transclude:null}),
html = tElement.html();
tElement.html('');
$http.get(asyncWidgetDirective.templateUrl, {cache: $templateCache}).
success(function(content) {
content = trim(content).replace(CONTENT_REGEXP, html);
if (replace && !content.match(HAS_ROOT_ELEMENT)) {
throw Error('Template must have exactly one root element: ' + content);
}
var templateNode, tempTemplateAttrs;
if (replace) {
tempTemplateAttrs = {$attr: {}};
templateNode = jqLite(content)[0];
replaceWith(rootElement, tElement, templateNode);
collectDirectives(tElement[0], directives, tempTemplateAttrs);
mergeTemplateAttributes(tAttrs, tempTemplateAttrs);
} else {
templateNode = tElement[0];
tElement.html(content);
}
directives.unshift(syncWidgetDirective);
afterWidgetLinkFn = /* directiveLinkingFn */ applyDirectivesToNode(directives, tElement, tAttrs, transcludeFn);
afterWidgetChildrenLinkFn = /* nodesetLinkingFn */ compileNodes(tElement.contents(), transcludeFn);
while(linkQueue.length) {
var controller = linkQueue.pop(),
linkRootElement = linkQueue.pop(),
cLinkNode = linkQueue.pop(),
scope = linkQueue.pop(),
node = templateNode;
if (cLinkNode !== originalWidgetNode) {
// it was cloned therefore we have to clone as well.
node = JQLiteClone(templateNode);
replaceWith(linkRootElement, jqLite(cLinkNode), node);
}
afterWidgetLinkFn(function() {
beforeWidgetLinkFn(afterWidgetChildrenLinkFn, scope, node, rootElement, controller);
}, scope, node, rootElement, controller);
}
linkQueue = null;
}).
error(function(response, code, headers, config) {
throw Error('Failed to load template: ' + config.url);
});
return /* directiveLinkingFn */ function(ignoreChildLinkingFn, scope, node, rootElement,
controller) {
if (linkQueue) {
linkQueue.push(scope);
linkQueue.push(node);
linkQueue.push(rootElement);
linkQueue.push(controller);
} else {
afterWidgetLinkFn(function() {
beforeWidgetLinkFn(afterWidgetChildrenLinkFn, scope, node, rootElement, controller);
}, scope, node, rootElement, controller);
}
};
}
/**
* Sorting function for bound directives.
*/
function byPriority(a, b) {
return b.priority - a.priority;
}
function assertNoDuplicate(what, previousDirective, directive, element) {
if (previousDirective) {
throw Error('Multiple directives [' + previousDirective.name + ', ' +
directive.name + '] asking for ' + what + ' on: ' + startingTag(element));
}
}
function addTextInterpolateDirective(directives, text) {
var interpolateFn = $interpolate(text, true);
if (interpolateFn) {
directives.push({
priority: 0,
compile: valueFn(function(scope, node) {
var parent = node.parent(),
bindings = parent.data('$binding') || [];
bindings.push(interpolateFn);
safeAddClass(parent.data('$binding', bindings), 'ng-binding');
scope.$watch(interpolateFn, function(value) {
node[0].nodeValue = value;
});
})
});
}
}
function addAttrInterpolateDirective(node, directives, value, name) {
var interpolateFn = $interpolate(value, true);
// no interpolation found -> ignore
if (!interpolateFn) return;
directives.push({
priority: 100,
compile: valueFn(function(scope, element, attr) {
if (name === 'class') {
// we need to interpolate classes again, in the case the element was replaced
// and therefore the two class attrs got merged - we want to interpolate the result
interpolateFn = $interpolate(attr[name], true);
}
// we define observers array only for interpolated attrs
// and ignore observers for non interpolated attrs to save some memory
attr.$$observers[name] = [];
attr[name] = undefined;
scope.$watch(interpolateFn, function(value) {
attr.$set(name, value);
});
})
});
}
/**
* This is a special jqLite.replaceWith, which can replace items which
* have no parents, provided that the containing jqLite collection is provided.
*
* @param {JqLite=} rootElement The root of the compile tree. Used so that we can replace nodes
* in the root of the tree.
* @param {JqLite} element The jqLite element which we are going to replace. We keep the shell,
* but replace its DOM node reference.
* @param {Node} newNode The new DOM node.
*/
function replaceWith(rootElement, element, newNode) {
var oldNode = element[0],
parent = oldNode.parentNode,
i, ii;
if (rootElement) {
for(i = 0, ii = rootElement.length; i<ii; i++) {
if (rootElement[i] == oldNode) {
rootElement[i] = newNode;
}
}
}
if (parent) {
parent.replaceChild(newNode, oldNode);
}
element[0] = newNode;
}
}];
}
var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i;
/**
* Converts all accepted directives format into proper directive name.
* All of these will become 'myDirective':
* my:DiRective
* my-directive
* x-my-directive
* data-my:directive
*
* Also there is special case for Moz prefix starting with upper case letter.
* @param name Name to normalize
*/
function directiveNormalize(name) {
return camelCase(name.replace(PREFIX_REGEXP, ''));
}
/**
* Closure compiler type information
*/
function nodesetLinkingFn(
/* angular.Scope */ scope,
/* NodeList */ nodeList,
/* Element */ rootElement,
/* function(Function) */ boundTranscludeFn
){}
function directiveLinkingFn(
/* nodesetLinkingFn */ nodesetLinkingFn,
/* angular.Scope */ scope,
/* Node */ node,
/* Element */ rootElement,
/* function(Function) */ boundTranscludeFn
){}
/**
* @ngdoc object
* @name angular.module.ng.$controllerProvider
* @description
* The {@link angular.module.ng.$controller $controller service} is used by Angular to create new
* controllers.
*
* This provider allows controller registration via the
* {@link angular.module.ng.$controllerProvider#register register} method.
*/
function $ControllerProvider() {
var controllers = {};
/**
* @ngdoc function
* @name angular.module.ng.$controllerProvider#register
* @methodOf angular.module.ng.$controllerProvider
* @param {string} name Controller name
* @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI
* annotations in the array notation).
*/
this.register = function(name, constructor) {
controllers[name] = constructor;
};
this.$get = ['$injector', '$window', function($injector, $window) {
/**
* @ngdoc function
* @name angular.module.ng.$controller
* @requires $injector
*
* @param {Function|string} constructor If called with a function then it's considered to be the
* controller constructor function. Otherwise it's considered to be a string which is used
* to retrieve the controller constructor using the following steps:
*
* * check if a controller with given name is registered via `$controllerProvider`
* * check if evaluating the string on the current scope returns a constructor
* * check `window[constructor]` on the global `window` object
*
* @param {Object} locals Injection locals for Controller.
* @return {Object} Instance of given controller.
*
* @description
* `$controller` service is responsible for instantiating controllers.
*
* It's just simple call to {@link angular.module.AUTO.$injector $injector}, but extracted into
* a service, so that one can override this service with {@link https://gist.github.com/1649788
* BC version}.
*/
return function(constructor, locals) {
if(isString(constructor)) {
var name = constructor;
constructor = controllers.hasOwnProperty(name)
? controllers[name]
: getter(locals.$scope, name, true) || getter($window, name, true);
assertArgFn(constructor, name, true);
}
return $injector.instantiate(constructor, locals);
};
}];
}
/**
* @ngdoc function
* @name angular.module.ng.$defer
* @requires $browser
*
* @description
* Delegates to {@link angular.module.ng.$browser#defer $browser.defer}, but wraps the `fn` function
* into a try/catch block and delegates any exceptions to
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* In tests you can use `$browser.defer.flush()` to flush the queue of deferred functions.
*
* @param {function()} fn A function, who's execution should be deferred.
* @param {number=} [delay=0] of milliseconds to defer the function execution.
* @returns {*} DeferId that can be used to cancel the task via `$defer.cancel()`.
*/
/**
* @ngdoc function
* @name angular.module.ng.$defer#cancel
* @methodOf angular.module.ng.$defer
*
* @description
* Cancels a defered task identified with `deferId`.
*
* @param {*} deferId Token returned by the `$defer` function.
* @returns {boolean} Returns `true` if the task hasn't executed yet and was successfuly canceled.
*/
function $DeferProvider(){
this.$get = ['$rootScope', '$browser', function($rootScope, $browser) {
function defer(fn, delay) {
return $browser.defer(function() {
$rootScope.$apply(fn);
}, delay);
}
defer.cancel = function(deferId) {
return $browser.defer.cancel(deferId);
};
return defer;
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$document
* @requires $window
*
* @description
* A {@link angular.element jQuery (lite)}-wrapped reference to the browser's `window.document`
* element.
*/
function $DocumentProvider(){
this.$get = ['$window', function(window){
return jqLite(window.document);
}];
}
/**
* @ngdoc function
* @name angular.module.ng.$exceptionHandler
* @requires $log
*
* @description
* Any uncaught exception in angular expressions is delegated to this service.
* The default implementation simply delegates to `$log.error` which logs it into
* the browser console.
*
* In unit tests, if `angular-mocks.js` is loaded, this service is overridden by
* {@link angular.module.ngMock.$exceptionHandler mock $exceptionHandler}
*
* @param {Error} exception Exception associated with the error.
* @param {string=} cause optional information about the context in which
* the error was thrown.
*/
function $ExceptionHandlerProvider() {
this.$get = ['$log', function($log){
return function(exception, cause) {
$log.error.apply($log, arguments);
};
}];
}
/**
* @ngdoc function
* @name angular.module.ng.$interpolateProvider
* @function
*
* @description
*
* Used for configuring the interpolation markup. Deafults to `{{` and `}}`.
*/
function $InterpolateProvider() {
var startSymbol = '{{';
var endSymbol = '}}';
/**
* @ngdoc method
* @name angular.module.ng.$interpolateProvider#startSymbol
* @methodOf angular.module.ng.$interpolateProvider
* @description
* Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
*
* @prop {string=} value new value to set the starting symbol to.
*/
this.startSymbol = function(value){
if (value) {
startSymbol = value;
return this;
} else {
return startSymbol;
}
};
/**
* @ngdoc method
* @name angular.module.ng.$interpolateProvider#endSymbol
* @methodOf angular.module.ng.$interpolateProvider
* @description
* Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
*
* @prop {string=} value new value to set the ending symbol to.
*/
this.endSymbol = function(value){
if (value) {
endSymbol = value;
return this;
} else {
return startSymbol;
}
};
this.$get = ['$parse', function($parse) {
var startSymbolLength = startSymbol.length,
endSymbolLength = endSymbol.length;
/**
* @ngdoc function
* @name angular.module.ng.$interpolate
* @function
*
* @requires $parse
*
* @description
*
* Compiles a string with markup into an interpolation function. This service is used by the
* HTML {@link angular.module.ng.$compile $compile} service for data binding. See
* {@link angular.module.ng.$interpolateProvider $interpolateProvider} for configuring the
* interpolation markup.
*
*
<pre>
var $interpolate = ...; // injected
var exp = $interpolate('Hello {{name}}!');
expect(exp({name:'Angular'}).toEqual('Hello Angular!');
</pre>
*
*
* @param {string} text The text with markup to interpolate.
* @param {boolean=} mustHaveExpression if set to true then the interpolation string must have
* embedded expression in order to return an interpolation function. Strings with no
* embedded expression will return null for the interpolation function.
* @returns {function(context)} an interpolation function which is used to compute the interpolated
* string. The function has these parameters:
*
* * `context`: an object against which any expressions embedded in the strings are evaluated
* against.
*
*/
return function(text, mustHaveExpression) {
var startIndex,
endIndex,
index = 0,
parts = [],
length = text.length,
hasInterpolation = false,
fn,
exp,
concat = [];
while(index < length) {
if ( ((startIndex = text.indexOf(startSymbol, index)) != -1) &&
((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1) ) {
(index != startIndex) && parts.push(text.substring(index, startIndex));
parts.push(fn = $parse(exp = text.substring(startIndex + startSymbolLength, endIndex)));
fn.exp = exp;
index = endIndex + endSymbolLength;
hasInterpolation = true;
} else {
// we did not find anything, so we have to add the remainder to the parts array
(index != length) && parts.push(text.substring(index));
index = length;
}
}
if (!(length = parts.length)) {
// we added, nothing, must have been an empty string.
parts.push('');
length = 1;
}
if (!mustHaveExpression || hasInterpolation) {
concat.length = length;
fn = function(context) {
for(var i = 0, ii = length, part; i<ii; i++) {
if (typeof (part = parts[i]) == 'function') {
part = part(context);
if (part == null || part == undefined) {
part = '';
} else if (typeof part != 'string') {
part = toJson(part);
}
}
concat[i] = part;
}
return concat.join('');
};
fn.exp = text;
fn.parts = parts;
return fn;
}
};
}];
}
var URL_MATCH = /^(file|ftp|http|https):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
PATH_MATCH = /^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,
HASH_MATCH = PATH_MATCH,
DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
/**
* Encode path using encodeUriSegment, ignoring forward slashes
*
* @param {string} path Path to encode
* @returns {string}
*/
function encodePath(path) {
var segments = path.split('/'),
i = segments.length;
while (i--) {
segments[i] = encodeUriSegment(segments[i]);
}
return segments.join('/');
}
function matchUrl(url, obj) {
var match = URL_MATCH.exec(url);
match = {
protocol: match[1],
host: match[3],
port: int(match[5]) || DEFAULT_PORTS[match[1]] || null,
path: match[6] || '/',
search: match[8],
hash: match[10]
};
if (obj) {
obj.$$protocol = match.protocol;
obj.$$host = match.host;
obj.$$port = match.port;
}
return match;
}
function composeProtocolHostPort(protocol, host, port) {
return protocol + '://' + host + (port == DEFAULT_PORTS[protocol] ? '' : ':' + port);
}
function pathPrefixFromBase(basePath) {
return basePath.substr(0, basePath.lastIndexOf('/'));
}
function convertToHtml5Url(url, basePath, hashPrefix) {
var match = matchUrl(url);
// already html5 url
if (decodeURIComponent(match.path) != basePath || isUndefined(match.hash) ||
match.hash.indexOf(hashPrefix) !== 0) {
return url;
// convert hashbang url -> html5 url
} else {
return composeProtocolHostPort(match.protocol, match.host, match.port) +
pathPrefixFromBase(basePath) + match.hash.substr(hashPrefix.length);
}
}
function convertToHashbangUrl(url, basePath, hashPrefix) {
var match = matchUrl(url);
// already hashbang url
if (decodeURIComponent(match.path) == basePath) {
return url;
// convert html5 url -> hashbang url
} else {
var search = match.search && '?' + match.search || '',
hash = match.hash && '#' + match.hash || '',
pathPrefix = pathPrefixFromBase(basePath),
path = match.path.substr(pathPrefix.length);
if (match.path.indexOf(pathPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !';
}
return composeProtocolHostPort(match.protocol, match.host, match.port) + basePath +
'#' + hashPrefix + path + search + hash;
}
}
/**
* LocationUrl represents an url
* This object is exposed as $location service when HTML5 mode is enabled and supported
*
* @constructor
* @param {string} url HTML5 url
* @param {string} pathPrefix
*/
function LocationUrl(url, pathPrefix) {
pathPrefix = pathPrefix || '';
/**
* Parse given html5 (regular) url string into properties
* @param {string} url HTML5 url
* @private
*/
this.$$parse = function(url) {
var match = matchUrl(url, this);
if (match.path.indexOf(pathPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !';
}
this.$$path = decodeURIComponent(match.path.substr(pathPrefix.length));
this.$$search = parseKeyValue(match.search);
this.$$hash = match.hash && decodeURIComponent(match.hash) || '';
this.$$compose();
};
/**
* Compose url and update `absUrl` property
* @private
*/
this.$$compose = function() {
var search = toKeyValue(this.$$search),
hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
this.$$absUrl = composeProtocolHostPort(this.$$protocol, this.$$host, this.$$port) +
pathPrefix + this.$$url;
};
this.$$parse(url);
}
/**
* LocationHashbangUrl represents url
* This object is exposed as $location service when html5 history api is disabled or not supported
*
* @constructor
* @param {string} url Legacy url
* @param {string} hashPrefix Prefix for hash part (containing path and search)
*/
function LocationHashbangUrl(url, hashPrefix) {
var basePath;
/**
* Parse given hashbang url into properties
* @param {string} url Hashbang url
* @private
*/
this.$$parse = function(url) {
var match = matchUrl(url, this);
if (match.hash && match.hash.indexOf(hashPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing hash prefix "' + hashPrefix + '" !';
}
basePath = match.path + (match.search ? '?' + match.search : '');
match = HASH_MATCH.exec((match.hash || '').substr(hashPrefix.length));
if (match[1]) {
this.$$path = (match[1].charAt(0) == '/' ? '' : '/') + decodeURIComponent(match[1]);
} else {
this.$$path = '';
}
this.$$search = parseKeyValue(match[3]);
this.$$hash = match[5] && decodeURIComponent(match[5]) || '';
this.$$compose();
};
/**
* Compose hashbang url and update `absUrl` property
* @private
*/
this.$$compose = function() {
var search = toKeyValue(this.$$search),
hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
this.$$absUrl = composeProtocolHostPort(this.$$protocol, this.$$host, this.$$port) +
basePath + (this.$$url ? '#' + hashPrefix + this.$$url : '');
};
this.$$parse(url);
}
LocationUrl.prototype = {
/**
* Has any change been replacing ?
* @private
*/
$$replace: false,
/**
* @ngdoc method
* @name angular.module.ng.$location#absUrl
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return full url representation with all segments encoded according to rules specified in
* {@link http://www.ietf.org/rfc/rfc3986.txt RFC 3986}.
*
* @return {string}
*/
absUrl: locationGetter('$$absUrl'),
/**
* @ngdoc method
* @name angular.module.ng.$location#url
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return url (e.g. `/path?a=b#hash`) when called without any parameter.
*
* Change path, search and hash, when called with parameter and return `$location`.
*
* @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)
* @return {string}
*/
url: function(url, replace) {
if (isUndefined(url))
return this.$$url;
var match = PATH_MATCH.exec(url);
if (match[1]) this.path(decodeURIComponent(match[1]));
if (match[2] || match[1]) this.search(match[3] || '');
this.hash(match[5] || '', replace);
return this;
},
/**
* @ngdoc method
* @name angular.module.ng.$location#protocol
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return protocol of current url.
*
* @return {string}
*/
protocol: locationGetter('$$protocol'),
/**
* @ngdoc method
* @name angular.module.ng.$location#host
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return host of current url.
*
* @return {string}
*/
host: locationGetter('$$host'),
/**
* @ngdoc method
* @name angular.module.ng.$location#port
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return port of current url.
*
* @return {Number}
*/
port: locationGetter('$$port'),
/**
* @ngdoc method
* @name angular.module.ng.$location#path
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return path of current url when called without any parameter.
*
* Change path when called with parameter and return `$location`.
*
* Note: Path should always begin with forward slash (/), this method will add the forward slash
* if it is missing.
*
* @param {string=} path New path
* @return {string}
*/
path: locationGetterSetter('$$path', function(path) {
return path.charAt(0) == '/' ? path : '/' + path;
}),
/**
* @ngdoc method
* @name angular.module.ng.$location#search
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return search part (as object) of current url when called without any parameter.
*
* Change search part when called with parameter and return `$location`.
*
* @param {string|object<string,string>=} search New search params - string or hash object
* @param {string=} paramValue If `search` is a string, then `paramValue` will override only a
* single search parameter. If the value is `null`, the parameter will be deleted.
*
* @return {string}
*/
search: function(search, paramValue) {
if (isUndefined(search))
return this.$$search;
if (isDefined(paramValue)) {
if (paramValue === null) {
delete this.$$search[search];
} else {
this.$$search[search] = paramValue;
}
} else {
this.$$search = isString(search) ? parseKeyValue(search) : search;
}
this.$$compose();
return this;
},
/**
* @ngdoc method
* @name angular.module.ng.$location#hash
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return hash fragment when called without any parameter.
*
* Change hash fragment when called with parameter and return `$location`.
*
* @param {string=} hash New hash fragment
* @return {string}
*/
hash: locationGetterSetter('$$hash', identity),
/**
* @ngdoc method
* @name angular.module.ng.$location#replace
* @methodOf angular.module.ng.$location
*
* @description
* If called, all changes to $location during current `$digest` will be replacing current history
* record, instead of adding new one.
*/
replace: function() {
this.$$replace = true;
return this;
}
};
LocationHashbangUrl.prototype = inherit(LocationUrl.prototype);
function locationGetter(property) {
return function() {
return this[property];
};
}
function locationGetterSetter(property, preprocess) {
return function(value) {
if (isUndefined(value))
return this[property];
this[property] = preprocess(value);
this.$$compose();
return this;
};
}
/**
* @ngdoc object
* @name angular.module.ng.$location
*
* @requires $browser
* @requires $sniffer
* @requires $document
*
* @description
* The $location service parses the URL in the browser address bar (based on the {@link https://developer.mozilla.org/en/window.location window.location}) and makes the URL available to your application. Changes to the URL in the address bar are reflected into $location service and changes to $location are reflected into the browser address bar.
*
* **The $location service:**
*
* - Exposes the current URL in the browser address bar, so you can
* - Watch and observe the URL.
* - Change the URL.
* - Synchronizes the URL with the browser when the user
* - Changes the address bar.
* - Clicks the back or forward button (or clicks a History link).
* - Clicks on a link.
* - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
*
* For more information see {@link guide/dev_guide.services.$location Developer Guide: Angular Services: Using $location}
*/
/**
* @ngdoc object
* @name angular.module.ng.$locationProvider
* @description
* Use the `$locationProvider` to configure how the application deep linking paths are stored.
*/
function $LocationProvider(){
var hashPrefix = '',
html5Mode = false;
/**
* @ngdoc property
* @name angular.module.ng.$locationProvider#hashPrefix
* @methodOf angular.module.ng.$locationProvider
* @description
* @param {string=} prefix Prefix for hash part (containing path and search)
* @returns {*} current value if used as getter or itself (chaining) if used as setter
*/
this.hashPrefix = function(prefix) {
if (isDefined(prefix)) {
hashPrefix = prefix;
return this;
} else {
return hashPrefix;
}
}
/**
* @ngdoc property
* @name angular.module.ng.$locationProvider#html5Mode
* @methodOf angular.module.ng.$locationProvider
* @description
* @param {string=} mode Use HTML5 strategy if available.
* @returns {*} current value if used as getter or itself (chaining) if used as setter
*/
this.html5Mode = function(mode) {
if (isDefined(mode)) {
html5Mode = mode;
return this;
} else {
return html5Mode;
}
};
this.$get = ['$rootScope', '$browser', '$sniffer', '$document',
function( $rootScope, $browser, $sniffer, $document) {
var currentUrl,
basePath = $browser.baseHref() || '/',
pathPrefix = pathPrefixFromBase(basePath),
initUrl = $browser.url();
if (html5Mode) {
if ($sniffer.history) {
currentUrl = new LocationUrl(convertToHtml5Url(initUrl, basePath, hashPrefix), pathPrefix);
} else {
currentUrl = new LocationHashbangUrl(convertToHashbangUrl(initUrl, basePath, hashPrefix),
hashPrefix);
}
// link rewriting
var u = currentUrl,
absUrlPrefix = composeProtocolHostPort(u.protocol(), u.host(), u.port()) + pathPrefix;
$document.bind('click', function(event) {
// TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
// currently we open nice url link and redirect then
if (event.ctrlKey || event.metaKey || event.which == 2) return;
var elm = jqLite(event.target);
// traverse the DOM up to find first A tag
while (elm.length && lowercase(elm[0].nodeName) !== 'a') {
elm = elm.parent();
}
var href = elm.attr('href');
if (!href || isDefined(elm.attr('ng-ext-link')) || elm.attr('target')) return;
// remove same domain from full url links (IE7 always returns full hrefs)
href = href.replace(absUrlPrefix, '');
// link to different domain (or base path)
if (href.substr(0, 4) == 'http') return;
// remove pathPrefix from absolute links
href = href.indexOf(pathPrefix) === 0 ? href.substr(pathPrefix.length) : href;
currentUrl.url(href);
$rootScope.$apply();
event.preventDefault();
// hack to work around FF6 bug 684208 when scenario runner clicks on links
window.angular['ff-684208-preventDefault'] = true;
});
} else {
currentUrl = new LocationHashbangUrl(initUrl, hashPrefix);
}
// rewrite hashbang url <> html5 url
if (currentUrl.absUrl() != initUrl) {
$browser.url(currentUrl.absUrl(), true);
}
// update $location when $browser url changes
$browser.onUrlChange(function(newUrl) {
if (currentUrl.absUrl() != newUrl) {
$rootScope.$evalAsync(function() {
currentUrl.$$parse(newUrl);
});
if (!$rootScope.$$phase) $rootScope.$digest();
}
});
// update browser
var changeCounter = 0;
$rootScope.$watch(function $locationWatch() {
if ($browser.url() != currentUrl.absUrl()) {
changeCounter++;
$rootScope.$evalAsync(function() {
$browser.url(currentUrl.absUrl(), currentUrl.$$replace);
currentUrl.$$replace = false;
});
}
return changeCounter;
});
return currentUrl;
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$log
* @requires $window
*
* @description
* Simple service for logging. Default implementation writes the message
* into the browser's console (if present).
*
* The main purpose of this service is to simplify debugging and troubleshooting.
*
* @example
<doc:example>
<doc:source>
<script>
function LogCtrl($log) {
this.$log = $log;
this.message = 'Hello World!';
}
</script>
<div ng-controller="LogCtrl">
<p>Reload this page with open console, enter text and hit the log button...</p>
Message:
<input type="text" ng-model="message"/>
<button ng-click="$log.log(message)">log</button>
<button ng-click="$log.warn(message)">warn</button>
<button ng-click="$log.info(message)">info</button>
<button ng-click="$log.error(message)">error</button>
</div>
</doc:source>
<doc:scenario>
</doc:scenario>
</doc:example>
*/
function $LogProvider(){
this.$get = ['$window', function($window){
return {
/**
* @ngdoc method
* @name angular.module.ng.$log#log
* @methodOf angular.module.ng.$log
*
* @description
* Write a log message
*/
log: consoleLog('log'),
/**
* @ngdoc method
* @name angular.module.ng.$log#warn
* @methodOf angular.module.ng.$log
*
* @description
* Write a warning message
*/
warn: consoleLog('warn'),
/**
* @ngdoc method
* @name angular.module.ng.$log#info
* @methodOf angular.module.ng.$log
*
* @description
* Write an information message
*/
info: consoleLog('info'),
/**
* @ngdoc method
* @name angular.module.ng.$log#error
* @methodOf angular.module.ng.$log
*
* @description
* Write an error message
*/
error: consoleLog('error')
};
function formatError(arg) {
if (arg instanceof Error) {
if (arg.stack) {
arg = (arg.message && arg.stack.indexOf(arg.message) === -1)
? 'Error: ' + arg.message + '\n' + arg.stack
: arg.stack;
} else if (arg.sourceURL) {
arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
}
}
return arg;
}
function consoleLog(type) {
var console = $window.console || {},
logFn = console[type] || console.log || noop;
if (logFn.apply) {
return function() {
var args = [];
forEach(arguments, function(arg) {
args.push(formatError(arg));
});
return logFn.apply(console, args);
};
}
// we are IE which either doesn't have window.console => this is noop and we do nothing,
// or we are IE where console.log doesn't have apply so we log at least first 2 args
return function(arg1, arg2) {
logFn(arg1, arg2);
}
}
}];
}
var OPERATORS = {
'null':function(){return null;},
'true':function(){return true;},
'false':function(){return false;},
undefined:noop,
'+':function(self, locals, a,b){a=a(self, locals); b=b(self, locals); return (isDefined(a)?a:0)+(isDefined(b)?b:0);},
'-':function(self, locals, a,b){a=a(self, locals); b=b(self, locals); return (isDefined(a)?a:0)-(isDefined(b)?b:0);},
'*':function(self, locals, a,b){return a(self, locals)*b(self, locals);},
'/':function(self, locals, a,b){return a(self, locals)/b(self, locals);},
'%':function(self, locals, a,b){return a(self, locals)%b(self, locals);},
'^':function(self, locals, a,b){return a(self, locals)^b(self, locals);},
'=':noop,
'==':function(self, locals, a,b){return a(self, locals)==b(self, locals);},
'!=':function(self, locals, a,b){return a(self, locals)!=b(self, locals);},
'<':function(self, locals, a,b){return a(self, locals)<b(self, locals);},
'>':function(self, locals, a,b){return a(self, locals)>b(self, locals);},
'<=':function(self, locals, a,b){return a(self, locals)<=b(self, locals);},
'>=':function(self, locals, a,b){return a(self, locals)>=b(self, locals);},
'&&':function(self, locals, a,b){return a(self, locals)&&b(self, locals);},
'||':function(self, locals, a,b){return a(self, locals)||b(self, locals);},
'&':function(self, locals, a,b){return a(self, locals)&b(self, locals);},
// '|':function(self, locals, a,b){return a|b;},
'|':function(self, locals, a,b){return b(self, locals)(self, locals, a(self, locals));},
'!':function(self, locals, a){return !a(self, locals);}
};
var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
function lex(text){
var tokens = [],
token,
index = 0,
json = [],
ch,
lastCh = ':'; // can start regexp
while (index < text.length) {
ch = text.charAt(index);
if (is('"\'')) {
readString(ch);
} else if (isNumber(ch) || is('.') && isNumber(peek())) {
readNumber();
} else if (isIdent(ch)) {
readIdent();
// identifiers can only be if the preceding char was a { or ,
if (was('{,') && json[0]=='{' &&
(token=tokens[tokens.length-1])) {
token.json = token.text.indexOf('.') == -1;
}
} else if (is('(){}[].,;:')) {
tokens.push({
index:index,
text:ch,
json:(was(':[,') && is('{[')) || is('}]:,')
});
if (is('{[')) json.unshift(ch);
if (is('}]')) json.shift();
index++;
} else if (isWhitespace(ch)) {
index++;
continue;
} else {
var ch2 = ch + peek(),
fn = OPERATORS[ch],
fn2 = OPERATORS[ch2];
if (fn2) {
tokens.push({index:index, text:ch2, fn:fn2});
index += 2;
} else if (fn) {
tokens.push({index:index, text:ch, fn:fn, json: was('[,:') && is('+-')});
index += 1;
} else {
throwError("Unexpected next character ", index, index+1);
}
}
lastCh = ch;
}
return tokens;
function is(chars) {
return chars.indexOf(ch) != -1;
}
function was(chars) {
return chars.indexOf(lastCh) != -1;
}
function peek() {
return index + 1 < text.length ? text.charAt(index + 1) : false;
}
function isNumber(ch) {
return '0' <= ch && ch <= '9';
}
function isWhitespace(ch) {
return ch == ' ' || ch == '\r' || ch == '\t' ||
ch == '\n' || ch == '\v' || ch == '\u00A0'; // IE treats non-breaking space as \u00A0
}
function isIdent(ch) {
return 'a' <= ch && ch <= 'z' ||
'A' <= ch && ch <= 'Z' ||
'_' == ch || ch == '$';
}
function isExpOperator(ch) {
return ch == '-' || ch == '+' || isNumber(ch);
}
function throwError(error, start, end) {
end = end || index;
throw Error("Lexer Error: " + error + " at column" +
(isDefined(start)
? "s " + start + "-" + index + " [" + text.substring(start, end) + "]"
: " " + end) +
" in expression [" + text + "].");
}
function readNumber() {
var number = "";
var start = index;
while (index < text.length) {
var ch = lowercase(text.charAt(index));
if (ch == '.' || isNumber(ch)) {
number += ch;
} else {
var peekCh = peek();
if (ch == 'e' && isExpOperator(peekCh)) {
number += ch;
} else if (isExpOperator(ch) &&
peekCh && isNumber(peekCh) &&
number.charAt(number.length - 1) == 'e') {
number += ch;
} else if (isExpOperator(ch) &&
(!peekCh || !isNumber(peekCh)) &&
number.charAt(number.length - 1) == 'e') {
throwError('Invalid exponent');
} else {
break;
}
}
index++;
}
number = 1 * number;
tokens.push({index:start, text:number, json:true,
fn:function() {return number;}});
}
function readIdent() {
var ident = "",
start = index,
lastDot, peekIndex, methodName;
while (index < text.length) {
var ch = text.charAt(index);
if (ch == '.' || isIdent(ch) || isNumber(ch)) {
if (ch == '.') lastDot = index;
ident += ch;
} else {
break;
}
index++;
}
//check if this is not a method invocation and if it is back out to last dot
if (lastDot) {
peekIndex = index
while(peekIndex < text.length) {
var ch = text.charAt(peekIndex);
if (ch == '(') {
methodName = ident.substr(lastDot - start + 1);
ident = ident.substr(0, lastDot - start);
index = peekIndex;
break;
}
if(isWhitespace(ch)) {
peekIndex++;
} else {
break;
}
}
}
var token = {
index:start,
text:ident
};
if (OPERATORS.hasOwnProperty(ident)) {
token.fn = token.json = OPERATORS[ident];
} else {
var getter = getterFn(ident);
token.fn = extend(function(self, locals) {
return (getter(self, locals));
}, {
assign: function(self, value) {
return setter(self, ident, value);
}
});
}
tokens.push(token);
if (methodName) {
tokens.push({
index:lastDot,
text: '.',
json: false
});
tokens.push({
index: lastDot + 1,
text: methodName,
json: false
});
}
}
function readString(quote) {
var start = index;
index++;
var string = "";
var rawString = quote;
var escape = false;
while (index < text.length) {
var ch = text.charAt(index);
rawString += ch;
if (escape) {
if (ch == 'u') {
var hex = text.substring(index + 1, index + 5);
if (!hex.match(/[\da-f]{4}/i))
throwError( "Invalid unicode escape [\\u" + hex + "]");
index += 4;
string += String.fromCharCode(parseInt(hex, 16));
} else {
var rep = ESCAPE[ch];
if (rep) {
string += rep;
} else {
string += ch;
}
}
escape = false;
} else if (ch == '\\') {
escape = true;
} else if (ch == quote) {
index++;
tokens.push({
index:start,
text:rawString,
string:string,
json:true,
fn:function() { return string; }
});
return;
} else {
string += ch;
}
index++;
}
throwError("Unterminated quote", start);
}
}
/////////////////////////////////////////
function parser(text, json, $filter){
var ZERO = valueFn(0),
value,
tokens = lex(text),
assignment = _assignment,
functionCall = _functionCall,
fieldAccess = _fieldAccess,
objectIndex = _objectIndex,
filterChain = _filterChain
if(json){
// The extra level of aliasing is here, just in case the lexer misses something, so that
// we prevent any accidental execution in JSON.
assignment = logicalOR;
functionCall =
fieldAccess =
objectIndex =
filterChain =
function() { throwError("is not valid json", {text:text, index:0}); };
value = primary();
} else {
value = statements();
}
if (tokens.length !== 0) {
throwError("is an unexpected token", tokens[0]);
}
return value;
///////////////////////////////////
function throwError(msg, token) {
throw Error("Syntax Error: Token '" + token.text +
"' " + msg + " at column " +
(token.index + 1) + " of the expression [" +
text + "] starting at [" + text.substring(token.index) + "].");
}
function peekToken() {
if (tokens.length === 0)
throw Error("Unexpected end of expression: " + text);
return tokens[0];
}
function peek(e1, e2, e3, e4) {
if (tokens.length > 0) {
var token = tokens[0];
var t = token.text;
if (t==e1 || t==e2 || t==e3 || t==e4 ||
(!e1 && !e2 && !e3 && !e4)) {
return token;
}
}
return false;
}
function expect(e1, e2, e3, e4){
var token = peek(e1, e2, e3, e4);
if (token) {
if (json && !token.json) {
throwError("is not valid json", token);
}
tokens.shift();
return token;
}
return false;
}
function consume(e1){
if (!expect(e1)) {
throwError("is unexpected, expecting [" + e1 + "]", peek());
}
}
function unaryFn(fn, right) {
return function(self, locals) {
return fn(self, locals, right);
};
}
function binaryFn(left, fn, right) {
return function(self, locals) {
return fn(self, locals, left, right);
};
}
function hasTokens () {
return tokens.length > 0;
}
function statements() {
var statements = [];
while(true) {
if (tokens.length > 0 && !peek('}', ')', ';', ']'))
statements.push(filterChain());
if (!expect(';')) {
// optimize for the common case where there is only one statement.
// TODO(size): maybe we should not support multiple statements?
return statements.length == 1
? statements[0]
: function(self, locals){
var value;
for ( var i = 0; i < statements.length; i++) {
var statement = statements[i];
if (statement)
value = statement(self, locals);
}
return value;
};
}
}
}
function _filterChain() {
var left = expression();
var token;
while(true) {
if ((token = expect('|'))) {
left = binaryFn(left, token.fn, filter());
} else {
return left;
}
}
}
function filter() {
var token = expect();
var fn = $filter(token.text);
var argsFn = [];
while(true) {
if ((token = expect(':'))) {
argsFn.push(expression());
} else {
var fnInvoke = function(self, locals, input){
var args = [input];
for ( var i = 0; i < argsFn.length; i++) {
args.push(argsFn[i](self, locals));
}
return fn.apply(self, args);
};
return function() {
return fnInvoke;
};
}
}
}
function expression() {
return assignment();
}
function _assignment() {
var left = logicalOR();
var right;
var token;
if ((token = expect('='))) {
if (!left.assign) {
throwError("implies assignment but [" +
text.substring(0, token.index) + "] can not be assigned to", token);
}
right = logicalOR();
return function(self, locals){
return left.assign(self, right(self, locals), locals);
};
} else {
return left;
}
}
function logicalOR() {
var left = logicalAND();
var token;
while(true) {
if ((token = expect('||'))) {
left = binaryFn(left, token.fn, logicalAND());
} else {
return left;
}
}
}
function logicalAND() {
var left = equality();
var token;
if ((token = expect('&&'))) {
left = binaryFn(left, token.fn, logicalAND());
}
return left;
}
function equality() {
var left = relational();
var token;
if ((token = expect('==','!='))) {
left = binaryFn(left, token.fn, equality());
}
return left;
}
function relational() {
var left = additive();
var token;
if ((token = expect('<', '>', '<=', '>='))) {
left = binaryFn(left, token.fn, relational());
}
return left;
}
function additive() {
var left = multiplicative();
var token;
while ((token = expect('+','-'))) {
left = binaryFn(left, token.fn, multiplicative());
}
return left;
}
function multiplicative() {
var left = unary();
var token;
while ((token = expect('*','/','%'))) {
left = binaryFn(left, token.fn, unary());
}
return left;
}
function unary() {
var token;
if (expect('+')) {
return primary();
} else if ((token = expect('-'))) {
return binaryFn(ZERO, token.fn, unary());
} else if ((token = expect('!'))) {
return unaryFn(token.fn, unary());
} else {
return primary();
}
}
function _functionIdent(fnScope) {
var token = expect();
var element = token.text.split('.');
var instance = fnScope;
var key;
for ( var i = 0; i < element.length; i++) {
key = element[i];
if (instance)
instance = instance[key];
}
if (!isFunction(instance)) {
throwError("should be a function", token);
}
return instance;
}
function primary() {
var primary;
if (expect('(')) {
primary = filterChain();
consume(')');
} else if (expect('[')) {
primary = arrayDeclaration();
} else if (expect('{')) {
primary = object();
} else {
var token = expect();
primary = token.fn;
if (!primary) {
throwError("not a primary expression", token);
}
}
var next, context;
while ((next = expect('(', '[', '.'))) {
if (next.text === '(') {
primary = functionCall(primary, context);
context = null;
} else if (next.text === '[') {
context = primary;
primary = objectIndex(primary);
} else if (next.text === '.') {
context = primary;
primary = fieldAccess(primary);
} else {
throwError("IMPOSSIBLE");
}
}
return primary;
}
function _fieldAccess(object) {
var field = expect().text;
var getter = getterFn(field);
return extend(
function(self, locals) {
return getter(object(self, locals), locals);
},
{
assign:function(self, value, locals) {
return setter(object(self, locals), field, value);
}
}
);
}
function _objectIndex(obj) {
var indexFn = expression();
consume(']');
return extend(
function(self, locals){
var o = obj(self, locals),
i = indexFn(self, locals),
v, p;
if (!o) return undefined;
v = o[i];
if (v && v.then) {
p = v;
if (!('$$v' in v)) {
p.$$v = undefined;
p.then(function(val) { p.$$v = val; });
}
v = v.$$v;
}
return v;
}, {
assign:function(self, value, locals){
return obj(self, locals)[indexFn(self, locals)] = value;
}
});
}
function _functionCall(fn, contextGetter) {
var argsFn = [];
if (peekToken().text != ')') {
do {
argsFn.push(expression());
} while (expect(','));
}
consume(')');
return function(self, locals){
var args = [],
context = contextGetter ? contextGetter(self, locals) : self;
for ( var i = 0; i < argsFn.length; i++) {
args.push(argsFn[i](self, locals));
}
var fnPtr = fn(self, locals) || noop;
// IE stupidity!
return fnPtr.apply
? fnPtr.apply(context, args)
: fnPtr(args[0], args[1], args[2], args[3], args[4]);
};
}
// This is used with json array declaration
function arrayDeclaration () {
var elementFns = [];
if (peekToken().text != ']') {
do {
elementFns.push(expression());
} while (expect(','));
}
consume(']');
return function(self, locals){
var array = [];
for ( var i = 0; i < elementFns.length; i++) {
array.push(elementFns[i](self, locals));
}
return array;
};
}
function object () {
var keyValues = [];
if (peekToken().text != '}') {
do {
var token = expect(),
key = token.string || token.text;
consume(":");
var value = expression();
keyValues.push({key:key, value:value});
} while (expect(','));
}
consume('}');
return function(self, locals){
var object = {};
for ( var i = 0; i < keyValues.length; i++) {
var keyValue = keyValues[i];
var value = keyValue.value(self, locals);
object[keyValue.key] = value;
}
return object;
};
}
}
//////////////////////////////////////////////////
// Parser helper functions
//////////////////////////////////////////////////
function setter(obj, path, setValue) {
var element = path.split('.');
for (var i = 0; element.length > 1; i++) {
var key = element.shift();
var propertyObj = obj[key];
if (!propertyObj) {
propertyObj = {};
obj[key] = propertyObj;
}
obj = propertyObj;
}
obj[element.shift()] = setValue;
return setValue;
}
/**
* Return the value accesible from the object by path. Any undefined traversals are ignored
* @param {Object} obj starting object
* @param {string} path path to traverse
* @param {boolean=true} bindFnToScope
* @returns value as accesbile by path
*/
//TODO(misko): this function needs to be removed
function getter(obj, path, bindFnToScope) {
if (!path) return obj;
var keys = path.split('.');
var key;
var lastInstance = obj;
var len = keys.length;
for (var i = 0; i < len; i++) {
key = keys[i];
if (obj) {
obj = (lastInstance = obj)[key];
}
}
if (!bindFnToScope && isFunction(obj)) {
return bind(lastInstance, obj);
}
return obj;
}
var getterFnCache = {};
function getterFn(path) {
if (getterFnCache.hasOwnProperty(path)) {
return getterFnCache[path];
}
var fn, code = 'var l, fn, p;\n';
forEach(path.split('.'), function(key, index) {
code += 'if(!s) return s;\n' +
'l=s;\n' +
's='+ (index
// we simply direference 's' on any .dot notation
? 's'
// but if we are first then we check locals firs, and if so read it first
: '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n' +
'if (s && s.then) {\n' +
' if (!("$$v" in s)) {\n' +
' p=s;\n' +
' p.$$v = undefined;\n' +
' p.then(function(v) {p.$$v=v;});\n' +
'}\n' +
' s=s.$$v\n' +
'}\n';
});
code += 'return s;';
fn = Function('s', 'k', code);
fn.toString = function() { return code; };
return getterFnCache[path] = fn;
}
///////////////////////////////////
function $ParseProvider() {
var cache = {};
this.$get = ['$filter', function($filter) {
return function(exp) {
switch(typeof exp) {
case 'string':
return cache.hasOwnProperty(exp)
? cache[exp]
: cache[exp] = parser(exp, false, $filter);
case 'function':
return exp;
default:
return noop;
}
};
}];
}
/**
* @ngdoc service
* @name angular.module.ng.$q
* @requires $rootScope
*
* @description
* A promise/deferred implementation inspired by [Kris Kowal's Q](https://github.com/kriskowal/q).
*
* [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an
* interface for interacting with an object that represents the result of an action that is
* performed asynchronously, and may or may not be finished at any given point in time.
*
* From the perspective of dealing with error handling, deferred and promise apis are to
* asynchronous programing what `try`, `catch` and `throw` keywords are to synchronous programing.
*
* <pre>
* // for the purpose of this example let's assume that variables `$q` and `scope` are
* // available in the current lexical scope (they could have been injected or passed in).
*
* function asyncGreet(name) {
* var deferred = $q.defer();
*
* setTimeout(function() {
* // since this fn executes async in a future turn of the event loop, we need to wrap
* // our code into an $apply call so that the model changes are properly observed.
* scope.$apply(function() {
* if (okToGreet(name)) {
* deferred.resolve('Hello, ' + name + '!');
* } else {
* deferred.reject('Greeting ' + name + ' is not allowed.');
* }
* });
* }, 1000);
*
* return deferred.promise;
* }
*
* var promise = asyncGreet('Robin Hood');
* promise.then(function(greeting) {
* alert('Success: ' + greeting);
* }, function(reason) {
* alert('Failed: ' + reason);
* );
* </pre>
*
* At first it might not be obvious why this extra complexity is worth the trouble. The payoff
* comes in the way of
* [guarantees that promise and deferred apis make](https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md).
*
* Additionally the promise api allows for composition that is very hard to do with the
* traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.
* For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the
* section on serial or parallel joining of promises.
*
*
* # The Deferred API
*
* A new instance of deferred is constructed by calling `$q.defer()`.
*
* The purpose of the deferred object is to expose the associated Promise instance as well as apis
* that can be used for signaling the successful or unsuccessful completion of the task.
*
* **Methods**
*
* - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection
* constructed via `$q.reject`, the promise will be rejected instead.
* - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
* resolving it with a rejection constructed via `$q.reject`.
*
* **Properties**
*
* - promise – `{Promise}` – promise object associated with this deferred.
*
*
* # The Promise API
*
* A new promise instance is created when a deferred instance is created and can be retrieved by
* calling `deferred.promise`.
*
* The purpose of the promise object is to allow for interested parties to get access to the result
* of the deferred task when it completes.
*
* **Methods**
*
* - `then(successCallback, errorCallback)` – regardless of when the promise was or will be resolved
* or rejected calls one of the success or error callbacks asynchronously as soon as the result
* is available. The callbacks are called with a single argument the result or rejection reason.
*
* This method *returns a new promise* which is resolved or rejected via the return value of the
* `successCallback` or `errorCallback`.
*
*
* # Chaining promises
*
* Because calling `then` api of a promise returns a new derived promise, it is easily possible
* to create a chain of promises:
*
* <pre>
* promiseB = promiseA.then(function(result) {
* return result + 1;
* });
*
* // promiseB will be resolved immediately after promiseA is resolved and it's value will be
* // the result of promiseA incremented by 1
* </pre>
*
* It is possible to create chains of any length and since a promise can be resolved with another
* promise (which will defer its resolution further), it is possible to pause/defer resolution of
* the promises at any point in the chain. This makes it possible to implement powerful apis like
* $http's response interceptors.
*
*
* # Differences between Kris Kowal's Q and $q
*
* There are three main differences:
*
* - $q is integrated with the {@link angular.module.ng.$rootScope.Scope} Scope model observation
* mechanism in angular, which means faster propagation of resolution or rejection into your
* models and avoiding unnecessary browser repaints, which would result in flickering UI.
* - $q promises are recognized by the templating engine in angular, which means that in templates
* you can treat promises attached to a scope as if they were the resulting values.
* - Q has many more features that $q, but that comes at a cost of bytes. $q is tiny, but contains
* all the important functionality needed for common async tasks.
*/
function $QProvider() {
this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
return qFactory(function(callback) {
$rootScope.$evalAsync(callback);
}, $exceptionHandler);
}];
}
/**
* Constructs a promise manager.
*
* @param {function(function)} nextTick Function for executing functions in the next turn.
* @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for
* debugging purposes.
* @returns {object} Promise manager.
*/
function qFactory(nextTick, exceptionHandler) {
/**
* @ngdoc
* @name angular.module.ng.$q#defer
* @methodOf angular.module.ng.$q
* @description
* Creates a `Deferred` object which represents a task which will finish in the future.
*
* @returns {Deferred} Returns a new instance of deferred.
*/
var defer = function() {
var pending = [],
value, deferred;
deferred = {
resolve: function(val) {
if (pending) {
var callbacks = pending;
pending = undefined;
value = ref(val);
if (callbacks.length) {
nextTick(function() {
var callback;
for (var i = 0, ii = callbacks.length; i < ii; i++) {
callback = callbacks[i];
value.then(callback[0], callback[1]);
}
});
}
}
},
reject: function(reason) {
deferred.resolve(reject(reason));
},
promise: {
then: function(callback, errback) {
var result = defer();
var wrappedCallback = function(value) {
try {
result.resolve((callback || defaultCallback)(value));
} catch(e) {
exceptionHandler(e);
result.reject(e);
}
};
var wrappedErrback = function(reason) {
try {
result.resolve((errback || defaultErrback)(reason));
} catch(e) {
exceptionHandler(e);
result.reject(e);
}
};
if (pending) {
pending.push([wrappedCallback, wrappedErrback]);
} else {
value.then(wrappedCallback, wrappedErrback);
}
return result.promise;
}
}
};
return deferred;
};
var ref = function(value) {
if (value && value.then) return value;
return {
then: function(callback) {
var result = defer();
nextTick(function() {
result.resolve(callback(value));
});
return result.promise;
}
};
};
/**
* @ngdoc
* @name angular.module.ng.$q#reject
* @methodOf angular.module.ng.$q
* @description
* Creates a promise that is resolved as rejected with the specified `reason`. This api should be
* used to forward rejection in a chain of promises. If you are dealing with the last promise in
* a promise chain, you don't need to worry about it.
*
* When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of
* `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via
* a promise error callback and you want to forward the error to the promise derived from the
* current promise, you have to "rethrow" the error by returning a rejection constructed via
* `reject`.
*
* <pre>
* promiseB = promiseA.then(function(result) {
* // success: do something and resolve promiseB
* // with the old or a new result
* return result;
* }, function(reason) {
* // error: handle the error if possible and
* // resolve promiseB with newPromiseOrValue,
* // otherwise forward the rejection to promiseB
* if (canHandle(reason)) {
* // handle the error and recover
* return newPromiseOrValue;
* }
* return $q.reject(reason);
* });
* </pre>
*
* @param {*} reason Constant, message, exception or an object representing the rejection reason.
* @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.
*/
var reject = function(reason) {
return {
then: function(callback, errback) {
var result = defer();
nextTick(function() {
result.resolve((errback || defaultErrback)(reason));
});
return result.promise;
}
};
};
/**
* @ngdoc
* @name angular.module.ng.$q#when
* @methodOf angular.module.ng.$q
* @description
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
* This is useful when you are dealing with on object that might or might not be a promise, or if
* the promise comes from a source that can't be trusted.
*
* @param {*} value Value or a promise
* @returns {Promise} Returns a single promise that will be resolved with an array of values,
* each value coresponding to the promise at the same index in the `promises` array. If any of
* the promises is resolved with a rejection, this resulting promise will be resolved with the
* same rejection.
*/
var when = function(value, callback, errback) {
var result = defer(),
done;
var wrappedCallback = function(value) {
try {
return (callback || defaultCallback)(value);
} catch (e) {
exceptionHandler(e);
return reject(e);
}
};
var wrappedErrback = function(reason) {
try {
return (errback || defaultErrback)(reason);
} catch (e) {
exceptionHandler(e);
return reject(e);
}
};
nextTick(function() {
ref(value).then(function(value) {
if (done) return;
done = true;
result.resolve(ref(value).then(wrappedCallback, wrappedErrback));
}, function(reason) {
if (done) return;
done = true;
result.resolve(wrappedErrback(reason));
});
});
return result.promise;
};
function defaultCallback(value) {
return value;
}
function defaultErrback(reason) {
return reject(reason);
}
/**
* @ngdoc
* @name angular.module.ng.$q#all
* @methodOf angular.module.ng.$q
* @description
* Combines multiple promises into a single promise that is resolved when all of the input
* promises are resolved.
*
* @param {Array.<Promise>} promises An array of promises.
* @returns {Promise} Returns a single promise that will be resolved with an array of values,
* each value coresponding to the promise at the same index in the `promises` array. If any of
* the promises is resolved with a rejection, this resulting promise will be resolved with the
* same rejection.
*/
function all(promises) {
var deferred = defer(),
counter = promises.length,
results = [];
if (counter) {
forEach(promises, function(promise, index) {
ref(promise).then(function(value) {
if (index in results) return;
results[index] = value;
if (!(--counter)) deferred.resolve(results);
}, function(reason) {
if (index in results) return;
deferred.reject(reason);
});
});
} else {
deferred.resolve(results);
}
return deferred.promise;
}
return {
defer: defer,
reject: reject,
when: when,
all: all
};
}
/**
* @ngdoc object
* @name angular.module.ng.$routeProvider
* @function
*
* @description
*
* Used for configuring routes. See {@link angular.module.ng.$route $route} for an example.
*/
function $RouteProvider(){
var routes = {};
/**
* @ngdoc method
* @name angular.module.ng.$routeProvider#when
* @methodOf angular.module.ng.$routeProvider
*
* @param {string} path Route path (matched against `$location.path`). If `$location.path`
* contains redudant trailing slash or is missing one, the route will still match and the
* `$location.path` will be updated to add or drop the trailing slash to exacly match the
* route definition.
* @param {Object} route Mapping information to be assigned to `$route.current` on route
* match.
*
* Object properties:
*
* - `controller` – `{function()=}` – Controller fn that should be associated with newly
* created scope.
* - `template` – `{string=}` – path to an html template that should be used by
* {@link angular.module.ng.$compileProvider.directive.ng-view ng-view} or
* {@link angular.module.ng.$compileProvider.directive.ng-include ng-include} directives.
* - `redirectTo` – {(string|function())=} – value to update
* {@link angular.module.ng.$location $location} path with and trigger route redirection.
*
* If `redirectTo` is a function, it will be called with the following parameters:
*
* - `{Object.<string>}` - route parameters extracted from the current
* `$location.path()` by applying the current route template.
* - `{string}` - current `$location.path()`
* - `{Object}` - current `$location.search()`
*
* The custom `redirectTo` function is expected to return a string which will be used
* to update `$location.path()` and `$location.search()`.
*
* - `[reloadOnSearch=true]` - {boolean=} - reload route when only $location.search()
* changes.
*
* If the option is set to `false` and url in the browser changes, then
* `$routeUpdate` event is broadcasted on the root scope.
*
* @returns {Object} self
*
* @description
* Adds a new route definition to the `$route` service.
*/
this.when = function(path, route) {
routes[path] = extend({reloadOnSearch: true}, route);
// create redirection for trailing slashes
if (path) {
var redirectPath = (path[path.length-1] == '/')
? path.substr(0, path.length-1)
: path +'/';
routes[redirectPath] = {redirectTo: path};
}
return this;
};
/**
* @ngdoc method
* @name angular.module.ng.$routeProvider#otherwise
* @methodOf angular.module.ng.$routeProvider
*
* @description
* Sets route definition that will be used on route change when no other route definition
* is matched.
*
* @param {Object} params Mapping information to be assigned to `$route.current`.
* @returns {Object} self
*/
this.otherwise = function(params) {
this.when(null, params);
return this;
};
this.$get = ['$rootScope', '$location', '$routeParams',
function( $rootScope, $location, $routeParams) {
/**
* @ngdoc object
* @name angular.module.ng.$route
* @requires $location
* @requires $routeParams
*
* @property {Object} current Reference to the current route definition.
* @property {Array.<Object>} routes Array of all configured routes.
*
* @description
* Is used for deep-linking URLs to controllers and views (HTML partials).
* It watches `$location.url()` and tries to map the path to an existing route definition.
*
* You can define routes through {@link angular.module.ng.$routeProvider $routeProvider}'s API.
*
* The `$route` service is typically used in conjunction with {@link angular.module.ng.$compileProvider.directive.ng-view ng-view}
* directive and the {@link angular.module.ng.$routeParams $routeParams} service.
*
* @example
This example shows how changing the URL hash causes the `$route` to match a route against the
URL, and the `ng-view` pulls in the partial.
Note that this example is using {@link angular.module.ng.$compileProvider.directive.script inlined templates}
to get it working on jsfiddle as well.
<doc:example module="route">
<doc:source>
<script type="text/ng-template" id="examples/book.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
</script>
<script type="text/ng-template" id="examples/chapter.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
Chapter Id: {{params.chapterId}}
</script>
<script>
angular.module('route', [], function($routeProvider, $locationProvider) {
$routeProvider.when('/Book/:bookId', {template: 'examples/book.html', controller: BookCntl});
$routeProvider.when('/Book/:bookId/ch/:chapterId', {template: 'examples/chapter.html', controller: ChapterCntl});
// configure html5 to get links working on jsfiddle
$locationProvider.html5Mode(true);
});
function MainCntl($scope, $route, $routeParams, $location) {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
}
function BookCntl($scope, $routeParams) {
$scope.name = "BookCntl";
$scope.params = $routeParams;
}
function ChapterCntl($scope, $routeParams) {
$scope.name = "ChapterCntl";
$scope.params = $routeParams;
}
</script>
<div ng-controller="MainCntl">
Choose:
<a href="/Book/Moby">Moby</a> |
<a href="/Book/Moby/ch/1">Moby: Ch1</a> |
<a href="/Book/Gatsby">Gatsby</a> |
<a href="/Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
<a href="/Book/Scarlet">Scarlet Letter</a><br/>
<div ng-view></div>
<hr />
<pre>$location.path() = {{$location.path()}}</pre>
<pre>$route.current.template = {{$route.current.template}}</pre>
<pre>$route.current.params = {{$route.current.params}}</pre>
<pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
<pre>$routeParams = {{$routeParams}}</pre>
</div>
</doc:source>
<doc:scenario>
it('should load and compile correct template', function() {
element('a:contains("Moby: Ch1")').click();
var content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: ChapterCntl/);
expect(content).toMatch(/Book Id\: Moby/);
expect(content).toMatch(/Chapter Id\: 1/);
element('a:contains("Scarlet")').click();
content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: BookCntl/);
expect(content).toMatch(/Book Id\: Scarlet/);
});
</doc:scenario>
</doc:example>
*/
/**
* @ngdoc event
* @name angular.module.ng.$route#$beforeRouteChange
* @eventOf angular.module.ng.$route
* @eventType broadcast on root scope
* @description
* Broadcasted before a route change.
*
* @param {Route} next Future route information.
* @param {Route} current Current route information.
*/
/**
* @ngdoc event
* @name angular.module.ng.$route#$afterRouteChange
* @eventOf angular.module.ng.$route
* @eventType broadcast on root scope
* @description
* Broadcasted after a route change.
*
* @param {Route} current Current route information.
* @param {Route} previous Previous route information.
*/
/**
* @ngdoc event
* @name angular.module.ng.$route#$routeUpdate
* @eventOf angular.module.ng.$route
* @eventType broadcast on root scope
* @description
*
* The `reloadOnSearch` property has been set to false, and we are reusing the same
* instance of the Controller.
*/
var matcher = switchRouteMatcher,
dirty = 0,
forceReload = false,
$route = {
routes: routes,
/**
* @ngdoc method
* @name angular.module.ng.$route#reload
* @methodOf angular.module.ng.$route
*
* @description
* Causes `$route` service to reload the current route even if
* {@link angular.module.ng.$location $location} hasn't changed.
*
* As a result of that, {@link angular.module.ng.$compileProvider.directive.ng-view ng-view}
* creates new scope, reinstantiates the controller.
*/
reload: function() {
dirty++;
forceReload = true;
}
};
$rootScope.$watch(function() { return dirty + $location.url(); }, updateRoute);
return $route;
/////////////////////////////////////////////////////
function switchRouteMatcher(on, when) {
// TODO(i): this code is convoluted and inefficient, we should construct the route matching
// regex only once and then reuse it
var regex = '^' + when.replace(/([\.\\\(\)\^\$])/g, "\\$1") + '$',
params = [],
dst = {};
forEach(when.split(/\W/), function(param) {
if (param) {
var paramRegExp = new RegExp(":" + param + "([\\W])");
if (regex.match(paramRegExp)) {
regex = regex.replace(paramRegExp, "([^\\/]*)$1");
params.push(param);
}
}
});
var match = on.match(new RegExp(regex));
if (match) {
forEach(params, function(name, index) {
dst[name] = match[index + 1];
});
}
return match ? dst : null;
}
function updateRoute() {
var next = parseRoute(),
last = $route.current;
if (next && last && next.$route === last.$route
&& equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload) {
last.params = next.params;
copy(last.params, $routeParams);
$rootScope.$broadcast('$routeUpdate', last);
} else if (next || last) {
forceReload = false;
$rootScope.$broadcast('$beforeRouteChange', next, last);
$route.current = next;
if (next) {
if (next.redirectTo) {
if (isString(next.redirectTo)) {
$location.path(interpolate(next.redirectTo, next.params)).search(next.params)
.replace();
} else {
$location.url(next.redirectTo(next.pathParams, $location.path(), $location.search()))
.replace();
}
} else {
copy(next.params, $routeParams);
}
}
$rootScope.$broadcast('$afterRouteChange', next, last);
}
}
/**
* @returns the current active route, by matching it against the URL
*/
function parseRoute() {
// Match a route
var params, match;
forEach(routes, function(route, path) {
if (!match && (params = matcher($location.path(), path))) {
match = inherit(route, {
params: extend({}, $location.search(), params),
pathParams: params});
match.$route = route;
}
});
// No route matched; fallback to "otherwise" route
return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
}
/**
* @returns interpolation of the redirect path with the parametrs
*/
function interpolate(string, params) {
var result = [];
forEach((string||'').split(':'), function(segment, i) {
if (i == 0) {
result.push(segment);
} else {
var segmentMatch = segment.match(/(\w+)(.*)/);
var key = segmentMatch[1];
result.push(params[key]);
result.push(segmentMatch[2] || '');
delete params[key];
}
});
return result.join('');
}
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$routeParams
* @requires $route
*
* @description
* Current set of route parameters. The route parameters are a combination of the
* {@link angular.module.ng.$location $location} `search()`, and `path()`. The `path` parameters
* are extracted when the {@link angular.module.ng.$route $route} path is matched.
*
* In case of parameter name collision, `path` params take precedence over `search` params.
*
* The service guarantees that the identity of the `$routeParams` object will remain unchanged
* (but its properties will likely change) even when a route change occurs.
*
* @example
* <pre>
* // Given:
* // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
* // Route: /Chapter/:chapterId/Section/:sectionId
* //
* // Then
* $routeParams ==> {chapterId:1, sectionId:2, search:'moby'}
* </pre>
*/
function $RouteParamsProvider() {
this.$get = valueFn({});
}
/**
* DESIGN NOTES
*
* The design decisions behind the scope ware heavily favored for speed and memory consumption.
*
* The typical use of scope is to watch the expressions, which most of the time return the same
* value as last time so we optimize the operation.
*
* Closures construction is expensive from speed as well as memory:
* - no closures, instead ups prototypical inheritance for API
* - Internal state needs to be stored on scope directly, which means that private state is
* exposed as $$____ properties
*
* Loop operations are optimized by using while(count--) { ... }
* - this means that in order to keep the same order of execution as addition we have to add
* items to the array at the begging (shift) instead of at the end (push)
*
* Child scopes are created and removed often
* - Using array would be slow since inserts in meddle are expensive so we use linked list
*
* There are few watches then a lot of observers. This is why you don't want the observer to be
* implemented in the same way as watch. Watch requires return of initialization function which
* are expensive to construct.
*/
/**
* @ngdoc object
* @name angular.module.ng.$rootScopeProvider
* @description
*
* Provider for the $rootScope service.
*/
/**
* @ngdoc function
* @name angular.module.ng.$rootScopeProvider#digestTtl
* @methodOf angular.module.ng.$rootScopeProvider
* @description
*
* Sets the number of digest iteration the scope should attempt to execute before giving up and
* assuming that the model is unstable.
*
* The current default is 10 iterations.
*
* @param {number} limit The number of digest iterations.
*/
/**
* @ngdoc object
* @name angular.module.ng.$rootScope
* @description
*
* Every application has a single root {@link angular.module.ng.$rootScope.Scope scope}.
* All other scopes are child scopes of the root scope. Scopes provide mechanism for watching the model and provide
* event processing life-cycle. See {@link guide/dev_guide.scopes developer guide on scopes}.
*/
function $RootScopeProvider(){
var TTL = 10;
this.digestTtl = function(value) {
if (arguments.length) {
TTL = value;
}
return TTL;
}
this.$get = ['$injector', '$exceptionHandler', '$parse',
function( $injector, $exceptionHandler, $parse) {
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope
*
* @description
* A root scope can be retrieved using the {@link angular.module.ng.$rootScope $rootScope} key from the
* {@link angular.module.AUTO.$injector $injector}. Child scopes are created using the
* {@link angular.module.ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when
* compiled HTML template is executed.)
*
* Here is a simple scope snippet to show how you can interact with the scope.
* <pre>
angular.injector(['ng']).invoke(function($rootScope) {
var scope = $rootScope.$new();
scope.salutation = 'Hello';
scope.name = 'World';
expect(scope.greeting).toEqual(undefined);
scope.$watch('name', function() {
this.greeting = this.salutation + ' ' + this.name + '!';
}); // initialize the watch
expect(scope.greeting).toEqual(undefined);
scope.name = 'Misko';
// still old value, since watches have not been called yet
expect(scope.greeting).toEqual(undefined);
scope.$digest(); // fire all the watches
expect(scope.greeting).toEqual('Hello Misko!');
});
* </pre>
*
* # Inheritance
* A scope can inherit from a parent scope, as in this example:
* <pre>
var parent = $rootScope;
var child = parent.$new();
parent.salutation = "Hello";
child.name = "World";
expect(child.salutation).toEqual('Hello');
child.salutation = "Welcome";
expect(child.salutation).toEqual('Welcome');
expect(parent.salutation).toEqual('Hello');
* </pre>
*
* # Dependency Injection
* See {@link guide/dev_guide.di dependency injection}.
*
*
* @param {Object.<string, function()>=} providers Map of service factory which need to be provided
* for the current scope. Defaults to {@link angular.module.ng}.
* @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should
* append/override services provided by `providers`. This is handy when unit-testing and having
* the need to override a default service.
* @returns {Object} Newly created scope.
*
*/
function Scope() {
this.$id = nextUid();
this.$$phase = this.$parent = this.$$watchers =
this.$$nextSibling = this.$$prevSibling =
this.$$childHead = this.$$childTail = null;
this['this'] = this.$root = this;
this.$$asyncQueue = [];
this.$$listeners = {};
}
/**
* @ngdoc property
* @name angular.module.ng.$rootScope.Scope#$id
* @propertyOf angular.module.ng.$rootScope.Scope
* @returns {number} Unique scope ID (monotonically increasing alphanumeric sequence) useful for
* debugging.
*/
Scope.prototype = {
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$new
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Creates a new child {@link angular.module.ng.$rootScope.Scope scope}.
*
* The parent scope will propagate the {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and
* {@link angular.module.ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the scope
* hierarchy using {@link angular.module.ng.$rootScope.Scope#$destroy $destroy()}.
*
* {@link angular.module.ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is desired for
* the scope and its child scopes to be permanently detached from the parent and thus stop
* participating in model change detection and listener notification by invoking.
*
* @params {boolean} isolate if true then the scoped does not prototypically inherit from the
* parent scope. The scope is isolated, as it can not se parent scope properties.
* When creating widgets it is useful for the widget to not accidently read parent
* state.
*
* @returns {Object} The newly created child scope.
*
*/
$new: function(isolate) {
var Child,
child;
if (isFunction(isolate)) {
// TODO: remove at some point
throw Error('API-CHANGE: Use $controller to instantiate controllers.');
}
if (isolate) {
child = new Scope();
child.$root = this.$root;
} else {
Child = function() {}; // should be anonymous; This is so that when the minifier munges
// the name it does not become random set of chars. These will then show up as class
// name in the debugger.
Child.prototype = this;
child = new Child();
child.$id = nextUid();
}
child['this'] = child;
child.$$listeners = {};
child.$parent = this;
child.$$asyncQueue = [];
child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null;
child.$$prevSibling = this.$$childTail;
if (this.$$childHead) {
this.$$childTail.$$nextSibling = child;
this.$$childTail = child;
} else {
this.$$childHead = this.$$childTail = child;
}
return child;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$watch
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Registers a `listener` callback to be executed whenever the `watchExpression` changes.
*
* - The `watchExpression` is called on every call to {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and
* should return the value which will be watched. (Since {@link angular.module.ng.$rootScope.Scope#$digest $digest()}
* reruns when it detects changes the `watchExpression` can execute multiple times per
* {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)
* - The `listener` is called only when the value from the current `watchExpression` and the
* previous call to `watchExpression' are not equal (with the exception of the initial run
* see below). The inequality is determined according to
* {@link angular.equals} function. To save the value of the object for later comparison
* {@link angular.copy} function is used. It also means that watching complex options will
* have adverse memory and performance implications.
* - The watch `listener` may change the model, which may trigger other `listener`s to fire. This
* is achieved by rerunning the watchers until no changes are detected. The rerun iteration
* limit is 100 to prevent infinity loop deadlock.
*
*
* If you want to be notified whenever {@link angular.module.ng.$rootScope.Scope#$digest $digest} is called,
* you can register an `watchExpression` function with no `listener`. (Since `watchExpression`,
* can execute multiple times per {@link angular.module.ng.$rootScope.Scope#$digest $digest} cycle when a change is
* detected, be prepared for multiple calls to your listener.)
*
* After a watcher is registered with the scope, the `listener` fn is called asynchronously
* (via {@link angular.module.ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the
* watcher. In rare cases, this is undesirable because the listener is called when the result
* of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
* can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
* listener was called due to initialization.
*
*
* # Example
<pre>
// let's assume that scope was dependency injected as the $rootScope
var scope = $rootScope;
scope.name = 'misko';
scope.counter = 0;
expect(scope.counter).toEqual(0);
scope.$watch('name', function(newValue, oldValue) { counter = counter + 1; });
expect(scope.counter).toEqual(0);
scope.$digest();
// no variable change
expect(scope.counter).toEqual(0);
scope.name = 'adam';
scope.$digest();
expect(scope.counter).toEqual(1);
</pre>
*
*
*
* @param {(function()|string)} watchExpression Expression that is evaluated on each
* {@link angular.module.ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers a
* call to the `listener`.
*
* - `string`: Evaluated as {@link guide/dev_guide.expressions expression}
* - `function(scope)`: called with current `scope` as a parameter.
* @param {(function()|string)=} listener Callback called whenever the return value of
* the `watchExpression` changes.
*
* - `string`: Evaluated as {@link guide/dev_guide.expressions expression}
* - `function(newValue, oldValue, scope)`: called with current and previous values as parameters.
*
* @param {boolean=} objectEquality Compare object for equality rather then for refference.
* @returns {function()} Returns a deregistration function for this listener.
*/
$watch: function(watchExp, listener, objectEquality) {
var scope = this,
get = compileToFn(watchExp, 'watch'),
array = scope.$$watchers,
watcher = {
fn: listener,
last: initWatchVal,
get: get,
exp: watchExp,
eq: !!objectEquality
};
// in the case user pass string, we need to compile it, do we really need this ?
if (!isFunction(listener)) {
var listenFn = compileToFn(listener || noop, 'listener');
watcher.fn = function(newVal, oldVal, scope) {listenFn(scope);};
}
if (!array) {
array = scope.$$watchers = [];
}
// we use unshift since we use a while loop in $digest for speed.
// the while loop reads in reverse order.
array.unshift(watcher);
return function() {
arrayRemove(array, watcher);
};
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$digest
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Process all of the {@link angular.module.ng.$rootScope.Scope#$watch watchers} of the current scope and its children.
* Because a {@link angular.module.ng.$rootScope.Scope#$watch watcher}'s listener can change the model, the
* `$digest()` keeps calling the {@link angular.module.ng.$rootScope.Scope#$watch watchers} until no more listeners are
* firing. This means that it is possible to get into an infinite loop. This function will throw
* `'Maximum iteration limit exceeded.'` if the number of iterations exceeds 100.
*
* Usually you don't call `$digest()` directly in
* {@link angular.module.ng.$compileProvider.directive.ng-controller controllers} or in
* {@link angular.module.ng.$compileProvider.directive directives}.
* Instead a call to {@link angular.module.ng.$rootScope.Scope#$apply $apply()} (typically from within a
* {@link angular.module.ng.$compileProvider.directive directives}) will force a `$digest()`.
*
* If you want to be notified whenever `$digest()` is called,
* you can register a `watchExpression` function with {@link angular.module.ng.$rootScope.Scope#$watch $watch()}
* with no `listener`.
*
* You may have a need to call `$digest()` from within unit-tests, to simulate the scope
* life-cycle.
*
* # Example
<pre>
var scope = ...;
scope.name = 'misko';
scope.counter = 0;
expect(scope.counter).toEqual(0);
scope.$watch('name', function(scope, newValue, oldValue) {
counter = counter + 1;
});
expect(scope.counter).toEqual(0);
scope.$digest();
// no variable change
expect(scope.counter).toEqual(0);
scope.name = 'adam';
scope.$digest();
expect(scope.counter).toEqual(1);
</pre>
*
*/
$digest: function() {
var watch, value, last,
watchers,
asyncQueue,
length,
dirty, ttl = TTL,
next, current, target = this,
watchLog = [],
logIdx, logMsg;
flagPhase(target, '$digest');
do {
dirty = false;
current = target;
do {
asyncQueue = current.$$asyncQueue;
while(asyncQueue.length) {
try {
current.$eval(asyncQueue.shift());
} catch (e) {
$exceptionHandler(e);
}
}
if ((watchers = current.$$watchers)) {
// process our watches
length = watchers.length;
while (length--) {
try {
watch = watchers[length];
// Most common watches are on primitives, in which case we can short
// circuit it with === operator, only when === fails do we use .equals
if ((value = watch.get(current)) !== (last = watch.last) &&
!(watch.eq
? equals(value, last)
: (typeof value == 'number' && typeof last == 'number'
&& isNaN(value) && isNaN(last)))) {
dirty = true;
watch.last = watch.eq ? copy(value) : value;
watch.fn(value, ((last === initWatchVal) ? value : last), current);
if (ttl < 5) {
logIdx = 4 - ttl;
if (!watchLog[logIdx]) watchLog[logIdx] = [];
logMsg = (isFunction(watch.exp))
? 'fn: ' + (watch.exp.name || watch.exp.toString())
: watch.exp;
logMsg += '; newVal: ' + toJson(value) + '; oldVal: ' + toJson(last);
watchLog[logIdx].push(logMsg);
}
}
} catch (e) {
$exceptionHandler(e);
}
}
}
// Insanity Warning: scope depth-first traversal
// yes, this code is a bit crazy, but it works and we have tests to prove it!
// this piece should be kept in sync with the traversal in $broadcast
if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) {
while(current !== target && !(next = current.$$nextSibling)) {
current = current.$parent;
}
}
} while ((current = next));
if(dirty && !(ttl--)) {
throw Error(TTL + ' $digest() iterations reached. Aborting!\n' +
'Watchers fired in the last 5 iterations: ' + toJson(watchLog));
}
} while (dirty || asyncQueue.length);
this.$root.$$phase = null;
},
/**
* @ngdoc event
* @name angular.module.$rootScope.Scope#$destroy
* @eventOf angular.module.ng.$rootScope.Scope
* @eventType broadcast on scope being destroyed
*
* @description
* Broadcasted when a scope and its children are being destroyed.
*/
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$destroy
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Remove the current scope (and all of its children) from the parent scope. Removal implies
* that calls to {@link angular.module.ng.$rootScope.Scope#$digest $digest()} will no longer
* propagate to the current scope and its children. Removal also implies that the current
* scope is eligible for garbage collection.
*
* The `$destroy()` is usually used by directives such as
* {@link angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat} for managing the
* unrolling of the loop.
*
* Just before a scope is destroyed a `$destroy` event is broadcasted on this scope.
* Application code can register a `$destroy` event handler that will give it chance to
* perform any necessary cleanup.
*/
$destroy: function() {
if (this.$root == this) return; // we can't remove the root node;
var parent = this.$parent;
this.$broadcast('$destroy');
if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$eval
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Executes the `expression` on the current scope returning the result. Any exceptions in the
* expression are propagated (uncaught). This is useful when evaluating engular expressions.
*
* # Example
<pre>
var scope = angular.module.ng.$rootScope.Scope();
scope.a = 1;
scope.b = 2;
expect(scope.$eval('a+b')).toEqual(3);
expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);
</pre>
*
* @param {(string|function())=} expression An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope, locals)`: execute the function with the current `scope` parameter.
* @param {Object=} locals Hash object of local variables for the expression.
*
* @returns {*} The result of evaluating the expression.
*/
$eval: function(expr, locals) {
return $parse(expr)(this, locals);
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$evalAsync
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Executes the expression on the current scope at a later point in time.
*
* The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only that:
*
* - it will execute in the current script execution context (before any DOM rendering).
* - at least one {@link angular.module.ng.$rootScope.Scope#$digest $digest cycle} will be performed after
* `expression` execution.
*
* Any exceptions from the execution of the expression are forwarded to the
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {(string|function())=} expression An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope)`: execute the function with the current `scope` parameter.
*
*/
$evalAsync: function(expr) {
this.$$asyncQueue.push(expr);
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$apply
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* `$apply()` is used to execute an expression in angular from outside of the angular framework.
* (For example from browser DOM events, setTimeout, XHR or third party libraries).
* Because we are calling into the angular framework we need to perform proper scope life-cycle
* of {@link angular.module.ng.$exceptionHandler exception handling},
* {@link angular.module.ng.$rootScope.Scope#$digest executing watches}.
*
* ## Life cycle
*
* # Pseudo-Code of `$apply()`
function $apply(expr) {
try {
return $eval(expr);
} catch (e) {
$exceptionHandler(e);
} finally {
$root.$digest();
}
}
*
*
* Scope's `$apply()` method transitions through the following stages:
*
* 1. The {@link guide/dev_guide.expressions expression} is executed using the
* {@link angular.module.ng.$rootScope.Scope#$eval $eval()} method.
* 2. Any exceptions from the execution of the expression are forwarded to the
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
* 3. The {@link angular.module.ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the expression
* was executed using the {@link angular.module.ng.$rootScope.Scope#$digest $digest()} method.
*
*
* @param {(string|function())=} exp An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope)`: execute the function with current `scope` parameter.
*
* @returns {*} The result of evaluating the expression.
*/
$apply: function(expr) {
try {
flagPhase(this, '$apply');
return this.$eval(expr);
} catch (e) {
$exceptionHandler(e);
} finally {
this.$root.$$phase = null;
this.$root.$digest();
}
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$on
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Listen on events of a given type. See {@link angular.module.ng.$rootScope.Scope#$emit $emit} for discussion of
* event life cycle.
*
* @param {string} name Event name to listen on.
* @param {function(event)} listener Function to call when the event is emitted.
* @returns {function()} Returns a deregistration function for this listener.
*
* The event listener function format is: `function(event)`. The `event` object passed into the
* listener has the following attributes
*
* - `targetScope` - {Scope}: the scope on which the event was `$emit`-ed or `$broadcast`-ed.
* - `currentScope` - {Scope}: the current scope which is handling the event.
* - `name` - {string}: Name of the event.
* - `cancel` - {function=}: calling `cancel` function will cancel further event propagation
* (available only for events that were `$emit`-ed).
* - `cancelled` - {boolean}: Whether the event was cancelled.
*/
$on: function(name, listener) {
var namedListeners = this.$$listeners[name];
if (!namedListeners) {
this.$$listeners[name] = namedListeners = [];
}
namedListeners.push(listener);
return function() {
arrayRemove(namedListeners, listener);
};
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$emit
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Dispatches an event `name` upwards through the scope hierarchy notifying the
* registered {@link angular.module.ng.$rootScope.Scope#$on} listeners.
*
* The event life cycle starts at the scope on which `$emit` was called. All
* {@link angular.module.ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified.
* Afterwards, the event traverses upwards toward the root scope and calls all registered
* listeners along the way. The event will stop propagating if one of the listeners cancels it.
*
* Any exception emmited from the {@link angular.module.ng.$rootScope.Scope#$on listeners} will be passed
* onto the {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {string} name Event name to emit.
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
* @return {Object} Event object, see {@link angular.module.ng.$rootScope.Scope#$on}
*/
$emit: function(name, args) {
var empty = [],
namedListeners,
scope = this,
event = {
name: name,
targetScope: scope,
cancel: function() {event.cancelled = true;},
cancelled: false
},
listenerArgs = concat([event], arguments, 1),
i, length;
do {
namedListeners = scope.$$listeners[name] || empty;
event.currentScope = scope;
for (i=0, length=namedListeners.length; i<length; i++) {
try {
namedListeners[i].apply(null, listenerArgs);
if (event.cancelled) return event;
} catch (e) {
$exceptionHandler(e);
}
}
//traverse upwards
scope = scope.$parent;
} while (scope);
return event;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$broadcast
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Dispatches an event `name` downwards to all child scopes (and their children) notifying the
* registered {@link angular.module.ng.$rootScope.Scope#$on} listeners.
*
* The event life cycle starts at the scope on which `$broadcast` was called. All
* {@link angular.module.ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified.
* Afterwards, the event propagates to all direct and indirect scopes of the current scope and
* calls all registered listeners along the way. The event cannot be canceled.
*
* Any exception emmited from the {@link angular.module.ng.$rootScope.Scope#$on listeners} will be passed
* onto the {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {string} name Event name to emit.
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
* @return {Object} Event object, see {@link angular.module.ng.$rootScope.Scope#$on}
*/
$broadcast: function(name, args) {
var target = this,
current = target,
next = target,
event = { name: name,
targetScope: target },
listenerArgs = concat([event], arguments, 1);
//down while you can, then up and next sibling or up and next sibling until back at root
do {
current = next;
event.currentScope = current;
forEach(current.$$listeners[name], function(listener) {
try {
listener.apply(null, listenerArgs);
} catch(e) {
$exceptionHandler(e);
}
});
// Insanity Warning: scope depth-first traversal
// yes, this code is a bit crazy, but it works and we have tests to prove it!
// this piece should be kept in sync with the traversal in $digest
if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) {
while(current !== target && !(next = current.$$nextSibling)) {
current = current.$parent;
}
}
} while ((current = next));
return event;
}
};
function flagPhase(scope, phase) {
var root = scope.$root;
if (root.$$phase) {
throw Error(root.$$phase + ' already in progress');
}
root.$$phase = phase;
}
return new Scope();
function compileToFn(exp, name) {
var fn = $parse(exp);
assertArgFn(fn, name);
return fn;
}
/**
* function used as an initial value for watchers.
* because it's uniqueue we can easily tell it apart from other values
*/
function initWatchVal() {}
}];
}
/*
* HTML Parser By Misko Hevery (misko@hevery.com)
* based on: HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
*
* // Use like so:
* htmlParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
*/
/**
* @ngdoc service
* @name angular.module.ng.$sanitize
* @function
*
* @description
* The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are
* then serialized back to properly escaped html string. This means that no unsafe input can make
* it into the returned string, however, since our parser is more strict than a typical browser
* parser, it's possible that some obscure input, which would be recognized as valid HTML by a
* browser, won't make it through the sanitizer.
*
* @param {string} html Html input.
* @returns {string} Sanitized html.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.snippet =
'<p style="color:blue">an html\n' +
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
'snippet</p>';
}
</script>
<div ng-controller="Ctrl">
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<td>Filter</td>
<td>Source</td>
<td>Rendered</td>
</tr>
<tr id="html-filter">
<td>html filter</td>
<td>
<pre><div ng-bind-html="snippet"><br/></div></pre>
</td>
<td>
<div ng-bind-html="snippet"></div>
</td>
</tr>
<tr id="escaped-html">
<td>no filter</td>
<td><pre><div ng-bind="snippet"><br/></div></pre></td>
<td><div ng-bind="snippet"></div></td>
</tr>
<tr id="html-unsafe-filter">
<td>unsafe html filter</td>
<td><pre><div ng-bind-html-unsafe="snippet"><br/></div></pre></td>
<td><div ng-bind-html-unsafe="snippet"></div></td>
</tr>
</table>
</div>
</doc:source>
<doc:scenario>
it('should sanitize the html snippet ', function() {
expect(using('#html-filter').element('div').html()).
toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
});
it('should escape snippet without any filter', function() {
expect(using('#escaped-html').element('div').html()).
toBe("<p style=\"color:blue\">an html\n" +
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
"snippet</p>");
});
it('should inline raw snippet if filtered as unsafe', function() {
expect(using('#html-unsafe-filter').element("div").html()).
toBe("<p style=\"color:blue\">an html\n" +
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
"snippet</p>");
});
it('should update', function() {
input('snippet').enter('new <b>text</b>');
expect(using('#html-filter').binding('snippet')).toBe('new <b>text</b>');
expect(using('#escaped-html').element('div').html()).toBe("new <b>text</b>");
expect(using('#html-unsafe-filter').binding("snippet")).toBe('new <b>text</b>');
});
</doc:scenario>
</doc:example>
*/
function $SanitizeProvider() {
this.$get = valueFn(function(html) {
var buf = [];
htmlParser(html, htmlSanitizeWriter(buf));
return buf.join('');
});
};
// Regular Expressions for parsing tags and attributes
var START_TAG_REGEXP = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,
END_TAG_REGEXP = /^<\s*\/\s*([\w:-]+)[^>]*>/,
ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,
BEGIN_TAG_REGEXP = /^</,
BEGING_END_TAGE_REGEXP = /^<\s*\//,
COMMENT_REGEXP = /<!--(.*?)-->/g,
CDATA_REGEXP = /<!\[CDATA\[(.*?)]]>/g,
URI_REGEXP = /^((ftp|https?):\/\/|mailto:|#)/,
NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g; // Match everything outside of normal chars and " (quote character)
// Good source of info about elements and attributes
// http://dev.w3.org/html5/spec/Overview.html#semantics
// http://simon.html5.org/html-elements
// Safe Void Elements - HTML5
// http://dev.w3.org/html5/spec/Overview.html#void-elements
var voidElements = makeMap("area,br,col,hr,img,wbr");
// Elements that you can, intentionally, leave open (and which close themselves)
// http://dev.w3.org/html5/spec/Overview.html#optional-tags
var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
optionalEndTagInlineElements = makeMap("rp,rt"),
optionalEndTagElements = extend({}, optionalEndTagInlineElements, optionalEndTagBlockElements);
// Safe Block Elements - HTML5
var blockElements = extend({}, optionalEndTagBlockElements, makeMap("address,article,aside," +
"blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6," +
"header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul"));
// Inline Elements - HTML5
var inlineElements = extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b,bdi,bdo," +
"big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small," +
"span,strike,strong,sub,sup,time,tt,u,var"));
// Special Elements (can contain anything)
var specialElements = makeMap("script,style");
var validElements = extend({}, voidElements, blockElements, inlineElements, optionalEndTagElements);
//Attributes that have href and hence need to be sanitized
var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap");
var validAttrs = extend({}, uriAttrs, makeMap(
'abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,'+
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,'+
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,'+
'scope,scrolling,shape,span,start,summary,target,title,type,'+
'valign,value,vspace,width'));
/**
* @example
* htmlParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
* @param {string} html string
* @param {object} handler
*/
function htmlParser( html, handler ) {
var index, chars, match, stack = [], last = html;
stack.last = function() { return stack[ stack.length - 1 ]; };
while ( html ) {
chars = true;
// Make sure we're not in a script or style element
if ( !stack.last() || !specialElements[ stack.last() ] ) {
// Comment
if ( html.indexOf("<!--") === 0 ) {
index = html.indexOf("-->");
if ( index >= 0 ) {
if (handler.comment) handler.comment( html.substring( 4, index ) );
html = html.substring( index + 3 );
chars = false;
}
// end tag
} else if ( BEGING_END_TAGE_REGEXP.test(html) ) {
match = html.match( END_TAG_REGEXP );
if ( match ) {
html = html.substring( match[0].length );
match[0].replace( END_TAG_REGEXP, parseEndTag );
chars = false;
}
// start tag
} else if ( BEGIN_TAG_REGEXP.test(html) ) {
match = html.match( START_TAG_REGEXP );
if ( match ) {
html = html.substring( match[0].length );
match[0].replace( START_TAG_REGEXP, parseStartTag );
chars = false;
}
}
if ( chars ) {
index = html.indexOf("<");
var text = index < 0 ? html : html.substring( 0, index );
html = index < 0 ? "" : html.substring( index );
if (handler.chars) handler.chars( decodeEntities(text) );
}
} else {
html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'), function(all, text){
text = text.
replace(COMMENT_REGEXP, "$1").
replace(CDATA_REGEXP, "$1");
if (handler.chars) handler.chars( decodeEntities(text) );
return "";
});
parseEndTag( "", stack.last() );
}
if ( html == last ) {
throw "Parse Error: " + html;
}
last = html;
}
// Clean up any remaining tags
parseEndTag();
function parseStartTag( tag, tagName, rest, unary ) {
tagName = lowercase(tagName);
if ( blockElements[ tagName ] ) {
while ( stack.last() && inlineElements[ stack.last() ] ) {
parseEndTag( "", stack.last() );
}
}
if ( optionalEndTagElements[ tagName ] && stack.last() == tagName ) {
parseEndTag( "", tagName );
}
unary = voidElements[ tagName ] || !!unary;
if ( !unary )
stack.push( tagName );
var attrs = {};
rest.replace(ATTR_REGEXP, function(match, name, doubleQuotedValue, singleQoutedValue, unqoutedValue) {
var value = doubleQuotedValue
|| singleQoutedValue
|| unqoutedValue
|| '';
attrs[name] = decodeEntities(value);
});
if (handler.start) handler.start( tagName, attrs, unary );
}
function parseEndTag( tag, tagName ) {
var pos = 0, i;
tagName = lowercase(tagName);
if ( tagName )
// Find the closest opened tag of the same type
for ( pos = stack.length - 1; pos >= 0; pos-- )
if ( stack[ pos ] == tagName )
break;
if ( pos >= 0 ) {
// Close all the open elements, up the stack
for ( i = stack.length - 1; i >= pos; i-- )
if (handler.end) handler.end( stack[ i ] );
// Remove the open elements from the stack
stack.length = pos;
}
}
}
/**
* decodes all entities into regular string
* @param value
* @returns {string} A string with decoded entities.
*/
var hiddenPre=document.createElement("pre");
function decodeEntities(value) {
hiddenPre.innerHTML=value.replace(/</g,"<");
return hiddenPre.innerText || hiddenPre.textContent || '';
}
/**
* Escapes all potentially dangerous characters, so that the
* resulting string can be safely inserted into attribute or
* element text.
* @param value
* @returns escaped text
*/
function encodeEntities(value) {
return value.
replace(/&/g, '&').
replace(NON_ALPHANUMERIC_REGEXP, function(value){
return '&#' + value.charCodeAt(0) + ';';
}).
replace(/</g, '<').
replace(/>/g, '>');
}
/**
* create an HTML/XML writer which writes to buffer
* @param {Array} buf use buf.jain('') to get out sanitized html string
* @returns {object} in the form of {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* }
*/
function htmlSanitizeWriter(buf){
var ignore = false;
var out = bind(buf, buf.push);
return {
start: function(tag, attrs, unary){
tag = lowercase(tag);
if (!ignore && specialElements[tag]) {
ignore = tag;
}
if (!ignore && validElements[tag] == true) {
out('<');
out(tag);
forEach(attrs, function(value, key){
var lkey=lowercase(key);
if (validAttrs[lkey]==true && (uriAttrs[lkey]!==true || value.match(URI_REGEXP))) {
out(' ');
out(key);
out('="');
out(encodeEntities(value));
out('"');
}
});
out(unary ? '/>' : '>');
}
},
end: function(tag){
tag = lowercase(tag);
if (!ignore && validElements[tag] == true) {
out('</');
out(tag);
out('>');
}
if (tag == ignore) {
ignore = false;
}
},
chars: function(chars){
if (!ignore) {
out(encodeEntities(chars));
}
}
};
}
/**
* !!! This is an undocumented "private" service !!!
*
* @name angular.module.ng.$sniffer
* @requires $window
*
* @property {boolean} history Does the browser support html5 history api ?
* @property {boolean} hashchange Does the browser support hashchange event ?
*
* @description
* This is very simple implementation of testing browser's features.
*/
function $SnifferProvider() {
this.$get = ['$window', function($window) {
var eventSupport = {};
return {
history: !!($window.history && $window.history.pushState),
hashchange: 'onhashchange' in $window &&
// IE8 compatible mode lies
(!$window.document.documentMode || $window.document.documentMode > 7),
hasEvent: function(event) {
if (isUndefined(eventSupport[event])) {
var divElm = $window.document.createElement('div');
eventSupport[event] = 'on' + event in divElm;
}
return eventSupport[event];
}
};
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$window
*
* @description
* A reference to the browser's `window` object. While `window`
* is globally available in JavaScript, it causes testability problems, because
* it is a global variable. In angular we always refer to it through the
* `$window` service, so it may be overriden, removed or mocked for testing.
*
* All expressions are evaluated with respect to current scope so they don't
* suffer from window globality.
*
* @example
<doc:example>
<doc:source>
<input ng-init="$window = $service('$window'); greeting='Hello World!'" type="text" ng-model="greeting" />
<button ng-click="$window.alert(greeting)">ALERT</button>
</doc:source>
<doc:scenario>
</doc:scenario>
</doc:example>
*/
function $WindowProvider(){
this.$get = valueFn(window);
}
/**
* Parse headers into key value object
*
* @param {string} headers Raw headers as a string
* @returns {Object} Parsed headers as key value object
*/
function parseHeaders(headers) {
var parsed = {}, key, val, i;
if (!headers) return parsed;
forEach(headers.split('\n'), function(line) {
i = line.indexOf(':');
key = lowercase(trim(line.substr(0, i)));
val = trim(line.substr(i + 1));
if (key) {
if (parsed[key]) {
parsed[key] += ', ' + val;
} else {
parsed[key] = val;
}
}
});
return parsed;
}
/**
* Returns a function that provides access to parsed headers.
*
* Headers are lazy parsed when first requested.
* @see parseHeaders
*
* @param {(string|Object)} headers Headers to provide access to.
* @returns {function(string=)} Returns a getter function which if called with:
*
* - if called with single an argument returns a single header value or null
* - if called with no arguments returns an object containing all headers.
*/
function headersGetter(headers) {
var headersObj = isObject(headers) ? headers : undefined;
return function(name) {
if (!headersObj) headersObj = parseHeaders(headers);
if (name) {
return headersObj[lowercase(name)] || null;
}
return headersObj;
};
}
/**
* Chain all given functions
*
* This function is used for both request and response transforming
*
* @param {*} data Data to transform.
* @param {function(string=)} headers Http headers getter fn.
* @param {(function|Array.<function>)} fns Function or an array of functions.
* @returns {*} Transformed data.
*/
function transformData(data, headers, fns) {
if (isFunction(fns))
return fns(data, headers);
forEach(fns, function(fn) {
data = fn(data, headers);
});
return data;
}
function isSuccess(status) {
return 200 <= status && status < 300;
}
function $HttpProvider() {
var JSON_START = /^\s*(\[|\{[^\{])/,
JSON_END = /[\}\]]\s*$/,
PROTECTION_PREFIX = /^\)\]\}',?\n/;
var $config = this.defaults = {
// transform incoming response data
transformResponse: [function(data) {
if (isString(data)) {
// strip json vulnerability protection prefix
data = data.replace(PROTECTION_PREFIX, '');
if (JSON_START.test(data) && JSON_END.test(data))
data = fromJson(data, true);
}
return data;
}],
// transform outgoing request data
transformRequest: [function(d) {
return isObject(d) && !isFile(d) ? toJson(d) : d;
}],
// default headers
headers: {
common: {
'Accept': 'application/json, text/plain, */*',
'X-Requested-With': 'XMLHttpRequest'
},
post: {'Content-Type': 'application/json'},
put: {'Content-Type': 'application/json'}
}
};
var providerResponseInterceptors = this.responseInterceptors = [];
this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector',
function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) {
var defaultCache = $cacheFactory('$http'),
responseInterceptors = [];
forEach(providerResponseInterceptors, function(interceptor) {
responseInterceptors.push(
isString(interceptor)
? $injector.get(interceptor)
: $injector.invoke(interceptor)
);
});
/**
* @ngdoc function
* @name angular.module.ng.$http
* @requires $httpBacked
* @requires $browser
* @requires $cacheFactory
* @requires $rootScope
* @requires $q
* @requires $injector
*
* @description
* The `$http` service is a core Angular service that facilitates communication with the remote
* HTTP servers via browser's {@link https://developer.mozilla.org/en/xmlhttprequest
* XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP JSONP}.
*
* For unit testing applications that use `$http` service, see
* {@link angular.module.ngMock.$httpBackend $httpBackend mock}.
*
* For a higher level of abstraction, please check out the {@link angular.module.ngResource.$resource
* $resource} service.
*
* The $http API is based on the {@link angular.module.ng.$q deferred/promise APIs} exposed by
* the $q service. While for simple usage patters this doesn't matter much, for advanced usage,
* it is important to familiarize yourself with these apis and guarantees they provide.
*
*
* # General usage
* The `$http` service is a function which takes a single argument — a configuration object —
* that is used to generate an http request and returns a {@link angular.module.ng.$q promise}
* with two $http specific methods: `success` and `error`.
*
* <pre>
* $http({method: 'GET', url: '/someUrl'}).
* success(function(data, status, headers, config) {
* // this callback will be called asynchronously
* // when the response is available
* }).
* error(function(data, status, headers, config) {
* // called asynchronously if an error occurs
* // or server returns response with status
* // code outside of the <200, 400) range
* });
* </pre>
*
* Since the returned value of calling the $http function is a Promise object, you can also use
* the `then` method to register callbacks, and these callbacks will receive a single argument –
* an object representing the response. See the api signature and type info below for more
* details.
*
*
* # Shortcut methods
*
* Since all invocation of the $http service require definition of the http method and url and
* POST and PUT requests require response body/data to be provided as well, shortcut methods
* were created to simplify using the api:
*
* <pre>
* $http.get('/someUrl').success(successCallback);
* $http.post('/someUrl', data).success(successCallback);
* </pre>
*
* Complete list of shortcut methods:
*
* - {@link angular.module.ng.$http#get $http.get}
* - {@link angular.module.ng.$http#head $http.head}
* - {@link angular.module.ng.$http#post $http.post}
* - {@link angular.module.ng.$http#put $http.put}
* - {@link angular.module.ng.$http#delete $http.delete}
* - {@link angular.module.ng.$http#jsonp $http.jsonp}
*
*
* # Setting HTTP Headers
*
* The $http service will automatically add certain http headers to all requests. These defaults
* can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
* object, which currently contains this default configuration:
*
* - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
* - `Accept: application/json, text/plain, * / *`
* - `X-Requested-With: XMLHttpRequest`
* - `$httpProvider.defaults.headers.post`: (header defaults for HTTP POST requests)
* - `Content-Type: application/json`
* - `$httpProvider.defaults.headers.put` (header defaults for HTTP PUT requests)
* - `Content-Type: application/json`
*
* To add or overwrite these defaults, simply add or remove a property from this configuration
* objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
* with name equal to the lower-cased http method name, e.g.
* `$httpProvider.defaults.headers.get['My-Header']='value'`.
*
*
* # Transforming Requests and Responses
*
* Both requests and responses can be transformed using transform functions. By default, Angular
* applies these transformations:
*
* Request transformations:
*
* - if the `data` property of the request config object contains an object, serialize it into
* JSON format.
*
* Response transformations:
*
* - if XSRF prefix is detected, strip it (see Security Considerations section below)
* - if json response is detected, deserialize it using a JSON parser
*
* To override these transformation locally, specify transform functions as `transformRequest`
* and/or `transformResponse` properties of the config object. To globally override the default
* transforms, override the `$httpProvider.defaults.transformRequest` and
* `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`.
*
*
* # Caching
*
* To enable caching set the configuration property `cache` to `true`. When the cache is
* enabled, `$http` stores the response from the server in local cache. Next time the
* response is served from the cache without sending a request to the server.
*
* Note that even if the response is served from cache, delivery of the data is asynchronous in
* the same way that real requests are.
*
* If there are multiple GET requests for the same url that should be cached using the same
* cache, but the cache is not populated yet, only one request to the server will be made and
* the remaining requests will be fulfilled using the response for the first request.
*
*
* # Response interceptors
*
* Before you start creating interceptors, be sure to understand the
* {@link angular.module.ng.$q $q and deferred/promise APIs}.
*
* For purposes of global error handling, authentication or any kind of synchronous or
* asynchronous preprocessing of received responses, it is desirable to be able to intercept
* responses for http requests before they are handed over to the application code that
* initiated these requests. The response interceptors leverage the {@link angular.module.ng.$q
* promise apis} to fulfil this need for both synchronous and asynchronous preprocessing.
*
* The interceptors are service factories that are registered with the $httpProvider by
* adding them to the `$httpProvider.responseInterceptors` array. The factory is called and
* injected with dependencies (if specified) and returns the interceptor — a function that
* takes a {@link angular.module.ng.$q promise} and returns the original or a new promise.
*
* <pre>
* // register the interceptor as a service
* $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
* return function(promise) {
* return promise.then(function(response) {
* // do something on success
* }, function(response) {
* // do something on error
* if (canRecover(response)) {
* return responseOrNewPromise
* }
* return $q.reject(response);
* });
* }
* });
*
* $httpProvider.responseInterceptors.push('myHttpInterceptor');
*
*
* // register the interceptor via an anonymous factory
* $httpProvider.responseInterceptors.push(function($q, dependency1, dependency2) {
* return function(promise) {
* // same as above
* }
* });
* </pre>
*
*
* # Security Considerations
*
* When designing web applications, consider security threats from:
*
* - {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
* JSON Vulnerability}
* - {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF}
*
* Both server and the client must cooperate in order to eliminate these threats. Angular comes
* pre-configured with strategies that address these issues, but for this to work backend server
* cooperation is required.
*
* ## JSON Vulnerability Protection
*
* A {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
* JSON Vulnerability} allows third party web-site to turn your JSON resource URL into
* {@link http://en.wikipedia.org/wiki/JSON#JSONP JSONP} request under some conditions. To
* counter this your server can prefix all JSON requests with following string `")]}',\n"`.
* Angular will automatically strip the prefix before processing it as JSON.
*
* For example if your server needs to return:
* <pre>
* ['one','two']
* </pre>
*
* which is vulnerable to attack, your server can return:
* <pre>
* )]}',
* ['one','two']
* </pre>
*
* Angular will strip the prefix, before processing the JSON.
*
*
* ## Cross Site Request Forgery (XSRF) Protection
*
* {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} is a technique by which
* an unauthorized site can gain your user's private data. Angular provides following mechanism
* to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
* called `XSRF-TOKEN` and sets it as the HTTP header `X-XSRF-TOKEN`. Since only JavaScript that
* runs on your domain could read the cookie, your server can be assured that the XHR came from
* JavaScript running on your domain.
*
* To take advantage of this, your server needs to set a token in a JavaScript readable session
* cookie called `XSRF-TOKEN` on first HTTP GET request. On subsequent non-GET requests the
* server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure
* that only JavaScript running on your domain could have read the token. The token must be
* unique for each user and must be verifiable by the server (to prevent the JavaScript making
* up its own tokens). We recommend that the token is a digest of your site's authentication
* cookie with {@link http://en.wikipedia.org/wiki/Rainbow_table salt for added security}.
*
*
* @param {object} config Object describing the request to be made and how it should be
* processed. The object has following properties:
*
* - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)
* - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.
* - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be turned to
* `?key1=value1&key2=value2` after the url. If the value is not a string, it will be JSONified.
* - **data** – `{string|Object}` – Data to be sent as the request message data.
* - **headers** – `{Object}` – Map of strings representing HTTP headers to send to the server.
* - **transformRequest** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
* transform function or an array of such functions. The transform function takes the http
* request body and headers and returns its transformed (typically serialized) version.
* - **transformResponse** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
* transform function or an array of such functions. The transform function takes the http
* response body and headers and returns its transformed (typically deserialized) version.
* - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
* GET request, otherwise if a cache instance built with
* {@link angular.module.ng.$cacheFactory $cacheFactory}, this cache will be used for
* caching.
* - **timeout** – `{number}` – timeout in milliseconds.
* - **withCredentials** - `{boolean}` - whether to to set the `withCredentials` flag on the
* XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5
* requests with credentials} for more information.
*
* @returns {HttpPromise} Returns a {@link angular.module.ng.$q promise} object with the
* standard `then` method and two http specific methods: `success` and `error`. The `then`
* method takes two arguments a success and an error callback which will be called with a
* response object. The `success` and `error` methods take a single argument - a function that
* will be called when the request succeeds or fails respectively. The arguments passed into
* these functions are destructured representation of the response object passed into the
* `then` method. The response object has these properties:
*
* - **data** – `{string|Object}` – The response body transformed with the transform functions.
* - **status** – `{number}` – HTTP status code of the response.
* - **headers** – `{function([headerName])}` – Header getter function.
* - **config** – `{Object}` – The configuration object that was used to generate the request.
*
* @property {Array.<Object>} pendingRequests Array of config objects for currently pending
* requests. This is primarily meant to be used for debugging purposes.
*
*
* @example
<doc:example>
<doc:source jsfiddle="false">
<script>
function FetchCtrl($scope, $http) {
$scope.method = 'GET';
$scope.url = 'examples/http-hello.html';
$scope.fetch = function() {
$scope.code = null;
$scope.response = null;
$http({method: $scope.method, url: $scope.url}).
success(function(data, status) {
$scope.status = status;
$scope.data = data;
}).
error(function(data, status) {
$scope.data = data || "Request failed";
$scope.status = status;
});
};
$scope.updateModel = function(method, url) {
$scope.method = method;
$scope.url = url;
};
}
</script>
<div ng-controller="FetchCtrl">
<select ng-model="method">
<option>GET</option>
<option>JSONP</option>
</select>
<input type="text" ng-model="url" size="80"/>
<button ng-click="fetch()">fetch</button><br>
<button ng-click="updateModel('GET', 'examples/http-hello.html')">Sample GET</button>
<button ng-click="updateModel('JSONP', 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">Sample JSONP</button>
<button ng-click="updateModel('JSONP', 'http://angularjs.org/doesntexist&callback=JSON_CALLBACK')">Invalid JSONP</button>
<pre>http status code: {{status}}</pre>
<pre>http response data: {{data}}</pre>
</div>
</doc:source>
<doc:scenario>
it('should make an xhr GET request', function() {
element(':button:contains("Sample GET")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('200');
expect(binding('data')).toBe('Hello, $http!\n');
});
it('should make a JSONP request to angularjs.org', function() {
element(':button:contains("Sample JSONP")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('200');
expect(binding('data')).toMatch(/Super Hero!/);
});
it('should make JSONP request to invalid URL and invoke the error handler',
function() {
element(':button:contains("Invalid JSONP")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('0');
expect(binding('data')).toBe('Request failed');
});
</doc:scenario>
</doc:example>
*/
function $http(config) {
config.method = uppercase(config.method);
var reqTransformFn = config.transformRequest || $config.transformRequest,
respTransformFn = config.transformResponse || $config.transformResponse,
defHeaders = $config.headers,
reqHeaders = extend({'X-XSRF-TOKEN': $browser.cookies()['XSRF-TOKEN']},
defHeaders.common, defHeaders[lowercase(config.method)], config.headers),
reqData = transformData(config.data, headersGetter(reqHeaders), reqTransformFn),
promise;
// strip content-type if data is undefined
if (isUndefined(config.data)) {
delete reqHeaders['Content-Type'];
}
// send request
promise = sendReq(config, reqData, reqHeaders);
// transform future response
promise = promise.then(transformResponse, transformResponse);
// apply interceptors
forEach(responseInterceptors, function(interceptor) {
promise = interceptor(promise);
});
promise.success = function(fn) {
promise.then(function(response) {
fn(response.data, response.status, response.headers, config);
});
return promise;
};
promise.error = function(fn) {
promise.then(null, function(response) {
fn(response.data, response.status, response.headers, config);
});
return promise;
};
return promise;
function transformResponse(response) {
// make a copy since the response must be cacheable
var resp = extend({}, response, {
data: transformData(response.data, response.headers, respTransformFn)
});
return (isSuccess(response.status))
? resp
: $q.reject(resp);
}
}
$http.pendingRequests = [];
/**
* @ngdoc method
* @name angular.module.ng.$http#get
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `GET` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#delete
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `DELETE` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#head
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `HEAD` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {XhrFuture} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#jsonp
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `JSONP` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request.
* Should contain `JSON_CALLBACK` string.
* @param {Object=} config Optional configuration object
* @returns {XhrFuture} Future object
*/
createShortMethods('get', 'delete', 'head', 'jsonp');
/**
* @ngdoc method
* @name angular.module.ng.$http#post
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `POST` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {*} data Request content
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#put
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `PUT` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {*} data Request content
* @param {Object=} config Optional configuration object
* @returns {XhrFuture} Future object
*/
createShortMethodsWithData('post', 'put');
return $http;
function createShortMethods(names) {
forEach(arguments, function(name) {
$http[name] = function(url, config) {
return $http(extend(config || {}, {
method: name,
url: url
}));
};
});
}
function createShortMethodsWithData(name) {
forEach(arguments, function(name) {
$http[name] = function(url, data, config) {
return $http(extend(config || {}, {
method: name,
url: url,
data: data
}));
};
});
}
/**
* Makes the request
*
* !!! ACCESSES CLOSURE VARS:
* $httpBackend, $config, $log, $rootScope, defaultCache, $http.pendingRequests
*/
function sendReq(config, reqData, reqHeaders) {
var deferred = $q.defer(),
promise = deferred.promise,
cache,
cachedResp,
url = buildUrl(config.url, config.params);
$http.pendingRequests.push(config);
promise.then(removePendingReq, removePendingReq);
if (config.cache && config.method == 'GET') {
cache = isObject(config.cache) ? config.cache : defaultCache;
}
if (cache) {
cachedResp = cache.get(url);
if (cachedResp) {
if (cachedResp.then) {
// cached request has already been sent, but there is no response yet
cachedResp.then(removePendingReq, removePendingReq);
return cachedResp;
} else {
// serving from cache
if (isArray(cachedResp)) {
resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));
} else {
resolvePromise(cachedResp, 200, {});
}
}
} else {
// put the promise for the non-transformed response into cache as a placeholder
cache.put(url, promise);
}
}
// if we won't have the response in cache, send the request to the backend
if (!cachedResp) {
$httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,
config.withCredentials);
}
return promise;
/**
* Callback registered to $httpBackend():
* - caches the response if desired
* - resolves the raw $http promise
* - calls $apply
*/
function done(status, response, headersString) {
if (cache) {
if (isSuccess(status)) {
cache.put(url, [status, response, parseHeaders(headersString)]);
} else {
// remove promise from the cache
cache.remove(url);
}
}
resolvePromise(response, status, headersString);
$rootScope.$apply();
}
/**
* Resolves the raw $http promise.
*/
function resolvePromise(response, status, headers) {
// normalize internal statuses to 0
status = Math.max(status, 0);
(isSuccess(status) ? deferred.resolve : deferred.reject)({
data: response,
status: status,
headers: headersGetter(headers),
config: config
});
}
function removePendingReq() {
var idx = indexOf($http.pendingRequests, config);
if (idx !== -1) $http.pendingRequests.splice(idx, 1);
}
}
function buildUrl(url, params) {
if (!params) return url;
var parts = [];
forEachSorted(params, function(value, key) {
if (value == null || value == undefined) return;
if (isObject(value)) {
value = toJson(value);
}
parts.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
});
return url + ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&');
}
}];
}
var XHR = window.XMLHttpRequest || function() {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {}
throw new Error("This browser does not support XMLHttpRequest.");
};
/**
* @ngdoc object
* @name angular.module.ng.$httpBackend
* @requires $browser
* @requires $window
* @requires $document
*
* @description
* HTTP backend used by the {@link angular.module.ng.$http service} that delegates to
* XMLHttpRequest object or JSONP and deals with browser incompatibilities.
*
* You should never need to use this service directly, instead use the higher-level abstractions:
* {@link angular.module.ng.$http $http} or {@link angular.module.ngResource.$resource $resource}.
*
* During testing this implementation is swapped with {@link angular.module.ngMock.$httpBackend mock
* $httpBackend} which can be trained with responses.
*/
function $HttpBackendProvider() {
this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) {
return createHttpBackend($browser, XHR, $browser.defer, $window.angular.callbacks,
$document[0].body, $window.location.protocol.replace(':', ''));
}];
}
function createHttpBackend($browser, XHR, $browserDefer, callbacks, body, locationProtocol) {
// TODO(vojta): fix the signature
return function(method, url, post, callback, headers, timeout, withCredentials) {
$browser.$$incOutstandingRequestCount();
url = url || $browser.url();
if (lowercase(method) == 'jsonp') {
var callbackId = '_' + (callbacks.counter++).toString(36);
callbacks[callbackId] = function(data) {
callbacks[callbackId].data = data;
};
var script = $browser.addJs(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),
function() {
if (callbacks[callbackId].data) {
completeRequest(callback, 200, callbacks[callbackId].data);
} else {
completeRequest(callback, -2);
}
delete callbacks[callbackId];
body.removeChild(script);
});
} else {
var xhr = new XHR();
xhr.open(method, url, true);
forEach(headers, function(value, key) {
if (value) xhr.setRequestHeader(key, value);
});
var status;
// In IE6 and 7, this might be called synchronously when xhr.send below is called and the
// response is in the cache. the promise api will ensure that to the app code the api is
// always async
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
completeRequest(
callback, status || xhr.status, xhr.responseText, xhr.getAllResponseHeaders());
}
};
if (withCredentials) {
xhr.withCredentials = true;
}
xhr.send(post || '');
if (timeout > 0) {
$browserDefer(function() {
status = -1;
xhr.abort();
}, timeout);
}
}
function completeRequest(callback, status, response, headersString) {
// URL_MATCH is defined in src/service/location.js
var protocol = (url.match(URL_MATCH) || ['', locationProtocol])[1];
// fix status code for file protocol (it's always 0)
status = (protocol == 'file') ? (response ? 200 : 404) : status;
// normalize IE bug (http://bugs.jquery.com/ticket/1450)
status = status == 1223 ? 204 : status;
callback(status, response, headersString);
$browser.$$completeOutstandingRequest(noop);
}
};
}
/**
* @ngdoc object
* @name angular.module.ng.$locale
*
* @description
* $locale service provides localization rules for various Angular components. As of right now the
* only public api is:
*
* * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)
*/
function $LocaleProvider(){
this.$get = function() {
return {
id: 'en-us',
NUMBER_FORMATS: {
DECIMAL_SEP: '.',
GROUP_SEP: ',',
PATTERNS: [
{ // Decimal Pattern
minInt: 1,
minFrac: 0,
maxFrac: 3,
posPre: '',
posSuf: '',
negPre: '-',
negSuf: '',
gSize: 3,
lgSize: 3
},{ //Currency Pattern
minInt: 1,
minFrac: 2,
maxFrac: 2,
posPre: '\u00A4',
posSuf: '',
negPre: '(\u00A4',
negSuf: ')',
gSize: 3,
lgSize: 3
}
],
CURRENCY_SYM: '$'
},
DATETIME_FORMATS: {
MONTH: 'January,February,March,April,May,June,July,August,September,October,November,December'
.split(','),
SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),
DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),
SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),
AMPMS: ['AM','PM'],
medium: 'MMM d, y h:mm:ss a',
short: 'M/d/yy h:mm a',
fullDate: 'EEEE, MMMM d, y',
longDate: 'MMMM d, y',
mediumDate: 'MMM d, y',
shortDate: 'M/d/yy',
mediumTime: 'h:mm:ss a',
shortTime: 'h:mm a'
},
pluralCat: function(num) {
if (num === 1) {
return 'one';
}
return 'other';
}
};
};
}
/**
* @ngdoc object
* @name angular.module.ng.$filterProvider
* @description
*
* Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To
* achieve this a filter definition consists of a factory function which is annotated with dependencies and is
* responsible for creating a the filter function.
*
* <pre>
* // Filter registration
* function MyModule($provide, $filterProvider) {
* // create a service to demonstrate injection (not always needed)
* $provide.value('greet', function(name){
* return 'Hello ' + name + '!':
* });
*
* // register a filter factory which uses the
* // greet service to demonstrate DI.
* $filterProvider.register('greet', function(greet){
* // return the filter function which uses the greet service
* // to generate salutation
* return function(text) {
* // filters need to be forgiving so check input validity
* return text && greet(text) || text;
* };
* };
* }
* </pre>
*
* The filter function is registered with the `$injector` under the filter name suffixe with `Filter`.
* <pre>
* it('should be the same instance', inject(
* function($filterProvider) {
* $filterProvider.register('reverse', function(){
* return ...;
* });
* },
* function($filter, reverseFilter) {
* expect($filter('reverse')).toBe(reverseFilter);
* });
* </pre>
*
*
* For more information about how angular filters work, and how to create your own filters, see
* {@link guide/dev_guide.templates.filters Understanding Angular Filters} in the angular Developer
* Guide.
*/
/**
* @ngdoc method
* @name angular.module.ng.$filterProvider#register
* @methodOf angular.module.ng.$filterProvider
* @description
* Register filter factory function.
*
* @param {String} name Name of the filter.
* @param {function} fn The filter factory function which is injectable.
*/
/**
* @ngdoc function
* @name angular.module.ng.$filter
* @function
* @description
* Filters are used for formatting data displayed to the user.
*
* The general syntax in templates is as follows:
*
* {{ expression | [ filter_name ] }}
*
* @param {String} name Name of the filter function to retrieve
* @return {Function} the filter function
*/
$FilterProvider.$inject = ['$provide'];
function $FilterProvider($provide) {
var suffix = 'Filter';
function register(name, factory) {
return $provide.factory(name + suffix, factory);
}
this.register = register;
this.$get = ['$injector', function($injector) {
return function(name) {
return $injector.get(name + suffix);
}
}];
////////////////////////////////////////
register('currency', currencyFilter);
register('date', dateFilter);
register('filter', filterFilter);
register('json', jsonFilter);
register('limitTo', limitToFilter);
register('linky', linkyFilter);
register('lowercase', lowercaseFilter);
register('number', numberFilter);
register('orderBy', orderByFilter);
register('uppercase', uppercaseFilter);
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.filter
* @function
*
* @description
* Selects a subset of items from `array` and returns it as a new array.
*
* Note: This function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {Array} array The source array.
* @param {string|Object|function()} expression The predicate to be used for selecting items from
* `array`.
*
* Can be one of:
*
* - `string`: Predicate that results in a substring match using the value of `expression`
* string. All strings or objects with string properties in `array` that contain this string
* will be returned. The predicate can be negated by prefixing the string with `!`.
*
* - `Object`: A pattern object can be used to filter specific properties on objects contained
* by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items
* which have property `name` containing "M" and property `phone` containing "1". A special
* property name `$` can be used (as in `{$:"text"}`) to accept a match against any
* property of the object. That's equivalent to the simple substring match with a `string`
* as described above.
*
* - `function`: A predicate function can be used to write arbitrary filters. The function is
* called for each element of `array`. The final result is an array of those elements that
* the predicate returned true for.
*
* @example
<doc:example>
<doc:source>
<div ng-init="friends = [{name:'John', phone:'555-1276'},
{name:'Mary', phone:'800-BIG-MARY'},
{name:'Mike', phone:'555-4321'},
{name:'Adam', phone:'555-5678'},
{name:'Julie', phone:'555-8765'}]"></div>
Search: <input ng-model="searchText">
<table id="searchTextResults">
<tr><th>Name</th><th>Phone</th><tr>
<tr ng-repeat="friend in friends | filter:searchText">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<tr>
</table>
<hr>
Any: <input ng-model="search.$"> <br>
Name only <input ng-model="search.name"><br>
Phone only <input ng-model="search.phone"Ã¥><br>
<table id="searchObjResults">
<tr><th>Name</th><th>Phone</th><tr>
<tr ng-repeat="friend in friends | filter:search">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<tr>
</table>
</doc:source>
<doc:scenario>
it('should search across all fields when filtering with a string', function() {
input('searchText').enter('m');
expect(repeater('#searchTextResults tr', 'friend in friends').column('friend.name')).
toEqual(['Mary', 'Mike', 'Adam']);
input('searchText').enter('76');
expect(repeater('#searchTextResults tr', 'friend in friends').column('friend.name')).
toEqual(['John', 'Julie']);
});
it('should search in specific fields when filtering with a predicate object', function() {
input('search.$').enter('i');
expect(repeater('#searchObjResults tr', 'friend in friends').column('friend.name')).
toEqual(['Mary', 'Mike', 'Julie']);
});
</doc:scenario>
</doc:example>
*/
function filterFilter() {
return function(array, expression) {
if (!(array instanceof Array)) return array;
var predicates = [];
predicates.check = function(value) {
for (var j = 0; j < predicates.length; j++) {
if(!predicates[j](value)) {
return false;
}
}
return true;
};
var search = function(obj, text){
if (text.charAt(0) === '!') {
return !search(obj, text.substr(1));
}
switch (typeof obj) {
case "boolean":
case "number":
case "string":
return ('' + obj).toLowerCase().indexOf(text) > -1;
case "object":
for ( var objKey in obj) {
if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) {
return true;
}
}
return false;
case "array":
for ( var i = 0; i < obj.length; i++) {
if (search(obj[i], text)) {
return true;
}
}
return false;
default:
return false;
}
};
switch (typeof expression) {
case "boolean":
case "number":
case "string":
expression = {$:expression};
case "object":
for (var key in expression) {
if (key == '$') {
(function() {
var text = (''+expression[key]).toLowerCase();
if (!text) return;
predicates.push(function(value) {
return search(value, text);
});
})();
} else {
(function() {
var path = key;
var text = (''+expression[key]).toLowerCase();
if (!text) return;
predicates.push(function(value) {
return search(getter(value, path), text);
});
})();
}
}
break;
case 'function':
predicates.push(expression);
break;
default:
return array;
}
var filtered = [];
for ( var j = 0; j < array.length; j++) {
var value = array[j];
if (predicates.check(value)) {
filtered.push(value);
}
}
return filtered;
}
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.currency
* @function
*
* @description
* Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default
* symbol for current locale is used.
*
* @param {number} amount Input to filter.
* @param {string=} symbol Currency symbol or identifier to be displayed.
* @returns {string} Formatted number.
*
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.amount = 1234.56;
}
</script>
<div ng-controller="Ctrl">
<input type="number" ng-model="amount"> <br>
default currency symbol ($): {{amount | currency}}<br>
custom currency identifier (USD$): {{amount | currency:"USD$"}}
</div>
</doc:source>
<doc:scenario>
it('should init with 1234.56', function() {
expect(binding('amount | currency')).toBe('$1,234.56');
expect(binding('amount | currency:"USD$"')).toBe('USD$1,234.56');
});
it('should update', function() {
input('amount').enter('-1234');
expect(binding('amount | currency')).toBe('($1,234.00)');
expect(binding('amount | currency:"USD$"')).toBe('(USD$1,234.00)');
});
</doc:scenario>
</doc:example>
*/
currencyFilter.$inject = ['$locale'];
function currencyFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(amount, currencySymbol){
if (isUndefined(currencySymbol)) currencySymbol = formats.CURRENCY_SYM;
return formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2).
replace(/\u00A4/g, currencySymbol);
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.number
* @function
*
* @description
* Formats a number as text.
*
* If the input is not a number an empty string is returned.
*
* @param {number|string} number Number to format.
* @param {(number|string)=} [fractionSize=2] Number of decimal places to round the number to.
* @returns {string} Number rounded to decimalPlaces and places a “,†after each third digit.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.val = 1234.56789;
}
</script>
<div ng-controller="Ctrl">
Enter number: <input ng-model='val'><br>
Default formatting: {{val | number}}<br>
No fractions: {{val | number:0}}<br>
Negative number: {{-val | number:4}}
</div>
</doc:source>
<doc:scenario>
it('should format numbers', function() {
expect(binding('val | number')).toBe('1,234.568');
expect(binding('val | number:0')).toBe('1,235');
expect(binding('-val | number:4')).toBe('-1,234.5679');
});
it('should update', function() {
input('val').enter('3374.333');
expect(binding('val | number')).toBe('3,374.333');
expect(binding('val | number:0')).toBe('3,374');
expect(binding('-val | number:4')).toBe('-3,374.3330');
});
</doc:scenario>
</doc:example>
*/
numberFilter.$inject = ['$locale'];
function numberFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(number, fractionSize) {
return formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,
fractionSize);
};
}
var DECIMAL_SEP = '.';
function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
if (isNaN(number) || !isFinite(number)) return '';
var isNegative = number < 0;
number = Math.abs(number);
var numStr = number + '',
formatedText = '',
parts = [];
if (numStr.indexOf('e') !== -1) {
formatedText = numStr;
} else {
var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length;
// determine fractionSize if it is not specified
if (isUndefined(fractionSize)) {
fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);
}
var pow = Math.pow(10, fractionSize);
number = Math.round(number * pow) / pow;
var fraction = ('' + number).split(DECIMAL_SEP);
var whole = fraction[0];
fraction = fraction[1] || '';
var pos = 0,
lgroup = pattern.lgSize,
group = pattern.gSize;
if (whole.length >= (lgroup + group)) {
pos = whole.length - lgroup;
for (var i = 0; i < pos; i++) {
if ((pos - i)%group === 0 && i !== 0) {
formatedText += groupSep;
}
formatedText += whole.charAt(i);
}
}
for (i = pos; i < whole.length; i++) {
if ((whole.length - i)%lgroup === 0 && i !== 0) {
formatedText += groupSep;
}
formatedText += whole.charAt(i);
}
// format fraction part.
while(fraction.length < fractionSize) {
fraction += '0';
}
if (fractionSize) formatedText += decimalSep + fraction.substr(0, fractionSize);
}
parts.push(isNegative ? pattern.negPre : pattern.posPre);
parts.push(formatedText);
parts.push(isNegative ? pattern.negSuf : pattern.posSuf);
return parts.join('');
}
function padNumber(num, digits, trim) {
var neg = '';
if (num < 0) {
neg = '-';
num = -num;
}
num = '' + num;
while(num.length < digits) num = '0' + num;
if (trim)
num = num.substr(num.length - digits);
return neg + num;
}
function dateGetter(name, size, offset, trim) {
return function(date) {
var value = date['get' + name]();
if (offset > 0 || value > -offset)
value += offset;
if (value === 0 && offset == -12 ) value = 12;
return padNumber(value, size, trim);
};
}
function dateStrGetter(name, shortForm) {
return function(date, formats) {
var value = date['get' + name]();
var get = uppercase(shortForm ? ('SHORT' + name) : name);
return formats[get][value];
};
}
function timeZoneGetter(date) {
var offset = date.getTimezoneOffset();
return padNumber(offset / 60, 2) + padNumber(Math.abs(offset % 60), 2);
}
function ampmGetter(date, formats) {
return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];
}
var DATE_FORMATS = {
yyyy: dateGetter('FullYear', 4),
yy: dateGetter('FullYear', 2, 0, true),
y: dateGetter('FullYear', 1),
MMMM: dateStrGetter('Month'),
MMM: dateStrGetter('Month', true),
MM: dateGetter('Month', 2, 1),
M: dateGetter('Month', 1, 1),
dd: dateGetter('Date', 2),
d: dateGetter('Date', 1),
HH: dateGetter('Hours', 2),
H: dateGetter('Hours', 1),
hh: dateGetter('Hours', 2, -12),
h: dateGetter('Hours', 1, -12),
mm: dateGetter('Minutes', 2),
m: dateGetter('Minutes', 1),
ss: dateGetter('Seconds', 2),
s: dateGetter('Seconds', 1),
EEEE: dateStrGetter('Day'),
EEE: dateStrGetter('Day', true),
a: ampmGetter,
Z: timeZoneGetter
};
var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,
NUMBER_STRING = /^\d+$/;
/**
* @ngdoc filter
* @name angular.module.ng.$filter.date
* @function
*
* @description
* Formats `date` to a string based on the requested `format`.
*
* `format` string can be composed of the following elements:
*
* * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
* * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
* * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
* * `'MMMM'`: Month in year (January-December)
* * `'MMM'`: Month in year (Jan-Dec)
* * `'MM'`: Month in year, padded (01-12)
* * `'M'`: Month in year (1-12)
* * `'dd'`: Day in month, padded (01-31)
* * `'d'`: Day in month (1-31)
* * `'EEEE'`: Day in Week,(Sunday-Saturday)
* * `'EEE'`: Day in Week, (Sun-Sat)
* * `'HH'`: Hour in day, padded (00-23)
* * `'H'`: Hour in day (0-23)
* * `'hh'`: Hour in am/pm, padded (01-12)
* * `'h'`: Hour in am/pm, (1-12)
* * `'mm'`: Minute in hour, padded (00-59)
* * `'m'`: Minute in hour (0-59)
* * `'ss'`: Second in minute, padded (00-59)
* * `'s'`: Second in minute (0-59)
* * `'a'`: am/pm marker
* * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-1200)
*
* `format` string can also be one of the following predefined
* {@link guide/dev_guide.i18n localizable formats}:
*
* * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale
* (e.g. Sep 3, 2010 12:05:08 pm)
* * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 pm)
* * `'fullDate'`: equivalent to `'EEEE, MMMM d,y'` for en_US locale
* (e.g. Friday, September 3, 2010)
* * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010
* * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)
* * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)
* * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 pm)
* * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 pm)
*
* `format` string can contain literal values. These need to be quoted with single quotes (e.g.
* `"h 'in the morning'"`). In order to output single quote, use two single quotes in a sequence
* (e.g. `"h o''clock"`).
*
* @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or
* number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.SSSZ and it's
* shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ).
* @param {string=} format Formatting rules (see Description). If not specified,
* `mediumDate` is used.
* @returns {string} Formatted string or the input if input is not recognized as date/millis.
*
* @example
<doc:example>
<doc:source>
<span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:
{{1288323623006 | date:'medium'}}<br>
<span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:
{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}<br>
<span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:
{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}<br>
</doc:source>
<doc:scenario>
it('should format date', function() {
expect(binding("1288323623006 | date:'medium'")).
toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/);
expect(binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).
toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} \-?\d{4}/);
expect(binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).
toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/);
});
</doc:scenario>
</doc:example>
*/
dateFilter.$inject = ['$locale'];
function dateFilter($locale) {
var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
function jsonStringToDate(string){
var match;
if (match = string.match(R_ISO8601_STR)) {
var date = new Date(0),
tzHour = 0,
tzMin = 0;
if (match[9]) {
tzHour = int(match[9] + match[10]);
tzMin = int(match[9] + match[11]);
}
date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
date.setUTCHours(int(match[4]||0) - tzHour, int(match[5]||0) - tzMin, int(match[6]||0), int(match[7]||0));
return date;
}
return string;
}
return function(date, format) {
var text = '',
parts = [],
fn, match;
format = format || 'mediumDate'
format = $locale.DATETIME_FORMATS[format] || format;
if (isString(date)) {
if (NUMBER_STRING.test(date)) {
date = int(date);
} else {
date = jsonStringToDate(date);
}
}
if (isNumber(date)) {
date = new Date(date);
}
if (!isDate(date)) {
return date;
}
while(format) {
match = DATE_FORMATS_SPLIT.exec(format);
if (match) {
parts = concat(parts, match, 1);
format = parts.pop();
} else {
parts.push(format);
format = null;
}
}
forEach(parts, function(value){
fn = DATE_FORMATS[value];
text += fn ? fn(date, $locale.DATETIME_FORMATS)
: value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
});
return text;
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.json
* @function
*
* @description
* Allows you to convert a JavaScript object into JSON string.
*
* This filter is mostly useful for debugging. When using the double curly {{value}} notation
* the binding is automatically converted to JSON.
*
* @param {*} object Any JavaScript object (including arrays and primitive types) to filter.
* @returns {string} JSON string.
*
* @css ng-monospace Always applied to the encapsulating element.
*
* @example:
<doc:example>
<doc:source>
<pre>{{ {'name':'value'} | json }}</pre>
</doc:source>
<doc:scenario>
it('should jsonify filtered objects', function() {
expect(binding("{'name':'value'}")).toMatch(/\{\n "name": ?"value"\n}/);
});
</doc:scenario>
</doc:example>
*
*/
function jsonFilter() {
return function(object) {
return toJson(object, true);
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.lowercase
* @function
* @description
* Converts string to lowercase.
* @see angular.lowercase
*/
var lowercaseFilter = valueFn(lowercase);
/**
* @ngdoc filter
* @name angular.module.ng.$filter.uppercase
* @function
* @description
* Converts string to uppercase.
* @see angular.uppercase
*/
var uppercaseFilter = valueFn(uppercase);
/**
* @ngdoc filter
* @name angular.module.ng.$filter.linky
* @function
*
* @description
* Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
* plain email address links.
*
* @param {string} text Input text.
* @returns {string} Html-linkified text.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.snippet =
'Pretty text with some links:\n'+
'http://angularjs.org/,\n'+
'mailto:us@somewhere.org,\n'+
'another@somewhere.org,\n'+
'and one more: ftp://127.0.0.1/.';
}
</script>
<div ng-controller="Ctrl">
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<td>Filter</td>
<td>Source</td>
<td>Rendered</td>
</tr>
<tr id="linky-filter">
<td>linky filter</td>
<td>
<pre><div ng-bind-html="snippet | linky"><br></div></pre>
</td>
<td>
<div ng-bind-html="snippet | linky"></div>
</td>
</tr>
<tr id="escaped-html">
<td>no filter</td>
<td><pre><div ng-bind="snippet"><br></div></pre></td>
<td><div ng-bind="snippet"></div></td>
</tr>
</table>
</doc:source>
<doc:scenario>
it('should linkify the snippet with urls', function() {
expect(using('#linky-filter').binding('snippet | linky')).
toBe('Pretty text with some links: ' +
'<a href="http://angularjs.org/">http://angularjs.org/</a>, ' +
'<a href="mailto:us@somewhere.org">us@somewhere.org</a>, ' +
'<a href="mailto:another@somewhere.org">another@somewhere.org</a>, ' +
'and one more: <a href="ftp://127.0.0.1/">ftp://127.0.0.1/</a>.');
});
it ('should not linkify snippet without the linky filter', function() {
expect(using('#escaped-html').binding('snippet')).
toBe("Pretty text with some links:\n" +
"http://angularjs.org/,\n" +
"mailto:us@somewhere.org,\n" +
"another@somewhere.org,\n" +
"and one more: ftp://127.0.0.1/.");
});
it('should update', function() {
input('snippet').enter('new http://link.');
expect(using('#linky-filter').binding('snippet | linky')).
toBe('new <a href="http://link">http://link</a>.');
expect(using('#escaped-html').binding('snippet')).toBe('new http://link.');
});
</doc:scenario>
</doc:example>
*/
function linkyFilter() {
var LINKY_URL_REGEXP = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/,
MAILTO_REGEXP = /^mailto:/;
return function(text) {
if (!text) return text;
var match;
var raw = text;
var html = [];
var writer = htmlSanitizeWriter(html);
var url;
var i;
while ((match = raw.match(LINKY_URL_REGEXP))) {
// We can not end in these as they are sometimes found at the end of the sentence
url = match[0];
// if we did not match ftp/http/mailto then assume mailto
if (match[2] == match[3]) url = 'mailto:' + url;
i = match.index;
writer.chars(raw.substr(0, i));
writer.start('a', {href:url});
writer.chars(match[0].replace(MAILTO_REGEXP, ''));
writer.end('a');
raw = raw.substring(i + match[0].length);
}
writer.chars(raw);
return html.join('');
};
};
/**
* @ngdoc function
* @name angular.module.ng.$filter.limitTo
* @function
*
* @description
* Creates a new array containing only a specified number of elements in an array. The elements
* are taken from either the beginning or the end of the source array, as specified by the
* value and sign (positive or negative) of `limit`.
*
* Note: This function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {Array} array Source array to be limited.
* @param {string|Number} limit The length of the returned array. If the `limit` number is
* positive, `limit` number of items from the beginning of the source array are copied.
* If the number is negative, `limit` number of items from the end of the source array are
* copied. The `limit` will be trimmed if it exceeds `array.length`
* @returns {Array} A new sub-array of length `limit` or less if input array had less than `limit`
* elements.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.numbers = [1,2,3,4,5,6,7,8,9];
$scope.limit = 3;
}
</script>
<div ng-controller="Ctrl">
Limit {{numbers}} to: <input type="integer" ng-model="limit">
<p>Output: {{ numbers | limitTo:limit }}</p>
</div>
</doc:source>
<doc:scenario>
it('should limit the numer array to first three items', function() {
expect(element('.doc-example-live input[ng-model=limit]').val()).toBe('3');
expect(binding('numbers | limitTo:limit')).toEqual('[1,2,3]');
});
it('should update the output when -3 is entered', function() {
input('limit').enter(-3);
expect(binding('numbers | limitTo:limit')).toEqual('[7,8,9]');
});
it('should not exceed the maximum size of input array', function() {
input('limit').enter(100);
expect(binding('numbers | limitTo:limit')).toEqual('[1,2,3,4,5,6,7,8,9]');
});
</doc:scenario>
</doc:example>
*/
function limitToFilter(){
return function(array, limit) {
if (!(array instanceof Array)) return array;
limit = int(limit);
var out = [],
i, n;
// check that array is iterable
if (!array || !(array instanceof Array))
return out;
// if abs(limit) exceeds maximum length, trim it
if (limit > array.length)
limit = array.length;
else if (limit < -array.length)
limit = -array.length;
if (limit > 0) {
i = 0;
n = limit;
} else {
i = array.length + limit;
n = array.length;
}
for (; i<n; i++) {
out.push(array[i]);
}
return out;
}
}
/**
* @ngdoc function
* @name angular.module.ng.$filter.orderBy
* @function
*
* @description
* Orders a specified `array` by the `expression` predicate.
*
* Note: this function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more informaton about Angular arrays.
*
* @param {Array} array The array to sort.
* @param {function(*)|string|Array.<(function(*)|string)>} expression A predicate to be
* used by the comparator to determine the order of elements.
*
* Can be one of:
*
* - `function`: Getter function. The result of this function will be sorted using the
* `<`, `=`, `>` operator.
* - `string`: An Angular expression which evaluates to an object to order by, such as 'name'
* to sort by a property called 'name'. Optionally prefixed with `+` or `-` to control
* ascending or descending sort order (for example, +name or -name).
* - `Array`: An array of function or string predicates. The first predicate in the array
* is used for sorting, but when two items are equivalent, the next predicate is used.
*
* @param {boolean=} reverse Reverse the order the array.
* @returns {Array} Sorted copy of the source array.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.friends =
[{name:'John', phone:'555-1212', age:10},
{name:'Mary', phone:'555-9876', age:19},
{name:'Mike', phone:'555-4321', age:21},
{name:'Adam', phone:'555-5678', age:35},
{name:'Julie', phone:'555-8765', age:29}]
$scope.predicate = '-age';
}
</script>
<div ng-controller="Ctrl">
<pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
<hr/>
[ <a href="" ng-click="predicate=''">unsorted</a> ]
<table class="friend">
<tr>
<th><a href="" ng-click="predicate = 'name'; reverse=false">Name</a>
(<a href ng-click="predicate = '-name'; reverse=false">^</a>)</th>
<th><a href="" ng-click="predicate = 'phone'; reverse=!reverse">Phone Number</a></th>
<th><a href="" ng-click="predicate = 'age'; reverse=!reverse">Age</a></th>
<tr>
<tr ng-repeat="friend in friends | orderBy:predicate:reverse">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<td>{{friend.age}}</td>
<tr>
</table>
</div>
</doc:source>
<doc:scenario>
it('should be reverse ordered by aged', function() {
expect(binding('predicate')).toBe('-age');
expect(repeater('table.friend', 'friend in friends').column('friend.age')).
toEqual(['35', '29', '21', '19', '10']);
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Adam', 'Julie', 'Mike', 'Mary', 'John']);
});
it('should reorder the table when user selects different predicate', function() {
element('.doc-example-live a:contains("Name")').click();
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Adam', 'John', 'Julie', 'Mary', 'Mike']);
expect(repeater('table.friend', 'friend in friends').column('friend.age')).
toEqual(['35', '10', '29', '19', '21']);
element('.doc-example-live a:contains("Phone")').click();
expect(repeater('table.friend', 'friend in friends').column('friend.phone')).
toEqual(['555-9876', '555-8765', '555-5678', '555-4321', '555-1212']);
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Mary', 'Julie', 'Adam', 'Mike', 'John']);
});
</doc:scenario>
</doc:example>
*/
orderByFilter.$inject = ['$parse'];
function orderByFilter($parse){
return function(array, sortPredicate, reverseOrder) {
if (!(array instanceof Array)) return array;
if (!sortPredicate) return array;
sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];
sortPredicate = map(sortPredicate, function(predicate){
var descending = false, get = predicate || identity;
if (isString(predicate)) {
if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
descending = predicate.charAt(0) == '-';
predicate = predicate.substring(1);
}
get = $parse(predicate);
}
return reverseComparator(function(a,b){
return compare(get(a),get(b));
}, descending);
});
var arrayCopy = [];
for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }
return arrayCopy.sort(reverseComparator(comparator, reverseOrder));
function comparator(o1, o2){
for ( var i = 0; i < sortPredicate.length; i++) {
var comp = sortPredicate[i](o1, o2);
if (comp !== 0) return comp;
}
return 0;
}
function reverseComparator(comp, descending) {
return toBoolean(descending)
? function(a,b){return comp(b,a);}
: comp;
}
function compare(v1, v2){
var t1 = typeof v1;
var t2 = typeof v2;
if (t1 == t2) {
if (t1 == "string") v1 = v1.toLowerCase();
if (t1 == "string") v2 = v2.toLowerCase();
if (v1 === v2) return 0;
return v1 < v2 ? -1 : 1;
} else {
return t1 < t2 ? -1 : 1;
}
}
}
}
function ngDirective(directive) {
if (isFunction(directive)) {
directive = {
link: directive
}
}
directive.restrict = directive.restrict || 'AC';
return valueFn(directive);
};
/*
* Modifies the default behavior of html A tag, so that the default action is prevented when href
* attribute is empty.
*
* The reasoning for this change is to allow easy creation of action links with ng-click without
* changing the location or causing page reloads, e.g.:
* <a href="" ng-click="model.$save()">Save</a>
*/
var htmlAnchorDirective = valueFn({
restrict: 'E',
compile: function(element, attr) {
// turn <a href ng-click="..">link</a> into a link in IE
// but only if it doesn't have name attribute, in which case it's an anchor
if (!attr.href) {
attr.$set('href', '');
}
return function(scope, element) {
element.bind('click', function(event){
// if we have no href url, then don't navigate anywhere.
if (!element.attr('href')) {
event.preventDefault();
}
});
}
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-href
* @restrict A
*
* @description
* Using <angular/> markup like {{hash}} in an href attribute makes
* the page open to a wrong URL, if the user clicks that link before
* angular has a chance to replace the {{hash}} with actual URL, the
* link will be broken and will most likely return a 404 error.
* The `ng-href` solves this problem by placing the `href` in the
* `ng-` namespace.
*
* The buggy way to write it:
* <pre>
* <a href="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* The correct way to write it:
* <pre>
* <a ng-href="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* @element A
* @param {template} ng-href any string which can contain `{{}}` markup.
*
* @example
* This example uses `link` variable inside `href` attribute:
<doc:example>
<doc:source>
<input ng-model="value" /><br />
<a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br />
<a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br />
<a id="link-3" ng-href="/{{'123'}}" ng-ext-link>link 3</a> (link, reload!)<br />
<a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br />
<a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br />
<a id="link-6" ng-href="/{{value}}" ng-ext-link>link</a> (link, change hash)
</doc:source>
<doc:scenario>
it('should execute ng-click but not reload when href without value', function() {
element('#link-1').click();
expect(input('value').val()).toEqual('1');
expect(element('#link-1').attr('href')).toBe("");
});
it('should execute ng-click but not reload when href empty string', function() {
element('#link-2').click();
expect(input('value').val()).toEqual('2');
expect(element('#link-2').attr('href')).toBe("");
});
it('should execute ng-click and change url when ng-href specified', function() {
expect(element('#link-3').attr('href')).toBe("/123");
element('#link-3').click();
expect(browser().window().path()).toEqual('/123');
});
it('should execute ng-click but not reload when href empty string and name specified', function() {
element('#link-4').click();
expect(input('value').val()).toEqual('4');
expect(element('#link-4').attr('href')).toBe("");
});
it('should execute ng-click but not reload when no href but name specified', function() {
element('#link-5').click();
expect(input('value').val()).toEqual('5');
expect(element('#link-5').attr('href')).toBe("");
});
it('should only change url when only ng-href', function() {
input('value').enter('6');
expect(element('#link-6').attr('href')).toBe("/6");
element('#link-6').click();
expect(browser().window().path()).toEqual('/6');
});
</doc:scenario>
</doc:example>
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-src
* @restrict A
*
* @description
* Using <angular/> markup like `{{hash}}` in a `src` attribute doesn't
* work right: The browser will fetch from the URL with the literal
* text `{{hash}}` until <angular/> replaces the expression inside
* `{{hash}}`. The `ng-src` attribute solves this problem by placing
* the `src` attribute in the `ng-` namespace.
*
* The buggy way to write it:
* <pre>
* <img src="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* The correct way to write it:
* <pre>
* <img ng-src="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* @element IMG
* @param {template} ng-src any string which can contain `{{}}` markup.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-disabled
* @restrict A
*
* @description
*
* The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
* <pre>
* <div ng-init="scope = { isDisabled: false }">
* <button disabled="{{scope.isDisabled}}">Disabled</button>
* </div>
* </pre>
*
* The HTML specs do not require browsers to preserve the special attributes such as disabled.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng-disabled.
*
* @example
<doc:example>
<doc:source>
Click me to toggle: <input type="checkbox" ng-model="checked"><br/>
<button ng-model="button" ng-disabled="checked">Button</button>
</doc:source>
<doc:scenario>
it('should toggle button', function() {
expect(element('.doc-example-live :button').prop('disabled')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live :button').prop('disabled')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element INPUT
* @param {string} expression Angular expression that will be evaluated.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-checked
* @restrict A
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as checked.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng-checked.
* @example
<doc:example>
<doc:source>
Check me to check both: <input type="checkbox" ng-model="master"><br/>
<input id="checkSlave" type="checkbox" ng-checked="master">
</doc:source>
<doc:scenario>
it('should check both checkBoxes', function() {
expect(element('.doc-example-live #checkSlave').prop('checked')).toBeFalsy();
input('master').check();
expect(element('.doc-example-live #checkSlave').prop('checked')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element INPUT
* @param {string} expression Angular expression that will be evaluated.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-multiple
* @restrict A
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as multiple.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng-multiple.
*
* @example
<doc:example>
<doc:source>
Check me check multiple: <input type="checkbox" ng-model="checked"><br/>
<select id="select" ng-multiple="checked">
<option>Misko</option>
<option>Igor</option>
<option>Vojta</option>
<option>Di</option>
</select>
</doc:source>
<doc:scenario>
it('should toggle multiple', function() {
expect(element('.doc-example-live #select').prop('multiple')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live #select').prop('multiple')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element SELECT
* @param {string} expression Angular expression that will be evaluated.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-readonly
* @restrict A
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as readonly.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng-readonly.
* @example
<doc:example>
<doc:source>
Check me to make text readonly: <input type="checkbox" ng-model="checked"><br/>
<input type="text" ng-readonly="checked" value="I'm Angular"/>
</doc:source>
<doc:scenario>
it('should toggle readonly attr', function() {
expect(element('.doc-example-live :text').prop('readonly')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live :text').prop('readonly')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element INPUT
* @param {string} expression Angular expression that will be evaluated.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-selected
* @restrict A
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as selected.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng-selected.
* @example
<doc:example>
<doc:source>
Check me to select: <input type="checkbox" ng-model="selected"><br/>
<select>
<option>Hello!</option>
<option id="greet" ng-selected="selected">Greetings!</option>
</select>
</doc:source>
<doc:scenario>
it('should select Greetings!', function() {
expect(element('.doc-example-live #greet').prop('selected')).toBeFalsy();
input('selected').check();
expect(element('.doc-example-live #greet').prop('selected')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element OPTION
* @param {string} expression Angular expression that will be evaluated.
*/
var ngAttributeAliasDirectives = {};
// boolean attrs are evaluated
forEach(BOOLEAN_ATTR, function(propName, attrName) {
var normalized = directiveNormalize('ng-' + attrName);
ngAttributeAliasDirectives[normalized] = function() {
return {
priority: 100,
compile: function(tpl, attr) {
return function(scope, element, attr) {
attr.$$observers[attrName] = [];
scope.$watch(attr[normalized], function(value) {
attr.$set(attrName, !!value);
});
};
}
};
};
});
// ng-src, ng-href are interpolated
forEach(['src', 'href'], function(attrName) {
var normalized = directiveNormalize('ng-' + attrName);
ngAttributeAliasDirectives[normalized] = function() {
return {
priority: 99, // it needs to run after the attributes are interpolated
compile: function(tpl, attr) {
return function(scope, element, attr) {
var value = attr[normalized];
if (value == undefined) {
// undefined value means that the directive is being interpolated
// so just register observer
attr.$$observers[attrName] = [];
attr.$observe(normalized, function(value) {
attr.$set(attrName, value);
});
} else {
// value present means that no interpolation, so copy to native attribute.
attr.$set(attrName, value);
}
};
}
};
};
});
var nullFormCtrl = {
$addControl: noop,
$removeControl: noop,
$setValidity: noop,
$setDirty: noop
}
/**
* @ngdoc object
* @name angular.module.ng.$compileProvider.directive.form.FormController
*
* @property {boolean} $pristine True if user has not interacted with the form yet.
* @property {boolean} $dirty True if user has already interacted with the form.
* @property {boolean} $valid True if all of the containg forms and controls are valid.
* @property {boolean} $invalid True if at least one containing control or form is invalid.
*
* @property {Object} $error Is an object hash, containing references to all invalid controls or
* forms, where:
*
* - keys are validation tokens (error names) — such as `REQUIRED`, `URL` or `EMAIL`),
* - values are arrays of controls or forms that are invalid with given error.
*
* @description
* `FormController` keeps track of all its controls and nested forms as well as state of them,
* such as being valid/invalid or dirty/pristine.
*
* Each {@link angular.module.ng.$compileProvider.directive.form form} directive creates an instance
* of `FormController`.
*
*/
//asks for $scope to fool the BC controller module
FormController.$inject = ['$element', '$attrs', '$scope'];
function FormController(element, attrs) {
var form = this,
parentForm = element.parent().controller('form') || nullFormCtrl,
invalidCount = 0, // used to easily determine if we are valid
errors = form.$error = {};
// init state
form.$name = attrs.name;
form.$dirty = false;
form.$pristine = true;
form.$valid = true;
form.$invalid = false;
parentForm.$addControl(form);
// Setup initial state of the control
element.addClass(PRISTINE_CLASS);
toggleValidCss(true);
// convenience method for easy toggling of classes
function toggleValidCss(isValid, validationErrorKey) {
validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
element.
removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).
addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey);
}
form.$addControl = function(control) {
if (control.$name && !form.hasOwnProperty(control.$name)) {
form[control.$name] = control;
}
};
form.$removeControl = function(control) {
if (control.$name && form[control.$name] === control) {
delete form[control.$name];
}
forEach(errors, function(queue, validationToken) {
form.$setValidity(validationToken, true, control);
});
};
form.$setValidity = function(validationToken, isValid, control) {
var queue = errors[validationToken];
if (isValid) {
if (queue) {
arrayRemove(queue, control);
if (!queue.length) {
invalidCount--;
if (!invalidCount) {
toggleValidCss(isValid);
form.$valid = true;
form.$invalid = false;
}
errors[validationToken] = false;
toggleValidCss(true, validationToken);
parentForm.$setValidity(validationToken, true, form);
}
}
} else {
if (!invalidCount) {
toggleValidCss(isValid);
}
if (queue) {
if (includes(queue, control)) return;
} else {
errors[validationToken] = queue = [];
invalidCount++;
toggleValidCss(false, validationToken);
parentForm.$setValidity(validationToken, false, form);
}
queue.push(control);
form.$valid = false;
form.$invalid = true;
}
};
form.$setDirty = function() {
element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS);
form.$dirty = true;
form.$pristine = false;
};
}
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-form
* @restrict EAC
*
* @description
* Nestable alias of {@link angular.module.ng.$compileProvider.directive.form `form`} directive. HTML
* does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
* sub-group of controls needs to be determined.
*
* @param {string=} ng-form|name Name of the form. If specified, the form controller will be published into
* related scope, under this name.
*
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.form
* @restrict E
*
* @description
* Directive that instantiates
* {@link angular.module.ng.$compileProvider.directive.form.FormController FormController}.
*
* If `name` attribute is specified, the form controller is published onto the current scope under
* this name.
*
* # Alias: {@link angular.module.ng.$compileProvider.directive.ng-form `ng-form`}
*
* In angular forms can be nested. This means that the outer form is valid when all of the child
* forms are valid as well. However browsers do not allow nesting of `<form>` elements, for this
* reason angular provides {@link angular.module.ng.$compileProvider.directive.ng-form `ng-form`} alias
* which behaves identical to `<form>` but allows form nesting.
*
*
* # CSS classes
* - `ng-valid` Is set if the form is valid.
* - `ng-invalid` Is set if the form is invalid.
* - `ng-pristine` Is set if the form is pristine.
* - `ng-dirty` Is set if the form is dirty.
*
*
* # Submitting a form and preventing default action
*
* Since the role of forms in client-side Angular applications is different than in classical
* roundtrip apps, it is desirable for the browser not to translate the form submission into a full
* page reload that sends the data to the server. Instead some javascript logic should be triggered
* to handle the form submission in application specific way.
*
* For this reason, Angular prevents the default action (form submission to the server) unless the
* `<form>` element has an `action` attribute specified.
*
* You can use one of the following two ways to specify what javascript method should be called when
* a form is submitted:
*
* - ng-submit on the form element (add link to ng-submit)
* - ng-click on the first button or input field of type submit (input[type=submit])
*
* To prevent double execution of the handler, use only one of ng-submit or ng-click. This is
* because of the following form submission rules coming from the html spec:
*
* - If a form has only one input field then hitting enter in this field triggers form submit
* (`ng-submit`)
* - if a form has has 2+ input fields and no buttons or input[type=submit] then hitting enter
* doesn't trigger submit
* - if a form has one or more input fields and one or more buttons or input[type=submit] then
* hitting enter in any of the input fields will trigger the click handler on the *first* button or
* input[type=submit] (`ng-click`) *and* a submit handler on the enclosing form (`ng-submit`)
*
* @param {string=} name Name of the form. If specified, the form controller will be published into
* related scope, under this name.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.userType = 'guest';
}
</script>
<form name="myForm" ng-controller="Ctrl">
userType: <input name="input" ng-model="userType" required>
<span class="error" ng-show="myForm.input.$error.REQUIRED">Required!</span><br>
<tt>userType = {{userType}}</tt><br>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('userType')).toEqual('guest');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('userType').enter('');
expect(binding('userType')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
var formDirectiveDir = {
name: 'form',
restrict: 'E',
controller: FormController,
compile: function() {
return {
pre: function(scope, formElement, attr, controller) {
if (!attr.action) {
formElement.bind('submit', function(event) {
event.preventDefault();
});
}
var parentFormCtrl = formElement.parent().controller('form'),
alias = attr.name || attr.ngForm;
if (alias) {
scope[alias] = controller;
}
if (parentFormCtrl) {
formElement.bind('$destroy', function() {
parentFormCtrl.$removeControl(controller);
if (alias) {
scope[alias] = undefined;
}
extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards
});
}
}
};
}
};
var formDirective = valueFn(formDirectiveDir);
var ngFormDirective = valueFn(extend(copy(formDirectiveDir), {restrict: 'EAC'}));
var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
var EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/;
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/;
var inputType = {
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.text
*
* @description
* Standard HTML text input with angular data binding.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ng-minlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ng-maxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ng-pattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng-change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.text = 'guest';
$scope.word = /^\w*$/;
}
</script>
<form name="myForm" ng-controller="Ctrl">
Single word: <input type="text" name="input" ng-model="text"
ng-pattern="word" required>
<span class="error" ng-show="myForm.input.$error.required">
Required!</span>
<span class="error" ng-show="myForm.input.$error.pattern">
Single word only!</span>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('guest');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if multi word', function() {
input('text').enter('hello world');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
'text': textInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.number
*
* @description
* Text input with number validation and transformation. Sets the `number` validation
* error if not a valid number.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} min Sets the `min` validation error key if the value entered is less then `min`.
* @param {string=} max Sets the `max` validation error key if the value entered is greater then `min`.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ng-minlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ng-maxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ng-pattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng-change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.value = 12;
}
</script>
<form name="myForm" ng-controller="Ctrl">
Number: <input type="number" name="input" ng-model="value"
min="0" max="99" required>
<span class="error" ng-show="myForm.list.$error.required">
Required!</span>
<span class="error" ng-show="myForm.list.$error.number">
Not valid number!</span>
<tt>value = {{value}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('value')).toEqual('12');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('value').enter('');
expect(binding('value')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if over max', function() {
input('value').enter('123');
expect(binding('value')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
'number': numberInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.url
*
* @description
* Text input with URL validation. Sets the `url` validation error key if the content is not a
* valid URL.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ng-minlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ng-maxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ng-pattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng-change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.text = 'http://google.com';
}
</script>
<form name="myForm" ng-controller="Ctrl">
URL: <input type="url" name="input" ng-model="text" required>
<span class="error" ng-show="myForm.input.$error.required">
Required!</span>
<span class="error" ng-show="myForm.input.$error.url">
Not valid url!</span>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
<tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('http://google.com');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if not url', function() {
input('text').enter('xxx');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
'url': urlInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.email
*
* @description
* Text input with email validation. Sets the `email` validation error key if not a valid email
* address.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ng-minlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ng-maxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ng-pattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.text = 'me@example.com';
}
</script>
<form name="myForm" ng-controller="Ctrl">
Email: <input type="email" name="input" ng-model="text" required>
<span class="error" ng-show="myForm.input.$error.required">
Required!</span>
<span class="error" ng-show="myForm.input.$error.email">
Not valid email!</span>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
<tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('me@example.com');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if not email', function() {
input('text').enter('xxx');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
'email': emailInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.radio
*
* @description
* HTML radio button.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string} value The value to which the expression should be set when selected.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} ng-change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.color = 'blue';
}
</script>
<form name="myForm" ng-controller="Ctrl">
<input type="radio" ng-model="color" value="red"> Red <br/>
<input type="radio" ng-model="color" value="green"> Green <br/>
<input type="radio" ng-model="color" value="blue"> Blue <br/>
<tt>color = {{color}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should change state', function() {
expect(binding('color')).toEqual('blue');
input('color').select('red');
expect(binding('color')).toEqual('red');
});
</doc:scenario>
</doc:example>
*/
'radio': radioInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.checkbox
*
* @description
* HTML checkbox.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} ng-true-value The value to which the expression should be set when selected.
* @param {string=} ng-false-value The value to which the expression should be set when not selected.
* @param {string=} ng-change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.value1 = true;
$scope.value2 = 'YES'
}
</script>
<form name="myForm" ng-controller="Ctrl">
Value1: <input type="checkbox" ng-model="value1"> <br/>
Value2: <input type="checkbox" ng-model="value2"
ng-true-value="YES" ng-false-value="NO"> <br/>
<tt>value1 = {{value1}}</tt><br/>
<tt>value2 = {{value2}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should change state', function() {
expect(binding('value1')).toEqual('true');
expect(binding('value2')).toEqual('YES');
input('value1').check();
input('value2').check();
expect(binding('value1')).toEqual('false');
expect(binding('value2')).toEqual('NO');
});
</doc:scenario>
</doc:example>
*/
'checkbox': checkboxInputType,
'hidden': noop,
'button': noop,
'submit': noop,
'reset': noop
};
function isEmpty(value) {
return isUndefined(value) || value === '' || value === null || value !== value;
}
function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
var listener = function() {
var value = trim(element.val());
if (ctrl.$viewValue !== value) {
scope.$apply(function() {
ctrl.$setViewValue(value);
});
}
};
// if the browser does support "input" event, we are fine
if ($sniffer.hasEvent('input')) {
element.bind('input', listener);
} else {
var timeout;
element.bind('keydown', function(event) {
var key = event.keyCode;
// ignore
// command modifiers arrows
if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;
if (!timeout) {
timeout = $browser.defer(function() {
listener();
timeout = null;
});
}
});
// if user paste into input using mouse, we need "change" event to catch it
element.bind('change', listener);
}
ctrl.$render = function() {
element.val(isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue);
};
// pattern validator
var pattern = attr.ngPattern,
patternValidator;
var validate = function(regexp, value) {
if (isEmpty(value) || regexp.test(value)) {
ctrl.$setValidity('pattern', true);
return value;
} else {
ctrl.$setValidity('pattern', false);
return undefined;
}
};
if (pattern) {
if (pattern.match(/^\/(.*)\/$/)) {
pattern = new RegExp(pattern.substr(1, pattern.length - 2));
patternValidator = function(value) {
return validate(pattern, value)
};
} else {
patternValidator = function(value) {
var patternObj = scope.$eval(pattern);
if (!patternObj || !patternObj.test) {
throw new Error('Expected ' + pattern + ' to be a RegExp but was ' + patternObj);
}
return validate(patternObj, value);
};
}
ctrl.$formatters.push(patternValidator);
ctrl.$parsers.push(patternValidator);
}
// min length validator
if (attr.ngMinlength) {
var minlength = int(attr.ngMinlength);
var minLengthValidator = function(value) {
if (!isEmpty(value) && value.length < minlength) {
ctrl.$setValidity('minlength', false);
return undefined;
} else {
ctrl.$setValidity('minlength', true);
return value;
}
};
ctrl.$parsers.push(minLengthValidator);
ctrl.$formatters.push(minLengthValidator);
}
// max length validator
if (attr.ngMaxlength) {
var maxlength = int(attr.ngMaxlength);
var maxLengthValidator = function(value) {
if (!isEmpty(value) && value.length > maxlength) {
ctrl.$setValidity('maxlength', false);
return undefined;
} else {
ctrl.$setValidity('maxlength', true);
return value;
}
};
ctrl.$parsers.push(maxLengthValidator);
ctrl.$formatters.push(maxLengthValidator);
}
};
function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
ctrl.$parsers.push(function(value) {
var empty = isEmpty(value);
if (empty || NUMBER_REGEXP.test(value)) {
ctrl.$setValidity('number', true);
return value === '' ? null : (empty ? value : parseFloat(value));
} else {
ctrl.$setValidity('number', false);
return undefined;
}
});
ctrl.$formatters.push(function(value) {
return isEmpty(value) ? '' : '' + value;
});
if (attr.min) {
var min = parseFloat(attr.min);
var minValidator = function(value) {
if (!isEmpty(value) && value < min) {
ctrl.$setValidity('min', false);
return undefined;
} else {
ctrl.$setValidity('min', true);
return value;
}
};
ctrl.$parsers.push(minValidator);
ctrl.$formatters.push(minValidator);
}
if (attr.max) {
var max = parseFloat(attr.max);
var maxValidator = function(value) {
if (!isEmpty(value) && value > max) {
ctrl.$setValidity('max', false);
return undefined;
} else {
ctrl.$setValidity('max', true);
return value;
}
};
ctrl.$parsers.push(maxValidator);
ctrl.$formatters.push(maxValidator);
}
ctrl.$formatters.push(function(value) {
if (isEmpty(value) || isNumber(value)) {
ctrl.$setValidity('number', true);
return value;
} else {
ctrl.$setValidity('number', false);
return undefined;
}
});
}
function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
var urlValidator = function(value) {
if (isEmpty(value) || URL_REGEXP.test(value)) {
ctrl.$setValidity('url', true);
return value;
} else {
ctrl.$setValidity('url', false);
return undefined;
}
};
ctrl.$formatters.push(urlValidator);
ctrl.$parsers.push(urlValidator);
}
function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
var emailValidator = function(value) {
if (isEmpty(value) || EMAIL_REGEXP.test(value)) {
ctrl.$setValidity('email', true);
return value;
} else {
ctrl.$setValidity('email', false);
return undefined;
}
};
ctrl.$formatters.push(emailValidator);
ctrl.$parsers.push(emailValidator);
}
function radioInputType(scope, element, attr, ctrl) {
// correct the name
element.attr('name', attr.id + '@' + attr.name);
element.bind('click', function() {
if (element[0].checked) {
scope.$apply(function() {
ctrl.$setViewValue(attr.value);
});
};
});
ctrl.$render = function() {
var value = attr.value;
element[0].checked = (value == ctrl.$viewValue);
};
attr.$observe('value', ctrl.$render);
}
function checkboxInputType(scope, element, attr, ctrl) {
var trueValue = attr.ngTrueValue,
falseValue = attr.ngFalseValue;
if (!isString(trueValue)) trueValue = true;
if (!isString(falseValue)) falseValue = false;
element.bind('click', function() {
scope.$apply(function() {
ctrl.$setViewValue(element[0].checked);
});
});
ctrl.$render = function() {
element[0].checked = ctrl.$viewValue;
};
ctrl.$formatters.push(function(value) {
return value === trueValue;
});
ctrl.$parsers.push(function(value) {
return value ? trueValue : falseValue;
});
}
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.textarea
*
* @description
* HTML textarea element control with angular data-binding. The data-binding and validation
* properties of this element are exactly the same as those of the
* {@link angular.module.ng.$compileProvider.directive.input input element}.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ng-minlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ng-maxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ng-pattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng-change Angular expression to be executed when input changes due to user
* interaction with the input element.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.input
* @restrict E
*
* @description
* HTML input element control with angular data-binding. Input control follows HTML5 input types
* and polyfills the HTML5 validation behavior for older browsers.
*
* @param {string} ng-model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ng-minlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ng-maxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ng-pattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng-change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.user = {name: 'guest', last: 'visitor'};
}
</script>
<div ng-controller="Ctrl">
<form name="myForm">
User name: <input type="text" name="userName" ng-model="user.name" required>
<span class="error" ng-show="myForm.userName.$error.required">
Required!</span><br>
Last name: <input type="text" name="lastName" ng-model="user.last"
ng-minlength="3" ng-maxlength="10">
<span class="error" ng-show="myForm.lastName.$error.minlength">
Too short!</span>
<span class="error" ng-show="myForm.lastName.$error.maxlength">
Too long!</span><br>
</form>
<hr>
<tt>user = {{user}}</tt><br/>
<tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br>
<tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br>
<tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br>
<tt>myForm.userName.$error = {{myForm.lastName.$error}}</tt><br>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>
<tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br>
<tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('user')).toEqual('{"name":"guest","last":"visitor"}');
expect(binding('myForm.userName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
it('should be invalid if empty when required', function() {
input('user.name').enter('');
expect(binding('user')).toEqual('{"last":"visitor"}');
expect(binding('myForm.userName.$valid')).toEqual('false');
expect(binding('myForm.$valid')).toEqual('false');
});
it('should be valid if empty when min length is set', function() {
input('user.last').enter('');
expect(binding('user')).toEqual('{"name":"guest","last":""}');
expect(binding('myForm.lastName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
it('should be invalid if less than required min length', function() {
input('user.last').enter('xx');
expect(binding('user')).toEqual('{"name":"guest"}');
expect(binding('myForm.lastName.$valid')).toEqual('false');
expect(binding('myForm.lastName.$error')).toMatch(/minlength/);
expect(binding('myForm.$valid')).toEqual('false');
});
it('should be invalid if longer than max length', function() {
input('user.last').enter('some ridiculously long name');
expect(binding('user'))
.toEqual('{"name":"guest"}');
expect(binding('myForm.lastName.$valid')).toEqual('false');
expect(binding('myForm.lastName.$error')).toMatch(/maxlength/);
expect(binding('myForm.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
var inputDirective = ['$browser', '$sniffer', function($browser, $sniffer) {
return {
restrict: 'E',
require: '?ngModel',
link: function(scope, element, attr, ctrl) {
if (ctrl) {
(inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrl, $sniffer,
$browser);
}
}
};
}];
var VALID_CLASS = 'ng-valid',
INVALID_CLASS = 'ng-invalid',
PRISTINE_CLASS = 'ng-pristine',
DIRTY_CLASS = 'ng-dirty';
/**
* @ngdoc object
* @name angular.module.ng.$compileProvider.directive.ng-model.NgModelController
*
* @property {string} $viewValue Actual string value in the view.
* @property {*} $modelValue The value in the model, that the control is bound to.
* @property {Array.<Function>} $parsers Whenever the control reads value from the DOM, it executes
* all of these functions to sanitize / convert the value as well as validate.
*
* @property {Array.<Function>} $formatters Whenever the model value changes, it executes all of
* these functions to convert the value as well as validate.
*
* @property {Object} $error An bject hash with all errors as keys.
*
* @property {boolean} $pristine True if user has not interacted with the control yet.
* @property {boolean} $dirty True if user has already interacted with the control.
* @property {boolean} $valid True if there is no error.
* @property {boolean} $invalid True if at least one error on the control.
*
* @description
*
*/
var NgModelController = ['$scope', '$exceptionHandler', '$attrs', 'ngModel', '$element',
function($scope, $exceptionHandler, $attr, ngModel, $element) {
this.$viewValue = Number.NaN;
this.$modelValue = Number.NaN;
this.$parsers = [];
this.$formatters = [];
this.$viewChangeListeners = [];
this.$pristine = true;
this.$dirty = false;
this.$valid = true;
this.$invalid = false;
this.$render = noop;
this.$name = $attr.name;
var parentForm = $element.inheritedData('$formController') || nullFormCtrl,
invalidCount = 0, // used to easily determine if we are valid
$error = this.$error = {}; // keep invalid keys here
// Setup initial state of the control
$element.addClass(PRISTINE_CLASS);
toggleValidCss(true);
// convenience method for easy toggling of classes
function toggleValidCss(isValid, validationErrorKey) {
validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
$element.
removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).
addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey);
}
/**
* @ngdoc function
* @name angular.module.ng.$compileProvider.directive.ng-model.NgModelController#$setValidity
* @methodOf angular.module.ng.$compileProvider.directive.ng-model.NgModelController
*
* @description
* Change the validity state, and notifies the form when the control changes validity. (i.e. it
* does not notify form if given validator is already marked as invalid).
*
* This method should be called by validators - i.e. the parser or formatter functions.
*
* @param {string} validationErrorKey Name of the validator. the `validationErrorKey` will assign
* to `$error[validationErrorKey]=isValid` so that it is available for data-binding.
* The `validationErrorKey` should be in camelCase and will get converted into dash-case
* for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`
* class and can be bound to as `{{someForm.someControl.$error.myError}}` .
* @param {boolean} isValid Whether the current state is valid (true) or invalid (false).
*/
this.$setValidity = function(validationErrorKey, isValid) {
if ($error[validationErrorKey] === !isValid) return;
if (isValid) {
if ($error[validationErrorKey]) invalidCount--;
if (!invalidCount) {
toggleValidCss(true);
this.$valid = true;
this.$invalid = false;
}
} else {
toggleValidCss(false)
this.$invalid = true;
this.$valid = false;
invalidCount++;
}
$error[validationErrorKey] = !isValid;
toggleValidCss(isValid, validationErrorKey);
parentForm.$setValidity(validationErrorKey, isValid, this);
};
/**
* @ngdoc function
* @name angular.module.ng.$compileProvider.directive.ng-model.NgModelController#$setViewValue
* @methodOf angular.module.ng.$compileProvider.directive.ng-model.NgModelController
*
* @description
* Read a value from view.
*
* This method should be called from within a DOM event handler.
* For example {@link angular.module.ng.$compileProvider.directive.input input} or
* {@link angular.module.ng.$compileProvider.directive.select select} directives call it.
*
* It internally calls all `formatters` and if resulted value is valid, updates the model and
* calls all registered change listeners.
*
* @param {string} value Value from the view.
*/
this.$setViewValue = function(value) {
this.$viewValue = value;
// change to dirty
if (this.$pristine) {
this.$dirty = true;
this.$pristine = false;
$element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS);
parentForm.$setDirty();
}
forEach(this.$parsers, function(fn) {
value = fn(value);
});
if (this.$modelValue !== value) {
this.$modelValue = value;
ngModel(value);
forEach(this.$viewChangeListeners, function(listener) {
try {
listener();
} catch(e) {
$exceptionHandler(e);
}
})
}
};
// model -> value
var ctrl = this;
$scope.$watch(function() {
return ngModel();
}, function(value) {
// ignore change from view
if (ctrl.$modelValue === value) return;
var formatters = ctrl.$formatters,
idx = formatters.length;
ctrl.$modelValue = value;
while(idx--) {
value = formatters[idx](value);
}
if (ctrl.$viewValue !== value) {
ctrl.$viewValue = value;
ctrl.$render();
}
});
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-model
*
* @element input
*
* @description
* Is directive that tells Angular to do two-way data binding. It works together with `input`,
* `select`, `textarea`. You can easily write your own directives to use `ng-model` as well.
*
* `ng-model` is responsible for:
*
* - binding the view into the model, which other directives such as `input`, `textarea` or `select`
* require,
* - providing validation behavior (i.e. required, number, email, url),
* - keeping state of the control (valid/invalid, dirty/pristine, validation errors),
* - setting related css class onto the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`),
* - register the control with parent {@link angular.module.ng.$compileProvider.directive.form form}.
*
* For basic examples, how to use `ng-model`, see:
*
* - {@link angular.module.ng.$compileProvider.directive.input input}
* - {@link angular.module.ng.$compileProvider.directive.input.text text}
* - {@link angular.module.ng.$compileProvider.directive.input.checkbox checkbox}
* - {@link angular.module.ng.$compileProvider.directive.input.radio radio}
* - {@link angular.module.ng.$compileProvider.directive.input.number number}
* - {@link angular.module.ng.$compileProvider.directive.input.email email}
* - {@link angular.module.ng.$compileProvider.directive.input.url url}
* - {@link angular.module.ng.$compileProvider.directive.select select}
* - {@link angular.module.ng.$compileProvider.directive.textarea textarea}
*
*/
var ngModelDirective = [function() {
return {
inject: {
ngModel: 'accessor'
},
require: ['ngModel', '^?form'],
controller: NgModelController,
link: function(scope, element, attr, ctrls) {
// notify others, especially parent forms
var modelCtrl = ctrls[0],
formCtrl = ctrls[1] || nullFormCtrl;
formCtrl.$addControl(modelCtrl);
element.bind('$destroy', function() {
formCtrl.$removeControl(modelCtrl);
});
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-change
* @restrict E
*
* @description
* Evaluate given expression when user changes the input.
* The expression is not evaluated when the value change is coming from the model.
*
* Note, this directive requires `ng-model` to be present.
*
* @element input
*
* @example
* <doc:example>
* <doc:source>
* <script>
* function Controller($scope) {
* $scope.counter = 0;
* $scope.change = function() {
* $scope.counter++;
* };
* }
* </script>
* <div ng-controller="Controller">
* <input type="checkbox" ng-model="confirmed" ng-change="change()" id="ng-change-example1" />
* <input type="checkbox" ng-model="confirmed" id="ng-change-example2" />
* <label for="ng-change-example2">Confirmed</label><br />
* debug = {{confirmed}}<br />
* counter = {{counter}}
* </div>
* </doc:source>
* <doc:scenario>
* it('should evaluate the expression if changing from view', function() {
* expect(binding('counter')).toEqual('0');
* element('#ng-change-example1').click();
* expect(binding('counter')).toEqual('1');
* expect(binding('confirmed')).toEqual('true');
* });
*
* it('should not evaluate the expression if changing from model', function() {
* element('#ng-change-example2').click();
* expect(binding('counter')).toEqual('0');
* expect(binding('confirmed')).toEqual('true');
* });
* </doc:scenario>
* </doc:example>
*/
var ngChangeDirective = valueFn({
require: 'ngModel',
link: function(scope, element, attr, ctrl) {
ctrl.$viewChangeListeners.push(function() {
scope.$eval(attr.ngChange);
});
}
});
var requiredDirective = [function() {
return {
require: '?ngModel',
link: function(scope, elm, attr, ctrl) {
if (!ctrl) return;
var validator = function(value) {
if (attr.required && (isEmpty(value) || value === false)) {
ctrl.$setValidity('required', false);
return;
} else {
ctrl.$setValidity('required', true);
return value;
}
};
ctrl.$formatters.push(validator);
ctrl.$parsers.unshift(validator);
attr.$observe('required', function() {
validator(ctrl.$viewValue);
});
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-list
*
* @description
* Text input that converts between comma-seperated string into an array of strings.
*
* @element input
* @param {string=} ng-list optional delimiter that should be used to split the value. If
* specified in form `/something/` then the value will be converted into a regular expression.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.names = ['igor', 'misko', 'vojta'];
}
</script>
<form name="myForm" ng-controller="Ctrl">
List: <input name="namesInput" ng-model="names" ng-list required>
<span class="error" ng-show="myForm.list.$error.required">
Required!</span>
<tt>names = {{names}}</tt><br/>
<tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
<tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('names')).toEqual('["igor","misko","vojta"]');
expect(binding('myForm.namesInput.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('names').enter('');
expect(binding('names')).toEqual('[]');
expect(binding('myForm.namesInput.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
var ngListDirective = function() {
return {
require: 'ngModel',
link: function(scope, element, attr, ctrl) {
var match = /\/(.*)\//.exec(attr.ngList),
separator = match && new RegExp(match[1]) || attr.ngList || ',';
var parse = function(viewValue) {
var list = [];
if (viewValue) {
forEach(viewValue.split(separator), function(value) {
if (value) list.push(trim(value));
});
}
return list;
};
ctrl.$parsers.push(parse);
ctrl.$formatters.push(function(value) {
if (isArray(value) && !equals(parse(ctrl.$viewValue), value)) {
return value.join(', ');
}
return undefined;
});
}
};
};
var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
var ngValueDirective = [function() {
return {
priority: 100,
compile: function(tpl, attr) {
if (CONSTANT_VALUE_REGEXP.test(attr.ngValue)) {
return function(scope) {
attr.$set('value', scope.$eval(attr.ngValue));
};
} else {
return function(scope, elm, attr) {
attr.$$observers.value = [];
scope.$watch(attr.ngValue, function(value) {
attr.$set('value', value, false);
});
};
}
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-bind
*
* @description
* The `ng-bind` attribute tells Angular to replace the text content of the specified HTML element
* with the value of a given expression, and to update the text content when the value of that
* expression changes.
*
* Typically, you don't use `ng-bind` directly, but instead you use the double curly markup like
* `{{ expression }}` and let the Angular compiler transform it to
* `<span ng-bind="expression"></span>` when the template is compiled.
*
* @element ANY
* @param {expression} ng-bind {@link guide/dev_guide.expressions Expression} to evaluate.
*
* @example
* Enter a name in the Live Preview text box; the greeting below the text box changes instantly.
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.name = 'Whirled';
}
</script>
<div ng-controller="Ctrl">
Enter name: <input type="text" ng-model="name"><br>
Hello <span ng-bind="name"></span>!
</div>
</doc:source>
<doc:scenario>
it('should check ng-bind', function() {
expect(using('.doc-example-live').binding('name')).toBe('Whirled');
using('.doc-example-live').input('name').enter('world');
expect(using('.doc-example-live').binding('name')).toBe('world');
});
</doc:scenario>
</doc:example>
*/
var ngBindDirective = ngDirective(function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBind);
scope.$watch(attr.ngBind, function(value) {
element.text(value == undefined ? '' : value);
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-bind-html-unsafe
*
* @description
* Creates a binding that will innerHTML the result of evaluating the `expression` into the current
* element. *The innerHTML-ed content will not be sanitized!* You should use this directive only if
* {@link angular.module.ng.$compileProvider.directive.ng-bind-html ng-bind-html} directive is too
* restrictive and when you absolutely trust the source of the content you are binding to.
*
* See {@link angular.module.ng.$sanitize $sanitize} docs for examples.
*
* @element ANY
* @param {expression} ng-bind-html-unsafe {@link guide/dev_guide.expressions Expression} to evaluate.
*/
var ngBindHtmlUnsafeDirective = ngDirective(function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBindHtmlUnsafe);
scope.$watch(attr.ngBindHtmlUnsafe, function(value) {
element.html(value == undefined ? '' : value);
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-bind-html
*
* @description
* Creates a binding that will sanitize the result of evaluating the `expression` with the
* {@link angular.module.ng.$sanitize $sanitize} service and innerHTML the result into the current
* element.
*
* See {@link angular.module.ng.$sanitize $sanitize} docs for examples.
*
* @element ANY
* @param {expression} ng-bind-html {@link guide/dev_guide.expressions Expression} to evaluate.
*/
var ngBindHtmlDirective = ['$sanitize', function($sanitize) {
return function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBindHtml);
scope.$watch(attr.ngBindHtml, function(value) {
if (value = $sanitize(value)) {
element.html(value);
}
});
}
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-bind-template
*
* @description
* The `ng-bind-template` attribute specifies that the element
* text should be replaced with the template in ng-bind-template.
* Unlike ng-bind the ng-bind-template can contain multiple `{{` `}}`
* expressions. (This is required since some HTML elements
* can not have SPAN elements such as TITLE, or OPTION to name a few.)
*
* @element ANY
* @param {string} ng-bind-template template of form
* <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.
*
* @example
* Try it here: enter text in text box and watch the greeting change.
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.salutation = 'Hello';
$scope.name = 'World';
}
</script>
<div ng-controller="Ctrl">
Salutation: <input type="text" ng-model="salutation"><br>
Name: <input type="text" ng-model="name"><br>
<pre ng-bind-template="{{salutation}} {{name}}!"></pre>
</div>
</doc:source>
<doc:scenario>
it('should check ng-bind', function() {
expect(using('.doc-example-live').binding('salutation')).
toBe('Hello');
expect(using('.doc-example-live').binding('name')).
toBe('World');
using('.doc-example-live').input('salutation').enter('Greetings');
using('.doc-example-live').input('name').enter('user');
expect(using('.doc-example-live').binding('salutation')).
toBe('Greetings');
expect(using('.doc-example-live').binding('name')).
toBe('user');
});
</doc:scenario>
</doc:example>
*/
var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
return function(scope, element, attr) {
// TODO: move this to scenario runner
var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));
element.addClass('ng-binding').data('$binding', interpolateFn);
attr.$observe('ngBindTemplate', function(value) {
element.text(value);
});
}
}];
function classDirective(name, selector) {
name = 'ngClass' + name;
return ngDirective(function(scope, element, attr) {
scope.$watch(attr[name], function(newVal, oldVal) {
if (selector === true || scope.$index % 2 === selector) {
if (oldVal && (newVal !== oldVal)) {
if (isObject(oldVal) && !isArray(oldVal))
oldVal = map(oldVal, function(v, k) { if (v) return k });
element.removeClass(isArray(oldVal) ? oldVal.join(' ') : oldVal);
}
if (isObject(newVal) && !isArray(newVal))
newVal = map(newVal, function(v, k) { if (v) return k });
if (newVal) element.addClass(isArray(newVal) ? newVal.join(' ') : newVal); }
}, true);
});
}
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-class
*
* @description
* The `ng-class` allows you to set CSS class on HTML element dynamically by databinding an
* expression that represents all classes to be added.
*
* The directive won't add duplicate classes if a particular class was already set.
*
* When the expression changes, the previously added classes are removed and only then the classes
* new classes are added.
*
* @element ANY
* @param {expression} ng-class {@link guide/dev_guide.expressions Expression} to eval. The result
* of the evaluation can be a string representing space delimited class
* names, an array, or a map of class names to boolean values.
*
* @example
<doc:example>
<doc:source>
<input type="button" value="set" ng-click="myVar='ng-invalid'">
<input type="button" value="clear" ng-click="myVar=''">
<br>
<span ng-class="myVar">Sample Text </span>
</doc:source>
<doc:scenario>
it('should check ng-class', function() {
expect(element('.doc-example-live span').prop('className')).not().
toMatch(/ng-invalid/);
using('.doc-example-live').element(':button:first').click();
expect(element('.doc-example-live span').prop('className')).
toMatch(/ng-invalid/);
using('.doc-example-live').element(':button:last').click();
expect(element('.doc-example-live span').prop('className')).not().
toMatch(/ng-invalid/);
});
</doc:scenario>
</doc:example>
*/
var ngClassDirective = classDirective('', true);
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-class-odd
*
* @description
* The `ng-class-odd` and `ng-class-even` works exactly as
* {@link angular.module.ng.$compileProvider.directive.ng-class ng-class}, except it works in conjunction with `ng-repeat` and
* takes affect only on odd (even) rows.
*
* This directive can be applied only within a scope of an
* {@link angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat}.
*
* @element ANY
* @param {expression} ng-class-odd {@link guide/dev_guide.expressions Expression} to eval. The result
* of the evaluation can be a string representing space delimited class names or an array.
*
* @example
<doc:example>
<doc:source>
<ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng-repeat="name in names">
<span ng-class-odd="'ng-format-negative'"
ng-class-even="'ng-invalid'">
{{name}}
</span>
</li>
</ol>
</doc:source>
<doc:scenario>
it('should check ng-class-odd and ng-class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/ng-format-negative/);
expect(element('.doc-example-live li:last span').prop('className')).
toMatch(/ng-invalid/);
});
</doc:scenario>
</doc:example>
*/
var ngClassOddDirective = classDirective('Odd', 0);
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-class-even
*
* @description
* The `ng-class-odd` and `ng-class-even` works exactly as
* {@link angular.module.ng.$compileProvider.directive.ng-class ng-class}, except it works in
* conjunction with `ng-repeat` and takes affect only on odd (even) rows.
*
* This directive can be applied only within a scope of an
* {@link angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat}.
*
* @element ANY
* @param {expression} ng-class-even {@link guide/dev_guide.expressions Expression} to eval. The
* result of the evaluation can be a string representing space delimited class names or an array.
*
* @example
<doc:example>
<doc:source>
<ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng-repeat="name in names">
<span ng-class-odd="'odd'" ng-class-even="'even'">
{{name}}
</span>
</li>
</ol>
</doc:source>
<doc:scenario>
it('should check ng-class-odd and ng-class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/odd/);
expect(element('.doc-example-live li:last span').prop('className')).
toMatch(/even/);
});
</doc:scenario>
</doc:example>
*/
var ngClassEvenDirective = classDirective('Even', 1);
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-cloak
*
* @description
* The `ng-cloak` directive is used to prevent the Angular html template from being briefly
* displayed by the browser in its raw (uncompiled) form while your application is loading. Use this
* directive to avoid the undesirable flicker effect caused by the html template display.
*
* The directive can be applied to the `<body>` element, but typically a fine-grained application is
* prefered in order to benefit from progressive rendering of the browser view.
*
* `ng-cloak` works in cooperation with a css rule that is embedded within `angular.js` and
* `angular.min.js` files. Following is the css rule:
*
* <pre>
* [ng\:cloak], .ng-cloak {
* display: none;
* }
* </pre>
*
* When this css rule is loaded by the browser, all html elements (including their children) that
* are tagged with the `ng-cloak` directive are hidden. When Angular comes across this directive
* during the compilation of the template it deletes the `ng-cloak` element attribute, which
* makes the compiled element visible.
*
* For the best result, `angular.js` script must be loaded in the head section of the html file;
* alternatively, the css rule (above) must be included in the external stylesheet of the
* application.
*
* Legacy browsers, like IE7, do not provide attribute selector support (added in CSS 2.1) so they
* cannot match the `[ng\:cloak]` selector. To work around this limitation, you must add the css
* class `ng-cloak` in addition to `ng-cloak` directive as shown in the example below.
*
* @element ANY
*
* @example
<doc:example>
<doc:source>
<div id="template1" ng-cloak>{{ 'hello' }}</div>
<div id="template2" ng-cloak class="ng-cloak">{{ 'hello IE7' }}</div>
</doc:source>
<doc:scenario>
it('should remove the template directive and css class', function() {
expect(element('.doc-example-live #template1').attr('ng-cloak')).
not().toBeDefined();
expect(element('.doc-example-live #template2').attr('ng-cloak')).
not().toBeDefined();
});
</doc:scenario>
</doc:example>
*
*/
var ngCloakDirective = ngDirective({
compile: function(element, attr) {
attr.$set('ngCloak', undefined);
element.removeClass('ng-cloak');
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-controller
*
* @description
* The `ng-controller` directive assigns behavior to a scope. This is a key aspect of how angular
* supports the principles behind the Model-View-Controller design pattern.
*
* MVC components in angular:
*
* * Model — The Model is data in scope properties; scopes are attached to the DOM.
* * View — The template (HTML with data bindings) is rendered into the View.
* * Controller — The `ng-controller` directive specifies a Controller class; the class has
* methods that typically express the business logic behind the application.
*
* Note that an alternative way to define controllers is via the `{@link angular.module.ng.$route}`
* service.
*
* @element ANY
* @scope
* @param {expression} ng-controller Name of a globally accessible constructor function or an
* {@link guide/dev_guide.expressions expression} that on the current scope evaluates to a
* constructor function.
*
* @example
* Here is a simple form for editing user contact information. Adding, removing, clearing, and
* greeting are methods declared on the controller (see source tab). These methods can
* easily be called from the angular markup. Notice that the scope becomes the `this` for the
* controller's instance. This allows for easy access to the view data from the controller. Also
* notice that any changes to the data are automatically reflected in the View without the need
* for a manual update.
<doc:example>
<doc:source>
<script type="text/javascript">
function SettingsController($scope) {
$scope.name = "John Smith";
$scope.contacts = [
{type:'phone', value:'408 555 1212'},
{type:'email', value:'john.smith@example.org'} ];
$scope.greet = function() {
alert(this.name);
};
$scope.addContact = function() {
this.contacts.push({type:'email', value:'yourname@example.org'});
};
$scope.removeContact = function(contactToRemove) {
var index = this.contacts.indexOf(contactToRemove);
this.contacts.splice(index, 1);
};
$scope.clearContact = function(contact) {
contact.type = 'phone';
contact.value = '';
};
}
</script>
<div ng-controller="SettingsController">
Name: <input type="text" ng-model="name"/>
[ <a href="" ng-click="greet()">greet</a> ]<br/>
Contact:
<ul>
<li ng-repeat="contact in contacts">
<select ng-model="contact.type">
<option>phone</option>
<option>email</option>
</select>
<input type="text" ng-model="contact.value"/>
[ <a href="" ng-click="clearContact(contact)">clear</a>
| <a href="" ng-click="removeContact(contact)">X</a> ]
</li>
<li>[ <a href="" ng-click="addContact()">add</a> ]</li>
</ul>
</div>
</doc:source>
<doc:scenario>
it('should check controller', function() {
expect(element('.doc-example-live div>:input').val()).toBe('John Smith');
expect(element('.doc-example-live li:nth-child(1) input').val())
.toBe('408 555 1212');
expect(element('.doc-example-live li:nth-child(2) input').val())
.toBe('john.smith@example.org');
element('.doc-example-live li:first a:contains("clear")').click();
expect(element('.doc-example-live li:first input').val()).toBe('');
element('.doc-example-live li:last a:contains("add")').click();
expect(element('.doc-example-live li:nth-child(3) input').val())
.toBe('yourname@example.org');
});
</doc:scenario>
</doc:example>
*/
var ngControllerDirective = [function() {
return {
scope: true,
controller: '@'
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-click
*
* @description
* The ng-click allows you to specify custom behavior when
* element is clicked.
*
* @element ANY
* @param {expression} ng-click {@link guide/dev_guide.expressions Expression} to evaluate upon
* click. (Event object is available as `$event`)
*
* @example
<doc:example>
<doc:source>
<button ng-click="count = count + 1" ng-init="count=0">
Increment
</button>
count: {{count}}
</doc:source>
<doc:scenario>
it('should check ng-click', function() {
expect(binding('count')).toBe('0');
element('.doc-example-live :button').click();
expect(binding('count')).toBe('1');
});
</doc:scenario>
</doc:example>
*/
/*
* A directive that allows creation of custom onclick handlers that are defined as angular
* expressions and are compiled and executed within the current scope.
*
* Events that are handled via these handler are always configured not to propagate further.
*/
var ngEventDirectives = {};
forEach(
'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave'.split(' '),
function(name) {
var directiveName = directiveNormalize('ng-' + name);
ngEventDirectives[directiveName] = ['$parse', function($parse) {
return function(scope, element, attr) {
var fn = $parse(attr[directiveName]);
element.bind(lowercase(name), function(event) {
scope.$apply(function() {
fn(scope, {$event:event});
});
});
};
}];
}
);
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-dblclick
*
* @description
* The ng-dblclick allows you to specify custom behavior on dblclick event.
*
* @element ANY
* @param {expression} ng-dblclick {@link guide/dev_guide.expressions Expression} to evaluate upon
* dblclick. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-mousedown
*
* @description
* The ng-mousedown allows you to specify custom behavior on mousedown event.
*
* @element ANY
* @param {expression} ng-mousedown {@link guide/dev_guide.expressions Expression} to evaluate upon
* mousedown. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-mouseup
*
* @description
* Specify custom behavior on mouseup event.
*
* @element ANY
* @param {expression} ng-mouseup {@link guide/dev_guide.expressions Expression} to evaluate upon
* mouseup. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-mouseover
*
* @description
* Specify custom behavior on mouseover event.
*
* @element ANY
* @param {expression} ng-mouseover {@link guide/dev_guide.expressions Expression} to evaluate upon
* mouseover. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-mouseenter
*
* @description
* Specify custom behavior on mouseenter event.
*
* @element ANY
* @param {expression} ng-mouseenter {@link guide/dev_guide.expressions Expression} to evaluate upon
* mouseenter. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-mouseleave
*
* @description
* Specify custom behavior on mouseleave event.
*
* @element ANY
* @param {expression} ng-mouseleave {@link guide/dev_guide.expressions Expression} to evaluate upon
* mouseleave. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-mousemove
*
* @description
* Specify custom behavior on mousemove event.
*
* @element ANY
* @param {expression} ng-mousemove {@link guide/dev_guide.expressions Expression} to evaluate upon
* mousemove. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ng-click ng-click}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-submit
*
* @description
* Enables binding angular expressions to onsubmit events.
*
* Additionally it prevents the default action (which for form means sending the request to the
* server and reloading the current page).
*
* @element form
* @param {expression} ng-submit {@link guide/dev_guide.expressions Expression} to eval.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.list = [];
$scope.text = 'hello';
$scope.submit = function() {
if (this.text) {
this.list.push(this.text);
this.text = '';
}
};
}
</script>
<form ng-submit="submit()" ng-controller="Ctrl">
Enter text and hit enter:
<input type="text" ng-model="text" name="text" />
<input type="submit" id="submit" value="Submit" />
<pre>list={{list}}</pre>
</form>
</doc:source>
<doc:scenario>
it('should check ng-submit', function() {
expect(binding('list')).toBe('[]');
element('.doc-example-live #submit').click();
expect(binding('list')).toBe('["hello"]');
expect(input('text').val()).toBe('');
});
it('should ignore empty strings', function() {
expect(binding('list')).toBe('[]');
element('.doc-example-live #submit').click();
element('.doc-example-live #submit').click();
expect(binding('list')).toBe('["hello"]');
});
</doc:scenario>
</doc:example>
*/
var ngSubmitDirective = ngDirective(function(scope, element, attrs) {
element.bind('submit', function() {
scope.$apply(attrs.ngSubmit);
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-include
* @restrict ECA
*
* @description
* Fetches, compiles and includes an external HTML fragment.
*
* Keep in mind that Same Origin Policy applies to included resources
* (e.g. ng-include won't work for file:// access).
*
* @scope
*
* @param {string} ng-include|src angular expression evaluating to URL. If the source is a string constant,
* make sure you wrap it in quotes, e.g. `src="'myPartialTemplate.html'"`.
* @param {string=} onload Expression to evaluate when a new partial is loaded.
*
* @param {string=} autoscroll Whether `ng-include` should call {@link angular.module.ng.$anchorScroll
* $anchorScroll} to scroll the viewport after the content is loaded.
*
* - If the attribute is not set, disable scrolling.
* - If the attribute is set without value, enable scrolling.
* - Otherwise enable scrolling only if the expression evaluates to truthy value.
*
* @example
<doc:example>
<doc:source jsfiddle="false">
<script>
function Ctrl($scope) {
$scope.templates =
[ { name: 'template1.html', url: 'examples/ng-include/template1.html'}
, { name: 'template2.html', url: 'examples/ng-include/template2.html'} ];
$scope.template = $scope.templates[0];
}
</script>
<div ng-controller="Ctrl">
<select ng-model="template" ng-options="t.name for t in templates">
<option value="">(blank)</option>
</select>
url of the template: <tt><a href="{{template.url}}">{{template.url}}</a></tt>
<hr/>
<div ng-include src="template.url"></div>
</div>
</doc:source>
<doc:scenario>
it('should load template1.html', function() {
expect(element('.doc-example-live [ng-include]').text()).
toBe('Content of template1.html\n');
});
it('should load template2.html', function() {
select('template').option('1');
expect(element('.doc-example-live [ng-include]').text()).
toBe('Content of template2.html\n');
});
it('should change to blank', function() {
select('template').option('');
expect(element('.doc-example-live [ng-include]').text()).toEqual('');
});
</doc:scenario>
</doc:example>
*/
/**
* @ngdoc event
* @name angular.module.ng.$compileProvider.directive.ng-include#$includeContentLoaded
* @eventOf angular.module.ng.$compileProvider.directive.ng-include
* @eventType emit on the current ng-include scope
* @description
* Emitted every time the ng-include content is reloaded.
*/
var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile',
function($http, $templateCache, $anchorScroll, $compile) {
return {
restrict: 'ECA',
terminal: true,
compile: function(element, attr) {
var srcExp = attr.ngInclude || attr.src,
onloadExp = attr.onload || '',
autoScrollExp = attr.autoscroll;
return function(scope, element, attr) {
var changeCounter = 0,
childScope;
var clearContent = function() {
if (childScope) {
childScope.$destroy();
childScope = null;
}
element.html('');
};
scope.$watch(srcExp, function(src) {
var thisChangeId = ++changeCounter;
if (src) {
$http.get(src, {cache: $templateCache}).success(function(response) {
if (thisChangeId !== changeCounter) return;
if (childScope) childScope.$destroy();
childScope = scope.$new();
element.html(response);
$compile(element.contents())(childScope);
if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
$anchorScroll();
}
childScope.$emit('$includeContentLoaded');
scope.$eval(onloadExp);
}).error(function() {
if (thisChangeId === changeCounter) clearContent();
});
} else clearContent();
});
};
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-init
*
* @description
* The `ng-init` attribute specifies initialization tasks to be executed
* before the template enters execution mode during bootstrap.
*
* @element ANY
* @param {expression} ng-init {@link guide/dev_guide.expressions Expression} to eval.
*
* @example
<doc:example>
<doc:source>
<div ng-init="greeting='Hello'; person='World'">
{{greeting}} {{person}}!
</div>
</doc:source>
<doc:scenario>
it('should check greeting', function() {
expect(binding('greeting')).toBe('Hello');
expect(binding('person')).toBe('World');
});
</doc:scenario>
</doc:example>
*/
var ngInitDirective = ngDirective({
compile: function() {
return {
pre: function(scope, element, attrs) {
scope.$eval(attrs.ngInit);
}
}
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-non-bindable
* @priority 1000
*
* @description
* Sometimes it is necessary to write code which looks like bindings but which should be left alone
* by angular. Use `ng-non-bindable` to make angular ignore a chunk of HTML.
*
* @element ANY
*
* @example
* In this example there are two location where a simple binding (`{{}}`) is present, but the one
* wrapped in `ng-non-bindable` is left alone.
*
* @example
<doc:example>
<doc:source>
<div>Normal: {{1 + 2}}</div>
<div ng-non-bindable>Ignored: {{1 + 2}}</div>
</doc:source>
<doc:scenario>
it('should check ng-non-bindable', function() {
expect(using('.doc-example-live').binding('1 + 2')).toBe('3');
expect(using('.doc-example-live').element('div:last').text()).
toMatch(/1 \+ 2/);
});
</doc:scenario>
</doc:example>
*/
var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-pluralize
* @restrict EA
*
* @description
* # Overview
* ng-pluralize is a directive that displays messages according to en-US localization rules.
* These rules are bundled with angular.js and the rules can be overridden
* (see {@link guide/dev_guide.i18n Angular i18n} dev guide). You configure ng-pluralize by
* specifying the mappings between
* {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
* plural categories} and the strings to be displayed.
*
* # Plural categories and explicit number rules
* There are two
* {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
* plural categories} in Angular's default en-US locale: "one" and "other".
*
* While a pural category may match many numbers (for example, in en-US locale, "other" can match
* any number that is not 1), an explicit number rule can only match one number. For example, the
* explicit number rule for "3" matches the number 3. You will see the use of plural categories
* and explicit number rules throughout later parts of this documentation.
*
* # Configuring ng-pluralize
* You configure ng-pluralize by providing 2 attributes: `count` and `when`.
* You can also provide an optional attribute, `offset`.
*
* The value of the `count` attribute can be either a string or an {@link guide/dev_guide.expressions
* Angular expression}; these are evaluated on the current scope for its binded value.
*
* The `when` attribute specifies the mappings between plural categories and the actual
* string to be displayed. The value of the attribute should be a JSON object so that Angular
* can interpret it correctly.
*
* The following example shows how to configure ng-pluralize:
*
* <pre>
* <ng-pluralize count="personCount"
when="{'0': 'Nobody is viewing.',
* 'one': '1 person is viewing.',
* 'other': '{} people are viewing.'}">
* </ng-pluralize>
*</pre>
*
* In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not
* specify this rule, 0 would be matched to the "other" category and "0 people are viewing"
* would be shown instead of "Nobody is viewing". You can specify an explicit number rule for
* other numbers, for example 12, so that instead of showing "12 people are viewing", you can
* show "a dozen people are viewing".
*
* You can use a set of closed braces(`{}`) as a placeholder for the number that you want substituted
* into pluralized strings. In the previous example, Angular will replace `{}` with
* <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder
* for <span ng-non-bindable>{{numberExpression}}</span>.
*
* # Configuring ng-pluralize with offset
* The `offset` attribute allows further customization of pluralized text, which can result in
* a better user experience. For example, instead of the message "4 people are viewing this document",
* you might display "John, Kate and 2 others are viewing this document".
* The offset attribute allows you to offset a number by any desired value.
* Let's take a look at an example:
*
* <pre>
* <ng-pluralize count="personCount" offset=2
* when="{'0': 'Nobody is viewing.',
* '1': '{{person1}} is viewing.',
* '2': '{{person1}} and {{person2}} are viewing.',
* 'one': '{{person1}}, {{person2}} and one other person are viewing.',
* 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
* </ng-pluralize>
* </pre>
*
* Notice that we are still using two plural categories(one, other), but we added
* three explicit number rules 0, 1 and 2.
* When one person, perhaps John, views the document, "John is viewing" will be shown.
* When three people view the document, no explicit number rule is found, so
* an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.
* In this case, plural category 'one' is matched and "John, Marry and one other person are viewing"
* is shown.
*
* Note that when you specify offsets, you must provide explicit number rules for
* numbers from 0 up to and including the offset. If you use an offset of 3, for example,
* you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for
* plural categories "one" and "other".
*
* @param {string|expression} count The variable to be bounded to.
* @param {string} when The mapping between plural category to its correspoding strings.
* @param {number=} offset Offset to deduct from the total number.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.person1 = 'Igor';
$scope.person2 = 'Misko';
$scope.personCount = 1;
}
</script>
<div ng-controller="Ctrl">
Person 1:<input type="text" ng-model="person1" value="Igor" /><br/>
Person 2:<input type="text" ng-model="person2" value="Misko" /><br/>
Number of People:<input type="text" ng-model="personCount" value="1" /><br/>
<!--- Example with simple pluralization rules for en locale --->
Without Offset:
<ng-pluralize count="personCount"
when="{'0': 'Nobody is viewing.',
'one': '1 person is viewing.',
'other': '{} people are viewing.'}">
</ng-pluralize><br>
<!--- Example with offset --->
With Offset(2):
<ng-pluralize count="personCount" offset=2
when="{'0': 'Nobody is viewing.',
'1': '{{person1}} is viewing.',
'2': '{{person1}} and {{person2}} are viewing.',
'one': '{{person1}}, {{person2}} and one other person are viewing.',
'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
</ng-pluralize>
</div>
</doc:source>
<doc:scenario>
it('should show correct pluralized string', function() {
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('1 person is viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor is viewing.');
using('.doc-example-live').input('personCount').enter('0');
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('Nobody is viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Nobody is viewing.');
using('.doc-example-live').input('personCount').enter('2');
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('2 people are viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor and Misko are viewing.');
using('.doc-example-live').input('personCount').enter('3');
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('3 people are viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor, Misko and one other person are viewing.');
using('.doc-example-live').input('personCount').enter('4');
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('4 people are viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor, Misko and 2 other people are viewing.');
});
it('should show data-binded names', function() {
using('.doc-example-live').input('personCount').enter('4');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor, Misko and 2 other people are viewing.');
using('.doc-example-live').input('person1').enter('Di');
using('.doc-example-live').input('person2').enter('Vojta');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Di, Vojta and 2 other people are viewing.');
});
</doc:scenario>
</doc:example>
*/
var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) {
var BRACE = /{}/g;
return {
restrict: 'EA',
link: function(scope, element, attr) {
var numberExp = attr.count,
whenExp = element.attr(attr.$attr.when), // this is because we have {{}} in attrs
offset = attr.offset || 0,
whens = scope.$eval(whenExp),
whensExpFns = {};
forEach(whens, function(expression, key) {
whensExpFns[key] =
$interpolate(expression.replace(BRACE, '{{' + numberExp + '-' + offset + '}}'));
});
scope.$watch(function() {
var value = parseFloat(scope.$eval(numberExp));
if (!isNaN(value)) {
//if explicit number rule such as 1, 2, 3... is defined, just use it. Otherwise,
//check it against pluralization rules in $locale service
if (!whens[value]) value = $locale.pluralCat(value - offset);
return whensExpFns[value](scope, element, true);
} else {
return '';
}
}, function(newVal) {
element.text(newVal);
});
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-repeat
*
* @description
* The `ng-repeat` directive instantiates a template once per item from a collection. Each template
* instance gets its own scope, where the given loop variable is set to the current collection item,
* and `$index` is set to the item index or key.
*
* Special properties are exposed on the local scope of each template instance, including:
*
* * `$index` – `{number}` – iterator offset of the repeated element (0..length-1)
* * `$position` – `{string}` – position of the repeated element in the iterator. One of:
* * `'first'`,
* * `'middle'`
* * `'last'`
*
*
* @element ANY
* @scope
* @priority 1000
* @param {repeat_expression} ng-repeat The expression indicating how to enumerate a collection. Two
* formats are currently supported:
*
* * `variable in expression` – where variable is the user defined loop variable and `expression`
* is a scope expression giving the collection to enumerate.
*
* For example: `track in cd.tracks`.
*
* * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,
* and `expression` is the scope expression giving the collection to enumerate.
*
* For example: `(name, age) in {'adam':10, 'amalie':12}`.
*
* @example
* This example initializes the scope to a list of names and
* then uses `ng-repeat` to display every person:
<doc:example>
<doc:source>
<div ng-init="friends = [{name:'John', age:25}, {name:'Mary', age:28}]">
I have {{friends.length}} friends. They are:
<ul>
<li ng-repeat="friend in friends">
[{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
</li>
</ul>
</div>
</doc:source>
<doc:scenario>
it('should check ng-repeat', function() {
var r = using('.doc-example-live').repeater('ul li');
expect(r.count()).toBe(2);
expect(r.row(0)).toEqual(["1","John","25"]);
expect(r.row(1)).toEqual(["2","Mary","28"]);
});
</doc:scenario>
</doc:example>
*/
var ngRepeatDirective = ngDirective({
transclude: 'element',
priority: 1000,
terminal: true,
compile: function(element, attr, linker) {
return function(scope, iterStartElement, attr){
var expression = attr.ngRepeat;
var match = expression.match(/^\s*(.+)\s+in\s+(.*)\s*$/),
lhs, rhs, valueIdent, keyIdent;
if (! match) {
throw Error("Expected ng-repeat in form of '_item_ in _collection_' but got '" +
expression + "'.");
}
lhs = match[1];
rhs = match[2];
match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);
if (!match) {
throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '" +
lhs + "'.");
}
valueIdent = match[3] || match[1];
keyIdent = match[2];
// Store a list of elements from previous run. This is a hash where key is the item from the
// iterator, and the value is an array of objects with following properties.
// - scope: bound scope
// - element: previous element.
// - index: position
// We need an array of these objects since the same object can be returned from the iterator.
// We expect this to be a rare case.
var lastOrder = new HashQueueMap();
scope.$watch(function(scope){
var index, length,
collection = scope.$eval(rhs),
collectionLength = size(collection, true),
childScope,
// Same as lastOrder but it has the current state. It will become the
// lastOrder on the next iteration.
nextOrder = new HashQueueMap(),
key, value, // key/value of iteration
array, last, // last object information {scope, element, index}
cursor = iterStartElement; // current position of the node
if (!isArray(collection)) {
// if object, extract keys, sort them and use to determine order of iteration over obj props
array = [];
for(key in collection) {
if (collection.hasOwnProperty(key) && key.charAt(0) != '$') {
array.push(key);
}
}
array.sort();
} else {
array = collection || [];
}
// we are not using forEach for perf reasons (trying to avoid #call)
for (index = 0, length = array.length; index < length; index++) {
key = (collection === array) ? index : array[index];
value = collection[key];
last = lastOrder.shift(value);
if (last) {
// if we have already seen this object, then we need to reuse the
// associated scope/element
childScope = last.scope;
nextOrder.push(value, last);
if (index === last.index) {
// do nothing
cursor = last.element;
} else {
// existing item which got moved
last.index = index;
// This may be a noop, if the element is next, but I don't know of a good way to
// figure this out, since it would require extra DOM access, so let's just hope that
// the browsers realizes that it is noop, and treats it as such.
cursor.after(last.element);
cursor = last.element;
}
} else {
// new item which we don't know about
childScope = scope.$new();
}
childScope[valueIdent] = value;
if (keyIdent) childScope[keyIdent] = key;
childScope.$index = index;
childScope.$position = index === 0 ?
'first' :
(index == collectionLength - 1 ? 'last' : 'middle');
if (!last) {
linker(childScope, function(clone){
cursor.after(clone);
last = {
scope: childScope,
element: (cursor = clone),
index: index
};
nextOrder.push(value, last);
});
}
}
//shrink children
for (key in lastOrder) {
if (lastOrder.hasOwnProperty(key)) {
array = lastOrder[key];
while(array.length) {
value = array.pop();
value.element.remove();
value.scope.$destroy();
}
}
}
lastOrder = nextOrder;
});
};
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-show
*
* @description
* The `ng-show` and `ng-hide` directives show or hide a portion of the DOM tree (HTML)
* conditionally.
*
* @element ANY
* @param {expression} ng-show If the {@link guide/dev_guide.expressions expression} is truthy
* then the element is shown or hidden respectively.
*
* @example
<doc:example>
<doc:source>
Click me: <input type="checkbox" ng-model="checked"><br/>
Show: <span ng-show="checked">I show up when your checkbox is checked.</span> <br/>
Hide: <span ng-hide="checked">I hide when your checkbox is checked.</span>
</doc:source>
<doc:scenario>
it('should check ng-show / ng-hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
input('checked').check();
expect(element('.doc-example-live span:first:visible').count()).toEqual(1);
expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);
});
</doc:scenario>
</doc:example>
*/
//TODO(misko): refactor to remove element from the DOM
var ngShowDirective = ngDirective(function(scope, element, attr){
scope.$watch(attr.ngShow, function(value){
element.css('display', toBoolean(value) ? '' : 'none');
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-hide
*
* @description
* The `ng-hide` and `ng-show` directives hide or show a portion
* of the HTML conditionally.
*
* @element ANY
* @param {expression} ng-hide If the {@link guide/dev_guide.expressions expression} truthy then
* the element is shown or hidden respectively.
*
* @example
<doc:example>
<doc:source>
Click me: <input type="checkbox" ng-model="checked"><br/>
Show: <span ng-show="checked">I show up when you checkbox is checked?</span> <br/>
Hide: <span ng-hide="checked">I hide when you checkbox is checked?</span>
</doc:source>
<doc:scenario>
it('should check ng-show / ng-hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
input('checked').check();
expect(element('.doc-example-live span:first:visible').count()).toEqual(1);
expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);
});
</doc:scenario>
</doc:example>
*/
//TODO(misko): refactor to remove element from the DOM
var ngHideDirective = ngDirective(function(scope, element, attr){
scope.$watch(attr.ngHide, function(value){
element.css('display', toBoolean(value) ? 'none' : '');
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-style
*
* @description
* The ng-style allows you to set CSS style on an HTML element conditionally.
*
* @element ANY
* @param {expression} ng-style {@link guide/dev_guide.expressions Expression} which evals to an
* object whose keys are CSS style names and values are corresponding values for those CSS
* keys.
*
* @example
<doc:example>
<doc:source>
<input type="button" value="set" ng-click="myStyle={color:'red'}">
<input type="button" value="clear" ng-click="myStyle={}">
<br/>
<span ng-style="myStyle">Sample Text</span>
<pre>myStyle={{myStyle}}</pre>
</doc:source>
<doc:scenario>
it('should check ng-style', function() {
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
element('.doc-example-live :button[value=set]').click();
expect(element('.doc-example-live span').css('color')).toBe('rgb(255, 0, 0)');
element('.doc-example-live :button[value=clear]').click();
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
});
</doc:scenario>
</doc:example>
*/
var ngStyleDirective = ngDirective(function(scope, element, attr) {
scope.$watch(attr.ngStyle, function(newStyles, oldStyles) {
if (oldStyles && (newStyles !== oldStyles)) {
forEach(oldStyles, function(val, style) { element.css(style, '');});
}
if (newStyles) element.css(newStyles);
}, true);
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-switch
* @restrict EA
*
* @description
* Conditionally change the DOM structure.
*
* @usageContent
* <any ng-switch-when="matchValue1">...</any>
* <any ng-switch-when="matchValue2">...</any>
* ...
* <any ng-switch-default>...</any>
*
* @scope
* @param {*} ng-switch|on expression to match against <tt>ng-switch-when</tt>.
* @paramDescription
* On child elments add:
*
* * `ng-switch-when`: the case statement to match against. If match then this
* case will be displayed.
* * `ng-switch-default`: the default case when no other casses match.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.items = ['settings', 'home', 'other'];
$scope.selection = $scope.items[0];
}
</script>
<div ng-controller="Ctrl">
<select ng-model="selection" ng-options="item for item in items">
</select>
<tt>selection={{selection}}</tt>
<hr/>
<div ng-switch on="selection" >
<div ng-switch-when="settings">Settings Div</div>
<span ng-switch-when="home">Home Span</span>
<span ng-switch-default>default</span>
</div>
</div>
</doc:source>
<doc:scenario>
it('should start in settings', function() {
expect(element('.doc-example-live [ng-switch]').text()).toMatch(/Settings Div/);
});
it('should change to home', function() {
select('selection').option('home');
expect(element('.doc-example-live [ng-switch]').text()).toMatch(/Home Span/);
});
it('should select deafault', function() {
select('selection').option('other');
expect(element('.doc-example-live [ng-switch]').text()).toMatch(/default/);
});
</doc:scenario>
</doc:example>
*/
var NG_SWITCH = 'ng-switch';
var ngSwitchDirective = valueFn({
restrict: 'EA',
compile: function(element, attr) {
var watchExpr = attr.ngSwitch || attr.on,
cases = {};
element.data(NG_SWITCH, cases);
return function(scope, element){
var selectedTransclude,
selectedElement,
selectedScope;
scope.$watch(watchExpr, function(value) {
if (selectedElement) {
selectedScope.$destroy();
selectedElement.remove();
selectedElement = selectedScope = null;
}
if ((selectedTransclude = cases['!' + value] || cases['?'])) {
scope.$eval(attr.change);
selectedScope = scope.$new();
selectedTransclude(selectedScope, function(caseElement) {
selectedElement = caseElement;
element.append(caseElement);
});
}
});
};
}
});
var ngSwitchWhenDirective = ngDirective({
transclude: 'element',
priority: 500,
compile: function(element, attrs, transclude) {
var cases = element.inheritedData(NG_SWITCH);
assertArg(cases);
cases['!' + attrs.ngSwitchWhen] = transclude;
}
});
var ngSwitchDefaultDirective = ngDirective({
transclude: 'element',
priority: 500,
compile: function(element, attrs, transclude) {
var cases = element.inheritedData(NG_SWITCH);
assertArg(cases);
cases['?'] = transclude;
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-transclude
*
* @description
* Insert the transcluded DOM here.
*
* @element ANY
*
* @example
<doc:example module="transclude">
<doc:source>
<script>
function Ctrl($scope) {
$scope.title = 'Lorem Ipsum';
$scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';
}
angular.module('transclude', [])
.directive('pane', function(){
return {
restrict: 'E',
transclude: true,
scope: 'isolate',
locals: { title:'bind' },
template: '<div style="border: 1px solid black;">' +
'<div style="background-color: gray">{{title}}</div>' +
'<div ng-transclude></div>' +
'</div>'
};
});
</script>
<div ng-controller="Ctrl">
<input ng-model="title"><br>
<textarea ng-model="text"></textarea> <br/>
<pane title="{{title}}">{{text}}</pane>
</div>
</doc:source>
<doc:scenario>
it('should have transcluded', function() {
input('title').enter('TITLE');
input('text').enter('TEXT');
expect(binding('title')).toEqual('TITLE');
expect(binding('text')).toEqual('TEXT');
});
</doc:scenario>
</doc:example>
*
*/
var ngTranscludeDirective = ngDirective({
controller: ['$transclude', '$element', function($transclude, $element) {
$transclude(function(clone) {
$element.append(clone);
});
}]
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ng-view
* @restrict ECA
*
* @description
* # Overview
* `ng-view` is a directive that complements the {@link angular.module.ng.$route $route} service by
* including the rendered template of the current route into the main layout (`index.html`) file.
* Every time the current route changes, the included view changes with it according to the
* configuration of the `$route` service.
*
* @scope
* @example
<doc:example module="ngView">
<doc:source>
<script type="text/ng-template" id="examples/book.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
</script>
<script type="text/ng-template" id="examples/chapter.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
Chapter Id: {{params.chapterId}}
</script>
<script>
angular.module('ngView', [], function($routeProvider, $locationProvider) {
$routeProvider.when('/Book/:bookId', {
template: 'examples/book.html',
controller: BookCntl
});
$routeProvider.when('/Book/:bookId/ch/:chapterId', {
template: 'examples/chapter.html',
controller: ChapterCntl
});
// configure html5 to get links working on jsfiddle
$locationProvider.html5Mode(true);
});
function MainCntl($scope, $route, $routeParams, $location) {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
}
function BookCntl($scope, $routeParams) {
$scope.name = "BookCntl";
$scope.params = $routeParams;
}
function ChapterCntl($scope, $routeParams) {
$scope.name = "ChapterCntl";
$scope.params = $routeParams;
}
</script>
<div ng-controller="MainCntl">
Choose:
<a href="/Book/Moby">Moby</a> |
<a href="/Book/Moby/ch/1">Moby: Ch1</a> |
<a href="/Book/Gatsby">Gatsby</a> |
<a href="/Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
<a href="/Book/Scarlet">Scarlet Letter</a><br/>
<div ng-view></div>
<hr />
<pre>$location.path() = {{$location.path()}}</pre>
<pre>$route.current.template = {{$route.current.template}}</pre>
<pre>$route.current.params = {{$route.current.params}}</pre>
<pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
<pre>$routeParams = {{$routeParams}}</pre>
</div>
</doc:source>
<doc:scenario>
it('should load and compile correct template', function() {
element('a:contains("Moby: Ch1")').click();
var content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: ChapterCntl/);
expect(content).toMatch(/Book Id\: Moby/);
expect(content).toMatch(/Chapter Id\: 1/);
element('a:contains("Scarlet")').click();
content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: BookCntl/);
expect(content).toMatch(/Book Id\: Scarlet/);
});
</doc:scenario>
</doc:example>
*/
/**
* @ngdoc event
* @name angular.module.ng.$compileProvider.directive.ng-view#$viewContentLoaded
* @eventOf angular.module.ng.$compileProvider.directive.ng-view
* @eventType emit on the current ng-view scope
* @description
* Emitted every time the ng-view content is reloaded.
*/
var ngViewDirective = ['$http', '$templateCache', '$route', '$anchorScroll', '$compile',
'$controller',
function($http, $templateCache, $route, $anchorScroll, $compile,
$controller) {
return {
restrict: 'ECA',
terminal: true,
link: function(scope, element, attr) {
var changeCounter = 0,
lastScope,
onloadExp = attr.onload || '';
scope.$on('$afterRouteChange', update);
update();
function destroyLastScope() {
if (lastScope) {
lastScope.$destroy();
lastScope = null;
}
}
function update() {
var template = $route.current && $route.current.template,
thisChangeId = ++changeCounter;
function clearContent() {
// ignore callback if another route change occured since
if (thisChangeId === changeCounter) {
element.html('');
destroyLastScope();
}
}
if (template) {
$http.get(template, {cache: $templateCache}).success(function(response) {
// ignore callback if another route change occured since
if (thisChangeId === changeCounter) {
element.html(response);
destroyLastScope();
var link = $compile(element.contents()),
current = $route.current,
controller;
lastScope = current.scope = scope.$new();
if (current.controller) {
controller = $controller(current.controller, {$scope: lastScope});
element.contents().data('$ngControllerController', controller);
}
link(lastScope);
lastScope.$emit('$viewContentLoaded');
lastScope.$eval(onloadExp);
// $anchorScroll might listen on event...
$anchorScroll();
}
}).error(clearContent);
} else {
clearContent();
}
}
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.script
*
* @description
* Load content of a script tag, with type `text/ng-template`, into `$templateCache`, so that the
* template can be used by `ng-include`, `ng-view` or directive templates.
*
* @restrict E
* @param {'text/ng-template'} type must be set to `'text/ng-template'`
*
* @example
<doc:example>
<doc:source>
<script type="text/ng-template" id="/tpl.html">
Content of the template.
</script>
<a ng-click="currentTpl='/tpl.html'" id="tpl-link">Load inlined template</a>
<div id="tpl-content" ng-include src="currentTpl"></div>
</doc:source>
<doc:scenario>
it('should load template defined inside script tag', function() {
element('#tpl-link').click();
expect(element('#tpl-content').text()).toMatch(/Content of the template/);
});
</doc:scenario>
</doc:example>
*/
var scriptDirective = ['$templateCache', function($templateCache) {
return {
restrict: 'E',
terminal: true,
compile: function(element, attr) {
if (attr.type == 'text/ng-template') {
var templateUrl = attr.id;
$templateCache.put(templateUrl, element.text());
}
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.select
* @restrict E
*
* @description
* HTML `SELECT` element with angular data-binding.
*
* # `ng-options`
*
* Optionally `ng-options` attribute can be used to dynamically generate a list of `<option>`
* elements for a `<select>` element using an array or an object obtained by evaluating the
* `ng-options` expression.
*ËË
* When an item in the select menu is select, the value of array element or object property
* represented by the selected option will be bound to the model identified by the `ng-model` attribute
* of the parent select element.
*
* Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
* be nested into the `<select>` element. This element will then represent `null` or "not selected"
* option. See example below for demonstration.
*
* Note: `ng-options` provides iterator facility for `<option>` element which must be used instead
* of {@link angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat}. `ng-repeat` is not suitable for use with
* `<option>` element because of the following reasons:
*
* * value attribute of the option element that we need to bind to requires a string, but the
* source of data for the iteration might be in a form of array containing objects instead of
* strings
* * {@link angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat} unrolls after the select binds causing
* incorect rendering on most browsers.
* * binding to a value not in list confuses most browsers.
*
* @param {string} name assignable expression to data-bind to.
* @param {string=} required The control is considered valid only if value is entered.
* @param {comprehension_expression=} ng-options in one of the following forms:
*
* * for array data sources:
* * `label` **`for`** `value` **`in`** `array`
* * `select` **`as`** `label` **`for`** `value` **`in`** `array`
* * `label` **`group by`** `group` **`for`** `value` **`in`** `array`
* * `select` **`as`** `label` **`group by`** `group` **`for`** `value` **`in`** `array`
* * for object data sources:
* * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
* * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
* * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`
* * `select` **`as`** `label` **`group by`** `group`
* **`for` `(`**`key`**`,`** `value`**`) in`** `object`
*
* Where:
*
* * `array` / `object`: an expression which evaluates to an array / object to iterate over.
* * `value`: local variable which will refer to each item in the `array` or each property value
* of `object` during iteration.
* * `key`: local variable which will refer to a property name in `object` during iteration.
* * `label`: The result of this expression will be the label for `<option>` element. The
* `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).
* * `select`: The result of this expression will be bound to the model of the parent `<select>`
* element. If not specified, `select` expression will default to `value`.
* * `group`: The result of this expression will be used to group options using the `<optgroup>`
* DOM element.
*
* @example
<doc:example>
<doc:source>
<script>
function MyCntrl($scope) {
$scope.colors = [
{name:'black', shade:'dark'},
{name:'white', shade:'light'},
{name:'red', shade:'dark'},
{name:'blue', shade:'dark'},
{name:'yellow', shade:'light'}
];
$scope.color = $scope.colors[2]; // red
}
</script>
<div ng-controller="MyCntrl">
<ul>
<li ng-repeat="color in colors">
Name: <input ng-model="color.name">
[<a href ng-click="colors.$remove(color)">X</a>]
</li>
<li>
[<a href ng-click="colors.push({})">add</a>]
</li>
</ul>
<hr/>
Color (null not allowed):
<select ng-model="color" ng-options="c.name for c in colors"></select><br>
Color (null allowed):
<div class="nullable">
<select ng-model="color" ng-options="c.name for c in colors">
<option value="">-- chose color --</option>
</select>
</div><br/>
Color grouped by shade:
<select ng-model="color" ng-options="c.name group by c.shade for c in colors">
</select><br/>
Select <a href ng-click="color={name:'not in list'}">bogus</a>.<br>
<hr/>
Currently selected: {{ {selected_color:color} }}
<div style="border:solid 1px black; height:20px"
ng-style="{'background-color':color.name}">
</div>
</div>
</doc:source>
<doc:scenario>
it('should check ng-options', function() {
expect(binding('{selected_color:color}')).toMatch('red');
select('color').option('0');
expect(binding('{selected_color:color}')).toMatch('black');
using('.nullable').select('color').option('');
expect(binding('{selected_color:color}')).toMatch('null');
});
</doc:scenario>
</doc:example>
*/
var ngOptionsDirective = valueFn({ terminal: true });
var selectDirective = ['$compile', '$parse', function($compile, $parse) {
//00001111100000000000222200000000000000000000003333000000000000044444444444444444000000000555555555555555550000000666666666666666660000000000000007777
var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/;
return {
restrict: 'E',
require: '?ngModel',
link: function(scope, element, attr, ctrl) {
if (!ctrl) return;
var multiple = attr.multiple,
optionsExp = attr.ngOptions;
// required validator
if (multiple && (attr.required || attr.ngRequired)) {
var requiredValidator = function(value) {
ctrl.$setValidity('required', !attr.required || (value && value.length));
return value;
};
ctrl.$parsers.push(requiredValidator);
ctrl.$formatters.unshift(requiredValidator);
attr.$observe('required', function() {
requiredValidator(ctrl.$viewValue);
});
}
if (optionsExp) Options(scope, element, ctrl);
else if (multiple) Multiple(scope, element, ctrl);
else Single(scope, element, ctrl);
////////////////////////////
function Single(scope, selectElement, ctrl) {
ctrl.$render = function() {
selectElement.val(ctrl.$viewValue);
};
selectElement.bind('change', function() {
scope.$apply(function() {
ctrl.$setViewValue(selectElement.val());
});
});
}
function Multiple(scope, selectElement, ctrl) {
var lastView;
ctrl.$render = function() {
var items = new HashMap(ctrl.$viewValue);
forEach(selectElement.children(), function(option) {
option.selected = isDefined(items.get(option.value));
});
};
// we have to do it on each watch since ng-model watches reference, but
// we need to work of an array, so we need to see if anything was inserted/removed
scope.$watch(function() {
if (!equals(lastView, ctrl.$viewValue)) {
lastView = copy(ctrl.$viewValue);
ctrl.$render();
}
});
selectElement.bind('change', function() {
scope.$apply(function() {
var array = [];
forEach(selectElement.children(), function(option) {
if (option.selected) {
array.push(option.value);
}
});
ctrl.$setViewValue(array);
});
});
}
function Options(scope, selectElement, ctrl) {
var match;
if (! (match = optionsExp.match(NG_OPTIONS_REGEXP))) {
throw Error(
"Expected ng-options in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
" but got '" + optionsExp + "'.");
}
var displayFn = $parse(match[2] || match[1]),
valueName = match[4] || match[6],
keyName = match[5],
groupByFn = $parse(match[3] || ''),
valueFn = $parse(match[2] ? match[1] : valueName),
valuesFn = $parse(match[7]),
// we can't just jqLite('<option>') since jqLite is not smart enough
// to create it in <select> and IE barfs otherwise.
optionTemplate = jqLite(document.createElement('option')),
optGroupTemplate = jqLite(document.createElement('optgroup')),
nullOption = false, // if false then user will not be able to select it
// This is an array of array of existing option groups in DOM. We try to reuse these if possible
// optionGroupsCache[0] is the options with no option group
// optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element
optionGroupsCache = [[{element: selectElement, label:''}]];
// find existing special options
forEach(selectElement.children(), function(option) {
if (option.value == '') {
// developer declared null option, so user should be able to select it
nullOption = jqLite(option).remove();
// compile the element since there might be bindings in it
$compile(nullOption)(scope);
}
});
selectElement.html(''); // clear contents
selectElement.bind('change', function() {
scope.$apply(function() {
var optionGroup,
collection = valuesFn(scope) || [],
locals = {},
key, value, optionElement, index, groupIndex, length, groupLength;
if (multiple) {
value = [];
for (groupIndex = 0, groupLength = optionGroupsCache.length;
groupIndex < groupLength;
groupIndex++) {
// list of options for that group. (first item has the parent)
optionGroup = optionGroupsCache[groupIndex];
for(index = 1, length = optionGroup.length; index < length; index++) {
if ((optionElement = optionGroup[index].element)[0].selected) {
key = optionElement.val();
if (keyName) locals[keyName] = key;
locals[valueName] = collection[key];
value.push(valueFn(scope, locals));
}
}
}
} else {
key = selectElement.val();
if (key == '?') {
value = undefined;
} else if (key == ''){
value = null;
} else {
locals[valueName] = collection[key];
if (keyName) locals[keyName] = key;
value = valueFn(scope, locals);
}
}
ctrl.$setViewValue(value);
});
});
ctrl.$render = render;
// TODO(vojta): can't we optimize this ?
scope.$watch(render);
function render() {
var optionGroups = {'':[]}, // Temporary location for the option groups before we render them
optionGroupNames = [''],
optionGroupName,
optionGroup,
option,
existingParent, existingOptions, existingOption,
modelValue = ctrl.$modelValue,
values = valuesFn(scope) || [],
keys = keyName ? sortedKeys(values) : values,
groupLength, length,
groupIndex, index,
locals = {},
selected,
selectedSet = false, // nothing is selected yet
lastElement,
element;
if (multiple) {
selectedSet = new HashMap(modelValue);
} else if (modelValue === null || nullOption) {
// if we are not multiselect, and we are null then we have to add the nullOption
optionGroups[''].push({selected:modelValue === null, id:'', label:''});
selectedSet = true;
}
// We now build up the list of options we need (we merge later)
for (index = 0; length = keys.length, index < length; index++) {
locals[valueName] = values[keyName ? locals[keyName]=keys[index]:index];
optionGroupName = groupByFn(scope, locals) || '';
if (!(optionGroup = optionGroups[optionGroupName])) {
optionGroup = optionGroups[optionGroupName] = [];
optionGroupNames.push(optionGroupName);
}
if (multiple) {
selected = selectedSet.remove(valueFn(scope, locals)) != undefined;
} else {
selected = modelValue === valueFn(scope, locals);
selectedSet = selectedSet || selected; // see if at least one item is selected
}
optionGroup.push({
id: keyName ? keys[index] : index, // either the index into array or key from object
label: displayFn(scope, locals) || '', // what will be seen by the user
selected: selected // determine if we should be selected
});
}
if (!multiple && !selectedSet) {
// nothing was selected, we have to insert the undefined item
optionGroups[''].unshift({id:'?', label:'', selected:true});
}
// Now we need to update the list of DOM nodes to match the optionGroups we computed above
for (groupIndex = 0, groupLength = optionGroupNames.length;
groupIndex < groupLength;
groupIndex++) {
// current option group name or '' if no group
optionGroupName = optionGroupNames[groupIndex];
// list of options for that group. (first item has the parent)
optionGroup = optionGroups[optionGroupName];
if (optionGroupsCache.length <= groupIndex) {
// we need to grow the optionGroups
existingParent = {
element: optGroupTemplate.clone().attr('label', optionGroupName),
label: optionGroup.label
};
existingOptions = [existingParent];
optionGroupsCache.push(existingOptions);
selectElement.append(existingParent.element);
} else {
existingOptions = optionGroupsCache[groupIndex];
existingParent = existingOptions[0]; // either SELECT (no group) or OPTGROUP element
// update the OPTGROUP label if not the same.
if (existingParent.label != optionGroupName) {
existingParent.element.attr('label', existingParent.label = optionGroupName);
}
}
lastElement = null; // start at the begining
for(index = 0, length = optionGroup.length; index < length; index++) {
option = optionGroup[index];
if ((existingOption = existingOptions[index+1])) {
// reuse elements
lastElement = existingOption.element;
if (existingOption.label !== option.label) {
lastElement.text(existingOption.label = option.label);
}
if (existingOption.id !== option.id) {
lastElement.val(existingOption.id = option.id);
}
if (existingOption.element.selected !== option.selected) {
lastElement.prop('selected', (existingOption.selected = option.selected));
}
} else {
// grow elements
// if it's a null option
if (option.id === '' && nullOption) {
// put back the pre-compiled element
element = nullOption;
} else {
// jQuery(v1.4.2) Bug: We should be able to chain the method calls, but
// in this version of jQuery on some browser the .text() returns a string
// rather then the element.
(element = optionTemplate.clone())
.val(option.id)
.attr('selected', option.selected)
.text(option.label);
}
existingOptions.push(existingOption = {
element: element,
label: option.label,
id: option.id,
selected: option.selected
});
if (lastElement) {
lastElement.after(element);
} else {
existingParent.element.append(element);
}
lastElement = element;
}
}
// remove any excessive OPTIONs in a group
index++; // increment since the existingOptions[0] is parent element not OPTION
while(existingOptions.length > index) {
existingOptions.pop().element.remove();
}
}
// remove any excessive OPTGROUPs from select
while(optionGroupsCache.length > groupIndex) {
optionGroupsCache.pop()[0].element.remove();
}
};
}
}
}
}];
var optionDirective = ['$interpolate', function($interpolate) {
return {
restrict: 'E',
priority: 100,
compile: function(element, attr) {
if (isUndefined(attr.value)) {
var interpolateFn = $interpolate(element.text(), true);
if (interpolateFn) {
return function (scope, element, attr) {
scope.$watch(interpolateFn, function(value) {
attr.$set('value', value);
});
}
} else {
attr.$set('value', element.text());
}
}
}
}
}];
var styleDirective = valueFn({
restrict: 'E',
terminal: true
});
//try to bind to jquery now so that one can write angular.element().read()
//but we will rebind on bootstrap again.
bindJQuery();
publishExternalAPI(angular);
jqLite(document).ready(function() {
angularInit(document, bootstrap);
});
})(window, document);
angular.element(document).find('head').append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>');
|
function cov_2rgxocfy0o(){var path="C:\\Users\\Tjerk_2\\Desktop\\S4 - Vue FrontEnd\\models\\Review.js";var hash="da678f3391da5b9ed4c9bf858ffbb706282487f4";var global=new Function("return this")();var gcv="__coverage__";var coverageData={path:"C:\\Users\\Tjerk_2\\Desktop\\S4 - Vue FrontEnd\\models\\Review.js",statementMap:{"0":{start:{line:1,column:0},end:{line:31,column:1}},"1":{start:{line:5,column:8},end:{line:5,column:29}},"2":{start:{line:7,column:8},end:{line:7,column:31}},"3":{start:{line:9,column:8},end:{line:9,column:27}},"4":{start:{line:10,column:8},end:{line:10,column:31}},"5":{start:{line:12,column:8},end:{line:12,column:37}},"6":{start:{line:14,column:8},end:{line:14,column:23}},"7":{start:{line:15,column:8},end:{line:15,column:23}},"8":{start:{line:19,column:8},end:{line:19,column:35}},"9":{start:{line:23,column:8},end:{line:23,column:49}},"10":{start:{line:27,column:8},end:{line:27,column:49}}},fnMap:{"0":{name:"(anonymous_0)",decl:{start:{line:3,column:4},end:{line:3,column:5}},loc:{start:{line:3,column:52},end:{line:16,column:5}},line:3},"1":{name:"(anonymous_1)",decl:{start:{line:18,column:4},end:{line:18,column:5}},loc:{start:{line:18,column:28},end:{line:20,column:5}},line:18},"2":{name:"(anonymous_2)",decl:{start:{line:22,column:4},end:{line:22,column:5}},loc:{start:{line:22,column:24},end:{line:24,column:5}},line:22},"3":{name:"(anonymous_3)",decl:{start:{line:26,column:4},end:{line:26,column:5}},loc:{start:{line:26,column:24},end:{line:28,column:5}},line:26}},branchMap:{},s:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},f:{"0":0,"1":0,"2":0,"3":0},b:{},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"da678f3391da5b9ed4c9bf858ffbb706282487f4"};var coverage=global[gcv]||(global[gcv]={});if(!coverage[path]||coverage[path].hash!==hash){coverage[path]=coverageData;}var actualCoverage=coverage[path];cov_2rgxocfy0o=function(){return actualCoverage;};return actualCoverage;}cov_2rgxocfy0o();cov_2rgxocfy0o().s[0]++;module.exports=class Review{constructor(author,title,content,starRating){cov_2rgxocfy0o().f[0]++;cov_2rgxocfy0o().s[1]++;this.author=author;//send timeStamp
cov_2rgxocfy0o().s[2]++;this.date=Date.now();cov_2rgxocfy0o().s[3]++;this.title=title;cov_2rgxocfy0o().s[4]++;this.content=content;cov_2rgxocfy0o().s[5]++;this.starRating=starRating;cov_2rgxocfy0o().s[6]++;this.pros=[];cov_2rgxocfy0o().s[7]++;this.cons=[];}setProductId(productId){cov_2rgxocfy0o().f[1]++;cov_2rgxocfy0o().s[8]++;this.productId=productId;}addPros(...newPros){cov_2rgxocfy0o().f[2]++;cov_2rgxocfy0o().s[9]++;this.pros.push.apply(this.pros,newPros);}addCons(...newCons){cov_2rgxocfy0o().f[3]++;cov_2rgxocfy0o().s[10]++;this.cons.push.apply(this.cons,newCons);}};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJldmlldy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiUmV2aWV3IiwiY29uc3RydWN0b3IiLCJhdXRob3IiLCJ0aXRsZSIsImNvbnRlbnQiLCJzdGFyUmF0aW5nIiwiZGF0ZSIsIkRhdGUiLCJub3ciLCJwcm9zIiwiY29ucyIsInNldFByb2R1Y3RJZCIsInByb2R1Y3RJZCIsImFkZFByb3MiLCJuZXdQcm9zIiwicHVzaCIsImFwcGx5IiwiYWRkQ29ucyIsIm5ld0NvbnMiXSwibWFwcGluZ3MiOiJnOURBQUFBLE1BQU0sQ0FBQ0MsT0FBUCxDQUFpQixLQUFNQyxDQUFBQSxNQUFPLENBRTFCQyxXQUFXLENBQUNDLE1BQUQsQ0FBU0MsS0FBVCxDQUFnQkMsT0FBaEIsQ0FBeUJDLFVBQXpCLENBQXFDLGlEQUU1QyxLQUFLSCxNQUFMLENBQWNBLE1BQWQsQ0FDWTtBQUhnQyx3QkFJNUMsS0FBS0ksSUFBTCxDQUFZQyxJQUFJLENBQUNDLEdBQUwsRUFBWixDQUo0Qyx3QkFNNUMsS0FBS0wsS0FBTCxDQUFhQSxLQUFiLENBTjRDLHdCQU81QyxLQUFLQyxPQUFMLENBQWVBLE9BQWYsQ0FQNEMsd0JBUzVDLEtBQUtDLFVBQUwsQ0FBa0JBLFVBQWxCLENBVDRDLHdCQVc1QyxLQUFLSSxJQUFMLENBQVksRUFBWixDQVg0Qyx3QkFZNUMsS0FBS0MsSUFBTCxDQUFZLEVBQVosQ0FDSCxDQUVEQyxZQUFZLENBQUNDLFNBQUQsQ0FBWSxpREFDcEIsS0FBS0EsU0FBTCxDQUFpQkEsU0FBakIsQ0FDSCxDQUVEQyxPQUFPLENBQUMsR0FBR0MsT0FBSixDQUFhLGlEQUNoQixLQUFLTCxJQUFMLENBQVVNLElBQVYsQ0FBZUMsS0FBZixDQUFxQixLQUFLUCxJQUExQixDQUFnQ0ssT0FBaEMsRUFDSCxDQUVERyxPQUFPLENBQUMsR0FBR0MsT0FBSixDQUFhLGtEQUNoQixLQUFLUixJQUFMLENBQVVLLElBQVYsQ0FBZUMsS0FBZixDQUFxQixLQUFLTixJQUExQixDQUFnQ1EsT0FBaEMsRUFDSCxDQTNCeUIsQ0FBOUIiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGNsYXNzIFJldmlldyB7XHJcblxyXG4gICAgY29uc3RydWN0b3IoYXV0aG9yLCB0aXRsZSwgY29udGVudCwgc3RhclJhdGluZykge1xyXG5cclxuICAgICAgICB0aGlzLmF1dGhvciA9IGF1dGhvcjtcclxuICAgICAgICAgICAgICAgICAgICAvL3NlbmQgdGltZVN0YW1wXHJcbiAgICAgICAgdGhpcy5kYXRlID0gRGF0ZS5ub3coKTtcclxuXHJcbiAgICAgICAgdGhpcy50aXRsZSA9IHRpdGxlO1xyXG4gICAgICAgIHRoaXMuY29udGVudCA9IGNvbnRlbnQ7XHJcblxyXG4gICAgICAgIHRoaXMuc3RhclJhdGluZyA9IHN0YXJSYXRpbmc7XHJcblxyXG4gICAgICAgIHRoaXMucHJvcyA9IFtdO1xyXG4gICAgICAgIHRoaXMuY29ucyA9IFtdO1xyXG4gICAgfVxyXG5cclxuICAgIHNldFByb2R1Y3RJZChwcm9kdWN0SWQpIHtcclxuICAgICAgICB0aGlzLnByb2R1Y3RJZCA9IHByb2R1Y3RJZDtcclxuICAgIH1cclxuXHJcbiAgICBhZGRQcm9zKC4uLm5ld1Byb3MpIHtcclxuICAgICAgICB0aGlzLnByb3MucHVzaC5hcHBseSh0aGlzLnByb3MsIG5ld1Byb3MpO1xyXG4gICAgfVxyXG5cclxuICAgIGFkZENvbnMoLi4ubmV3Q29ucykge1xyXG4gICAgICAgIHRoaXMuY29ucy5wdXNoLmFwcGx5KHRoaXMuY29ucywgbmV3Q29ucyk7XHJcbiAgICB9XHJcblxyXG5cclxufSJdfQ==
|
$(document).ready(function() {
/*------------------------- CARSEARCH.JS ------------------------------------
By: Christopher Torres
Version: 1.0
Date: 3/18/2019
Libraries used: JQuery, Javascript
Purpose:
This file handles all javascript operations for the car search page.
Section Index:
-VARIABLES: Hold global variables
-HELPER FUNCTIONS: Implementations of helper functions used in file
-ON PAGE LOADERS: Functions that run when the page is loaded
-ON CHANGE LISTENERS: Functions that run when an element changes
-ON CLICK LISTENERS: Functions that run when a element is clicked
---------------------------------------------------------------------------*/
/*****************************************************************************
VARIABLES
*****************************************************************************/
/*
Search list generated on page load for drop down menus
Structure: {
'make':{ 'model':['1992','1993'], 'model':['2000','2001'] },
'make':{ 'model':['1992','1993'], 'model':['2000','2001'] }
}
*/
var searchListJson = {};
/*****************************************************************************
HELPER FUNCTIONS
*****************************************************************************/
/*
Made by: Chris
Date: 3/9/2019
Version: 1.0
Helper function to switch the state of a button on and off.
Example:
$('#submitbutton').changeState(true); - Turn on button
$('#submitbutton').changeState(false); - Turn off button
*/
$.fn.changeState = function(state) {
var active = "btn-primary";
var disabled = "btn-secondary";
if (state === true) { //Turn on button
//Change color from blue to gray
this.removeClass(disabled).addClass(active);
//Turn disabled state on
this.removeAttr('disabled');
} else if (state === false) { //Turn off button
//Change color from blue to gray
this.removeClass(active).addClass(disabled);
//Turn disabled state off
this.attr('disabled', 'disabled');
}
}
/*
Made by: Chris
Date: 3/9/2019
Version: 1.0
Helper function to convert a JSON object to a custom JS Object
for the dropdown menu search terms.
Pre-format: 3 column mySql table
=======================
| make | model | year |
-----------------------
| Data | Data | Data |
| Data | Data | Data |
| Data | Data | Data |
======================
Post-Format: 3D JSON Object
{
'make':{'model':['2000',2001],'model':['year','year']} ,
'Toyota':{'Corolla':['2000',2001],'model':['year','year']}
}
*/
$.createSearchList = function(data) {
for (var i = 0; i < data.length; ++i) {
//'make' index operation
if (!searchListJson[data[i][0]]) {
searchListJson[data[i][0]] = {};
}
//'model' index operation
if (!searchListJson[data[i][0]][data[i][1]]) {
searchListJson[data[i][0]][data[i][1]] = [];
}
//'year' index operation
if (!(data[i][1] in searchListJson[data[i][0]][data[i][1]])) {
searchListJson[data[i][0]][data[i][1]].push(data[i][2]);
}
}
}
/*
Made by: Chris
Date: 3/13/2019
Version: 1.0
Creates a GET request value string with the passed parameters
Output:
" make='Toyota'&model='Corolla'&year='2018'&zip=78109,78258 "
*/
$.getRequestValues = function(make, model, year, location) {
console.log("GetValues recieved: \n" + make + "\n" + model + "\n" + year + "\n" + location);
if ((make == "null") && (model == "null") && (year == "null") && (location == null)) {
console.log("GetValues Returning: NULL");
return null;
} else {
//If where=true, the query will be filtered by the search terms
var searchTerms = [];
var values = "";
//make='Toyota'
if (make !== "null") {
searchTerms.push("make=\"" + make + "\"");
}
//model='Corolla'
if (model !== "null") {
searchTerms.push("model=\"" + model + "\"");
}
//year='2017'
if (year !== "null") {
searchTerms.push("year=\"" + year + "\"");
}
//zip=78258,78109
if (location !== null) {
//Add zips to car GET request string
var getString = "zip=";
for (var i = 0; i < location.length; ++i) {
getString += location[i];
if ((i + 1) != location.length)
getString += ",";
}
searchTerms.push(getString);
}
for (var i = 0; i < searchTerms.length; ++i) {
values += "&"
values += searchTerms[i];
}
console.log("GetValues Returning: " + values);
return values;
}
}
/*
Made by: Chris
Date: 3/18/2019
Version: 1.0
This function accepts a get-car.php/where?params call to get cars from the DB.
If cars are found, the data is inserted into card HTML elements and pushed to the
card deck. If no results are found, a message is displayed saying nothing was
found.
Returns: Nothing
*/
$.setCardDeck = function(getString) {
$.get(getString, function(data, status) {
var jsonData = JSON.parse(data);
if (jsonData != null) {
//US Currency Formatter
const formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
//Clear table before appending cards
$("#card_deck").html("");
var card = "";
for (var i = 0; i < jsonData.length; ++i) {
var hash = jsonData[i].img;
if (hash != null) {
var settings = {
"url": "https://api.imgur.com/3/image/" + hash,
"method": "GET",
"timeout": 0,
"jsonData": jsonData[i],
"headers": {
"Authorization": "Client-ID 24e7752611ea41f"
},
};
$.ajax(settings).done(function(response) {
var imgURL = response.data.link;
card = "<div class=\"card mx-auto mb-3 border-secondary\" id=\"card\"" +
"style=\"min-width:300px;max-width:300px;min-height:475px;\">" +
"<a href=\"./details?car=" + this.jsonData.car_id + "\" style=\"height:200px;\">" +
"<img src=\""+imgURL+"\" height=\"auto\" width=\"300\" class=\"card-img-top p-1\" alt=\"...\">" +
"</a>" +
"<div class=\"card-body\"><hr>" +
"<h5 class=\"card-title\">" + this.jsonData.year + " " + this.jsonData.make + "<br>" + this.jsonData.model + " " + this.jsonData.trim + "</h5>" +
"<p class=\"card-title\"><u>" + this.jsonData.name + "</u><br>" + this.jsonData.street + "<br>" + this.jsonData.city + " " + this.jsonData.zip + "</p>" +
"<hr>" +
"<h5 class=\"card-text\">Posted Price:<br>" + formatter.format(this.jsonData.price) + "</h5>" +
//"<h5 class=\"card-text\">KBB Price:<br> $19,650</h5>" +
"<p class=\"card-text\"><small class=\"text-muted\">Last Update: " + this.jsonData.date + "</small></p>" +
"</div>" +
"</div>";
$("#card_deck").append(card);
});
} else {
card = "<div class=\"card mx-auto mb-3 border-secondary\" id=\"card\"" +
"style=\"min-width:300px;max-width:300px;min-height:475px;\">" +
"<a href=\"./details?car=" + jsonData[i].car_id + "\" style=\"height:200px;\">" +
"<img src=\"https://i.imgur.com/l5ysJiD.png\" height=\"auto\" width=\"300\" class=\"card-img-top p-1\" alt=\"...\">" +
"</a>" +
"<div class=\"card-body\"><hr>" +
"<h5 class=\"card-title\">" + jsonData[i].year + " " + jsonData[i].make + "<br>" + jsonData[i].model + " " + jsonData[i].trim + "</h5>" +
"<p class=\"card-title\"><u>" + jsonData[i].name + "</u><br>" + jsonData[i].street + "<br>" + jsonData[i].city + " " + jsonData[i].zip + "</p>" +
"<hr>" +
"<h5 class=\"card-text\">Posted Price:<br>" + formatter.format(jsonData[i].price) + "</h5>" +
//"<h5 class=\"card-text\">KBB Price:<br> $19,650</h5>" +
"<p class=\"card-text\"><small class=\"text-muted\">Last Update: " + jsonData[i].date + "</small></p>" +
"</div>" +
"</div>";
$("#card_deck").append(card);
}
}
} else {
var noResult = "<div class=\"card px-1\"><h3>No results found...</h3></div>"
$("#card_deck").html(noResult);
}
});
}
/*
Made by: Chris
Date: 3/18/2019
Version: 1.0
This function flattens a JSON object to a 1d array.
WARNING: The elements of the array are casted into strings for use in
the Google distance matrix API.
Example Input: [['78109'],['78258'],['78249']]
Example output: ["78109","78258","78249"]
*/
$.flattenArray = function(OldArr) {
var newArr = [];
for (var i = 0; i < OldArr.length; ++i) {
newArr.push(String(OldArr[i]));
}
return newArr;
}
/*
Made by: Chris
Date: 3/9/2019
Version: 1.0
Helper function to create a null <option> element
*/
$.newNullDropdownItem = function(value) {
return "<option value=null class=\"dropdown-header text-dark\">" + value + "</option>";
}
/*
Made by: Chris
Date: 3/9/2019
Version: 1.0
Helper function to create a new <option> element. The parameter is used
as the value and text
*/
$.newDropdownItem = function(value) {
return "<option value=\"" + value + "\" class=\"dropdown-header text-dark\">" + value + "</option>";
}
/*****************************************************************************
ON PAGE LOADERS
*****************************************************************************/
//Load head and footer data
$('#header').load('./html/header.php');
$('#footer').load('./html/footer.php');
/*
#make_dropdown - inflate make_dropdown with list of makes
*/
//Turn off button while list is Loaded
$('#submitsearch').changeState(false);
$.get("/choosencruise/PHP/API/get-car.php?search=false", function(data, status) {
//Parse incoming data into manipulatable array
var jsonData = JSON.parse(data);
//Populate searchListJson list fro DB
$.createSearchList(jsonData);
//Get make list
var makeList = Object.keys(searchListJson);
//Build option list for <select> element
var list = $.newNullDropdownItem("Make...");
//add returned data to option list
for (index = 0; index < makeList.length; ++index) {
list += $.newDropdownItem(makeList[index]);
}
//Assign list to #make_dropdown
$('#make_dropdown').html(list);
//Null #model_dropdown and #year_dropdown
var nullOption = $.newNullDropdownItem("-");
$('#model_dropdown').html(nullOption);
$('#year_dropdown').html(nullOption);
//Activate submit button after list is loaded
$('#submitsearch').changeState(true);
});
/*****************************************************************************
ON CHANGE LISTENERS
*****************************************************************************/
/*
#make_dropdown onChange() listener
This event listener waits for a change in the make_dropdown menu, then
waterfalls the correct search terms to the dropdowns below it.
*/
$('#make_dropdown').change(function() {
//disable submit button
$('#submitsearch').changeState(false);
//Get make_dropdown value
var makeVal = $("#make_dropdown").val();
if (makeVal != "null") {
// Goto 'model' index on searchListJson - see searchListJson format
// in VARIABLES (top of the page) section
var makeList = Object.keys(searchListJson[makeVal]);
//Set loading status to model make_dropdown
var loadingStatus = $.newNullDropdownItem("Loading...");
$('#model_dropdown').html(loadingStatus);
$('#year_dropdown').html(loadingStatus);
//build option list for <select> element
var list = $.newNullDropdownItem("Make...");
//add data returned from query
for (index = 0; index < makeList.length; ++index) {
list += $.newDropdownItem(makeList[index]);
}
//assign option list to dropdown
$('#model_dropdown').html(list);
//clear year_dropdown
var nullOption = $.newNullDropdownItem("-");
$('#year_dropdown').html(nullOption);
//Activate button
$('#submitsearch').changeState(true);
} else {
//Null #model_dropdown and #year_dropdown
var nullOption = $.newNullDropdownItem("-");
$('#model_dropdown').html(nullOption);
$('#year_dropdown').html(nullOption);
//Activate button
$('#submitsearch').changeState(true);
}
});
/**************************************
ON CHANGE LISTENER | #model_dropdown
***************************************/
$('#model_dropdown').change(function() {
//Disable button while function is running
$('#submitsearch').changeState(false);
//Get make_dropdown value
var modelVal = $("#model_dropdown").val();
if (modelVal != "null") {
var makeVal = $("#make_dropdown").val();
//Goto 'model' index on searchListJson
var yearList = searchListJson[makeVal][modelVal];
//Set loading status to model make_dropdown
var loadingStatus = $.newNullDropdownItem("Loading...");
$('#year_dropdown').html(loadingStatus);
//build option list for <select> element
var list = $.newNullDropdownItem("Year...");
//add data returned from query
for (index = 0; index < yearList.length; ++index) {
list += $.newDropdownItem(yearList[index])
}
//assign option list to dropdown
$('#year_dropdown').html(list);
//Activate button
$('#submitsearch').changeState(true);
} else {
//Null #model_dropdown and #year_dropdown
var nullOption = $.newNullDropdownItem("-");
$('#year_dropdown').html(nullOption);
//Activate button
$('#submitsearch').changeState(true);
}
});
/*****************************************************************************
ON CLICK LISTENER
*****************************************************************************/
//Variables for performance testing
var times = 0.0;
var totalTime = 0.0;
/*
-Submit button listener
By: Christopher
Updated: 3/22/2019
This on click listner waits for the submit button to be activated. When
clicked, cars from the database will be requested and inserted into the
results table.
if(location is requested){
-Get list of zip codes (zip codes only) from DB filtered by dropdown menu
search terms
-Request distance of origin VS destinations from Google Distance Matrix
API
-Determine which zipcodes are within the distance of the origin
-GET request to DB for cars using search terms and valid zipcodes within
distance of origin
}else{
-GET request to DB for cars using search terms
}
*/
$('#submitsearch').click(function() {
console.log("Submit button pressed");
var t0 = performance.now();
//Disable button
$('#submitsearch').changeState(false);
//Set loading Status
$("#card_deck").html("<div class=\"spinner-border text-primary mt-3 mx-auto\"" +
"role=\"status\"><span class =\"sr-only\">Loading...</span></div>");
//Get search terms
var make = $("#make_dropdown").val();
var model = $("#model_dropdown").val();
var year = $("#year_dropdown").val();
var zip = String($("#zip_textbox").val());
var distance = $('#distance_dropdown').val();
//Regular expression literal to test the format of the input
var zipRegex = /^(\d{5})$/;
/*******
If distance and location are set, location filter will be calculated,
otherwise all location calulations will be skipped
******/
if (zipRegex.test(zip) && distance !== 'null') { //Executed if Location
// is detected
console.log("Location detected");
//location array initiation. Used to hold results of location calulations
var location = null;
/*
Get request filter values for zip code query
-See $.getRequestValues() implementation in helper function section
for details of how to use function.
*/
var requestString = $.getRequestValues(make, model, year, null);
//API URL used to get list of distinct zip codes
var getZipString = "/choosencruise/PHP/API/get-car.php?zipsearch";
//if request filter values were returned, append to end of URL
if (requestString != null) {
getZipString += requestString;
}
/*****
GET request is used to get the list of zip codes associated with
the cars requested. The JSON data is immediately flattened to a 1d
array for easy insertion to the Google Service Distance matrix
request. See $.flattenArray() implementation in HELPER FUNCTION
section for details
returns data: a single column table with distinct zip codes.
*****/
$.get(getZipString, function(data, status) {
if (status == 'success') {
var jsonData = $.parseJSON(data);
var list = $.flattenArray(jsonData);
var zipsInArea = [];
console.table(list);
/*
Google Distance matrix response format
{
"rows":[
{"elements":[
{"distance":{"text":"21.1 mi","value":33962},"duration":{"text":"30 mins","value":1825},"status":"OK"},
{"distance":{"text":"24.6 mi","value":39647},"duration":{"text":"35 mins","value":2082},"status":"OK"}
}],
"originAddresses":["Converse, TX 78109, USA"],
"destinationAddresses":["San Antonio, TX 78221, USA","San Antonio, TX 78258, USA","San Antonio, TX 78233, USA"]
}
*********************************************************************
The zip code data passed from the parent GET request is passed into
Google distance matrix API. If an OK status is passed, the results are
processed. If the car's zip codes are within the distance of the
origin, an array of the valid zipcodes are created, otherwise, the
array will contain a 0.
*/
var service = new google.maps.DistanceMatrixService();
service.getDistanceMatrix({
origins: [zip],
destinations: list,
travelMode: 'DRIVING',
unitSystem: google.maps.UnitSystem.IMPERIAL,
}, function(data, status) {
if (status == "OK") {
zipsInArea = [];
var origins = data.originAddresses;
//Iterate thru each row, and compare the distance to the user
//input distance.
for (var i = 0; i < origins.length; i++) {
var results = data.rows[i].elements;
for (var j = 0; j < results.length; j++) {
var element = results[j]
var elementDistance = element.distance.text;
// index: 1 2
// The distance value is a string with format: "26.1 mi". In
// order to compare each row distance to the user-input
// distance, the string is exploded with a whitespace and
// the first index is parsed into a float
var elementMiles = parseFloat(elementDistance.split(" ", 1));
if (elementMiles <= distance) {
zipsInArea.push(list[j]);
}
}
}
//If no zip codes were aquired, push 0 into array
if (zipsInArea.length < 1) {
zipsInArea.push(0);
}
//Save results into location variable
location = zipsInArea;
/*
Use $.getRequestValues to create the GET request car search
filter values.
Return example:
make="Toyota"&model="Camry"&year="2017"&zip=78219,78249;
*/
var requestValues = $.getRequestValues(make, model, year, location);
//If request value is null, no search terms were fetched
var getString = "/choosencruise/PHP/API/get-car.php?";
if (requestValues === null) {
getString += "where=false";
} else {
getString += "where=true" + requestValues;
}
// GET request to server for cars that will build car
// deck data.
$.setCardDeck(getString);
//Activate button
$('#submitsearch').changeState(true);
//performance testing
var t1 = performance.now();
totalTime += (t1 - t0);
times++;
console.log("Clicks: " + times + "\nAvg: " + (totalTime / times) + "ms");
} else {
console.error("Google Distance matrix has failed");
}
});
}
});
} else {
console.log("Location not detected");
/*
Use $.getRequestValues to create the GET request car search
filter values.
Return example:
make="Toyota"&model="Camry"&year="2017"&zip=78219,78249;
*/
var requestValues = $.getRequestValues(make, model, year, null);
var getString = "/choosencruise/PHP/API/get-car.php?";
if (requestValues === null) {
getString += "where=false";
} else {
getString += "where=true" + requestValues;
}
// GET request to server for cars that will build car
// table data.
$.setCardDeck(getString);
//Activate button
$('#submitsearch').changeState(true);
var t1 = performance.now();
totalTime += (t1 - t0);
times++;
console.log("Clicks: " + times + "\nAvg: " + (totalTime / times) + "ms");
}
});
});
|
// Adapted analytics.js to work with this app.
// See: https://developers.google.com/analytics/devguides/collection/analyticsjs
// Also: https://stackoverflow.com/a/42216498/772086
(() => {
"use strict";
try {
(function (i, s, o, g, r, a, m) {
i["GoogleAnalyticsObject"] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, "script", "https://www.google-analytics.com/analytics.js", "ga");
var fields = {
trackingId: "UA-124434075-1"
};
ga('set', 'anonymizeIp', true);
// If we are in the app the protocol will be "file://
var isBrowser = document.URL.startsWith("http");
if (isBrowser) {
ga("create", fields);
app.logAction = (name) => {
ga("send", {
// this is required, there are optional properties too if you want them
hitType: "pageview",
eventLabel: name,
});
}
} else {
// a callback function to get the clientId and store it ourselves
ga(function (tracker) {
localStorage.setItem("ga:clientId", tracker.get("clientId"));
});
// We store and provide the clientId ourselves in localStorage since there are no
// cookies in Cordova.
fields.clientId = localStorage.getItem("ga:clientId");
// Disable GA"s cookie storage functions
fields.storage = "none";
ga("create", fields);
// See: https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
ga("set", {
// Skip protocol check because it's probably "file://
checkProtocolTask: null,
// do not expect cookies to be enabled
checkStorageTask: null,
// Since the appName field must be sent with all app hits, it's often best to set that field with the set command
appName: "PediCrisis"
});
app.logAction = (name) => {
// See: https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
ga("send", {
hitType: "screenview",
screenName: name
});
}
}
} catch (error) {
console.error(error);
}
})();
|
/* eslint-disable @typescript-eslint/no-var-requires */
const flow = require('lodash.flow');
const withManifest = require('next-manifest');
const withOffline = require('next-offline');
const algoliasearch = require('algoliasearch');
require('dotenv').config();
const INDEX_HITS_PER_PAGE = 1000;
const exportPathMap = async function () {
const pages = {
'/': {
page: '/',
query: {
vse: ''
}
},
'/preview': {
page: '/preview',
query: {
content: '',
vse: ''
}
},
'/visualization.html': {
page: '/visualization',
query: {
vse: '',
content: ''
}
}
};
const client = algoliasearch(process.env.ALGOLIA_APPLICATION_ID, process.env.SEARCH_API_KEY);
const index = client.initIndex(process.env.SEARCH_INDEX_NAME_PRODUCTION);
try {
console.info('\nLoading blog posts:');
const results = await index.search('', {
attributesToRetrieve: ['objectID', 'deliveryKey'],
attributesToHighlight: [],
hitsPerPage: INDEX_HITS_PER_PAGE
});
results.hits.forEach(blogPost => {
if (!blogPost.deliveryKey) {
console.warn('No deliveryKey for blogPost', blogPost);
}
const slug = blogPost.deliveryKey ? blogPost.deliveryKey : blogPost.objectID;
const path = `/blog/${encodeURIComponent(slug)}`;
const pageInfo = {
page: '/blog/[...slug]',
query: { slug }
};
console.info(`Loading blog post "${path}`, pageInfo);
pages[path] = pageInfo;
});
} catch (err) {
console.error('Error building exportPathMap', err);
throw err;
}
return pages;
};
const env = {
URL: process.env.URL,
ALGOLIA_APPLICATION_ID: process.env.ALGOLIA_APPLICATION_ID,
SEARCH_API_KEY: process.env.SEARCH_API_KEY,
SEARCH_INDEX_NAME_PRODUCTION: process.env.SEARCH_INDEX_NAME_PRODUCTION,
SEARCH_INDEX_NAME_STAGING: process.env.SEARCH_INDEX_NAME_STAGING,
AUTHORS_FACET_FIELD: process.env.AUTHORS_FACET_FIELD,
DYNAMIC_CONTENT_HUB_NAME: process.env.DYNAMIC_CONTENT_HUB_NAME,
DYNAMIC_CONTENT_DELIVERY_KEY: process.env.DYNAMIC_CONTENT_DELIVERY_KEY,
DYNAMIC_CONTENT_BASE_URL: process.env.DYNAMIC_CONTENT_BASE_URL,
DYNAMIC_CONTENT_SECURE_MEDIA_HOST: process.env.DYNAMIC_CONTENT_SECURE_MEDIA_HOST,
ROBOTS_META_TAG_NOINDEX: process.env.ROBOTS_META_TAG_NOINDEX,
TAGS_FACET_FIELD: process.env.TAGS_FACET_FIELD,
HITS_PER_PAGE: process.env.HITS_PER_PAGE
};
const manifest = {
name: 'Amplience Product Blog',
short_name: 'Amplience',
theme_color: '#29333f',
background_color: '#29333f',
display: 'standalone',
orientation: 'portrait',
Scope: '/',
start_url: '/',
cache: true,
output: './public/static/',
icons: [
{
src: '/static/icons/icon-72x72.png',
sizes: '72x72',
type: 'image/png'
},
{
src: '/static/icons/icon-96x96.png',
sizes: '96x96',
type: 'image/png'
},
{
src: '/static/icons/icon-128x128.png',
sizes: '128x128',
type: 'image/png'
},
{
src: '/static/icons/icon-144x144.png',
sizes: '144x144',
type: 'image/png'
},
{
src: '/static/icons/icon-152x152.png',
sizes: '152x152',
type: 'image/png'
},
{
src: '/static/icons/icon-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: '/static/icons/icon-384x384.png',
sizes: '384x384',
type: 'image/png'
},
{
src: '/static/icons/icon-512x512.png',
sizes: '512x512',
type: 'image/png'
}
],
splash_pages: null
};
const plugins = [withManifest];
// the withOffline plugin doesn't work with the nextjs-sitemap-generator,
// so if SITEMAP_GENERATOR is present skip the withOffline plugin
if (!process.env.SITEMAP_GENERATOR) {
plugins.push(withOffline);
}
const invokePlugins = flow(plugins);
module.exports = invokePlugins({
env,
exportPathMap,
manifest,
exportTrailingSlash: true,
workboxOpts: {
runtimeCaching: [
{
urlPattern: /.mp4$/,
handler: 'NetworkFirst'
}
]
}
});
|
const Discover = require('@dashersw/node-discover');
// eslint-disable-next-line
const colors = require('colors');
const defaultOptions = {
helloInterval: 2000,
checkInterval: 4000,
nodeTimeout: 5000,
masterTimeout: 6000,
monitor: false,
log: true,
helloLogsEnabled: true,
statusLogsEnabled: true,
ignoreProcess: false,
};
class Discovery extends Discover {
constructor(advertisement, options = {}) {
options = { ...defaultOptions, ...Discovery.defaults, ...options };
super(options);
this.advertisement = { type: 'service', ...advertisement };
this.advertise(this.advertisement);
this.me.id = this.broadcast.instanceUuid;
this.me.processId = this.broadcast.processUuid;
this.me.processCommand = process.argv.slice(1).map((n) => {
return n.split('/').slice(-2).join('/');
}).join(' ');
options.log && this.log(this.helloLogger());
this.on('added', (obj) => {
if (!options.monitor && obj.advertisement.key != this.advertisement.key) return;
options.log && options.statusLogsEnabled && options.helloLogsEnabled &&
this.log(this.statusLogger(obj, 'online'));
});
this.on('removed', (obj) => {
if (!options.monitor && obj.advertisement.key != this.advertisement.key) return;
options.log && options.statusLogsEnabled &&
this.log(this.statusLogger(obj, 'offline'));
});
}
static setDefaults(options) {
this.defaults = options;
}
log(logs) {
console.log.apply(console.log, logs);
}
helloLogger() {
return ['\nHello! I\'m'.white, ...this.statusLogger(this.me), '\n========================\n'.white];
}
statusLogger(obj, status) {
const logs = [];
if (status) {
const statusLog = status == 'online' ? '.online'.green : '.offline'.red;
logs.push(this.advertisement.name, '>', obj.advertisement.type.magenta + statusLog);
} else {
logs.push();
}
logs.push(
`${obj.advertisement.name.white}${'#'.grey}${obj.id.grey}`);
if (obj.advertisement.port) {
logs.push('on', obj.advertisement.port.toString().blue);
}
return logs;
}
}
module.exports = Discovery;
|
import * as React from "react"
import { Link } from "gatsby"
import { StaticImage } from "gatsby-plugin-image"
import Layout from "../components/layout"
import Seo from "../components/seo";
import InputValue from "../components/inputValue";
import localForage from 'localforage';
const usersInstance = localForage.createInstance({
name: "users"
});
export const addUsers = async (newUsers) => {
await newUsers.map((item) => usersInstance.setItem(item.id, item));
};
/// Method to fetch the users from indexedDB
export const getUsers = async (searchValue) => {
// const keys = (await usersInstance.keys()).reverse();
const results = await usersInstance.getItem(searchValue);
//const results = await usersInstance.getItem(keys);
console.log(results);
return results
}
/// Function to add the REST URL in the browser cache
// export const addUsersCache = async (item) => {
// const userPageUrl = `https://jsonplaceholder.typicode.com/users/${item.id}`;
// const cache = await window.caches.open("userDetailsCachePageV1");
// const response = await cache.match(userPageUrl);
// if (!response) cache.add(new Request(userPageUrl));
// }
const Tracker = () => (
<Layout>
<Seo title="Home" />
<StaticImage
src="../images/gatsby-astronaut.png"
width={300}
quality={95}
formats={["AUTO", "WEBP", "AVIF"]}
alt="A Gatsby astronaut"
style={{
marginBottom: `1.45rem`,
marginLeft: `30%`
}}
/>
<InputValue />
</Layout>
)
export default Tracker
|
import {app, BrowserWindow, ipcMain} from 'electron';
import _ from 'lodash';
let windowHandleArr = [];
app.on('browser-window-created', (event, window) => {
windowHandleArr.push({name: window.getTitle(), handle: window});
});
export const ipcMsgMain = () => {
ipcMain.on('showWindow', (event, args) => {
if (_.findIndex(windowHandleArr, {name: args[0]}) === -1) {
const width = (args[0] === 'home') ? 320 : 979;
const height = (args[0] === 'home') ? 690 : 719;
if (process.env.NODE_ENV == 'production') {
const win = new BrowserWindow({
minWidth: width, minHeight: height, width: width, height: height,
autoHideMenuBar: true, frame: false, resizable: true, show: false, title: args[0]
});
win.once('ready-to-show', () => win.show());
win.loadURL(`file://${__dirname}/..${args[1]}`);
} else {
const win = new BrowserWindow({
minWidth: width, minHeight: height, width: width, height: height,
autoHideMenuBar: false, frame: true, resizable: true, show: false, title: args[0]
});
win.once('ready-to-show', () => win.show());
win.loadURL('http://localhost:3000' + args[1]);
win.webContents.openDevTools();
}
}
});
ipcMain.on('closeWindow', (event, args) => {
const index = _.findIndex(windowHandleArr, {name: args[0]});
if (index === -1) return;
if (args[0] === 'home' || (args[0] === 'account' && windowHandleArr.length === 1)) return app.exit();
windowHandleArr[index].handle.close();
_.pullAt(windowHandleArr, index);
});
ipcMain.on('minWindow', (event, args) => {
const index = _.findIndex(windowHandleArr, {name: args[0]});
if (index === -1) return;
windowHandleArr[index].handle.minimize();
});
ipcMain.on('resizeWindow', (event, args) => {
const index = _.findIndex(windowHandleArr, {name: args[0]});
if (index === -1) return;
windowHandleArr[index].handle.setContentSize(args[2], args[3]);
});
};
|
"""
Prime Developer Trial
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.StocksAPIforDigitalPortals.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiModel
)
from fds.sdk.StocksAPIforDigitalPortals.exceptions import ApiAttributeError
class InlineResponse2005DataPerformanceEndOfDayYearToDate(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
}
validations = {
}
@cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'minimum': (float,), # noqa: E501
'maximum': (float,), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {
'minimum': 'minimum', # noqa: E501
'maximum': 'maximum', # noqa: E501
}
read_only_vars = {
}
_composed_schemas = {}
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
"""InlineResponse2005DataPerformanceEndOfDayYearToDate - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
minimum (float): Minimum value.. [optional] # noqa: E501
maximum (float): Maximum value.. [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
self = super(OpenApiModel, cls).__new__(cls)
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
return self
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""InlineResponse2005DataPerformanceEndOfDayYearToDate - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
minimum (float): Minimum value.. [optional] # noqa: E501
maximum (float): Maximum value.. [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
if var_name in self.read_only_vars:
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
f"class with read only attributes.")
|
"use strict";
// Heading for a smart tree
//
// Can use a NodeWatcher to associate the heading with a specific CSL node path
define(
[ 'src/NodeWatcher',
'src/dataInstance',
'src/debug'
],
function (
CSLEDIT_NodeWatcher,
CSLEDIT_data,
debug
) {
var CSLEDIT_SmartTreeHeading = function (element, nodePath, title, possibleChildren, showPropertyPanel) {
var that = this;
this.element = element;
this.title = title;
this.possibleChildren = possibleChildren;
this.showPropertyPanel = showPropertyPanel;
if (typeof(nodePath) === "undefined" || nodePath === "") {
this._updateHtml(false);
} else {
this.nodeWatcher = new CSLEDIT_NodeWatcher(nodePath, CSLEDIT_data, function (nodeData) {
that._updateHtml(true, nodeData);
});
this.addNode = function (id, position, nodeData, numNodes) {
that.nodeWatcher.addNode(id, position, nodeData, numNodes);
};
this.deleteNode = function (id, numNodes) {
that.nodeWatcher.deleteNode(id, numNodes);
};
this.amendNode = function (id, nodeData) {
that.nodeWatcher.amendNode(id, nodeData);
};
this.element.click(function () {
if (that.nodeWatcher.nodeData === null) {
that.element.find('span').addClass('selected');
that.callbacks.selectNode(-1, [], that.nodeWatcher.nodePath);
} else {
that.callbacks.selectNode(that.nodeWatcher.nodeData.cslId);
}
});
}
};
// Deselect this SmartTreeHeading
CSLEDIT_SmartTreeHeading.prototype.deselectAll = function () {
this.element.find('span').removeClass('selected');
};
CSLEDIT_SmartTreeHeading.prototype._updateHtml = function (dynamicNode, nodeData) {
var that = this,
cslidAttribute,
span;
span = $('<span/>').html(this.title);
if (dynamicNode) {
if (nodeData === null) {
span.addClass('missingNode').removeAttr('cslid');
} else {
span.removeClass('missingNode').attr('cslid', nodeData.cslId);
}
}
this.element.html('');
this.element.append($('<h3 class="smartTreeHeading"/>').append(span));
debug.log("updated smart tree to " + this.element.html());
};
CSLEDIT_SmartTreeHeading.prototype.setCallbacks = function (callbacks) {
this.callbacks = callbacks;
};
// Returns the cslId of the node associated with this SmartTreeHeading
CSLEDIT_SmartTreeHeading.prototype.selectedNode = function () {
if (this.nodeWatcher.nodeData !== null) {
return this.nodeWatcher.nodeData.cslId;
} else {
return -1;
}
};
// Only call if this SmartTreeHeading is associated with a node path
// not currently in the CSL tree
//
// Returns the full node path as a '/' separated string
CSLEDIT_SmartTreeHeading.prototype.getMissingNodePath = function () {
debug.assertEqual(this.nodeWatcher.nodeData, null);
return this.nodeWatcher.nodePath;
};
// Returns a list of cslIds representing the path/stack associated with this
// SmartTreeHeading
CSLEDIT_SmartTreeHeading.prototype.getSelectedNodePath = function () {
var splitNodePath = this.nodeWatcher.nodePath.split("/"),
nodePath = [],
cslIdPath = [],
nodes;
if (this.nodeWatcher.nodeData === null) {
return [];
}
while (splitNodePath.length > 0) {
nodePath.push(splitNodePath.splice(0, 1));
nodes = CSLEDIT_data.getNodesFromPath(nodePath.join("/"));
debug.assertEqual(nodes.length, 1);
cslIdPath.push(nodes[0].cslId);
}
return cslIdPath;
};
return CSLEDIT_SmartTreeHeading;
});
|
this is file 254
|
from collections import Counter
d = [4,1,1,1,5,1,3,1,5,3,4,3,3,1,3,3,1,5,3,2,4,4,3,4,1,4,2,2,1,3,5,1,1,3,2,5,1,1,4,2,5,4,3,2,5,3,3,4,5,4,3,5,4,2,5,5,2,2,2,3,5,5,4,2,1,1,5,1,4,3,2,2,1,2,1,5,3,3,3,5,1,5,4,2,2,2,1,4,2,5,2,3,3,2,3,4,4,1,4,4,3,1,1,1,1,1,4,4,5,4,2,5,1,5,4,4,5,2,3,5,4,1,4,5,2,1,1,2,5,4,5,5,1,1,1,1,1,4,5,3,1,3,4,3,3,1,5,4,2,1,4,4,4,1,1,3,1,3,5,3,1,4,5,3,5,1,1,2,2,4,4,1,4,1,3,1,1,3,1,3,3,5,4,2,1,1,2,1,2,3,3,5,4,1,1,2,1,2,5,3,1,5,4,3,1,5,2,3,4,4,3,1,1,1,2,1,1,2,1,5,4,2,2,1,4,3,1,1,1,1,3,1,5,2,4,1,3,2,3,4,3,4,2,1,2,1,2,4,2,1,5,2,2,5,5,1,1,2,3,1,1,1,3,5,1,3,5,1,3,3,2,4,5,5,3,1,4,1,5,2,4,5,5,5,2,4,2,2,5,2,4,1,3,2,1,1,4,4,1,5]
test = [3,4,3,1,2]
fish = Counter(d)
def step(d):
zer = d.get(0, 0)
one = d.get(1, 0)
two = d.get(2, 0)
thr = d.get(3, 0)
fou = d.get(4, 0)
fiv = d.get(5, 0)
six = d.get(6, 0)
sev = d.get(7, 0)
eig = d.get(8, 0)
d[8] = zer
d[0] = one
d[1] = two
d[2] = thr
d[3] = fou
d[4] = fiv
d[5] = six
d[6] = sev + zer
d[7] = eig
for i in range(256):
step(fish)
print(fish.total())
|
import React from 'react';
import { connect } from 'react-redux';
import { useHistory } from 'react-router-dom';
import { authenticate } from '../store';
import {
Grid,
Paper,
Avatar,
CustomInput,
Button,
Typography,
Link,
} from '@material-ui/core';
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
const AuthForm = (props) => {
const { name, displayName, handleSubmit, error } = props;
const paperStyle = {
padding: 30,
height: '50vh',
width: 280,
margin: '100px auto',
};
const avatarStyle = {
backgroundColor: '#1bbd7e',
};
const btnstyle = {
margin: '8px 0',
};
const handleSubmitProfile = (evt) => {
handleSubmit(evt);
};
return (
<Grid>
<Paper elevation={10} style={paperStyle}>
<Grid align="center">
<Avatar style={avatarStyle}>
<LockOutlinedIcon />
</Avatar>
<h2>Sign In</h2>
</Grid>
<form onSubmit={handleSubmitProfile} name={name}>
<div>
<label htmlFor="email"></label>
<input
name="email"
type="email"
placeholder="Email"
required="required"
/>
<label htmlFor="password"></label>
<input
name="password"
type="password"
placeholder="Password"
required="required"
/>
</div>
<Button
type="submit"
color="primary"
variant="contained"
style={btnstyle}
fullWidth="fullWidth"
>
{displayName}
</Button>
{error && error.response && <div>{error.response.data}</div>}
</form>
<div className="signup__link">
<Link href="/signup">I want to sign up</Link>
</div>
</Paper>
</Grid>
);
};
const mapLogin = (state) => {
return { name: 'login', displayName: 'Login', error: state.auth.error };
};
const mapDispatch = (dispatch) => {
return {
handleSubmit(evt) {
evt.preventDefault();
const formName = evt.target.name;
const email = evt.target.email.value;
const password = evt.target.password.value;
return dispatch(authenticate(email, password, formName));
},
};
};
export const Login = connect(mapLogin, mapDispatch)(AuthForm);
|
from domain.database import DBSession
from domain.blood import Blood
import json
# 添加血糖记录
def insertGBlood(userId, level, bloodTime, bloodDate):
edBlood = Blood(userId=userId, level=level, bloodTime=bloodTime, bloodDate=bloodDate)
effect_row = 0
try:
session = DBSession()
session.add(edBlood)
except Exception:
session.rollback()
raise
else:
session.commit()
effect_row = 1
session.close()
return effect_row
# 更新早餐前血糖记录
def updateBloodbeforeBF(userId, bLevel, bTime, bIndex, bloodDate):
effect_raw = 0
try:
session = DBSession()
blood = session.query(Blood).filter(Blood.userId == userId, Blood.bloodDate == bloodDate).first()
if blood is None:
level = {'0': '0', '1': '0', '2': '0', '3': '0', '4': '0', '5': '0', '6': '0'}
bloodTime = {'0': '0', '1': '0', '2': '0', '3': '0', '4': '0', '5': '0', '6': '0'}
level[bIndex] = bLevel
bloodTime[bIndex] = bTime
effect_raw = insertGBlood(userId, json.dumps(level), json.dumps(bloodTime), bloodDate)
else:
level = json.loads(blood.level)
bloodTime = json.loads(blood.bloodTime)
level[bIndex] = bLevel
bloodTime[bIndex] = bTime
blood.level = json.dumps(level)
blood.bloodTime = json.dumps(bloodTime)
effect_raw = 1
except Exception:
session.rollback()
raise
else:
session.commit()
session.close()
return effect_raw
# 获取用户的血糖记录
def selectUserBloodFromXGetN(userId, x, n):
try:
session = DBSession()
offset = x
num = x+n
blood = session.query(Blood).filter(Blood.userId == userId).order_by(Blood.bloodDate.desc()).slice(offset, num).all()
if blood is None:
result = None
else:
result = blood
except Exception:
raise
else:
session.close()
return result
# 某个用户的血糖记录总数
def selectSumBlood(userId):
try:
session = DBSession()
result = session.query(Blood).filter(Blood.userId == userId).count()
except Exception:
raise
else:
session.close()
return result
# 精确获取用户某一天血糖记录
def selectUserOneDayBlood(userId, bloodDate):
try:
session = DBSession()
blood = session.query(Blood).filter(Blood.userId == userId, Blood.bloodDate == bloodDate).first()
if blood is None:
result = None
else:
result = blood
except Exception:
raise
else:
session.close()
return result
|
const XlsxPopulate = require('xlsx-populate');
const cfg = require('./customers2.json')
const formatCell = require('./formatCell')
XlsxPopulate.fromFileAsync("./Customers10.xlsx")
.then(workbook => {
var usedRange = workbook.sheet("Sheet1").usedRange()
var startRow = usedRange.startCell().rowNumber()
startRow = startRow > 2? startRow : 2
const ws = workbook.sheet("Sheet1")
.range(startRow,
usedRange.startCell().columnNumber(),
usedRange.endCell().rowNumber(),
usedRange.endCell().columnNumber())
.value()
var beginRow = '(',
endRow = ')'
var SQL = 'insert into ' + cfg.schema + '.' + cfg.table + ' ';
SQL += beginRow + cfg.cols.map((col) => col.NAME).join(",") + endRow
SQL += ' values\n'
SQL += ws.map((row, rowNum) => {
return beginRow + cfg.cols.map(function(col, colNum) {
let opts = {
value: row[col.COL],
type: col.TYPE,
len: col.LEN,
allowNull: (col.NULLABLE == '1'),
numberToDate: XlsxPopulate.numberToDate,
colNum: colNum + 1,
rowNum: rowNum + startRow
}
return formatCell(opts)
}).join(',') + endRow
}).join(',\n')
// The SQL statement is ready to execute!
var db = require('/QOpenSys/QIBM/ProdData/OPS/Node6/os400/db2i/lib/db2a')
var dbconn = new db.dbconn(); // Create a connection object.
dbconn.conn("*LOCAL", function() {
dbconn.setConnAttr(db.SQL_ATTR_AUTOCOMMIT, db.SQL_TXN_NOCOMMIT)
})
var stmt = new db.dbstmt(dbconn)
stmt.exec(SQL, function() {
stmt.close() // Clean up the statement object (PTF SI64401)
dbconn.disconn() // Disconnect from the database.
dbconn.close() // Clean up the connection object (PTF SI64401)
})
}).catch((error) => {
throw new Error('XlsxPopulate.fromFileAsync:' + error)
});
|
import PropTypes from "prop-types";
import React from "react";
import { Link } from "react-router-dom";
const BannerThirtyThreeSingle = ({ data, spaceBottomClass }) => {
return (
<div className="col-lg-6 col-md-6">
<div
className={`single-banner-2 ${
spaceBottomClass ? spaceBottomClass : ""
}`}
>
<Link to={process.env.PUBLIC_URL + data.link}>
<img src={process.env.PUBLIC_URL + data.image} alt="" />
</Link>
<div className="banner-content-2 banner-content-2-black">
<h3>{data.title}</h3>
<h4>
{data.subtitle} <span>{data.price}</span>
</h4>
<Link to={process.env.PUBLIC_URL + data.link}>
<i className="fa fa-long-arrow-right" />
</Link>
</div>
</div>
</div>
);
};
BannerThirtyThreeSingle.propTypes = {
data: PropTypes.object,
spaceBottomClass: PropTypes.string
};
export default BannerThirtyThreeSingle;
|
import * as ActionTypes from './action-types'
// NODES
// Nodes have a single output
// However tables have multiple columns that can be output
//
// SubTable(subListOfColumns)
// func inputs
// Table Node types: getDBTable db query (preloaded)
// subTable another table & selected columns
// filterTable another table & conditions(colNames,colConditions))
export const addNode = (name,x,y,func,inputs,inputTypes={}) => {
return {
type: ActionTypes.ADD_NODE,
name, x, y,
func, inputs, inputTypes
}
}
export const removeNode = id => {
return {
type: ActionTypes.REMOVE_NODE,
id
}
}
export const clearAllNodes = () => {
return {
type: ActionTypes.CLEAR_ALL_NODES
}
}
export const setNodes = newNodes => {
return {
type: ActionTypes.SET_NODES,
newNodes
}
}
// Node Selector
export const nodeSelectorOn = () => {
return {
type: ActionTypes.NODE_SELECTOR_ON
}
}
// Active Node
export const setActiveNode = id => {
return {
type: ActionTypes.SET_ACTIVE_NODE,
id
}
}
export const activeNodeOptionsOn = () => {
return {
type: ActionTypes.ACTIVE_NODE_OPTIONS_ON
}
}
export const activeNodeOptionsOff = () => {
return {
type: ActionTypes.ACTIVE_NODE_OPTIONS_OFF
}
}
export const nodeSelectorOff = () => {
return {
type: ActionTypes.NODE_SELECTOR_OFF
}
}
// LINK
export const addLink = (fromNode,toNode,toInput) => {
return {
type: ActionTypes.ADD_LINK,
fromNode, toNode, toInput
}
}
export const updateCalcTable = () => {
return {
type: ActionTypes.UPDATE_CALC_TABLE
}
}
export const changeNodePosition = (id,x,y) => {
return {
type: ActionTypes.CHANGE_NODE_POSITION,
id,x,y
}
}
export const updateDBTablesMeta = infosArray => {
return {
type: ActionTypes.UPDATE_DBTABLES_META,
infosArray
}
}
export const updateResults = results => {
return {
type: ActionTypes.UPDATE_RESULTS,
results
}
}
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.texVariant = void 0;
exports.texVariant = {
0x2C6: [.845, -0.561, 2.333, { ic: .013 }],
0x2DC: [.899, -0.628, 2.333],
0x302: [.845, -0.561, 0, { ic: .013 }],
0x303: [.899, -0.628, 0],
0x3F0: [.434, .006, .667, { ic: .067 }],
0x210F: [.695, .013, .54, { ic: .022 }],
0x2190: [.437, -0.064, .5],
0x2192: [.437, -0.064, .5],
0x21CC: [.514, .014, 1],
0x2204: [.86, .166, .556],
0x2205: [.587, 0, .778],
0x2212: [.27, -0.23, .5],
0x2216: [.43, .023, .778],
0x221D: [.472, -0.028, .778],
0x2223: [.43, .023, .222],
0x2224: [.43, .023, .222, { ic: .018 }],
0x2225: [.431, .023, .389],
0x2226: [.431, .024, .389, { ic: .018 }],
0x223C: [.365, -0.132, .778],
0x2248: [.481, -0.05, .778],
0x2268: [.752, .284, .778],
0x2269: [.752, .284, .778],
0x2270: [.919, .421, .778],
0x2271: [.919, .421, .778],
0x2288: [.828, .33, .778],
0x2289: [.828, .33, .778],
0x228A: [.634, .255, .778],
0x228B: [.634, .254, .778],
0x22A8: [.694, 0, .611],
0x22C5: [.189, 0, .278],
0x2322: [.378, -0.122, .778],
0x2323: [.378, -0.143, .778],
0x25B3: [.575, .02, .722],
0x25BD: [.576, .019, .722],
0x2A87: [.801, .303, .778],
0x2A88: [.801, .303, .778],
0x2ACB: [.752, .332, .778],
0x2ACC: [.752, .333, .778],
};
//# sourceMappingURL=tex-variant.js.map
|
// 管理员相关路由
const express=require('express')
const pool=require('../../pool.js')
var router=express.Router();
// 管理员登录
// API: GET/admin/login
// 完成登陆
// 请求的数据:{aname:'xxx',apwd:'xxx'}
//返回的数据:{code:200,msg:'login succ'}
// {code:400,msg:"aname or apwd err"}
router.get('/login/:aname/:apwd',(req,res)=>{
var aname=req.params.aname
var apwd=req.params.apwd
console.log(aname,apwd)
pool.query('SELECT aid FROM xfn_admin WHERE aname=? AND apwd=PASSWORD(?)',[aname,apwd],(err,result)=>{
if(err) throw err;
if(result.length>0){//查询到一行数据,登录成功
res.send({code:200,msg:'login succ'})
}else{//没有查询到数据
res.send({code:400,msg:"aname or apwd err"})
}
console.log(result)
});
})
// API: PATCH /admin/login 修改部分数据用Patch
// 请求的数据:{aname:'xxx',oldPwd:'xxx',apwd:'xxx'}
// 根据管理员的名和密码修改管理员密码
// 返回数据:
// {code:200,msg:'modified succ'} 修改密码成功
// {code:400,msg:"aname or apwd err"} 修改密码错误
// {code:401,msg:"aname or modified"} 新密码与原来的密码一致
router.patch('/',(req,res)=>{
var data=req.body
console.log(data)
// 首先根据aname/oldPwd查询该用户是否存在,
// 如果查询到了用户,在修改器密码;
pool.query('SELECT aid FROM xfn_admin WHERE aname=? AND apwd=PASSWORD(?)',[data.aname,data.oldPwd],(err,result)=>{
if(err) throw err;
if(result.length==0){
res.send({code:400,msg:'password err'})
return ;
}
// 如果查到用户,修改其密码
pool.query('UPDATE xfn_admin SET apwd=PASSWORD(?) WHERE aname=?',[data.newPwd,data.aname],(err,result)=>{
if(err) throw err;
if(result.changedRows>0){ //修改密码完成
res.send({code:200,msg:"modify succ"})
}else { //新旧密码一致,未作修改
res.send({code:401,msg:'pwd not modified'})
}
})
})
})
module.exports=router;
|
from telethon import events
from iahr.utils import Delimiter, CommandDelimiter
from iahr.utils import parenthesize, Delayed, SingletonMeta
from iahr.exception import IahrBaseError
from iahr import localization
import re, logging, json, os
import sys
from dotenv import load_dotenv
# constants
CONFIG_DATA_FOLDER_ENV_NAME = 'IAHR_DATA_FOLDER'
DATA_FOLDER = os.getenv(CONFIG_DATA_FOLDER_ENV_NAME)
if DATA_FOLDER is None:
DATA_FOLDER = 'data'
CONFIG_FNAME = 'config.json'
SESSION_FNAME = 'iahr.session'
LOG_FNAME = 'iahr.log'
##################################################
# Exceptions
##################################################
class IahrConfigError(IahrBaseError):
"""
Base exception class for this module
"""
pass
class IahrEventsError(IahrConfigError):
"""
Exception to raise when events
are not ok
"""
TELETHON_EVENTS_URL = \
'https://docs.telethon.dev/en/latest/quick-references/events-reference.html'
TELETHON_EVENTS = {
'MessageEdited',
}
def __init__(self, events: set):
should_be = self.TELETHON_EVENTS.difference(events)
should_not_be = events.difference(self.TELETHON_EVENTS)
msg = '\n\n\tSomething wrong with your event strings:\n'
msg += f'\tthese should be there: {should_be}\n' if should_be else ''
msg += f'\tthese should not be there: {should_not_be}\n' if should_not_be else ''
msg += f'\n\tsee telethon docs: {self.TELETHON_EVENTS_URL}\n'
super().__init__(msg)
@classmethod
def check_events(cls, events: set):
if events != cls.TELETHON_EVENTS:
raise cls(events)
class IahrUnknownLocalizationError(IahrConfigError):
"""
Exception to raise when no such
language available in iahr.localization module
"""
IAHR_AVAILABLE_LANGS = [
var for var in dir(localization) if not var.startswith("__")
]
IAHR_LOCALIZATION_URL = \
'https://github.com/B1Z0N/iahr/blob/master/README.md#localization'
def __init__(self, lang: str):
msg = f"""\n
Currently, there are no such language in Iahr: `{lang}`,
but you always can add one yourself: {self.IAHR_LOCALIZATION_URL}.
These localizations available: {self.IAHR_AVAILABLE_LANGS}
"""
super().__init__(msg)
@classmethod
def lang_from_str(cls, lang: str):
if lang not in cls.IAHR_AVAILABLE_LANGS:
raise cls(lang)
return getattr(localization, lang)
##################################################
# Config class
##################################################
class IahrConfig(metaclass=SingletonMeta):
"""
Single source of truth about configuration.
This way all modules can access fresh info
at import time.
Needs to be initialized with `init` call.
It is only for internal use, to update values
from userspace use `config` function below.
"""
APP = None # to be settled, but needed here for use in routine execution time
REG = Delayed() # Register in import time
BARE_REG = None # Register in runtime
##################################################
# Config methods
##################################################
@classmethod
def init(cls, reg):
"""
Should be called with initial setup args.
The core call to start a framework.
"""
cls.APP = reg.app
cls.REG.init(reg.reg)
cls.BARE_REG = reg
@classmethod
def _update(cls, preprocess, **kwargs):
"""
Helper function to update the member if it's
lowercase kwarg conterpart is not None.
"""
for name, val in kwargs.items():
if val is not None:
setattr(cls, name.upper(), preprocess(val))
##################################################
# Functions for updating dependent config data
# and utility functions
##################################################
def update_command_re(cmd: Delimiter):
return re.compile(r'{}[^\W]+.*'.format(cmd.in_re()))
def update_add_pars(left, right, cmd, raw):
return parenthesize(left, right, cmd, raw)
def update_logger(fmt, datefmt, out, lvl: str = None):
if out in (sys.stdout, sys.stderr):
handler_cls = logging.StreamHandler
elif type(out) == str:
handler_cls = logging.FileHandler
else:
raise RuntimeError(
"out should be one of this: sys.stdout, sys.stdin, `filename`")
lvl = getattr(logging, str(lvl), logging.INFO)
logger = logging.getLogger('iahr')
logger.setLevel(lvl)
formatter = logging.Formatter(fmt, datefmt)
handler = handler_cls(out)
handler.setFormatter(formatter)
logger.addHandler(handler)
return logger
def prefixes_from_str(prefixes):
IahrEventsError.check_events(set(prefixes.keys()))
return {getattr(events, key): val for key, val in prefixes.items()}
def reverse_prefixes_from_str(prefixes):
return dict(zip(prefixes.values(), prefixes.keys()))
def config_from_file():
global DATA_FOLDER, CONFIG_FNAME
os.makedirs(DATA_FOLDER, exist_ok=True)
config_fname = os.path.join(DATA_FOLDER, CONFIG_FNAME)
if os.path.exists(config_fname) and os.path.getsize(config_fname) > 0:
with open(config_fname) as f:
config_data = json.load(f)
else:
with open(config_fname, 'w') as f:
f.write('{}')
config_data = {}
config(**config_data)
##################################################
# Interface for changing IahrConfig
##################################################
def config(left=None,
right=None,
raw=None,
cmd=None,
prefixes=None,
me=None,
others=None,
noone=None,
log_format=None,
log_datetime_format=None,
log_lvl=None,
local=None,
data_folder=None,
media_folder=None,
edit_to_respond=None,
custom=None):
"""
Single entry to framework configuration,
just run this with some of updated values and
it will update IahrConfig accordingly.
"""
global SESSION_FNAME, LOG_FNAME
cfg = IahrConfig
cfg._update(Delimiter, left=left, right=right, raw=raw)
cfg._update(CommandDelimiter, cmd=cmd)
cfg._update(IahrUnknownLocalizationError.lang_from_str, local=local)
cfg._update(prefixes_from_str, prefixes=prefixes)
cfg._update(reverse_prefixes_from_str, reverse_prefixes=cfg.PREFIXES)
cfg._update(lambda x: x,
me=me,
others=others,
noone=noone,
log_format=log_format,
log_datetime_format=log_datetime_format,
data_folder=data_folder,
media_folder=media_folder,
custom=custom,
edit_to_respond=edit_to_respond,
log_lvl=log_lvl)
os.makedirs(cfg.DATA_FOLDER, exist_ok=True)
cfg.SESSION_FNAME = os.path.join(cfg.DATA_FOLDER, SESSION_FNAME)
cfg.LOG_OUT = os.path.join(cfg.DATA_FOLDER, LOG_FNAME)
cfg.COMMAND_RE = update_command_re(cfg.CMD)
cfg.ADD_PARS = update_add_pars(cfg.LEFT, cfg.RIGHT, cfg.CMD, cfg.RAW)
cfg.LOGGER = update_logger(cfg.LOG_FORMAT, cfg.LOG_DATETIME_FORMAT,
cfg.LOG_OUT, cfg.LOG_LVL)
os.makedirs(cfg.MEDIA_FOLDER, exist_ok=True)
def reset():
"""
Reset(set) IahrConfig to default value
Single source of truth about default
"""
global DATA_FOLDER, SESSION_FNAME, LOG_FNAME
log_format = '%(asctime)s:%(name)s:%(levelname)s:%(module)s:%(funcName)s:%(message)s:'
log_datetime_format = '%m/%d/%Y %I:%M:%S %p'
log_lvl = 'INFO'
IahrConfig.LOGGER = update_logger(log_format, log_datetime_format,
sys.stdout, log_lvl)
config(
left='[',
right=']',
raw='r',
cmd='.',
prefixes={
# additional handlers(not commands)
'MessageEdited': 'onedit',
},
me='me',
others='*',
noone='-',
log_format=log_format,
log_datetime_format=log_datetime_format,
log_lvl=log_lvl,
local='english',
data_folder=DATA_FOLDER,
media_folder='media',
edit_to_respond=False,
custom={ # custom user config dictionary
# entity to deduce user of chat in access rights actions
# (e.g. `allowchat`, `banusr`)
'current_entity': '$',
'tagall_max_number': 50,
'openonline_max_size_mb': 15,
'enable_gdrive': True
})
##################################################
# Setting config on import
##################################################
reset()
config_from_file()
|
var eventSource = new EventSource("/events"),
xhrInfo = new XMLHttpRequest(),
xhrGetServers = new XMLHttpRequest(),
xhrSend = new XMLHttpRequest(),
servericon = null,
servername = null,
channelname = null,
serverlist = null,
chatwindow = null,
startmessage = null,
messageBox = null
function sendMessage() {
if (messageBox.value) {
xhrSend.abort()
xhrSend.open("POST", "/message?message=" + encodeURIComponent(messageBox.value))
xhrSend.send(null)
messageBox.value = ""
}
return false
}
eventSource.addEventListener("message", function(event) {
var data = JSON.parse(event.data)
if (data.color == "#000000") {
data.color = "#e6e5e3"
}
var parentSpan = document.createElement("span")
var nameSpan = document.createElement("span")
nameSpan.innerText = data.author + ": "
nameSpan.style.color = data.color
var messageNode = document.createTextNode(data.content)
parentSpan.appendChild(nameSpan)
parentSpan.appendChild(messageNode)
var chatWindow = document.getElementById("chatwindow")
var br = document.createElement("br")
chatWindow.appendChild(parentSpan)
chatWindow.appendChild(br)
chatWindow.scrollTop = chatWindow.scrollHeight;
})
xhrInfo.onreadystatechange = function() {
if (xhrInfo.readyState == 4) {
if (xhrInfo.responseText) {
var data = JSON.parse(xhrInfo.responseText)
servericon.src = data.iconURL
servername.innerText = data.serverName
channelname.innerText = "#" + data.channelName
startmessage.innerText = "This is the start of the #" + data.channelName + " channel."
}
}
}
xhrGetServers.onreadystatechange = function() {
if (xhrGetServers.readyState == 4) {
if (xhrGetServers.responseText) {
var data = JSON.parse(xhrGetServers.responseText)
for (var i = 0; i < data.length; i++) {
var guild = data[i]
var iconURL = guild.iconURL
var guildId = guild.id
var link = document.createElement("a")
var iconImage = document.createElement("img")
iconImage.src = iconURL
link.href = "/" + guildId + "/790647811594518580"
link.appendChild(iconImage)
serverlist.appendChild(link)
}
}
}
}
window.onload = function() {
servericon = document.getElementById("servericon")
servername = document.getElementById("servername")
channelname = document.getElementById("channelname")
serverlist = document.getElementById("serverlist")
chatwindow = document.getElementById("chatwindow")
startmessage = document.getElementById("startmessage")
messageBox = document.getElementById("messagebox")
xhrInfo.abort()
xhrInfo.open("GET", "/chatinfo?gid=" + "790647809460142080" + "&cid=" + "809135609293307954")
xhrInfo.send(null)
xhrGetServers.abort()
xhrGetServers.open("GET", "/getservers")
xhrGetServers.send(null)
document.body.scrollTop = 176
}
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = require('babel-runtime/helpers/createClass');
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = require('babel-runtime/helpers/inherits');
var _inherits3 = _interopRequireDefault(_inherits2);
var _simpleAssign = require('simple-assign');
var _simpleAssign2 = _interopRequireDefault(_simpleAssign);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
var _shallowEqual = require('recompose/shallowEqual');
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _Popover = require('../Popover/Popover');
var _Popover2 = _interopRequireDefault(_Popover);
var _check = require('../svg-icons/navigation/check');
var _check2 = _interopRequireDefault(_check);
var _ListItem = require('../List/ListItem');
var _ListItem2 = _interopRequireDefault(_ListItem);
var _Menu = require('../Menu/Menu');
var _Menu2 = _interopRequireDefault(_Menu);
var _propTypes3 = require('../utils/propTypes');
var _propTypes4 = _interopRequireDefault(_propTypes3);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var nestedMenuStyle = {
position: 'relative'
};
function getStyles(props, context) {
var disabledColor = context.muiTheme.baseTheme.palette.disabledColor;
var textColor = context.muiTheme.baseTheme.palette.textColor;
var indent = props.desktop ? 64 : 72;
var sidePadding = props.desktop ? 24 : 16;
var styles = {
root: {
color: props.disabled ? disabledColor : textColor,
cursor: props.disabled ? 'default' : 'pointer',
minHeight: props.desktop ? '32px' : '48px',
lineHeight: props.desktop ? '32px' : '48px',
fontSize: props.desktop ? 15 : 16,
whiteSpace: 'nowrap'
},
innerDivStyle: {
paddingLeft: props.leftIcon || props.insetChildren || props.checked ? indent : sidePadding,
paddingRight: props.rightIcon ? indent : sidePadding,
paddingBottom: 0,
paddingTop: 0
},
secondaryText: {
float: 'right'
},
leftIconDesktop: {
margin: 0,
left: 24,
top: 4
},
rightIconDesktop: {
margin: 0,
right: 24,
top: 4,
fill: context.muiTheme.menuItem.rightIconDesktopFill
}
};
return styles;
}
var MenuItem = function (_Component) {
(0, _inherits3.default)(MenuItem, _Component);
function MenuItem() {
var _ref;
var _temp, _this, _ret;
(0, _classCallCheck3.default)(this, MenuItem);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = MenuItem.__proto__ || (0, _getPrototypeOf2.default)(MenuItem)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
open: false
}, _this.cloneMenuItem = function (item) {
return _react2.default.cloneElement(item, {
onTouchTap: function onTouchTap(event) {
if (!item.props.menuItems) {
_this.handleRequestClose();
}
if (item.props.onTouchTap) {
item.props.onTouchTap(event);
}
}
});
}, _this.handleTouchTap = function (event) {
event.preventDefault();
_this.setState({
open: true,
anchorEl: _reactDom2.default.findDOMNode(_this)
});
if (_this.props.onTouchTap) {
_this.props.onTouchTap(event);
}
}, _this.handleRequestClose = function () {
_this.setState({
open: false,
anchorEl: null
});
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
}
(0, _createClass3.default)(MenuItem, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.applyFocusState();
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (this.state.open && nextProps.focusState === 'none') {
this.handleRequestClose();
}
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState, nextContext) {
return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)(this.state, nextState) || !(0, _shallowEqual2.default)(this.context, nextContext);
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
this.applyFocusState();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
if (this.state.open) {
this.setState({
open: false
});
}
}
}, {
key: 'applyFocusState',
value: function applyFocusState() {
this.refs.listItem.applyFocusState(this.props.focusState);
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
checked = _props.checked,
children = _props.children,
desktop = _props.desktop,
disabled = _props.disabled,
focusState = _props.focusState,
innerDivStyle = _props.innerDivStyle,
insetChildren = _props.insetChildren,
leftIcon = _props.leftIcon,
menuItems = _props.menuItems,
rightIcon = _props.rightIcon,
secondaryText = _props.secondaryText,
style = _props.style,
animation = _props.animation,
anchorOrigin = _props.anchorOrigin,
targetOrigin = _props.targetOrigin,
value = _props.value,
other = (0, _objectWithoutProperties3.default)(_props, ['checked', 'children', 'desktop', 'disabled', 'focusState', 'innerDivStyle', 'insetChildren', 'leftIcon', 'menuItems', 'rightIcon', 'secondaryText', 'style', 'animation', 'anchorOrigin', 'targetOrigin', 'value']);
var prepareStyles = this.context.muiTheme.prepareStyles;
var styles = getStyles(this.props, this.context);
var mergedRootStyles = (0, _simpleAssign2.default)(styles.root, style);
var mergedInnerDivStyles = (0, _simpleAssign2.default)(styles.innerDivStyle, innerDivStyle);
// Left Icon
var leftIconElement = leftIcon ? leftIcon : checked ? _react2.default.createElement(_check2.default, null) : null;
if (leftIconElement) {
var mergedLeftIconStyles = desktop ? (0, _simpleAssign2.default)(styles.leftIconDesktop, leftIconElement.props.style) : leftIconElement.props.style;
leftIconElement = _react2.default.cloneElement(leftIconElement, { style: mergedLeftIconStyles });
}
// Right Icon
var rightIconElement = void 0;
if (rightIcon) {
var mergedRightIconStyles = desktop ? (0, _simpleAssign2.default)(styles.rightIconDesktop, rightIcon.props.style) : rightIcon.props.style;
rightIconElement = _react2.default.cloneElement(rightIcon, { style: mergedRightIconStyles });
}
// Secondary Text
var secondaryTextElement = void 0;
if (secondaryText) {
var secondaryTextIsAnElement = _react2.default.isValidElement(secondaryText);
var mergedSecondaryTextStyles = secondaryTextIsAnElement ? (0, _simpleAssign2.default)(styles.secondaryText, secondaryText.props.style) : null;
secondaryTextElement = secondaryTextIsAnElement ? _react2.default.cloneElement(secondaryText, { style: mergedSecondaryTextStyles }) : _react2.default.createElement(
'div',
{ style: prepareStyles(styles.secondaryText) },
secondaryText
);
}
var childMenuPopover = void 0;
if (menuItems) {
childMenuPopover = _react2.default.createElement(
_Popover2.default,
{
animation: animation,
anchorOrigin: anchorOrigin,
anchorEl: this.state.anchorEl,
open: this.state.open,
targetOrigin: targetOrigin,
useLayerForClickAway: false,
onRequestClose: this.handleRequestClose
},
_react2.default.createElement(
_Menu2.default,
{ desktop: desktop, disabled: disabled, style: nestedMenuStyle },
_react2.default.Children.map(menuItems, this.cloneMenuItem)
)
);
other.onTouchTap = this.handleTouchTap;
}
return _react2.default.createElement(
_ListItem2.default,
(0, _extends3.default)({}, other, {
disabled: disabled,
hoverColor: this.context.muiTheme.menuItem.hoverColor,
innerDivStyle: mergedInnerDivStyles,
insetChildren: insetChildren,
leftIcon: leftIconElement,
ref: 'listItem',
rightIcon: rightIconElement,
role: 'menuitem',
style: mergedRootStyles
}),
children,
secondaryTextElement,
childMenuPopover
);
}
}]);
return MenuItem;
}(_react.Component);
MenuItem.muiName = 'MenuItem';
MenuItem.defaultProps = {
anchorOrigin: { horizontal: 'right', vertical: 'top' },
checked: false,
desktop: false,
disabled: false,
focusState: 'none',
insetChildren: false,
targetOrigin: { horizontal: 'left', vertical: 'top' }
};
MenuItem.contextTypes = {
muiTheme: _propTypes2.default.object.isRequired
};
MenuItem.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* Location of the anchor for the popover of nested `MenuItem`
* elements.
* Options:
* horizontal: [left, middle, right]
* vertical: [top, center, bottom].
*/
anchorOrigin: _propTypes4.default.origin,
/**
* Override the default animation component used.
*/
animation: _propTypes2.default.func,
/**
* If true, a left check mark will be rendered.
*/
checked: _propTypes2.default.bool,
/**
* Elements passed as children to the underlying `ListItem`.
*/
children: _propTypes2.default.node,
/**
* @ignore
* If true, the menu item will render with compact desktop
* styles.
*/
desktop: _propTypes2.default.bool,
/**
* If true, the menu item will be disabled.
*/
disabled: _propTypes2.default.bool,
/**
* The focus state of the menu item. This prop is used to set the focus
* state of the underlying `ListItem`.
*/
focusState: _propTypes2.default.oneOf(['none', 'focused', 'keyboard-focused']),
/**
* Override the inline-styles of the inner div.
*/
innerDivStyle: _propTypes2.default.object,
/**
* If true, the children will be indented.
* This is only needed when there is no `leftIcon`.
*/
insetChildren: _propTypes2.default.bool,
/**
* The `SvgIcon` or `FontIcon` to be displayed on the left side.
*/
leftIcon: _propTypes2.default.element,
/**
* `MenuItem` elements to nest within the menu item.
*/
menuItems: _propTypes2.default.node,
/**
* Callback function fired when the menu item is touch-tapped.
*
* @param {object} event TouchTap event targeting the menu item.
*/
onTouchTap: _propTypes2.default.func,
/**
* Can be used to render primary text within the menu item.
*/
primaryText: _propTypes2.default.node,
/**
* The `SvgIcon` or `FontIcon` to be displayed on the right side.
*/
rightIcon: _propTypes2.default.element,
/**
* Can be used to render secondary text within the menu item.
*/
secondaryText: _propTypes2.default.node,
/**
* Override the inline-styles of the root element.
*/
style: _propTypes2.default.object,
/**
* Location on the popover of nested `MenuItem` elements that will attach
* to the anchor's origin.
* Options:
* horizontal: [left, middle, right]
* vertical: [top, center, bottom].
*/
targetOrigin: _propTypes4.default.origin,
/**
* The value of the menu item.
*/
value: _propTypes2.default.any
} : {};
exports.default = MenuItem;
|
#!/usr/bin/python
# Copyright 2018 The Tulsi Authors. 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
#
# 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.
"""Update the Tulsi dSYM symbol cache."""
import sqlite3
from symbol_cache_schema import SQLITE_SYMBOL_CACHE_PATH
from symbol_cache_schema import SymbolCacheSchema
class UpdateSymbolCache(object):
"""Provides a common interface to update a UUID referencing a dSYM."""
def UpdateUUID(self, uuid, dsym_path, arch):
"""Updates a given UUID entry in the database.
Args:
uuid: A UUID representing a binary slice in the dSYM bundle.
dsym_path: An absolute path to the dSYM bundle.
arch: The binary slice's architecture.
Returns:
None: If no error occurred in inserting the new set of values.
String: If a sqlite3.error was raised upon attempting to store new
values into the dSYM cache.
"""
con = self.cache_schema.connection
cur = con.cursor()
# Relies on the UNIQUE constraint between dsym_path + architecture to
# update the UUID if dsym_path and arch match an existing pair, or
# create a new row if this combination of dsym_path and arch is unique.
try:
cur.execute('INSERT OR REPLACE INTO symbol_cache '
'(uuid, dsym_path, architecture) '
'VALUES("%s", "%s", "%s");' % (uuid, dsym_path, arch))
con.commit()
except sqlite3.Error as e:
return e.message
return None
def __init__(self, db_path=SQLITE_SYMBOL_CACHE_PATH):
self.cache_schema = SymbolCacheSchema(db_path)
|
from venues.scheduling_zone_director import SchedulingZoneDirector
from venues.visitor_situation_on_arrival_zone_director_mixin import VisitorSituationOnArrivalZoneDirectorMixin
class ChaletGardenZoneDirector(VisitorSituationOnArrivalZoneDirectorMixin, SchedulingZoneDirector):
pass
|
import heapq # implementation of the heap queue algorithm, also known as the priority queue algorithm (binary tree)
from abc import ABC, abstractmethod
from typing import List
# modified sample code from https://www.redblobgames.com/pathfinding/a-star/
class PriorityQueue:
def __init__(self):
self.elements = []
def __len__(self):
return len(self.elements)
def is_empty(self):
return len(self.elements) == 0
def put(self, item, cost):
heapq.heappush(self.elements, (cost, item))
def pop(self):
# remove and returns (only) the item with the lowest cost
return heapq.heappop(self.elements)
def get(self):
return self.elements[0]
class PriorityQueue2D:
def __init__(self):
self.lvl1_heap = PriorityQueue()
self.cost2id = {}
self.id2heap = {}
def __len__(self):
length = 0
for lvl2_heap in self.id2heap.values():
length += len(lvl2_heap)
return length
def is_empty(self):
return self.lvl1_heap.is_empty()
def put(self, item):
cost1 = item.cost_estimate
cost2 = item.factorisation_measure
try:
# look up the heap with this lvl1 cost
heap_id = self.cost2id[cost1]
lvl2_heap = self.id2heap[heap_id]
except KeyError:
# there exists no second level heap with this cost, create an empty one
lvl2_heap = PriorityQueue()
heap_id = id(lvl2_heap)
self.cost2id[cost1] = heap_id
self.id2heap[heap_id] = lvl2_heap
# the lvl1 heap stores the ids of the corresponding heaps
self.lvl1_heap.put(heap_id, cost1)
# the lvl2 heaps store the actual items
lvl2_heap.put(item, cost2)
def pop(self):
cost1, heap_id = self.lvl1_heap.get()
lvl2_heap = self.id2heap[heap_id]
cost2, item = lvl2_heap.pop()
if lvl2_heap.is_empty():
# remove entries referring to an empty heap
self.lvl1_heap.pop()
self.id2heap.pop(heap_id)
self.cost2id.pop(cost1)
del lvl2_heap
return item
def get(self):
cost1, heap_id = self.lvl1_heap.get()
lvl2_heap = self.id2heap[heap_id]
cost2, item = lvl2_heap.get()
return item # return only the item without the costs
def get_all(self):
all_items = []
for lvl2_heap in self.id2heap.values():
for (_cost, item) in lvl2_heap.elements:
all_items.append(item)
return all_items
class AbstractFactor(ABC):
__slots__ = ["value_idx"]
@abstractmethod
def __str__(self, *args, **kwargs):
pass
@abstractmethod
def __repr__(self):
pass
@abstractmethod
def compute(self, x, value_array):
pass
@abstractmethod
def num_ops(self):
pass
@abstractmethod
def get_recipe(self):
pass
def eval(self, value_array):
"""
looks up the computed value in the value array
self.compute() has to be called before!
then the value is stored at the value index in the value array
:param value_array:
:return: the computed value of self
"""
return value_array[self.value_idx]
class ScalarFactor(AbstractFactor):
"""
a factor depending on just one variable: :math:`f(x) = x_d^e`
"""
__slots__ = ["dimension", "exponent"]
def __init__(self, factor_dimension, factor_exponent):
self.dimension = factor_dimension
self.exponent = factor_exponent
self.value_idx = (
None # initialize the idx with None to catch faulty evaluation tries
)
def __str__(self, factor_fmt_str="x_{dim}^{exp}", *args, **kwargs):
# NOTE: variable numbering starts with 1: x_1, x_2, ...
# if self.exponent == 1:
# return 'x_{}'.format(self.dimension + 1)
return factor_fmt_str.format(
**{"dim": self.dimension + 1, "exp": self.exponent}
)
def __repr__(self, *args, **kwargs):
return self.__str__(*args, **kwargs)
def num_ops(self):
return 1 # the number of instructions required for computing the value
def compute(self, x, value_array):
value_array[self.value_idx] = x[self.dimension] ** self.exponent
def get_recipe(self):
"""
for evaluation the input value has to be either copied or exponentiated
:return: copy_recipe, scalar_recipe
"""
if self.exponent == 1:
# just copy x[dim] value
# values[target] = x[source]
return [(self.value_idx, self.dimension)], []
else:
# instruction encoding: target, source, exponent
# values[target] = x[source] ** exponent
return [], [(self.value_idx, self.dimension, self.exponent)]
class MonomialFactor(AbstractFactor):
"""
a factor ('monomial') consisting of a product of scalar factors:
:math:`m(x) = x_i^j * ... * x_k^l`
Parameters
----------
:param scalar_factors: a list of scalar factors the monomial consists of
Attributes
----------
factorisation_idxs: the indices of the values of all scalar 'sub' factors in the value array of the polynomial.
cannot be set at construction time, because all scalar factors need to receive their index first,
but not all required scalar factors might exist
"""
__slots__ = ["scalar_factors", "factorisation_idxs"]
def __init__(self, scalar_factors: List["ScalarFactor"]):
# assert len(scalar_factors) > 1, 'a monomial must consist of at least two scalar factors' # DEBUG
self.scalar_factors = scalar_factors
self.value_idx = (
None # initialize the idx with None to catch faulty evaluation tries
)
def __str__(self):
return " ".join([f.__str__() for f in self.scalar_factors])
def __repr__(self):
return self.__str__()
def num_ops(self):
# count the number of instructions done during compute (during eval() only looks up the computed value)
return len(self.scalar_factors) - 1 # product of all scalar factors
def compute(self, x, value_array):
# IMPORTANT: compute() of all the sub factors has had to be called before!
value = value_array[self.factorisation_idxs[0]]
for idx in self.factorisation_idxs[1:]:
value *= value_array[idx]
value_array[self.value_idx] = value
def get_recipe(self):
"""
for evaluation all scalar factors have to be multiplied (= monomial_recipe)
:return: monomial_recipe
"""
# target = source1 * source2
# instruction encoding: target, source1, source2
target, source1, source2 = (
self.value_idx,
self.factorisation_idxs[0],
self.factorisation_idxs[1],
)
monomial_recipe = [(target, source1, source2)]
source1 = target # always take the previously computed value
for source2 in self.factorisation_idxs[2:]:
# and multiply it with the remaining factor values
monomial_recipe += [(target, source1, source2)]
return monomial_recipe
class FactorContainer:
"""
a class for storing and reusing all factors appearing in a factorisation
"""
def __init__(self):
self.scalar_factors = []
self.monomial_factors = []
self.property2idx_scalar = {}
self.property2idx_monomial = {}
def get_factor(self, property_list):
"""
creates and stores objects of all required (sub-)factors if necessary
:param property_list: a list of dimension and exponent tuples [(d1,e1), (d2,e2)...]
representing the scalar factors of a monomial
:return: the object representing the factor with the given properties
"""
assert len(property_list) > 0 # TODO DEBUG
# create all required scalar factors
scalar_factors = []
monomial_id = 1
for prop in property_list:
d, e = prop
try:
scalar_idx = self.property2idx_scalar[prop]
scalar_factor = self.scalar_factors[scalar_idx]
except KeyError:
scalar_factor = ScalarFactor(d, e)
self.property2idx_scalar[prop] = len(self.scalar_factors)
self.scalar_factors.append(scalar_factor)
scalar_factors.append(scalar_factor)
assert len(scalar_factors) == len(property_list) # TODO DEBUG
if len(scalar_factors) == 1:
# the requested factor is a scalar factor
return scalar_factors[0]
# the requested factor is a monomial consisting of multiple factors
monomial_id = tuple(property_list)
try:
monomial_idx = self.property2idx_monomial[monomial_id]
monomial_factor = self.monomial_factors[monomial_idx]
except KeyError:
monomial_factor = MonomialFactor(scalar_factors)
self.property2idx_monomial[monomial_id] = len(self.monomial_factors)
self.monomial_factors.append(monomial_factor)
return monomial_factor
def get_factors(self, exponent_matrix):
"""
:param exponent_matrix:
:return: a list of all factors represented by the exponent_matrix with an identical ordering
"""
all_factors = []
# TODO optimise, modularise into functions: monomial factor, scalar factor... use numpy routines!?
for mon_nr in range(exponent_matrix.shape[0]):
exponent_vector = exponent_matrix[mon_nr, :]
scalar_factors = []
property_list = []
for dim, exp in enumerate(exponent_vector):
if exp > 0:
prop = (dim, exp)
property_list.append(prop)
scalar_factor = self.get_factor([prop])
scalar_factors.append(scalar_factor)
if len(scalar_factors) == 0:
factor = None # monomial consists of no factors
elif len(scalar_factors) == 1:
factor = scalar_factors[
0
] # monomial consists of a single scalar factor
else:
factor = self.get_factor(
property_list
) # monomial consists of a multiple scalar factors
all_factors.append(factor)
return all_factors
|
const http = require("http");
const File = require("./File.js");
class SimpleHttpServer {
constructor(config = {}) {
this.hostname = '127.0.0.1';
this.port = 3000;
this.baseDirectory = __dirname;
this.verbose = typeof config.verbose !== 'undefined' ? config.verbose : false;
this.server = null;
}
start(dirname = null) {
if(dirname) {
this.baseDirectory = dirname;
}
this.server = http.createServer((req, res) => {
this.requestRecieved(req, res);
});
this.server.listen(this.port, this.hostname, () => {
// do something on server boot here
});
}
stop(callback) {
this.server.close(callback);
}
requestRecieved(req, res) {
this.log(`Requested: ${req.url}`);
const file = this.loadFile(req.url);
if(!file.exists()) {
res.statusCode = 400;
res.end('');
this.log(`\tStatus: 400`);
return;
}
res.statusCode = 200;
res.setHeader('Content-Type', file.mime);
res.end(file.contents);
this.log(`\tStatus: 200`);
}
loadFile(path) {
const file = new File(path, this.baseDirectory);
return file;
}
log(message) {
if(this.verbose) {
console.log(message);
}
}
}
module.exports = SimpleHttpServer;
|
/*! For license information please see vendors~main.1f96e45aeead60dee58a.bundle.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(618)},function(module,exports,__webpack_require__){"use strict";var $TypeError=TypeError,$gOPD=Object.getOwnPropertyDescriptor;if($gOPD)try{$gOPD({},"")}catch(e){$gOPD=null}var throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return arguments.callee,throwTypeError}catch(calleeThrows){try{return $gOPD(arguments,"callee").get}catch(gOPDthrows){return throwTypeError}}}():throwTypeError,hasSymbols=__webpack_require__(26)(),getProto=Object.getPrototypeOf||function(x){return x.__proto__},asyncGenIterator=void 0,TypedArray="undefined"==typeof Uint8Array?void 0:getProto(Uint8Array),INTRINSICS={"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":hasSymbols?getProto([][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%":asyncGenIterator&&hasSymbols&&Symbol.asyncIterator?asyncGenIterator[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%":hasSymbols?getProto(getProto([][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&&hasSymbols?getProto((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&&hasSymbols?getProto((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%":hasSymbols?getProto(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":hasSymbols?Symbol:void 0,"%SymbolPrototype%":hasSymbols?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypedArrayPrototype%":TypedArray?TypedArray.prototype:void 0,"%TypeError%":$TypeError,"%TypeErrorPrototype%":$TypeError.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},$replace=__webpack_require__(72).call(Function.call,String.prototype.replace),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(string){var result=[];return $replace(string,rePropName,(function(match,number,quote,subString){result[result.length]=quote?$replace(subString,reEscapeChar,"$1"):number||match})),result},getBaseIntrinsic=function getBaseIntrinsic(name,allowMissing){if(!(name in INTRINSICS))throw new SyntaxError("intrinsic "+name+" does not exist!");if(void 0===INTRINSICS[name]&&!allowMissing)throw new $TypeError("intrinsic "+name+" exists, but is not available. Please file an issue!");return INTRINSICS[name]};module.exports=function GetIntrinsic(name,allowMissing){if("string"!=typeof name||0===name.length)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof allowMissing)throw new TypeError('"allowMissing" argument must be a boolean');for(var parts=stringToPath(name),value=getBaseIntrinsic("%"+(parts.length>0?parts[0]:"")+"%",allowMissing),i=1;i<parts.length;i+=1)if(null!=value)if($gOPD&&i+1>=parts.length){var desc=$gOPD(value,parts[i]);if(!(allowMissing||parts[i]in value))throw new $TypeError("base intrinsic for "+name+" exists, but the property is not available.");value=desc?desc.get||desc.value:value[parts[i]]}else value=value[parts[i]];return value}},function(module,exports,__webpack_require__){var global=__webpack_require__(3),getOwnPropertyDescriptor=__webpack_require__(76).f,createNonEnumerableProperty=__webpack_require__(28),redefine=__webpack_require__(21),setGlobal=__webpack_require__(131),copyConstructorProperties=__webpack_require__(208),isForced=__webpack_require__(100);module.exports=function(options,source){var target,key,targetProperty,sourceProperty,descriptor,TARGET=options.target,GLOBAL=options.global,STATIC=options.stat;if(target=GLOBAL?global:STATIC?global[TARGET]||setGlobal(TARGET,{}):(global[TARGET]||{}).prototype)for(key in source){if(sourceProperty=source[key],targetProperty=options.noTargetGet?(descriptor=getOwnPropertyDescriptor(target,key))&&descriptor.value:target[key],!isForced(GLOBAL?key:TARGET+(STATIC?".":"#")+key,options.forced)&&void 0!==targetProperty){if(typeof sourceProperty==typeof targetProperty)continue;copyConstructorProperties(sourceProperty,targetProperty)}(options.sham||targetProperty&&targetProperty.sham)&&createNonEnumerableProperty(sourceProperty,"sham",!0),redefine(target,key,sourceProperty,options)}}},function(module,exports,__webpack_require__){(function(global){var check=function(it){return it&&it.Math==Math&&it};module.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||Function("return this")()}).call(this,__webpack_require__(20))},function(module,exports,__webpack_require__){"use strict";var ES5Type=__webpack_require__(187);module.exports=function Type(x){return"symbol"==typeof x?"Symbol":ES5Type(x)}},function(module,exports){module.exports=function(exec){try{return!!exec()}catch(error){return!0}}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),callBind=__webpack_require__(120),$indexOf=callBind(GetIntrinsic("String.prototype.indexOf"));module.exports=function callBoundIntrinsic(name,allowMissing){var intrinsic=GetIntrinsic(name,!!allowMissing);return"function"==typeof intrinsic&&$indexOf(name,".prototype.")?callBind(intrinsic):intrinsic}},function(module,exports,__webpack_require__){var global=__webpack_require__(3),shared=__webpack_require__(133),has=__webpack_require__(14),uid=__webpack_require__(97),NATIVE_SYMBOL=__webpack_require__(139),USE_SYMBOL_AS_UID=__webpack_require__(212),WellKnownSymbolsStore=shared("wks"),Symbol=global.Symbol,createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol:Symbol&&Symbol.withoutSetter||uid;module.exports=function(name){return has(WellKnownSymbolsStore,name)||(NATIVE_SYMBOL&&has(Symbol,name)?WellKnownSymbolsStore[name]=Symbol[name]:WellKnownSymbolsStore[name]=createWellKnownSymbol("Symbol."+name)),WellKnownSymbolsStore[name]}},function(module,exports){module.exports=function(it){return"object"==typeof it?null!==it:"function"==typeof it}},function(module,exports,__webpack_require__){"use strict";var keys=__webpack_require__(312),hasSymbols="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),toStr=Object.prototype.toString,concat=Array.prototype.concat,origDefineProperty=Object.defineProperty,supportsDescriptors=origDefineProperty&&function(){var obj={};try{for(var _ in origDefineProperty(obj,"x",{enumerable:!1,value:obj}),obj)return!1;return obj.x===obj}catch(e){return!1}}(),defineProperty=function(object,name,value,predicate){var fn;name in object&&("function"!=typeof(fn=predicate)||"[object Function]"!==toStr.call(fn)||!predicate())||(supportsDescriptors?origDefineProperty(object,name,{configurable:!0,enumerable:!1,value:value,writable:!0}):object[name]=value)},defineProperties=function(object,map){var predicates=arguments.length>2?arguments[2]:{},props=keys(map);hasSymbols&&(props=concat.call(props,Object.getOwnPropertySymbols(map)));for(var i=0;i<props.length;i+=1)defineProperty(object,props[i],map[props[i]],predicates[props[i]])};defineProperties.supportsDescriptors=!!supportsDescriptors,module.exports=defineProperties},,function(module,exports,__webpack_require__){var path=__webpack_require__(134),has=__webpack_require__(14),wrappedWellKnownSymbolModule=__webpack_require__(216),defineProperty=__webpack_require__(16).f;module.exports=function(NAME){var Symbol=path.Symbol||(path.Symbol={});has(Symbol,NAME)||defineProperty(Symbol,NAME,{value:wrappedWellKnownSymbolModule.f(NAME)})}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),function(process){__webpack_require__.d(__webpack_exports__,"ServerStyleSheet",(function(){return ServerStyleSheet})),__webpack_require__.d(__webpack_exports__,"StyleSheetConsumer",(function(){return StyleSheetConsumer})),__webpack_require__.d(__webpack_exports__,"StyleSheetContext",(function(){return StyleSheetContext})),__webpack_require__.d(__webpack_exports__,"StyleSheetManager",(function(){return StyleSheetManager})),__webpack_require__.d(__webpack_exports__,"ThemeConsumer",(function(){return ThemeConsumer})),__webpack_require__.d(__webpack_exports__,"ThemeContext",(function(){return ThemeContext})),__webpack_require__.d(__webpack_exports__,"ThemeProvider",(function(){return ThemeProvider})),__webpack_require__.d(__webpack_exports__,"__PRIVATE__",(function(){return __PRIVATE__})),__webpack_require__.d(__webpack_exports__,"createGlobalStyle",(function(){return createGlobalStyle})),__webpack_require__.d(__webpack_exports__,"css",(function(){return css})),__webpack_require__.d(__webpack_exports__,"isStyledComponent",(function(){return isStyledComponent})),__webpack_require__.d(__webpack_exports__,"keyframes",(function(){return keyframes})),__webpack_require__.d(__webpack_exports__,"useTheme",(function(){return useTheme})),__webpack_require__.d(__webpack_exports__,"version",(function(){return version})),__webpack_require__.d(__webpack_exports__,"withTheme",(function(){return withTheme}));var react_is__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(171),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__),shallowequal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(299),shallowequal__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(shallowequal__WEBPACK_IMPORTED_MODULE_2__),_emotion_stylis__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(300),_emotion_unitless__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(301),_emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(302),hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(172),hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6__);function _extends(){return(_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target}).apply(this,arguments)}var interleave=function(strings,interpolations){for(var result=[strings[0]],i=0,len=interpolations.length;i<len;i+=1)result.push(interpolations[i],strings[i+1]);return result},isPlainObject=function(x){return"object"==typeof x&&x.constructor===Object},EMPTY_ARRAY=Object.freeze([]),EMPTY_OBJECT=Object.freeze({});function isFunction(test){return"function"==typeof test}function getComponentName(target){return target.displayName||target.name||"Component"}function isStyledComponent(target){return target&&"string"==typeof target.styledComponentId}var SC_ATTR=void 0!==process&&(Object({NODE_ENV:"production",NODE_PATH:"",PUBLIC_URL:"."}).REACT_APP_SC_ATTR||Object({NODE_ENV:"production",NODE_PATH:"",PUBLIC_URL:"."}).SC_ATTR)||"data-styled",IS_BROWSER="undefined"!=typeof window&&"HTMLElement"in window,DISABLE_SPEEDY="boolean"==typeof SC_DISABLE_SPEEDY&&SC_DISABLE_SPEEDY||void 0!==process&&(Object({NODE_ENV:"production",NODE_PATH:"",PUBLIC_URL:"."}).REACT_APP_SC_DISABLE_SPEEDY||Object({NODE_ENV:"production",NODE_PATH:"",PUBLIC_URL:"."}).SC_DISABLE_SPEEDY)||!1,STATIC_EXECUTION_CONTEXT={},getNonce=function getNonce(){return __webpack_require__.nc};function throwStyledComponentsError(code){for(var _len=arguments.length,interpolations=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)interpolations[_key-1]=arguments[_key];throw new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/master/packages/styled-components/src/utils/errors.md#"+code+" for more information."+(interpolations.length>0?" Additional arguments: "+interpolations.join(", "):""))}var makeStyleTag=function makeStyleTag(target){var head=document.head,parent=target||head,style=document.createElement("style"),prevStyle=function findLastStyleTag(target){for(var childNodes=target.childNodes,i=childNodes.length;i>=0;i--){var child=childNodes[i];if(child&&1===child.nodeType&&child.hasAttribute(SC_ATTR))return child}}(parent),nextSibling=void 0!==prevStyle?prevStyle.nextSibling:null;style.setAttribute(SC_ATTR,"active"),style.setAttribute("data-styled-version","5.0.1");var nonce=getNonce();return nonce&&style.setAttribute("nonce",nonce),parent.insertBefore(style,nextSibling),style},CSSOMTag=function(){function CSSOMTag(target){var element=this.element=makeStyleTag(target);element.appendChild(document.createTextNode("")),this.sheet=function getSheet(tag){if(tag.sheet)return tag.sheet;for(var styleSheets=document.styleSheets,i=0,l=styleSheets.length;i<l;i++){var sheet=styleSheets[i];if(sheet.ownerNode===tag)return sheet}throwStyledComponentsError(17)}(element),this.length=0}var _proto=CSSOMTag.prototype;return _proto.insertRule=function insertRule(index,rule){try{return this.sheet.insertRule(rule,index),this.length++,!0}catch(_error){return!1}},_proto.deleteRule=function deleteRule(index){this.sheet.deleteRule(index),this.length--},_proto.getRule=function getRule(index){var rule=this.sheet.cssRules[index];return void 0!==rule&&"string"==typeof rule.cssText?rule.cssText:""},CSSOMTag}(),TextTag=function(){function TextTag(target){var element=this.element=makeStyleTag(target);this.nodes=element.childNodes,this.length=0}var _proto2=TextTag.prototype;return _proto2.insertRule=function insertRule(index,rule){if(index<=this.length&&index>=0){var node=document.createTextNode(rule),refNode=this.nodes[index];return this.element.insertBefore(node,refNode||null),this.length++,!0}return!1},_proto2.deleteRule=function deleteRule(index){this.element.removeChild(this.nodes[index]),this.length--},_proto2.getRule=function getRule(index){return index<this.length?this.nodes[index].textContent:""},TextTag}(),VirtualTag=function(){function VirtualTag(_target){this.rules=[],this.length=0}var _proto3=VirtualTag.prototype;return _proto3.insertRule=function insertRule(index,rule){return index<=this.length&&(this.rules.splice(index,0,rule),this.length++,!0)},_proto3.deleteRule=function deleteRule(index){this.rules.splice(index,1),this.length--},_proto3.getRule=function getRule(index){return index<this.length?this.rules[index]:""},VirtualTag}(),DefaultGroupedTag=function(){function DefaultGroupedTag(tag){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=tag}var _proto=DefaultGroupedTag.prototype;return _proto.indexOfGroup=function indexOfGroup(group){for(var index=0,i=0;i<group;i++)index+=this.groupSizes[i];return index},_proto.insertRules=function insertRules(group,rules){if(group>=this.groupSizes.length){for(var oldBuffer=this.groupSizes,oldSize=oldBuffer.length,newSize=oldSize;group>=newSize;)(newSize<<=1)<0&&throwStyledComponentsError(16,""+group);this.groupSizes=new Uint32Array(newSize),this.groupSizes.set(oldBuffer),this.length=newSize;for(var i=oldSize;i<newSize;i++)this.groupSizes[i]=0}for(var ruleIndex=this.indexOfGroup(group+1),_i=0,l=rules.length;_i<l;_i++)this.tag.insertRule(ruleIndex,rules[_i])&&(this.groupSizes[group]++,ruleIndex++)},_proto.clearGroup=function clearGroup(group){if(group<this.length){var length=this.groupSizes[group],startIndex=this.indexOfGroup(group),endIndex=startIndex+length;this.groupSizes[group]=0;for(var i=startIndex;i<endIndex;i++)this.tag.deleteRule(startIndex)}},_proto.getGroup=function getGroup(group){var css="";if(group>=this.length||0===this.groupSizes[group])return css;for(var length=this.groupSizes[group],startIndex=this.indexOfGroup(group),endIndex=startIndex+length,i=startIndex;i<endIndex;i++)css+=this.tag.getRule(i)+"\n";return css},DefaultGroupedTag}(),groupIDRegister=new Map,reverseRegister=new Map,nextFreeGroup=1,getGroupForId=function getGroupForId(id){if(groupIDRegister.has(id))return groupIDRegister.get(id);var group=nextFreeGroup++;return groupIDRegister.set(id,group),reverseRegister.set(group,id),group},getIdForGroup=function getIdForGroup(group){return reverseRegister.get(group)},setGroupForId=function setGroupForId(id,group){group>=nextFreeGroup&&(nextFreeGroup=group+1),groupIDRegister.set(id,group),reverseRegister.set(group,id)},SELECTOR="style["+SC_ATTR+'][data-styled-version="5.0.1"]',RULE_RE=/(?:\s*)?(.*?){((?:{[^}]*}|(?!{).*?)*)}/g,MARKER_RE=new RegExp("^"+SC_ATTR+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\]'),rehydrateNamesFromContent=function rehydrateNamesFromContent(sheet,id,content){for(var name,names=content.split(","),i=0,l=names.length;i<l;i++)(name=names[i])&&sheet.registerName(id,name)},rehydrateSheetFromTag=function rehydrateSheetFromTag(sheet,style){for(var parts,rawHTML=style.innerHTML,rules=[];parts=RULE_RE.exec(rawHTML);){var marker=parts[1].match(MARKER_RE);if(marker){var group=0|parseInt(marker[1],10),id=marker[2];0!==group&&(setGroupForId(id,group),rehydrateNamesFromContent(sheet,id,parts[2].split('"')[1]),sheet.getTag().insertRules(group,rules)),rules.length=0}else rules.push(parts[0].trim())}},SHOULD_REHYDRATE=IS_BROWSER,defaultOptions={isServer:!IS_BROWSER,useCSSOMInjection:!DISABLE_SPEEDY},StyleSheet=function(){function StyleSheet(options,globalStyles,names){void 0===options&&(options=defaultOptions),void 0===globalStyles&&(globalStyles={}),this.options=_extends({},defaultOptions,{},options),this.gs=globalStyles,this.names=new Map(names),!this.options.isServer&&IS_BROWSER&&SHOULD_REHYDRATE&&(SHOULD_REHYDRATE=!1,function rehydrateSheet(sheet){for(var nodes=document.querySelectorAll(SELECTOR),i=0,l=nodes.length;i<l;i++){var node=nodes[i];node&&"active"!==node.getAttribute(SC_ATTR)&&(rehydrateSheetFromTag(sheet,node),node.parentNode&&node.parentNode.removeChild(node))}}(this))}StyleSheet.registerId=function registerId(id){return getGroupForId(id)};var _proto=StyleSheet.prototype;return _proto.reconstructWithOptions=function reconstructWithOptions(options){return new StyleSheet(_extends({},this.options,{},options),this.gs,this.names)},_proto.allocateGSInstance=function allocateGSInstance(id){return this.gs[id]=(this.gs[id]||0)+1},_proto.getTag=function getTag(){return this.tag||(this.tag=function makeGroupedTag(tag){return new DefaultGroupedTag(tag)}(function makeTag(_ref){var isServer=_ref.isServer,useCSSOMInjection=_ref.useCSSOMInjection,target=_ref.target;return isServer?new VirtualTag(target):useCSSOMInjection?new CSSOMTag(target):new TextTag(target)}(this.options)))},_proto.hasNameForId=function hasNameForId(id,name){return this.names.has(id)&&this.names.get(id).has(name)},_proto.registerName=function registerName(id,name){if(getGroupForId(id),this.names.has(id))this.names.get(id).add(name);else{var groupNames=new Set;groupNames.add(name),this.names.set(id,groupNames)}},_proto.insertRules=function insertRules(id,name,rules){this.registerName(id,name),this.getTag().insertRules(getGroupForId(id),rules)},_proto.clearNames=function clearNames(id){this.names.has(id)&&this.names.get(id).clear()},_proto.clearRules=function clearRules(id){this.getTag().clearGroup(getGroupForId(id)),this.clearNames(id)},_proto.clearTag=function clearTag(){this.tag=void 0},_proto.toString=function toString(){return function outputSheet(sheet){for(var tag=sheet.getTag(),length=tag.length,css="",group=0;group<length;group++){var id=getIdForGroup(group);if(void 0!==id){var names=sheet.names.get(id),rules=tag.getGroup(group);if(void 0!==names&&0!==rules.length){var selector=SC_ATTR+".g"+group+'[id="'+id+'"]',content="";void 0!==names&&names.forEach((function(name){name.length>0&&(content+=name+",")})),css+=""+rules+selector+'{content:"'+content+'"}\n'}}}return css}(this)},StyleSheet}(),phash=function phash(h,x){for(var i=x.length;i;)h=33*h^x.charCodeAt(--i);return h},hash=function hash(x){return phash(5381,x)};var COMMENT_REGEX=/^\s*\/\/.*$/gm;function createStylisInstance(_temp){var _componentId,_selector,_selectorRegexp,_ref=void 0===_temp?EMPTY_OBJECT:_temp,_ref$options=_ref.options,options=void 0===_ref$options?EMPTY_OBJECT:_ref$options,_ref$plugins=_ref.plugins,plugins=void 0===_ref$plugins?EMPTY_ARRAY:_ref$plugins,stylis=new _emotion_stylis__WEBPACK_IMPORTED_MODULE_3__.a(options),parsingRules=[],parseRulesPlugin=function insertRulePlugin(insertRule){function toSheet(block){if(block)try{insertRule(block+"}")}catch(e){}}return function ruleSheet(context,content,selectors,parents,line,column,length,ns,depth,at){switch(context){case 1:if(0===depth&&64===content.charCodeAt(0))return insertRule(content+";"),"";break;case 2:if(0===ns)return content+"/*|*/";break;case 3:switch(ns){case 102:case 112:return insertRule(selectors[0]+content),"";default:return content+(0===at?"/*|*/":"")}case-2:content.split("/*|*/}").forEach(toSheet)}}}((function(rule){parsingRules.push(rule)})),selfReferenceReplacer=function selfReferenceReplacer(match,offset,string){return offset>0&&-1!==string.slice(0,offset).indexOf(_selector)&&string.slice(offset-_selector.length,offset)!==_selector?"."+_componentId:match};function stringifyRules(css,selector,prefix,componentId){void 0===componentId&&(componentId="&");var flatCSS=css.replace(COMMENT_REGEX,""),cssStr=selector&&prefix?prefix+" "+selector+" { "+flatCSS+" }":flatCSS;return _componentId=componentId,_selector=selector,_selectorRegexp=new RegExp("\\"+_selector+"\\b","g"),stylis(prefix||!selector?"":selector,cssStr)}return stylis.use([].concat(plugins,[function selfReferenceReplacementPlugin(context,_,selectors){2===context&&selectors.length&&selectors[0].lastIndexOf(_selector)>0&&(selectors[0]=selectors[0].replace(_selectorRegexp,selfReferenceReplacer))},parseRulesPlugin,function returnRulesPlugin(context){if(-2===context){var parsedRules=parsingRules;return parsingRules=[],parsedRules}}])),stringifyRules.hash=plugins.length?plugins.reduce((function(acc,plugin){return plugin.name||throwStyledComponentsError(15),phash(acc,plugin.name)}),5381).toString():"",stringifyRules}var StyleSheetContext=react__WEBPACK_IMPORTED_MODULE_1___default.a.createContext(),StyleSheetConsumer=StyleSheetContext.Consumer,StylisContext=react__WEBPACK_IMPORTED_MODULE_1___default.a.createContext(),masterSheet=(StylisContext.Consumer,new StyleSheet),masterStylis=createStylisInstance();function useStyleSheet(){return Object(react__WEBPACK_IMPORTED_MODULE_1__.useContext)(StyleSheetContext)||masterSheet}function useStylis(){return Object(react__WEBPACK_IMPORTED_MODULE_1__.useContext)(StylisContext)||masterStylis}function StyleSheetManager(props){var _useState=Object(react__WEBPACK_IMPORTED_MODULE_1__.useState)(props.stylisPlugins),plugins=_useState[0],setPlugins=_useState[1],contextStyleSheet=useStyleSheet(),styleSheet=Object(react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((function(){var sheet=contextStyleSheet;return props.sheet?sheet=props.sheet:props.target&&(sheet=sheet.reconstructWithOptions({target:props.target})),props.disableCSSOMInjection&&(sheet=sheet.reconstructWithOptions({useCSSOMInjection:!1})),sheet}),[props.disableCSSOMInjection,props.sheet,props.target]),stylis=Object(react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((function(){return createStylisInstance({options:{prefix:!props.disableVendorPrefixes},plugins:plugins})}),[props.disableVendorPrefixes,plugins]);return Object(react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((function(){shallowequal__WEBPACK_IMPORTED_MODULE_2___default()(plugins,props.stylisPlugins)||setPlugins(props.stylisPlugins)}),[props.stylisPlugins]),react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(StyleSheetContext.Provider,{value:styleSheet},react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(StylisContext.Provider,{value:stylis},props.children))}var Keyframes=function(){function Keyframes(name,stringifyArgs){var _this=this;this.inject=function(styleSheet){styleSheet.hasNameForId(_this.id,_this.name)||styleSheet.insertRules(_this.id,_this.name,masterStylis.apply(void 0,_this.stringifyArgs))},this.toString=function(){return throwStyledComponentsError(12,String(_this.name))},this.name=name,this.id="sc-keyframes-"+name,this.stringifyArgs=stringifyArgs}return Keyframes.prototype.getName=function getName(){return this.name},Keyframes}(),uppercasePattern=/([A-Z])/g,msPattern=/^ms-/;function hyphenateStyleName(string){return string.replace(uppercasePattern,"-$1").toLowerCase().replace(msPattern,"-ms-")}var isFalsish=function isFalsish(chunk){return null==chunk||!1===chunk||""===chunk},objToCssArray=function objToCssArray(obj,prevKey){var rules=[];return Object.keys(obj).forEach((function(key){if(!isFalsish(obj[key])){if(isPlainObject(obj[key]))return rules.push.apply(rules,objToCssArray(obj[key],key)),rules;if(isFunction(obj[key]))return rules.push(hyphenateStyleName(key)+":",obj[key],";"),rules;rules.push(hyphenateStyleName(key)+": "+function addUnitIfNeeded(name,value){return null==value||"boolean"==typeof value||""===value?"":"number"!=typeof value||0===value||name in _emotion_unitless__WEBPACK_IMPORTED_MODULE_4__.a?String(value).trim():value+"px"}(key,obj[key])+";")}return rules})),prevKey?[prevKey+" {"].concat(rules,["}"]):rules};function flatten(chunk,executionContext,styleSheet){if(Array.isArray(chunk)){for(var result,ruleSet=[],i=0,len=chunk.length;i<len;i+=1)""!==(result=flatten(chunk[i],executionContext,styleSheet))&&(Array.isArray(result)?ruleSet.push.apply(ruleSet,result):ruleSet.push(result));return ruleSet}return isFalsish(chunk)?"":isStyledComponent(chunk)?"."+chunk.styledComponentId:isFunction(chunk)?function isStatelessFunction(test){return"function"==typeof test&&!(test.prototype&&test.prototype.isReactComponent)}(chunk)&&executionContext?flatten(chunk(executionContext),executionContext,styleSheet):chunk:chunk instanceof Keyframes?styleSheet?(chunk.inject(styleSheet),chunk.getName()):chunk:isPlainObject(chunk)?objToCssArray(chunk):chunk.toString()}function css(styles){for(var _len=arguments.length,interpolations=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)interpolations[_key-1]=arguments[_key];return isFunction(styles)||isPlainObject(styles)?flatten(interleave(EMPTY_ARRAY,[styles].concat(interpolations))):0===interpolations.length&&1===styles.length&&"string"==typeof styles[0]?styles:flatten(interleave(styles,interpolations))}var isObject=function isObject(val){return"function"==typeof val||"object"==typeof val&&null!==val&&!Array.isArray(val)},isValidKey=function isValidKey(key){return"__proto__"!==key&&"constructor"!==key&&"prototype"!==key};function mixin(target,val,key){var obj=target[key];isObject(val)&&isObject(obj)?mixinDeep(obj,val):target[key]=val}function mixinDeep(target){for(var _len=arguments.length,rest=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)rest[_key-1]=arguments[_key];for(var _i=0,_rest=rest;_i<_rest.length;_i++){var obj=_rest[_i];if(isObject(obj))for(var key in obj)isValidKey(key)&&mixin(target,obj[key],key)}return target}var AD_REPLACER_R=/(a)(d)/gi,getAlphabeticChar=function getAlphabeticChar(code){return String.fromCharCode(code+(code>25?39:97))};function generateAlphabeticName(code){var x,name="";for(x=Math.abs(code);x>52;x=x/52|0)name=getAlphabeticChar(x%52)+name;return(getAlphabeticChar(x%52)+name).replace(AD_REPLACER_R,"$1-$2")}function isStaticRules(rules){for(var i=0;i<rules.length;i+=1){var rule=rules[i];if(isFunction(rule)&&!isStyledComponent(rule))return!1}return!0}var ComponentStyle=function(){function ComponentStyle(rules,componentId){this.rules=rules,this.staticRulesId="",this.isStatic=isStaticRules(rules),this.componentId=componentId,this.baseHash=hash(componentId),StyleSheet.registerId(componentId)}return ComponentStyle.prototype.generateAndInjectStyles=function generateAndInjectStyles(executionContext,styleSheet,stylis){var componentId=this.componentId;if(this.isStatic&&!stylis.hash){if(this.staticRulesId&&styleSheet.hasNameForId(componentId,this.staticRulesId))return this.staticRulesId;var cssStatic=flatten(this.rules,executionContext,styleSheet).join(""),name=generateAlphabeticName(phash(this.baseHash,cssStatic.length)>>>0);if(!styleSheet.hasNameForId(componentId,name)){var cssStaticFormatted=stylis(cssStatic,"."+name,void 0,componentId);styleSheet.insertRules(componentId,name,cssStaticFormatted)}return this.staticRulesId=name,name}for(var length=this.rules.length,dynamicHash=phash(this.baseHash,stylis.hash),css="",i=0;i<length;i++){var partRule=this.rules[i];if("string"==typeof partRule)css+=partRule;else{var partChunk=flatten(partRule,executionContext,styleSheet),partString=Array.isArray(partChunk)?partChunk.join(""):partChunk;dynamicHash=phash(dynamicHash,partString+i),css+=partString}}var _name=generateAlphabeticName(dynamicHash>>>0);if(!styleSheet.hasNameForId(componentId,_name)){var cssFormatted=stylis(css,"."+_name,void 0,componentId);styleSheet.insertRules(componentId,_name,cssFormatted)}return _name},ComponentStyle}(),determineTheme=(new Set,function(props,providedTheme,defaultProps){return void 0===defaultProps&&(defaultProps=EMPTY_OBJECT),props.theme!==defaultProps.theme&&props.theme||providedTheme||defaultProps.theme}),escapeRegex=/[[\].#*$><+~=|^:(),"'`-]+/g,dashesAtEnds=/(^-|-$)/g;function escape(str){return str.replace(escapeRegex,"-").replace(dashesAtEnds,"")}function isTag(target){return"string"==typeof target&&!0}var generateComponentId=function(str){return generateAlphabeticName(hash(str)>>>0)};var ThemeContext=react__WEBPACK_IMPORTED_MODULE_1___default.a.createContext(),ThemeConsumer=ThemeContext.Consumer;function ThemeProvider(props){var outerTheme=Object(react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ThemeContext),themeContext=Object(react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((function(){return function mergeTheme(theme,outerTheme){return theme?isFunction(theme)?theme(outerTheme):Array.isArray(theme)||"object"!=typeof theme?throwStyledComponentsError(8):outerTheme?_extends({},outerTheme,{},theme):theme:throwStyledComponentsError(14)}(props.theme,outerTheme)}),[props.theme,outerTheme]);return props.children?react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ThemeContext.Provider,{value:themeContext},props.children):null}var identifiers={};function useStyledComponentImpl(forwardedComponent,props,forwardedRef){var componentAttrs=forwardedComponent.attrs,componentStyle=forwardedComponent.componentStyle,defaultProps=forwardedComponent.defaultProps,foldedComponentIds=forwardedComponent.foldedComponentIds,styledComponentId=forwardedComponent.styledComponentId,target=forwardedComponent.target;Object(react__WEBPACK_IMPORTED_MODULE_1__.useDebugValue)(styledComponentId);var _useResolvedAttrs=function useResolvedAttrs(theme,props,attrs){void 0===theme&&(theme=EMPTY_OBJECT);var context=_extends({},props,{theme:theme}),resolvedAttrs={};return attrs.forEach((function(attrDef){var key,a,b,resolvedAttrDef=attrDef;for(key in isFunction(resolvedAttrDef)&&(resolvedAttrDef=resolvedAttrDef(context)),resolvedAttrDef)context[key]=resolvedAttrs[key]="className"===key?(a=resolvedAttrs[key],b=resolvedAttrDef[key],a&&b?a+" "+b:a||b):resolvedAttrDef[key]})),[context,resolvedAttrs]}(determineTheme(props,Object(react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ThemeContext),defaultProps)||EMPTY_OBJECT,props,componentAttrs),context=_useResolvedAttrs[0],attrs=_useResolvedAttrs[1],generatedClassName=function useInjectedStyle(componentStyle,hasAttrs,resolvedAttrs,warnTooManyClasses){var styleSheet=useStyleSheet(),stylis=useStylis(),className=componentStyle.isStatic&&!hasAttrs?componentStyle.generateAndInjectStyles(EMPTY_OBJECT,styleSheet,stylis):componentStyle.generateAndInjectStyles(resolvedAttrs,styleSheet,stylis);return Object(react__WEBPACK_IMPORTED_MODULE_1__.useDebugValue)(className),className}(componentStyle,componentAttrs.length>0,context),refToForward=forwardedRef,elementToBeCreated=attrs.as||props.as||target,isTargetTag=isTag(elementToBeCreated),computedProps=attrs!==props?_extends({},props,{},attrs):props,shouldFilterProps=isTargetTag||"as"in computedProps||"forwardedAs"in computedProps,propsForElement=shouldFilterProps?{}:_extends({},computedProps);if(shouldFilterProps)for(var key in computedProps)"forwardedAs"===key?propsForElement.as=computedProps[key]:"as"===key||"forwardedAs"===key||isTargetTag&&!Object(_emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_5__.a)(key)||(propsForElement[key]=computedProps[key]);return props.style&&attrs.style!==props.style&&(propsForElement.style=_extends({},props.style,{},attrs.style)),propsForElement.className=Array.prototype.concat(foldedComponentIds,styledComponentId,generatedClassName!==styledComponentId?generatedClassName:null,props.className,attrs.className).filter(Boolean).join(" "),propsForElement.ref=refToForward,Object(react__WEBPACK_IMPORTED_MODULE_1__.createElement)(elementToBeCreated,propsForElement)}function createStyledComponent(target,options,rules){var WrappedStyledComponent,isTargetStyledComp=isStyledComponent(target),isCompositeComponent=!isTag(target),_options$displayName=options.displayName,displayName=void 0===_options$displayName?function generateDisplayName(target){return isTag(target)?"styled."+target:"Styled("+getComponentName(target)+")"}(target):_options$displayName,_options$componentId=options.componentId,componentId=void 0===_options$componentId?function generateId(displayName,parentComponentId){var name="string"!=typeof displayName?"sc":escape(displayName);identifiers[name]=(identifiers[name]||0)+1;var componentId=name+"-"+generateComponentId(name+identifiers[name]);return parentComponentId?parentComponentId+"-"+componentId:componentId}(options.displayName,options.parentComponentId):_options$componentId,_options$attrs=options.attrs,attrs=void 0===_options$attrs?EMPTY_ARRAY:_options$attrs,styledComponentId=options.displayName&&options.componentId?escape(options.displayName)+"-"+options.componentId:options.componentId||componentId,finalAttrs=isTargetStyledComp&&target.attrs?Array.prototype.concat(target.attrs,attrs).filter(Boolean):attrs,componentStyle=new ComponentStyle(isTargetStyledComp?target.componentStyle.rules.concat(rules):rules,styledComponentId),forwardRef=function forwardRef(props,ref){return useStyledComponentImpl(WrappedStyledComponent,props,ref)};return forwardRef.displayName=displayName,(WrappedStyledComponent=react__WEBPACK_IMPORTED_MODULE_1___default.a.forwardRef(forwardRef)).attrs=finalAttrs,WrappedStyledComponent.componentStyle=componentStyle,WrappedStyledComponent.displayName=displayName,WrappedStyledComponent.foldedComponentIds=isTargetStyledComp?Array.prototype.concat(target.foldedComponentIds,target.styledComponentId):EMPTY_ARRAY,WrappedStyledComponent.styledComponentId=styledComponentId,WrappedStyledComponent.target=isTargetStyledComp?target.target:target,WrappedStyledComponent.withComponent=function withComponent(tag){var previousComponentId=options.componentId,optionsToCopy=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(options,["componentId"]),newComponentId=previousComponentId&&previousComponentId+"-"+(isTag(tag)?tag:escape(getComponentName(tag)));return createStyledComponent(tag,_extends({},optionsToCopy,{attrs:finalAttrs,componentId:newComponentId}),rules)},Object.defineProperty(WrappedStyledComponent,"defaultProps",{get:function get(){return this._foldedDefaultProps},set:function set(obj){this._foldedDefaultProps=isTargetStyledComp?mixinDeep({},target.defaultProps,obj):obj}}),WrappedStyledComponent.toString=function(){return"."+WrappedStyledComponent.styledComponentId},isCompositeComponent&&hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default()(WrappedStyledComponent,target,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,self:!0,styledComponentId:!0,target:!0,withComponent:!0}),WrappedStyledComponent}var styled=function styled(tag){return function constructWithOptions(componentConstructor,tag,options){if(void 0===options&&(options=EMPTY_OBJECT),!Object(react_is__WEBPACK_IMPORTED_MODULE_0__.isValidElementType)(tag))return throwStyledComponentsError(1,String(tag));var templateFunction=function templateFunction(){return componentConstructor(tag,options,css.apply(void 0,arguments))};return templateFunction.withConfig=function(config){return constructWithOptions(componentConstructor,tag,_extends({},options,{},config))},templateFunction.attrs=function(attrs){return constructWithOptions(componentConstructor,tag,_extends({},options,{attrs:Array.prototype.concat(options.attrs,attrs).filter(Boolean)}))},templateFunction}(createStyledComponent,tag)};["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","marquee","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","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(domElement){styled[domElement]=styled(domElement)}));var GlobalStyle=function(){function GlobalStyle(rules,componentId){this.rules=rules,this.componentId=componentId,this.isStatic=isStaticRules(rules)}var _proto=GlobalStyle.prototype;return _proto.createStyles=function createStyles(instance,executionContext,styleSheet,stylis){var css=stylis(flatten(this.rules,executionContext,styleSheet).join(""),""),id=this.componentId+instance;styleSheet.insertRules(id,id,css)},_proto.removeStyles=function removeStyles(instance,styleSheet){styleSheet.clearRules(this.componentId+instance)},_proto.renderStyles=function renderStyles(instance,executionContext,styleSheet,stylis){StyleSheet.registerId(this.componentId+instance),this.removeStyles(instance,styleSheet),this.createStyles(instance,executionContext,styleSheet,stylis)},GlobalStyle}();function createGlobalStyle(strings){for(var _len=arguments.length,interpolations=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)interpolations[_key-1]=arguments[_key];var rules=css.apply(void 0,[strings].concat(interpolations)),styledComponentId="sc-global-"+generateComponentId(JSON.stringify(rules)),globalStyle=new GlobalStyle(rules,styledComponentId);function GlobalStyleComponent(props){var styleSheet=useStyleSheet(),stylis=useStylis(),theme=Object(react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ThemeContext),instanceRef=Object(react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);null===instanceRef.current&&(instanceRef.current=styleSheet.allocateGSInstance(styledComponentId));var instance=instanceRef.current;if(globalStyle.isStatic)globalStyle.renderStyles(instance,STATIC_EXECUTION_CONTEXT,styleSheet,stylis);else{var context=_extends({},props,{theme:determineTheme(props,theme,GlobalStyleComponent.defaultProps)});globalStyle.renderStyles(instance,context,styleSheet,stylis)}return Object(react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((function(){return function(){return globalStyle.removeStyles(instance,styleSheet)}}),EMPTY_ARRAY),null}return react__WEBPACK_IMPORTED_MODULE_1___default.a.memo(GlobalStyleComponent)}function keyframes(strings){for(var _len=arguments.length,interpolations=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)interpolations[_key-1]=arguments[_key];var rules=css.apply(void 0,[strings].concat(interpolations)).join(""),name=generateComponentId(rules);return new Keyframes(name,[rules,name,"@keyframes"])}var ServerStyleSheet=function(){function ServerStyleSheet(){var _this=this;this._emitSheetCSS=function(){var css=_this.instance.toString(),nonce=getNonce();return"<style "+[nonce&&'nonce="'+nonce+'"',SC_ATTR+'="true"','data-styled-version="5.0.1"'].filter(Boolean).join(" ")+">"+css+"</style>"},this.getStyleTags=function(){return _this.sealed?throwStyledComponentsError(2):_this._emitSheetCSS()},this.getStyleElement=function(){var _props;if(_this.sealed)return throwStyledComponentsError(2);var props=((_props={})[SC_ATTR]="",_props["data-styled-version"]="5.0.1",_props.dangerouslySetInnerHTML={__html:_this.instance.toString()},_props),nonce=getNonce();return nonce&&(props.nonce=nonce),[react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("style",_extends({},props,{key:"sc-0-0"}))]},this.seal=function(){_this.sealed=!0},this.instance=new StyleSheet({isServer:!0}),this.sealed=!1}var _proto=ServerStyleSheet.prototype;return _proto.collectStyles=function collectStyles(children){return this.sealed?throwStyledComponentsError(2):react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(StyleSheetManager,{sheet:this.instance},children)},_proto.interleaveWithNodeStream=function interleaveWithNodeStream(input){return throwStyledComponentsError(3)},ServerStyleSheet}(),withTheme=function(Component){var WithTheme=react__WEBPACK_IMPORTED_MODULE_1___default.a.forwardRef((function(props,ref){var theme=Object(react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ThemeContext),defaultProps=Component.defaultProps,themeProp=determineTheme(props,theme,defaultProps);return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Component,_extends({},props,{theme:themeProp,ref:ref}))}));return hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default()(WithTheme,Component),WithTheme.displayName="WithTheme("+getComponentName(Component)+")",WithTheme},useTheme=function useTheme(){return Object(react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ThemeContext)},__PRIVATE__={StyleSheet:StyleSheet,masterSheet:masterSheet},version="5.0.1";__webpack_exports__.default=styled}.call(this,__webpack_require__(91))},function(module,exports,__webpack_require__){var fails=__webpack_require__(5);module.exports=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(it,key){return hasOwnProperty.call(it,key)}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8);module.exports=function(it){if(!isObject(it))throw TypeError(String(it)+" is not an object");return it}},function(module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(13),IE8_DOM_DEFINE=__webpack_require__(205),anObject=__webpack_require__(15),toPrimitive=__webpack_require__(78),nativeDefineProperty=Object.defineProperty;exports.f=DESCRIPTORS?nativeDefineProperty:function defineProperty(O,P,Attributes){if(anObject(O),P=toPrimitive(P,!0),anObject(Attributes),IE8_DOM_DEFINE)try{return nativeDefineProperty(O,P,Attributes)}catch(error){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported");return"value"in Attributes&&(O[P]=Attributes.value),O}},,function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),inspect=__webpack_require__(93),IsPropertyKey=__webpack_require__(33),Type=__webpack_require__(4);module.exports=function Get(O,P){if("Object"!==Type(O))throw new $TypeError("Assertion failed: Type(O) is not Object");if(!IsPropertyKey(P))throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true, got "+inspect(P));return O[P]}},,function(module,exports){var g;g=function(){return this}();try{g=g||new Function("return this")()}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){var global=__webpack_require__(3),createNonEnumerableProperty=__webpack_require__(28),has=__webpack_require__(14),setGlobal=__webpack_require__(131),inspectSource=__webpack_require__(132),InternalStateModule=__webpack_require__(44),getInternalState=InternalStateModule.get,enforceInternalState=InternalStateModule.enforce,TEMPLATE=String(String).split("String");(module.exports=function(O,key,value,options){var unsafe=!!options&&!!options.unsafe,simple=!!options&&!!options.enumerable,noTargetGet=!!options&&!!options.noTargetGet;"function"==typeof value&&("string"!=typeof key||has(value,"name")||createNonEnumerableProperty(value,"name",key),enforceInternalState(value).source=TEMPLATE.join("string"==typeof key?key:"")),O!==global?(unsafe?!noTargetGet&&O[key]&&(simple=!0):delete O[key],simple?O[key]=value:createNonEnumerableProperty(O,key,value)):simple?O[key]=value:setGlobal(key,value)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&getInternalState(this).source||inspectSource(this)}))},function(module,exports,__webpack_require__){var requireObjectCoercible=__webpack_require__(43);module.exports=function(argument){return Object(requireObjectCoercible(argument))}},function(module,exports,__webpack_require__){var TO_STRING_TAG_SUPPORT=__webpack_require__(142),redefine=__webpack_require__(21),toString=__webpack_require__(429);TO_STRING_TAG_SUPPORT||redefine(Object.prototype,"toString",toString,{unsafe:!0})},function(module,exports,__webpack_require__){var freeGlobal=__webpack_require__(242),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(119)},function(module,exports,__webpack_require__){"use strict";(function(global){var origSymbol=global.Symbol,hasSymbolSham=__webpack_require__(175);module.exports=function hasNativeSymbols(){return"function"==typeof origSymbol&&("function"==typeof Symbol&&("symbol"==typeof origSymbol("foo")&&("symbol"==typeof Symbol("bar")&&hasSymbolSham())))}}).call(this,__webpack_require__(20))},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),fails=__webpack_require__(5),isArray=__webpack_require__(81),isObject=__webpack_require__(8),toObject=__webpack_require__(22),toLength=__webpack_require__(35),createProperty=__webpack_require__(138),arraySpeciesCreate=__webpack_require__(211),arrayMethodHasSpeciesSupport=__webpack_require__(101),wellKnownSymbol=__webpack_require__(7),V8_VERSION=__webpack_require__(140),IS_CONCAT_SPREADABLE=wellKnownSymbol("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=V8_VERSION>=51||!fails((function(){var array=[];return array[IS_CONCAT_SPREADABLE]=!1,array.concat()[0]!==array})),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(O){if(!isObject(O))return!1;var spreadable=O[IS_CONCAT_SPREADABLE];return void 0!==spreadable?!!spreadable:isArray(O)};$({target:"Array",proto:!0,forced:!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT},{concat:function concat(arg){var i,k,length,len,E,O=toObject(this),A=arraySpeciesCreate(O,0),n=0;for(i=-1,length=arguments.length;i<length;i++)if(E=-1===i?O:arguments[i],isConcatSpreadable(E)){if(n+(len=toLength(E.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(k=0;k<len;k++,n++)k in E&&createProperty(A,n,E[k])}else{if(n>=9007199254740991)throw TypeError("Maximum allowed index exceeded");createProperty(A,n++,E)}return A.length=n,A}})},function(module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(13),definePropertyModule=__webpack_require__(16),createPropertyDescriptor=__webpack_require__(77);module.exports=DESCRIPTORS?function(object,key,value){return definePropertyModule.f(object,key,createPropertyDescriptor(1,value))}:function(object,key,value){return object[key]=value,object}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),global=__webpack_require__(3),getBuiltIn=__webpack_require__(60),IS_PURE=__webpack_require__(79),DESCRIPTORS=__webpack_require__(13),NATIVE_SYMBOL=__webpack_require__(139),USE_SYMBOL_AS_UID=__webpack_require__(212),fails=__webpack_require__(5),has=__webpack_require__(14),isArray=__webpack_require__(81),isObject=__webpack_require__(8),anObject=__webpack_require__(15),toObject=__webpack_require__(22),toIndexedObject=__webpack_require__(42),toPrimitive=__webpack_require__(78),createPropertyDescriptor=__webpack_require__(77),nativeObjectCreate=__webpack_require__(61),objectKeys=__webpack_require__(82),getOwnPropertyNamesModule=__webpack_require__(98),getOwnPropertyNamesExternal=__webpack_require__(430),getOwnPropertySymbolsModule=__webpack_require__(137),getOwnPropertyDescriptorModule=__webpack_require__(76),definePropertyModule=__webpack_require__(16),propertyIsEnumerableModule=__webpack_require__(94),createNonEnumerableProperty=__webpack_require__(28),redefine=__webpack_require__(21),shared=__webpack_require__(133),sharedKey=__webpack_require__(96),hiddenKeys=__webpack_require__(80),uid=__webpack_require__(97),wellKnownSymbol=__webpack_require__(7),wrappedWellKnownSymbolModule=__webpack_require__(216),defineWellKnownSymbol=__webpack_require__(11),setToStringTag=__webpack_require__(52),InternalStateModule=__webpack_require__(44),$forEach=__webpack_require__(45).forEach,HIDDEN=sharedKey("hidden"),TO_PRIMITIVE=wellKnownSymbol("toPrimitive"),setInternalState=InternalStateModule.set,getInternalState=InternalStateModule.getterFor("Symbol"),ObjectPrototype=Object.prototype,$Symbol=global.Symbol,$stringify=getBuiltIn("JSON","stringify"),nativeGetOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f,nativeDefineProperty=definePropertyModule.f,nativeGetOwnPropertyNames=getOwnPropertyNamesExternal.f,nativePropertyIsEnumerable=propertyIsEnumerableModule.f,AllSymbols=shared("symbols"),ObjectPrototypeSymbols=shared("op-symbols"),StringToSymbolRegistry=shared("string-to-symbol-registry"),SymbolToStringRegistry=shared("symbol-to-string-registry"),WellKnownSymbolsStore=shared("wks"),QObject=global.QObject,USE_SETTER=!QObject||!QObject.prototype||!QObject.prototype.findChild,setSymbolDescriptor=DESCRIPTORS&&fails((function(){return 7!=nativeObjectCreate(nativeDefineProperty({},"a",{get:function(){return nativeDefineProperty(this,"a",{value:7}).a}})).a}))?function(O,P,Attributes){var ObjectPrototypeDescriptor=nativeGetOwnPropertyDescriptor(ObjectPrototype,P);ObjectPrototypeDescriptor&&delete ObjectPrototype[P],nativeDefineProperty(O,P,Attributes),ObjectPrototypeDescriptor&&O!==ObjectPrototype&&nativeDefineProperty(ObjectPrototype,P,ObjectPrototypeDescriptor)}:nativeDefineProperty,wrap=function(tag,description){var symbol=AllSymbols[tag]=nativeObjectCreate($Symbol.prototype);return setInternalState(symbol,{type:"Symbol",tag:tag,description:description}),DESCRIPTORS||(symbol.description=description),symbol},isSymbol=USE_SYMBOL_AS_UID?function(it){return"symbol"==typeof it}:function(it){return Object(it)instanceof $Symbol},$defineProperty=function defineProperty(O,P,Attributes){O===ObjectPrototype&&$defineProperty(ObjectPrototypeSymbols,P,Attributes),anObject(O);var key=toPrimitive(P,!0);return anObject(Attributes),has(AllSymbols,key)?(Attributes.enumerable?(has(O,HIDDEN)&&O[HIDDEN][key]&&(O[HIDDEN][key]=!1),Attributes=nativeObjectCreate(Attributes,{enumerable:createPropertyDescriptor(0,!1)})):(has(O,HIDDEN)||nativeDefineProperty(O,HIDDEN,createPropertyDescriptor(1,{})),O[HIDDEN][key]=!0),setSymbolDescriptor(O,key,Attributes)):nativeDefineProperty(O,key,Attributes)},$defineProperties=function defineProperties(O,Properties){anObject(O);var properties=toIndexedObject(Properties),keys=objectKeys(properties).concat($getOwnPropertySymbols(properties));return $forEach(keys,(function(key){DESCRIPTORS&&!$propertyIsEnumerable.call(properties,key)||$defineProperty(O,key,properties[key])})),O},$propertyIsEnumerable=function propertyIsEnumerable(V){var P=toPrimitive(V,!0),enumerable=nativePropertyIsEnumerable.call(this,P);return!(this===ObjectPrototype&&has(AllSymbols,P)&&!has(ObjectPrototypeSymbols,P))&&(!(enumerable||!has(this,P)||!has(AllSymbols,P)||has(this,HIDDEN)&&this[HIDDEN][P])||enumerable)},$getOwnPropertyDescriptor=function getOwnPropertyDescriptor(O,P){var it=toIndexedObject(O),key=toPrimitive(P,!0);if(it!==ObjectPrototype||!has(AllSymbols,key)||has(ObjectPrototypeSymbols,key)){var descriptor=nativeGetOwnPropertyDescriptor(it,key);return!descriptor||!has(AllSymbols,key)||has(it,HIDDEN)&&it[HIDDEN][key]||(descriptor.enumerable=!0),descriptor}},$getOwnPropertyNames=function getOwnPropertyNames(O){var names=nativeGetOwnPropertyNames(toIndexedObject(O)),result=[];return $forEach(names,(function(key){has(AllSymbols,key)||has(hiddenKeys,key)||result.push(key)})),result},$getOwnPropertySymbols=function getOwnPropertySymbols(O){var IS_OBJECT_PROTOTYPE=O===ObjectPrototype,names=nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE?ObjectPrototypeSymbols:toIndexedObject(O)),result=[];return $forEach(names,(function(key){!has(AllSymbols,key)||IS_OBJECT_PROTOTYPE&&!has(ObjectPrototype,key)||result.push(AllSymbols[key])})),result};(NATIVE_SYMBOL||(redefine(($Symbol=function Symbol(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor");var description=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,tag=uid(description),setter=function(value){this===ObjectPrototype&&setter.call(ObjectPrototypeSymbols,value),has(this,HIDDEN)&&has(this[HIDDEN],tag)&&(this[HIDDEN][tag]=!1),setSymbolDescriptor(this,tag,createPropertyDescriptor(1,value))};return DESCRIPTORS&&USE_SETTER&&setSymbolDescriptor(ObjectPrototype,tag,{configurable:!0,set:setter}),wrap(tag,description)}).prototype,"toString",(function toString(){return getInternalState(this).tag})),redefine($Symbol,"withoutSetter",(function(description){return wrap(uid(description),description)})),propertyIsEnumerableModule.f=$propertyIsEnumerable,definePropertyModule.f=$defineProperty,getOwnPropertyDescriptorModule.f=$getOwnPropertyDescriptor,getOwnPropertyNamesModule.f=getOwnPropertyNamesExternal.f=$getOwnPropertyNames,getOwnPropertySymbolsModule.f=$getOwnPropertySymbols,wrappedWellKnownSymbolModule.f=function(name){return wrap(wellKnownSymbol(name),name)},DESCRIPTORS&&(nativeDefineProperty($Symbol.prototype,"description",{configurable:!0,get:function description(){return getInternalState(this).description}}),IS_PURE||redefine(ObjectPrototype,"propertyIsEnumerable",$propertyIsEnumerable,{unsafe:!0}))),$({global:!0,wrap:!0,forced:!NATIVE_SYMBOL,sham:!NATIVE_SYMBOL},{Symbol:$Symbol}),$forEach(objectKeys(WellKnownSymbolsStore),(function(name){defineWellKnownSymbol(name)})),$({target:"Symbol",stat:!0,forced:!NATIVE_SYMBOL},{for:function(key){var string=String(key);if(has(StringToSymbolRegistry,string))return StringToSymbolRegistry[string];var symbol=$Symbol(string);return StringToSymbolRegistry[string]=symbol,SymbolToStringRegistry[symbol]=string,symbol},keyFor:function keyFor(sym){if(!isSymbol(sym))throw TypeError(sym+" is not a symbol");if(has(SymbolToStringRegistry,sym))return SymbolToStringRegistry[sym]},useSetter:function(){USE_SETTER=!0},useSimple:function(){USE_SETTER=!1}}),$({target:"Object",stat:!0,forced:!NATIVE_SYMBOL,sham:!DESCRIPTORS},{create:function create(O,Properties){return void 0===Properties?nativeObjectCreate(O):$defineProperties(nativeObjectCreate(O),Properties)},defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor}),$({target:"Object",stat:!0,forced:!NATIVE_SYMBOL},{getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols}),$({target:"Object",stat:!0,forced:fails((function(){getOwnPropertySymbolsModule.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(it){return getOwnPropertySymbolsModule.f(toObject(it))}}),$stringify)&&$({target:"JSON",stat:!0,forced:!NATIVE_SYMBOL||fails((function(){var symbol=$Symbol();return"[null]"!=$stringify([symbol])||"{}"!=$stringify({a:symbol})||"{}"!=$stringify(Object(symbol))}))},{stringify:function stringify(it,replacer,space){for(var $replacer,args=[it],index=1;arguments.length>index;)args.push(arguments[index++]);if($replacer=replacer,(isObject(replacer)||void 0!==it)&&!isSymbol(it))return isArray(replacer)||(replacer=function(key,value){if("function"==typeof $replacer&&(value=$replacer.call(this,key,value)),!isSymbol(value))return value}),args[1]=replacer,$stringify.apply(null,args)}});$Symbol.prototype[TO_PRIMITIVE]||createNonEnumerableProperty($Symbol.prototype,TO_PRIMITIVE,$Symbol.prototype.valueOf),setToStringTag($Symbol,"Symbol"),hiddenKeys[HIDDEN]=!0},function(module,exports,__webpack_require__){"use strict";var toIndexedObject=__webpack_require__(42),addToUnscopables=__webpack_require__(143),Iterators=__webpack_require__(84),InternalStateModule=__webpack_require__(44),defineIterator=__webpack_require__(144),setInternalState=InternalStateModule.set,getInternalState=InternalStateModule.getterFor("Array Iterator");module.exports=defineIterator(Array,"Array",(function(iterated,kind){setInternalState(this,{type:"Array Iterator",target:toIndexedObject(iterated),index:0,kind:kind})}),(function(){var state=getInternalState(this),target=state.target,kind=state.kind,index=state.index++;return!target||index>=target.length?(state.target=void 0,{value:void 0,done:!0}):"keys"==kind?{value:index,done:!1}:"values"==kind?{value:target[index],done:!1}:{value:[index,target[index]],done:!1}}),"values"),Iterators.Arguments=Iterators.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries")},function(module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(13),fails=__webpack_require__(5),has=__webpack_require__(14),defineProperty=Object.defineProperty,cache={},thrower=function(it){throw it};module.exports=function(METHOD_NAME,options){if(has(cache,METHOD_NAME))return cache[METHOD_NAME];options||(options={});var method=[][METHOD_NAME],ACCESSORS=!!has(options,"ACCESSORS")&&options.ACCESSORS,argument0=has(options,0)?options[0]:thrower,argument1=has(options,1)?options[1]:void 0;return cache[METHOD_NAME]=!!method&&!fails((function(){if(ACCESSORS&&!DESCRIPTORS)return!0;var O={length:-1};ACCESSORS?defineProperty(O,1,{enumerable:!0,get:thrower}):O[1]=1,method.call(O,argument0,argument1)}))}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(181)},function(module,exports,__webpack_require__){"use strict";module.exports=function IsPropertyKey(argument){return"string"==typeof argument||"symbol"==typeof argument}},function(module,exports){var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1)}},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(99),min=Math.min;module.exports=function(argument){return argument>0?min(toInteger(argument),9007199254740991):0}},function(module,exports,__webpack_require__){(function(global){var win;win="undefined"!=typeof window?window:void 0!==global?global:"undefined"!=typeof self?self:{},module.exports=win}).call(this,__webpack_require__(20))},function(module,exports,__webpack_require__){var global=__webpack_require__(3),DOMIterables=__webpack_require__(219),ArrayIteratorMethods=__webpack_require__(30),createNonEnumerableProperty=__webpack_require__(28),wellKnownSymbol=__webpack_require__(7),ITERATOR=wellKnownSymbol("iterator"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),ArrayValues=ArrayIteratorMethods.values;for(var COLLECTION_NAME in DOMIterables){var Collection=global[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype){if(CollectionPrototype[ITERATOR]!==ArrayValues)try{createNonEnumerableProperty(CollectionPrototype,ITERATOR,ArrayValues)}catch(error){CollectionPrototype[ITERATOR]=ArrayValues}if(CollectionPrototype[TO_STRING_TAG]||createNonEnumerableProperty(CollectionPrototype,TO_STRING_TAG,COLLECTION_NAME),DOMIterables[COLLECTION_NAME])for(var METHOD_NAME in ArrayIteratorMethods)if(CollectionPrototype[METHOD_NAME]!==ArrayIteratorMethods[METHOD_NAME])try{createNonEnumerableProperty(CollectionPrototype,METHOD_NAME,ArrayIteratorMethods[METHOD_NAME])}catch(error){CollectionPrototype[METHOD_NAME]=ArrayIteratorMethods[METHOD_NAME]}}}},function(module,exports){module.exports=function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}},function(module,exports,__webpack_require__){"use strict";var bind=__webpack_require__(72);module.exports=bind.call(Function.call,Object.prototype.hasOwnProperty)},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$String=GetIntrinsic("%String%"),$TypeError=GetIntrinsic("%TypeError%");module.exports=function ToString(argument){if("symbol"==typeof argument)throw new $TypeError("Cannot convert a Symbol value to a string");return $String(argument)}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),inspect=__webpack_require__(93),IsCallable=__webpack_require__(25);module.exports=function Call(F,V){var args=arguments.length>2?arguments[2]:[];if(!IsCallable(F))throw new $TypeError(inspect(F)+" is not a function");return F.apply(V,args)}},function(module,exports,__webpack_require__){var IndexedObject=__webpack_require__(95),requireObjectCoercible=__webpack_require__(43);module.exports=function(it){return IndexedObject(requireObjectCoercible(it))}},function(module,exports){module.exports=function(it){if(null==it)throw TypeError("Can't call method on "+it);return it}},function(module,exports,__webpack_require__){var set,get,has,NATIVE_WEAK_MAP=__webpack_require__(207),global=__webpack_require__(3),isObject=__webpack_require__(8),createNonEnumerableProperty=__webpack_require__(28),objectHas=__webpack_require__(14),sharedKey=__webpack_require__(96),hiddenKeys=__webpack_require__(80),WeakMap=global.WeakMap;if(NATIVE_WEAK_MAP){var store=new WeakMap,wmget=store.get,wmhas=store.has,wmset=store.set;set=function(it,metadata){return wmset.call(store,it,metadata),metadata},get=function(it){return wmget.call(store,it)||{}},has=function(it){return wmhas.call(store,it)}}else{var STATE=sharedKey("state");hiddenKeys[STATE]=!0,set=function(it,metadata){return createNonEnumerableProperty(it,STATE,metadata),metadata},get=function(it){return objectHas(it,STATE)?it[STATE]:{}},has=function(it){return objectHas(it,STATE)}}module.exports={set:set,get:get,has:has,enforce:function(it){return has(it)?get(it):set(it,{})},getterFor:function(TYPE){return function(it){var state;if(!isObject(it)||(state=get(it)).type!==TYPE)throw TypeError("Incompatible receiver, "+TYPE+" required");return state}}}},function(module,exports,__webpack_require__){var bind=__webpack_require__(83),IndexedObject=__webpack_require__(95),toObject=__webpack_require__(22),toLength=__webpack_require__(35),arraySpeciesCreate=__webpack_require__(211),push=[].push,createMethod=function(TYPE){var IS_MAP=1==TYPE,IS_FILTER=2==TYPE,IS_SOME=3==TYPE,IS_EVERY=4==TYPE,IS_FIND_INDEX=6==TYPE,NO_HOLES=5==TYPE||IS_FIND_INDEX;return function($this,callbackfn,that,specificCreate){for(var value,result,O=toObject($this),self=IndexedObject(O),boundFunction=bind(callbackfn,that,3),length=toLength(self.length),index=0,create=specificCreate||arraySpeciesCreate,target=IS_MAP?create($this,length):IS_FILTER?create($this,0):void 0;length>index;index++)if((NO_HOLES||index in self)&&(result=boundFunction(value=self[index],index,O),TYPE))if(IS_MAP)target[index]=result;else if(result)switch(TYPE){case 3:return!0;case 5:return value;case 6:return index;case 2:push.call(target,value)}else if(IS_EVERY)return!1;return IS_FIND_INDEX?-1:IS_SOME||IS_EVERY?IS_EVERY:target}};module.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6)}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),DESCRIPTORS=__webpack_require__(13),global=__webpack_require__(3),has=__webpack_require__(14),isObject=__webpack_require__(8),defineProperty=__webpack_require__(16).f,copyConstructorProperties=__webpack_require__(208),NativeSymbol=global.Symbol;if(DESCRIPTORS&&"function"==typeof NativeSymbol&&(!("description"in NativeSymbol.prototype)||void 0!==NativeSymbol().description)){var EmptyStringDescriptionStore={},SymbolWrapper=function Symbol(){var description=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),result=this instanceof SymbolWrapper?new NativeSymbol(description):void 0===description?NativeSymbol():NativeSymbol(description);return""===description&&(EmptyStringDescriptionStore[result]=!0),result};copyConstructorProperties(SymbolWrapper,NativeSymbol);var symbolPrototype=SymbolWrapper.prototype=NativeSymbol.prototype;symbolPrototype.constructor=SymbolWrapper;var symbolToString=symbolPrototype.toString,native="Symbol(test)"==String(NativeSymbol("test")),regexp=/^Symbol\((.*)\)[^)]+$/;defineProperty(symbolPrototype,"description",{configurable:!0,get:function description(){var symbol=isObject(this)?this.valueOf():this,string=symbolToString.call(symbol);if(has(EmptyStringDescriptionStore,symbol))return"";var desc=native?string.slice(7,-1):string.replace(regexp,"$1");return""===desc?void 0:desc}}),$({global:!0,forced:!0},{Symbol:SymbolWrapper})}},function(module,exports,__webpack_require__){__webpack_require__(11)("iterator")},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),forEach=__webpack_require__(221);$({target:"Array",proto:!0,forced:[].forEach!=forEach},{forEach:forEach})},function(module,exports,__webpack_require__){var global=__webpack_require__(3),DOMIterables=__webpack_require__(219),forEach=__webpack_require__(221),createNonEnumerableProperty=__webpack_require__(28);for(var COLLECTION_NAME in DOMIterables){var Collection=global[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype&&CollectionPrototype.forEach!==forEach)try{createNonEnumerableProperty(CollectionPrototype,"forEach",forEach)}catch(error){CollectionPrototype.forEach=forEach}}},function(module,exports,__webpack_require__){"use strict";var charAt=__webpack_require__(233).charAt,InternalStateModule=__webpack_require__(44),defineIterator=__webpack_require__(144),setInternalState=InternalStateModule.set,getInternalState=InternalStateModule.getterFor("String Iterator");defineIterator(String,"String",(function(iterated){setInternalState(this,{type:"String Iterator",string:String(iterated),index:0})}),(function next(){var point,state=getInternalState(this),string=state.string,index=state.index;return index>=string.length?{value:void 0,done:!0}:(point=charAt(string,index),state.index+=point.length,{value:point,done:!1})}))},function(module,exports,__webpack_require__){"use strict";var MAX_SAFE_INTEGER=__webpack_require__(92),ToInteger=__webpack_require__(182);module.exports=function ToLength(argument){var len=ToInteger(argument);return len<=0?0:len>MAX_SAFE_INTEGER?MAX_SAFE_INTEGER:len}},function(module,exports,__webpack_require__){var defineProperty=__webpack_require__(16).f,has=__webpack_require__(14),TO_STRING_TAG=__webpack_require__(7)("toStringTag");module.exports=function(it,TAG,STATIC){it&&!has(it=STATIC?it:it.prototype,TO_STRING_TAG)&&defineProperty(it,TO_STRING_TAG,{configurable:!0,value:TAG})}},function(module,exports){module.exports=function(it){if("function"!=typeof it)throw TypeError(String(it)+" is not a function");return it}},function(module,exports){module.exports=function(module){return module.webpackPolyfill||(module.deprecate=function(){},module.paths=[],module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),module.webpackPolyfill=1),module}},function(module,exports,__webpack_require__){var $=__webpack_require__(2),toObject=__webpack_require__(22),nativeKeys=__webpack_require__(82);$({target:"Object",stat:!0,forced:__webpack_require__(5)((function(){nativeKeys(1)}))},{keys:function keys(it){return nativeKeys(toObject(it))}})},function(module,exports){var isArray=Array.isArray;module.exports=isArray},function(module,exports){module.exports=function isObjectLike(value){return null!=value&&"object"==typeof value}},function(module,exports,__webpack_require__){var baseIsNative=__webpack_require__(520),getValue=__webpack_require__(523);module.exports=function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}},function(module,exports,__webpack_require__){(function(global,module){var __WEBPACK_AMD_DEFINE_RESULT__;(function(){var FUNC_ERROR_TEXT="Expected a function",PLACEHOLDER="__lodash_placeholder__",wrapFlags=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g,reEscapedHtml=/&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml=/[&<>"']/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source),reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source),reTrim=/^\s+|\s+$/g,reTrimStart=/^\s+/,reTrimEnd=/\s+$/,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /,reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,reEscapeChar=/\\(\\)?/g,reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,reFlags=/\w*$/,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,reNoMatch=/($^)/,reUnescapedString=/['\n\r\u2028\u2029\\]/g,rsComboRange="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",rsBreakRange="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rsAstral="[\\ud800-\\udfff]",rsBreak="["+rsBreakRange+"]",rsCombo="["+rsComboRange+"]",rsDigits="\\d+",rsDingbat="[\\u2700-\\u27bf]",rsLower="[a-z\\xdf-\\xf6\\xf8-\\xff]",rsMisc="[^\\ud800-\\udfff"+rsBreakRange+rsDigits+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsNonAstral="[^\\ud800-\\udfff]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsUpper="[A-Z\\xc0-\\xd6\\xd8-\\xde]",rsMiscLower="(?:"+rsLower+"|"+rsMisc+")",rsMiscUpper="(?:"+rsUpper+"|"+rsMisc+")",reOptMod="(?:"+rsCombo+"|"+rsFitz+")"+"?",rsSeq="[\\ufe0e\\ufe0f]?"+reOptMod+("(?:\\u200d(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")[\\ufe0e\\ufe0f]?"+reOptMod+")*"),rsEmoji="(?:"+[rsDingbat,rsRegional,rsSurrPair].join("|")+")"+rsSeq,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reApos=RegExp("['’]","g"),reComboMark=RegExp(rsCombo,"g"),reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reUnicodeWord=RegExp([rsUpper+"?"+rsLower+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[rsBreak,rsUpper,"$"].join("|")+")",rsMiscUpper+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[rsBreak,rsUpper+rsMiscLower,"$"].join("|")+")",rsUpper+"?"+rsMiscLower+"+(?:['’](?:d|ll|m|re|s|t|ve))?",rsUpper+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rsDigits,rsEmoji].join("|"),"g"),reHasUnicode=RegExp("[\\u200d\\ud800-\\udfff"+rsComboRange+"\\ufe0e\\ufe0f]"),reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,contextProps=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],templateCounter=-1,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags["[object Uint8ClampedArray]"]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},freeParseFloat=parseFloat,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;return types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayAggregator(array,setter,iteratee,accumulator){for(var index=-1,length=null==array?0:array.length;++index<length;){var value=array[index];setter(accumulator,value,iteratee(value),array)}return accumulator}function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function arrayEachRight(array,iteratee){for(var length=null==array?0:array.length;length--&&!1!==iteratee(array[length],length,array););return array}function arrayEvery(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(!predicate(array[index],index,array))return!1;return!0}function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function arrayIncludes(array,value){return!!(null==array?0:array.length)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=null==array?0:array.length;++index<length;)if(comparator(value,array[index]))return!0;return!1}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function arrayReduceRight(array,iteratee,accumulator,initAccum){var length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[--length]);length--;)accumulator=iteratee(accumulator,array[length],length,array);return accumulator}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}var asciiSize=baseProperty("length");function baseFindKey(collection,predicate,eachFunc){var result;return eachFunc(collection,(function(value,key,collection){if(predicate(value,key,collection))return result=key,!1})),result}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){return value==value?function strictIndexOf(array,value,fromIndex){var index=fromIndex-1,length=array.length;for(;++index<length;)if(array[index]===value)return index;return-1}(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}function baseIndexOfWith(array,value,fromIndex,comparator){for(var index=fromIndex-1,length=array.length;++index<length;)if(comparator(array[index],value))return index;return-1}function baseIsNaN(value){return value!=value}function baseMean(array,iteratee){var length=null==array?0:array.length;return length?baseSum(array,iteratee)/length:NaN}function baseProperty(key){return function(object){return null==object?void 0:object[key]}}function basePropertyOf(object){return function(key){return null==object?void 0:object[key]}}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,(function(value,index,collection){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection)})),accumulator}function baseSum(array,iteratee){for(var result,index=-1,length=array.length;++index<length;){var current=iteratee(array[index]);void 0!==current&&(result=void 0===result?current:result+current)}return result}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function baseUnary(func){return function(value){return func(value)}}function baseValues(object,props){return arrayMap(props,(function(key){return object[key]}))}function cacheHas(cache,key){return cache.has(key)}function charsStartIndex(strSymbols,chrSymbols){for(var index=-1,length=strSymbols.length;++index<length&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function countHolders(array,placeholder){for(var length=array.length,result=0;length--;)array[length]===placeholder&&++result;return result}var deburrLetter=basePropertyOf({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),escapeHtmlChar=basePropertyOf({"&":"&","<":"<",">":">",'"':""","'":"'"});function escapeStringChar(chr){return"\\"+stringEscapes[chr]}function hasUnicode(string){return reHasUnicode.test(string)}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach((function(value,key){result[++index]=[key,value]})),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function replaceHolders(array,placeholder){for(var index=-1,length=array.length,resIndex=0,result=[];++index<length;){var value=array[index];value!==placeholder&&value!==PLACEHOLDER||(array[index]=PLACEHOLDER,result[resIndex++]=index)}return result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach((function(value){result[++index]=value})),result}function setToPairs(set){var index=-1,result=Array(set.size);return set.forEach((function(value){result[++index]=[value,value]})),result}function stringSize(string){return hasUnicode(string)?function unicodeSize(string){var result=reUnicode.lastIndex=0;for(;reUnicode.test(string);)++result;return result}(string):asciiSize(string)}function stringToArray(string){return hasUnicode(string)?function unicodeToArray(string){return string.match(reUnicode)||[]}(string):function asciiToArray(string){return string.split("")}(string)}var unescapeHtmlChar=basePropertyOf({"&":"&","<":"<",">":">",""":'"',"'":"'"});var _=function runInContext(context){var uid,Array=(context=null==context?root:_.defaults(root.Object(),context,_.pick(root,contextProps))).Array,Date=context.Date,Error=context.Error,Function=context.Function,Math=context.Math,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=context["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,idCounter=0,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""))?"Symbol(src)_1."+uid:"",nativeObjectToString=objectProto.toString,objectCtorString=funcToString.call(Object),oldDash=root._,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?context.Buffer:void 0,Symbol=context.Symbol,Uint8Array=context.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,symIterator=Symbol?Symbol.iterator:void 0,symToStringTag=Symbol?Symbol.toStringTag:void 0,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),ctxClearTimeout=context.clearTimeout!==root.clearTimeout&&context.clearTimeout,ctxNow=Date&&Date.now!==root.Date.now&&Date.now,ctxSetTimeout=context.setTimeout!==root.setTimeout&&context.setTimeout,nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,nativeIsFinite=context.isFinite,nativeJoin=arrayProto.join,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeParseInt=context.parseInt,nativeRandom=Math.random,nativeReverse=arrayProto.reverse,DataView=getNative(context,"DataView"),Map=getNative(context,"Map"),Promise=getNative(context,"Promise"),Set=getNative(context,"Set"),WeakMap=getNative(context,"WeakMap"),nativeCreate=getNative(Object,"create"),metaMap=WeakMap&&new WeakMap,realNames={},dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper)return value;if(hasOwnProperty.call(value,"__wrapped__"))return wrapperClone(value)}return new LodashWrapper(value)}var baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=void 0,result}}();function baseLodash(){}function LodashWrapper(value,chainAll){this.__wrapped__=value,this.__actions__=[],this.__chain__=!!chainAll,this.__index__=0,this.__values__=void 0}function LazyWrapper(value){this.__wrapped__=value,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function arraySample(array){var length=array.length;return length?array[baseRandom(0,length-1)]:void 0}function arraySampleSize(array,n){return shuffleSelf(copyArray(array),baseClamp(n,0,array.length))}function arrayShuffle(array){return shuffleSelf(copyArray(array))}function assignMergeValue(object,key,value){(void 0===value||eq(object[key],value))&&(void 0!==value||key in object)||baseAssignValue(object,key,value)}function assignValue(object,key,value){var objValue=object[key];hasOwnProperty.call(object,key)&&eq(objValue,value)&&(void 0!==value||key in object)||baseAssignValue(object,key,value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseAggregator(collection,setter,iteratee,accumulator){return baseEach(collection,(function(value,key,collection){setter(accumulator,value,iteratee(value),collection)})),accumulator}function baseAssign(object,source){return object&©Object(source,keys(source),object)}function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}function baseAt(object,paths){for(var index=-1,length=paths.length,result=Array(length),skip=null==object;++index<length;)result[index]=skip?void 0:get(object,paths[index]);return result}function baseClamp(number,lower,upper){return number==number&&(void 0!==upper&&(number=number<=upper?number:upper),void 0!==lower&&(number=number>=lower?number:lower)),number}function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=1&bitmask,isFlat=2&bitmask,isFull=4&bitmask;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),void 0!==result)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=function initCloneArray(array){var length=array.length,result=new array.constructor(length);length&&"string"==typeof array[0]&&hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input);return result}(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?function copySymbolsIn(source,object){return copyObject(source,getSymbolsIn(source),object)}(value,function baseAssignIn(object,source){return object&©Object(source,keysIn(source),object)}(result,value)):function copySymbols(source,object){return copyObject(source,getSymbols(source),object)}(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=function initCloneByTag(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case"[object Uint8ClampedArray]":case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return new Ctor;case numberTag:case stringTag:return new Ctor(object);case regexpTag:return function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}(object);case setTag:return new Ctor;case symbolTag:return function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{}}(object)}}(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;stack.set(value,result),isSet(value)?value.forEach((function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))})):isMap(value)&&value.forEach((function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack))}));var props=isArr?void 0:(isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys)(value);return arrayEach(props||value,(function(subValue,key){props&&(subValue=value[key=subValue]),assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack))})),result}function baseConformsTo(object,source,props){var length=props.length;if(null==object)return!length;for(object=Object(object);length--;){var key=props[length],predicate=source[key],value=object[key];if(void 0===value&&!(key in object)||!predicate(value))return!1}return!0}function baseDelay(func,wait,args){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return setTimeout((function(){func.apply(void 0,args)}),wait)}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=200&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index<length;){var value=array[index],computed=null==iteratee?value:iteratee(value);if(value=comparator||0!==value?value:0,isCommon&&computed==computed){for(var valuesIndex=valuesLength;valuesIndex--;)if(values[valuesIndex]===computed)continue outer;result.push(value)}else includes(values,computed,comparator)||result.push(value)}return result}lodash.templateSettings={escape:reEscape,evaluate:reEvaluate,interpolate:reInterpolate,variable:"",imports:{_:lodash}},lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=baseCreate(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=baseCreate(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0},Hash.prototype.delete=function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result},Hash.prototype.get=function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return"__lodash_hash_undefined__"===result?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0},Hash.prototype.has=function hashHas(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty.call(data,key)},Hash.prototype.set=function hashSet(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&void 0===value?"__lodash_hash_undefined__":value,this},ListCache.prototype.clear=function listCacheClear(){this.__data__=[],this.size=0},ListCache.prototype.delete=function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)},ListCache.prototype.get=function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]},ListCache.prototype.has=function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1},ListCache.prototype.set=function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this},MapCache.prototype.clear=function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}},MapCache.prototype.delete=function mapCacheDelete(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result},MapCache.prototype.get=function mapCacheGet(key){return getMapData(this,key).get(key)},MapCache.prototype.has=function mapCacheHas(key){return getMapData(this,key).has(key)},MapCache.prototype.set=function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this},SetCache.prototype.add=SetCache.prototype.push=function setCacheAdd(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function setCacheHas(value){return this.__data__.has(value)},Stack.prototype.clear=function stackClear(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function stackDelete(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result},Stack.prototype.get=function stackGet(key){return this.__data__.get(key)},Stack.prototype.has=function stackHas(key){return this.__data__.has(key)},Stack.prototype.set=function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<199)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this};var baseEach=createBaseEach(baseForOwn),baseEachRight=createBaseEach(baseForOwnRight,!0);function baseEvery(collection,predicate){var result=!0;return baseEach(collection,(function(value,index,collection){return result=!!predicate(value,index,collection)})),result}function baseExtremum(array,iteratee,comparator){for(var index=-1,length=array.length;++index<length;){var value=array[index],current=iteratee(value);if(null!=current&&(void 0===computed?current==current&&!isSymbol(current):comparator(current,computed)))var computed=current,result=value}return result}function baseFilter(collection,predicate){var result=[];return baseEach(collection,(function(value,index,collection){predicate(value,index,collection)&&result.push(value)})),result}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}var baseFor=createBaseFor(),baseForRight=createBaseFor(!0);function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys)}function baseFunctions(object,props){return arrayFilter(props,(function(key){return isFunction(object[key])}))}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function baseGetTag(value){return null==value?void 0===value?"[object Undefined]":"[object Null]":symToStringTag&&symToStringTag in Object(value)?function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=void 0;var unmasked=!0}catch(e){}var result=nativeObjectToString.call(value);unmasked&&(isOwn?value[symToStringTag]=tag:delete value[symToStringTag]);return result}(value):function objectToString(value){return nativeObjectToString.call(value)}(value)}function baseGt(value,other){return value>other}function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function baseHasIn(object,key){return null!=object&&key in Object(object)}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):void 0}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++index<length&&result.length<maxLength;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,!(seen?cacheHas(seen,computed):includes(result,computed,comparator))){for(othIndex=othLength;--othIndex;){var cache=caches[othIndex];if(!(cache?cacheHas(cache,computed):includes(arrays[othIndex],computed,comparator)))continue outer}seen&&seen.push(computed),result.push(value)}}return result}function baseInvoke(object,path,args){var func=null==(object=parent(object,path=castPath(path,object)))?object:object[toKey(last(path))];return null==func?void 0:apply(func,object,args)}function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other),objIsObj=(objTag=objTag==argsTag?objectTag:objTag)==objectTag,othIsObj=(othTag=othTag==argsTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function equalByTag(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case arrayBufferTag:return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case boolTag:case dateTag:case numberTag:return eq(+object,+other);case errorTag:return object.name==other.name&&object.message==other.message;case regexpTag:case stringTag:return object==other+"";case mapTag:var convert=mapToArray;case setTag:var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case symbolTag:if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}if(!isSameTag)return!1;return stack||(stack=new Stack),function equalObjects(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length,othLength=getAllKeys(other).length;if(objLength!=othLength&&!isPartial)return!1;var index=objLength;for(;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key)))return!1}var stacked=stack.get(object);if(stacked&&stack.get(other))return stacked==other;var result=!0;stack.set(object,other),stack.set(other,object);var skipCtor=isPartial;for(;++index<objLength;){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!("function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor)&&(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack)}(value,other,bitmask,customizer,baseIsEqual,stack))}function baseIsMatch(object,source,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){var key=(data=matchData[index])[0],objValue=object[key],srcValue=data[1];if(noCustomizer&&data[2]){if(void 0===objValue&&!(key in object))return!1}else{var stack=new Stack;if(customizer)var result=customizer(objValue,srcValue,key,object,source,stack);if(!(void 0===result?baseIsEqual(srcValue,objValue,3,customizer,stack):result))return!1}}return!0}function baseIsNative(value){return!(!isObject(value)||function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}(value))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value))}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&"constructor"!=key&&result.push(key);return result}function baseKeysIn(object){if(!isObject(object))return function nativeKeysIn(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}(object);var isProto=isPrototype(object),result=[];for(var key in object)("constructor"!=key||!isProto&&hasOwnProperty.call(object,key))&&result.push(key);return result}function baseLt(value,other){return value<other}function baseMap(collection,iteratee){var index=-1,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,(function(value,key,collection){result[++index]=iteratee(value,key,collection)})),result}function baseMatches(source){var matchData=getMatchData(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||baseIsMatch(object,source,matchData)}}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=get(object,path);return void 0===objValue&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,3)}}function baseMerge(object,source,srcIndex,customizer,stack){object!==source&&baseFor(source,(function(srcValue,key){if(stack||(stack=new Stack),isObject(srcValue))!function baseMergeDeep(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked)return void assignMergeValue(object,key,stacked);var newValue=customizer?customizer(objValue,srcValue,key+"",object,source,stack):void 0,isCommon=void 0===newValue;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue,isArr||isBuff||isTyped?isArray(objValue)?newValue=objValue:isArrayLikeObject(objValue)?newValue=copyArray(objValue):isBuff?(isCommon=!1,newValue=cloneBuffer(srcValue,!0)):isTyped?(isCommon=!1,newValue=cloneTypedArray(srcValue,!0)):newValue=[]:isPlainObject(srcValue)||isArguments(srcValue)?(newValue=objValue,isArguments(objValue)?newValue=toPlainObject(objValue):isObject(objValue)&&!isFunction(objValue)||(newValue=initCloneObject(srcValue))):isCommon=!1}isCommon&&(stack.set(srcValue,newValue),mergeFunc(newValue,srcValue,srcIndex,customizer,stack),stack.delete(srcValue));assignMergeValue(object,key,newValue)}(object,source,key,srcIndex,baseMerge,customizer,stack);else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+"",object,source,stack):void 0;void 0===newValue&&(newValue=srcValue),assignMergeValue(object,key,newValue)}}),keysIn)}function baseNth(array,n){var length=array.length;if(length)return isIndex(n+=n<0?length:0,length)?array[n]:void 0}function baseOrderBy(collection,iteratees,orders){var index=-1;return iteratees=arrayMap(iteratees.length?iteratees:[identity],baseUnary(getIteratee())),function baseSortBy(array,comparer){var length=array.length;for(array.sort(comparer);length--;)array[length]=array[length].value;return array}(baseMap(collection,(function(value,key,collection){return{criteria:arrayMap(iteratees,(function(iteratee){return iteratee(value)})),index:++index,value:value}})),(function(object,other){return function compareMultiple(object,other,orders){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;for(;++index<length;){var result=compareAscending(objCriteria[index],othCriteria[index]);if(result){if(index>=ordersLength)return result;var order=orders[index];return result*("desc"==order?-1:1)}}return object.index-other.index}(object,other,orders)}))}function basePickBy(object,paths,predicate){for(var index=-1,length=paths.length,result={};++index<length;){var path=paths[index],value=baseGet(object,path);predicate(value,path)&&baseSet(result,castPath(path,object),value)}return result}function basePullAll(array,values,iteratee,comparator){var indexOf=comparator?baseIndexOfWith:baseIndexOf,index=-1,length=values.length,seen=array;for(array===values&&(values=copyArray(values)),iteratee&&(seen=arrayMap(array,baseUnary(iteratee)));++index<length;)for(var fromIndex=0,value=values[index],computed=iteratee?iteratee(value):value;(fromIndex=indexOf(seen,computed,fromIndex,comparator))>-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function basePullAt(array,indexes){for(var length=array?indexes.length:0,lastIndex=length-1;length--;){var index=indexes[length];if(length==lastIndex||index!==previous){var previous=index;isIndex(index)?splice.call(array,index,1):baseUnset(array,index)}}return array}function baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1))}function baseRepeat(string,n){var result="";if(!string||n<1||n>9007199254740991)return result;do{n%2&&(result+=string),(n=nativeFloor(n/2))&&(string+=string)}while(n);return result}function baseRest(func,start){return setToString(overRest(func,start,identity),func+"")}function baseSample(collection){return arraySample(values(collection))}function baseSampleSize(collection,n){var array=values(collection);return shuffleSelf(array,baseClamp(n,0,array.length))}function baseSet(object,path,value,customizer){if(!isObject(object))return object;for(var index=-1,length=(path=castPath(path,object)).length,lastIndex=length-1,nested=object;null!=nested&&++index<length;){var key=toKey(path[index]),newValue=value;if(index!=lastIndex){var objValue=nested[key];void 0===(newValue=customizer?customizer(objValue,key,nested):void 0)&&(newValue=isObject(objValue)?objValue:isIndex(path[index+1])?[]:{})}assignValue(nested,key,newValue),nested=nested[key]}return object}var baseSetData=metaMap?function(func,data){return metaMap.set(func,data),func}:identity,baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity;function baseShuffle(collection){return shuffleSelf(values(collection))}function baseSlice(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),(end=end>length?length:end)<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}function baseSome(collection,predicate){var result;return baseEach(collection,(function(value,index,collection){return!(result=predicate(value,index,collection))})),!!result}function baseSortedIndex(array,value,retHighest){var low=0,high=null==array?low:array.length;if("number"==typeof value&&value==value&&high<=2147483647){for(;low<high;){var mid=low+high>>>1,computed=array[mid];null!==computed&&!isSymbol(computed)&&(retHighest?computed<=value:computed<value)?low=mid+1:high=mid}return high}return baseSortedIndexBy(array,value,identity,retHighest)}function baseSortedIndexBy(array,value,iteratee,retHighest){value=iteratee(value);for(var low=0,high=null==array?0:array.length,valIsNaN=value!=value,valIsNull=null===value,valIsSymbol=isSymbol(value),valIsUndefined=void 0===value;low<high;){var mid=nativeFloor((low+high)/2),computed=iteratee(array[mid]),othIsDefined=void 0!==computed,othIsNull=null===computed,othIsReflexive=computed==computed,othIsSymbol=isSymbol(computed);if(valIsNaN)var setLow=retHighest||othIsReflexive;else setLow=valIsUndefined?othIsReflexive&&(retHighest||othIsDefined):valIsNull?othIsReflexive&&othIsDefined&&(retHighest||!othIsNull):valIsSymbol?othIsReflexive&&othIsDefined&&!othIsNull&&(retHighest||!othIsSymbol):!othIsNull&&!othIsSymbol&&(retHighest?computed<=value:computed<value);setLow?low=mid+1:high=mid}return nativeMin(high,4294967294)}function baseSortedUniq(array,iteratee){for(var index=-1,length=array.length,resIndex=0,result=[];++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(!index||!eq(computed,seen)){var seen=computed;result[resIndex++]=0===value?0:value}}return result}function baseToNumber(value){return"number"==typeof value?value:isSymbol(value)?NaN:+value}function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(comparator)isCommon=!1,includes=arrayIncludesWith;else if(length>=200){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed==computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}function baseUnset(object,path){return null==(object=parent(object,path=castPath(path,object)))||delete object[toKey(last(path))]}function baseUpdate(object,path,updater,customizer){return baseSet(object,path,updater(baseGet(object,path)),customizer)}function baseWhile(array,predicate,isDrop,fromRight){for(var length=array.length,index=fromRight?length:-1;(fromRight?index--:++index<length)&&predicate(array[index],index,array););return isDrop?baseSlice(array,fromRight?0:index,fromRight?index+1:length):baseSlice(array,fromRight?index+1:0,fromRight?length:index)}function baseWrapperValue(value,actions){var result=value;return result instanceof LazyWrapper&&(result=result.value()),arrayReduce(actions,(function(result,action){return action.func.apply(action.thisArg,arrayPush([result],action.args))}),result)}function baseXor(arrays,iteratee,comparator){var length=arrays.length;if(length<2)return length?baseUniq(arrays[0]):[];for(var index=-1,result=Array(length);++index<length;)for(var array=arrays[index],othIndex=-1;++othIndex<length;)othIndex!=index&&(result[index]=baseDifference(result[index]||array,arrays[othIndex],iteratee,comparator));return baseUniq(baseFlatten(result,1),iteratee,comparator)}function baseZipObject(props,values,assignFunc){for(var index=-1,length=props.length,valsLength=values.length,result={};++index<length;){var value=index<valsLength?values[index]:void 0;assignFunc(result,props[index],value)}return result}function castArrayLikeObject(value){return isArrayLikeObject(value)?value:[]}function castFunction(value){return"function"==typeof value?value:identity}function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}var castRest=baseRest;function castSlice(array,start,end){var length=array.length;return end=void 0===end?length:end,!start&&end>=length?array:baseSlice(array,start,end)}var clearTimeout=ctxClearTimeout||function(id){return root.clearTimeout(id)};function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)),result}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function compareAscending(value,other){if(value!==other){var valIsDefined=void 0!==value,valIsNull=null===value,valIsReflexive=value==value,valIsSymbol=isSymbol(value),othIsDefined=void 0!==other,othIsNull=null===other,othIsReflexive=other==other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value<other||othIsSymbol&&valIsDefined&&valIsReflexive&&!valIsNull&&!valIsSymbol||othIsNull&&valIsDefined&&valIsReflexive||!othIsDefined&&valIsReflexive||!othIsReflexive)return-1}return 0}function composeArgs(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;++leftIndex<leftLength;)result[leftIndex]=partials[leftIndex];for(;++argsIndex<holdersLength;)(isUncurried||argsIndex<argsLength)&&(result[holders[argsIndex]]=args[argsIndex]);for(;rangeLength--;)result[leftIndex++]=args[argsIndex++];return result}function composeArgsRight(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersIndex=-1,holdersLength=holders.length,rightIndex=-1,rightLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(rangeLength+rightLength),isUncurried=!isCurried;++argsIndex<rangeLength;)result[argsIndex]=args[argsIndex];for(var offset=argsIndex;++rightIndex<rightLength;)result[offset+rightIndex]=partials[rightIndex];for(;++holdersIndex<holdersLength;)(isUncurried||argsIndex<argsLength)&&(result[offset+holders[holdersIndex]]=args[argsIndex++]);return result}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=customizer?customizer(object[key],source[key],key,object,source):void 0;void 0===newValue&&(newValue=source[key]),isNew?baseAssignValue(object,key,newValue):assignValue(object,key,newValue)}return object}function createAggregator(setter,initializer){return function(collection,iteratee){var func=isArray(collection)?arrayAggregator:baseAggregator,accumulator=initializer?initializer():{};return func(collection,setter,getIteratee(iteratee,2),accumulator)}}function createAssigner(assigner){return baseRest((function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++index<length;){var source=sources[index];source&&assigner(object,source,index,customizer)}return object}))}function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index<length)&&!1!==iteratee(iterable[index],index,iterable););return collection}}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[fromRight?length:++index];if(!1===iteratee(iterable[key],key,iterable))break}return object}}function createCaseFirst(methodName){return function(string){var strSymbols=hasUnicode(string=toString(string))?stringToArray(string):void 0,chr=strSymbols?strSymbols[0]:string.charAt(0),trailing=strSymbols?castSlice(strSymbols,1).join(""):string.slice(1);return chr[methodName]()+trailing}}function createCompounder(callback){return function(string){return arrayReduce(words(deburr(string).replace(reApos,"")),callback,"")}}function createCtor(Ctor){return function(){var args=arguments;switch(args.length){case 0:return new Ctor;case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6])}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);return isObject(result)?result:thisBinding}}function createFind(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=getIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:void 0}}function createFlow(fromRight){return flatRest((function(funcs){var length=funcs.length,index=length,prereq=LodashWrapper.prototype.thru;for(fromRight&&funcs.reverse();index--;){var func=funcs[index];if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);if(prereq&&!wrapper&&"wrapper"==getFuncName(func))var wrapper=new LodashWrapper([],!0)}for(index=wrapper?index:length;++index<length;){var funcName=getFuncName(func=funcs[index]),data="wrapper"==funcName?getData(func):void 0;wrapper=data&&isLaziable(data[0])&&424==data[1]&&!data[4].length&&1==data[9]?wrapper[getFuncName(data[0])].apply(wrapper,data[3]):1==func.length&&isLaziable(func)?wrapper[funcName]():wrapper.thru(func)}return function(){var args=arguments,value=args[0];if(wrapper&&1==args.length&&isArray(value))return wrapper.plant(value).value();for(var index=0,result=length?funcs[index].apply(this,args):value;++index<length;)result=funcs[index].call(this,result);return result}}))}function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=128&bitmask,isBind=1&bitmask,isBindKey=2&bitmask,isCurried=24&bitmask,isFlip=512&bitmask,Ctor=isBindKey?void 0:createCtor(func);return function wrapper(){for(var length=arguments.length,args=Array(length),index=length;index--;)args[index]=arguments[index];if(isCurried)var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);if(partials&&(args=composeArgs(args,partials,holders,isCurried)),partialsRight&&(args=composeArgsRight(args,partialsRight,holdersRight,isCurried)),length-=holdersCount,isCurried&&length<arity){var newHolders=replaceHolders(args,placeholder);return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,thisArg,args,newHolders,argPos,ary,arity-length)}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;return length=args.length,argPos?args=reorder(args,argPos):isFlip&&length>1&&args.reverse(),isAry&&ary<length&&(args.length=ary),this&&this!==root&&this instanceof wrapper&&(fn=Ctor||createCtor(fn)),fn.apply(thisBinding,args)}}function createInverter(setter,toIteratee){return function(object,iteratee){return function baseInverter(object,setter,iteratee,accumulator){return baseForOwn(object,(function(value,key,object){setter(accumulator,iteratee(value),key,object)})),accumulator}(object,setter,toIteratee(iteratee),{})}}function createMathOperation(operator,defaultValue){return function(value,other){var result;if(void 0===value&&void 0===other)return defaultValue;if(void 0!==value&&(result=value),void 0!==other){if(void 0===result)return other;"string"==typeof value||"string"==typeof other?(value=baseToString(value),other=baseToString(other)):(value=baseToNumber(value),other=baseToNumber(other)),result=operator(value,other)}return result}}function createOver(arrayFunc){return flatRest((function(iteratees){return iteratees=arrayMap(iteratees,baseUnary(getIteratee())),baseRest((function(args){var thisArg=this;return arrayFunc(iteratees,(function(iteratee){return apply(iteratee,thisArg,args)}))}))}))}function createPadding(length,chars){var charsLength=(chars=void 0===chars?" ":baseToString(chars)).length;if(charsLength<2)return charsLength?baseRepeat(chars,length):chars;var result=baseRepeat(chars,nativeCeil(length/stringSize(chars)));return hasUnicode(chars)?castSlice(stringToArray(result),0,length).join(""):result.slice(0,length)}function createRange(fromRight){return function(start,end,step){return step&&"number"!=typeof step&&isIterateeCall(start,end,step)&&(end=step=void 0),start=toFinite(start),void 0===end?(end=start,start=0):end=toFinite(end),function baseRange(start,end,step,fromRight){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[fromRight?length:++index]=start,start+=step;return result}(start,end,step=void 0===step?start<end?1:-1:toFinite(step),fromRight)}}function createRelationalOperation(operator){return function(value,other){return"string"==typeof value&&"string"==typeof other||(value=toNumber(value),other=toNumber(other)),operator(value,other)}}function createRecurry(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=8&bitmask;bitmask|=isCurry?32:64,4&(bitmask&=~(isCurry?64:32))||(bitmask&=-4);var newData=[func,bitmask,thisArg,isCurry?partials:void 0,isCurry?holders:void 0,isCurry?void 0:partials,isCurry?void 0:holders,argPos,ary,arity],result=wrapFunc.apply(void 0,newData);return isLaziable(func)&&setData(result,newData),result.placeholder=placeholder,setWrapToString(result,func,bitmask)}function createRound(methodName){var func=Math[methodName];return function(number,precision){if(number=toNumber(number),(precision=null==precision?0:nativeMin(toInteger(precision),292))&&nativeIsFinite(number)){var pair=(toString(number)+"e").split("e");return+((pair=(toString(func(pair[0]+"e"+(+pair[1]+precision)))+"e").split("e"))[0]+"e"+(+pair[1]-precision))}return func(number)}}var createSet=Set&&1/setToArray(new Set([,-0]))[1]==1/0?function(values){return new Set(values)}:noop;function createToPairs(keysFunc){return function(object){var tag=getTag(object);return tag==mapTag?mapToArray(object):tag==setTag?setToPairs(object):function baseToPairs(object,props){return arrayMap(props,(function(key){return[key,object[key]]}))}(object,keysFunc(object))}}function createWrap(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=2&bitmask;if(!isBindKey&&"function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);var length=partials?partials.length:0;if(length||(bitmask&=-97,partials=holders=void 0),ary=void 0===ary?ary:nativeMax(toInteger(ary),0),arity=void 0===arity?arity:toInteger(arity),length-=holders?holders.length:0,64&bitmask){var partialsRight=partials,holdersRight=holders;partials=holders=void 0}var data=isBindKey?void 0:getData(func),newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];if(data&&function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask<131,isCombo=128==srcBitmask&&8==bitmask||128==srcBitmask&&256==bitmask&&data[7].length<=source[8]||384==srcBitmask&&source[7].length<=source[8]&&8==bitmask;if(!isCommon&&!isCombo)return data;1&srcBitmask&&(data[2]=source[2],newBitmask|=1&bitmask?0:4);var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):value,data[4]=partials?replaceHolders(data[3],PLACEHOLDER):source[4]}(value=source[5])&&(partials=data[5],data[5]=partials?composeArgsRight(partials,value,source[6]):value,data[6]=partials?replaceHolders(data[5],PLACEHOLDER):source[6]);(value=source[7])&&(data[7]=value);128&srcBitmask&&(data[8]=null==data[8]?source[8]:nativeMin(data[8],source[8]));null==data[9]&&(data[9]=source[9]);return data[0]=source[0],data[1]=newBitmask,data}(newData,data),func=newData[0],bitmask=newData[1],thisArg=newData[2],partials=newData[3],holders=newData[4],!(arity=newData[9]=void 0===newData[9]?isBindKey?0:func.length:nativeMax(newData[9]-length,0))&&24&bitmask&&(bitmask&=-25),bitmask&&1!=bitmask)result=8==bitmask||16==bitmask?function createCurry(func,bitmask,arity){var Ctor=createCtor(func);return function wrapper(){for(var length=arguments.length,args=Array(length),index=length,placeholder=getHolder(wrapper);index--;)args[index]=arguments[index];var holders=length<3&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);if((length-=holders.length)<arity)return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,void 0,args,holders,void 0,void 0,arity-length);var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return apply(fn,this,args)}}(func,bitmask,arity):32!=bitmask&&33!=bitmask||holders.length?createHybrid.apply(void 0,newData):function createPartial(func,bitmask,thisArg,partials){var isBind=1&bitmask,Ctor=createCtor(func);return function wrapper(){for(var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;++leftIndex<leftLength;)args[leftIndex]=partials[leftIndex];for(;argsLength--;)args[leftIndex++]=arguments[++argsIndex];return apply(fn,isBind?thisArg:this,args)}}(func,bitmask,thisArg,partials);else var result=function createBind(func,bitmask,thisArg){var isBind=1&bitmask,Ctor=createCtor(func);return function wrapper(){var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return fn.apply(isBind?thisArg:this,arguments)}}(func,bitmask,thisArg);return setWrapToString((data?baseSetData:setData)(result,newData),func,bitmask)}function customDefaultsAssignIn(objValue,srcValue,key,object){return void 0===objValue||eq(objValue,objectProto[key])&&!hasOwnProperty.call(object,key)?srcValue:objValue}function customDefaultsMerge(objValue,srcValue,key,object,source,stack){return isObject(objValue)&&isObject(srcValue)&&(stack.set(srcValue,objValue),baseMerge(objValue,srcValue,void 0,customDefaultsMerge,stack),stack.delete(srcValue)),objValue}function customOmitClone(value){return isPlainObject(value)?void 0:value}function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,(function(othValue,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack)))return seen.push(othIndex)}))){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function flatRest(func){return setToString(overRest(func,void 0,flatten),func+"")}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}var getData=metaMap?function(func){return metaMap.get(func)}:noop;function getFuncName(func){for(var result=func.name+"",array=realNames[result],length=hasOwnProperty.call(realNames,result)?array.length:0;length--;){var data=array[length],otherFunc=data.func;if(null==otherFunc||otherFunc==func)return data.name}return result}function getHolder(func){return(hasOwnProperty.call(lodash,"placeholder")?lodash:func).placeholder}function getIteratee(){var result=lodash.iteratee||iteratee;return result=result===iteratee?baseIteratee:result,arguments.length?result(arguments[0],arguments[1]):result}function getMapData(map,key){var data=map.__data__;return function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}(key)?data["string"==typeof key?"string":"hash"]:data.map}function getMatchData(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}function getNative(object,key){var value=function getValue(object,key){return null==object?void 0:object[key]}(object,key);return baseIsNative(value)?value:void 0}var getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),(function(symbol){return propertyIsEnumerable.call(object,symbol)})))}:stubArray,getSymbolsIn=nativeGetSymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray,getTag=baseGetTag;function hasPath(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}function initCloneObject(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isIndex(value,length){var type=typeof value;return!!(length=null==length?9007199254740991:length)&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function isIterateeCall(value,index,object){if(!isObject(object))return!1;var type=typeof index;return!!("number"==type?isArrayLike(object)&&isIndex(index,object.length):"string"==type&&index in object)&&eq(object[index],value)}function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}function isLaziable(func){var funcName=getFuncName(func),other=lodash[funcName];if("function"!=typeof other||!(funcName in LazyWrapper.prototype))return!1;if(func===other)return!0;var data=getData(other);return!!data&&func===data[0]}(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var isMaskable=coreJsData?isFunction:stubFalse;function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto)}function isStrictComparable(value){return value==value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(void 0!==srcValue||key in Object(object)))}}function overRest(func,start,transform){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),apply(func,this,otherArgs)}}function parent(object,path){return path.length<2?object:baseGet(object,baseSlice(path,0,-1))}function reorder(array,indexes){for(var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);length--;){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:void 0}return array}function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}var setData=shortOut(baseSetData),setTimeout=ctxSetTimeout||function(func,wait){return root.setTimeout(func,wait)},setToString=shortOut(baseSetToString);function setWrapToString(wrapper,reference,bitmask){var source=reference+"";return setToString(wrapper,function insertWrapDetails(source,details){var length=details.length;if(!length)return source;var lastIndex=length-1;return details[lastIndex]=(length>1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}(source,function updateWrapDetails(details,bitmask){return arrayEach(wrapFlags,(function(pair){var value="_."+pair[0];bitmask&pair[1]&&!arrayIncludes(details,value)&&details.push(value)})),details.sort()}(function getWrapDetails(source){var match=source.match(reWrapDetails);return match?match[1].split(reSplitDetails):[]}(source),bitmask)))}function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=16-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}function shuffleSelf(array,size){var index=-1,length=array.length,lastIndex=length-1;for(size=void 0===size?length:size;++index<size;){var rand=baseRandom(index,lastIndex),value=array[rand];array[rand]=array[index],array[index]=value}return array.length=size,array}var stringToPath=function memoizeCapped(func){var result=memoize(func,(function(key){return 500===cache.size&&cache.clear(),key})),cache=result.cache;return result}((function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,(function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)})),result}));function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper)return wrapper.clone();var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);return result.__actions__=copyArray(wrapper.__actions__),result.__index__=wrapper.__index__,result.__values__=wrapper.__values__,result}var difference=baseRest((function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]})),differenceBy=baseRest((function(array,values){var iteratee=last(values);return isArrayLikeObject(iteratee)&&(iteratee=void 0),isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0),getIteratee(iteratee,2)):[]})),differenceWith=baseRest((function(array,values){var comparator=last(values);return isArrayLikeObject(comparator)&&(comparator=void 0),isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0),void 0,comparator):[]}));function findIndex(array,predicate,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=null==fromIndex?0:toInteger(fromIndex);return index<0&&(index=nativeMax(length+index,0)),baseFindIndex(array,getIteratee(predicate,3),index)}function findLastIndex(array,predicate,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=length-1;return void 0!==fromIndex&&(index=toInteger(fromIndex),index=fromIndex<0?nativeMax(length+index,0):nativeMin(index,length-1)),baseFindIndex(array,getIteratee(predicate,3),index,!0)}function flatten(array){return(null==array?0:array.length)?baseFlatten(array,1):[]}function head(array){return array&&array.length?array[0]:void 0}var intersection=baseRest((function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]})),intersectionBy=baseRest((function(arrays){var iteratee=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);return iteratee===last(mapped)?iteratee=void 0:mapped.pop(),mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,getIteratee(iteratee,2)):[]})),intersectionWith=baseRest((function(arrays){var comparator=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);return(comparator="function"==typeof comparator?comparator:void 0)&&mapped.pop(),mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,void 0,comparator):[]}));function last(array){var length=null==array?0:array.length;return length?array[length-1]:void 0}var pull=baseRest(pullAll);function pullAll(array,values){return array&&array.length&&values&&values.length?basePullAll(array,values):array}var pullAt=flatRest((function(array,indexes){var length=null==array?0:array.length,result=baseAt(array,indexes);return basePullAt(array,arrayMap(indexes,(function(index){return isIndex(index,length)?+index:index})).sort(compareAscending)),result}));function reverse(array){return null==array?array:nativeReverse.call(array)}var union=baseRest((function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))})),unionBy=baseRest((function(arrays){var iteratee=last(arrays);return isArrayLikeObject(iteratee)&&(iteratee=void 0),baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0),getIteratee(iteratee,2))})),unionWith=baseRest((function(arrays){var comparator=last(arrays);return comparator="function"==typeof comparator?comparator:void 0,baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0),void 0,comparator)}));function unzip(array){if(!array||!array.length)return[];var length=0;return array=arrayFilter(array,(function(group){if(isArrayLikeObject(group))return length=nativeMax(group.length,length),!0})),baseTimes(length,(function(index){return arrayMap(array,baseProperty(index))}))}function unzipWith(array,iteratee){if(!array||!array.length)return[];var result=unzip(array);return null==iteratee?result:arrayMap(result,(function(group){return apply(iteratee,void 0,group)}))}var without=baseRest((function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[]})),xor=baseRest((function(arrays){return baseXor(arrayFilter(arrays,isArrayLikeObject))})),xorBy=baseRest((function(arrays){var iteratee=last(arrays);return isArrayLikeObject(iteratee)&&(iteratee=void 0),baseXor(arrayFilter(arrays,isArrayLikeObject),getIteratee(iteratee,2))})),xorWith=baseRest((function(arrays){var comparator=last(arrays);return comparator="function"==typeof comparator?comparator:void 0,baseXor(arrayFilter(arrays,isArrayLikeObject),void 0,comparator)})),zip=baseRest(unzip);var zipWith=baseRest((function(arrays){var length=arrays.length,iteratee=length>1?arrays[length-1]:void 0;return iteratee="function"==typeof iteratee?(arrays.pop(),iteratee):void 0,unzipWith(arrays,iteratee)}));function chain(value){var result=lodash(value);return result.__chain__=!0,result}function thru(value,interceptor){return interceptor(value)}var wrapperAt=flatRest((function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths)};return!(length>1||this.__actions__.length)&&value instanceof LazyWrapper&&isIndex(start)?((value=value.slice(start,+start+(length?1:0))).__actions__.push({func:thru,args:[interceptor],thisArg:void 0}),new LodashWrapper(value,this.__chain__).thru((function(array){return length&&!array.length&&array.push(void 0),array}))):this.thru(interceptor)}));var countBy=createAggregator((function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:baseAssignValue(result,key,1)}));var find=createFind(findIndex),findLast=createFind(findLastIndex);function forEach(collection,iteratee){return(isArray(collection)?arrayEach:baseEach)(collection,getIteratee(iteratee,3))}function forEachRight(collection,iteratee){return(isArray(collection)?arrayEachRight:baseEachRight)(collection,getIteratee(iteratee,3))}var groupBy=createAggregator((function(result,value,key){hasOwnProperty.call(result,key)?result[key].push(value):baseAssignValue(result,key,[value])}));var invokeMap=baseRest((function(collection,path,args){var index=-1,isFunc="function"==typeof path,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,(function(value){result[++index]=isFunc?apply(path,value,args):baseInvoke(value,path,args)})),result})),keyBy=createAggregator((function(result,value,key){baseAssignValue(result,key,value)}));function map(collection,iteratee){return(isArray(collection)?arrayMap:baseMap)(collection,getIteratee(iteratee,3))}var partition=createAggregator((function(result,value,key){result[key?0:1].push(value)}),(function(){return[[],[]]}));var sortBy=baseRest((function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])})),now=ctxNow||function(){return root.Date.now()};function ary(func,n,guard){return n=guard?void 0:n,createWrap(func,128,void 0,void 0,void 0,void 0,n=func&&null==n?func.length:n)}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),n<=1&&(func=void 0),result}}var bind=baseRest((function(func,thisArg,partials){var bitmask=1;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=32}return createWrap(func,bitmask,thisArg,partials,holders)})),bindKey=baseRest((function(object,key,partials){var bitmask=3;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=32}return createWrap(key,bitmask,object,partials,holders)}));function debounce(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&time-lastInvokeTime>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,function remainingWait(time){var timeWaiting=wait-(time-lastCallTime);return maxing?nativeMin(timeWaiting,maxWait-(time-lastInvokeTime)):timeWaiting}(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return clearTimeout(timerId),timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxWait=(maxing="maxWait"in options)?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0},debounced.flush=function flush(){return void 0===timerId?result:trailingEdge(now())},debounced}var defer=baseRest((function(func,args){return baseDelay(func,1,args)})),delay=baseRest((function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args)}));function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}memoize.Cache=MapCache;var overArgs=castRest((function(func,transforms){var funcsLength=(transforms=1==transforms.length&&isArray(transforms[0])?arrayMap(transforms[0],baseUnary(getIteratee())):arrayMap(baseFlatten(transforms,1),baseUnary(getIteratee()))).length;return baseRest((function(args){for(var index=-1,length=nativeMin(args.length,funcsLength);++index<length;)args[index]=transforms[index].call(this,args[index]);return apply(func,this,args)}))})),partial=baseRest((function(func,partials){return createWrap(func,32,void 0,partials,replaceHolders(partials,getHolder(partial)))})),partialRight=baseRest((function(func,partials){return createWrap(func,64,void 0,partials,replaceHolders(partials,getHolder(partialRight)))})),rearg=flatRest((function(func,indexes){return createWrap(func,256,void 0,void 0,void 0,indexes)}));function eq(value,other){return value===other||value!=value&&other!=other}var gt=createRelationalOperation(baseGt),gte=createRelationalOperation((function(value,other){return value>=other})),isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isArrayBuffer=nodeIsArrayBuffer?baseUnary(nodeIsArrayBuffer):function baseIsArrayBuffer(value){return isObjectLike(value)&&baseGetTag(value)==arrayBufferTag};function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}var isBuffer=nativeIsBuffer||stubFalse,isDate=nodeIsDate?baseUnary(nodeIsDate):function baseIsDate(value){return isObjectLike(value)&&baseGetTag(value)==dateTag};function isError(value){if(!isObjectLike(value))return!1;var tag=baseGetTag(value);return tag==errorTag||"[object DOMException]"==tag||"string"==typeof value.message&&"string"==typeof value.name&&!isPlainObject(value)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||"[object AsyncFunction]"==tag||"[object Proxy]"==tag}function isInteger(value){return"number"==typeof value&&value==toInteger(value)}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=9007199254740991}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}var isMap=nodeIsMap?baseUnary(nodeIsMap):function baseIsMap(value){return isObjectLike(value)&&getTag(value)==mapTag};function isNumber(value){return"number"==typeof value||isObjectLike(value)&&baseGetTag(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}var isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):function baseIsRegExp(value){return isObjectLike(value)&&baseGetTag(value)==regexpTag};var isSet=nodeIsSet?baseUnary(nodeIsSet):function baseIsSet(value){return isObjectLike(value)&&getTag(value)==setTag};function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]};var lt=createRelationalOperation(baseLt),lte=createRelationalOperation((function(value,other){return value<=other}));function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(symIterator&&value[symIterator])return function iteratorToArray(iterator){for(var data,result=[];!(data=iterator.next()).done;)result.push(data.value);return result}(value[symIterator]());var tag=getTag(value);return(tag==mapTag?mapToArray:tag==setTag?setToArray:values)(value)}function toFinite(value){return value?(value=toNumber(value))===1/0||value===-1/0?17976931348623157e292*(value<0?-1:1):value==value?value:0:0===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result==result?remainder?result-remainder:result:0}function toLength(value){return value?baseClamp(toInteger(value),0,4294967295):0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NaN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NaN:+value}function toPlainObject(value){return copyObject(value,keysIn(value))}function toString(value){return null==value?"":baseToString(value)}var assign=createAssigner((function(object,source){if(isPrototype(source)||isArrayLike(source))copyObject(source,keys(source),object);else for(var key in source)hasOwnProperty.call(source,key)&&assignValue(object,key,source[key])})),assignIn=createAssigner((function(object,source){copyObject(source,keysIn(source),object)})),assignInWith=createAssigner((function(object,source,srcIndex,customizer){copyObject(source,keysIn(source),object,customizer)})),assignWith=createAssigner((function(object,source,srcIndex,customizer){copyObject(source,keys(source),object,customizer)})),at=flatRest(baseAt);var defaults=baseRest((function(object,sources){object=Object(object);var index=-1,length=sources.length,guard=length>2?sources[2]:void 0;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index<length;)for(var source=sources[index],props=keysIn(source),propsIndex=-1,propsLength=props.length;++propsIndex<propsLength;){var key=props[propsIndex],value=object[key];(void 0===value||eq(value,objectProto[key])&&!hasOwnProperty.call(object,key))&&(object[key]=source[key])}return object})),defaultsDeep=baseRest((function(args){return args.push(void 0,customDefaultsMerge),apply(mergeWith,void 0,args)}));function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}var invert=createInverter((function(result,value,key){null!=value&&"function"!=typeof value.toString&&(value=nativeObjectToString.call(value)),result[value]=key}),constant(identity)),invertBy=createInverter((function(result,value,key){null!=value&&"function"!=typeof value.toString&&(value=nativeObjectToString.call(value)),hasOwnProperty.call(result,value)?result[value].push(key):result[value]=[key]}),getIteratee),invoke=baseRest(baseInvoke);function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}var merge=createAssigner((function(object,source,srcIndex){baseMerge(object,source,srcIndex)})),mergeWith=createAssigner((function(object,source,srcIndex,customizer){baseMerge(object,source,srcIndex,customizer)})),omit=flatRest((function(object,paths){var result={};if(null==object)return result;var isDeep=!1;paths=arrayMap(paths,(function(path){return path=castPath(path,object),isDeep||(isDeep=path.length>1),path})),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,7,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result}));var pick=flatRest((function(object,paths){return null==object?{}:function basePick(object,paths){return basePickBy(object,paths,(function(value,path){return hasIn(object,path)}))}(object,paths)}));function pickBy(object,predicate){if(null==object)return{};var props=arrayMap(getAllKeysIn(object),(function(prop){return[prop]}));return predicate=getIteratee(predicate),basePickBy(object,props,(function(value,path){return predicate(value,path[0])}))}var toPairs=createToPairs(keys),toPairsIn=createToPairs(keysIn);function values(object){return null==object?[]:baseValues(object,keys(object))}var camelCase=createCompounder((function(result,word,index){return word=word.toLowerCase(),result+(index?capitalize(word):word)}));function capitalize(string){return upperFirst(toString(string).toLowerCase())}function deburr(string){return(string=toString(string))&&string.replace(reLatin,deburrLetter).replace(reComboMark,"")}var kebabCase=createCompounder((function(result,word,index){return result+(index?"-":"")+word.toLowerCase()})),lowerCase=createCompounder((function(result,word,index){return result+(index?" ":"")+word.toLowerCase()})),lowerFirst=createCaseFirst("toLowerCase");var snakeCase=createCompounder((function(result,word,index){return result+(index?"_":"")+word.toLowerCase()}));var startCase=createCompounder((function(result,word,index){return result+(index?" ":"")+upperFirst(word)}));var upperCase=createCompounder((function(result,word,index){return result+(index?" ":"")+word.toUpperCase()})),upperFirst=createCaseFirst("toUpperCase");function words(string,pattern,guard){return string=toString(string),void 0===(pattern=guard?void 0:pattern)?function hasUnicodeWord(string){return reHasUnicodeWord.test(string)}(string)?function unicodeWords(string){return string.match(reUnicodeWord)||[]}(string):function asciiWords(string){return string.match(reAsciiWord)||[]}(string):string.match(pattern)||[]}var attempt=baseRest((function(func,args){try{return apply(func,void 0,args)}catch(e){return isError(e)?e:new Error(e)}})),bindAll=flatRest((function(object,methodNames){return arrayEach(methodNames,(function(key){key=toKey(key),baseAssignValue(object,key,bind(object[key],object))})),object}));function constant(value){return function(){return value}}var flow=createFlow(),flowRight=createFlow(!0);function identity(value){return value}function iteratee(func){return baseIteratee("function"==typeof func?func:baseClone(func,1))}var method=baseRest((function(path,args){return function(object){return baseInvoke(object,path,args)}})),methodOf=baseRest((function(object,args){return function(path){return baseInvoke(object,path,args)}}));function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);null!=options||isObject(source)&&(methodNames.length||!props.length)||(options=source,source=object,object=this,methodNames=baseFunctions(source,keys(source)));var chain=!(isObject(options)&&"chain"in options&&!options.chain),isFunc=isFunction(object);return arrayEach(methodNames,(function(methodName){var func=source[methodName];object[methodName]=func,isFunc&&(object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);return actions.push({func:func,args:arguments,thisArg:object}),result.__chain__=chainAll,result}return func.apply(object,arrayPush([this.value()],arguments))})})),object}function noop(){}var over=createOver(arrayMap),overEvery=createOver(arrayEvery),overSome=createOver(arraySome);function property(path){return isKey(path)?baseProperty(toKey(path)):function basePropertyDeep(path){return function(object){return baseGet(object,path)}}(path)}var range=createRange(),rangeRight=createRange(!0);function stubArray(){return[]}function stubFalse(){return!1}var add=createMathOperation((function(augend,addend){return augend+addend}),0),ceil=createRound("ceil"),divide=createMathOperation((function(dividend,divisor){return dividend/divisor}),1),floor=createRound("floor");var source,multiply=createMathOperation((function(multiplier,multiplicand){return multiplier*multiplicand}),1),round=createRound("round"),subtract=createMathOperation((function(minuend,subtrahend){return minuend-subtrahend}),0);return lodash.after=function after(n,func){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){if(--n<1)return func.apply(this,arguments)}},lodash.ary=ary,lodash.assign=assign,lodash.assignIn=assignIn,lodash.assignInWith=assignInWith,lodash.assignWith=assignWith,lodash.at=at,lodash.before=before,lodash.bind=bind,lodash.bindAll=bindAll,lodash.bindKey=bindKey,lodash.castArray=function castArray(){if(!arguments.length)return[];var value=arguments[0];return isArray(value)?value:[value]},lodash.chain=chain,lodash.chunk=function chunk(array,size,guard){size=(guard?isIterateeCall(array,size,guard):void 0===size)?1:nativeMax(toInteger(size),0);var length=null==array?0:array.length;if(!length||size<1)return[];for(var index=0,resIndex=0,result=Array(nativeCeil(length/size));index<length;)result[resIndex++]=baseSlice(array,index,index+=size);return result},lodash.compact=function compact(array){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];value&&(result[resIndex++]=value)}return result},lodash.concat=function concat(){var length=arguments.length;if(!length)return[];for(var args=Array(length-1),array=arguments[0],index=length;index--;)args[index-1]=arguments[index];return arrayPush(isArray(array)?copyArray(array):[array],baseFlatten(args,1))},lodash.cond=function cond(pairs){var length=null==pairs?0:pairs.length,toIteratee=getIteratee();return pairs=length?arrayMap(pairs,(function(pair){if("function"!=typeof pair[1])throw new TypeError(FUNC_ERROR_TEXT);return[toIteratee(pair[0]),pair[1]]})):[],baseRest((function(args){for(var index=-1;++index<length;){var pair=pairs[index];if(apply(pair[0],this,args))return apply(pair[1],this,args)}}))},lodash.conforms=function conforms(source){return function baseConforms(source){var props=keys(source);return function(object){return baseConformsTo(object,source,props)}}(baseClone(source,1))},lodash.constant=constant,lodash.countBy=countBy,lodash.create=function create(prototype,properties){var result=baseCreate(prototype);return null==properties?result:baseAssign(result,properties)},lodash.curry=function curry(func,arity,guard){var result=createWrap(func,8,void 0,void 0,void 0,void 0,void 0,arity=guard?void 0:arity);return result.placeholder=curry.placeholder,result},lodash.curryRight=function curryRight(func,arity,guard){var result=createWrap(func,16,void 0,void 0,void 0,void 0,void 0,arity=guard?void 0:arity);return result.placeholder=curryRight.placeholder,result},lodash.debounce=debounce,lodash.defaults=defaults,lodash.defaultsDeep=defaultsDeep,lodash.defer=defer,lodash.delay=delay,lodash.difference=difference,lodash.differenceBy=differenceBy,lodash.differenceWith=differenceWith,lodash.drop=function drop(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,(n=guard||void 0===n?1:toInteger(n))<0?0:n,length):[]},lodash.dropRight=function dropRight(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,0,(n=length-(n=guard||void 0===n?1:toInteger(n)))<0?0:n):[]},lodash.dropRightWhile=function dropRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!0,!0):[]},lodash.dropWhile=function dropWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!0):[]},lodash.fill=function fill(array,value,start,end){var length=null==array?0:array.length;return length?(start&&"number"!=typeof start&&isIterateeCall(array,value,start)&&(start=0,end=length),function baseFill(array,value,start,end){var length=array.length;for((start=toInteger(start))<0&&(start=-start>length?0:length+start),(end=void 0===end||end>length?length:toInteger(end))<0&&(end+=length),end=start>end?0:toLength(end);start<end;)array[start++]=value;return array}(array,value,start,end)):[]},lodash.filter=function filter(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,getIteratee(predicate,3))},lodash.flatMap=function flatMap(collection,iteratee){return baseFlatten(map(collection,iteratee),1)},lodash.flatMapDeep=function flatMapDeep(collection,iteratee){return baseFlatten(map(collection,iteratee),1/0)},lodash.flatMapDepth=function flatMapDepth(collection,iteratee,depth){return depth=void 0===depth?1:toInteger(depth),baseFlatten(map(collection,iteratee),depth)},lodash.flatten=flatten,lodash.flattenDeep=function flattenDeep(array){return(null==array?0:array.length)?baseFlatten(array,1/0):[]},lodash.flattenDepth=function flattenDepth(array,depth){return(null==array?0:array.length)?baseFlatten(array,depth=void 0===depth?1:toInteger(depth)):[]},lodash.flip=function flip(func){return createWrap(func,512)},lodash.flow=flow,lodash.flowRight=flowRight,lodash.fromPairs=function fromPairs(pairs){for(var index=-1,length=null==pairs?0:pairs.length,result={};++index<length;){var pair=pairs[index];result[pair[0]]=pair[1]}return result},lodash.functions=function functions(object){return null==object?[]:baseFunctions(object,keys(object))},lodash.functionsIn=function functionsIn(object){return null==object?[]:baseFunctions(object,keysIn(object))},lodash.groupBy=groupBy,lodash.initial=function initial(array){return(null==array?0:array.length)?baseSlice(array,0,-1):[]},lodash.intersection=intersection,lodash.intersectionBy=intersectionBy,lodash.intersectionWith=intersectionWith,lodash.invert=invert,lodash.invertBy=invertBy,lodash.invokeMap=invokeMap,lodash.iteratee=iteratee,lodash.keyBy=keyBy,lodash.keys=keys,lodash.keysIn=keysIn,lodash.map=map,lodash.mapKeys=function mapKeys(object,iteratee){var result={};return iteratee=getIteratee(iteratee,3),baseForOwn(object,(function(value,key,object){baseAssignValue(result,iteratee(value,key,object),value)})),result},lodash.mapValues=function mapValues(object,iteratee){var result={};return iteratee=getIteratee(iteratee,3),baseForOwn(object,(function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object))})),result},lodash.matches=function matches(source){return baseMatches(baseClone(source,1))},lodash.matchesProperty=function matchesProperty(path,srcValue){return baseMatchesProperty(path,baseClone(srcValue,1))},lodash.memoize=memoize,lodash.merge=merge,lodash.mergeWith=mergeWith,lodash.method=method,lodash.methodOf=methodOf,lodash.mixin=mixin,lodash.negate=negate,lodash.nthArg=function nthArg(n){return n=toInteger(n),baseRest((function(args){return baseNth(args,n)}))},lodash.omit=omit,lodash.omitBy=function omitBy(object,predicate){return pickBy(object,negate(getIteratee(predicate)))},lodash.once=function once(func){return before(2,func)},lodash.orderBy=function orderBy(collection,iteratees,orders,guard){return null==collection?[]:(isArray(iteratees)||(iteratees=null==iteratees?[]:[iteratees]),isArray(orders=guard?void 0:orders)||(orders=null==orders?[]:[orders]),baseOrderBy(collection,iteratees,orders))},lodash.over=over,lodash.overArgs=overArgs,lodash.overEvery=overEvery,lodash.overSome=overSome,lodash.partial=partial,lodash.partialRight=partialRight,lodash.partition=partition,lodash.pick=pick,lodash.pickBy=pickBy,lodash.property=property,lodash.propertyOf=function propertyOf(object){return function(path){return null==object?void 0:baseGet(object,path)}},lodash.pull=pull,lodash.pullAll=pullAll,lodash.pullAllBy=function pullAllBy(array,values,iteratee){return array&&array.length&&values&&values.length?basePullAll(array,values,getIteratee(iteratee,2)):array},lodash.pullAllWith=function pullAllWith(array,values,comparator){return array&&array.length&&values&&values.length?basePullAll(array,values,void 0,comparator):array},lodash.pullAt=pullAt,lodash.range=range,lodash.rangeRight=rangeRight,lodash.rearg=rearg,lodash.reject=function reject(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,negate(getIteratee(predicate,3)))},lodash.remove=function remove(array,predicate){var result=[];if(!array||!array.length)return result;var index=-1,indexes=[],length=array.length;for(predicate=getIteratee(predicate,3);++index<length;){var value=array[index];predicate(value,index,array)&&(result.push(value),indexes.push(index))}return basePullAt(array,indexes),result},lodash.rest=function rest(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return baseRest(func,start=void 0===start?start:toInteger(start))},lodash.reverse=reverse,lodash.sampleSize=function sampleSize(collection,n,guard){return n=(guard?isIterateeCall(collection,n,guard):void 0===n)?1:toInteger(n),(isArray(collection)?arraySampleSize:baseSampleSize)(collection,n)},lodash.set=function set(object,path,value){return null==object?object:baseSet(object,path,value)},lodash.setWith=function setWith(object,path,value,customizer){return customizer="function"==typeof customizer?customizer:void 0,null==object?object:baseSet(object,path,value,customizer)},lodash.shuffle=function shuffle(collection){return(isArray(collection)?arrayShuffle:baseShuffle)(collection)},lodash.slice=function slice(array,start,end){var length=null==array?0:array.length;return length?(end&&"number"!=typeof end&&isIterateeCall(array,start,end)?(start=0,end=length):(start=null==start?0:toInteger(start),end=void 0===end?length:toInteger(end)),baseSlice(array,start,end)):[]},lodash.sortBy=sortBy,lodash.sortedUniq=function sortedUniq(array){return array&&array.length?baseSortedUniq(array):[]},lodash.sortedUniqBy=function sortedUniqBy(array,iteratee){return array&&array.length?baseSortedUniq(array,getIteratee(iteratee,2)):[]},lodash.split=function split(string,separator,limit){return limit&&"number"!=typeof limit&&isIterateeCall(string,separator,limit)&&(separator=limit=void 0),(limit=void 0===limit?4294967295:limit>>>0)?(string=toString(string))&&("string"==typeof separator||null!=separator&&!isRegExp(separator))&&!(separator=baseToString(separator))&&hasUnicode(string)?castSlice(stringToArray(string),0,limit):string.split(separator,limit):[]},lodash.spread=function spread(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=null==start?0:nativeMax(toInteger(start),0),baseRest((function(args){var array=args[start],otherArgs=castSlice(args,0,start);return array&&arrayPush(otherArgs,array),apply(func,this,otherArgs)}))},lodash.tail=function tail(array){var length=null==array?0:array.length;return length?baseSlice(array,1,length):[]},lodash.take=function take(array,n,guard){return array&&array.length?baseSlice(array,0,(n=guard||void 0===n?1:toInteger(n))<0?0:n):[]},lodash.takeRight=function takeRight(array,n,guard){var length=null==array?0:array.length;return length?baseSlice(array,(n=length-(n=guard||void 0===n?1:toInteger(n)))<0?0:n,length):[]},lodash.takeRightWhile=function takeRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!1,!0):[]},lodash.takeWhile=function takeWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3)):[]},lodash.tap=function tap(value,interceptor){return interceptor(value),value},lodash.throttle=function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})},lodash.thru=thru,lodash.toArray=toArray,lodash.toPairs=toPairs,lodash.toPairsIn=toPairsIn,lodash.toPath=function toPath(value){return isArray(value)?arrayMap(value,toKey):isSymbol(value)?[value]:copyArray(stringToPath(toString(value)))},lodash.toPlainObject=toPlainObject,lodash.transform=function transform(object,iteratee,accumulator){var isArr=isArray(object),isArrLike=isArr||isBuffer(object)||isTypedArray(object);if(iteratee=getIteratee(iteratee,4),null==accumulator){var Ctor=object&&object.constructor;accumulator=isArrLike?isArr?new Ctor:[]:isObject(object)&&isFunction(Ctor)?baseCreate(getPrototype(object)):{}}return(isArrLike?arrayEach:baseForOwn)(object,(function(value,index,object){return iteratee(accumulator,value,index,object)})),accumulator},lodash.unary=function unary(func){return ary(func,1)},lodash.union=union,lodash.unionBy=unionBy,lodash.unionWith=unionWith,lodash.uniq=function uniq(array){return array&&array.length?baseUniq(array):[]},lodash.uniqBy=function uniqBy(array,iteratee){return array&&array.length?baseUniq(array,getIteratee(iteratee,2)):[]},lodash.uniqWith=function uniqWith(array,comparator){return comparator="function"==typeof comparator?comparator:void 0,array&&array.length?baseUniq(array,void 0,comparator):[]},lodash.unset=function unset(object,path){return null==object||baseUnset(object,path)},lodash.unzip=unzip,lodash.unzipWith=unzipWith,lodash.update=function update(object,path,updater){return null==object?object:baseUpdate(object,path,castFunction(updater))},lodash.updateWith=function updateWith(object,path,updater,customizer){return customizer="function"==typeof customizer?customizer:void 0,null==object?object:baseUpdate(object,path,castFunction(updater),customizer)},lodash.values=values,lodash.valuesIn=function valuesIn(object){return null==object?[]:baseValues(object,keysIn(object))},lodash.without=without,lodash.words=words,lodash.wrap=function wrap(value,wrapper){return partial(castFunction(wrapper),value)},lodash.xor=xor,lodash.xorBy=xorBy,lodash.xorWith=xorWith,lodash.zip=zip,lodash.zipObject=function zipObject(props,values){return baseZipObject(props||[],values||[],assignValue)},lodash.zipObjectDeep=function zipObjectDeep(props,values){return baseZipObject(props||[],values||[],baseSet)},lodash.zipWith=zipWith,lodash.entries=toPairs,lodash.entriesIn=toPairsIn,lodash.extend=assignIn,lodash.extendWith=assignInWith,mixin(lodash,lodash),lodash.add=add,lodash.attempt=attempt,lodash.camelCase=camelCase,lodash.capitalize=capitalize,lodash.ceil=ceil,lodash.clamp=function clamp(number,lower,upper){return void 0===upper&&(upper=lower,lower=void 0),void 0!==upper&&(upper=(upper=toNumber(upper))==upper?upper:0),void 0!==lower&&(lower=(lower=toNumber(lower))==lower?lower:0),baseClamp(toNumber(number),lower,upper)},lodash.clone=function clone(value){return baseClone(value,4)},lodash.cloneDeep=function cloneDeep(value){return baseClone(value,5)},lodash.cloneDeepWith=function cloneDeepWith(value,customizer){return baseClone(value,5,customizer="function"==typeof customizer?customizer:void 0)},lodash.cloneWith=function cloneWith(value,customizer){return baseClone(value,4,customizer="function"==typeof customizer?customizer:void 0)},lodash.conformsTo=function conformsTo(object,source){return null==source||baseConformsTo(object,source,keys(source))},lodash.deburr=deburr,lodash.defaultTo=function defaultTo(value,defaultValue){return null==value||value!=value?defaultValue:value},lodash.divide=divide,lodash.endsWith=function endsWith(string,target,position){string=toString(string),target=baseToString(target);var length=string.length,end=position=void 0===position?length:baseClamp(toInteger(position),0,length);return(position-=target.length)>=0&&string.slice(position,end)==target},lodash.eq=eq,lodash.escape=function escape(string){return(string=toString(string))&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string},lodash.escapeRegExp=function escapeRegExp(string){return(string=toString(string))&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,"\\$&"):string},lodash.every=function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=void 0),func(collection,getIteratee(predicate,3))},lodash.find=find,lodash.findIndex=findIndex,lodash.findKey=function findKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwn)},lodash.findLast=findLast,lodash.findLastIndex=findLastIndex,lodash.findLastKey=function findLastKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwnRight)},lodash.floor=floor,lodash.forEach=forEach,lodash.forEachRight=forEachRight,lodash.forIn=function forIn(object,iteratee){return null==object?object:baseFor(object,getIteratee(iteratee,3),keysIn)},lodash.forInRight=function forInRight(object,iteratee){return null==object?object:baseForRight(object,getIteratee(iteratee,3),keysIn)},lodash.forOwn=function forOwn(object,iteratee){return object&&baseForOwn(object,getIteratee(iteratee,3))},lodash.forOwnRight=function forOwnRight(object,iteratee){return object&&baseForOwnRight(object,getIteratee(iteratee,3))},lodash.get=get,lodash.gt=gt,lodash.gte=gte,lodash.has=function has(object,path){return null!=object&&hasPath(object,path,baseHas)},lodash.hasIn=hasIn,lodash.head=head,lodash.identity=identity,lodash.includes=function includes(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection),fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;return fromIndex<0&&(fromIndex=nativeMax(length+fromIndex,0)),isString(collection)?fromIndex<=length&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1},lodash.indexOf=function indexOf(array,value,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=null==fromIndex?0:toInteger(fromIndex);return index<0&&(index=nativeMax(length+index,0)),baseIndexOf(array,value,index)},lodash.inRange=function inRange(number,start,end){return start=toFinite(start),void 0===end?(end=start,start=0):end=toFinite(end),function baseInRange(number,start,end){return number>=nativeMin(start,end)&&number<nativeMax(start,end)}(number=toNumber(number),start,end)},lodash.invoke=invoke,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isArrayBuffer=isArrayBuffer,lodash.isArrayLike=isArrayLike,lodash.isArrayLikeObject=isArrayLikeObject,lodash.isBoolean=function isBoolean(value){return!0===value||!1===value||isObjectLike(value)&&baseGetTag(value)==boolTag},lodash.isBuffer=isBuffer,lodash.isDate=isDate,lodash.isElement=function isElement(value){return isObjectLike(value)&&1===value.nodeType&&!isPlainObject(value)},lodash.isEmpty=function isEmpty(value){if(null==value)return!0;if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if(tag==mapTag||tag==setTag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0},lodash.isEqual=function isEqual(value,other){return baseIsEqual(value,other)},lodash.isEqualWith=function isEqualWith(value,other,customizer){var result=(customizer="function"==typeof customizer?customizer:void 0)?customizer(value,other):void 0;return void 0===result?baseIsEqual(value,other,void 0,customizer):!!result},lodash.isError=isError,lodash.isFinite=function isFinite(value){return"number"==typeof value&&nativeIsFinite(value)},lodash.isFunction=isFunction,lodash.isInteger=isInteger,lodash.isLength=isLength,lodash.isMap=isMap,lodash.isMatch=function isMatch(object,source){return object===source||baseIsMatch(object,source,getMatchData(source))},lodash.isMatchWith=function isMatchWith(object,source,customizer){return customizer="function"==typeof customizer?customizer:void 0,baseIsMatch(object,source,getMatchData(source),customizer)},lodash.isNaN=function isNaN(value){return isNumber(value)&&value!=+value},lodash.isNative=function isNative(value){if(isMaskable(value))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return baseIsNative(value)},lodash.isNil=function isNil(value){return null==value},lodash.isNull=function isNull(value){return null===value},lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isObjectLike=isObjectLike,lodash.isPlainObject=isPlainObject,lodash.isRegExp=isRegExp,lodash.isSafeInteger=function isSafeInteger(value){return isInteger(value)&&value>=-9007199254740991&&value<=9007199254740991},lodash.isSet=isSet,lodash.isString=isString,lodash.isSymbol=isSymbol,lodash.isTypedArray=isTypedArray,lodash.isUndefined=function isUndefined(value){return void 0===value},lodash.isWeakMap=function isWeakMap(value){return isObjectLike(value)&&getTag(value)==weakMapTag},lodash.isWeakSet=function isWeakSet(value){return isObjectLike(value)&&"[object WeakSet]"==baseGetTag(value)},lodash.join=function join(array,separator){return null==array?"":nativeJoin.call(array,separator)},lodash.kebabCase=kebabCase,lodash.last=last,lodash.lastIndexOf=function lastIndexOf(array,value,fromIndex){var length=null==array?0:array.length;if(!length)return-1;var index=length;return void 0!==fromIndex&&(index=(index=toInteger(fromIndex))<0?nativeMax(length+index,0):nativeMin(index,length-1)),value==value?function strictLastIndexOf(array,value,fromIndex){for(var index=fromIndex+1;index--;)if(array[index]===value)return index;return index}(array,value,index):baseFindIndex(array,baseIsNaN,index,!0)},lodash.lowerCase=lowerCase,lodash.lowerFirst=lowerFirst,lodash.lt=lt,lodash.lte=lte,lodash.max=function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):void 0},lodash.maxBy=function maxBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseGt):void 0},lodash.mean=function mean(array){return baseMean(array,identity)},lodash.meanBy=function meanBy(array,iteratee){return baseMean(array,getIteratee(iteratee,2))},lodash.min=function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):void 0},lodash.minBy=function minBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseLt):void 0},lodash.stubArray=stubArray,lodash.stubFalse=stubFalse,lodash.stubObject=function stubObject(){return{}},lodash.stubString=function stubString(){return""},lodash.stubTrue=function stubTrue(){return!0},lodash.multiply=multiply,lodash.nth=function nth(array,n){return array&&array.length?baseNth(array,toInteger(n)):void 0},lodash.noConflict=function noConflict(){return root._===this&&(root._=oldDash),this},lodash.noop=noop,lodash.now=now,lodash.pad=function pad(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;if(!length||strLength>=length)return string;var mid=(length-strLength)/2;return createPadding(nativeFloor(mid),chars)+string+createPadding(nativeCeil(mid),chars)},lodash.padEnd=function padEnd(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;return length&&strLength<length?string+createPadding(length-strLength,chars):string},lodash.padStart=function padStart(string,length,chars){string=toString(string);var strLength=(length=toInteger(length))?stringSize(string):0;return length&&strLength<length?createPadding(length-strLength,chars)+string:string},lodash.parseInt=function parseInt(string,radix,guard){return guard||null==radix?radix=0:radix&&(radix=+radix),nativeParseInt(toString(string).replace(reTrimStart,""),radix||0)},lodash.random=function random(lower,upper,floating){if(floating&&"boolean"!=typeof floating&&isIterateeCall(lower,upper,floating)&&(upper=floating=void 0),void 0===floating&&("boolean"==typeof upper?(floating=upper,upper=void 0):"boolean"==typeof lower&&(floating=lower,lower=void 0)),void 0===lower&&void 0===upper?(lower=0,upper=1):(lower=toFinite(lower),void 0===upper?(upper=lower,lower=0):upper=toFinite(upper)),lower>upper){var temp=lower;lower=upper,upper=temp}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat("1e-"+((rand+"").length-1))),upper)}return baseRandom(lower,upper)},lodash.reduce=function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEach)},lodash.reduceRight=function reduceRight(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduceRight:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEachRight)},lodash.repeat=function repeat(string,n,guard){return n=(guard?isIterateeCall(string,n,guard):void 0===n)?1:toInteger(n),baseRepeat(toString(string),n)},lodash.replace=function replace(){var args=arguments,string=toString(args[0]);return args.length<3?string:string.replace(args[1],args[2])},lodash.result=function result(object,path,defaultValue){var index=-1,length=(path=castPath(path,object)).length;for(length||(length=1,object=void 0);++index<length;){var value=null==object?void 0:object[toKey(path[index])];void 0===value&&(index=length,value=defaultValue),object=isFunction(value)?value.call(object):value}return object},lodash.round=round,lodash.runInContext=runInContext,lodash.sample=function sample(collection){return(isArray(collection)?arraySample:baseSample)(collection)},lodash.size=function size(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length},lodash.snakeCase=snakeCase,lodash.some=function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=void 0),func(collection,getIteratee(predicate,3))},lodash.sortedIndex=function sortedIndex(array,value){return baseSortedIndex(array,value)},lodash.sortedIndexBy=function sortedIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2))},lodash.sortedIndexOf=function sortedIndexOf(array,value){var length=null==array?0:array.length;if(length){var index=baseSortedIndex(array,value);if(index<length&&eq(array[index],value))return index}return-1},lodash.sortedLastIndex=function sortedLastIndex(array,value){return baseSortedIndex(array,value,!0)},lodash.sortedLastIndexBy=function sortedLastIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2),!0)},lodash.sortedLastIndexOf=function sortedLastIndexOf(array,value){if(null==array?0:array.length){var index=baseSortedIndex(array,value,!0)-1;if(eq(array[index],value))return index}return-1},lodash.startCase=startCase,lodash.startsWith=function startsWith(string,target,position){return string=toString(string),position=null==position?0:baseClamp(toInteger(position),0,string.length),target=baseToString(target),string.slice(position,position+target.length)==target},lodash.subtract=subtract,lodash.sum=function sum(array){return array&&array.length?baseSum(array,identity):0},lodash.sumBy=function sumBy(array,iteratee){return array&&array.length?baseSum(array,getIteratee(iteratee,2)):0},lodash.template=function template(string,options,guard){var settings=lodash.templateSettings;guard&&isIterateeCall(string,options,guard)&&(options=void 0),string=toString(string),options=assignInWith({},options,settings,customDefaultsAssignIn);var isEscaping,isEvaluating,imports=assignInWith({},options.imports,settings.imports,customDefaultsAssignIn),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys),index=0,interpolate=options.interpolate||reNoMatch,source="__p += '",reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g"),sourceURL="//# sourceURL="+(hasOwnProperty.call(options,"sourceURL")?(options.sourceURL+"").replace(/[\r\n]/g," "):"lodash.templateSources["+ ++templateCounter+"]")+"\n";string.replace(reDelimiters,(function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){return interpolateValue||(interpolateValue=esTemplateValue),source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar),escapeValue&&(isEscaping=!0,source+="' +\n__e("+escapeValue+") +\n'"),evaluateValue&&(isEvaluating=!0,source+="';\n"+evaluateValue+";\n__p += '"),interpolateValue&&(source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"),index=offset+match.length,match})),source+="';\n";var variable=hasOwnProperty.call(options,"variable")&&options.variable;variable||(source="with (obj) {\n"+source+"\n}\n"),source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;"),source="function("+(variable||"obj")+") {\n"+(variable?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(isEscaping?", __e = _.escape":"")+(isEvaluating?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var result=attempt((function(){return Function(importsKeys,sourceURL+"return "+source).apply(void 0,importsValues)}));if(result.source=source,isError(result))throw result;return result},lodash.times=function times(n,iteratee){if((n=toInteger(n))<1||n>9007199254740991)return[];var index=4294967295,length=nativeMin(n,4294967295);n-=4294967295;for(var result=baseTimes(length,iteratee=getIteratee(iteratee));++index<n;)iteratee(index);return result},lodash.toFinite=toFinite,lodash.toInteger=toInteger,lodash.toLength=toLength,lodash.toLower=function toLower(value){return toString(value).toLowerCase()},lodash.toNumber=toNumber,lodash.toSafeInteger=function toSafeInteger(value){return value?baseClamp(toInteger(value),-9007199254740991,9007199254740991):0===value?value:0},lodash.toString=toString,lodash.toUpper=function toUpper(value){return toString(value).toUpperCase()},lodash.trim=function trim(string,chars,guard){if((string=toString(string))&&(guard||void 0===chars))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars);return castSlice(strSymbols,charsStartIndex(strSymbols,chrSymbols),charsEndIndex(strSymbols,chrSymbols)+1).join("")},lodash.trimEnd=function trimEnd(string,chars,guard){if((string=toString(string))&&(guard||void 0===chars))return string.replace(reTrimEnd,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string);return castSlice(strSymbols,0,charsEndIndex(strSymbols,stringToArray(chars))+1).join("")},lodash.trimStart=function trimStart(string,chars,guard){if((string=toString(string))&&(guard||void 0===chars))return string.replace(reTrimStart,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string);return castSlice(strSymbols,charsStartIndex(strSymbols,stringToArray(chars))).join("")},lodash.truncate=function truncate(string,options){var length=30,omission="...";if(isObject(options)){var separator="separator"in options?options.separator:separator;length="length"in options?toInteger(options.length):length,omission="omission"in options?baseToString(options.omission):omission}var strLength=(string=toString(string)).length;if(hasUnicode(string)){var strSymbols=stringToArray(string);strLength=strSymbols.length}if(length>=strLength)return string;var end=length-stringSize(omission);if(end<1)return omission;var result=strSymbols?castSlice(strSymbols,0,end).join(""):string.slice(0,end);if(void 0===separator)return result+omission;if(strSymbols&&(end+=result.length-end),isRegExp(separator)){if(string.slice(end).search(separator)){var match,substring=result;for(separator.global||(separator=RegExp(separator.source,toString(reFlags.exec(separator))+"g")),separator.lastIndex=0;match=separator.exec(substring);)var newEnd=match.index;result=result.slice(0,void 0===newEnd?end:newEnd)}}else if(string.indexOf(baseToString(separator),end)!=end){var index=result.lastIndexOf(separator);index>-1&&(result=result.slice(0,index))}return result+omission},lodash.unescape=function unescape(string){return(string=toString(string))&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string},lodash.uniqueId=function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id},lodash.upperCase=upperCase,lodash.upperFirst=upperFirst,lodash.each=forEach,lodash.eachRight=forEachRight,lodash.first=head,mixin(lodash,(source={},baseForOwn(lodash,(function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)})),source),{chain:!1}),lodash.VERSION="4.17.15",arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(methodName){lodash[methodName].placeholder=lodash})),arrayEach(["drop","take"],(function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=void 0===n?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__filtered__?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,4294967295),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}})),arrayEach(["filter","map","takeWhile"],(function(methodName,index){var type=index+1,isFilter=1==type||3==type;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}})),arrayEach(["head","last"],(function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}})),arrayEach(["initial","tail"],(function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}})),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest((function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map((function(value){return baseInvoke(value,path,args)}))})),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),void 0!==end&&(result=(end=toInteger(end))<0?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(4294967295)},baseForOwn(LazyWrapper.prototype,(function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:void 0}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})})),arrayEach(["pop","push","shift","sort","splice","unshift"],(function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args)}return this[chainName]((function(value){return func.apply(isArray(value)?value:[],args)}))}})),baseForOwn(LazyWrapper.prototype,(function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+"";hasOwnProperty.call(realNames,key)||(realNames[key]=[]),realNames[key].push({name:methodName,func:lodashFunc})}})),realNames[createHybrid(void 0,2).name]=[{name:"wrapper",func:void 0}],LazyWrapper.prototype.clone=function lazyClone(){var result=new LazyWrapper(this.__wrapped__);return result.__actions__=copyArray(this.__actions__),result.__dir__=this.__dir__,result.__filtered__=this.__filtered__,result.__iteratees__=copyArray(this.__iteratees__),result.__takeCount__=this.__takeCount__,result.__views__=copyArray(this.__views__),result},LazyWrapper.prototype.reverse=function lazyReverse(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1,result.__filtered__=!0}else(result=this.clone()).__dir__*=-1;return result},LazyWrapper.prototype.value=function lazyValue(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=dir<0,arrLength=isArr?array.length:0,view=function getView(start,end,transforms){var index=-1,length=transforms.length;for(;++index<length;){var data=transforms[index],size=data.size;switch(data.type){case"drop":start+=size;break;case"dropRight":end-=size;break;case"take":end=nativeMin(end,start+size);break;case"takeRight":start=nativeMax(start,end-size)}}return{start:start,end:end}}(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||!isRight&&arrLength==length&&takeCount==length)return baseWrapperValue(array,this.__actions__);var result=[];outer:for(;length--&&resIndex<takeCount;){for(var iterIndex=-1,value=array[index+=dir];++iterIndex<iterLength;){var data=iteratees[iterIndex],iteratee=data.iteratee,type=data.type,computed=iteratee(value);if(2==type)value=computed;else if(!computed){if(1==type)continue outer;break outer}}result[resIndex++]=value}return result},lodash.prototype.at=wrapperAt,lodash.prototype.chain=function wrapperChain(){return chain(this)},lodash.prototype.commit=function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)},lodash.prototype.next=function wrapperNext(){void 0===this.__values__&&(this.__values__=toArray(this.value()));var done=this.__index__>=this.__values__.length;return{done:done,value:done?void 0:this.__values__[this.__index__++]}},lodash.prototype.plant=function wrapperPlant(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=void 0,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result},lodash.prototype.reverse=function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),(wrapped=wrapped.reverse()).__actions__.push({func:thru,args:[reverse],thisArg:void 0}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)},lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)},lodash.prototype.first=lodash.prototype.head,symIterator&&(lodash.prototype[symIterator]=function wrapperToIterator(){return this}),lodash}();root._=_,void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return _}.call(exports,__webpack_require__,exports,module))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}).call(this)}).call(this,__webpack_require__(20),__webpack_require__(54)(module))},function(module,exports,__webpack_require__){var path=__webpack_require__(134),global=__webpack_require__(3),aFunction=function(variable){return"function"==typeof variable?variable:void 0};module.exports=function(namespace,method){return arguments.length<2?aFunction(path[namespace])||aFunction(global[namespace]):path[namespace]&&path[namespace][method]||global[namespace]&&global[namespace][method]}},function(module,exports,__webpack_require__){var activeXDocument,anObject=__webpack_require__(15),defineProperties=__webpack_require__(214),enumBugKeys=__webpack_require__(136),hiddenKeys=__webpack_require__(80),html=__webpack_require__(215),documentCreateElement=__webpack_require__(130),sharedKey=__webpack_require__(96),IE_PROTO=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(content){return"<script>"+content+"<\/script>"},NullProtoObject=function(){try{activeXDocument=document.domain&&new ActiveXObject("htmlfile")}catch(error){}var iframeDocument,iframe;NullProtoObject=activeXDocument?function(activeXDocument){activeXDocument.write(scriptTag("")),activeXDocument.close();var temp=activeXDocument.parentWindow.Object;return activeXDocument=null,temp}(activeXDocument):((iframe=documentCreateElement("iframe")).style.display="none",html.appendChild(iframe),iframe.src=String("javascript:"),(iframeDocument=iframe.contentWindow.document).open(),iframeDocument.write(scriptTag("document.F=Object")),iframeDocument.close(),iframeDocument.F);for(var length=enumBugKeys.length;length--;)delete NullProtoObject.prototype[enumBugKeys[length]];return NullProtoObject()};hiddenKeys[IE_PROTO]=!0,module.exports=Object.create||function create(O,Properties){var result;return null!==O?(EmptyConstructor.prototype=anObject(O),result=new EmptyConstructor,EmptyConstructor.prototype=null,result[IE_PROTO]=O):result=NullProtoObject(),void 0===Properties?result:defineProperties(result,Properties)}},function(module,exports,__webpack_require__){"use strict";var fails=__webpack_require__(5);module.exports=function(METHOD_NAME,argument){var method=[][METHOD_NAME];return!!method&&fails((function(){method.call(null,argument||function(){throw 1},1)}))}},function(module,exports,__webpack_require__){var $=__webpack_require__(2),assign=__webpack_require__(455);$({target:"Object",stat:!0,forced:Object.assign!==assign},{assign:assign})},function(module,exports,__webpack_require__){"use strict";(function(global){__webpack_require__(27),Object.defineProperty(exports,"__esModule",{value:!0}),exports.logger=void 0;var console=global.console,logger={debug:function debug(message){for(var _len=arguments.length,rest=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)rest[_key-1]=arguments[_key];return console.debug.apply(console,[message].concat(rest))},log:function log(message){for(var _len2=arguments.length,rest=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)rest[_key2-1]=arguments[_key2];return console.log.apply(console,[message].concat(rest))},info:function info(message){for(var _len3=arguments.length,rest=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)rest[_key3-1]=arguments[_key3];return console.info.apply(console,[message].concat(rest))},warn:function warn(message){for(var _len4=arguments.length,rest=new Array(_len4>1?_len4-1:0),_key4=1;_key4<_len4;_key4++)rest[_key4-1]=arguments[_key4];return console.warn.apply(console,[message].concat(rest))},error:function error(message){for(var _len5=arguments.length,rest=new Array(_len5>1?_len5-1:0),_key5=1;_key5<_len5;_key5++)rest[_key5-1]=arguments[_key5];return console.error.apply(console,[message].concat(rest))}};exports.logger=logger}).call(this,__webpack_require__(20))},function(module,exports,__webpack_require__){__webpack_require__(2)({target:"Array",stat:!0},{isArray:__webpack_require__(81)})},function(module,exports,__webpack_require__){var redefine=__webpack_require__(21),DatePrototype=Date.prototype,nativeDateToString=DatePrototype.toString,getTime=DatePrototype.getTime;new Date(NaN)+""!="Invalid Date"&&redefine(DatePrototype,"toString",(function toString(){var value=getTime.call(this);return value==value?nativeDateToString.call(this):"Invalid Date"}))},function(module,exports,__webpack_require__){var $=__webpack_require__(2),DESCRIPTORS=__webpack_require__(13);$({target:"Object",stat:!0,forced:!DESCRIPTORS,sham:!DESCRIPTORS},{defineProperty:__webpack_require__(16).f})},function(module,exports,__webpack_require__){"use strict";var redefine=__webpack_require__(21),anObject=__webpack_require__(15),fails=__webpack_require__(5),flags=__webpack_require__(232),RegExpPrototype=RegExp.prototype,nativeToString=RegExpPrototype.toString,NOT_GENERIC=fails((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME="toString"!=nativeToString.name;(NOT_GENERIC||INCORRECT_NAME)&&redefine(RegExp.prototype,"toString",(function toString(){var R=anObject(this),p=String(R.source),rf=R.flags;return"/"+p+"/"+String(void 0===rf&&R instanceof RegExp&&!("flags"in RegExpPrototype)?flags.call(R):rf)}),{unsafe:!0})},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),exec=__webpack_require__(156);$({target:"RegExp",proto:!0,forced:/./.exec!==exec},{exec:exec})},function(module,exports,__webpack_require__){var Symbol=__webpack_require__(111),getRawTag=__webpack_require__(495),objectToString=__webpack_require__(496),symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=function baseGetTag(value){return null==value?void 0===value?"[object Undefined]":"[object Null]":symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value)}},,function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(316);module.exports=Function.prototype.bind||implementation},function(module,exports,__webpack_require__){"use strict";module.exports=Number.isNaN||function isNaN(a){return a!=a}},function(module,exports,__webpack_require__){"use strict";var $Array=__webpack_require__(1)("%Array%"),toStr=!$Array.isArray&&__webpack_require__(6)("Object.prototype.toString");module.exports=$Array.isArray||function IsArray(argument){return"[object Array]"===toStr(argument)}},function(module,exports,__webpack_require__){"use strict";var $Object=__webpack_require__(1)("%Object%"),RequireObjectCoercible=__webpack_require__(32);module.exports=function ToObject(value){return RequireObjectCoercible(value),$Object(value)}},function(module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(13),propertyIsEnumerableModule=__webpack_require__(94),createPropertyDescriptor=__webpack_require__(77),toIndexedObject=__webpack_require__(42),toPrimitive=__webpack_require__(78),has=__webpack_require__(14),IE8_DOM_DEFINE=__webpack_require__(205),nativeGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;exports.f=DESCRIPTORS?nativeGetOwnPropertyDescriptor:function getOwnPropertyDescriptor(O,P){if(O=toIndexedObject(O),P=toPrimitive(P,!0),IE8_DOM_DEFINE)try{return nativeGetOwnPropertyDescriptor(O,P)}catch(error){}if(has(O,P))return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O,P),O[P])}},function(module,exports){module.exports=function(bitmap,value){return{enumerable:!(1&bitmap),configurable:!(2&bitmap),writable:!(4&bitmap),value:value}}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8);module.exports=function(input,PREFERRED_STRING){if(!isObject(input))return input;var fn,val;if(PREFERRED_STRING&&"function"==typeof(fn=input.toString)&&!isObject(val=fn.call(input)))return val;if("function"==typeof(fn=input.valueOf)&&!isObject(val=fn.call(input)))return val;if(!PREFERRED_STRING&&"function"==typeof(fn=input.toString)&&!isObject(val=fn.call(input)))return val;throw TypeError("Can't convert object to primitive value")}},function(module,exports){module.exports=!1},function(module,exports){module.exports={}},function(module,exports,__webpack_require__){var classof=__webpack_require__(34);module.exports=Array.isArray||function isArray(arg){return"Array"==classof(arg)}},function(module,exports,__webpack_require__){var internalObjectKeys=__webpack_require__(209),enumBugKeys=__webpack_require__(136);module.exports=Object.keys||function keys(O){return internalObjectKeys(O,enumBugKeys)}},function(module,exports,__webpack_require__){var aFunction=__webpack_require__(53);module.exports=function(fn,that,length){if(aFunction(fn),void 0===that)return fn;switch(length){case 0:return function(){return fn.call(that)};case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},function(module,exports){module.exports={}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),$map=__webpack_require__(45).map,arrayMethodHasSpeciesSupport=__webpack_require__(101),arrayMethodUsesToLength=__webpack_require__(31),HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("map"),USES_TO_LENGTH=arrayMethodUsesToLength("map");$({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH},{map:function map(callbackfn){return $map(this,callbackfn,arguments.length>1?arguments[1]:void 0)}})},function(module,exports,__webpack_require__){var $=__webpack_require__(2),from=__webpack_require__(466);$({target:"Array",stat:!0,forced:!__webpack_require__(149)((function(iterable){Array.from(iterable)}))},{from:from})},function(module,exports,__webpack_require__){var hiddenKeys=__webpack_require__(80),isObject=__webpack_require__(8),has=__webpack_require__(14),defineProperty=__webpack_require__(16).f,uid=__webpack_require__(97),FREEZING=__webpack_require__(236),METADATA=uid("meta"),id=0,isExtensible=Object.isExtensible||function(){return!0},setMetadata=function(it){defineProperty(it,METADATA,{value:{objectID:"O"+ ++id,weakData:{}}})},meta=module.exports={REQUIRED:!1,fastKey:function(it,create){if(!isObject(it))return"symbol"==typeof it?it:("string"==typeof it?"S":"P")+it;if(!has(it,METADATA)){if(!isExtensible(it))return"F";if(!create)return"E";setMetadata(it)}return it[METADATA].objectID},getWeakData:function(it,create){if(!has(it,METADATA)){if(!isExtensible(it))return!0;if(!create)return!1;setMetadata(it)}return it[METADATA].weakData},onFreeze:function(it){return FREEZING&&meta.REQUIRED&&isExtensible(it)&&!has(it,METADATA)&&setMetadata(it),it}};hiddenKeys[METADATA]=!0},function(module,exports,__webpack_require__){"use strict";var events;Object.defineProperty(exports,"__esModule",{value:!0}),exports.NAVIGATE_URL=exports.DOCS_RENDERED=exports.STORY_THREW_EXCEPTION=exports.STORIES_EXPAND_ALL=exports.STORIES_COLLAPSE_ALL=exports.STORY_CHANGED=exports.STORY_ERRORED=exports.STORY_MISSING=exports.STORY_RENDERED=exports.STORY_RENDER=exports.STORY_ADDED=exports.STORY_INIT=exports.REGISTER_SUBSCRIPTION=exports.FORCE_RE_RENDER=exports.PREVIEW_KEYDOWN=exports.SELECT_STORY=exports.STORIES_CONFIGURED=exports.SET_STORIES=exports.GET_STORIES=exports.SET_CURRENT_STORY=exports.GET_CURRENT_STORY=exports.CHANNEL_CREATED=exports.default=void 0,function(events){events.CHANNEL_CREATED="channelCreated",events.GET_CURRENT_STORY="getCurrentStory",events.SET_CURRENT_STORY="setCurrentStory",events.GET_STORIES="getStories",events.SET_STORIES="setStories",events.STORIES_CONFIGURED="storiesConfigured",events.SELECT_STORY="selectStory",events.PREVIEW_KEYDOWN="previewKeydown",events.STORY_ADDED="storyAdded",events.STORY_CHANGED="storyChanged",events.STORY_UNCHANGED="storyUnchanged",events.FORCE_RE_RENDER="forceReRender",events.REGISTER_SUBSCRIPTION="registerSubscription",events.STORY_INIT="storyInit",events.STORY_RENDER="storyRender",events.STORY_RENDERED="storyRendered",events.STORY_MISSING="storyMissing",events.STORY_ERRORED="storyErrored",events.STORY_THREW_EXCEPTION="storyThrewException",events.STORIES_COLLAPSE_ALL="storiesCollapseAll",events.STORIES_EXPAND_ALL="storiesExpandAll",events.DOCS_RENDERED="docsRendered",events.NAVIGATE_URL="navigateUrl"}(events||(events={}));var _default=events;exports.default=_default;var CHANNEL_CREATED=events.CHANNEL_CREATED,GET_CURRENT_STORY=events.GET_CURRENT_STORY,SET_CURRENT_STORY=events.SET_CURRENT_STORY,GET_STORIES=events.GET_STORIES,SET_STORIES=events.SET_STORIES,STORIES_CONFIGURED=events.STORIES_CONFIGURED,SELECT_STORY=events.SELECT_STORY,PREVIEW_KEYDOWN=events.PREVIEW_KEYDOWN,FORCE_RE_RENDER=events.FORCE_RE_RENDER,REGISTER_SUBSCRIPTION=events.REGISTER_SUBSCRIPTION,STORY_INIT=events.STORY_INIT,STORY_ADDED=events.STORY_ADDED,STORY_RENDER=events.STORY_RENDER,STORY_RENDERED=events.STORY_RENDERED,STORY_MISSING=events.STORY_MISSING,STORY_ERRORED=events.STORY_ERRORED,STORY_CHANGED=events.STORY_CHANGED,STORIES_COLLAPSE_ALL=events.STORIES_COLLAPSE_ALL,STORIES_EXPAND_ALL=events.STORIES_EXPAND_ALL,STORY_THREW_EXCEPTION=events.STORY_THREW_EXCEPTION,DOCS_RENDERED=events.DOCS_RENDERED,NAVIGATE_URL=events.NAVIGATE_URL;exports.NAVIGATE_URL=NAVIGATE_URL,exports.DOCS_RENDERED=DOCS_RENDERED,exports.STORY_THREW_EXCEPTION=STORY_THREW_EXCEPTION,exports.STORIES_EXPAND_ALL=STORIES_EXPAND_ALL,exports.STORIES_COLLAPSE_ALL=STORIES_COLLAPSE_ALL,exports.STORY_CHANGED=STORY_CHANGED,exports.STORY_ERRORED=STORY_ERRORED,exports.STORY_MISSING=STORY_MISSING,exports.STORY_RENDERED=STORY_RENDERED,exports.STORY_RENDER=STORY_RENDER,exports.STORY_ADDED=STORY_ADDED,exports.STORY_INIT=STORY_INIT,exports.REGISTER_SUBSCRIPTION=REGISTER_SUBSCRIPTION,exports.FORCE_RE_RENDER=FORCE_RE_RENDER,exports.PREVIEW_KEYDOWN=PREVIEW_KEYDOWN,exports.SELECT_STORY=SELECT_STORY,exports.STORIES_CONFIGURED=STORIES_CONFIGURED,exports.SET_STORIES=SET_STORIES,exports.GET_STORIES=GET_STORIES,exports.SET_CURRENT_STORY=SET_CURRENT_STORY,exports.GET_CURRENT_STORY=GET_CURRENT_STORY,exports.CHANNEL_CREATED=CHANNEL_CREATED},function(module,exports){module.exports=function eq(value,other){return value===other||value!=value&&other!=other}},function(module,exports,__webpack_require__){"use strict";!function checkDCE(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(err){console.error(err)}}}(),module.exports=__webpack_require__(619)},function(module,exports){var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}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)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},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}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$Math=GetIntrinsic("%Math%"),$Number=GetIntrinsic("%Number%");module.exports=$Number.MAX_SAFE_INTEGER||$Math.pow(2,53)-1},function(module,exports,__webpack_require__){var hasMap="function"==typeof Map&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize=hasMap&&mapSizeDescriptor&&"function"==typeof mapSizeDescriptor.get?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet="function"==typeof Set&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&"function"==typeof setSizeDescriptor.get?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,weakMapHas="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,weakSetHas="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,booleanValueOf=Boolean.prototype.valueOf,objectToString=Object.prototype.toString,match=String.prototype.match,bigIntValueOf="function"==typeof BigInt?BigInt.prototype.valueOf:null,inspectCustom=__webpack_require__(368).custom,inspectSymbol=inspectCustom&&isSymbol(inspectCustom)?inspectCustom:null;function wrapQuotes(s,defaultStyle,opts){var quoteChar="double"===(opts.quoteStyle||defaultStyle)?'"':"'";return quoteChar+s+quoteChar}function quote(s){return String(s).replace(/"/g,""")}function isArray(obj){return"[object Array]"===toStr(obj)}function isSymbol(obj){return"[object Symbol]"===toStr(obj)}module.exports=function inspect_(obj,options,depth,seen){var opts=options||{};if(has(opts,"quoteStyle")&&"single"!==opts.quoteStyle&&"double"!==opts.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(void 0===obj)return"undefined";if(null===obj)return"null";if("boolean"==typeof obj)return obj?"true":"false";if("string"==typeof obj)return function inspectString(str,opts){return wrapQuotes(str.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,lowbyte),"single",opts)}(obj,opts);if("number"==typeof obj)return 0===obj?1/0/obj>0?"0":"-0":String(obj);if("bigint"==typeof obj)return String(obj)+"n";var maxDepth=void 0===opts.depth?5:opts.depth;if(void 0===depth&&(depth=0),depth>=maxDepth&&maxDepth>0&&"object"==typeof obj)return"[Object]";if(void 0===seen)seen=[];else if(function indexOf(xs,x){if(xs.indexOf)return xs.indexOf(x);for(var i=0,l=xs.length;i<l;i++)if(xs[i]===x)return i;return-1}(seen,obj)>=0)return"[Circular]";function inspect(value,from){return from&&(seen=seen.slice()).push(from),inspect_(value,opts,depth+1,seen)}if("function"==typeof obj){var name=function nameOf(f){if(f.name)return f.name;var m=match.call(f,/^function\s*([\w$]+)/);if(m)return m[1];return null}(obj);return"[Function"+(name?": "+name:"")+"]"}if(isSymbol(obj)){var symString=Symbol.prototype.toString.call(obj);return"object"==typeof obj?markBoxed(symString):symString}if(function isElement(x){if(!x||"object"!=typeof x)return!1;if("undefined"!=typeof HTMLElement&&x instanceof HTMLElement)return!0;return"string"==typeof x.nodeName&&"function"==typeof x.getAttribute}(obj)){for(var s="<"+String(obj.nodeName).toLowerCase(),attrs=obj.attributes||[],i=0;i<attrs.length;i++)s+=" "+attrs[i].name+"="+wrapQuotes(quote(attrs[i].value),"double",opts);return s+=">",obj.childNodes&&obj.childNodes.length&&(s+="..."),s+="</"+String(obj.nodeName).toLowerCase()+">"}if(isArray(obj))return 0===obj.length?"[]":"[ "+arrObjKeys(obj,inspect).join(", ")+" ]";if(function isError(obj){return"[object Error]"===toStr(obj)}(obj)){var parts=arrObjKeys(obj,inspect);return 0===parts.length?"["+String(obj)+"]":"{ ["+String(obj)+"] "+parts.join(", ")+" }"}if("object"==typeof obj){if(inspectSymbol&&"function"==typeof obj[inspectSymbol])return obj[inspectSymbol]();if("function"==typeof obj.inspect)return obj.inspect()}if(function isMap(x){if(!mapSize||!x||"object"!=typeof x)return!1;try{mapSize.call(x);try{setSize.call(x)}catch(s){return!0}return x instanceof Map}catch(e){}return!1}(obj)){var mapParts=[];return mapForEach.call(obj,(function(value,key){mapParts.push(inspect(key,obj)+" => "+inspect(value,obj))})),collectionOf("Map",mapSize.call(obj),mapParts)}if(function isSet(x){if(!setSize||!x||"object"!=typeof x)return!1;try{setSize.call(x);try{mapSize.call(x)}catch(m){return!0}return x instanceof Set}catch(e){}return!1}(obj)){var setParts=[];return setForEach.call(obj,(function(value){setParts.push(inspect(value,obj))})),collectionOf("Set",setSize.call(obj),setParts)}if(function isWeakMap(x){if(!weakMapHas||!x||"object"!=typeof x)return!1;try{weakMapHas.call(x,weakMapHas);try{weakSetHas.call(x,weakSetHas)}catch(s){return!0}return x instanceof WeakMap}catch(e){}return!1}(obj))return weakCollectionOf("WeakMap");if(function isWeakSet(x){if(!weakSetHas||!x||"object"!=typeof x)return!1;try{weakSetHas.call(x,weakSetHas);try{weakMapHas.call(x,weakMapHas)}catch(s){return!0}return x instanceof WeakSet}catch(e){}return!1}(obj))return weakCollectionOf("WeakSet");if(function isNumber(obj){return"[object Number]"===toStr(obj)}(obj))return markBoxed(inspect(Number(obj)));if(function isBigInt(obj){return"[object BigInt]"===toStr(obj)}(obj))return markBoxed(inspect(bigIntValueOf.call(obj)));if(function isBoolean(obj){return"[object Boolean]"===toStr(obj)}(obj))return markBoxed(booleanValueOf.call(obj));if(function isString(obj){return"[object String]"===toStr(obj)}(obj))return markBoxed(inspect(String(obj)));if(!function isDate(obj){return"[object Date]"===toStr(obj)}(obj)&&!function isRegExp(obj){return"[object RegExp]"===toStr(obj)}(obj)){var xs=arrObjKeys(obj,inspect);return 0===xs.length?"{}":"{ "+xs.join(", ")+" }"}return String(obj)};var hasOwn=Object.prototype.hasOwnProperty||function(key){return key in this};function has(obj,key){return hasOwn.call(obj,key)}function toStr(obj){return objectToString.call(obj)}function lowbyte(c){var n=c.charCodeAt(0),x={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return x?"\\"+x:"\\x"+(n<16?"0":"")+n.toString(16)}function markBoxed(str){return"Object("+str+")"}function weakCollectionOf(type){return type+" { ? }"}function collectionOf(type,size,entries){return type+" ("+size+") {"+entries.join(", ")+"}"}function arrObjKeys(obj,inspect){var isArr=isArray(obj),xs=[];if(isArr){xs.length=obj.length;for(var i=0;i<obj.length;i++)xs[i]=has(obj,i)?inspect(obj[i],obj):""}for(var key in obj)has(obj,key)&&(isArr&&String(Number(key))===key&&key<obj.length||(/[^\w$]/.test(key)?xs.push(inspect(key,obj)+": "+inspect(obj[key],obj)):xs.push(key+": "+inspect(obj[key],obj))));return xs}},function(module,exports,__webpack_require__){"use strict";var nativePropertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor&&!nativePropertyIsEnumerable.call({1:2},1);exports.f=NASHORN_BUG?function propertyIsEnumerable(V){var descriptor=getOwnPropertyDescriptor(this,V);return!!descriptor&&descriptor.enumerable}:nativePropertyIsEnumerable},function(module,exports,__webpack_require__){var fails=__webpack_require__(5),classof=__webpack_require__(34),split="".split;module.exports=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(it){return"String"==classof(it)?split.call(it,""):Object(it)}:Object},function(module,exports,__webpack_require__){var shared=__webpack_require__(133),uid=__webpack_require__(97),keys=shared("keys");module.exports=function(key){return keys[key]||(keys[key]=uid(key))}},function(module,exports){var id=0,postfix=Math.random();module.exports=function(key){return"Symbol("+String(void 0===key?"":key)+")_"+(++id+postfix).toString(36)}},function(module,exports,__webpack_require__){var internalObjectKeys=__webpack_require__(209),hiddenKeys=__webpack_require__(136).concat("length","prototype");exports.f=Object.getOwnPropertyNames||function getOwnPropertyNames(O){return internalObjectKeys(O,hiddenKeys)}},function(module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(argument){return isNaN(argument=+argument)?0:(argument>0?floor:ceil)(argument)}},function(module,exports,__webpack_require__){var fails=__webpack_require__(5),replacement=/#|\.prototype\./,isForced=function(feature,detection){var value=data[normalize(feature)];return value==POLYFILL||value!=NATIVE&&("function"==typeof detection?fails(detection):!!detection)},normalize=isForced.normalize=function(string){return String(string).replace(replacement,".").toLowerCase()},data=isForced.data={},NATIVE=isForced.NATIVE="N",POLYFILL=isForced.POLYFILL="P";module.exports=isForced},function(module,exports,__webpack_require__){var fails=__webpack_require__(5),wellKnownSymbol=__webpack_require__(7),V8_VERSION=__webpack_require__(140),SPECIES=wellKnownSymbol("species");module.exports=function(METHOD_NAME){return V8_VERSION>=51||!fails((function(){var array=[];return(array.constructor={})[SPECIES]=function(){return{foo:1}},1!==array[METHOD_NAME](Boolean).foo}))}},function(module,exports,__webpack_require__){(function(global){function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=function deprecate(fn,msg){if(config("noDeprecation"))return fn;var warned=!1;return function deprecated(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}}}).call(this,__webpack_require__(20))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={};exports.default=void 0;var _index=__webpack_require__(220);Object.keys(_index).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _index[key]}}))}));var _makeDecorator=__webpack_require__(462);Object.keys(_makeDecorator).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _makeDecorator[key]}}))}));var _types=__webpack_require__(229);Object.keys(_types).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _types[key]}}))}));var _storybookChannelMock=__webpack_require__(463);Object.keys(_storybookChannelMock).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _storybookChannelMock[key]}}))}));var _hooks=__webpack_require__(468);Object.keys(_hooks).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _hooks[key]}}))}));var _default=_index.addons;exports.default=_default},function(module,exports,__webpack_require__){"use strict";var Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,$=__webpack_require__(2),IS_PURE=__webpack_require__(79),global=__webpack_require__(3),getBuiltIn=__webpack_require__(60),NativePromise=__webpack_require__(456),redefine=__webpack_require__(21),redefineAll=__webpack_require__(105),setToStringTag=__webpack_require__(52),setSpecies=__webpack_require__(223),isObject=__webpack_require__(8),aFunction=__webpack_require__(53),anInstance=__webpack_require__(106),classof=__webpack_require__(34),inspectSource=__webpack_require__(132),iterate=__webpack_require__(107),checkCorrectnessOfIteration=__webpack_require__(149),speciesConstructor=__webpack_require__(457),task=__webpack_require__(150).set,microtask=__webpack_require__(458),promiseResolve=__webpack_require__(459),hostReportErrors=__webpack_require__(460),newPromiseCapabilityModule=__webpack_require__(228),perform=__webpack_require__(461),InternalStateModule=__webpack_require__(44),isForced=__webpack_require__(100),wellKnownSymbol=__webpack_require__(7),V8_VERSION=__webpack_require__(140),SPECIES=wellKnownSymbol("species"),PROMISE="Promise",getInternalState=InternalStateModule.get,setInternalState=InternalStateModule.set,getInternalPromiseState=InternalStateModule.getterFor(PROMISE),PromiseConstructor=NativePromise,TypeError=global.TypeError,document=global.document,process=global.process,$fetch=getBuiltIn("fetch"),newPromiseCapability=newPromiseCapabilityModule.f,newGenericPromiseCapability=newPromiseCapability,IS_NODE="process"==classof(process),DISPATCH_EVENT=!!(document&&document.createEvent&&global.dispatchEvent),FORCED=isForced(PROMISE,(function(){if(!(inspectSource(PromiseConstructor)!==String(PromiseConstructor))){if(66===V8_VERSION)return!0;if(!IS_NODE&&"function"!=typeof PromiseRejectionEvent)return!0}if(IS_PURE&&!PromiseConstructor.prototype.finally)return!0;if(V8_VERSION>=51&&/native code/.test(PromiseConstructor))return!1;var promise=PromiseConstructor.resolve(1),FakePromise=function(exec){exec((function(){}),(function(){}))};return(promise.constructor={})[SPECIES]=FakePromise,!(promise.then((function(){}))instanceof FakePromise)})),INCORRECT_ITERATION=FORCED||!checkCorrectnessOfIteration((function(iterable){PromiseConstructor.all(iterable).catch((function(){}))})),isThenable=function(it){var then;return!(!isObject(it)||"function"!=typeof(then=it.then))&&then},notify=function(promise,state,isReject){if(!state.notified){state.notified=!0;var chain=state.reactions;microtask((function(){for(var value=state.value,ok=1==state.state,index=0;chain.length>index;){var result,then,exited,reaction=chain[index++],handler=ok?reaction.ok:reaction.fail,resolve=reaction.resolve,reject=reaction.reject,domain=reaction.domain;try{handler?(ok||(2===state.rejection&&onHandleUnhandled(promise,state),state.rejection=1),!0===handler?result=value:(domain&&domain.enter(),result=handler(value),domain&&(domain.exit(),exited=!0)),result===reaction.promise?reject(TypeError("Promise-chain cycle")):(then=isThenable(result))?then.call(result,resolve,reject):resolve(result)):reject(value)}catch(error){domain&&!exited&&domain.exit(),reject(error)}}state.reactions=[],state.notified=!1,isReject&&!state.rejection&&onUnhandled(promise,state)}))}},dispatchEvent=function(name,promise,reason){var event,handler;DISPATCH_EVENT?((event=document.createEvent("Event")).promise=promise,event.reason=reason,event.initEvent(name,!1,!0),global.dispatchEvent(event)):event={promise:promise,reason:reason},(handler=global["on"+name])?handler(event):"unhandledrejection"===name&&hostReportErrors("Unhandled promise rejection",reason)},onUnhandled=function(promise,state){task.call(global,(function(){var result,value=state.value;if(isUnhandled(state)&&(result=perform((function(){IS_NODE?process.emit("unhandledRejection",value,promise):dispatchEvent("unhandledrejection",promise,value)})),state.rejection=IS_NODE||isUnhandled(state)?2:1,result.error))throw result.value}))},isUnhandled=function(state){return 1!==state.rejection&&!state.parent},onHandleUnhandled=function(promise,state){task.call(global,(function(){IS_NODE?process.emit("rejectionHandled",promise):dispatchEvent("rejectionhandled",promise,state.value)}))},bind=function(fn,promise,state,unwrap){return function(value){fn(promise,state,value,unwrap)}},internalReject=function(promise,state,value,unwrap){state.done||(state.done=!0,unwrap&&(state=unwrap),state.value=value,state.state=2,notify(promise,state,!0))},internalResolve=function(promise,state,value,unwrap){if(!state.done){state.done=!0,unwrap&&(state=unwrap);try{if(promise===value)throw TypeError("Promise can't be resolved itself");var then=isThenable(value);then?microtask((function(){var wrapper={done:!1};try{then.call(value,bind(internalResolve,promise,wrapper,state),bind(internalReject,promise,wrapper,state))}catch(error){internalReject(promise,wrapper,error,state)}})):(state.value=value,state.state=1,notify(promise,state,!1))}catch(error){internalReject(promise,{done:!1},error,state)}}};FORCED&&(PromiseConstructor=function Promise(executor){anInstance(this,PromiseConstructor,PROMISE),aFunction(executor),Internal.call(this);var state=getInternalState(this);try{executor(bind(internalResolve,this,state),bind(internalReject,this,state))}catch(error){internalReject(this,state,error)}},(Internal=function Promise(executor){setInternalState(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=redefineAll(PromiseConstructor.prototype,{then:function then(onFulfilled,onRejected){var state=getInternalPromiseState(this),reaction=newPromiseCapability(speciesConstructor(this,PromiseConstructor));return reaction.ok="function"!=typeof onFulfilled||onFulfilled,reaction.fail="function"==typeof onRejected&&onRejected,reaction.domain=IS_NODE?process.domain:void 0,state.parent=!0,state.reactions.push(reaction),0!=state.state&¬ify(this,state,!1),reaction.promise},catch:function(onRejected){return this.then(void 0,onRejected)}}),OwnPromiseCapability=function(){var promise=new Internal,state=getInternalState(promise);this.promise=promise,this.resolve=bind(internalResolve,promise,state),this.reject=bind(internalReject,promise,state)},newPromiseCapabilityModule.f=newPromiseCapability=function(C){return C===PromiseConstructor||C===PromiseWrapper?new OwnPromiseCapability(C):newGenericPromiseCapability(C)},IS_PURE||"function"!=typeof NativePromise||(nativeThen=NativePromise.prototype.then,redefine(NativePromise.prototype,"then",(function then(onFulfilled,onRejected){var that=this;return new PromiseConstructor((function(resolve,reject){nativeThen.call(that,resolve,reject)})).then(onFulfilled,onRejected)}),{unsafe:!0}),"function"==typeof $fetch&&$({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(input){return promiseResolve(PromiseConstructor,$fetch.apply(global,arguments))}}))),$({global:!0,wrap:!0,forced:FORCED},{Promise:PromiseConstructor}),setToStringTag(PromiseConstructor,PROMISE,!1,!0),setSpecies(PROMISE),PromiseWrapper=getBuiltIn(PROMISE),$({target:PROMISE,stat:!0,forced:FORCED},{reject:function reject(r){var capability=newPromiseCapability(this);return capability.reject.call(void 0,r),capability.promise}}),$({target:PROMISE,stat:!0,forced:IS_PURE||FORCED},{resolve:function resolve(x){return promiseResolve(IS_PURE&&this===PromiseWrapper?PromiseConstructor:this,x)}}),$({target:PROMISE,stat:!0,forced:INCORRECT_ITERATION},{all:function all(iterable){var C=this,capability=newPromiseCapability(C),resolve=capability.resolve,reject=capability.reject,result=perform((function(){var $promiseResolve=aFunction(C.resolve),values=[],counter=0,remaining=1;iterate(iterable,(function(promise){var index=counter++,alreadyCalled=!1;values.push(void 0),remaining++,$promiseResolve.call(C,promise).then((function(value){alreadyCalled||(alreadyCalled=!0,values[index]=value,--remaining||resolve(values))}),reject)})),--remaining||resolve(values)}));return result.error&&reject(result.value),capability.promise},race:function race(iterable){var C=this,capability=newPromiseCapability(C),reject=capability.reject,result=perform((function(){var $promiseResolve=aFunction(C.resolve);iterate(iterable,(function(promise){$promiseResolve.call(C,promise).then(capability.resolve,reject)}))}));return result.error&&reject(result.value),capability.promise}})},function(module,exports,__webpack_require__){var redefine=__webpack_require__(21);module.exports=function(target,src,options){for(var key in src)redefine(target,key,src[key],options);return target}},function(module,exports){module.exports=function(it,Constructor,name){if(!(it instanceof Constructor))throw TypeError("Incorrect "+(name?name+" ":"")+"invocation");return it}},function(module,exports,__webpack_require__){var anObject=__webpack_require__(15),isArrayIteratorMethod=__webpack_require__(224),toLength=__webpack_require__(35),bind=__webpack_require__(83),getIteratorMethod=__webpack_require__(225),callWithSafeIterationClosing=__webpack_require__(226),Result=function(stopped,result){this.stopped=stopped,this.result=result};(module.exports=function(iterable,fn,that,AS_ENTRIES,IS_ITERATOR){var iterator,iterFn,index,length,result,next,step,boundFunction=bind(fn,that,AS_ENTRIES?2:1);if(IS_ITERATOR)iterator=iterable;else{if("function"!=typeof(iterFn=getIteratorMethod(iterable)))throw TypeError("Target is not iterable");if(isArrayIteratorMethod(iterFn)){for(index=0,length=toLength(iterable.length);length>index;index++)if((result=AS_ENTRIES?boundFunction(anObject(step=iterable[index])[0],step[1]):boundFunction(iterable[index]))&&result instanceof Result)return result;return new Result(!1)}iterator=iterFn.call(iterable)}for(next=iterator.next;!(step=next.call(iterator)).done;)if("object"==typeof(result=callWithSafeIterationClosing(iterator,boundFunction,step.value,AS_ENTRIES))&&result&&result instanceof Result)return result;return new Result(!1)}).stop=function(result){return new Result(!0,result)}},function(module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(13),defineProperty=__webpack_require__(16).f,FunctionPrototype=Function.prototype,FunctionPrototypeToString=FunctionPrototype.toString,nameRE=/^\s*function ([^ (]*)/;!DESCRIPTORS||"name"in FunctionPrototype||defineProperty(FunctionPrototype,"name",{configurable:!0,get:function(){try{return FunctionPrototypeToString.call(this).match(nameRE)[1]}catch(error){return""}}})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isExportStory=function isExportStory(key,_ref){var includeStories=_ref.includeStories,excludeStories=_ref.excludeStories;return("__esModule"!==key&&(!includeStories||matches(key,includeStories))&&(!excludeStories||!matches(key,excludeStories)))},exports.parseKind=exports.storyNameFromExport=exports.toId=exports.sanitize=void 0;var _startCase=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(487));function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var sanitize=function sanitize(string){return string.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")};exports.sanitize=sanitize;var sanitizeSafe=function sanitizeSafe(string,part){var sanitized=sanitize(string);if(""===sanitized)throw new Error("Invalid ".concat(part," '").concat(string,"', must include alphanumeric characters"));return sanitized};exports.toId=function toId(kind,name){return"".concat(sanitizeSafe(kind,"kind"),"--").concat(sanitizeSafe(name,"name"))};function matches(storyKey,arrayOrRegex){return Array.isArray(arrayOrRegex)?arrayOrRegex.includes(storyKey):storyKey.match(arrayOrRegex)}exports.storyNameFromExport=function storyNameFromExport(key){return(0,_startCase.default)(key)};exports.parseKind=function parseKind(kind,_ref2){var rootSeparator=_ref2.rootSeparator,groupSeparator=_ref2.groupSeparator,_kind$split2=_slicedToArray(kind.split(rootSeparator,2),2),root=_kind$split2[0],remainder=_kind$split2[1];return{root:remainder?root:null,groups:(remainder||kind).split(groupSeparator).filter((function(i){return!!i}))}}},function(module,exports,__webpack_require__){var baseToString=__webpack_require__(493);module.exports=function toString(value){return null==value?"":baseToString(value)}},function(module,exports,__webpack_require__){var Symbol=__webpack_require__(24).Symbol;module.exports=Symbol},function(module,exports,__webpack_require__){var baseGetTag=__webpack_require__(70),isObjectLike=__webpack_require__(57);module.exports=function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}},function(module,exports,__webpack_require__){var listCacheClear=__webpack_require__(510),listCacheDelete=__webpack_require__(511),listCacheGet=__webpack_require__(512),listCacheHas=__webpack_require__(513),listCacheSet=__webpack_require__(514);function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,module.exports=ListCache},function(module,exports,__webpack_require__){var eq=__webpack_require__(89);module.exports=function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}},function(module,exports,__webpack_require__){var nativeCreate=__webpack_require__(58)(Object,"create");module.exports=nativeCreate},function(module,exports,__webpack_require__){var isKeyable=__webpack_require__(532);module.exports=function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data["string"==typeof key?"string":"hash"]:data.map}},function(module,exports,__webpack_require__){var isFunction=__webpack_require__(161),isLength=__webpack_require__(252);module.exports=function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}},function(module,exports,__webpack_require__){var runtime=function(exports){"use strict";var Op=Object.prototype,hasOwn=Op.hasOwnProperty,$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return generator._invoke=function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function invoke(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}(innerFn,self,context),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};IteratorPrototype[iteratorSymbol]=function(){return this};var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach((function(method){prototype[method]=function(arg){return this._invoke(method,arg)}}))}function AsyncIterator(generator){var previousPromise;this._invoke=function enqueue(method,arg){function callInvokeWithMethodAndArg(){return new Promise((function(resolve,reject){!function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==typeof value&&hasOwn.call(value,"__await")?Promise.resolve(value.__await).then((function(value){invoke("next",value,resolve,reject)}),(function(err){invoke("throw",err,resolve,reject)})):Promise.resolve(value).then((function(unwrapped){result.value=unwrapped,resolve(result)}),(function(error){return invoke("throw",error,resolve,reject)}))}reject(record.arg)}(method,arg,resolve,reject)}))}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(delegate,context){var method=delegate.iterator[context.method];if(void 0===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method))return ContinueSentinel;context.method="throw",context.arg=new TypeError("The iterator does not provide a 'throw' method")}return ContinueSentinel}var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=Gp.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[toStringTagSymbol]=GeneratorFunction.displayName="GeneratorFunction",exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name))},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,toStringTagSymbol in genFun||(genFun[toStringTagSymbol]="GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun},exports.awrap=function(arg){return{__await:arg}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[asyncIteratorSymbol]=function(){return this},exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList){var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList));return exports.isGeneratorFunction(outerFn)?iter:iter.next().then((function(result){return result.done?result.value:iter.next()}))},defineIteratorMethods(Gp),Gp[toStringTagSymbol]="Generator",Gp[iteratorSymbol]=function(){return this},Gp.toString=function(){return"[object Generator]"},exports.keys=function(object){var keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next}return next.done=!0,next}},exports.values=values,Context.prototype={constructor:Context,reset:function(skipTempReset){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(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},stop:function(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval},dispatchException:function(exception){if(this.done)throw exception;var context=this;function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(hasCatch){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}else{if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}}}},abrupt:function(type,arg){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break}}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record)},complete:function(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel},finish:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel}},catch:function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}(module.exports);try{regeneratorRuntime=runtime}catch(accidentalStrictMode){Function("r","regeneratorRuntime = r")(runtime)}},function(module,exports,__webpack_require__){"use strict";var fnToStr=Function.prototype.toString,constructorRegex=/^\s*class\b/,isES6ClassFn=function isES6ClassFunction(value){try{var fnStr=fnToStr.call(value);return constructorRegex.test(fnStr)}catch(e){return!1}},toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isCallable(value){if(!value)return!1;if("function"!=typeof value&&"object"!=typeof value)return!1;if("function"==typeof value&&!value.prototype)return!0;if(hasToStringTag)return function tryFunctionToStr(value){try{return!isES6ClassFn(value)&&(fnToStr.call(value),!0)}catch(e){return!1}}(value);if(isES6ClassFn(value))return!1;var strClass=toStr.call(value);return"[object Function]"===strClass||"[object GeneratorFunction]"===strClass}},function(module,exports,__webpack_require__){"use strict";var bind=__webpack_require__(72),$Function=__webpack_require__(1)("%Function%"),$apply=$Function.apply,$call=$Function.call;module.exports=function callBind(){return bind.apply($call,arguments)},module.exports.apply=function applyBind(){return bind.apply($apply,arguments)}},function(module,exports,__webpack_require__){"use strict";var $isNaN=Number.isNaN||function(a){return a!=a};module.exports=Number.isFinite||function(x){return"number"==typeof x&&!$isNaN(x)&&x!==1/0&&x!==-1/0}},function(module,exports,__webpack_require__){"use strict";module.exports=function isPrimitive(value){return null===value||"function"!=typeof value&&"object"!=typeof value}},function(module,exports,__webpack_require__){"use strict";var strValue=String.prototype.valueOf,toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isString(value){return"string"==typeof value||"object"==typeof value&&(hasToStringTag?function tryStringObject(value){try{return strValue.call(value),!0}catch(e){return!1}}(value):"[object String]"===toStr.call(value))}},function(module,exports,__webpack_require__){"use strict";module.exports=function ToBoolean(value){return!!value}},function(module,exports,__webpack_require__){"use strict";module.exports=function requirePromise(){if("function"!=typeof Promise)throw new TypeError("`Promise.prototype.finally` requires a global `Promise` be available.")}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$Array=GetIntrinsic("%Array%"),$species=GetIntrinsic("%Symbol.species%",!0),$TypeError=GetIntrinsic("%TypeError%"),Get=__webpack_require__(18),IsArray=__webpack_require__(74),IsConstructor=__webpack_require__(191),IsInteger=__webpack_require__(192),Type=__webpack_require__(4);module.exports=function ArraySpeciesCreate(originalArray,length){if(!IsInteger(length)||length<0)throw new $TypeError("Assertion failed: length must be an integer >= 0");var C,len=0===length?0:length;if(IsArray(originalArray)&&(C=Get(originalArray,"constructor"),$species&&"Object"===Type(C)&&null===(C=Get(C,$species))&&(C=void 0)),void 0===C)return $Array(len);if(!IsConstructor(C))throw new $TypeError("C must be a constructor");return new C(len)}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),CreateDataProperty=__webpack_require__(185),IsPropertyKey=__webpack_require__(33),Type=__webpack_require__(4);module.exports=function CreateDataPropertyOrThrow(O,P,V){if("Object"!==Type(O))throw new $TypeError("Assertion failed: Type(O) is not Object");if(!IsPropertyKey(P))throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true");var success=CreateDataProperty(O,P,V);if(!success)throw new $TypeError("unable to create data property");return success}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),GetV=__webpack_require__(197),IsCallable=__webpack_require__(25),IsPropertyKey=__webpack_require__(33);module.exports=function GetMethod(O,P){if(!IsPropertyKey(P))throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true");var func=GetV(O,P);if(null!=func){if(!IsCallable(func))throw new $TypeError(P+"is not a function");return func}}},function(module,exports,__webpack_require__){"use strict";module.exports=function requirePromise(){if("function"!=typeof Promise)throw new TypeError("`Promise.allSettled` requires a global `Promise` be available.")}},function(module,exports,__webpack_require__){var global=__webpack_require__(3),isObject=__webpack_require__(8),document=global.document,EXISTS=isObject(document)&&isObject(document.createElement);module.exports=function(it){return EXISTS?document.createElement(it):{}}},function(module,exports,__webpack_require__){var global=__webpack_require__(3),createNonEnumerableProperty=__webpack_require__(28);module.exports=function(key,value){try{createNonEnumerableProperty(global,key,value)}catch(error){global[key]=value}return value}},function(module,exports,__webpack_require__){var store=__webpack_require__(206),functionToString=Function.toString;"function"!=typeof store.inspectSource&&(store.inspectSource=function(it){return functionToString.call(it)}),module.exports=store.inspectSource},function(module,exports,__webpack_require__){var IS_PURE=__webpack_require__(79),store=__webpack_require__(206);(module.exports=function(key,value){return store[key]||(store[key]=void 0!==value?value:{})})("versions",[]).push({version:"3.6.4",mode:IS_PURE?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(module,exports,__webpack_require__){var global=__webpack_require__(3);module.exports=global},function(module,exports,__webpack_require__){var toIndexedObject=__webpack_require__(42),toLength=__webpack_require__(35),toAbsoluteIndex=__webpack_require__(210),createMethod=function(IS_INCLUDES){return function($this,el,fromIndex){var value,O=toIndexedObject($this),length=toLength(O.length),index=toAbsoluteIndex(fromIndex,length);if(IS_INCLUDES&&el!=el){for(;length>index;)if((value=O[index++])!=value)return!0}else for(;length>index;index++)if((IS_INCLUDES||index in O)&&O[index]===el)return IS_INCLUDES||index||0;return!IS_INCLUDES&&-1}};module.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},function(module,exports){module.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(module,exports){exports.f=Object.getOwnPropertySymbols},function(module,exports,__webpack_require__){"use strict";var toPrimitive=__webpack_require__(78),definePropertyModule=__webpack_require__(16),createPropertyDescriptor=__webpack_require__(77);module.exports=function(object,key,value){var propertyKey=toPrimitive(key);propertyKey in object?definePropertyModule.f(object,propertyKey,createPropertyDescriptor(0,value)):object[propertyKey]=value}},function(module,exports,__webpack_require__){var fails=__webpack_require__(5);module.exports=!!Object.getOwnPropertySymbols&&!fails((function(){return!String(Symbol())}))},function(module,exports,__webpack_require__){var match,version,global=__webpack_require__(3),userAgent=__webpack_require__(141),process=global.process,versions=process&&process.versions,v8=versions&&versions.v8;v8?version=(match=v8.split("."))[0]+match[1]:userAgent&&(!(match=userAgent.match(/Edge\/(\d+)/))||match[1]>=74)&&(match=userAgent.match(/Chrome\/(\d+)/))&&(version=match[1]),module.exports=version&&+version},function(module,exports,__webpack_require__){var getBuiltIn=__webpack_require__(60);module.exports=getBuiltIn("navigator","userAgent")||""},function(module,exports,__webpack_require__){var test={};test[__webpack_require__(7)("toStringTag")]="z",module.exports="[object z]"===String(test)},function(module,exports,__webpack_require__){var wellKnownSymbol=__webpack_require__(7),create=__webpack_require__(61),definePropertyModule=__webpack_require__(16),UNSCOPABLES=wellKnownSymbol("unscopables"),ArrayPrototype=Array.prototype;null==ArrayPrototype[UNSCOPABLES]&&definePropertyModule.f(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:create(null)}),module.exports=function(key){ArrayPrototype[UNSCOPABLES][key]=!0}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),createIteratorConstructor=__webpack_require__(453),getPrototypeOf=__webpack_require__(145),setPrototypeOf=__webpack_require__(146),setToStringTag=__webpack_require__(52),createNonEnumerableProperty=__webpack_require__(28),redefine=__webpack_require__(21),wellKnownSymbol=__webpack_require__(7),IS_PURE=__webpack_require__(79),Iterators=__webpack_require__(84),IteratorsCore=__webpack_require__(217),IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR=wellKnownSymbol("iterator"),returnThis=function(){return this};module.exports=function(Iterable,NAME,IteratorConstructor,next,DEFAULT,IS_SET,FORCED){createIteratorConstructor(IteratorConstructor,NAME,next);var CurrentIteratorPrototype,methods,KEY,getIterationMethod=function(KIND){if(KIND===DEFAULT&&defaultIterator)return defaultIterator;if(!BUGGY_SAFARI_ITERATORS&&KIND in IterablePrototype)return IterablePrototype[KIND];switch(KIND){case"keys":return function keys(){return new IteratorConstructor(this,KIND)};case"values":return function values(){return new IteratorConstructor(this,KIND)};case"entries":return function entries(){return new IteratorConstructor(this,KIND)}}return function(){return new IteratorConstructor(this)}},TO_STRING_TAG=NAME+" Iterator",INCORRECT_VALUES_NAME=!1,IterablePrototype=Iterable.prototype,nativeIterator=IterablePrototype[ITERATOR]||IterablePrototype["@@iterator"]||DEFAULT&&IterablePrototype[DEFAULT],defaultIterator=!BUGGY_SAFARI_ITERATORS&&nativeIterator||getIterationMethod(DEFAULT),anyNativeIterator="Array"==NAME&&IterablePrototype.entries||nativeIterator;if(anyNativeIterator&&(CurrentIteratorPrototype=getPrototypeOf(anyNativeIterator.call(new Iterable)),IteratorPrototype!==Object.prototype&&CurrentIteratorPrototype.next&&(IS_PURE||getPrototypeOf(CurrentIteratorPrototype)===IteratorPrototype||(setPrototypeOf?setPrototypeOf(CurrentIteratorPrototype,IteratorPrototype):"function"!=typeof CurrentIteratorPrototype[ITERATOR]&&createNonEnumerableProperty(CurrentIteratorPrototype,ITERATOR,returnThis)),setToStringTag(CurrentIteratorPrototype,TO_STRING_TAG,!0,!0),IS_PURE&&(Iterators[TO_STRING_TAG]=returnThis))),"values"==DEFAULT&&nativeIterator&&"values"!==nativeIterator.name&&(INCORRECT_VALUES_NAME=!0,defaultIterator=function values(){return nativeIterator.call(this)}),IS_PURE&&!FORCED||IterablePrototype[ITERATOR]===defaultIterator||createNonEnumerableProperty(IterablePrototype,ITERATOR,defaultIterator),Iterators[NAME]=defaultIterator,DEFAULT)if(methods={values:getIterationMethod("values"),keys:IS_SET?defaultIterator:getIterationMethod("keys"),entries:getIterationMethod("entries")},FORCED)for(KEY in methods)!BUGGY_SAFARI_ITERATORS&&!INCORRECT_VALUES_NAME&&KEY in IterablePrototype||redefine(IterablePrototype,KEY,methods[KEY]);else $({target:NAME,proto:!0,forced:BUGGY_SAFARI_ITERATORS||INCORRECT_VALUES_NAME},methods);return methods}},function(module,exports,__webpack_require__){var has=__webpack_require__(14),toObject=__webpack_require__(22),sharedKey=__webpack_require__(96),CORRECT_PROTOTYPE_GETTER=__webpack_require__(218),IE_PROTO=sharedKey("IE_PROTO"),ObjectPrototype=Object.prototype;module.exports=CORRECT_PROTOTYPE_GETTER?Object.getPrototypeOf:function(O){return O=toObject(O),has(O,IE_PROTO)?O[IE_PROTO]:"function"==typeof O.constructor&&O instanceof O.constructor?O.constructor.prototype:O instanceof Object?ObjectPrototype:null}},function(module,exports,__webpack_require__){var anObject=__webpack_require__(15),aPossiblePrototype=__webpack_require__(454);module.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var setter,CORRECT_SETTER=!1,test={};try{(setter=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(test,[]),CORRECT_SETTER=test instanceof Array}catch(error){}return function setPrototypeOf(O,proto){return anObject(O),aPossiblePrototype(proto),CORRECT_SETTER?setter.call(O,proto):O.__proto__=proto,O}}():void 0)},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),$indexOf=__webpack_require__(135).indexOf,arrayMethodIsStrict=__webpack_require__(62),arrayMethodUsesToLength=__webpack_require__(31),nativeIndexOf=[].indexOf,NEGATIVE_ZERO=!!nativeIndexOf&&1/[1].indexOf(1,-0)<0,STRICT_METHOD=arrayMethodIsStrict("indexOf"),USES_TO_LENGTH=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});$({target:"Array",proto:!0,forced:NEGATIVE_ZERO||!STRICT_METHOD||!USES_TO_LENGTH},{indexOf:function indexOf(searchElement){return NEGATIVE_ZERO?nativeIndexOf.apply(this,arguments)||0:$indexOf(this,searchElement,arguments.length>1?arguments[1]:void 0)}})},function(module,exports,__webpack_require__){var $=__webpack_require__(2),$values=__webpack_require__(222).values;$({target:"Object",stat:!0},{values:function values(O){return $values(O)}})},function(module,exports,__webpack_require__){var ITERATOR=__webpack_require__(7)("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(error){}module.exports=function(exec,SKIP_CLOSING){if(!SKIP_CLOSING&&!SAFE_CLOSING)return!1;var ITERATION_SUPPORT=!1;try{var object={};object[ITERATOR]=function(){return{next:function(){return{done:ITERATION_SUPPORT=!0}}}},exec(object)}catch(error){}return ITERATION_SUPPORT}},function(module,exports,__webpack_require__){var defer,channel,port,global=__webpack_require__(3),fails=__webpack_require__(5),classof=__webpack_require__(34),bind=__webpack_require__(83),html=__webpack_require__(215),createElement=__webpack_require__(130),IS_IOS=__webpack_require__(227),location=global.location,set=global.setImmediate,clear=global.clearImmediate,process=global.process,MessageChannel=global.MessageChannel,Dispatch=global.Dispatch,counter=0,queue={},run=function(id){if(queue.hasOwnProperty(id)){var fn=queue[id];delete queue[id],fn()}},runner=function(id){return function(){run(id)}},listener=function(event){run(event.data)},post=function(id){global.postMessage(id+"",location.protocol+"//"+location.host)};set&&clear||(set=function setImmediate(fn){for(var args=[],i=1;arguments.length>i;)args.push(arguments[i++]);return queue[++counter]=function(){("function"==typeof fn?fn:Function(fn)).apply(void 0,args)},defer(counter),counter},clear=function clearImmediate(id){delete queue[id]},"process"==classof(process)?defer=function(id){process.nextTick(runner(id))}:Dispatch&&Dispatch.now?defer=function(id){Dispatch.now(runner(id))}:MessageChannel&&!IS_IOS?(port=(channel=new MessageChannel).port2,channel.port1.onmessage=listener,defer=bind(port.postMessage,port,1)):!global.addEventListener||"function"!=typeof postMessage||global.importScripts||fails(post)?defer="onreadystatechange"in createElement("script")?function(id){html.appendChild(createElement("script")).onreadystatechange=function(){html.removeChild(this),run(id)}}:function(id){setTimeout(runner(id),0)}:(defer=post,global.addEventListener("message",listener,!1))),module.exports={set:set,clear:clear}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),$find=__webpack_require__(45).find,addToUnscopables=__webpack_require__(143),arrayMethodUsesToLength=__webpack_require__(31),SKIPS_HOLES=!0,USES_TO_LENGTH=arrayMethodUsesToLength("find");"find"in[]&&Array(1).find((function(){SKIPS_HOLES=!1})),$({target:"Array",proto:!0,forced:SKIPS_HOLES||!USES_TO_LENGTH},{find:function find(callbackfn){return $find(this,callbackfn,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("find")},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),$filter=__webpack_require__(45).filter,arrayMethodHasSpeciesSupport=__webpack_require__(101),arrayMethodUsesToLength=__webpack_require__(31),HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("filter"),USES_TO_LENGTH=arrayMethodUsesToLength("filter");$({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH},{filter:function filter(callbackfn){return $filter(this,callbackfn,arguments.length>1?arguments[1]:void 0)}})},function(module,exports,__webpack_require__){var $=__webpack_require__(2),$entries=__webpack_require__(222).entries;$({target:"Object",stat:!0},{entries:function entries(O){return $entries(O)}})},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),global=__webpack_require__(3),isForced=__webpack_require__(100),redefine=__webpack_require__(21),InternalMetadataModule=__webpack_require__(87),iterate=__webpack_require__(107),anInstance=__webpack_require__(106),isObject=__webpack_require__(8),fails=__webpack_require__(5),checkCorrectnessOfIteration=__webpack_require__(149),setToStringTag=__webpack_require__(52),inheritIfRequired=__webpack_require__(237);module.exports=function(CONSTRUCTOR_NAME,wrapper,common){var IS_MAP=-1!==CONSTRUCTOR_NAME.indexOf("Map"),IS_WEAK=-1!==CONSTRUCTOR_NAME.indexOf("Weak"),ADDER=IS_MAP?"set":"add",NativeConstructor=global[CONSTRUCTOR_NAME],NativePrototype=NativeConstructor&&NativeConstructor.prototype,Constructor=NativeConstructor,exported={},fixMethod=function(KEY){var nativeMethod=NativePrototype[KEY];redefine(NativePrototype,KEY,"add"==KEY?function add(value){return nativeMethod.call(this,0===value?0:value),this}:"delete"==KEY?function(key){return!(IS_WEAK&&!isObject(key))&&nativeMethod.call(this,0===key?0:key)}:"get"==KEY?function get(key){return IS_WEAK&&!isObject(key)?void 0:nativeMethod.call(this,0===key?0:key)}:"has"==KEY?function has(key){return!(IS_WEAK&&!isObject(key))&&nativeMethod.call(this,0===key?0:key)}:function set(key,value){return nativeMethod.call(this,0===key?0:key,value),this})};if(isForced(CONSTRUCTOR_NAME,"function"!=typeof NativeConstructor||!(IS_WEAK||NativePrototype.forEach&&!fails((function(){(new NativeConstructor).entries().next()})))))Constructor=common.getConstructor(wrapper,CONSTRUCTOR_NAME,IS_MAP,ADDER),InternalMetadataModule.REQUIRED=!0;else if(isForced(CONSTRUCTOR_NAME,!0)){var instance=new Constructor,HASNT_CHAINING=instance[ADDER](IS_WEAK?{}:-0,1)!=instance,THROWS_ON_PRIMITIVES=fails((function(){instance.has(1)})),ACCEPT_ITERABLES=checkCorrectnessOfIteration((function(iterable){new NativeConstructor(iterable)})),BUGGY_ZERO=!IS_WEAK&&fails((function(){for(var $instance=new NativeConstructor,index=5;index--;)$instance[ADDER](index,index);return!$instance.has(-0)}));ACCEPT_ITERABLES||((Constructor=wrapper((function(dummy,iterable){anInstance(dummy,Constructor,CONSTRUCTOR_NAME);var that=inheritIfRequired(new NativeConstructor,dummy,Constructor);return null!=iterable&&iterate(iterable,that[ADDER],that,IS_MAP),that}))).prototype=NativePrototype,NativePrototype.constructor=Constructor),(THROWS_ON_PRIMITIVES||BUGGY_ZERO)&&(fixMethod("delete"),fixMethod("has"),IS_MAP&&fixMethod("get")),(BUGGY_ZERO||HASNT_CHAINING)&&fixMethod(ADDER),IS_WEAK&&NativePrototype.clear&&delete NativePrototype.clear}return exported[CONSTRUCTOR_NAME]=Constructor,$({global:!0,forced:Constructor!=NativeConstructor},exported),setToStringTag(Constructor,CONSTRUCTOR_NAME),IS_WEAK||common.setStrong(Constructor,CONSTRUCTOR_NAME,IS_MAP),Constructor}},function(module,exports,__webpack_require__){var $=__webpack_require__(2),fails=__webpack_require__(5),toObject=__webpack_require__(22),nativeGetPrototypeOf=__webpack_require__(145),CORRECT_PROTOTYPE_GETTER=__webpack_require__(218);$({target:"Object",stat:!0,forced:fails((function(){nativeGetPrototypeOf(1)})),sham:!CORRECT_PROTOTYPE_GETTER},{getPrototypeOf:function getPrototypeOf(it){return nativeGetPrototypeOf(toObject(it))}})},function(module,exports,__webpack_require__){"use strict";var re1,re2,regexpFlags=__webpack_require__(232),stickyHelpers=__webpack_require__(486),nativeExec=RegExp.prototype.exec,nativeReplace=String.prototype.replace,patchedExec=nativeExec,UPDATES_LAST_INDEX_WRONG=(re1=/a/,re2=/b*/g,nativeExec.call(re1,"a"),nativeExec.call(re2,"a"),0!==re1.lastIndex||0!==re2.lastIndex),UNSUPPORTED_Y=stickyHelpers.UNSUPPORTED_Y||stickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1];(UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y)&&(patchedExec=function exec(str){var lastIndex,reCopy,match,i,re=this,sticky=UNSUPPORTED_Y&&re.sticky,flags=regexpFlags.call(re),source=re.source,charsAdded=0,strCopy=str;return sticky&&(-1===(flags=flags.replace("y","")).indexOf("g")&&(flags+="g"),strCopy=String(str).slice(re.lastIndex),re.lastIndex>0&&(!re.multiline||re.multiline&&"\n"!==str[re.lastIndex-1])&&(source="(?: "+source+")",strCopy=" "+strCopy,charsAdded++),reCopy=new RegExp("^(?:"+source+")",flags)),NPCG_INCLUDED&&(reCopy=new RegExp("^"+source+"$(?!\\s)",flags)),UPDATES_LAST_INDEX_WRONG&&(lastIndex=re.lastIndex),match=nativeExec.call(sticky?reCopy:re,strCopy),sticky?match?(match.input=match.input.slice(charsAdded),match[0]=match[0].slice(charsAdded),match.index=re.lastIndex,re.lastIndex+=match[0].length):re.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&match&&(re.lastIndex=re.global?match.index+match[0].length:lastIndex),NPCG_INCLUDED&&match&&match.length>1&&nativeReplace.call(match[0],reCopy,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(match[i]=void 0)})),match}),module.exports=patchedExec},function(module,exports,__webpack_require__){"use strict";var fixRegExpWellKnownSymbolLogic=__webpack_require__(158),anObject=__webpack_require__(15),toLength=__webpack_require__(35),requireObjectCoercible=__webpack_require__(43),advanceStringIndex=__webpack_require__(241),regExpExec=__webpack_require__(159);fixRegExpWellKnownSymbolLogic("match",1,(function(MATCH,nativeMatch,maybeCallNative){return[function match(regexp){var O=requireObjectCoercible(this),matcher=null==regexp?void 0:regexp[MATCH];return void 0!==matcher?matcher.call(regexp,O):new RegExp(regexp)[MATCH](String(O))},function(regexp){var res=maybeCallNative(nativeMatch,regexp,this);if(res.done)return res.value;var rx=anObject(regexp),S=String(this);if(!rx.global)return regExpExec(rx,S);var fullUnicode=rx.unicode;rx.lastIndex=0;for(var result,A=[],n=0;null!==(result=regExpExec(rx,S));){var matchStr=String(result[0]);A[n]=matchStr,""===matchStr&&(rx.lastIndex=advanceStringIndex(S,toLength(rx.lastIndex),fullUnicode)),n++}return 0===n?null:A}]}))},function(module,exports,__webpack_require__){"use strict";__webpack_require__(69);var redefine=__webpack_require__(21),fails=__webpack_require__(5),wellKnownSymbol=__webpack_require__(7),regexpExec=__webpack_require__(156),createNonEnumerableProperty=__webpack_require__(28),SPECIES=wellKnownSymbol("species"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails((function(){var re=/./;return re.exec=function(){var result=[];return result.groups={a:"7"},result},"7"!=="".replace(re,"$<a>")})),REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REPLACE=wellKnownSymbol("replace"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails((function(){var re=/(?:)/,originalExec=re.exec;re.exec=function(){return originalExec.apply(this,arguments)};var result="ab".split(re);return 2!==result.length||"a"!==result[0]||"b"!==result[1]}));module.exports=function(KEY,length,exec,sham){var SYMBOL=wellKnownSymbol(KEY),DELEGATES_TO_SYMBOL=!fails((function(){var O={};return O[SYMBOL]=function(){return 7},7!=""[KEY](O)})),DELEGATES_TO_EXEC=DELEGATES_TO_SYMBOL&&!fails((function(){var execCalled=!1,re=/a/;return"split"===KEY&&((re={}).constructor={},re.constructor[SPECIES]=function(){return re},re.flags="",re[SYMBOL]=/./[SYMBOL]),re.exec=function(){return execCalled=!0,null},re[SYMBOL](""),!execCalled}));if(!DELEGATES_TO_SYMBOL||!DELEGATES_TO_EXEC||"replace"===KEY&&(!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE)||"split"===KEY&&!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC){var nativeRegExpMethod=/./[SYMBOL],methods=exec(SYMBOL,""[KEY],(function(nativeMethod,regexp,str,arg2,forceStringMethod){return regexp.exec===regexpExec?DELEGATES_TO_SYMBOL&&!forceStringMethod?{done:!0,value:nativeRegExpMethod.call(regexp,str,arg2)}:{done:!0,value:nativeMethod.call(str,regexp,arg2)}:{done:!1}}),{REPLACE_KEEPS_$0:REPLACE_KEEPS_$0,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE}),stringMethod=methods[0],regexMethod=methods[1];redefine(String.prototype,KEY,stringMethod),redefine(RegExp.prototype,SYMBOL,2==length?function(string,arg){return regexMethod.call(string,this,arg)}:function(string){return regexMethod.call(string,this)})}sham&&createNonEnumerableProperty(RegExp.prototype[SYMBOL],"sham",!0)}},function(module,exports,__webpack_require__){var classof=__webpack_require__(34),regexpExec=__webpack_require__(156);module.exports=function(R,S){var exec=R.exec;if("function"==typeof exec){var result=exec.call(R,S);if("object"!=typeof result)throw TypeError("RegExp exec method returned something other than an Object or null");return result}if("RegExp"!==classof(R))throw TypeError("RegExp#exec called on incompatible receiver");return regexpExec.call(R,S)}},function(module,exports,__webpack_require__){var Map=__webpack_require__(58)(__webpack_require__(24),"Map");module.exports=Map},function(module,exports,__webpack_require__){var baseGetTag=__webpack_require__(70),isObject=__webpack_require__(38);module.exports=function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return"[object Function]"==tag||"[object GeneratorFunction]"==tag||"[object AsyncFunction]"==tag||"[object Proxy]"==tag}},function(module,exports,__webpack_require__){var mapCacheClear=__webpack_require__(524),mapCacheDelete=__webpack_require__(531),mapCacheGet=__webpack_require__(533),mapCacheHas=__webpack_require__(534),mapCacheSet=__webpack_require__(535);function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,module.exports=MapCache},function(module,exports,__webpack_require__){var defineProperty=__webpack_require__(247);module.exports=function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}},function(module,exports){var objectProto=Object.prototype;module.exports=function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto)}},function(module,exports,__webpack_require__){(function(module){var root=__webpack_require__(24),stubFalse=__webpack_require__(547),freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,Buffer=freeModule&&freeModule.exports===freeExports?root.Buffer:void 0,isBuffer=(Buffer?Buffer.isBuffer:void 0)||stubFalse;module.exports=isBuffer}).call(this,__webpack_require__(54)(module))},function(module,exports,__webpack_require__){var baseIsTypedArray=__webpack_require__(549),baseUnary=__webpack_require__(550),nodeUtil=__webpack_require__(551),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isTypedArray},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"HooksContext",{enumerable:!0,get:function get(){return _addons.HooksContext}}),Object.defineProperty(exports,"applyHooks",{enumerable:!0,get:function get(){return _addons.applyHooks}}),Object.defineProperty(exports,"useMemo",{enumerable:!0,get:function get(){return _addons.useMemo}}),Object.defineProperty(exports,"useCallback",{enumerable:!0,get:function get(){return _addons.useCallback}}),Object.defineProperty(exports,"useRef",{enumerable:!0,get:function get(){return _addons.useRef}}),Object.defineProperty(exports,"useState",{enumerable:!0,get:function get(){return _addons.useState}}),Object.defineProperty(exports,"useReducer",{enumerable:!0,get:function get(){return _addons.useReducer}}),Object.defineProperty(exports,"useEffect",{enumerable:!0,get:function get(){return _addons.useEffect}}),Object.defineProperty(exports,"useChannel",{enumerable:!0,get:function get(){return _addons.useChannel}}),Object.defineProperty(exports,"useStoryContext",{enumerable:!0,get:function get(){return _addons.useStoryContext}}),Object.defineProperty(exports,"useParameter",{enumerable:!0,get:function get(){return _addons.useParameter}});var _addons=__webpack_require__(103)},function(module,exports,__webpack_require__){"use strict";var has=Object.prototype.hasOwnProperty,isArray=Array.isArray,hexTable=function(){for(var array=[],i=0;i<256;++i)array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase());return array}(),arrayToObject=function arrayToObject(source,options){for(var obj=options&&options.plainObjects?Object.create(null):{},i=0;i<source.length;++i)void 0!==source[i]&&(obj[i]=source[i]);return obj};module.exports={arrayToObject:arrayToObject,assign:function assignSingleSource(target,source){return Object.keys(source).reduce((function(acc,key){return acc[key]=source[key],acc}),target)},combine:function combine(a,b){return[].concat(a,b)},compact:function compact(value){for(var queue=[{obj:{o:value},prop:"o"}],refs=[],i=0;i<queue.length;++i)for(var item=queue[i],obj=item.obj[item.prop],keys=Object.keys(obj),j=0;j<keys.length;++j){var key=keys[j],val=obj[key];"object"==typeof val&&null!==val&&-1===refs.indexOf(val)&&(queue.push({obj:obj,prop:key}),refs.push(val))}return function compactQueue(queue){for(;queue.length>1;){var item=queue.pop(),obj=item.obj[item.prop];if(isArray(obj)){for(var compacted=[],j=0;j<obj.length;++j)void 0!==obj[j]&&compacted.push(obj[j]);item.obj[item.prop]=compacted}}}(queue),value},decode:function(str,decoder,charset){var strWithoutPlus=str.replace(/\+/g," ");if("iso-8859-1"===charset)return strWithoutPlus.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(strWithoutPlus)}catch(e){return strWithoutPlus}},encode:function encode(str,defaultEncoder,charset){if(0===str.length)return str;var string=str;if("symbol"==typeof str?string=Symbol.prototype.toString.call(str):"string"!=typeof str&&(string=String(str)),"iso-8859-1"===charset)return escape(string).replace(/%u[0-9a-f]{4}/gi,(function($0){return"%26%23"+parseInt($0.slice(2),16)+"%3B"}));for(var out="",i=0;i<string.length;++i){var c=string.charCodeAt(i);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122?out+=string.charAt(i):c<128?out+=hexTable[c]:c<2048?out+=hexTable[192|c>>6]+hexTable[128|63&c]:c<55296||c>=57344?out+=hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|63&c]:(i+=1,c=65536+((1023&c)<<10|1023&string.charCodeAt(i)),out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|63&c])}return out},isBuffer:function isBuffer(obj){return!(!obj||"object"!=typeof obj)&&!!(obj.constructor&&obj.constructor.isBuffer&&obj.constructor.isBuffer(obj))},isRegExp:function isRegExp(obj){return"[object RegExp]"===Object.prototype.toString.call(obj)},merge:function merge(target,source,options){if(!source)return target;if("object"!=typeof source){if(isArray(target))target.push(source);else{if(!target||"object"!=typeof target)return[target,source];(options&&(options.plainObjects||options.allowPrototypes)||!has.call(Object.prototype,source))&&(target[source]=!0)}return target}if(!target||"object"!=typeof target)return[target].concat(source);var mergeTarget=target;return isArray(target)&&!isArray(source)&&(mergeTarget=arrayToObject(target,options)),isArray(target)&&isArray(source)?(source.forEach((function(item,i){if(has.call(target,i)){var targetItem=target[i];targetItem&&"object"==typeof targetItem&&item&&"object"==typeof item?target[i]=merge(targetItem,item,options):target.push(item)}else target[i]=item})),target):Object.keys(source).reduce((function(acc,key){var value=source[key];return has.call(acc,key)?acc[key]=merge(acc[key],value,options):acc[key]=value,acc}),mergeTarget)}}},,function(module,exports,__webpack_require__){"use strict";(function(module){Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"storiesOf",{enumerable:!0,get:function get(){return _preview.storiesOf}}),Object.defineProperty(exports,"setAddon",{enumerable:!0,get:function get(){return _preview.setAddon}}),Object.defineProperty(exports,"addDecorator",{enumerable:!0,get:function get(){return _preview.addDecorator}}),Object.defineProperty(exports,"DecoratorFn",{enumerable:!0,get:function get(){return _preview.DecoratorFn}}),Object.defineProperty(exports,"addParameters",{enumerable:!0,get:function get(){return _preview.addParameters}}),Object.defineProperty(exports,"configure",{enumerable:!0,get:function get(){return _preview.configure}}),Object.defineProperty(exports,"getStorybook",{enumerable:!0,get:function get(){return _preview.getStorybook}}),Object.defineProperty(exports,"raw",{enumerable:!0,get:function get(){return _preview.raw}}),Object.defineProperty(exports,"forceReRender",{enumerable:!0,get:function get(){return _preview.forceReRender}});var _preview=__webpack_require__(479);module&&module.hot&&module.hot.decline&&module.hot.decline()}).call(this,__webpack_require__(54)(module))},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(646)},function(module,exports,__webpack_require__){"use strict";var reactIs=__webpack_require__(171),REACT_STATICS={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},KNOWN_STATICS={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},MEMO_STATICS={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},TYPE_STATICS={};function getStatics(component){return reactIs.isMemo(component)?MEMO_STATICS:TYPE_STATICS[component.$$typeof]||REACT_STATICS}TYPE_STATICS[reactIs.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},TYPE_STATICS[reactIs.Memo]=MEMO_STATICS;var defineProperty=Object.defineProperty,getOwnPropertyNames=Object.getOwnPropertyNames,getOwnPropertySymbols=Object.getOwnPropertySymbols,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,getPrototypeOf=Object.getPrototypeOf,objectPrototype=Object.prototype;module.exports=function hoistNonReactStatics(targetComponent,sourceComponent,blacklist){if("string"!=typeof sourceComponent){if(objectPrototype){var inheritedComponent=getPrototypeOf(sourceComponent);inheritedComponent&&inheritedComponent!==objectPrototype&&hoistNonReactStatics(targetComponent,inheritedComponent,blacklist)}var keys=getOwnPropertyNames(sourceComponent);getOwnPropertySymbols&&(keys=keys.concat(getOwnPropertySymbols(sourceComponent)));for(var targetStatics=getStatics(targetComponent),sourceStatics=getStatics(sourceComponent),i=0;i<keys.length;++i){var key=keys[i];if(!(KNOWN_STATICS[key]||blacklist&&blacklist[key]||sourceStatics&&sourceStatics[key]||targetStatics&&targetStatics[key])){var descriptor=getOwnPropertyDescriptor(sourceComponent,key);try{defineProperty(targetComponent,key,descriptor)}catch(e){}}}}return targetComponent}},function(module,exports,__webpack_require__){"use strict";var toStr=Object.prototype.toString;module.exports=function isArguments(value){var str=toStr.call(value),isArgs="[object Arguments]"===str;return isArgs||(isArgs="[object Array]"!==str&&null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&"[object Function]"===toStr.call(value.callee)),isArgs}},function(module,exports,__webpack_require__){"use strict";var functionsHaveNames=function functionsHaveNames(){return"string"==typeof function f(){}.name},gOPD=Object.getOwnPropertyDescriptor;if(gOPD)try{gOPD([],"length")}catch(e){gOPD=null}functionsHaveNames.functionsHaveConfigurableNames=function functionsHaveConfigurableNames(){return functionsHaveNames()&&gOPD&&!!gOPD((function(){}),"name").configurable};var $bind=Function.prototype.bind;functionsHaveNames.boundFunctionsHaveNames=function boundFunctionsHaveNames(){return functionsHaveNames()&&"function"==typeof $bind&&""!==function f(){}.bind().name},module.exports=functionsHaveNames},function(module,exports,__webpack_require__){"use strict";module.exports=function hasSymbols(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var obj={},sym=Symbol("test"),symObj=Object(sym);if("string"==typeof sym)return!1;if("[object Symbol]"!==Object.prototype.toString.call(sym))return!1;if("[object Symbol]"!==Object.prototype.toString.call(symObj))return!1;for(sym in obj[sym]=42,obj)return!1;if("function"==typeof Object.keys&&0!==Object.keys(obj).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(obj).length)return!1;var syms=Object.getOwnPropertySymbols(obj);if(1!==syms.length||syms[0]!==sym)return!1;if(!Object.prototype.propertyIsEnumerable.call(obj,sym))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var descriptor=Object.getOwnPropertyDescriptor(obj,sym);if(42!==descriptor.value||!0!==descriptor.enumerable)return!1}return!0}},function(module,exports,__webpack_require__){"use strict";var ES5ToInteger=__webpack_require__(177),ToNumber=__webpack_require__(323);module.exports=function ToInteger(value){var number=ToNumber(value);return ES5ToInteger(number)}},function(module,exports,__webpack_require__){"use strict";var $Math=__webpack_require__(1)("%Math%"),ToNumber=__webpack_require__(321),$isNaN=__webpack_require__(73),$isFinite=__webpack_require__(121),$sign=__webpack_require__(322),$floor=$Math.floor,$abs=$Math.abs;module.exports=function ToInteger(value){var number=ToNumber(value);return $isNaN(number)?0:0!==number&&$isFinite(number)?$sign(number)*$floor($abs(number)):number}},function(module,exports,__webpack_require__){"use strict";var $test=__webpack_require__(1)("RegExp.prototype.test"),callBind=__webpack_require__(120);module.exports=function regexTester(regex){return callBind($test,regex)}},function(module,exports,__webpack_require__){"use strict";var hasSymbols="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,isPrimitive=__webpack_require__(325),isCallable=__webpack_require__(119),isDate=__webpack_require__(326),isSymbol=__webpack_require__(180),ordinaryToPrimitive=function OrdinaryToPrimitive(O,hint){if(null==O)throw new TypeError("Cannot call method on "+O);if("string"!=typeof hint||"number"!==hint&&"string"!==hint)throw new TypeError('hint must be "string" or "number"');var method,result,i,methodNames="string"===hint?["toString","valueOf"]:["valueOf","toString"];for(i=0;i<methodNames.length;++i)if(method=O[methodNames[i]],isCallable(method)&&(result=method.call(O),isPrimitive(result)))return result;throw new TypeError("No default value")},GetMethod=function GetMethod(O,P){var func=O[P];if(null!=func){if(!isCallable(func))throw new TypeError(func+" returned for property "+P+" of object "+O+" is not a function");return func}};module.exports=function ToPrimitive(input){if(isPrimitive(input))return input;var exoticToPrim,hint="default";if(arguments.length>1&&(arguments[1]===String?hint="string":arguments[1]===Number&&(hint="number")),hasSymbols&&(Symbol.toPrimitive?exoticToPrim=GetMethod(input,Symbol.toPrimitive):isSymbol(input)&&(exoticToPrim=Symbol.prototype.valueOf)),void 0!==exoticToPrim){var result=exoticToPrim.call(input,hint);if(isPrimitive(result))return result;throw new TypeError("unable to convert exotic object to primitive")}return"default"===hint&&(isDate(input)||isSymbol(input))&&(hint="string"),ordinaryToPrimitive(input,"default"===hint?"number":hint)}},function(module,exports,__webpack_require__){"use strict";var toStr=Object.prototype.toString;if(__webpack_require__(26)()){var symToStr=Symbol.prototype.toString,symStringRegex=/^Symbol\(.*\)$/;module.exports=function isSymbol(value){if("symbol"==typeof value)return!0;if("[object Symbol]"!==toStr.call(value))return!1;try{return function isRealSymbolObject(value){return"symbol"==typeof value.valueOf()&&symStringRegex.test(symToStr.call(value))}(value)}catch(e){return!1}}}else module.exports=function isSymbol(value){return!1}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%");module.exports=function CheckObjectCoercible(value,optMessage){if(null==value)throw new $TypeError(optMessage||"Cannot call method on "+value);return value}},function(module,exports,__webpack_require__){"use strict";var ES5ToInteger=__webpack_require__(177),ToNumber=__webpack_require__(183);module.exports=function ToInteger(value){var number=ToNumber(value);return ES5ToInteger(number)}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$TypeError=GetIntrinsic("%TypeError%"),$Number=GetIntrinsic("%Number%"),$RegExp=GetIntrinsic("%RegExp%"),$parseInteger=GetIntrinsic("%parseInt%"),callBound=__webpack_require__(6),regexTester=__webpack_require__(178),isPrimitive=__webpack_require__(122),$strSlice=callBound("String.prototype.slice"),isBinary=regexTester(/^0b[01]+$/i),isOctal=regexTester(/^0o[0-7]+$/i),isInvalidHexLiteral=regexTester(/^[-+]0x[0-9a-f]+$/i),hasNonWS=regexTester(new $RegExp("["+["
","",""].join("")+"]","g")),ws=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),trimRegex=new RegExp("(^["+ws+"]+)|(["+ws+"]+$)","g"),$replace=callBound("String.prototype.replace"),ToPrimitive=__webpack_require__(184);module.exports=function ToNumber(argument){var value=isPrimitive(argument)?argument:ToPrimitive(argument,$Number);if("symbol"==typeof value)throw new $TypeError("Cannot convert a Symbol value to a number");if("string"==typeof value){if(isBinary(value))return ToNumber($parseInteger($strSlice(value,2),2));if(isOctal(value))return ToNumber($parseInteger($strSlice(value,2),8));if(hasNonWS(value)||isInvalidHexLiteral(value))return NaN;var trimmed=function(value){return $replace(value,trimRegex,"")}(value);if(trimmed!==value)return ToNumber(trimmed)}return $Number(value)}},function(module,exports,__webpack_require__){"use strict";var toPrimitive=__webpack_require__(179);module.exports=function ToPrimitive(input){return arguments.length>1?toPrimitive(input,arguments[1]):toPrimitive(input)}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),DefineOwnProperty=__webpack_require__(347),FromPropertyDescriptor=__webpack_require__(348),OrdinaryGetOwnProperty=__webpack_require__(349),IsDataDescriptor=__webpack_require__(352),IsExtensible=__webpack_require__(353),IsPropertyKey=__webpack_require__(33),SameValue=__webpack_require__(354),Type=__webpack_require__(4);module.exports=function CreateDataProperty(O,P,V){if("Object"!==Type(O))throw new $TypeError("Assertion failed: Type(O) is not Object");if(!IsPropertyKey(P))throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true");var oldDesc=OrdinaryGetOwnProperty(O,P),extensible=oldDesc||IsExtensible(O);return!(oldDesc&&(!oldDesc.writable||!oldDesc.configurable)||!extensible)&&DefineOwnProperty(IsDataDescriptor,SameValue,FromPropertyDescriptor,O,P,{"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Value]]":V,"[[Writable]]":!0})}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$TypeError=GetIntrinsic("%TypeError%"),$SyntaxError=GetIntrinsic("%SyntaxError%"),has=__webpack_require__(39),predicates={"Property Descriptor":function isPropertyDescriptor(Type,Desc){if("Object"!==Type(Desc))return!1;var allowed={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var key in Desc)if(has(Desc,key)&&!allowed[key])return!1;var isData=has(Desc,"[[Value]]"),IsAccessor=has(Desc,"[[Get]]")||has(Desc,"[[Set]]");if(isData&&IsAccessor)throw new $TypeError("Property Descriptors may not be both accessor and data descriptors");return!0}};module.exports=function assertRecord(Type,recordType,argumentName,value){var predicate=predicates[recordType];if("function"!=typeof predicate)throw new $SyntaxError("unknown record type: "+recordType);if(!predicate(Type,value))throw new $TypeError(argumentName+" must be a "+recordType)}},function(module,exports,__webpack_require__){"use strict";module.exports=function Type(x){return null===x?"Null":void 0===x?"Undefined":"function"==typeof x||"object"==typeof x?"Object":"number"==typeof x?"Number":"boolean"==typeof x?"Boolean":"string"==typeof x?"String":void 0}},function(module,exports,__webpack_require__){"use strict";var $match=__webpack_require__(1)("%Symbol.match%",!0),hasRegExpMatcher=__webpack_require__(189),ToBoolean=__webpack_require__(124);module.exports=function IsRegExp(argument){if(!argument||"object"!=typeof argument)return!1;if($match){var isRegExp=argument[$match];if(void 0!==isRegExp)return ToBoolean(isRegExp)}return hasRegExpMatcher(argument)}},function(module,exports,__webpack_require__){"use strict";var has=__webpack_require__(39),regexExec=RegExp.prototype.exec,gOPD=Object.getOwnPropertyDescriptor,toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isRegex(value){if(!value||"object"!=typeof value)return!1;if(!hasToStringTag)return"[object RegExp]"===toStr.call(value);var descriptor=gOPD(value,"lastIndex");return!(!descriptor||!has(descriptor,"value"))&&function tryRegexExec(value){try{var lastIndex=value.lastIndex;return value.lastIndex=0,regexExec.call(value),!0}catch(e){return!1}finally{value.lastIndex=lastIndex}}(value)}},function(module,exports,__webpack_require__){"use strict";var ES5Type=__webpack_require__(187);module.exports=function Type(x){return"symbol"==typeof x?"Symbol":ES5Type(x)}},function(module,exports,__webpack_require__){"use strict";module.exports=function IsConstructor(argument){return"function"==typeof argument&&!!argument.prototype}},function(module,exports,__webpack_require__){"use strict";var $Math=__webpack_require__(1)("%Math%"),$floor=$Math.floor,$abs=$Math.abs,$isNaN=__webpack_require__(73),$isFinite=__webpack_require__(121);module.exports=function IsInteger(argument){if("number"!=typeof argument||$isNaN(argument)||!$isFinite(argument))return!1;var abs=$abs(argument);return $floor(abs)===abs}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),MAX_SAFE_INTEGER=__webpack_require__(92),Call=__webpack_require__(41),CreateDataPropertyOrThrow=__webpack_require__(127),Get=__webpack_require__(18),HasProperty=__webpack_require__(194),IsArray=__webpack_require__(74),ToLength=__webpack_require__(51),ToString=__webpack_require__(40);module.exports=function FlattenIntoArray(target,source,sourceLen,start,depth){var mapperFunction;arguments.length>5&&(mapperFunction=arguments[5]);for(var targetIndex=start,sourceIndex=0;sourceIndex<sourceLen;){var P=ToString(sourceIndex),exists=HasProperty(source,P);if(!0===exists){var element=Get(source,P);if(void 0!==mapperFunction){if(arguments.length<=6)throw new $TypeError("Assertion failed: thisArg is required when mapperFunction is provided");element=Call(mapperFunction,arguments[6],[element,sourceIndex,source])}var shouldFlatten=!1;if(depth>0&&(shouldFlatten=IsArray(element)),shouldFlatten){var elementLen=ToLength(Get(element,"length"));targetIndex=FlattenIntoArray(target,element,elementLen,targetIndex,depth-1)}else{if(targetIndex>=MAX_SAFE_INTEGER)throw new $TypeError("index too large");CreateDataPropertyOrThrow(target,ToString(targetIndex),element),targetIndex+=1}}sourceIndex+=1}return targetIndex}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),IsPropertyKey=__webpack_require__(33),Type=__webpack_require__(4);module.exports=function HasProperty(O,P){if("Object"!==Type(O))throw new $TypeError("Assertion failed: `O` must be an Object");if(!IsPropertyKey(P))throw new $TypeError("Assertion failed: `P` must be a Property Key");return P in O}},function(module,exports,__webpack_require__){"use strict";var getInferredName;try{getInferredName=Function("s","return { [s]() {} }[s].name;")}catch(e){}module.exports=getInferredName&&"inferred"===function(){}.name?getInferredName:null},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),IsInteger=__webpack_require__(192),Type=__webpack_require__(4),MAX_SAFE_INTEGER=__webpack_require__(92),$TypeError=GetIntrinsic("%TypeError%"),$charCodeAt=__webpack_require__(6)("String.prototype.charCodeAt");module.exports=function AdvanceStringIndex(S,index,unicode){if("String"!==Type(S))throw new $TypeError("Assertion failed: `S` must be a String");if(!IsInteger(index)||index<0||index>MAX_SAFE_INTEGER)throw new $TypeError("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==Type(unicode))throw new $TypeError("Assertion failed: `unicode` must be a Boolean");if(!unicode)return index+1;if(index+1>=S.length)return index+1;var first=$charCodeAt(S,index);if(first<55296||first>56319)return index+1;var second=$charCodeAt(S,index+1);return second<56320||second>57343?index+1:index+2}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),IsPropertyKey=__webpack_require__(33),ToObject=__webpack_require__(75);module.exports=function GetV(V,P){if(!IsPropertyKey(P))throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true");return ToObject(V)[P]}},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),callBind=__webpack_require__(120),implementation=__webpack_require__(199),getPolyfill=__webpack_require__(200),shim=__webpack_require__(397),flagsBound=callBind(implementation);define(flagsBound,{getPolyfill:getPolyfill,implementation:implementation,shim:shim}),module.exports=flagsBound},function(module,exports,__webpack_require__){"use strict";var $Object=Object,$TypeError=TypeError;module.exports=function flags(){if(null!=this&&this!==$Object(this))throw new $TypeError("RegExp.prototype.flags getter called on non-object");var result="";return this.global&&(result+="g"),this.ignoreCase&&(result+="i"),this.multiline&&(result+="m"),this.dotAll&&(result+="s"),this.unicode&&(result+="u"),this.sticky&&(result+="y"),result}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(199),supportsDescriptors=__webpack_require__(9).supportsDescriptors,$gOPD=Object.getOwnPropertyDescriptor,$TypeError=TypeError;module.exports=function getPolyfill(){if(!supportsDescriptors)throw new $TypeError("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var descriptor=$gOPD(RegExp.prototype,"flags");if(descriptor&&"function"==typeof descriptor.get&&"boolean"==typeof/a/.dotAll)return descriptor.get}return implementation}},function(module,exports,__webpack_require__){"use strict";var hasSymbols=__webpack_require__(26)(),regexpMatchAll=__webpack_require__(398);module.exports=function getRegExpMatchAllPolyfill(){return hasSymbols&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:regexpMatchAll}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),IsPropertyKey=__webpack_require__(33),Type=__webpack_require__(4);module.exports=function Set(O,P,V,Throw){if("Object"!==Type(O))throw new $TypeError("Assertion failed: `O` must be an Object");if(!IsPropertyKey(P))throw new $TypeError("Assertion failed: `P` must be a Property Key");if("Boolean"!==Type(Throw))throw new $TypeError("Assertion failed: `Throw` must be a Boolean");if(Throw)return O[P]=V,!0;try{O[P]=V}catch(e){return!1}}},function(module,exports,__webpack_require__){"use strict";var ArraySpeciesCreate=__webpack_require__(126),Call=__webpack_require__(41),CreateDataPropertyOrThrow=__webpack_require__(127),Get=__webpack_require__(18),HasProperty=__webpack_require__(194),IsCallable=__webpack_require__(25),ToUint32=__webpack_require__(423),ToObject=__webpack_require__(75),ToString=__webpack_require__(40),callBound=__webpack_require__(6),isString=__webpack_require__(123),boxedString=Object("a"),splitString="a"!==boxedString[0]||!(0 in boxedString),strSplit=callBound("String.prototype.split");module.exports=function map(callbackfn){var T,O=ToObject(this),self=splitString&&isString(O)?strSplit(O,""):O,len=ToUint32(self.length);if(!IsCallable(callbackfn))throw new TypeError("Array.prototype.map callback must be a function");arguments.length>1&&(T=arguments[1]);for(var A=ArraySpeciesCreate(O,len),k=0;k<len;){var Pk=ToString(k),kPresent=HasProperty(O,Pk);if(kPresent){var kValue=Get(O,Pk),mappedValue=Call(callbackfn,T,[kValue,k,O]);CreateDataPropertyOrThrow(A,Pk,mappedValue)}k+=1}return A}},function(module,exports,__webpack_require__){"use strict";var arrayMethodBoxesProperly=__webpack_require__(424),implementation=__webpack_require__(203);module.exports=function getPolyfill(){var method=Array.prototype.map;return arrayMethodBoxesProperly(method)?method:implementation}},function(module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(13),fails=__webpack_require__(5),createElement=__webpack_require__(130);module.exports=!DESCRIPTORS&&!fails((function(){return 7!=Object.defineProperty(createElement("div"),"a",{get:function(){return 7}}).a}))},function(module,exports,__webpack_require__){var global=__webpack_require__(3),setGlobal=__webpack_require__(131),store=global["__core-js_shared__"]||setGlobal("__core-js_shared__",{});module.exports=store},function(module,exports,__webpack_require__){var global=__webpack_require__(3),inspectSource=__webpack_require__(132),WeakMap=global.WeakMap;module.exports="function"==typeof WeakMap&&/native code/.test(inspectSource(WeakMap))},function(module,exports,__webpack_require__){var has=__webpack_require__(14),ownKeys=__webpack_require__(428),getOwnPropertyDescriptorModule=__webpack_require__(76),definePropertyModule=__webpack_require__(16);module.exports=function(target,source){for(var keys=ownKeys(source),defineProperty=definePropertyModule.f,getOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f,i=0;i<keys.length;i++){var key=keys[i];has(target,key)||defineProperty(target,key,getOwnPropertyDescriptor(source,key))}}},function(module,exports,__webpack_require__){var has=__webpack_require__(14),toIndexedObject=__webpack_require__(42),indexOf=__webpack_require__(135).indexOf,hiddenKeys=__webpack_require__(80);module.exports=function(object,names){var key,O=toIndexedObject(object),i=0,result=[];for(key in O)!has(hiddenKeys,key)&&has(O,key)&&result.push(key);for(;names.length>i;)has(O,key=names[i++])&&(~indexOf(result,key)||result.push(key));return result}},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(99),max=Math.max,min=Math.min;module.exports=function(index,length){var integer=toInteger(index);return integer<0?max(integer+length,0):min(integer,length)}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8),isArray=__webpack_require__(81),SPECIES=__webpack_require__(7)("species");module.exports=function(originalArray,length){var C;return isArray(originalArray)&&("function"!=typeof(C=originalArray.constructor)||C!==Array&&!isArray(C.prototype)?isObject(C)&&null===(C=C[SPECIES])&&(C=void 0):C=void 0),new(void 0===C?Array:C)(0===length?0:length)}},function(module,exports,__webpack_require__){var NATIVE_SYMBOL=__webpack_require__(139);module.exports=NATIVE_SYMBOL&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(module,exports,__webpack_require__){var TO_STRING_TAG_SUPPORT=__webpack_require__(142),classofRaw=__webpack_require__(34),TO_STRING_TAG=__webpack_require__(7)("toStringTag"),CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}());module.exports=TO_STRING_TAG_SUPPORT?classofRaw:function(it){var O,tag,result;return void 0===it?"Undefined":null===it?"Null":"string"==typeof(tag=function(it,key){try{return it[key]}catch(error){}}(O=Object(it),TO_STRING_TAG))?tag:CORRECT_ARGUMENTS?classofRaw(O):"Object"==(result=classofRaw(O))&&"function"==typeof O.callee?"Arguments":result}},function(module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(13),definePropertyModule=__webpack_require__(16),anObject=__webpack_require__(15),objectKeys=__webpack_require__(82);module.exports=DESCRIPTORS?Object.defineProperties:function defineProperties(O,Properties){anObject(O);for(var key,keys=objectKeys(Properties),length=keys.length,index=0;length>index;)definePropertyModule.f(O,key=keys[index++],Properties[key]);return O}},function(module,exports,__webpack_require__){var getBuiltIn=__webpack_require__(60);module.exports=getBuiltIn("document","documentElement")},function(module,exports,__webpack_require__){var wellKnownSymbol=__webpack_require__(7);exports.f=wellKnownSymbol},function(module,exports,__webpack_require__){"use strict";var IteratorPrototype,PrototypeOfArrayIteratorPrototype,arrayIterator,getPrototypeOf=__webpack_require__(145),createNonEnumerableProperty=__webpack_require__(28),has=__webpack_require__(14),wellKnownSymbol=__webpack_require__(7),IS_PURE=__webpack_require__(79),ITERATOR=wellKnownSymbol("iterator"),BUGGY_SAFARI_ITERATORS=!1;[].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf(getPrototypeOf(arrayIterator)))!==Object.prototype&&(IteratorPrototype=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS=!0),null==IteratorPrototype&&(IteratorPrototype={}),IS_PURE||has(IteratorPrototype,ITERATOR)||createNonEnumerableProperty(IteratorPrototype,ITERATOR,(function(){return this})),module.exports={IteratorPrototype:IteratorPrototype,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS}},function(module,exports,__webpack_require__){var fails=__webpack_require__(5);module.exports=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},function(module,exports){module.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(module,exports,__webpack_require__){"use strict";__webpack_require__(48),__webpack_require__(63),__webpack_require__(23),__webpack_require__(148),__webpack_require__(104),__webpack_require__(49),Object.defineProperty(exports,"__esModule",{value:!0}),exports.addons=exports.AddonStore=void 0;var _global=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(36)),_clientLogger=__webpack_require__(64),_types=__webpack_require__(229);var AddonStore=function AddonStore(){var _this=this;!function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AddonStore),this.loaders={},this.elements={},this.config={},this.channel=void 0,this.promise=void 0,this.resolve=void 0,this.getChannel=function(){if(!_this.channel)throw new Error("Accessing non-existent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel");return _this.channel},this.ready=function(){return _this.promise},this.hasChannel=function(){return!!_this.channel},this.setChannel=function(channel){_this.channel=channel,_this.resolve()},this.getElements=function(type){return _this.elements[type]||(_this.elements[type]={}),_this.elements[type]},this.addPanel=function(name,options){_this.add(name,Object.assign({type:_types.types.PANEL},options))},this.add=function(name,addon){var type=addon.type;_this.getElements(type)[name]=Object.assign({id:name},addon)},this.setConfig=function(value){Object.assign(_this.config,value)},this.getConfig=function(){return _this.config},this.register=function(name,registerCallback){_this.loaders[name]&&_clientLogger.logger.warn("".concat(name," was loaded twice, this could have bad side-effects")),_this.loaders[name]=registerCallback},this.loadAddons=function(api){Object.values(_this.loaders).forEach((function(value){return value(api)}))},this.promise=new Promise((function(res){_this.resolve=function(){return res(_this.getChannel())}}))};exports.AddonStore=AddonStore;var KEY="__STORYBOOK_ADDONS";var addons=function getAddonsStore(){return _global.default[KEY]||(_global.default[KEY]=new AddonStore),_global.default[KEY]}();exports.addons=addons},function(module,exports,__webpack_require__){"use strict";var $forEach=__webpack_require__(45).forEach,arrayMethodIsStrict=__webpack_require__(62),arrayMethodUsesToLength=__webpack_require__(31),STRICT_METHOD=arrayMethodIsStrict("forEach"),USES_TO_LENGTH=arrayMethodUsesToLength("forEach");module.exports=STRICT_METHOD&&USES_TO_LENGTH?[].forEach:function forEach(callbackfn){return $forEach(this,callbackfn,arguments.length>1?arguments[1]:void 0)}},function(module,exports,__webpack_require__){var DESCRIPTORS=__webpack_require__(13),objectKeys=__webpack_require__(82),toIndexedObject=__webpack_require__(42),propertyIsEnumerable=__webpack_require__(94).f,createMethod=function(TO_ENTRIES){return function(it){for(var key,O=toIndexedObject(it),keys=objectKeys(O),length=keys.length,i=0,result=[];length>i;)key=keys[i++],DESCRIPTORS&&!propertyIsEnumerable.call(O,key)||result.push(TO_ENTRIES?[key,O[key]]:O[key]);return result}};module.exports={entries:createMethod(!0),values:createMethod(!1)}},function(module,exports,__webpack_require__){"use strict";var getBuiltIn=__webpack_require__(60),definePropertyModule=__webpack_require__(16),wellKnownSymbol=__webpack_require__(7),DESCRIPTORS=__webpack_require__(13),SPECIES=wellKnownSymbol("species");module.exports=function(CONSTRUCTOR_NAME){var Constructor=getBuiltIn(CONSTRUCTOR_NAME),defineProperty=definePropertyModule.f;DESCRIPTORS&&Constructor&&!Constructor[SPECIES]&&defineProperty(Constructor,SPECIES,{configurable:!0,get:function(){return this}})}},function(module,exports,__webpack_require__){var wellKnownSymbol=__webpack_require__(7),Iterators=__webpack_require__(84),ITERATOR=wellKnownSymbol("iterator"),ArrayPrototype=Array.prototype;module.exports=function(it){return void 0!==it&&(Iterators.Array===it||ArrayPrototype[ITERATOR]===it)}},function(module,exports,__webpack_require__){var classof=__webpack_require__(213),Iterators=__webpack_require__(84),ITERATOR=__webpack_require__(7)("iterator");module.exports=function(it){if(null!=it)return it[ITERATOR]||it["@@iterator"]||Iterators[classof(it)]}},function(module,exports,__webpack_require__){var anObject=__webpack_require__(15);module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){var returnMethod=iterator.return;throw void 0!==returnMethod&&anObject(returnMethod.call(iterator)),error}}},function(module,exports,__webpack_require__){var userAgent=__webpack_require__(141);module.exports=/(iphone|ipod|ipad).*applewebkit/i.test(userAgent)},function(module,exports,__webpack_require__){"use strict";var aFunction=__webpack_require__(53),PromiseCapability=function(C){var resolve,reject;this.promise=new C((function($$resolve,$$reject){if(void 0!==resolve||void 0!==reject)throw TypeError("Bad Promise constructor");resolve=$$resolve,reject=$$reject})),this.resolve=aFunction(resolve),this.reject=aFunction(reject)};module.exports.f=function(C){return new PromiseCapability(C)}},function(module,exports,__webpack_require__){"use strict";var types;__webpack_require__(151),__webpack_require__(148),Object.defineProperty(exports,"__esModule",{value:!0}),exports.isSupportedType=function isSupportedType(type){return!!Object.values(types).find((function(typeVal){return typeVal===type}))},exports.types=void 0,exports.types=types,function(types){types.TAB="tab",types.PANEL="panel",types.TOOL="tool",types.PREVIEW="preview",types.NOTES_ELEMENT="notes-element"}(types||(exports.types=types={}))},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}}(arr)||function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||"[object Arguments]"===Object.prototype.toString.call(iter))return Array.from(iter)}(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}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||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}__webpack_require__(29),__webpack_require__(46),__webpack_require__(47),__webpack_require__(152),__webpack_require__(48),__webpack_require__(86),__webpack_require__(65),__webpack_require__(30),__webpack_require__(231),__webpack_require__(66),__webpack_require__(67),__webpack_require__(55),__webpack_require__(23),__webpack_require__(68),__webpack_require__(50),__webpack_require__(49),__webpack_require__(37),__webpack_require__(467),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Channel=void 0;var generateRandomId=function generateRandomId(){return Math.random().toString(16).slice(2)},Channel=function(){function Channel(){var _this=this,_ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},transport=_ref.transport,_ref$async=_ref.async,async=void 0!==_ref$async&&_ref$async;_classCallCheck(this,Channel),this.isAsync=void 0,this.sender=generateRandomId(),this.events={},this.transport=void 0,this.isAsync=async,transport&&(this.transport=transport,this.transport.setHandler((function(event){return _this.handleEvent(event)})))}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(Channel,[{key:"addListener",value:function addListener(eventName,listener){this.events[eventName]=this.events[eventName]||[],this.events[eventName].push(listener)}},{key:"addPeerListener",value:function addPeerListener(eventName,listener){var peerListener=listener;peerListener.ignorePeer=!0,this.addListener(eventName,peerListener)}},{key:"emit",value:function emit(eventName){for(var _this2=this,_len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var event={type:eventName,args:args,from:this.sender},options={};args.length>=1&&args[0]&&args[0].options&&(options=args[0].options);var handler=function handler(){_this2.transport&&_this2.transport.send(event,options),_this2.handleEvent(event,!0)};this.isAsync?setImmediate(handler):handler()}},{key:"eventNames",value:function eventNames(){return Object.keys(this.events)}},{key:"listenerCount",value:function listenerCount(eventName){var listeners=this.listeners(eventName);return listeners?listeners.length:0}},{key:"listeners",value:function listeners(eventName){var listeners=this.events[eventName];return listeners||void 0}},{key:"once",value:function once(eventName,listener){var onceListener=this.onceListener(eventName,listener);this.addListener(eventName,onceListener)}},{key:"removeAllListeners",value:function removeAllListeners(eventName){eventName?this.events[eventName]&&delete this.events[eventName]:this.events={}}},{key:"removeListener",value:function removeListener(eventName,listener){var listeners=this.listeners(eventName);listeners&&(this.events[eventName]=listeners.filter((function(l){return l!==listener})))}},{key:"on",value:function on(eventName,listener){this.addListener(eventName,listener)}},{key:"off",value:function off(eventName,listener){this.removeListener(eventName,listener)}},{key:"handleEvent",value:function handleEvent(event){var isPeer=arguments.length>1&&void 0!==arguments[1]&&arguments[1],listeners=this.listeners(event.type);listeners&&(isPeer||event.from!==this.sender)&&listeners.forEach((function(fn){return!(isPeer&&fn.ignorePeer)&&fn.apply(void 0,_toConsumableArray(event.args))}))}},{key:"onceListener",value:function onceListener(eventName,listener){var _this3=this,onceListener=function onceListener(){return _this3.removeListener(eventName,onceListener),listener.apply(void 0,arguments)};return onceListener}},{key:"hasTransport",get:function get(){return!!this.transport}}]),Channel}();exports.Channel=Channel;var _default=Channel;exports.default=_default}).call(this,__webpack_require__(464).setImmediate)},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),isObject=__webpack_require__(8),isArray=__webpack_require__(81),toAbsoluteIndex=__webpack_require__(210),toLength=__webpack_require__(35),toIndexedObject=__webpack_require__(42),createProperty=__webpack_require__(138),wellKnownSymbol=__webpack_require__(7),arrayMethodHasSpeciesSupport=__webpack_require__(101),arrayMethodUsesToLength=__webpack_require__(31),HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("slice"),USES_TO_LENGTH=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),SPECIES=wellKnownSymbol("species"),nativeSlice=[].slice,max=Math.max;$({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH},{slice:function slice(start,end){var Constructor,result,n,O=toIndexedObject(this),length=toLength(O.length),k=toAbsoluteIndex(start,length),fin=toAbsoluteIndex(void 0===end?length:end,length);if(isArray(O)&&("function"!=typeof(Constructor=O.constructor)||Constructor!==Array&&!isArray(Constructor.prototype)?isObject(Constructor)&&null===(Constructor=Constructor[SPECIES])&&(Constructor=void 0):Constructor=void 0,Constructor===Array||void 0===Constructor))return nativeSlice.call(O,k,fin);for(result=new(void 0===Constructor?Array:Constructor)(max(fin-k,0)),n=0;k<fin;k++,n++)k in O&&createProperty(result,n,O[k]);return result.length=n,result}})},function(module,exports,__webpack_require__){"use strict";var anObject=__webpack_require__(15);module.exports=function(){var that=anObject(this),result="";return that.global&&(result+="g"),that.ignoreCase&&(result+="i"),that.multiline&&(result+="m"),that.dotAll&&(result+="s"),that.unicode&&(result+="u"),that.sticky&&(result+="y"),result}},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(99),requireObjectCoercible=__webpack_require__(43),createMethod=function(CONVERT_TO_STRING){return function($this,pos){var first,second,S=String(requireObjectCoercible($this)),position=toInteger(pos),size=S.length;return position<0||position>=size?CONVERT_TO_STRING?"":void 0:(first=S.charCodeAt(position))<55296||first>56319||position+1===size||(second=S.charCodeAt(position+1))<56320||second>57343?CONVERT_TO_STRING?S.charAt(position):first:CONVERT_TO_STRING?S.slice(position,position+2):second-56320+(first-55296<<10)+65536}};module.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),$every=__webpack_require__(45).every,arrayMethodIsStrict=__webpack_require__(62),arrayMethodUsesToLength=__webpack_require__(31),STRICT_METHOD=arrayMethodIsStrict("every"),USES_TO_LENGTH=arrayMethodUsesToLength("every");$({target:"Array",proto:!0,forced:!STRICT_METHOD||!USES_TO_LENGTH},{every:function every(callbackfn){return $every(this,callbackfn,arguments.length>1?arguments[1]:void 0)}})},function(module,exports,__webpack_require__){__webpack_require__(2)({target:"Function",proto:!0},{bind:__webpack_require__(470)})},function(module,exports,__webpack_require__){var fails=__webpack_require__(5);module.exports=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8),setPrototypeOf=__webpack_require__(146);module.exports=function($this,dummy,Wrapper){var NewTarget,NewTargetPrototype;return setPrototypeOf&&"function"==typeof(NewTarget=dummy.constructor)&&NewTarget!==Wrapper&&isObject(NewTargetPrototype=NewTarget.prototype)&&NewTargetPrototype!==Wrapper.prototype&&setPrototypeOf($this,NewTargetPrototype),$this}},function(module,exports,__webpack_require__){"use strict";var defineProperty=__webpack_require__(16).f,create=__webpack_require__(61),redefineAll=__webpack_require__(105),bind=__webpack_require__(83),anInstance=__webpack_require__(106),iterate=__webpack_require__(107),defineIterator=__webpack_require__(144),setSpecies=__webpack_require__(223),DESCRIPTORS=__webpack_require__(13),fastKey=__webpack_require__(87).fastKey,InternalStateModule=__webpack_require__(44),setInternalState=InternalStateModule.set,internalStateGetterFor=InternalStateModule.getterFor;module.exports={getConstructor:function(wrapper,CONSTRUCTOR_NAME,IS_MAP,ADDER){var C=wrapper((function(that,iterable){anInstance(that,C,CONSTRUCTOR_NAME),setInternalState(that,{type:CONSTRUCTOR_NAME,index:create(null),first:void 0,last:void 0,size:0}),DESCRIPTORS||(that.size=0),null!=iterable&&iterate(iterable,that[ADDER],that,IS_MAP)})),getInternalState=internalStateGetterFor(CONSTRUCTOR_NAME),define=function(that,key,value){var previous,index,state=getInternalState(that),entry=getEntry(that,key);return entry?entry.value=value:(state.last=entry={index:index=fastKey(key,!0),key:key,value:value,previous:previous=state.last,next:void 0,removed:!1},state.first||(state.first=entry),previous&&(previous.next=entry),DESCRIPTORS?state.size++:that.size++,"F"!==index&&(state.index[index]=entry)),that},getEntry=function(that,key){var entry,state=getInternalState(that),index=fastKey(key);if("F"!==index)return state.index[index];for(entry=state.first;entry;entry=entry.next)if(entry.key==key)return entry};return redefineAll(C.prototype,{clear:function clear(){for(var state=getInternalState(this),data=state.index,entry=state.first;entry;)entry.removed=!0,entry.previous&&(entry.previous=entry.previous.next=void 0),delete data[entry.index],entry=entry.next;state.first=state.last=void 0,DESCRIPTORS?state.size=0:this.size=0},delete:function(key){var state=getInternalState(this),entry=getEntry(this,key);if(entry){var next=entry.next,prev=entry.previous;delete state.index[entry.index],entry.removed=!0,prev&&(prev.next=next),next&&(next.previous=prev),state.first==entry&&(state.first=next),state.last==entry&&(state.last=prev),DESCRIPTORS?state.size--:this.size--}return!!entry},forEach:function forEach(callbackfn){for(var entry,state=getInternalState(this),boundFunction=bind(callbackfn,arguments.length>1?arguments[1]:void 0,3);entry=entry?entry.next:state.first;)for(boundFunction(entry.value,entry.key,this);entry&&entry.removed;)entry=entry.previous},has:function has(key){return!!getEntry(this,key)}}),redefineAll(C.prototype,IS_MAP?{get:function get(key){var entry=getEntry(this,key);return entry&&entry.value},set:function set(key,value){return define(this,0===key?0:key,value)}}:{add:function add(value){return define(this,value=0===value?0:value,value)}}),DESCRIPTORS&&defineProperty(C.prototype,"size",{get:function(){return getInternalState(this).size}}),C},setStrong:function(C,CONSTRUCTOR_NAME,IS_MAP){var ITERATOR_NAME=CONSTRUCTOR_NAME+" Iterator",getInternalCollectionState=internalStateGetterFor(CONSTRUCTOR_NAME),getInternalIteratorState=internalStateGetterFor(ITERATOR_NAME);defineIterator(C,CONSTRUCTOR_NAME,(function(iterated,kind){setInternalState(this,{type:ITERATOR_NAME,target:iterated,state:getInternalCollectionState(iterated),kind:kind,last:void 0})}),(function(){for(var state=getInternalIteratorState(this),kind=state.kind,entry=state.last;entry&&entry.removed;)entry=entry.previous;return state.target&&(state.last=entry=entry?entry.next:state.state.first)?"keys"==kind?{value:entry.key,done:!1}:"values"==kind?{value:entry.value,done:!1}:{value:[entry.key,entry.value],done:!1}:(state.target=void 0,{value:void 0,done:!0})}),IS_MAP?"entries":"values",!IS_MAP,!0),setSpecies(CONSTRUCTOR_NAME)}}},function(module,exports,__webpack_require__){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={ClientApi:!0,defaultDecorateStory:!0,addDecorator:!0,addParameters:!0,StoryStore:!0,ConfigApi:!0,subscriptionsStore:!0,pathToId:!0,getQueryParams:!0,getQueryParam:!0};Object.defineProperty(exports,"ClientApi",{enumerable:!0,get:function get(){return _client_api.default}}),Object.defineProperty(exports,"defaultDecorateStory",{enumerable:!0,get:function get(){return _client_api.defaultDecorateStory}}),Object.defineProperty(exports,"addDecorator",{enumerable:!0,get:function get(){return _client_api.addDecorator}}),Object.defineProperty(exports,"addParameters",{enumerable:!0,get:function get(){return _client_api.addParameters}}),Object.defineProperty(exports,"StoryStore",{enumerable:!0,get:function get(){return _story_store.default}}),Object.defineProperty(exports,"ConfigApi",{enumerable:!0,get:function get(){return _config_api.default}}),Object.defineProperty(exports,"subscriptionsStore",{enumerable:!0,get:function get(){return _subscriptions_store.default}}),Object.defineProperty(exports,"pathToId",{enumerable:!0,get:function get(){return _pathToId.default}}),Object.defineProperty(exports,"getQueryParams",{enumerable:!0,get:function get(){return _queryparams.getQueryParams}}),Object.defineProperty(exports,"getQueryParam",{enumerable:!0,get:function get(){return _queryparams.getQueryParam}});var _client_api=function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache();if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(__webpack_require__(483)),_story_store=_interopRequireDefault(__webpack_require__(600)),_config_api=_interopRequireDefault(__webpack_require__(611)),_subscriptions_store=_interopRequireDefault(__webpack_require__(260)),_pathToId=_interopRequireDefault(__webpack_require__(612)),_queryparams=__webpack_require__(613),_hooks=__webpack_require__(167);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var cache=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return cache},cache}Object.keys(_hooks).forEach((function(key){"default"!==key&&"__esModule"!==key&&(Object.prototype.hasOwnProperty.call(_exportNames,key)||Object.defineProperty(exports,key,{enumerable:!0,get:function get(){return _hooks[key]}}))}))},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),$reduce=__webpack_require__(484).left,arrayMethodIsStrict=__webpack_require__(62),arrayMethodUsesToLength=__webpack_require__(31),STRICT_METHOD=arrayMethodIsStrict("reduce"),USES_TO_LENGTH=arrayMethodUsesToLength("reduce",{1:0});$({target:"Array",proto:!0,forced:!STRICT_METHOD||!USES_TO_LENGTH},{reduce:function reduce(callbackfn){return $reduce(this,callbackfn,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(module,exports,__webpack_require__){"use strict";var charAt=__webpack_require__(233).charAt;module.exports=function(S,index,unicode){return index+(unicode?charAt(S,index).length:1)}},function(module,exports,__webpack_require__){(function(global){var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global;module.exports=freeGlobal}).call(this,__webpack_require__(20))},function(module,exports){var reHasUnicode=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");module.exports=function hasUnicode(string){return reHasUnicode.test(string)}},function(module,exports,__webpack_require__){var ListCache=__webpack_require__(113),stackClear=__webpack_require__(515),stackDelete=__webpack_require__(516),stackGet=__webpack_require__(517),stackHas=__webpack_require__(518),stackSet=__webpack_require__(519);function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet,module.exports=Stack},function(module,exports){var funcToString=Function.prototype.toString;module.exports=function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}},function(module,exports,__webpack_require__){var baseAssignValue=__webpack_require__(163),eq=__webpack_require__(89);module.exports=function assignMergeValue(object,key,value){(void 0===value||eq(object[key],value))&&(void 0!==value||key in object)||baseAssignValue(object,key,value)}},function(module,exports,__webpack_require__){var getNative=__webpack_require__(58),defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}();module.exports=defineProperty},function(module,exports,__webpack_require__){var Uint8Array=__webpack_require__(24).Uint8Array;module.exports=Uint8Array},function(module,exports,__webpack_require__){var getPrototype=__webpack_require__(250)(Object.getPrototypeOf,Object);module.exports=getPrototype},function(module,exports){module.exports=function overArg(func,transform){return function(arg){return func(transform(arg))}}},function(module,exports,__webpack_require__){var baseIsArguments=__webpack_require__(545),isObjectLike=__webpack_require__(57),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,propertyIsEnumerable=objectProto.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")};module.exports=isArguments},function(module,exports){module.exports=function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=9007199254740991}},function(module,exports){module.exports=function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}},function(module,exports,__webpack_require__){var arrayLikeKeys=__webpack_require__(255),baseKeysIn=__webpack_require__(556),isArrayLike=__webpack_require__(117);module.exports=function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}},function(module,exports,__webpack_require__){var baseTimes=__webpack_require__(555),isArguments=__webpack_require__(251),isArray=__webpack_require__(56),isBuffer=__webpack_require__(165),isIndex=__webpack_require__(256),isTypedArray=__webpack_require__(166),hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}},function(module,exports){var reIsUint=/^(?:0|[1-9]\d*)$/;module.exports=function isIndex(value,length){var type=typeof value;return!!(length=null==length?9007199254740991:length)&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length}},function(module,exports){module.exports=function identity(value){return value}},function(module,exports,__webpack_require__){var SetCache=__webpack_require__(570),arraySome=__webpack_require__(573),cacheHas=__webpack_require__(574);module.exports=function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,(function(othValue,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack)))return seen.push(othIndex)}))){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}},function(module,exports,__webpack_require__){var baseGet=__webpack_require__(593);module.exports=function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(48),__webpack_require__(30),__webpack_require__(261),__webpack_require__(23),__webpack_require__(50),__webpack_require__(49),__webpack_require__(37),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.createSubscriptionsStore=void 0;var createSubscriptionsStore=function createSubscriptionsStore(){var subscriptions=new Map;return{register:function register(subscribe){var subscription=subscriptions.get(subscribe);subscription||(subscription={unsubscribe:subscribe()},subscriptions.set(subscribe,subscription)),subscription.used=!0},markAllAsUnused:function markAllAsUnused(){subscriptions.forEach((function(subscription){subscription.used=!1}))},clearUnused:function clearUnused(){subscriptions.forEach((function(subscription,key){subscription.used||(subscription.unsubscribe(),subscriptions.delete(key))}))}}};exports.createSubscriptionsStore=createSubscriptionsStore;var _default=createSubscriptionsStore();exports.default=_default},function(module,exports,__webpack_require__){"use strict";var collection=__webpack_require__(154),collectionStrong=__webpack_require__(238);module.exports=collection("Map",(function(init){return function Map(){return init(this,arguments.length?arguments[0]:void 0)}}),collectionStrong)},function(module,exports,__webpack_require__){__webpack_require__(2)({target:"Object",stat:!0,sham:!__webpack_require__(13)},{create:__webpack_require__(61)})},function(module,exports,__webpack_require__){__webpack_require__(2)({target:"Object",stat:!0},{setPrototypeOf:__webpack_require__(146)})},function(module,exports,__webpack_require__){var $=__webpack_require__(2),global=__webpack_require__(3),userAgent=__webpack_require__(141),slice=[].slice,wrap=function(scheduler){return function(handler,timeout){var boundArgs=arguments.length>2,args=boundArgs?slice.call(arguments,2):void 0;return scheduler(boundArgs?function(){("function"==typeof handler?handler:Function(handler)).apply(this,args)}:handler,timeout)}};$({global:!0,bind:!0,forced:/MSIE .\./.test(userAgent)},{setTimeout:wrap(global.setTimeout),setInterval:wrap(global.setInterval)})},function(module,exports,__webpack_require__){module.exports=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){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||e)}),l,l.exports,e,t,n,r)}return n[o].exports}for(var i=!1,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module,exports){module.exports=function(forceSimilar){return"function"!=typeof Map||forceSimilar?new(_dereq_("./similar")):new Map}},{"./similar":2}],2:[function(_dereq_,module,exports){function Similar(){return this.list=[],this.lastItem=void 0,this.size=0,this}Similar.prototype.get=function(key){var index;return this.lastItem&&this.isEqual(this.lastItem.key,key)?this.lastItem.val:(index=this.indexOf(key))>=0?(this.lastItem=this.list[index],this.list[index].val):void 0},Similar.prototype.set=function(key,val){var index;return this.lastItem&&this.isEqual(this.lastItem.key,key)?(this.lastItem.val=val,this):(index=this.indexOf(key))>=0?(this.lastItem=this.list[index],this.list[index].val=val,this):(this.lastItem={key:key,val:val},this.list.push(this.lastItem),this.size++,this)},Similar.prototype.delete=function(key){var index;if(this.lastItem&&this.isEqual(this.lastItem.key,key)&&(this.lastItem=void 0),(index=this.indexOf(key))>=0)return this.size--,this.list.splice(index,1)[0]},Similar.prototype.has=function(key){var index;return!(!this.lastItem||!this.isEqual(this.lastItem.key,key))||(index=this.indexOf(key))>=0&&(this.lastItem=this.list[index],!0)},Similar.prototype.forEach=function(callback,thisArg){var i;for(i=0;i<this.size;i++)callback.call(thisArg||this,this.list[i].val,this.list[i].key,this)},Similar.prototype.indexOf=function(key){var i;for(i=0;i<this.size;i++)if(this.isEqual(this.list[i].key,key))return i;return-1},Similar.prototype.isEqual=function(val1,val2){return val1===val2||val1!=val1&&val2!=val2},module.exports=Similar},{}],3:[function(_dereq_,module,exports){var MapOrSimilar=_dereq_("map-or-similar");function moveToMostRecentLru(lru,lruPath){var isMatch,i,ii,val1,val2,lruLen=lru.length,lruPathLen=lruPath.length;for(i=0;i<lruLen;i++){for(isMatch=!0,ii=0;ii<lruPathLen;ii++)if(val1=lru[i][ii].arg,val2=lruPath[ii].arg,val1!==val2&&(val1==val1||val2==val2)){isMatch=!1;break}if(isMatch)break}lru.push(lru.splice(i,1)[0])}function removeCachedResult(removedLru){var tmp,i,removedLruLen=removedLru.length,currentLru=removedLru[removedLruLen-1];for(currentLru.cacheItem.delete(currentLru.arg),i=removedLruLen-2;i>=0&&(!(tmp=(currentLru=removedLru[i]).cacheItem.get(currentLru.arg))||!tmp.size);i--)currentLru.cacheItem.delete(currentLru.arg)}module.exports=function(limit){var cache=new MapOrSimilar(!1),lru=[];return function(fn){var memoizerific=function(){var newMap,fnResult,i,currentCache=cache,argsLengthMinusOne=arguments.length-1,lruPath=Array(argsLengthMinusOne+1),isMemoized=!0;if((memoizerific.numArgs||0===memoizerific.numArgs)&&memoizerific.numArgs!==argsLengthMinusOne+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(i=0;i<argsLengthMinusOne;i++)lruPath[i]={cacheItem:currentCache,arg:arguments[i]},currentCache.has(arguments[i])?currentCache=currentCache.get(arguments[i]):(isMemoized=!1,newMap=new MapOrSimilar(!1),currentCache.set(arguments[i],newMap),currentCache=newMap);return isMemoized&&(currentCache.has(arguments[argsLengthMinusOne])?fnResult=currentCache.get(arguments[argsLengthMinusOne]):isMemoized=!1),isMemoized||(fnResult=fn.apply(null,arguments),currentCache.set(arguments[argsLengthMinusOne],fnResult)),limit>0&&(lruPath[argsLengthMinusOne]={cacheItem:currentCache,arg:arguments[argsLengthMinusOne]},isMemoized?moveToMostRecentLru(lru,lruPath):lru.push(lruPath),lru.length>limit&&removeCachedResult(lru.shift())),memoizerific.wasMemoized=isMemoized,memoizerific.numArgs=argsLengthMinusOne+1,fnResult};return memoizerific.limit=limit,memoizerific.wasMemoized=!1,memoizerific.cache=cache,memoizerific.lru=lru,memoizerific}}},{"map-or-similar":1}]},{},[3])(3)},function(module,exports,__webpack_require__){"use strict";var fixRegExpWellKnownSymbolLogic=__webpack_require__(158),anObject=__webpack_require__(15),requireObjectCoercible=__webpack_require__(43),sameValue=__webpack_require__(614),regExpExec=__webpack_require__(159);fixRegExpWellKnownSymbolLogic("search",1,(function(SEARCH,nativeSearch,maybeCallNative){return[function search(regexp){var O=requireObjectCoercible(this),searcher=null==regexp?void 0:regexp[SEARCH];return void 0!==searcher?searcher.call(regexp,O):new RegExp(regexp)[SEARCH](String(O))},function(regexp){var res=maybeCallNative(nativeSearch,regexp,this);if(res.done)return res.value;var rx=anObject(regexp),S=String(this),previousLastIndex=rx.lastIndex;sameValue(previousLastIndex,0)||(rx.lastIndex=0);var result=regExpExec(rx,S);return sameValue(rx.lastIndex,previousLastIndex)||(rx.lastIndex=previousLastIndex),null===result?-1:result.index}]}))},function(module,exports,__webpack_require__){"use strict";var stringify=__webpack_require__(615),parse=__webpack_require__(616),formats=__webpack_require__(268);module.exports={formats:formats,parse:parse,stringify:stringify}},function(module,exports,__webpack_require__){"use strict";var replace=String.prototype.replace,percentTwenties=/%20/g,util=__webpack_require__(168),Format={RFC1738:"RFC1738",RFC3986:"RFC3986"};module.exports=util.assign({default:Format.RFC3986,formatters:{RFC1738:function(value){return replace.call(value,percentTwenties,"+")},RFC3986:function(value){return String(value)}}},Format)},function(module,exports,__webpack_require__){"use strict";var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(null==val)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(val)}module.exports=function shouldUseNative(){try{if(!Object.assign)return!1;var test1=new String("abc");if(test1[5]="de","5"===Object.getOwnPropertyNames(test1)[0])return!1;for(var test2={},i=0;i<10;i++)test2["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(test2).map((function(n){return test2[n]})).join(""))return!1;var test3={};return"abcdefghijklmnopqrst".split("").forEach((function(letter){test3[letter]=letter})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},test3)).join("")}catch(err){return!1}}()?Object.assign:function(target,source){for(var from,symbols,to=toObject(target),s=1;s<arguments.length;s++){for(var key in from=Object(arguments[s]))hasOwnProperty.call(from,key)&&(to[key]=from[key]);if(getOwnPropertySymbols){symbols=getOwnPropertySymbols(from);for(var i=0;i<symbols.length;i++)propIsEnumerable.call(from,symbols[i])&&(to[symbols[i]]=from[symbols[i]])}}return to}},function(module){module.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')},function(module){module.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"","zwnj":""}')},,function(module,exports,__webpack_require__){module.exports=function(ReactDOM,React){"use strict";function createCommonjsModule(fn,module){return fn(module={exports:{}},module.exports),module.exports}function makeEmptyFunction(arg){return function(){return arg}}ReactDOM=ReactDOM&&ReactDOM.hasOwnProperty("default")?ReactDOM.default:ReactDOM,React=React&&React.hasOwnProperty("default")?React.default:React;var emptyFunction=function emptyFunction(){};emptyFunction.thatReturns=makeEmptyFunction,emptyFunction.thatReturnsFalse=makeEmptyFunction(!1),emptyFunction.thatReturnsTrue=makeEmptyFunction(!0),emptyFunction.thatReturnsNull=makeEmptyFunction(null),emptyFunction.thatReturnsThis=function(){return this},emptyFunction.thatReturnsArgument=function(arg){return arg};var validateFormat,emptyFunction_1=emptyFunction;validateFormat=function validateFormat(format){if(void 0===format)throw new Error("invariant requires an error message argument")};var invariant_1=function invariant(condition,format,a,b,c,d,e,f){if(validateFormat(format),!condition){var error;if(void 0===format)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],argIndex=0;(error=new Error(format.replace(/%s/g,(function(){return args[argIndex++]})))).name="Invariant Violation"}throw error.framesToPop=1,error}},printWarning=function printWarning(format){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var argIndex=0,message="Warning: "+format.replace(/%s/g,(function(){return args[argIndex++]}));"undefined"!=typeof console&&console.error(message);try{throw new Error(message)}catch(x){}},warning_1=function warning(condition,format){if(void 0===format)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==format.indexOf("Failed Composite propType: ")&&!condition){for(var _len2=arguments.length,args=Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++)args[_key2-2]=arguments[_key2];printWarning.apply(void 0,[format].concat(args))}},getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(null==val)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(val)}var objectAssign=function shouldUseNative(){try{if(!Object.assign)return!1;var test1=new String("abc");if(test1[5]="de","5"===Object.getOwnPropertyNames(test1)[0])return!1;for(var test2={},i=0;i<10;i++)test2["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(test2).map((function(n){return test2[n]})).join(""))return!1;var test3={};return"abcdefghijklmnopqrst".split("").forEach((function(letter){test3[letter]=letter})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},test3)).join("")}catch(err){return!1}}()?Object.assign:function(target,source){for(var from,symbols,to=toObject(target),s=1;s<arguments.length;s++){for(var key in from=Object(arguments[s]))hasOwnProperty.call(from,key)&&(to[key]=from[key]);if(getOwnPropertySymbols){symbols=getOwnPropertySymbols(from);for(var i=0;i<symbols.length;i++)propIsEnumerable.call(from,symbols[i])&&(to[symbols[i]]=from[symbols[i]])}}return to},ReactPropTypesSecret_1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",invariant$1=invariant_1,warning$1=warning_1,loggedTypeFailures={},checkPropTypes_1=function checkPropTypes(typeSpecs,values,location,componentName,getStack){for(var typeSpecName in typeSpecs)if(typeSpecs.hasOwnProperty(typeSpecName)){var error;try{invariant$1("function"==typeof typeSpecs[typeSpecName],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",componentName||"React class",location,typeSpecName,typeof typeSpecs[typeSpecName]),error=typeSpecs[typeSpecName](values,typeSpecName,componentName,location,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ex){error=ex}if(warning$1(!error||error instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",componentName||"React class",location,typeSpecName,typeof error),error instanceof Error&&!(error.message in loggedTypeFailures)){loggedTypeFailures[error.message]=!0;var stack=getStack?getStack():"";warning$1(!1,"Failed %s type: %s%s",location,error.message,null!=stack?stack:"")}}},factoryWithTypeCheckers=function(isValidElement,throwOnDirectAccess){var ITERATOR_SYMBOL="function"==typeof Symbol&&Symbol.iterator,ReactPropTypes={array:createPrimitiveTypeChecker("array"),bool:createPrimitiveTypeChecker("boolean"),func:createPrimitiveTypeChecker("function"),number:createPrimitiveTypeChecker("number"),object:createPrimitiveTypeChecker("object"),string:createPrimitiveTypeChecker("string"),symbol:createPrimitiveTypeChecker("symbol"),any:function createAnyTypeChecker(){return createChainableTypeChecker(emptyFunction_1.thatReturnsNull)}(),arrayOf:function createArrayOfTypeChecker(typeChecker){return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){if("function"!=typeof typeChecker)return new PropTypeError("Property `"+propFullName+"` of component `"+componentName+"` has invalid PropType notation inside arrayOf.");var propValue=props[propName];if(!Array.isArray(propValue))return new PropTypeError("Invalid "+location+" `"+propFullName+"` of type `"+getPropType(propValue)+"` supplied to `"+componentName+"`, expected an array.");for(var i=0;i<propValue.length;i++){var error=typeChecker(propValue,i,componentName,location,propFullName+"["+i+"]",ReactPropTypesSecret_1);if(error instanceof Error)return error}return null}))},element:function createElementTypeChecker(){return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];return isValidElement(propValue)?null:new PropTypeError("Invalid "+location+" `"+propFullName+"` of type `"+getPropType(propValue)+"` supplied to `"+componentName+"`, expected a single ReactElement.")}))}(),instanceOf:function createInstanceTypeChecker(expectedClass){return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){if(!(props[propName]instanceof expectedClass)){var expectedClassName=expectedClass.name||"<<anonymous>>";return new PropTypeError("Invalid "+location+" `"+propFullName+"` of type `"+function getClassName(propValue){return propValue.constructor&&propValue.constructor.name?propValue.constructor.name:"<<anonymous>>"}(props[propName])+"` supplied to `"+componentName+"`, expected instance of `"+expectedClassName+"`.")}return null}))},node:function createNodeChecker(){return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){return isNode(props[propName])?null:new PropTypeError("Invalid "+location+" `"+propFullName+"` supplied to `"+componentName+"`, expected a ReactNode.")}))}(),objectOf:function createObjectOfTypeChecker(typeChecker){return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){if("function"!=typeof typeChecker)return new PropTypeError("Property `"+propFullName+"` of component `"+componentName+"` has invalid PropType notation inside objectOf.");var propValue=props[propName],propType=getPropType(propValue);if("object"!==propType)return new PropTypeError("Invalid "+location+" `"+propFullName+"` 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,propFullName+"."+key,ReactPropTypesSecret_1);if(error instanceof Error)return error}return null}))},oneOf:function createEnumTypeChecker(expectedValues){return Array.isArray(expectedValues)?createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){for(var propValue=props[propName],i=0;i<expectedValues.length;i++)if(x=propValue,y=expectedValues[i],x===y?0!==x||1/x==1/y:x!=x&&y!=y)return null;var x,y;return new PropTypeError("Invalid "+location+" `"+propFullName+"` of value `"+propValue+"` supplied to `"+componentName+"`, expected one of "+JSON.stringify(expectedValues)+".")})):(warning_1(!1,"Invalid argument supplied to oneOf, expected an instance of array."),emptyFunction_1.thatReturnsNull)},oneOfType:function createUnionTypeChecker(arrayOfTypeCheckers){if(!Array.isArray(arrayOfTypeCheckers))return warning_1(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),emptyFunction_1.thatReturnsNull;for(var i=0;i<arrayOfTypeCheckers.length;i++){var checker=arrayOfTypeCheckers[i];if("function"!=typeof checker)return warning_1(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",getPostfixForTypeWarning(checker),i),emptyFunction_1.thatReturnsNull}return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){for(var i=0;i<arrayOfTypeCheckers.length;i++)if(null==(0,arrayOfTypeCheckers[i])(props,propName,componentName,location,propFullName,ReactPropTypesSecret_1))return null;return new PropTypeError("Invalid "+location+" `"+propFullName+"` supplied to `"+componentName+"`.")}))},shape:function createShapeTypeChecker(shapeTypes){return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){var propValue=props[propName],propType=getPropType(propValue);if("object"!==propType)return new PropTypeError("Invalid "+location+" `"+propFullName+"` of type `"+propType+"` supplied to `"+componentName+"`, expected `object`.");for(var key in shapeTypes){var checker=shapeTypes[key];if(checker){var error=checker(propValue,key,componentName,location,propFullName+"."+key,ReactPropTypesSecret_1);if(error)return error}}return null}))},exact:function createStrictShapeTypeChecker(shapeTypes){return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName){var propValue=props[propName],propType=getPropType(propValue);if("object"!==propType)return new PropTypeError("Invalid "+location+" `"+propFullName+"` of type `"+propType+"` supplied to `"+componentName+"`, expected `object`.");var allKeys=objectAssign({},props[propName],shapeTypes);for(var key in allKeys){var checker=shapeTypes[key];if(!checker)return new PropTypeError("Invalid "+location+" `"+propFullName+"` key `"+key+"` supplied to `"+componentName+"`.\nBad object: "+JSON.stringify(props[propName],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(shapeTypes),null," "));var error=checker(propValue,key,componentName,location,propFullName+"."+key,ReactPropTypesSecret_1);if(error)return error}return null}))}};function PropTypeError(message){this.message=message,this.stack=""}function createChainableTypeChecker(validate){var manualPropTypeCallCache={},manualPropTypeWarningCount=0;function checkType(isRequired,props,propName,componentName,location,propFullName,secret){if(componentName=componentName||"<<anonymous>>",propFullName=propFullName||propName,secret!==ReactPropTypesSecret_1)if(throwOnDirectAccess)invariant_1(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("undefined"!=typeof console){var cacheKey=componentName+":"+propName;!manualPropTypeCallCache[cacheKey]&&manualPropTypeWarningCount<3&&(warning_1(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",propFullName,componentName),manualPropTypeCallCache[cacheKey]=!0,manualPropTypeWarningCount++)}return null==props[propName]?isRequired?null===props[propName]?new PropTypeError("The "+location+" `"+propFullName+"` is marked as required in `"+componentName+"`, but its value is `null`."):new PropTypeError("The "+location+" `"+propFullName+"` is marked as required in `"+componentName+"`, but its value is `undefined`."):null:validate(props,propName,componentName,location,propFullName)}var chainedCheckType=checkType.bind(null,!1);return chainedCheckType.isRequired=checkType.bind(null,!0),chainedCheckType}function createPrimitiveTypeChecker(expectedType){return createChainableTypeChecker((function validate(props,propName,componentName,location,propFullName,secret){var propValue=props[propName];return getPropType(propValue)!==expectedType?new PropTypeError("Invalid "+location+" `"+propFullName+"` of type `"+getPreciseType(propValue)+"` supplied to `"+componentName+"`, expected `"+expectedType+"`."):null}))}function isNode(propValue){switch(typeof propValue){case"number":case"string":case"undefined":return!0;case"boolean":return!propValue;case"object":if(Array.isArray(propValue))return propValue.every(isNode);if(null===propValue||isValidElement(propValue))return!0;var iteratorFn=function getIteratorFn(maybeIterable){var iteratorFn=maybeIterable&&(ITERATOR_SYMBOL&&maybeIterable[ITERATOR_SYMBOL]||maybeIterable["@@iterator"]);if("function"==typeof iteratorFn)return iteratorFn}(propValue);if(!iteratorFn)return!1;var step,iterator=iteratorFn.call(propValue);if(iteratorFn!==propValue.entries){for(;!(step=iterator.next()).done;)if(!isNode(step.value))return!1}else for(;!(step=iterator.next()).done;){var entry=step.value;if(entry&&!isNode(entry[1]))return!1}return!0;default:return!1}}function getPropType(propValue){var propType=typeof propValue;return Array.isArray(propValue)?"array":propValue instanceof RegExp?"object":function isSymbol(propType,propValue){return"symbol"===propType||"Symbol"===propValue["@@toStringTag"]||"function"==typeof Symbol&&propValue instanceof Symbol}(propType,propValue)?"symbol":propType}function getPreciseType(propValue){if(null==propValue)return""+propValue;var propType=getPropType(propValue);if("object"===propType){if(propValue instanceof Date)return"date";if(propValue instanceof RegExp)return"regexp"}return propType}function getPostfixForTypeWarning(value){var type=getPreciseType(value);switch(type){case"array":case"object":return"an "+type;case"boolean":case"date":case"regexp":return"a "+type;default:return type}}return PropTypeError.prototype=Error.prototype,ReactPropTypes.checkPropTypes=checkPropTypes_1,ReactPropTypes.PropTypes=ReactPropTypes,ReactPropTypes},propTypes=createCommonjsModule((function(module){var REACT_ELEMENT_TYPE="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;module.exports=factoryWithTypeCheckers((function(object){return"object"==typeof object&&null!==object&&object.$$typeof===REACT_ELEMENT_TYPE}),!0)})),classnames=createCommonjsModule((function(module){!function(){var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i<arguments.length;i++){var arg=arguments[i];if(arg){var argType=typeof arg;if("string"===argType||"number"===argType)classes.push(arg);else if(Array.isArray(arg))classes.push(classNames.apply(null,arg));else if("object"===argType)for(var key in arg)hasOwn.call(arg,key)&&arg[key]&&classes.push(key)}}return classes.join(" ")}module.exports?module.exports=classNames:window.classNames=classNames}()}));function findInArray(array,callback){for(var i=0,length=array.length;i<length;i++)if(callback.apply(callback,[array[i],i,array]))return array[i]}function isFunction(func){return"function"==typeof func||"[object Function]"===Object.prototype.toString.call(func)}function isNum(num){return"number"==typeof num&&!isNaN(num)}function int(a){return parseInt(a,10)}function dontSetMe(props,propName,componentName){if(props[propName])return new Error("Invalid prop "+propName+" passed to "+componentName+" - do not set this, set it on the child.")}var prefixes=["Moz","Webkit","O","ms"];function browserPrefixToKey(prop,prefix){return prefix?""+prefix+function kebabToTitleCase(str){for(var out="",shouldCapitalize=!0,i=0;i<str.length;i++)shouldCapitalize?(out+=str[i].toUpperCase(),shouldCapitalize=!1):"-"===str[i]?shouldCapitalize=!0:out+=str[i];return out}(prop):prop}var browserPrefix=function getPrefix(){var prop=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";var style=window.document.documentElement.style;if(prop in style)return"";for(var i=0;i<prefixes.length;i++)if(browserPrefixToKey(prop,prefixes[i])in style)return prefixes[i];return""}(),classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")},createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),defineProperty=function(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},inherits=function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)},possibleConstructorReturn=function(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call},slicedToArray=function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")},matchesSelectorFunc="";function matchesSelector(el,selector){return matchesSelectorFunc||(matchesSelectorFunc=findInArray(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(method){return isFunction(el[method])}))),!!isFunction(el[matchesSelectorFunc])&&el[matchesSelectorFunc](selector)}function matchesSelectorAndParentsTo(el,selector,baseNode){var node=el;do{if(matchesSelector(node,selector))return!0;if(node===baseNode)return!1;node=node.parentNode}while(node);return!1}function addEvent(el,event,handler){el&&(el.attachEvent?el.attachEvent("on"+event,handler):el.addEventListener?el.addEventListener(event,handler,!0):el["on"+event]=handler)}function removeEvent(el,event,handler){el&&(el.detachEvent?el.detachEvent("on"+event,handler):el.removeEventListener?el.removeEventListener(event,handler,!0):el["on"+event]=null)}function outerHeight(node){var height=node.clientHeight,computedStyle=node.ownerDocument.defaultView.getComputedStyle(node);return height+=int(computedStyle.borderTopWidth),height+=int(computedStyle.borderBottomWidth)}function outerWidth(node){var width=node.clientWidth,computedStyle=node.ownerDocument.defaultView.getComputedStyle(node);return width+=int(computedStyle.borderLeftWidth),width+=int(computedStyle.borderRightWidth)}function innerHeight(node){var height=node.clientHeight,computedStyle=node.ownerDocument.defaultView.getComputedStyle(node);return height-=int(computedStyle.paddingTop),height-=int(computedStyle.paddingBottom)}function innerWidth(node){var width=node.clientWidth,computedStyle=node.ownerDocument.defaultView.getComputedStyle(node);return width-=int(computedStyle.paddingLeft),width-=int(computedStyle.paddingRight)}function getTranslation(_ref2,positionOffset,unitSuffix){var translation="translate("+_ref2.x+unitSuffix+","+_ref2.y+unitSuffix+")";return positionOffset&&(translation="translate("+("string"==typeof positionOffset.x?positionOffset.x:positionOffset.x+unitSuffix)+", "+("string"==typeof positionOffset.y?positionOffset.y:positionOffset.y+unitSuffix)+")"+translation),translation}function getTouchIdentifier(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0}function addUserSelectStyles(doc){if(doc){var styleEl=doc.getElementById("react-draggable-style-el");styleEl||((styleEl=doc.createElement("style")).type="text/css",styleEl.id="react-draggable-style-el",styleEl.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",styleEl.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",doc.getElementsByTagName("head")[0].appendChild(styleEl)),doc.body&&function addClassName(el,className){el.classList?el.classList.add(className):el.className.match(new RegExp("(?:^|\\s)"+className+"(?!\\S)"))||(el.className+=" "+className)}(doc.body,"react-draggable-transparent-selection")}}function removeUserSelectStyles(doc){try{doc&&doc.body&&function removeClassName(el,className){el.classList?el.classList.remove(className):el.className=el.className.replace(new RegExp("(?:^|\\s)"+className+"(?!\\S)","g"),"")}(doc.body,"react-draggable-transparent-selection"),doc.selection?doc.selection.empty():window.getSelection().removeAllRanges()}catch(e){}}function styleHacks(){var childStyle=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _extends({touchAction:"none"},childStyle)}function snapToGrid(grid,pendingX,pendingY){return[Math.round(pendingX/grid[0])*grid[0],Math.round(pendingY/grid[1])*grid[1]]}function canDragX(draggable){return"both"===draggable.props.axis||"x"===draggable.props.axis}function canDragY(draggable){return"both"===draggable.props.axis||"y"===draggable.props.axis}function getControlPosition(e,touchIdentifier,draggableCore){var touchObj="number"==typeof touchIdentifier?function getTouch(e,identifier){return e.targetTouches&&findInArray(e.targetTouches,(function(t){return identifier===t.identifier}))||e.changedTouches&&findInArray(e.changedTouches,(function(t){return identifier===t.identifier}))}(e,touchIdentifier):null;if("number"==typeof touchIdentifier&&!touchObj)return null;var node=findDOMNode(draggableCore);return function offsetXYFromParent(evt,offsetParent){var offsetParentRect=offsetParent===offsetParent.ownerDocument.body?{left:0,top:0}:offsetParent.getBoundingClientRect();return{x:evt.clientX+offsetParent.scrollLeft-offsetParentRect.left,y:evt.clientY+offsetParent.scrollTop-offsetParentRect.top}}(touchObj||e,draggableCore.props.offsetParent||node.offsetParent||node.ownerDocument.body)}function createCoreData(draggable,x,y){var state=draggable.state,isStart=!isNum(state.lastX),node=findDOMNode(draggable);return isStart?{node:node,deltaX:0,deltaY:0,lastX:x,lastY:y,x:x,y:y}:{node:node,deltaX:x-state.lastX,deltaY:y-state.lastY,lastX:state.lastX,lastY:state.lastY,x:x,y:y}}function createDraggableData(draggable,coreData){var scale=draggable.props.scale;return{node:coreData.node,x:draggable.state.x+coreData.deltaX/scale,y:draggable.state.y+coreData.deltaY/scale,deltaX:coreData.deltaX/scale,deltaY:coreData.deltaY/scale,lastX:draggable.state.x,lastY:draggable.state.y}}function findDOMNode(draggable){var node=ReactDOM.findDOMNode(draggable);if(!node)throw new Error("<DraggableCore>: Unmounted during event!");return node}var eventsFor_touch={start:"touchstart",move:"touchmove",stop:"touchend"},eventsFor_mouse={start:"mousedown",move:"mousemove",stop:"mouseup"},dragEventFor=eventsFor_mouse,DraggableCore=function(_React$Component){function DraggableCore(){var _ref,_temp,_this;classCallCheck(this,DraggableCore);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=possibleConstructorReturn(this,(_ref=DraggableCore.__proto__||Object.getPrototypeOf(DraggableCore)).call.apply(_ref,[this].concat(args))),_this.state={dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null},_this.handleDragStart=function(e){if(_this.props.onMouseDown(e),!_this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;var thisNode=ReactDOM.findDOMNode(_this);if(!thisNode||!thisNode.ownerDocument||!thisNode.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");var ownerDocument=thisNode.ownerDocument;if(!(_this.props.disabled||!(e.target instanceof ownerDocument.defaultView.Node)||_this.props.handle&&!matchesSelectorAndParentsTo(e.target,_this.props.handle,thisNode)||_this.props.cancel&&matchesSelectorAndParentsTo(e.target,_this.props.cancel,thisNode))){var touchIdentifier=getTouchIdentifier(e);_this.setState({touchIdentifier:touchIdentifier});var position=getControlPosition(e,touchIdentifier,_this);if(null!=position){var x=position.x,y=position.y,coreEvent=createCoreData(_this,x,y);_this.props.onStart,!1!==_this.props.onStart(e,coreEvent)&&(_this.props.enableUserSelectHack&&addUserSelectStyles(ownerDocument),_this.setState({dragging:!0,lastX:x,lastY:y}),addEvent(ownerDocument,dragEventFor.move,_this.handleDrag),addEvent(ownerDocument,dragEventFor.stop,_this.handleDragStop))}}},_this.handleDrag=function(e){"touchmove"===e.type&&e.preventDefault();var position=getControlPosition(e,_this.state.touchIdentifier,_this);if(null!=position){var x=position.x,y=position.y;if(Array.isArray(_this.props.grid)){var _deltaX=x-_this.state.lastX,_deltaY=y-_this.state.lastY,_snapToGrid=snapToGrid(_this.props.grid,_deltaX,_deltaY),_snapToGrid2=slicedToArray(_snapToGrid,2);if(_deltaX=_snapToGrid2[0],_deltaY=_snapToGrid2[1],!_deltaX&&!_deltaY)return;x=_this.state.lastX+_deltaX,y=_this.state.lastY+_deltaY}var coreEvent=createCoreData(_this,x,y);if(!1!==_this.props.onDrag(e,coreEvent))_this.setState({lastX:x,lastY:y});else try{_this.handleDragStop(new MouseEvent("mouseup"))}catch(err){var event=document.createEvent("MouseEvents");event.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),_this.handleDragStop(event)}}},_this.handleDragStop=function(e){if(_this.state.dragging){var position=getControlPosition(e,_this.state.touchIdentifier,_this);if(null!=position){var x=position.x,y=position.y,coreEvent=createCoreData(_this,x,y),thisNode=ReactDOM.findDOMNode(_this);thisNode&&_this.props.enableUserSelectHack&&removeUserSelectStyles(thisNode.ownerDocument),_this.setState({dragging:!1,lastX:NaN,lastY:NaN}),_this.props.onStop(e,coreEvent),thisNode&&(removeEvent(thisNode.ownerDocument,dragEventFor.move,_this.handleDrag),removeEvent(thisNode.ownerDocument,dragEventFor.stop,_this.handleDragStop))}}},_this.onMouseDown=function(e){return dragEventFor=eventsFor_mouse,_this.handleDragStart(e)},_this.onMouseUp=function(e){return dragEventFor=eventsFor_mouse,_this.handleDragStop(e)},_this.onTouchStart=function(e){return dragEventFor=eventsFor_touch,_this.handleDragStart(e)},_this.onTouchEnd=function(e){return dragEventFor=eventsFor_touch,_this.handleDragStop(e)},possibleConstructorReturn(_this,_temp)}return inherits(DraggableCore,_React$Component),createClass(DraggableCore,[{key:"componentWillUnmount",value:function componentWillUnmount(){var thisNode=ReactDOM.findDOMNode(this);if(thisNode){var ownerDocument=thisNode.ownerDocument;removeEvent(ownerDocument,eventsFor_mouse.move,this.handleDrag),removeEvent(ownerDocument,eventsFor_touch.move,this.handleDrag),removeEvent(ownerDocument,eventsFor_mouse.stop,this.handleDragStop),removeEvent(ownerDocument,eventsFor_touch.stop,this.handleDragStop),this.props.enableUserSelectHack&&removeUserSelectStyles(ownerDocument)}}},{key:"render",value:function render(){return React.cloneElement(React.Children.only(this.props.children),{style:styleHacks(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),DraggableCore}(React.Component);DraggableCore.displayName="DraggableCore",DraggableCore.propTypes={allowAnyClick:propTypes.bool,disabled:propTypes.bool,enableUserSelectHack:propTypes.bool,offsetParent:function offsetParent(props,propName){if(props[propName]&&1!==props[propName].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:propTypes.arrayOf(propTypes.number),scale:propTypes.number,handle:propTypes.string,cancel:propTypes.string,onStart:propTypes.func,onDrag:propTypes.func,onStop:propTypes.func,onMouseDown:propTypes.func,className:dontSetMe,style:dontSetMe,transform:dontSetMe},DraggableCore.defaultProps={allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function onStart(){},onDrag:function onDrag(){},onStop:function onStop(){},onMouseDown:function onMouseDown(){}};var Draggable=function(_React$Component){function Draggable(props){classCallCheck(this,Draggable);var _this=possibleConstructorReturn(this,(Draggable.__proto__||Object.getPrototypeOf(Draggable)).call(this,props));return _this.onDragStart=function(e,coreData){if(!1===_this.props.onStart(e,createDraggableData(_this,coreData)))return!1;_this.setState({dragging:!0,dragged:!0})},_this.onDrag=function(e,coreData){if(!_this.state.dragging)return!1;var uiData=createDraggableData(_this,coreData),newState={x:uiData.x,y:uiData.y};if(_this.props.bounds){var _x=newState.x,_y=newState.y;newState.x+=_this.state.slackX,newState.y+=_this.state.slackY;var _getBoundPosition=function getBoundPosition(draggable,x,y){if(!draggable.props.bounds)return[x,y];var bounds=draggable.props.bounds;bounds="string"==typeof bounds?bounds:function cloneBounds(bounds){return{left:bounds.left,top:bounds.top,right:bounds.right,bottom:bounds.bottom}}(bounds);var node=findDOMNode(draggable);if("string"==typeof bounds){var ownerDocument=node.ownerDocument,ownerWindow=ownerDocument.defaultView,boundNode=void 0;if(!((boundNode="parent"===bounds?node.parentNode:ownerDocument.querySelector(bounds))instanceof ownerWindow.HTMLElement))throw new Error('Bounds selector "'+bounds+'" could not find an element.');var nodeStyle=ownerWindow.getComputedStyle(node),boundNodeStyle=ownerWindow.getComputedStyle(boundNode);bounds={left:-node.offsetLeft+int(boundNodeStyle.paddingLeft)+int(nodeStyle.marginLeft),top:-node.offsetTop+int(boundNodeStyle.paddingTop)+int(nodeStyle.marginTop),right:innerWidth(boundNode)-outerWidth(node)-node.offsetLeft+int(boundNodeStyle.paddingRight)-int(nodeStyle.marginRight),bottom:innerHeight(boundNode)-outerHeight(node)-node.offsetTop+int(boundNodeStyle.paddingBottom)-int(nodeStyle.marginBottom)}}return isNum(bounds.right)&&(x=Math.min(x,bounds.right)),isNum(bounds.bottom)&&(y=Math.min(y,bounds.bottom)),isNum(bounds.left)&&(x=Math.max(x,bounds.left)),isNum(bounds.top)&&(y=Math.max(y,bounds.top)),[x,y]}(_this,newState.x,newState.y),_getBoundPosition2=slicedToArray(_getBoundPosition,2),newStateX=_getBoundPosition2[0],newStateY=_getBoundPosition2[1];newState.x=newStateX,newState.y=newStateY,newState.slackX=_this.state.slackX+(_x-newState.x),newState.slackY=_this.state.slackY+(_y-newState.y),uiData.x=newState.x,uiData.y=newState.y,uiData.deltaX=newState.x-_this.state.x,uiData.deltaY=newState.y-_this.state.y}if(!1===_this.props.onDrag(e,uiData))return!1;_this.setState(newState)},_this.onDragStop=function(e,coreData){if(!_this.state.dragging)return!1;if(!1===_this.props.onStop(e,createDraggableData(_this,coreData)))return!1;var newState={dragging:!1,slackX:0,slackY:0};if(Boolean(_this.props.position)){var _this$props$position=_this.props.position,_x2=_this$props$position.x,_y2=_this$props$position.y;newState.x=_x2,newState.y=_y2}_this.setState(newState)},_this.state={dragging:!1,dragged:!1,x:props.position?props.position.x:props.defaultPosition.x,y:props.position?props.position.y:props.defaultPosition.y,slackX:0,slackY:0,isElementSVG:!1},!props.position||props.onDrag||props.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),_this}return inherits(Draggable,_React$Component),createClass(Draggable,[{key:"componentDidMount",value:function componentDidMount(){void 0!==window.SVGElement&&ReactDOM.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillReceiveProps",value:function componentWillReceiveProps(nextProps){!nextProps.position||this.props.position&&nextProps.position.x===this.props.position.x&&nextProps.position.y===this.props.position.y||this.setState({x:nextProps.position.x,y:nextProps.position.y})}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.setState({dragging:!1})}},{key:"render",value:function render(){var _classNames,style={},svgTransform=null,draggable=!Boolean(this.props.position)||this.state.dragging,position=this.props.position||this.props.defaultPosition,transformOpts={x:canDragX(this)&&draggable?this.state.x:position.x,y:canDragY(this)&&draggable?this.state.y:position.y};this.state.isElementSVG?svgTransform=function createSVGTransform(controlPos,positionOffset){return getTranslation(controlPos,positionOffset,"")}(transformOpts,this.props.positionOffset):style=function createCSSTransform(controlPos,positionOffset){var translation=getTranslation(controlPos,positionOffset,"px");return defineProperty({},browserPrefixToKey("transform",browserPrefix),translation)}(transformOpts,this.props.positionOffset);var _props=this.props,defaultClassName=_props.defaultClassName,defaultClassNameDragging=_props.defaultClassNameDragging,defaultClassNameDragged=_props.defaultClassNameDragged,children=React.Children.only(this.props.children),className=classnames(children.props.className||"",defaultClassName,(defineProperty(_classNames={},defaultClassNameDragging,this.state.dragging),defineProperty(_classNames,defaultClassNameDragged,this.state.dragged),_classNames));return React.createElement(DraggableCore,_extends({},this.props,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),React.cloneElement(children,{className:className,style:_extends({},children.props.style,style),transform:svgTransform}))}}]),Draggable}(React.Component);return Draggable.displayName="Draggable",Draggable.propTypes=_extends({},DraggableCore.propTypes,{axis:propTypes.oneOf(["both","x","y","none"]),bounds:propTypes.oneOfType([propTypes.shape({left:propTypes.number,right:propTypes.number,top:propTypes.number,bottom:propTypes.number}),propTypes.string,propTypes.oneOf([!1])]),defaultClassName:propTypes.string,defaultClassNameDragging:propTypes.string,defaultClassNameDragged:propTypes.string,defaultPosition:propTypes.shape({x:propTypes.number,y:propTypes.number}),positionOffset:propTypes.shape({x:propTypes.oneOfType([propTypes.number,propTypes.string]),y:propTypes.oneOfType([propTypes.number,propTypes.string])}),position:propTypes.shape({x:propTypes.number,y:propTypes.number}),className:dontSetMe,style:dontSetMe,transform:dontSetMe}),Draggable.defaultProps=_extends({},DraggableCore.defaultProps,{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null,scale:1}),Draggable.default=Draggable,Draggable.DraggableCore=DraggableCore,Draggable}(__webpack_require__(90),__webpack_require__(0))},,,,function(module,exports,__webpack_require__){var v1=__webpack_require__(656),v4=__webpack_require__(657),uuid=v4;uuid.v1=v1,uuid.v4=v4,module.exports=uuid},function(module,exports){var getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues){var rnds8=new Uint8Array(16);module.exports=function whatwgRNG(){return getRandomValues(rnds8),rnds8}}else{var rnds=new Array(16);module.exports=function mathRNG(){for(var r,i=0;i<16;i++)0==(3&i)&&(r=4294967296*Math.random()),rnds[i]=r>>>((3&i)<<3)&255;return rnds}}},function(module,exports){for(var byteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);module.exports=function bytesToUuid(buf,offset){var i=offset||0,bth=byteToHex;return[bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]]].join("")}},,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){"use strict";(function(module){function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}__webpack_require__(29),__webpack_require__(147),__webpack_require__(63),__webpack_require__(55),Object.defineProperty(exports,"__esModule",{value:!0}),exports.withOptions=exports.setOptions=void 0;var _utilDeprecate=_interopRequireDefault(__webpack_require__(102)),_addons=function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache();if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(__webpack_require__(103)),_constants=_interopRequireDefault(__webpack_require__(478));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var cache=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return cache},cache}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],excluded.indexOf(key)>=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function emitOptions(options){var channel=_addons.default.getChannel();if(!channel)throw new Error("Failed to find addon channel. This may be due to https://github.com/storybookjs/storybook/issues/1192.");channel.emit(_constants.default.SET,{options:options})}var globalOptions={},setOptions=(0,_utilDeprecate.default)((function(options){globalOptions=options,emitOptions(options)}),"`setOptions(options)` is deprecated. Please use the `withOptions(options)` decorator globally.");exports.setOptions=setOptions;var withOptions=(0,_addons.makeDecorator)({name:"withOptions",parameterName:"options",skipIfNoParametersOrOptions:!1,wrapper:(0,_utilDeprecate.default)((function(getStory,context,_ref){var inputOptions=_ref.options,parameters=_ref.parameters,_globalOptions$inputO=Object.assign({},globalOptions,{},inputOptions,{},parameters),change=(_globalOptions$inputO.hierarchySeparator,_globalOptions$inputO.hierarchyRootSeparator,_objectWithoutProperties(_globalOptions$inputO,["hierarchySeparator","hierarchyRootSeparator"]));return Object.keys(change).length&&emitOptions(Object.assign({},globalOptions,{},inputOptions,{},parameters)),context.options=Object.assign({},globalOptions,{},inputOptions,{},parameters),getStory(Object.assign({},context,{options:Object.assign({},globalOptions,{},inputOptions,{},parameters)}))}),"withOptions is deprecated, use addParameters({ options: {} }) instead")});exports.withOptions=withOptions,module&&module.hot&&module.hot.decline&&module.hot.decline()}).call(this,__webpack_require__(54)(module))},function(module,exports){module.exports=function shallowEqual(objA,objB,compare,compareContext){var ret=compare?compare.call(compareContext,objA,objB):void 0;if(void 0!==ret)return!!ret;if(objA===objB)return!0;if("object"!=typeof objA||!objA||"object"!=typeof objB||!objB)return!1;var keysA=Object.keys(objA),keysB=Object.keys(objB);if(keysA.length!==keysB.length)return!1;for(var bHasOwnProperty=Object.prototype.hasOwnProperty.bind(objB),idx=0;idx<keysA.length;idx++){var key=keysA[idx];if(!bHasOwnProperty(key))return!1;var valueA=objA[key],valueB=objB[key];if(!1===(ret=compare?compare.call(compareContext,valueA,valueB,key):void 0)||void 0===ret&&valueA!==valueB)return!1}return!0}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a=function stylis_min(W){function X(d,c,e){var h=c.trim().split(ia);c=h;var a=h.length,m=d.length;switch(m){case 0:case 1:var b=0;for(d=0===m?"":d[0]+" ";b<a;++b)c[b]=Z(d,c[b],e).trim();break;default:var v=b=0;for(c=[];b<a;++b)for(var n=0;n<m;++n)c[v++]=Z(d[n]+" ",h[b],e).trim()}return c}function Z(d,c,e){var h=c.charCodeAt(0);switch(33>h&&(h=(c=c.trim()).charCodeAt(0)),h){case 38:return c.replace(F,"$1"+d.trim());case 58:return d.trim()+c.replace(F,"$1"+d.trim());default:if(0<1*e&&0<c.indexOf("\f"))return c.replace(F,(58===d.charCodeAt(0)?"":"$1")+d.trim())}return d+c}function P(d,c,e,h){var a=d+";",m=2*c+3*e+4*h;if(944===m){d=a.indexOf(":",9)+1;var b=a.substring(d,a.length-1).trim();return b=a.substring(0,d).trim()+b+";",1===w||2===w&&L(b,1)?"-webkit-"+b+b:b}if(0===w||2===w&&!L(a,1))return a;switch(m){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(ja,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(b=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+b+a;case 1005:return ka.test(a)?a.replace(aa,":-webkit-")+a.replace(aa,":-moz-")+a:a;case 1e3:switch(c=(b=a.substring(13).trim()).indexOf("-")+1,b.charCodeAt(0)+b.charCodeAt(c)){case 226:b=a.replace(G,"tb");break;case 232:b=a.replace(G,"tb-rl");break;case 220:b=a.replace(G,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+b+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(c=(a=d).length-10,m=(b=(33===a.charCodeAt(c)?a.substring(0,c):a).substring(d.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|b.charCodeAt(7))){case 203:if(111>b.charCodeAt(8))break;case 115:a=a.replace(b,"-webkit-"+b)+";"+a;break;case 207:case 102:a=a.replace(b,"-webkit-"+(102<m?"inline-":"")+"box")+";"+a.replace(b,"-webkit-"+b)+";"+a.replace(b,"-ms-"+b+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return b=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+b+"-ms-flex-"+b+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(ba,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(ba,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===la.test(d))return 115===(b=d.substring(d.indexOf(":")+1)).charCodeAt(0)?P(d.replace("stretch","fill-available"),c,e,h).replace(":fill-available",":stretch"):a.replace(b,"-webkit-"+b)+a.replace(b,"-moz-"+b.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===e+h&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(ma,"$1-webkit-$2")+a}return a}function L(d,c){var e=d.indexOf(1===c?":":"{"),h=d.substring(0,3!==c?e:10);return e=d.substring(e+1,d.length-1),R(2!==c?h:h.replace(na,"$1"),e,c)}function ea(d,c){var e=P(c,c.charCodeAt(0),c.charCodeAt(1),c.charCodeAt(2));return e!==c+";"?e.replace(oa," or ($1)").substring(4):"("+c+")"}function H(d,c,e,h,a,m,b,v,n,q){for(var w,g=0,x=c;g<A;++g)switch(w=S[g].call(B,d,x,e,h,a,m,b,v,n,q)){case void 0:case!1:case!0:case null:break;default:x=w}if(x!==c)return x}function U(d){return void 0!==(d=d.prefix)&&(R=null,d?"function"!=typeof d?w=1:(w=2,R=d):w=0),U}function B(d,c){var e=d;if(33>e.charCodeAt(0)&&(e=e.trim()),e=[e],0<A){var h=H(-1,c,e,e,D,z,0,0,0,0);void 0!==h&&"string"==typeof h&&(c=h)}var a=function M(d,c,e,h,a){for(var q,g,k,y,C,m=0,b=0,v=0,n=0,x=0,K=0,u=k=q=0,l=0,r=0,I=0,t=0,B=e.length,J=B-1,f="",p="",F="",G="";l<B;){if(g=e.charCodeAt(l),l===J&&0!==b+n+v+m&&(0!==b&&(g=47===b?10:47),n=v=m=0,B++,J++),0===b+n+v+m){if(l===J&&(0<r&&(f=f.replace(N,"")),0<f.trim().length)){switch(g){case 32:case 9:case 59:case 13:case 10:break;default:f+=e.charAt(l)}g=59}switch(g){case 123:for(q=(f=f.trim()).charCodeAt(0),k=1,t=++l;l<B;){switch(g=e.charCodeAt(l)){case 123:k++;break;case 125:k--;break;case 47:switch(g=e.charCodeAt(l+1)){case 42:case 47:a:{for(u=l+1;u<J;++u)switch(e.charCodeAt(u)){case 47:if(42===g&&42===e.charCodeAt(u-1)&&l+2!==u){l=u+1;break a}break;case 10:if(47===g){l=u+1;break a}}l=u}}break;case 91:g++;case 40:g++;case 34:case 39:for(;l++<J&&e.charCodeAt(l)!==g;);}if(0===k)break;l++}switch(k=e.substring(t,l),0===q&&(q=(f=f.replace(ca,"").trim()).charCodeAt(0)),q){case 64:switch(0<r&&(f=f.replace(N,"")),g=f.charCodeAt(1)){case 100:case 109:case 115:case 45:r=c;break;default:r=O}if(t=(k=M(c,r,k,g,a+1)).length,0<A&&(C=H(3,k,r=X(O,f,I),c,D,z,t,g,a,h),f=r.join(""),void 0!==C&&0===(t=(k=C.trim()).length)&&(g=0,k="")),0<t)switch(g){case 115:f=f.replace(da,ea);case 100:case 109:case 45:k=f+"{"+k+"}";break;case 107:k=(f=f.replace(fa,"$1 $2"))+"{"+k+"}",k=1===w||2===w&&L("@"+k,3)?"@-webkit-"+k+"@"+k:"@"+k;break;default:k=f+k,112===h&&(p+=k,k="")}else k="";break;default:k=M(c,X(c,f,I),k,h,a+1)}F+=k,k=I=r=u=q=0,f="",g=e.charCodeAt(++l);break;case 125:case 59:if(1<(t=(f=(0<r?f.replace(N,""):f).trim()).length))switch(0===u&&(q=f.charCodeAt(0),45===q||96<q&&123>q)&&(t=(f=f.replace(" ",":")).length),0<A&&void 0!==(C=H(1,f,c,d,D,z,p.length,h,a,h))&&0===(t=(f=C.trim()).length)&&(f="\0\0"),q=f.charCodeAt(0),g=f.charCodeAt(1),q){case 0:break;case 64:if(105===g||99===g){G+=f+e.charAt(l);break}default:58!==f.charCodeAt(t-1)&&(p+=P(f,q,g,f.charCodeAt(2)))}I=r=u=q=0,f="",g=e.charCodeAt(++l)}}switch(g){case 13:case 10:47===b?b=0:0===1+q&&107!==h&&0<f.length&&(r=1,f+="\0"),0<A*Y&&H(0,f,c,d,D,z,p.length,h,a,h),z=1,D++;break;case 59:case 125:if(0===b+n+v+m){z++;break}default:switch(z++,y=e.charAt(l),g){case 9:case 32:if(0===n+m+b)switch(x){case 44:case 58:case 9:case 32:y="";break;default:32!==g&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===n+b+m&&(r=I=1,y="\f"+y);break;case 108:if(0===n+b+m+E&&0<u)switch(l-u){case 2:112===x&&58===e.charCodeAt(l-3)&&(E=x);case 8:111===K&&(E=K)}break;case 58:0===n+b+m&&(u=l);break;case 44:0===b+v+n+m&&(r=1,y+="\r");break;case 34:case 39:0===b&&(n=n===g?0:0===n?g:n);break;case 91:0===n+b+v&&m++;break;case 93:0===n+b+v&&m--;break;case 41:0===n+b+m&&v--;break;case 40:if(0===n+b+m){if(0===q)switch(2*x+3*K){case 533:break;default:q=1}v++}break;case 64:0===b+v+n+m+u+k&&(k=1);break;case 42:case 47:if(!(0<n+m+v))switch(b){case 0:switch(2*g+3*e.charCodeAt(l+1)){case 235:b=47;break;case 220:t=l,b=42}break;case 42:47===g&&42===x&&t+2!==l&&(33===e.charCodeAt(t+2)&&(p+=e.substring(t,l+1)),y="",b=0)}}0===b&&(f+=y)}K=x,x=g,l++}if(0<(t=p.length)){if(r=c,0<A&&(void 0!==(C=H(2,p,r,d,D,z,t,h,a,h))&&0===(p=C).length))return G+p+F;if(p=r.join(",")+"{"+p+"}",0!=w*E){switch(2!==w||L(p,2)||(E=0),E){case 111:p=p.replace(ha,":-moz-$1")+p;break;case 112:p=p.replace(Q,"::-webkit-input-$1")+p.replace(Q,"::-moz-$1")+p.replace(Q,":-ms-input-$1")+p}E=0}}return G+p+F}(O,e,c,0,0);return 0<A&&(void 0!==(h=H(-2,a,e,e,D,z,a.length,0,0,0))&&(a=h)),"",E=0,z=D=1,a}var ca=/^\0+/g,N=/[\0\r\f]/g,aa=/: */g,ka=/zoo|gra/,ma=/([,: ])(transform)/g,ia=/,\r+?/g,F=/([\t\r\n ])*\f?&/g,fa=/@(k\w+)\s*(\S*)\s*/,Q=/::(place)/g,ha=/:(read-only)/g,G=/[svh]\w+-[tblr]{2}/,da=/\(\s*(.*)\s*\)/g,oa=/([\s\S]*?);/g,ba=/-self|flex-/g,na=/[^]*?(:[rp][el]a[\w-]+)[^]*/,la=/stretch|:\s*\w+\-(?:conte|avail)/,ja=/([^-])(image-set\()/,z=1,D=1,E=0,w=1,O=[],S=[],A=0,R=null,Y=0;return B.use=function T(d){switch(d){case void 0:case null:A=S.length=0;break;default:if("function"==typeof d)S[A++]=d;else if("object"==typeof d)for(var c=0,e=d.length;c<e;++c)T(d[c]);else Y=0|!!d}return T},B.set=U,void 0!==W&&U(W),B}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(module,__webpack_exports__,__webpack_require__){"use strict";var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,index=function memoize(fn){var cache={};return function(arg){return void 0===cache[arg]&&(cache[arg]=fn(arg)),cache[arg]}}((function(prop){return reactPropsRegex.test(prop)||111===prop.charCodeAt(0)&&110===prop.charCodeAt(1)&&prop.charCodeAt(2)<91}));__webpack_exports__.a=index},,function(module,exports,__webpack_require__){"use strict";__webpack_require__(118),__webpack_require__(305),__webpack_require__(426)},function(module,exports,__webpack_require__){"use strict";__webpack_require__(306)},function(module,exports,__webpack_require__){"use strict";__webpack_require__(307),__webpack_require__(308),__webpack_require__(309)},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__;!function(root,factory){"use strict";void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=function(){var isRegex,isString,$Array=Array,ArrayPrototype=$Array.prototype,$Object=Object,ObjectPrototype=$Object.prototype,$Function=Function,FunctionPrototype=$Function.prototype,$String=String,StringPrototype=$String.prototype,$Number=Number,NumberPrototype=$Number.prototype,array_slice=ArrayPrototype.slice,array_splice=ArrayPrototype.splice,array_push=ArrayPrototype.push,array_unshift=ArrayPrototype.unshift,array_concat=ArrayPrototype.concat,array_join=ArrayPrototype.join,call=FunctionPrototype.call,apply=FunctionPrototype.apply,max=Math.max,min=Math.min,to_string=ObjectPrototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,fnToStr=Function.prototype.toString,constructorRegex=/^\s*class /,isES6ClassFn=function isES6ClassFn(value){try{var spaceStripped=fnToStr.call(value).replace(/\/\/.*\n/g,"").replace(/\/\*[.\s\S]*\*\//g,"").replace(/\n/gm," ").replace(/ {2}/g," ");return constructorRegex.test(spaceStripped)}catch(e){return!1}},tryFunctionObject=function tryFunctionObject(value){try{return!isES6ClassFn(value)&&(fnToStr.call(value),!0)}catch(e){return!1}},fnClass="[object Function]",genClass="[object GeneratorFunction]",isCallable=function isCallable(value){if(!value)return!1;if("function"!=typeof value&&"object"!=typeof value)return!1;if(hasToStringTag)return tryFunctionObject(value);if(isES6ClassFn(value))return!1;var strClass=to_string.call(value);return strClass===fnClass||strClass===genClass},regexExec=RegExp.prototype.exec,tryRegexExec=function tryRegexExec(value){try{return regexExec.call(value),!0}catch(e){return!1}},regexClass="[object RegExp]";isRegex=function isRegex(value){return"object"==typeof value&&(hasToStringTag?tryRegexExec(value):to_string.call(value)===regexClass)};var strValue=String.prototype.valueOf,tryStringObject=function tryStringObject(value){try{return strValue.call(value),!0}catch(e){return!1}},stringClass="[object String]";isString=function isString(value){return"string"==typeof value||"object"==typeof value&&(hasToStringTag?tryStringObject(value):to_string.call(value)===stringClass)};var supportsDescriptors=$Object.defineProperty&&function(){try{var obj={};for(var _ in $Object.defineProperty(obj,"x",{enumerable:!1,value:obj}),obj)return!1;return obj.x===obj}catch(e){return!1}}(),defineProperties=(has=ObjectPrototype.hasOwnProperty,defineProperty=supportsDescriptors?function(object,name,method,forceAssign){!forceAssign&&name in object||$Object.defineProperty(object,name,{configurable:!0,enumerable:!1,writable:!0,value:method})}:function(object,name,method,forceAssign){!forceAssign&&name in object||(object[name]=method)},function defineProperties(object,map,forceAssign){for(var name in map)has.call(map,name)&&defineProperty(object,name,map[name],forceAssign)}),isPrimitive=function isPrimitive(input){var type=typeof input;return null===input||"object"!==type&&"function"!==type},isActualNaN=$Number.isNaN||function isActualNaN(x){return x!=x},ES={ToInteger:function ToInteger(num){var n=+num;return isActualNaN(n)?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n},ToPrimitive:function ToPrimitive(input){var val,valueOf,toStr;if(isPrimitive(input))return input;if(valueOf=input.valueOf,isCallable(valueOf)&&(val=valueOf.call(input),isPrimitive(val)))return val;if(toStr=input.toString,isCallable(toStr)&&(val=toStr.call(input),isPrimitive(val)))return val;throw new TypeError},ToObject:function(o){if(null==o)throw new TypeError("can't convert "+o+" to object");return $Object(o)},ToUint32:function ToUint32(x){return x>>>0}},Empty=function Empty(){};var has,defineProperty;defineProperties(FunctionPrototype,{bind:function bind(that){var target=this;if(!isCallable(target))throw new TypeError("Function.prototype.bind called on incompatible "+target);for(var bound,args=array_slice.call(arguments,1),binder=function(){if(this instanceof bound){var result=apply.call(target,this,array_concat.call(args,array_slice.call(arguments)));return $Object(result)===result?result:this}return apply.call(target,that,array_concat.call(args,array_slice.call(arguments)))},boundLength=max(0,target.length-args.length),boundArgs=[],i=0;i<boundLength;i++)array_push.call(boundArgs,"$"+i);return bound=$Function("binder","return function ("+array_join.call(boundArgs,",")+"){ return binder.apply(this, arguments); }")(binder),target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound}});var owns=call.bind(ObjectPrototype.hasOwnProperty),toStr=call.bind(ObjectPrototype.toString),arraySlice=call.bind(array_slice),arraySliceApply=apply.bind(array_slice);if("object"==typeof document&&document&&document.documentElement)try{arraySlice(document.documentElement.childNodes)}catch(e){var origArraySlice=arraySlice,origArraySliceApply=arraySliceApply;arraySlice=function arraySliceIE(arr){for(var r=[],i=arr.length;i-- >0;)r[i]=arr[i];return origArraySliceApply(r,origArraySlice(arguments,1))},arraySliceApply=function arraySliceApplyIE(arr,args){return origArraySliceApply(arraySlice(arr),args)}}var strSlice=call.bind(StringPrototype.slice),strSplit=call.bind(StringPrototype.split),strIndexOf=call.bind(StringPrototype.indexOf),pushCall=call.bind(array_push),isEnum=call.bind(ObjectPrototype.propertyIsEnumerable),arraySort=call.bind(ArrayPrototype.sort),isArray=$Array.isArray||function isArray(obj){return"[object Array]"===toStr(obj)},hasUnshiftReturnValueBug=1!==[].unshift(0);defineProperties(ArrayPrototype,{unshift:function(){return array_unshift.apply(this,arguments),this.length}},hasUnshiftReturnValueBug),defineProperties($Array,{isArray:isArray});var boxedString=$Object("a"),splitString="a"!==boxedString[0]||!(0 in boxedString),properlyBoxesContext=function properlyBoxed(method){var properlyBoxesNonStrict=!0,properlyBoxesStrict=!0,threwException=!1;if(method)try{method.call("foo",(function(_,__,context){"object"!=typeof context&&(properlyBoxesNonStrict=!1)})),method.call([1],(function(){properlyBoxesStrict="string"==typeof this}),"x")}catch(e){threwException=!0}return!!method&&!threwException&&properlyBoxesNonStrict&&properlyBoxesStrict};defineProperties(ArrayPrototype,{forEach:function forEach(callbackfn){var T,object=ES.ToObject(this),self=splitString&&isString(this)?strSplit(this,""):object,i=-1,length=ES.ToUint32(self.length);if(arguments.length>1&&(T=arguments[1]),!isCallable(callbackfn))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++i<length;)i in self&&(void 0===T?callbackfn(self[i],i,object):callbackfn.call(T,self[i],i,object))}},!properlyBoxesContext(ArrayPrototype.forEach)),defineProperties(ArrayPrototype,{map:function map(callbackfn){var T,object=ES.ToObject(this),self=splitString&&isString(this)?strSplit(this,""):object,length=ES.ToUint32(self.length),result=$Array(length);if(arguments.length>1&&(T=arguments[1]),!isCallable(callbackfn))throw new TypeError("Array.prototype.map callback must be a function");for(var i=0;i<length;i++)i in self&&(result[i]=void 0===T?callbackfn(self[i],i,object):callbackfn.call(T,self[i],i,object));return result}},!properlyBoxesContext(ArrayPrototype.map)),defineProperties(ArrayPrototype,{filter:function filter(callbackfn){var value,T,object=ES.ToObject(this),self=splitString&&isString(this)?strSplit(this,""):object,length=ES.ToUint32(self.length),result=[];if(arguments.length>1&&(T=arguments[1]),!isCallable(callbackfn))throw new TypeError("Array.prototype.filter callback must be a function");for(var i=0;i<length;i++)i in self&&(value=self[i],(void 0===T?callbackfn(value,i,object):callbackfn.call(T,value,i,object))&&pushCall(result,value));return result}},!properlyBoxesContext(ArrayPrototype.filter)),defineProperties(ArrayPrototype,{every:function every(callbackfn){var T,object=ES.ToObject(this),self=splitString&&isString(this)?strSplit(this,""):object,length=ES.ToUint32(self.length);if(arguments.length>1&&(T=arguments[1]),!isCallable(callbackfn))throw new TypeError("Array.prototype.every callback must be a function");for(var i=0;i<length;i++)if(i in self&&!(void 0===T?callbackfn(self[i],i,object):callbackfn.call(T,self[i],i,object)))return!1;return!0}},!properlyBoxesContext(ArrayPrototype.every)),defineProperties(ArrayPrototype,{some:function some(callbackfn){var T,object=ES.ToObject(this),self=splitString&&isString(this)?strSplit(this,""):object,length=ES.ToUint32(self.length);if(arguments.length>1&&(T=arguments[1]),!isCallable(callbackfn))throw new TypeError("Array.prototype.some callback must be a function");for(var i=0;i<length;i++)if(i in self&&(void 0===T?callbackfn(self[i],i,object):callbackfn.call(T,self[i],i,object)))return!0;return!1}},!properlyBoxesContext(ArrayPrototype.some));var reduceCoercesToObject=!1;ArrayPrototype.reduce&&(reduceCoercesToObject="object"==typeof ArrayPrototype.reduce.call("es5",(function(_,__,___,list){return list})));defineProperties(ArrayPrototype,{reduce:function reduce(callbackfn){var object=ES.ToObject(this),self=splitString&&isString(this)?strSplit(this,""):object,length=ES.ToUint32(self.length);if(!isCallable(callbackfn))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===length&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError("reduce of empty array with no initial value")}for(;i<length;i++)i in self&&(result=callbackfn(result,self[i],i,object));return result}},!reduceCoercesToObject);var reduceRightCoercesToObject=!1;ArrayPrototype.reduceRight&&(reduceRightCoercesToObject="object"==typeof ArrayPrototype.reduceRight.call("es5",(function(_,__,___,list){return list})));defineProperties(ArrayPrototype,{reduceRight:function reduceRight(callbackfn){var result,object=ES.ToObject(this),self=splitString&&isString(this)?strSplit(this,""):object,length=ES.ToUint32(self.length);if(!isCallable(callbackfn))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===length&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(--i<0)throw new TypeError("reduceRight of empty array with no initial value")}if(i<0)return result;do{i in self&&(result=callbackfn(result,self[i],i,object))}while(i--);return result}},!reduceRightCoercesToObject);var hasFirefox2IndexOfBug=ArrayPrototype.indexOf&&-1!==[0,1].indexOf(1,2);defineProperties(ArrayPrototype,{indexOf:function indexOf(searchElement){var self=splitString&&isString(this)?strSplit(this,""):ES.ToObject(this),length=ES.ToUint32(self.length);if(0===length)return-1;var i=0;for(arguments.length>1&&(i=ES.ToInteger(arguments[1])),i=i>=0?i:max(0,length+i);i<length;i++)if(i in self&&self[i]===searchElement)return i;return-1}},hasFirefox2IndexOfBug);var hasFirefox2LastIndexOfBug=ArrayPrototype.lastIndexOf&&-1!==[0,1].lastIndexOf(0,-3);defineProperties(ArrayPrototype,{lastIndexOf:function lastIndexOf(searchElement){var self=splitString&&isString(this)?strSplit(this,""):ES.ToObject(this),length=ES.ToUint32(self.length);if(0===length)return-1;var i=length-1;for(arguments.length>1&&(i=min(i,ES.ToInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&searchElement===self[i])return i;return-1}},hasFirefox2LastIndexOfBug);var spliceNoopReturnsEmptyArray=(a=[1,2],result=a.splice(),2===a.length&&isArray(result)&&0===result.length);var a,result;defineProperties(ArrayPrototype,{splice:function splice(start,deleteCount){return 0===arguments.length?[]:array_splice.apply(this,arguments)}},!spliceNoopReturnsEmptyArray);var spliceWorksWithEmptyObject=(obj={},ArrayPrototype.splice.call(obj,0,0,1),1===obj.length);var obj;defineProperties(ArrayPrototype,{splice:function splice(start,deleteCount){if(0===arguments.length)return[];var args=arguments;return this.length=max(ES.ToInteger(this.length),0),arguments.length>0&&"number"!=typeof deleteCount&&((args=arraySlice(arguments)).length<2?pushCall(args,this.length-start):args[1]=ES.ToInteger(deleteCount)),array_splice.apply(this,args)}},!spliceWorksWithEmptyObject);var spliceWorksWithLargeSparseArrays=(arr=new $Array(1e5),arr[8]="x",arr.splice(1,1),7===arr.indexOf("x")),spliceWorksWithSmallSparseArrays=function(){var arr=[];return arr[256]="a",arr.splice(257,0,"b"),"a"===arr[256]}();var arr;defineProperties(ArrayPrototype,{splice:function splice(start,deleteCount){for(var from,O=ES.ToObject(this),A=[],len=ES.ToUint32(O.length),relativeStart=ES.ToInteger(start),actualStart=relativeStart<0?max(len+relativeStart,0):min(relativeStart,len),actualDeleteCount=min(max(ES.ToInteger(deleteCount),0),len-actualStart),k=0;k<actualDeleteCount;)from=$String(actualStart+k),owns(O,from)&&(A[k]=O[from]),k+=1;var to,items=arraySlice(arguments,2),itemCount=items.length;if(itemCount<actualDeleteCount){k=actualStart;for(var maxK=len-actualDeleteCount;k<maxK;)from=$String(k+actualDeleteCount),to=$String(k+itemCount),owns(O,from)?O[to]=O[from]:delete O[to],k+=1;k=len;for(var minK=len-actualDeleteCount+itemCount;k>minK;)delete O[k-1],k-=1}else if(itemCount>actualDeleteCount)for(k=len-actualDeleteCount;k>actualStart;)from=$String(k+actualDeleteCount-1),to=$String(k+itemCount-1),owns(O,from)?O[to]=O[from]:delete O[to],k-=1;k=actualStart;for(var i=0;i<items.length;++i)O[k]=items[i],k+=1;return O.length=len-actualDeleteCount+itemCount,A}},!spliceWorksWithLargeSparseArrays||!spliceWorksWithSmallSparseArrays);var hasStringJoinBug,originalJoin=ArrayPrototype.join;try{hasStringJoinBug="1,2,3"!==Array.prototype.join.call("123",",")}catch(e){hasStringJoinBug=!0}hasStringJoinBug&&defineProperties(ArrayPrototype,{join:function join(separator){var sep=void 0===separator?",":separator;return originalJoin.call(isString(this)?strSplit(this,""):this,sep)}},hasStringJoinBug);var hasJoinUndefinedBug="1,2"!==[1,2].join(void 0);hasJoinUndefinedBug&&defineProperties(ArrayPrototype,{join:function join(separator){var sep=void 0===separator?",":separator;return originalJoin.call(this,sep)}},hasJoinUndefinedBug);var pushShim=function push(item){for(var O=ES.ToObject(this),n=ES.ToUint32(O.length),i=0;i<arguments.length;)O[n+i]=arguments[i],i+=1;return O.length=n+i,n+i},pushIsNotGeneric=function(){var obj={};return 1!==Array.prototype.push.call(obj,void 0)||1!==obj.length||void 0!==obj[0]||!owns(obj,0)}();defineProperties(ArrayPrototype,{push:function push(item){return isArray(this)?array_push.apply(this,arguments):pushShim.apply(this,arguments)}},pushIsNotGeneric);var pushUndefinedIsWeird=function(){var arr=[];return 1!==arr.push(void 0)||1!==arr.length||void 0!==arr[0]||!owns(arr,0)}();defineProperties(ArrayPrototype,{push:pushShim},pushUndefinedIsWeird),defineProperties(ArrayPrototype,{slice:function(start,end){var arr=isString(this)?strSplit(this,""):this;return arraySliceApply(arr,arguments)}},splitString);var sortIgnoresNonFunctions=function(){try{[1,2].sort(null)}catch(e){try{[1,2].sort({})}catch(e2){return!1}}return!0}(),sortThrowsOnRegex=function(){try{return[1,2].sort(/a/),!1}catch(e){}return!0}(),sortIgnoresUndefined=function(){try{return[1,2].sort(void 0),!0}catch(e){}return!1}();defineProperties(ArrayPrototype,{sort:function sort(compareFn){if(void 0===compareFn)return arraySort(this);if(!isCallable(compareFn))throw new TypeError("Array.prototype.sort callback must be a function");return arraySort(this,compareFn)}},sortIgnoresNonFunctions||!sortIgnoresUndefined||!sortThrowsOnRegex);var hasDontEnumBug=!isEnum({toString:null},"toString"),hasProtoEnumBug=isEnum((function(){}),"prototype"),hasStringEnumBug=!owns("x","0"),equalsConstructorPrototype=function(o){var ctor=o.constructor;return ctor&&ctor.prototype===o},excludedKeys={$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,$width:!0,$height:!0,$top:!0,$localStorage:!0},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var k in window)try{!excludedKeys["$"+k]&&owns(window,k)&&null!==window[k]&&"object"==typeof window[k]&&equalsConstructorPrototype(window[k])}catch(e){return!0}return!1}(),equalsConstructorPrototypeIfNotBuggy=function(object){if("undefined"==typeof window||!hasAutomationEqualityBug)return equalsConstructorPrototype(object);try{return equalsConstructorPrototype(object)}catch(e){return!1}},dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length,isStandardArguments=function isArguments(value){return"[object Arguments]"===toStr(value)},isLegacyArguments=function isArguments(value){return null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&!isArray(value)&&isCallable(value.callee)},isArguments=isStandardArguments(arguments)?isStandardArguments:isLegacyArguments;defineProperties($Object,{keys:function keys(object){var isFn=isCallable(object),isArgs=isArguments(object),isObject=null!==object&&"object"==typeof object,isStr=isObject&&isString(object);if(!isObject&&!isFn&&!isArgs)throw new TypeError("Object.keys called on a non-object");var theKeys=[],skipProto=hasProtoEnumBug&&isFn;if(isStr&&hasStringEnumBug||isArgs)for(var i=0;i<object.length;++i)pushCall(theKeys,$String(i));if(!isArgs)for(var name in object)skipProto&&"prototype"===name||!owns(object,name)||pushCall(theKeys,$String(name));if(hasDontEnumBug)for(var skipConstructor=equalsConstructorPrototypeIfNotBuggy(object),j=0;j<dontEnumsLength;j++){var dontEnum=dontEnums[j];skipConstructor&&"constructor"===dontEnum||!owns(object,dontEnum)||pushCall(theKeys,dontEnum)}return theKeys}});var keysWorksWithArguments=$Object.keys&&function(){return 2===$Object.keys(arguments).length}(1,2),keysHasArgumentsLengthBug=$Object.keys&&function(){var argKeys=$Object.keys(arguments);return 1!==arguments.length||1!==argKeys.length||1!==argKeys[0]}(1),originalKeys=$Object.keys;defineProperties($Object,{keys:function keys(object){return isArguments(object)?originalKeys(arraySlice(object)):originalKeys(object)}},!keysWorksWithArguments||keysHasArgumentsLengthBug);var hasToDateStringFormatBug,hasToStringFormatBug,hasNegativeMonthYearBug=0!==new Date(-0xc782b5b342b24).getUTCMonth(),aNegativeTestDate=new Date(-0x55d318d56a724),aPositiveTestDate=new Date(14496624e5),hasToUTCStringFormatBug="Mon, 01 Jan -45875 11:59:59 GMT"!==aNegativeTestDate.toUTCString(),timeZoneOffset=aNegativeTestDate.getTimezoneOffset();timeZoneOffset<-720?(hasToDateStringFormatBug="Tue Jan 02 -45875"!==aNegativeTestDate.toDateString(),hasToStringFormatBug=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(aPositiveTestDate))):(hasToDateStringFormatBug="Mon Jan 01 -45875"!==aNegativeTestDate.toDateString(),hasToStringFormatBug=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(aPositiveTestDate)));var originalGetFullYear=call.bind(Date.prototype.getFullYear),originalGetMonth=call.bind(Date.prototype.getMonth),originalGetDate=call.bind(Date.prototype.getDate),originalGetUTCFullYear=call.bind(Date.prototype.getUTCFullYear),originalGetUTCMonth=call.bind(Date.prototype.getUTCMonth),originalGetUTCDate=call.bind(Date.prototype.getUTCDate),originalGetUTCDay=call.bind(Date.prototype.getUTCDay),originalGetUTCHours=call.bind(Date.prototype.getUTCHours),originalGetUTCMinutes=call.bind(Date.prototype.getUTCMinutes),originalGetUTCSeconds=call.bind(Date.prototype.getUTCSeconds),originalGetUTCMilliseconds=call.bind(Date.prototype.getUTCMilliseconds),dayName=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],monthName=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],daysInMonth=function daysInMonth(month,year){return originalGetDate(new Date(year,month,0))};defineProperties(Date.prototype,{getFullYear:function getFullYear(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var year=originalGetFullYear(this);return year<0&&originalGetMonth(this)>11?year+1:year},getMonth:function getMonth(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var year=originalGetFullYear(this),month=originalGetMonth(this);return year<0&&month>11?0:month},getDate:function getDate(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var year=originalGetFullYear(this),month=originalGetMonth(this),date=originalGetDate(this);return year<0&&month>11?12===month?date:daysInMonth(0,year+1)-date+1:date},getUTCFullYear:function getUTCFullYear(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var year=originalGetUTCFullYear(this);return year<0&&originalGetUTCMonth(this)>11?year+1:year},getUTCMonth:function getUTCMonth(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var year=originalGetUTCFullYear(this),month=originalGetUTCMonth(this);return year<0&&month>11?0:month},getUTCDate:function getUTCDate(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var year=originalGetUTCFullYear(this),month=originalGetUTCMonth(this),date=originalGetUTCDate(this);return year<0&&month>11?12===month?date:daysInMonth(0,year+1)-date+1:date}},hasNegativeMonthYearBug),defineProperties(Date.prototype,{toUTCString:function toUTCString(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var day=originalGetUTCDay(this),date=originalGetUTCDate(this),month=originalGetUTCMonth(this),year=originalGetUTCFullYear(this),hour=originalGetUTCHours(this),minute=originalGetUTCMinutes(this),second=originalGetUTCSeconds(this);return dayName[day]+", "+(date<10?"0"+date:date)+" "+monthName[month]+" "+year+" "+(hour<10?"0"+hour:hour)+":"+(minute<10?"0"+minute:minute)+":"+(second<10?"0"+second:second)+" GMT"}},hasNegativeMonthYearBug||hasToUTCStringFormatBug),defineProperties(Date.prototype,{toDateString:function toDateString(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var day=this.getDay(),date=this.getDate(),month=this.getMonth(),year=this.getFullYear();return dayName[day]+" "+monthName[month]+" "+(date<10?"0"+date:date)+" "+year}},hasNegativeMonthYearBug||hasToDateStringFormatBug),(hasNegativeMonthYearBug||hasToStringFormatBug)&&(Date.prototype.toString=function toString(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var day=this.getDay(),date=this.getDate(),month=this.getMonth(),year=this.getFullYear(),hour=this.getHours(),minute=this.getMinutes(),second=this.getSeconds(),timezoneOffset=this.getTimezoneOffset(),hoursOffset=Math.floor(Math.abs(timezoneOffset)/60),minutesOffset=Math.floor(Math.abs(timezoneOffset)%60);return dayName[day]+" "+monthName[month]+" "+(date<10?"0"+date:date)+" "+year+" "+(hour<10?"0"+hour:hour)+":"+(minute<10?"0"+minute:minute)+":"+(second<10?"0"+second:second)+" GMT"+(timezoneOffset>0?"-":"+")+(hoursOffset<10?"0"+hoursOffset:hoursOffset)+(minutesOffset<10?"0"+minutesOffset:minutesOffset)},supportsDescriptors&&$Object.defineProperty(Date.prototype,"toString",{configurable:!0,enumerable:!1,writable:!0}));var negativeDate=-621987552e5,negativeYearString="-000001",hasNegativeDateBug=Date.prototype.toISOString&&-1===new Date(negativeDate).toISOString().indexOf(negativeYearString),hasSafari51DateBug=Date.prototype.toISOString&&"1969-12-31T23:59:59.999Z"!==new Date(-1).toISOString(),getTime=call.bind(Date.prototype.getTime);defineProperties(Date.prototype,{toISOString:function toISOString(){if(!isFinite(this)||!isFinite(getTime(this)))throw new RangeError("Date.prototype.toISOString called on non-finite value.");var year=originalGetUTCFullYear(this),month=originalGetUTCMonth(this);year+=Math.floor(month/12);var result=[(month=(month%12+12)%12)+1,originalGetUTCDate(this),originalGetUTCHours(this),originalGetUTCMinutes(this),originalGetUTCSeconds(this)];year=(year<0?"-":year>9999?"+":"")+strSlice("00000"+Math.abs(year),0<=year&&year<=9999?-4:-6);for(var i=0;i<result.length;++i)result[i]=strSlice("00"+result[i],-2);return year+"-"+arraySlice(result,0,2).join("-")+"T"+arraySlice(result,2).join(":")+"."+strSlice("000"+originalGetUTCMilliseconds(this),-3)+"Z"}},hasNegativeDateBug||hasSafari51DateBug);var dateToJSONIsSupported=function(){try{return Date.prototype.toJSON&&null===new Date(NaN).toJSON()&&-1!==new Date(negativeDate).toJSON().indexOf(negativeYearString)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(e){return!1}}();dateToJSONIsSupported||(Date.prototype.toJSON=function toJSON(key){var O=$Object(this),tv=ES.ToPrimitive(O);if("number"==typeof tv&&!isFinite(tv))return null;var toISO=O.toISOString;if(!isCallable(toISO))throw new TypeError("toISOString property is not callable");return toISO.call(O)});var supportsExtendedYears=1e15===Date.parse("+033658-09-27T01:46:40.000Z"),acceptsInvalidDates=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z")),doesNotParseY2KNewYear=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(doesNotParseY2KNewYear||acceptsInvalidDates||!supportsExtendedYears){var maxSafeUnsigned32Bit=Math.pow(2,31)-1,hasSafariSignedIntBug=isActualNaN(new Date(1970,0,1,0,0,0,maxSafeUnsigned32Bit+1).getTime());Date=function(NativeDate){var DateShim=function Date(Y,M,D,h,m,s,ms){var date,length=arguments.length;if(this instanceof NativeDate){var seconds=s,millis=ms;if(hasSafariSignedIntBug&&length>=7&&ms>maxSafeUnsigned32Bit){var msToShift=Math.floor(ms/maxSafeUnsigned32Bit)*maxSafeUnsigned32Bit,sToShift=Math.floor(msToShift/1e3);seconds+=sToShift,millis-=1e3*sToShift}date=1===length&&$String(Y)===Y?new NativeDate(DateShim.parse(Y)):length>=7?new NativeDate(Y,M,D,h,m,seconds,millis):length>=6?new NativeDate(Y,M,D,h,m,seconds):length>=5?new NativeDate(Y,M,D,h,m):length>=4?new NativeDate(Y,M,D,h):length>=3?new NativeDate(Y,M,D):length>=2?new NativeDate(Y,M):length>=1?new NativeDate(Y instanceof NativeDate?+Y:Y):new NativeDate}else date=NativeDate.apply(this,arguments);return isPrimitive(date)||defineProperties(date,{constructor:DateShim},!0),date},isoDateExpression=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"),months=[0,31,59,90,120,151,181,212,243,273,304,334,365],dayFromMonth=function dayFromMonth(year,month){var t=month>1?1:0;return months[month]+Math.floor((year-1969+t)/4)-Math.floor((year-1901+t)/100)+Math.floor((year-1601+t)/400)+365*(year-1970)},toUTC=function toUTC(t){var s=0,ms=t;if(hasSafariSignedIntBug&&ms>maxSafeUnsigned32Bit){var msToShift=Math.floor(ms/maxSafeUnsigned32Bit)*maxSafeUnsigned32Bit,sToShift=Math.floor(msToShift/1e3);s+=sToShift,ms-=1e3*sToShift}return $Number(new NativeDate(1970,0,1,0,0,s,ms))};for(var key in NativeDate)owns(NativeDate,key)&&(DateShim[key]=NativeDate[key]);defineProperties(DateShim,{now:NativeDate.now,UTC:NativeDate.UTC},!0),DateShim.prototype=NativeDate.prototype,defineProperties(DateShim.prototype,{constructor:DateShim},!0);return defineProperties(DateShim,{parse:function parse(string){var match=isoDateExpression.exec(string);if(match){var result,year=$Number(match[1]),month=$Number(match[2]||1)-1,day=$Number(match[3]||1)-1,hour=$Number(match[4]||0),minute=$Number(match[5]||0),second=$Number(match[6]||0),millisecond=Math.floor(1e3*$Number(match[7]||0)),isLocalTime=Boolean(match[4]&&!match[8]),signOffset="-"===match[9]?1:-1,hourOffset=$Number(match[10]||0),minuteOffset=$Number(match[11]||0),hasMinutesOrSecondsOrMilliseconds=minute>0||second>0||millisecond>0;return hour<(hasMinutesOrSecondsOrMilliseconds?24:25)&&minute<60&&second<60&&millisecond<1e3&&month>-1&&month<12&&hourOffset<24&&minuteOffset<60&&day>-1&&day<dayFromMonth(year,month+1)-dayFromMonth(year,month)&&(result=1e3*(60*((result=60*(24*(dayFromMonth(year,month)+day)+hour+hourOffset*signOffset))+minute+minuteOffset*signOffset)+second)+millisecond,isLocalTime&&(result=toUTC(result)),-864e13<=result&&result<=864e13)?result:NaN}return NativeDate.parse.apply(this,arguments)}}),DateShim}(Date)}Date.now||(Date.now=function now(){return(new Date).getTime()});var hasToFixedBugs=NumberPrototype.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0)),toFixedHelpers={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function multiply(n,c){for(var i=-1,c2=c;++i<toFixedHelpers.size;)c2+=n*toFixedHelpers.data[i],toFixedHelpers.data[i]=c2%toFixedHelpers.base,c2=Math.floor(c2/toFixedHelpers.base)},divide:function divide(n){for(var i=toFixedHelpers.size,c=0;--i>=0;)c+=toFixedHelpers.data[i],toFixedHelpers.data[i]=Math.floor(c/n),c=c%n*toFixedHelpers.base},numToString:function numToString(){for(var i=toFixedHelpers.size,s="";--i>=0;)if(""!==s||0===i||0!==toFixedHelpers.data[i]){var t=$String(toFixedHelpers.data[i]);""===s?s=t:s+=strSlice("0000000",0,7-t.length)+t}return s},pow:function pow(x,n,acc){return 0===n?acc:n%2==1?pow(x,n-1,acc*x):pow(x*x,n/2,acc)},log:function log(x){for(var n=0,x2=x;x2>=4096;)n+=12,x2/=4096;for(;x2>=2;)n+=1,x2/=2;return n}},toFixedShim=function toFixed(fractionDigits){var f,x,s,m,e,z,j,k;if(f=$Number(fractionDigits),(f=isActualNaN(f)?0:Math.floor(f))<0||f>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(x=$Number(this),isActualNaN(x))return"NaN";if(x<=-1e21||x>=1e21)return $String(x);if(s="",x<0&&(s="-",x=-x),m="0",x>1e-21)if(z=(e=toFixedHelpers.log(x*toFixedHelpers.pow(2,69,1))-69)<0?x*toFixedHelpers.pow(2,-e,1):x/toFixedHelpers.pow(2,e,1),z*=4503599627370496,(e=52-e)>0){for(toFixedHelpers.multiply(0,z),j=f;j>=7;)toFixedHelpers.multiply(1e7,0),j-=7;for(toFixedHelpers.multiply(toFixedHelpers.pow(10,j,1),0),j=e-1;j>=23;)toFixedHelpers.divide(1<<23),j-=23;toFixedHelpers.divide(1<<j),toFixedHelpers.multiply(1,1),toFixedHelpers.divide(2),m=toFixedHelpers.numToString()}else toFixedHelpers.multiply(0,z),toFixedHelpers.multiply(1<<-e,0),m=toFixedHelpers.numToString()+strSlice("0.00000000000000000000",2,2+f);return m=f>0?(k=m.length)<=f?s+strSlice("0.0000000000000000000",0,f-k+2)+m:s+strSlice(m,0,k-f)+"."+strSlice(m,k-f):s+m};defineProperties(NumberPrototype,{toFixed:toFixedShim},hasToFixedBugs);var hasToPrecisionUndefinedBug=function(){try{return"1"===1..toPrecision(void 0)}catch(e){return!0}}(),originalToPrecision=NumberPrototype.toPrecision;defineProperties(NumberPrototype,{toPrecision:function toPrecision(precision){return void 0===precision?originalToPrecision.call(this):originalToPrecision.call(this,precision)}},hasToPrecisionUndefinedBug),2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?(compliantExecNpcg=void 0===/()??/.exec("")[1],maxSafe32BitInt=Math.pow(2,32)-1,StringPrototype.split=function(separator,limit){var string=String(this);if(void 0===separator&&0===limit)return[];if(!isRegex(separator))return strSplit(this,separator,limit);var separator2,match,lastIndex,lastLength,output=[],flags=(separator.ignoreCase?"i":"")+(separator.multiline?"m":"")+(separator.unicode?"u":"")+(separator.sticky?"y":""),lastLastIndex=0,separatorCopy=new RegExp(separator.source,flags+"g");compliantExecNpcg||(separator2=new RegExp("^"+separatorCopy.source+"$(?!\\s)",flags));var splitLimit=void 0===limit?maxSafe32BitInt:ES.ToUint32(limit);for(match=separatorCopy.exec(string);match&&!((lastIndex=match.index+match[0].length)>lastLastIndex&&(pushCall(output,strSlice(string,lastLastIndex,match.index)),!compliantExecNpcg&&match.length>1&&match[0].replace(separator2,(function(){for(var i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(match[i]=void 0)})),match.length>1&&match.index<string.length&&array_push.apply(output,arraySlice(match,1)),lastLength=match[0].length,lastLastIndex=lastIndex,output.length>=splitLimit));)separatorCopy.lastIndex===match.index&&separatorCopy.lastIndex++,match=separatorCopy.exec(string);return lastLastIndex===string.length?!lastLength&&separatorCopy.test("")||pushCall(output,""):pushCall(output,strSlice(string,lastLastIndex)),output.length>splitLimit?arraySlice(output,0,splitLimit):output}):"0".split(void 0,0).length&&(StringPrototype.split=function split(separator,limit){return void 0===separator&&0===limit?[]:strSplit(this,separator,limit)});var compliantExecNpcg,maxSafe32BitInt;var str_replace=StringPrototype.replace,replaceReportsGroupsCorrectly=(groups=[],"x".replace(/x(.)?/g,(function(match,group){pushCall(groups,group)})),1===groups.length&&void 0===groups[0]);var groups;replaceReportsGroupsCorrectly||(StringPrototype.replace=function replace(searchValue,replaceValue){var isFn=isCallable(replaceValue),hasCapturingGroups=isRegex(searchValue)&&/\)[*?]/.test(searchValue.source);if(isFn&&hasCapturingGroups){return str_replace.call(this,searchValue,(function(match){var length=arguments.length,originalLastIndex=searchValue.lastIndex;searchValue.lastIndex=0;var args=searchValue.exec(match)||[];return searchValue.lastIndex=originalLastIndex,pushCall(args,arguments[length-2],arguments[length-1]),replaceValue.apply(this,args)}))}return str_replace.call(this,searchValue,replaceValue)});var string_substr=StringPrototype.substr,hasNegativeSubstrBug="".substr&&"b"!=="0b".substr(-1);defineProperties(StringPrototype,{substr:function substr(start,length){var normalizedStart=start;return start<0&&(normalizedStart=max(this.length+start,0)),string_substr.call(this,normalizedStart,length)}},hasNegativeSubstrBug);var ws="\t\n\v\f\r \u2028\u2029\ufeff",zeroWidth="",wsRegexChars="["+ws+"]",trimBeginRegexp=new RegExp("^"+wsRegexChars+wsRegexChars+"*"),trimEndRegexp=new RegExp(wsRegexChars+wsRegexChars+"*$"),hasTrimWhitespaceBug=StringPrototype.trim&&(ws.trim()||!zeroWidth.trim());defineProperties(StringPrototype,{trim:function trim(){if(null==this)throw new TypeError("can't convert "+this+" to object");return $String(this).replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}},hasTrimWhitespaceBug);var trim=call.bind(String.prototype.trim),hasLastIndexBug=StringPrototype.lastIndexOf&&-1!=="abcあい".lastIndexOf("あい",2);defineProperties(StringPrototype,{lastIndexOf:function lastIndexOf(searchString){if(null==this)throw new TypeError("can't convert "+this+" to object");for(var S=$String(this),searchStr=$String(searchString),numPos=arguments.length>1?$Number(arguments[1]):NaN,pos=isActualNaN(numPos)?1/0:ES.ToInteger(numPos),start=min(max(pos,0),S.length),searchLen=searchStr.length,k=start+searchLen;k>0;){k=max(0,k-searchLen);var index=strIndexOf(strSlice(S,k,start+searchLen),searchStr);if(-1!==index)return k+index}return-1}},hasLastIndexBug);var originalLastIndexOf=StringPrototype.lastIndexOf;defineProperties(StringPrototype,{lastIndexOf:function lastIndexOf(searchString){return originalLastIndexOf.apply(this,arguments)}},1!==StringPrototype.lastIndexOf.length),(8!==parseInt(ws+"08")||22!==parseInt(ws+"0x16"))&&(parseInt=(origParseInt=parseInt,hexRegex=/^[-+]?0[xX]/,function parseInt(str,radix){var string=trim(String(str)),defaultedRadix=$Number(radix)||(hexRegex.test(string)?16:10);return origParseInt(string,defaultedRadix)}));var origParseInt,hexRegex;1/parseFloat("-0")!=-1/0&&(parseFloat=(origParseFloat=parseFloat,function parseFloat(string){var inputString=trim(String(string)),result=origParseFloat(inputString);return 0===result&&"-"===strSlice(inputString,0,1)?-0:result}));var origParseFloat;if("RangeError: test"!==String(new RangeError("test"))){var errorToStringShim=function toString(){if(null==this)throw new TypeError("can't convert "+this+" to object");var name=this.name;void 0===name?name="Error":"string"!=typeof name&&(name=$String(name));var msg=this.message;return void 0===msg?msg="":"string"!=typeof msg&&(msg=$String(msg)),name?msg?name+": "+msg:name:msg};Error.prototype.toString=errorToStringShim}if(supportsDescriptors){var ensureNonEnumerable=function(obj,prop){if(isEnum(obj,prop)){var desc=Object.getOwnPropertyDescriptor(obj,prop);desc.configurable&&(desc.enumerable=!1,Object.defineProperty(obj,prop,desc))}};ensureNonEnumerable(Error.prototype,"message"),""!==Error.prototype.message&&(Error.prototype.message=""),ensureNonEnumerable(Error.prototype,"name")}if("/a/gim"!==String(/a/gim)){var regexToString=function toString(){var str="/"+this.source+"/";return this.global&&(str+="g"),this.ignoreCase&&(str+="i"),this.multiline&&(str+="m"),str};RegExp.prototype.toString=regexToString}})?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__;!function(root,factory){"use strict";void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=function(){var defineGetter,defineSetter,lookupGetter,lookupSetter,call=Function.call,prototypeOfObject=Object.prototype,owns=call.bind(prototypeOfObject.hasOwnProperty),isEnumerable=call.bind(prototypeOfObject.propertyIsEnumerable),toStr=call.bind(prototypeOfObject.toString),supportsAccessors=owns(prototypeOfObject,"__defineGetter__");supportsAccessors&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__));var isPrimitive=function isPrimitive(o){return null==o||"object"!=typeof o&&"function"!=typeof o};Object.getPrototypeOf||(Object.getPrototypeOf=function getPrototypeOf(object){var proto=object.__proto__;return proto||null===proto?proto:"[object Function]"===toStr(object.constructor)?object.constructor.prototype:object instanceof Object?prototypeOfObject:null});var doesGetOwnPropertyDescriptorWork=function doesGetOwnPropertyDescriptorWork(object){try{return object.sentinel=0,0===Object.getOwnPropertyDescriptor(object,"sentinel").value}catch(exception){return!1}};if(Object.defineProperty){var getOwnPropertyDescriptorWorksOnObject=doesGetOwnPropertyDescriptorWork({});if(!("undefined"==typeof document||doesGetOwnPropertyDescriptorWork(document.createElement("div")))||!getOwnPropertyDescriptorWorksOnObject)var getOwnPropertyDescriptorFallback=Object.getOwnPropertyDescriptor}if(!Object.getOwnPropertyDescriptor||getOwnPropertyDescriptorFallback){Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(object,property){if(isPrimitive(object))throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+object);if(getOwnPropertyDescriptorFallback)try{return getOwnPropertyDescriptorFallback.call(Object,object,property)}catch(exception){}var descriptor;if(!owns(object,property))return descriptor;if(descriptor={enumerable:isEnumerable(object,property),configurable:!0},supportsAccessors){var prototype=object.__proto__,notPrototypeOfObject=object!==prototypeOfObject;notPrototypeOfObject&&(object.__proto__=prototypeOfObject);var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(notPrototypeOfObject&&(object.__proto__=prototype),getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor.writable=!0,descriptor}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function getOwnPropertyNames(object){return Object.keys(object)});if(!Object.create){var createEmpty;createEmpty=!({__proto__:null}instanceof Object)||"undefined"==typeof document?function(){return{__proto__:null}}:function(){var empty=function shouldUseActiveX(){if(!document.domain)return!1;try{return!!new ActiveXObject("htmlfile")}catch(exception){return!1}}()?function getEmptyViaActiveX(){var empty,xDoc;return(xDoc=new ActiveXObject("htmlfile")).write("<script><\/script>"),xDoc.close(),empty=xDoc.parentWindow.Object.prototype,xDoc=null,empty}():function getEmptyViaIFrame(){var empty,iframe=document.createElement("iframe"),parent=document.body||document.documentElement;return iframe.style.display="none",parent.appendChild(iframe),iframe.src="javascript:",empty=iframe.contentWindow.Object.prototype,parent.removeChild(iframe),iframe=null,empty}();delete empty.constructor,delete empty.hasOwnProperty,delete empty.propertyIsEnumerable,delete empty.isPrototypeOf,delete empty.toLocaleString,delete empty.toString,delete empty.valueOf;var Empty=function Empty(){};return Empty.prototype=empty,createEmpty=function(){return new Empty},new Empty},Object.create=function create(prototype,properties){var object,Type=function Type(){};if(null===prototype)object=createEmpty();else{if(null!==prototype&&isPrimitive(prototype))throw new TypeError("Object prototype may only be an Object or null");Type.prototype=prototype,(object=new Type).__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}var doesDefinePropertyWork=function doesDefinePropertyWork(object){try{return Object.defineProperty(object,"sentinel",{}),"sentinel"in object}catch(exception){return!1}};if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom="undefined"==typeof document||doesDefinePropertyWork(document.createElement("div"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty,definePropertiesFallback=Object.defineProperties}if(!Object.defineProperty||definePropertyFallback){Object.defineProperty=function defineProperty(object,property,descriptor){if(isPrimitive(object))throw new TypeError("Object.defineProperty called on non-object: "+object);if(isPrimitive(descriptor))throw new TypeError("Property description must be an object: "+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if("value"in descriptor)if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{var hasGetter="get"in descriptor,hasSetter="set"in descriptor;if(!supportsAccessors&&(hasGetter||hasSetter))throw new TypeError("getters & setters can not be defined on this javascript engine");hasGetter&&defineGetter(object,property,descriptor.get),hasSetter&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties&&!definePropertiesFallback||(Object.defineProperties=function defineProperties(object,properties){if(definePropertiesFallback)try{return definePropertiesFallback.call(Object,object,properties)}catch(exception){}return Object.keys(properties).forEach((function(property){"__proto__"!==property&&Object.defineProperty(object,property,properties[property])})),object});Object.seal||(Object.seal=function seal(object){if(Object(object)!==object)throw new TypeError("Object.seal can only be called on Objects.");return object});Object.freeze||(Object.freeze=function freeze(object){if(Object(object)!==object)throw new TypeError("Object.freeze can only be called on Objects.");return object});try{Object.freeze((function(){}))}catch(exception){Object.freeze=(freezeObject=Object.freeze,function freeze(object){return"function"==typeof object?object:freezeObject(object)})}var freezeObject;Object.preventExtensions||(Object.preventExtensions=function preventExtensions(object){if(Object(object)!==object)throw new TypeError("Object.preventExtensions can only be called on Objects.");return object});Object.isSealed||(Object.isSealed=function isSealed(object){if(Object(object)!==object)throw new TypeError("Object.isSealed can only be called on Objects.");return!1});Object.isFrozen||(Object.isFrozen=function isFrozen(object){if(Object(object)!==object)throw new TypeError("Object.isFrozen can only be called on Objects.");return!1});Object.isExtensible||(Object.isExtensible=function isExtensible(object){if(Object(object)!==object)throw new TypeError("Object.isExtensible can only be called on Objects.");for(var name="";owns(object,name);)name+="?";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue})})?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()},function(module,exports,__webpack_require__){"use strict";__webpack_require__(310),__webpack_require__(311)(),__webpack_require__(317)},function(module,exports,__webpack_require__){(function(global,process){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__;void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=function(){"use strict";var ArrayIterator,_apply=Function.call.bind(Function.apply),_call=Function.call.bind(Function.call),isArray=Array.isArray,keys=Object.keys,not=function notThunker(func){return function notThunk(){return!_apply(func,this,arguments)}},throwsError=function(func){try{return func(),!1}catch(e){return!0}},valueOrFalseIfThrows=function valueOrFalseIfThrows(func){try{return func()}catch(e){return!1}},isCallableWithoutNew=not(throwsError),arePropertyDescriptorsSupported=function(){return!throwsError((function(){return Object.defineProperty({},"x",{get:function(){}})}))},supportsDescriptors=!!Object.defineProperty&&arePropertyDescriptorsSupported(),functionsHaveNames="foo"===function foo(){}.name,_forEach=Function.call.bind(Array.prototype.forEach),_reduce=Function.call.bind(Array.prototype.reduce),_filter=Function.call.bind(Array.prototype.filter),_some=Function.call.bind(Array.prototype.some),defineProperty=function(object,name,value,force){!force&&name in object||(supportsDescriptors?Object.defineProperty(object,name,{configurable:!0,enumerable:!1,writable:!0,value:value}):object[name]=value)},defineProperties=function(object,map,forceOverride){_forEach(keys(map),(function(name){var method=map[name];defineProperty(object,name,method,!!forceOverride)}))},_toString=Function.call.bind(Object.prototype.toString),isCallable=function IsCallableFast(x){return"function"==typeof x},Value={getter:function(object,name,getter){if(!supportsDescriptors)throw new TypeError("getters require true ES5 support");Object.defineProperty(object,name,{configurable:!0,enumerable:!1,get:getter})},proxy:function(originalObject,key,targetObject){if(!supportsDescriptors)throw new TypeError("getters require true ES5 support");var originalDescriptor=Object.getOwnPropertyDescriptor(originalObject,key);Object.defineProperty(targetObject,key,{configurable:originalDescriptor.configurable,enumerable:originalDescriptor.enumerable,get:function getKey(){return originalObject[key]},set:function setKey(value){originalObject[key]=value}})},redefine:function(object,property,newValue){if(supportsDescriptors){var descriptor=Object.getOwnPropertyDescriptor(object,property);descriptor.value=newValue,Object.defineProperty(object,property,descriptor)}else object[property]=newValue},defineByDescriptor:function(object,property,descriptor){supportsDescriptors?Object.defineProperty(object,property,descriptor):"value"in descriptor&&(object[property]=descriptor.value)},preserveToString:function(target,source){source&&isCallable(source.toString)&&defineProperty(target,"toString",source.toString.bind(source),!0)}},create=Object.create||function(prototype,properties){var Prototype=function Prototype(){};Prototype.prototype=prototype;var object=new Prototype;return void 0!==properties&&keys(properties).forEach((function(key){Value.defineByDescriptor(object,key,properties[key])})),object},supportsSubclassing=function(C,f){return!!Object.setPrototypeOf&&valueOrFalseIfThrows((function(){var Sub=function Subclass(arg){var o=new C(arg);return Object.setPrototypeOf(o,Subclass.prototype),o};return Object.setPrototypeOf(Sub,C),Sub.prototype=create(C.prototype,{constructor:{value:Sub}}),f(Sub)}))},getGlobal=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==global)return global;throw new Error("unable to locate global object")},globals=getGlobal(),globalIsFinite=globals.isFinite,_indexOf=Function.call.bind(String.prototype.indexOf),_arrayIndexOfApply=Function.apply.bind(Array.prototype.indexOf),_concat=Function.call.bind(Array.prototype.concat),_strSlice=Function.call.bind(String.prototype.slice),_push=Function.call.bind(Array.prototype.push),_pushApply=Function.apply.bind(Array.prototype.push),_shift=Function.call.bind(Array.prototype.shift),_max=Math.max,_min=Math.min,_floor=Math.floor,_abs=Math.abs,_exp=Math.exp,_log=Math.log,_sqrt=Math.sqrt,_hasOwnProperty=Function.call.bind(Object.prototype.hasOwnProperty),noop=function(){},OrigMap=globals.Map,origMapDelete=OrigMap&&OrigMap.prototype.delete,origMapGet=OrigMap&&OrigMap.prototype.get,origMapHas=OrigMap&&OrigMap.prototype.has,origMapSet=OrigMap&&OrigMap.prototype.set,Symbol=globals.Symbol||{},symbolSpecies=Symbol.species||"@@species",numberIsNaN=Number.isNaN||function isNaN(value){return value!=value},numberIsFinite=Number.isFinite||function isFinite(value){return"number"==typeof value&&globalIsFinite(value)},_sign=isCallable(Math.sign)?Math.sign:function sign(value){var number=Number(value);return 0===number||numberIsNaN(number)?number:number<0?-1:1},_log1p=function log1p(value){var x=Number(value);return x<-1||numberIsNaN(x)?NaN:0===x||x===1/0?x:-1===x?-1/0:1+x-1==0?x:x*(_log(1+x)/(1+x-1))},isStandardArguments=function isArguments(value){return"[object Arguments]"===_toString(value)},isLegacyArguments=function isArguments(value){return null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&"[object Array]"!==_toString(value)&&"[object Function]"===_toString(value.callee)},isArguments=isStandardArguments(arguments)?isStandardArguments:isLegacyArguments,Type={primitive:function(x){return null===x||"function"!=typeof x&&"object"!=typeof x},string:function(x){return"[object String]"===_toString(x)},regex:function(x){return"[object RegExp]"===_toString(x)},symbol:function(x){return"function"==typeof globals.Symbol&&"symbol"==typeof x}},overrideNative=function overrideNative(object,property,replacement){var original=object[property];defineProperty(object,property,replacement,!0),Value.preserveToString(object[property],original)},hasSymbols="function"==typeof Symbol&&"function"==typeof Symbol.for&&Type.symbol(Symbol()),$iterator$=Type.symbol(Symbol.iterator)?Symbol.iterator:"_es6-shim iterator_";globals.Set&&"function"==typeof(new globals.Set)["@@iterator"]&&($iterator$="@@iterator"),globals.Reflect||defineProperty(globals,"Reflect",{},!0);var o,Reflect=globals.Reflect,$String=String,domAll="undefined"!=typeof document&&document?document.all:null,isNullOrUndefined=null==domAll?function isNullOrUndefined(x){return null==x}:function isNullOrUndefinedAndNotDocumentAll(x){return null==x&&x!==domAll},ES={Call:function Call(F,V){var args=arguments.length>2?arguments[2]:[];if(!ES.IsCallable(F))throw new TypeError(F+" is not a function");return _apply(F,V,args)},RequireObjectCoercible:function(x,optMessage){if(isNullOrUndefined(x))throw new TypeError(optMessage||"Cannot call method on "+x);return x},TypeIsObject:function(x){return null!=x&&!0!==x&&!1!==x&&("function"==typeof x||"object"==typeof x||x===domAll)},ToObject:function(o,optMessage){return Object(ES.RequireObjectCoercible(o,optMessage))},IsCallable:isCallable,IsConstructor:function(x){return ES.IsCallable(x)},ToInt32:function(x){return ES.ToNumber(x)>>0},ToUint32:function(x){return ES.ToNumber(x)>>>0},ToNumber:function(value){if("[object Symbol]"===_toString(value))throw new TypeError("Cannot convert a Symbol value to a number");return+value},ToInteger:function(value){var number=ES.ToNumber(value);return numberIsNaN(number)?0:0!==number&&numberIsFinite(number)?(number>0?1:-1)*_floor(_abs(number)):number},ToLength:function(value){var len=ES.ToInteger(value);return len<=0?0:len>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:len},SameValue:function(a,b){return a===b?0!==a||1/a==1/b:numberIsNaN(a)&&numberIsNaN(b)},SameValueZero:function(a,b){return a===b||numberIsNaN(a)&&numberIsNaN(b)},IsIterable:function(o){return ES.TypeIsObject(o)&&(void 0!==o[$iterator$]||isArguments(o))},GetIterator:function(o){if(isArguments(o))return new ArrayIterator(o,"value");var itFn=ES.GetMethod(o,$iterator$);if(!ES.IsCallable(itFn))throw new TypeError("value is not an iterable");var it=ES.Call(itFn,o);if(!ES.TypeIsObject(it))throw new TypeError("bad iterator");return it},GetMethod:function(o,p){var func=ES.ToObject(o)[p];if(!isNullOrUndefined(func)){if(!ES.IsCallable(func))throw new TypeError("Method not callable: "+p);return func}},IteratorComplete:function(iterResult){return!!iterResult.done},IteratorClose:function(iterator,completionIsThrow){var returnMethod=ES.GetMethod(iterator,"return");if(void 0!==returnMethod){var innerResult,innerException;try{innerResult=ES.Call(returnMethod,iterator)}catch(e){innerException=e}if(!completionIsThrow){if(innerException)throw innerException;if(!ES.TypeIsObject(innerResult))throw new TypeError("Iterator's return method returned a non-object.")}}},IteratorNext:function(it){var result=arguments.length>1?it.next(arguments[1]):it.next();if(!ES.TypeIsObject(result))throw new TypeError("bad iterator");return result},IteratorStep:function(it){var result=ES.IteratorNext(it);return!ES.IteratorComplete(result)&&result},Construct:function(C,args,newTarget,isES6internal){var target=void 0===newTarget?C:newTarget;if(!isES6internal&&Reflect.construct)return Reflect.construct(C,args,target);var proto=target.prototype;ES.TypeIsObject(proto)||(proto=Object.prototype);var obj=create(proto),result=ES.Call(C,obj,args);return ES.TypeIsObject(result)?result:obj},SpeciesConstructor:function(O,defaultConstructor){var C=O.constructor;if(void 0===C)return defaultConstructor;if(!ES.TypeIsObject(C))throw new TypeError("Bad constructor");var S=C[symbolSpecies];if(isNullOrUndefined(S))return defaultConstructor;if(!ES.IsConstructor(S))throw new TypeError("Bad @@species");return S},CreateHTML:function(string,tag,attribute,value){var S=ES.ToString(string),p1="<"+tag;return""!==attribute&&(p1+=" "+attribute+'="'+ES.ToString(value).replace(/"/g,""")+'"'),p1+">"+S+"</"+tag+">"},IsRegExp:function IsRegExp(argument){if(!ES.TypeIsObject(argument))return!1;var isRegExp=argument[Symbol.match];return void 0!==isRegExp?!!isRegExp:Type.regex(argument)},ToString:function ToString(string){return $String(string)}};if(supportsDescriptors&&hasSymbols){var defineWellKnownSymbol=function defineWellKnownSymbol(name){if(Type.symbol(Symbol[name]))return Symbol[name];var sym=Symbol.for("Symbol."+name);return Object.defineProperty(Symbol,name,{configurable:!1,enumerable:!1,writable:!1,value:sym}),sym};if(!Type.symbol(Symbol.search)){var symbolSearch=defineWellKnownSymbol("search"),originalSearch=String.prototype.search;defineProperty(RegExp.prototype,symbolSearch,(function search(string){return ES.Call(originalSearch,string,[this])}));var searchShim=function search(regexp){var O=ES.RequireObjectCoercible(this);if(!isNullOrUndefined(regexp)){var searcher=ES.GetMethod(regexp,symbolSearch);if(void 0!==searcher)return ES.Call(searcher,regexp,[O])}return ES.Call(originalSearch,O,[ES.ToString(regexp)])};overrideNative(String.prototype,"search",searchShim)}if(!Type.symbol(Symbol.replace)){var symbolReplace=defineWellKnownSymbol("replace"),originalReplace=String.prototype.replace;defineProperty(RegExp.prototype,symbolReplace,(function replace(string,replaceValue){return ES.Call(originalReplace,string,[this,replaceValue])}));var replaceShim=function replace(searchValue,replaceValue){var O=ES.RequireObjectCoercible(this);if(!isNullOrUndefined(searchValue)){var replacer=ES.GetMethod(searchValue,symbolReplace);if(void 0!==replacer)return ES.Call(replacer,searchValue,[O,replaceValue])}return ES.Call(originalReplace,O,[ES.ToString(searchValue),replaceValue])};overrideNative(String.prototype,"replace",replaceShim)}if(!Type.symbol(Symbol.split)){var symbolSplit=defineWellKnownSymbol("split"),originalSplit=String.prototype.split;defineProperty(RegExp.prototype,symbolSplit,(function split(string,limit){return ES.Call(originalSplit,string,[this,limit])}));var splitShim=function split(separator,limit){var O=ES.RequireObjectCoercible(this);if(!isNullOrUndefined(separator)){var splitter=ES.GetMethod(separator,symbolSplit);if(void 0!==splitter)return ES.Call(splitter,separator,[O,limit])}return ES.Call(originalSplit,O,[ES.ToString(separator),limit])};overrideNative(String.prototype,"split",splitShim)}var symbolMatchExists=Type.symbol(Symbol.match),stringMatchIgnoresSymbolMatch=symbolMatchExists&&((o={})[Symbol.match]=function(){return 42},42!=="a".match(o));if(!symbolMatchExists||stringMatchIgnoresSymbolMatch){var symbolMatch=defineWellKnownSymbol("match"),originalMatch=String.prototype.match;defineProperty(RegExp.prototype,symbolMatch,(function match(string){return ES.Call(originalMatch,string,[this])}));var matchShim=function match(regexp){var O=ES.RequireObjectCoercible(this);if(!isNullOrUndefined(regexp)){var matcher=ES.GetMethod(regexp,symbolMatch);if(void 0!==matcher)return ES.Call(matcher,regexp,[O])}return ES.Call(originalMatch,O,[ES.ToString(regexp)])};overrideNative(String.prototype,"match",matchShim)}}var wrapConstructor=function wrapConstructor(original,replacement,keysToSkip){Value.preserveToString(replacement,original),Object.setPrototypeOf&&Object.setPrototypeOf(original,replacement),supportsDescriptors?_forEach(Object.getOwnPropertyNames(original),(function(key){key in noop||keysToSkip[key]||Value.proxy(original,key,replacement)})):_forEach(Object.keys(original),(function(key){key in noop||keysToSkip[key]||(replacement[key]=original[key])})),replacement.prototype=original.prototype,Value.redefine(original.prototype,"constructor",replacement)},defaultSpeciesGetter=function(){return this},addDefaultSpecies=function(C){supportsDescriptors&&!_hasOwnProperty(C,symbolSpecies)&&Value.getter(C,symbolSpecies,defaultSpeciesGetter)},addIterator=function(prototype,impl){var implementation=impl||function iterator(){return this};defineProperty(prototype,$iterator$,implementation),!prototype[$iterator$]&&Type.symbol($iterator$)&&(prototype[$iterator$]=implementation)},createDataProperty=function createDataProperty(object,name,value){supportsDescriptors?Object.defineProperty(object,name,{configurable:!0,enumerable:!0,writable:!0,value:value}):object[name]=value},createDataPropertyOrThrow=function createDataPropertyOrThrow(object,name,value){if(createDataProperty(object,name,value),!ES.SameValue(object[name],value))throw new TypeError("property is nonconfigurable")},emulateES6construct=function(o,defaultNewTarget,defaultProto,slots){if(!ES.TypeIsObject(o))throw new TypeError("Constructor requires `new`: "+defaultNewTarget.name);var proto=defaultNewTarget.prototype;ES.TypeIsObject(proto)||(proto=defaultProto);var obj=create(proto);for(var name in slots)if(_hasOwnProperty(slots,name)){var value=slots[name];defineProperty(obj,name,value,!0)}return obj};if(String.fromCodePoint&&1!==String.fromCodePoint.length){var originalFromCodePoint=String.fromCodePoint;overrideNative(String,"fromCodePoint",(function fromCodePoint(codePoints){return ES.Call(originalFromCodePoint,this,arguments)}))}var StringShims={fromCodePoint:function fromCodePoint(codePoints){for(var next,result=[],i=0,length=arguments.length;i<length;i++){if(next=Number(arguments[i]),!ES.SameValue(next,ES.ToInteger(next))||next<0||next>1114111)throw new RangeError("Invalid code point "+next);next<65536?_push(result,String.fromCharCode(next)):(next-=65536,_push(result,String.fromCharCode(55296+(next>>10))),_push(result,String.fromCharCode(next%1024+56320)))}return result.join("")},raw:function raw(callSite){var cooked=ES.ToObject(callSite,"bad callSite"),rawString=ES.ToObject(cooked.raw,"bad raw value"),len=rawString.length,literalsegments=ES.ToLength(len);if(literalsegments<=0)return"";for(var nextKey,next,nextSeg,nextSub,stringElements=[],nextIndex=0;nextIndex<literalsegments&&(nextKey=ES.ToString(nextIndex),nextSeg=ES.ToString(rawString[nextKey]),_push(stringElements,nextSeg),!(nextIndex+1>=literalsegments));)next=nextIndex+1<arguments.length?arguments[nextIndex+1]:"",nextSub=ES.ToString(next),_push(stringElements,nextSub),nextIndex+=1;return stringElements.join("")}};String.raw&&"xy"!==String.raw({raw:{0:"x",1:"y",length:2}})&&overrideNative(String,"raw",StringShims.raw),defineProperties(String,StringShims);var stringRepeat=function repeat(s,times){if(times<1)return"";if(times%2)return repeat(s,times-1)+s;var half=repeat(s,times/2);return half+half},stringMaxLength=1/0,StringPrototypeShims={repeat:function repeat(times){var thisStr=ES.ToString(ES.RequireObjectCoercible(this)),numTimes=ES.ToInteger(times);if(numTimes<0||numTimes>=stringMaxLength)throw new RangeError("repeat count must be less than infinity and not overflow maximum string size");return stringRepeat(thisStr,numTimes)},startsWith:function startsWith(searchString){var S=ES.ToString(ES.RequireObjectCoercible(this));if(ES.IsRegExp(searchString))throw new TypeError('Cannot call method "startsWith" with a regex');var position,searchStr=ES.ToString(searchString);arguments.length>1&&(position=arguments[1]);var start=_max(ES.ToInteger(position),0);return _strSlice(S,start,start+searchStr.length)===searchStr},endsWith:function endsWith(searchString){var S=ES.ToString(ES.RequireObjectCoercible(this));if(ES.IsRegExp(searchString))throw new TypeError('Cannot call method "endsWith" with a regex');var endPosition,searchStr=ES.ToString(searchString),len=S.length;arguments.length>1&&(endPosition=arguments[1]);var pos=void 0===endPosition?len:ES.ToInteger(endPosition),end=_min(_max(pos,0),len);return _strSlice(S,end-searchStr.length,end)===searchStr},includes:function includes(searchString){if(ES.IsRegExp(searchString))throw new TypeError('"includes" does not accept a RegExp');var position,searchStr=ES.ToString(searchString);return arguments.length>1&&(position=arguments[1]),-1!==_indexOf(this,searchStr,position)},codePointAt:function codePointAt(pos){var thisStr=ES.ToString(ES.RequireObjectCoercible(this)),position=ES.ToInteger(pos),length=thisStr.length;if(position>=0&&position<length){var first=thisStr.charCodeAt(position);if(first<55296||first>56319||position+1===length)return first;var second=thisStr.charCodeAt(position+1);return second<56320||second>57343?first:1024*(first-55296)+(second-56320)+65536}}};if(String.prototype.includes&&!1!=="a".includes("a",1/0)&&overrideNative(String.prototype,"includes",StringPrototypeShims.includes),String.prototype.startsWith&&String.prototype.endsWith){var startsWithRejectsRegex=throwsError((function(){return"/a/".startsWith(/a/)})),startsWithHandlesInfinity=valueOrFalseIfThrows((function(){return!1==="abc".startsWith("a",1/0)}));startsWithRejectsRegex&&startsWithHandlesInfinity||(overrideNative(String.prototype,"startsWith",StringPrototypeShims.startsWith),overrideNative(String.prototype,"endsWith",StringPrototypeShims.endsWith))}if(hasSymbols){var startsWithSupportsSymbolMatch=valueOrFalseIfThrows((function(){var re=/a/;return re[Symbol.match]=!1,"/a/".startsWith(re)}));startsWithSupportsSymbolMatch||overrideNative(String.prototype,"startsWith",StringPrototypeShims.startsWith);var endsWithSupportsSymbolMatch=valueOrFalseIfThrows((function(){var re=/a/;return re[Symbol.match]=!1,"/a/".endsWith(re)}));endsWithSupportsSymbolMatch||overrideNative(String.prototype,"endsWith",StringPrototypeShims.endsWith);var includesSupportsSymbolMatch=valueOrFalseIfThrows((function(){var re=/a/;return re[Symbol.match]=!1,"/a/".includes(re)}));includesSupportsSymbolMatch||overrideNative(String.prototype,"includes",StringPrototypeShims.includes)}defineProperties(String.prototype,StringPrototypeShims);var ws=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),trimRegexp=new RegExp("(^["+ws+"]+)|(["+ws+"]+$)","g"),trimShim=function trim(){return ES.ToString(ES.RequireObjectCoercible(this)).replace(trimRegexp,"")},nonWS=["
","",""].join(""),nonWSregex=new RegExp("["+nonWS+"]","g"),isBadHexRegex=/^[-+]0x[0-9a-f]+$/i,hasStringTrimBug=nonWS.trim().length!==nonWS.length;defineProperty(String.prototype,"trim",trimShim,hasStringTrimBug);var iteratorResult=function(x){return{value:x,done:0===arguments.length}},StringIterator=function(s){ES.RequireObjectCoercible(s),this._s=ES.ToString(s),this._i=0};StringIterator.prototype.next=function(){var s=this._s,i=this._i;if(void 0===s||i>=s.length)return this._s=void 0,iteratorResult();var second,len,first=s.charCodeAt(i);return len=first<55296||first>56319||i+1===s.length||(second=s.charCodeAt(i+1))<56320||second>57343?1:2,this._i=i+len,iteratorResult(s.substr(i,len))},addIterator(StringIterator.prototype),addIterator(String.prototype,(function(){return new StringIterator(this)}));var ArrayShims={from:function from(items){var mapFn,mapping,T,C=this;if(arguments.length>1&&(mapFn=arguments[1]),void 0===mapFn)mapping=!1;else{if(!ES.IsCallable(mapFn))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(T=arguments[2]),mapping=!0}var length,result,i,usingIterator=void 0!==(isArguments(items)||ES.GetMethod(items,$iterator$));if(usingIterator){result=ES.IsConstructor(C)?Object(new C):[];var next,nextValue,iterator=ES.GetIterator(items);for(i=0;!1!==(next=ES.IteratorStep(iterator));){nextValue=next.value;try{mapping&&(nextValue=void 0===T?mapFn(nextValue,i):_call(mapFn,T,nextValue,i)),result[i]=nextValue}catch(e){throw ES.IteratorClose(iterator,!0),e}i+=1}length=i}else{var value,arrayLike=ES.ToObject(items);for(length=ES.ToLength(arrayLike.length),result=ES.IsConstructor(C)?Object(new C(length)):new Array(length),i=0;i<length;++i)value=arrayLike[i],mapping&&(value=void 0===T?mapFn(value,i):_call(mapFn,T,value,i)),createDataPropertyOrThrow(result,i,value)}return result.length=length,result},of:function of(){for(var len=arguments.length,C=this,A=isArray(C)||!ES.IsCallable(C)?new Array(len):ES.Construct(C,[len]),k=0;k<len;++k)createDataPropertyOrThrow(A,k,arguments[k]);return A.length=len,A}};defineProperties(Array,ArrayShims),addDefaultSpecies(Array),defineProperties((ArrayIterator=function(array,kind){this.i=0,this.array=array,this.kind=kind}).prototype,{next:function(){var i=this.i,array=this.array;if(!(this instanceof ArrayIterator))throw new TypeError("Not an ArrayIterator");if(void 0!==array)for(var len=ES.ToLength(array.length);i<len;i++){var retval,kind=this.kind;return"key"===kind?retval=i:"value"===kind?retval=array[i]:"entry"===kind&&(retval=[i,array[i]]),this.i=i+1,iteratorResult(retval)}return this.array=void 0,iteratorResult()}}),addIterator(ArrayIterator.prototype);var arrayOfSupportsSubclassing=Array.of===ArrayShims.of||function(){var Foo=function Foo(len){this.length=len};Foo.prototype=[];var fooArr=Array.of.apply(Foo,[1,2]);return fooArr instanceof Foo&&2===fooArr.length}();arrayOfSupportsSubclassing||overrideNative(Array,"of",ArrayShims.of);var ArrayPrototypeShims={copyWithin:function copyWithin(target,start){var end,o=ES.ToObject(this),len=ES.ToLength(o.length),relativeTarget=ES.ToInteger(target),relativeStart=ES.ToInteger(start),to=relativeTarget<0?_max(len+relativeTarget,0):_min(relativeTarget,len),from=relativeStart<0?_max(len+relativeStart,0):_min(relativeStart,len);arguments.length>2&&(end=arguments[2]);var relativeEnd=void 0===end?len:ES.ToInteger(end),finalItem=relativeEnd<0?_max(len+relativeEnd,0):_min(relativeEnd,len),count=_min(finalItem-from,len-to),direction=1;for(from<to&&to<from+count&&(direction=-1,from+=count-1,to+=count-1);count>0;)from in o?o[to]=o[from]:delete o[to],from+=direction,to+=direction,count-=1;return o},fill:function fill(value){var start,end;arguments.length>1&&(start=arguments[1]),arguments.length>2&&(end=arguments[2]);var O=ES.ToObject(this),len=ES.ToLength(O.length);start=ES.ToInteger(void 0===start?0:start),end=ES.ToInteger(void 0===end?len:end);for(var relativeStart=start<0?_max(len+start,0):_min(start,len),relativeEnd=end<0?len+end:end,i=relativeStart;i<len&&i<relativeEnd;++i)O[i]=value;return O},find:function find(predicate){var list=ES.ToObject(this),length=ES.ToLength(list.length);if(!ES.IsCallable(predicate))throw new TypeError("Array#find: predicate must be a function");for(var value,thisArg=arguments.length>1?arguments[1]:null,i=0;i<length;i++)if(value=list[i],thisArg){if(_call(predicate,thisArg,value,i,list))return value}else if(predicate(value,i,list))return value},findIndex:function findIndex(predicate){var list=ES.ToObject(this),length=ES.ToLength(list.length);if(!ES.IsCallable(predicate))throw new TypeError("Array#findIndex: predicate must be a function");for(var thisArg=arguments.length>1?arguments[1]:null,i=0;i<length;i++)if(thisArg){if(_call(predicate,thisArg,list[i],i,list))return i}else if(predicate(list[i],i,list))return i;return-1},keys:function keys(){return new ArrayIterator(this,"key")},values:function values(){return new ArrayIterator(this,"value")},entries:function entries(){return new ArrayIterator(this,"entry")}};if(Array.prototype.keys&&!ES.IsCallable([1].keys().next)&&delete Array.prototype.keys,Array.prototype.entries&&!ES.IsCallable([1].entries().next)&&delete Array.prototype.entries,Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[$iterator$]&&(defineProperties(Array.prototype,{values:Array.prototype[$iterator$]}),Type.symbol(Symbol.unscopables)&&(Array.prototype[Symbol.unscopables].values=!0)),functionsHaveNames&&Array.prototype.values&&"values"!==Array.prototype.values.name){var originalArrayPrototypeValues=Array.prototype.values;overrideNative(Array.prototype,"values",(function values(){return ES.Call(originalArrayPrototypeValues,this,arguments)})),defineProperty(Array.prototype,$iterator$,Array.prototype.values,!0)}defineProperties(Array.prototype,ArrayPrototypeShims),1/[!0].indexOf(!0,-0)<0&&defineProperty(Array.prototype,"indexOf",(function indexOf(searchElement){var value=_arrayIndexOfApply(this,arguments);return 0===value&&1/value<0?0:value}),!0),addIterator(Array.prototype,(function(){return this.values()})),Object.getPrototypeOf&&addIterator(Object.getPrototypeOf([].values()));var arr,arrayFromSwallowsNegativeLengths=valueOrFalseIfThrows((function(){return 0===Array.from({length:-1}).length})),arrayFromHandlesIterables=1===(arr=Array.from([0].entries())).length&&isArray(arr[0])&&0===arr[0][0]&&0===arr[0][1];arrayFromSwallowsNegativeLengths&&arrayFromHandlesIterables||overrideNative(Array,"from",ArrayShims.from);var arrayFromHandlesUndefinedMapFunction=valueOrFalseIfThrows((function(){return Array.from([0],void 0)}));if(!arrayFromHandlesUndefinedMapFunction){var origArrayFrom=Array.from;overrideNative(Array,"from",(function from(items){return arguments.length>1&&void 0!==arguments[1]?ES.Call(origArrayFrom,this,arguments):_call(origArrayFrom,this,items)}))}var int32sAsOne=-(Math.pow(2,32)-1),toLengthsCorrectly=function(method,reversed){var obj={length:int32sAsOne};return obj[reversed?(obj.length>>>0)-1:0]=!0,valueOrFalseIfThrows((function(){return _call(method,obj,(function(){throw new RangeError("should not reach here")}),[]),!0}))};if(!toLengthsCorrectly(Array.prototype.forEach)){var originalForEach=Array.prototype.forEach;overrideNative(Array.prototype,"forEach",(function forEach(callbackFn){return ES.Call(originalForEach,this.length>=0?this:[],arguments)}),!0)}if(!toLengthsCorrectly(Array.prototype.map)){var originalMap=Array.prototype.map;overrideNative(Array.prototype,"map",(function map(callbackFn){return ES.Call(originalMap,this.length>=0?this:[],arguments)}),!0)}if(!toLengthsCorrectly(Array.prototype.filter)){var originalFilter=Array.prototype.filter;overrideNative(Array.prototype,"filter",(function filter(callbackFn){return ES.Call(originalFilter,this.length>=0?this:[],arguments)}),!0)}if(!toLengthsCorrectly(Array.prototype.some)){var originalSome=Array.prototype.some;overrideNative(Array.prototype,"some",(function some(callbackFn){return ES.Call(originalSome,this.length>=0?this:[],arguments)}),!0)}if(!toLengthsCorrectly(Array.prototype.every)){var originalEvery=Array.prototype.every;overrideNative(Array.prototype,"every",(function every(callbackFn){return ES.Call(originalEvery,this.length>=0?this:[],arguments)}),!0)}if(!toLengthsCorrectly(Array.prototype.reduce)){var originalReduce=Array.prototype.reduce;overrideNative(Array.prototype,"reduce",(function reduce(callbackFn){return ES.Call(originalReduce,this.length>=0?this:[],arguments)}),!0)}if(!toLengthsCorrectly(Array.prototype.reduceRight,!0)){var originalReduceRight=Array.prototype.reduceRight;overrideNative(Array.prototype,"reduceRight",(function reduceRight(callbackFn){return ES.Call(originalReduceRight,this.length>=0?this:[],arguments)}),!0)}var lacksOctalSupport=8!==Number("0o10"),lacksBinarySupport=2!==Number("0b10"),trimsNonWhitespace=_some(nonWS,(function(c){return 0===Number(c+0+c)}));if(lacksOctalSupport||lacksBinarySupport||trimsNonWhitespace){var OrigNumber=Number,binaryRegex=/^0b[01]+$/i,octalRegex=/^0o[0-7]+$/i,isBinary=binaryRegex.test.bind(binaryRegex),isOctal=octalRegex.test.bind(octalRegex),toPrimitive=function(O){var result;if("function"==typeof O.valueOf&&(result=O.valueOf(),Type.primitive(result)))return result;if("function"==typeof O.toString&&(result=O.toString(),Type.primitive(result)))return result;throw new TypeError("No default value")},hasNonWS=nonWSregex.test.bind(nonWSregex),isBadHex=isBadHexRegex.test.bind(isBadHexRegex),NumberShim=function(){var NumberShim=function Number(value){var primValue;"string"==typeof(primValue=arguments.length>0?Type.primitive(value)?value:toPrimitive(value,"number"):0)&&(primValue=ES.Call(trimShim,primValue),isBinary(primValue)?primValue=parseInt(_strSlice(primValue,2),2):isOctal(primValue)?primValue=parseInt(_strSlice(primValue,2),8):(hasNonWS(primValue)||isBadHex(primValue))&&(primValue=NaN));var receiver=this,valueOfSucceeds=valueOrFalseIfThrows((function(){return OrigNumber.prototype.valueOf.call(receiver),!0}));return receiver instanceof NumberShim&&!valueOfSucceeds?new OrigNumber(primValue):OrigNumber(primValue)};return NumberShim}();wrapConstructor(OrigNumber,NumberShim,{}),defineProperties(NumberShim,{NaN:OrigNumber.NaN,MAX_VALUE:OrigNumber.MAX_VALUE,MIN_VALUE:OrigNumber.MIN_VALUE,NEGATIVE_INFINITY:OrigNumber.NEGATIVE_INFINITY,POSITIVE_INFINITY:OrigNumber.POSITIVE_INFINITY}),Number=NumberShim,Value.redefine(globals,"Number",NumberShim)}var maxSafeInteger=Math.pow(2,53)-1;defineProperties(Number,{MAX_SAFE_INTEGER:maxSafeInteger,MIN_SAFE_INTEGER:-maxSafeInteger,EPSILON:2220446049250313e-31,parseInt:globals.parseInt,parseFloat:globals.parseFloat,isFinite:numberIsFinite,isInteger:function isInteger(value){return numberIsFinite(value)&&ES.ToInteger(value)===value},isSafeInteger:function isSafeInteger(value){return Number.isInteger(value)&&_abs(value)<=Number.MAX_SAFE_INTEGER},isNaN:numberIsNaN}),defineProperty(Number,"parseInt",globals.parseInt,Number.parseInt!==globals.parseInt),1===[,1].find((function(){return!0}))&&overrideNative(Array.prototype,"find",ArrayPrototypeShims.find),0!==[,1].findIndex((function(){return!0}))&&overrideNative(Array.prototype,"findIndex",ArrayPrototypeShims.findIndex);var FAKENULL,gpo,spo,isEnumerableOn=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable),ensureEnumerable=function ensureEnumerable(obj,prop){supportsDescriptors&&isEnumerableOn(obj,prop)&&Object.defineProperty(obj,prop,{enumerable:!1})},sliceArgs=function sliceArgs(){for(var initial=Number(this),len=arguments.length,desiredArgCount=len-initial,args=new Array(desiredArgCount<0?0:desiredArgCount),i=initial;i<len;++i)args[i-initial]=arguments[i];return args},assignTo=function assignTo(source){return function assignToSource(target,key){return target[key]=source[key],target}},assignReducer=function(target,source){var symbols,sourceKeys=keys(Object(source));return ES.IsCallable(Object.getOwnPropertySymbols)&&(symbols=_filter(Object.getOwnPropertySymbols(Object(source)),isEnumerableOn(source))),_reduce(_concat(sourceKeys,symbols||[]),assignTo(source),target)},ObjectShims={assign:function(target,source){var to=ES.ToObject(target,"Cannot convert undefined or null to object");return _reduce(ES.Call(sliceArgs,1,arguments),assignReducer,to)},is:function is(a,b){return ES.SameValue(a,b)}},assignHasPendingExceptions=Object.assign&&Object.preventExtensions&&function(){var thrower=Object.preventExtensions({1:2});try{Object.assign(thrower,"xy")}catch(e){return"y"===thrower[1]}}();if(assignHasPendingExceptions&&overrideNative(Object,"assign",ObjectShims.assign),defineProperties(Object,ObjectShims),supportsDescriptors){var ES5ObjectShims={setPrototypeOf:function(Object,magic){var set,setPrototypeOf=function(O,proto){return function(O,proto){if(!ES.TypeIsObject(O))throw new TypeError("cannot set prototype on a non-object");if(null!==proto&&!ES.TypeIsObject(proto))throw new TypeError("can only set prototype to an object or null"+proto)}(O,proto),_call(set,O,proto),O};try{set=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,_call(set,{},null)}catch(e){if(Object.prototype!=={}.__proto__)return;set=function(proto){this.__proto__=proto},setPrototypeOf.polyfill=setPrototypeOf(setPrototypeOf({},null),Object.prototype)instanceof Object}return setPrototypeOf}(Object)};defineProperties(Object,ES5ObjectShims)}Object.setPrototypeOf&&Object.getPrototypeOf&&null!==Object.getPrototypeOf(Object.setPrototypeOf({},null))&&null===Object.getPrototypeOf(Object.create(null))&&(FAKENULL=Object.create(null),gpo=Object.getPrototypeOf,spo=Object.setPrototypeOf,Object.getPrototypeOf=function(o){var result=gpo(o);return result===FAKENULL?null:result},Object.setPrototypeOf=function(o,p){return spo(o,null===p?FAKENULL:p)},Object.setPrototypeOf.polyfill=!1);var objectKeysAcceptsPrimitives=!throwsError((function(){return Object.keys("foo")}));if(!objectKeysAcceptsPrimitives){var originalObjectKeys=Object.keys;overrideNative(Object,"keys",(function keys(value){return originalObjectKeys(ES.ToObject(value))})),keys=Object.keys}var objectKeysRejectsRegex=throwsError((function(){return Object.keys(/a/g)}));if(objectKeysRejectsRegex){var regexRejectingObjectKeys=Object.keys;overrideNative(Object,"keys",(function keys(value){if(Type.regex(value)){var regexKeys=[];for(var k in value)_hasOwnProperty(value,k)&&_push(regexKeys,k);return regexKeys}return regexRejectingObjectKeys(value)})),keys=Object.keys}if(Object.getOwnPropertyNames){var objectGOPNAcceptsPrimitives=!throwsError((function(){return Object.getOwnPropertyNames("foo")}));if(!objectGOPNAcceptsPrimitives){var cachedWindowNames="object"==typeof window?Object.getOwnPropertyNames(window):[],originalObjectGetOwnPropertyNames=Object.getOwnPropertyNames;overrideNative(Object,"getOwnPropertyNames",(function getOwnPropertyNames(value){var val=ES.ToObject(value);if("[object Window]"===_toString(val))try{return originalObjectGetOwnPropertyNames(val)}catch(e){return _concat([],cachedWindowNames)}return originalObjectGetOwnPropertyNames(val)}))}}if(Object.getOwnPropertyDescriptor){var objectGOPDAcceptsPrimitives=!throwsError((function(){return Object.getOwnPropertyDescriptor("foo","bar")}));if(!objectGOPDAcceptsPrimitives){var originalObjectGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;overrideNative(Object,"getOwnPropertyDescriptor",(function getOwnPropertyDescriptor(value,property){return originalObjectGetOwnPropertyDescriptor(ES.ToObject(value),property)}))}}if(Object.seal){var objectSealAcceptsPrimitives=!throwsError((function(){return Object.seal("foo")}));if(!objectSealAcceptsPrimitives){var originalObjectSeal=Object.seal;overrideNative(Object,"seal",(function seal(value){return ES.TypeIsObject(value)?originalObjectSeal(value):value}))}}if(Object.isSealed){var objectIsSealedAcceptsPrimitives=!throwsError((function(){return Object.isSealed("foo")}));if(!objectIsSealedAcceptsPrimitives){var originalObjectIsSealed=Object.isSealed;overrideNative(Object,"isSealed",(function isSealed(value){return!ES.TypeIsObject(value)||originalObjectIsSealed(value)}))}}if(Object.freeze){var objectFreezeAcceptsPrimitives=!throwsError((function(){return Object.freeze("foo")}));if(!objectFreezeAcceptsPrimitives){var originalObjectFreeze=Object.freeze;overrideNative(Object,"freeze",(function freeze(value){return ES.TypeIsObject(value)?originalObjectFreeze(value):value}))}}if(Object.isFrozen){var objectIsFrozenAcceptsPrimitives=!throwsError((function(){return Object.isFrozen("foo")}));if(!objectIsFrozenAcceptsPrimitives){var originalObjectIsFrozen=Object.isFrozen;overrideNative(Object,"isFrozen",(function isFrozen(value){return!ES.TypeIsObject(value)||originalObjectIsFrozen(value)}))}}if(Object.preventExtensions){var objectPreventExtensionsAcceptsPrimitives=!throwsError((function(){return Object.preventExtensions("foo")}));if(!objectPreventExtensionsAcceptsPrimitives){var originalObjectPreventExtensions=Object.preventExtensions;overrideNative(Object,"preventExtensions",(function preventExtensions(value){return ES.TypeIsObject(value)?originalObjectPreventExtensions(value):value}))}}if(Object.isExtensible){var objectIsExtensibleAcceptsPrimitives=!throwsError((function(){return Object.isExtensible("foo")}));if(!objectIsExtensibleAcceptsPrimitives){var originalObjectIsExtensible=Object.isExtensible;overrideNative(Object,"isExtensible",(function isExtensible(value){return!!ES.TypeIsObject(value)&&originalObjectIsExtensible(value)}))}}if(Object.getPrototypeOf){var objectGetProtoAcceptsPrimitives=!throwsError((function(){return Object.getPrototypeOf("foo")}));if(!objectGetProtoAcceptsPrimitives){var originalGetProto=Object.getPrototypeOf;overrideNative(Object,"getPrototypeOf",(function getPrototypeOf(value){return originalGetProto(ES.ToObject(value))}))}}var desc,hasFlags=supportsDescriptors&&((desc=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))&&ES.IsCallable(desc.get));if(supportsDescriptors&&!hasFlags){var regExpFlagsGetter=function flags(){if(!ES.TypeIsObject(this))throw new TypeError("Method called on incompatible type: must be an object.");var result="";return this.global&&(result+="g"),this.ignoreCase&&(result+="i"),this.multiline&&(result+="m"),this.unicode&&(result+="u"),this.sticky&&(result+="y"),result};Value.getter(RegExp.prototype,"flags",regExpFlagsGetter)}var regex,regExpSupportsFlagsWithRegex=supportsDescriptors&&valueOrFalseIfThrows((function(){return"/a/i"===String(new RegExp(/a/g,"i"))})),regExpNeedsToSupportSymbolMatch=hasSymbols&&supportsDescriptors&&((regex=/./)[Symbol.match]=!1,RegExp(regex)===regex),regexToStringIsGeneric=valueOrFalseIfThrows((function(){return"/abc/"===RegExp.prototype.toString.call({source:"abc"})})),regexToStringSupportsGenericFlags=regexToStringIsGeneric&&valueOrFalseIfThrows((function(){return"/a/b"===RegExp.prototype.toString.call({source:"a",flags:"b"})}));if(!regexToStringIsGeneric||!regexToStringSupportsGenericFlags){var origRegExpToString=RegExp.prototype.toString;defineProperty(RegExp.prototype,"toString",(function toString(){var R=ES.RequireObjectCoercible(this);return Type.regex(R)?_call(origRegExpToString,R):"/"+$String(R.source)+"/"+$String(R.flags)}),!0),Value.preserveToString(RegExp.prototype.toString,origRegExpToString)}if(supportsDescriptors&&(!regExpSupportsFlagsWithRegex||regExpNeedsToSupportSymbolMatch)){var flagsGetter=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get,sourceDesc=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")||{},legacySourceGetter=function(){return this.source},sourceGetter=ES.IsCallable(sourceDesc.get)?sourceDesc.get:legacySourceGetter,OrigRegExp=RegExp,RegExpShim=function RegExp(pattern,flags){var patternIsRegExp=ES.IsRegExp(pattern);return this instanceof RegExp||!patternIsRegExp||void 0!==flags||pattern.constructor!==RegExp?Type.regex(pattern)?new RegExp(ES.Call(sourceGetter,pattern),void 0===flags?ES.Call(flagsGetter,pattern):flags):(patternIsRegExp&&(pattern.source,void 0===flags&&pattern.flags),new OrigRegExp(pattern,flags)):pattern};wrapConstructor(OrigRegExp,RegExpShim,{$input:!0}),RegExp=RegExpShim,Value.redefine(globals,"RegExp",RegExpShim)}if(supportsDescriptors){var regexGlobals={input:"$_",lastMatch:"$&",lastParen:"$+",leftContext:"$`",rightContext:"$'"};_forEach(keys(regexGlobals),(function(prop){prop in RegExp&&!(regexGlobals[prop]in RegExp)&&Value.getter(RegExp,regexGlobals[prop],(function get(){return RegExp[prop]}))}))}addDefaultSpecies(RegExp);var inverseEpsilon=1/Number.EPSILON,roundTiesToEven=function roundTiesToEven(n){return n+inverseEpsilon-inverseEpsilon},BINARY_32_EPSILON=Math.pow(2,-23),BINARY_32_MAX_VALUE=Math.pow(2,127)*(2-BINARY_32_EPSILON),BINARY_32_MIN_VALUE=Math.pow(2,-126),E=Math.E,LOG2E=Math.LOG2E,LOG10E=Math.LOG10E,numberCLZ=Number.prototype.clz;delete Number.prototype.clz;var MathShims={acosh:function acosh(value){var x=Number(value);if(numberIsNaN(x)||value<1)return NaN;if(1===x)return 0;if(x===1/0)return x;var xInvSquared=1/(x*x);if(x<2)return _log1p(x-1+_sqrt(1-xInvSquared)*x);var halfX=x/2;return _log1p(halfX+_sqrt(1-xInvSquared)*halfX-1)+1/LOG2E},asinh:function asinh(value){var x=Number(value);if(0===x||!globalIsFinite(x))return x;var a=_abs(x),aSquared=a*a,s=_sign(x);return a<1?s*_log1p(a+aSquared/(_sqrt(aSquared+1)+1)):s*(_log1p(a/2+_sqrt(1+1/aSquared)*a/2-1)+1/LOG2E)},atanh:function atanh(value){var x=Number(value);if(0===x)return x;if(-1===x)return-1/0;if(1===x)return 1/0;if(numberIsNaN(x)||x<-1||x>1)return NaN;var a=_abs(x);return _sign(x)*_log1p(2*a/(1-a))/2},cbrt:function cbrt(value){var x=Number(value);if(0===x)return x;var result,negate=x<0;return negate&&(x=-x),result=x===1/0?1/0:(x/((result=_exp(_log(x)/3))*result)+2*result)/3,negate?-result:result},clz32:function clz32(value){var x=Number(value),number=ES.ToUint32(x);return 0===number?32:numberCLZ?ES.Call(numberCLZ,number):31-_floor(_log(number+.5)*LOG2E)},cosh:function cosh(value){var x=Number(value);if(0===x)return 1;if(numberIsNaN(x))return NaN;if(!globalIsFinite(x))return 1/0;var t=_exp(_abs(x)-1);return(t+1/(t*E*E))*(E/2)},expm1:function expm1(value){var x=Number(value);if(x===-1/0)return-1;if(!globalIsFinite(x)||0===x)return x;if(_abs(x)>.5)return _exp(x)-1;for(var t=x,sum=0,n=1;sum+t!==sum;)sum+=t,t*=x/(n+=1);return sum},hypot:function hypot(x,y){for(var result=0,largest=0,i=0;i<arguments.length;++i){var value=_abs(Number(arguments[i]));largest<value?(result*=largest/value*(largest/value),result+=1,largest=value):result+=value>0?value/largest*(value/largest):value}return largest===1/0?1/0:largest*_sqrt(result)},log2:function log2(value){return _log(value)*LOG2E},log10:function log10(value){return _log(value)*LOG10E},log1p:_log1p,sign:_sign,sinh:function sinh(value){var x=Number(value);if(!globalIsFinite(x)||0===x)return x;var a=_abs(x);if(a<1){var u=Math.expm1(a);return _sign(x)*u*(1+1/(u+1))/2}var t=_exp(a-1);return _sign(x)*(t-1/(t*E*E))*(E/2)},tanh:function tanh(value){var x=Number(value);return numberIsNaN(x)||0===x?x:x>=20?1:x<=-20?-1:(Math.expm1(x)-Math.expm1(-x))/(_exp(x)+_exp(-x))},trunc:function trunc(value){var x=Number(value);return x<0?-_floor(-x):_floor(x)},imul:function imul(x,y){var a=ES.ToUint32(x),b=ES.ToUint32(y),al=65535&a,bl=65535&b;return al*bl+((a>>>16&65535)*bl+al*(b>>>16&65535)<<16>>>0)|0},fround:function fround(x){var v=Number(x);if(0===v||v===1/0||v===-1/0||numberIsNaN(v))return v;var sign=_sign(v),abs=_abs(v);if(abs<BINARY_32_MIN_VALUE)return sign*roundTiesToEven(abs/BINARY_32_MIN_VALUE/BINARY_32_EPSILON)*BINARY_32_MIN_VALUE*BINARY_32_EPSILON;var a=(1+BINARY_32_EPSILON/Number.EPSILON)*abs,result=a-(a-abs);return result>BINARY_32_MAX_VALUE||numberIsNaN(result)?sign*(1/0):sign*result}},withinULPDistance=function withinULPDistance(result,expected,distance){return _abs(1-result/expected)/Number.EPSILON<(distance||8)};defineProperties(Math,MathShims),defineProperty(Math,"sinh",MathShims.sinh,Math.sinh(710)===1/0),defineProperty(Math,"cosh",MathShims.cosh,Math.cosh(710)===1/0),defineProperty(Math,"log1p",MathShims.log1p,-1e-17!==Math.log1p(-1e-17)),defineProperty(Math,"asinh",MathShims.asinh,Math.asinh(-1e7)!==-Math.asinh(1e7)),defineProperty(Math,"asinh",MathShims.asinh,Math.asinh(1e300)===1/0),defineProperty(Math,"atanh",MathShims.atanh,0===Math.atanh(1e-300)),defineProperty(Math,"tanh",MathShims.tanh,-2e-17!==Math.tanh(-2e-17)),defineProperty(Math,"acosh",MathShims.acosh,Math.acosh(Number.MAX_VALUE)===1/0),defineProperty(Math,"acosh",MathShims.acosh,!withinULPDistance(Math.acosh(1+Number.EPSILON),Math.sqrt(2*Number.EPSILON))),defineProperty(Math,"cbrt",MathShims.cbrt,!withinULPDistance(Math.cbrt(1e-300),1e-100)),defineProperty(Math,"sinh",MathShims.sinh,-2e-17!==Math.sinh(-2e-17));var expm1OfTen=Math.expm1(10);defineProperty(Math,"expm1",MathShims.expm1,expm1OfTen>22025.465794806718||expm1OfTen<22025.465794806718);var origMathRound=Math.round,roundHandlesBoundaryConditions=0===Math.round(.5-Number.EPSILON/4)&&1===Math.round(Number.EPSILON/3.99-.5),smallestPositiveNumberWhereRoundBreaks=inverseEpsilon+1,largestPositiveNumberWhereRoundBreaks=2*inverseEpsilon-1,roundDoesNotIncreaseIntegers=[smallestPositiveNumberWhereRoundBreaks,largestPositiveNumberWhereRoundBreaks].every((function(num){return Math.round(num)===num}));defineProperty(Math,"round",(function round(x){var floor=_floor(x);return x-floor<.5?floor:-1===floor?-0:floor+1}),!roundHandlesBoundaryConditions||!roundDoesNotIncreaseIntegers),Value.preserveToString(Math.round,origMathRound);var origImul=Math.imul;-5!==Math.imul(4294967295,5)&&(Math.imul=MathShims.imul,Value.preserveToString(Math.imul,origImul)),2!==Math.imul.length&&overrideNative(Math,"imul",(function imul(x,y){return ES.Call(origImul,Math,arguments)}));var count,thenable,PromiseShim=function(){var setTimeout=globals.setTimeout;if("function"==typeof setTimeout||"object"==typeof setTimeout){ES.IsPromise=function(promise){return!!ES.TypeIsObject(promise)&&void 0!==promise._promise};var makeZeroTimeout,PromiseCapability=function(C){if(!ES.IsConstructor(C))throw new TypeError("Bad promise constructor");var capability=this;if(capability.resolve=void 0,capability.reject=void 0,capability.promise=new C((function(resolve,reject){if(void 0!==capability.resolve||void 0!==capability.reject)throw new TypeError("Bad Promise implementation!");capability.resolve=resolve,capability.reject=reject})),!ES.IsCallable(capability.resolve)||!ES.IsCallable(capability.reject))throw new TypeError("Bad promise constructor")};"undefined"!=typeof window&&ES.IsCallable(window.postMessage)&&(makeZeroTimeout=function(){var timeouts=[];return window.addEventListener("message",(function(event){if(event.source===window&&"zero-timeout-message"===event.data){if(event.stopPropagation(),0===timeouts.length)return;_shift(timeouts)()}}),!0),function(fn){_push(timeouts,fn),window.postMessage("zero-timeout-message","*")}});var P,pr,Promise$prototype,Promise$prototype$then,enqueue=ES.IsCallable(globals.setImmediate)?globals.setImmediate:"object"==typeof process&&process.nextTick?process.nextTick:(P=globals.Promise,(pr=P&&P.resolve&&P.resolve())&&function(task){return pr.then(task)}||(ES.IsCallable(makeZeroTimeout)?makeZeroTimeout():function(task){setTimeout(task,0)})),PROMISE_IDENTITY=function(x){return x},PROMISE_THROWER=function(e){throw e},PROMISE_FAKE_CAPABILITY={},enqueuePromiseReactionJob=function(handler,capability,argument){enqueue((function(){promiseReactionJob(handler,capability,argument)}))},promiseReactionJob=function(handler,promiseCapability,argument){var handlerResult,f;if(promiseCapability===PROMISE_FAKE_CAPABILITY)return handler(argument);try{handlerResult=handler(argument),f=promiseCapability.resolve}catch(e){handlerResult=e,f=promiseCapability.reject}f(handlerResult)},fulfillPromise=function(promise,value){var _promise=promise._promise,length=_promise.reactionLength;if(length>0&&(enqueuePromiseReactionJob(_promise.fulfillReactionHandler0,_promise.reactionCapability0,value),_promise.fulfillReactionHandler0=void 0,_promise.rejectReactions0=void 0,_promise.reactionCapability0=void 0,length>1))for(var i=1,idx=0;i<length;i++,idx+=3)enqueuePromiseReactionJob(_promise[idx+0],_promise[idx+2],value),promise[idx+0]=void 0,promise[idx+1]=void 0,promise[idx+2]=void 0;_promise.result=value,_promise.state=1,_promise.reactionLength=0},rejectPromise=function(promise,reason){var _promise=promise._promise,length=_promise.reactionLength;if(length>0&&(enqueuePromiseReactionJob(_promise.rejectReactionHandler0,_promise.reactionCapability0,reason),_promise.fulfillReactionHandler0=void 0,_promise.rejectReactions0=void 0,_promise.reactionCapability0=void 0,length>1))for(var i=1,idx=0;i<length;i++,idx+=3)enqueuePromiseReactionJob(_promise[idx+1],_promise[idx+2],reason),promise[idx+0]=void 0,promise[idx+1]=void 0,promise[idx+2]=void 0;_promise.result=reason,_promise.state=2,_promise.reactionLength=0},createResolvingFunctions=function(promise){var alreadyResolved=!1;return{resolve:function(resolution){var then;if(!alreadyResolved){if(alreadyResolved=!0,resolution===promise)return rejectPromise(promise,new TypeError("Self resolution"));if(!ES.TypeIsObject(resolution))return fulfillPromise(promise,resolution);try{then=resolution.then}catch(e){return rejectPromise(promise,e)}if(!ES.IsCallable(then))return fulfillPromise(promise,resolution);enqueue((function(){promiseResolveThenableJob(promise,resolution,then)}))}},reject:function(reason){if(!alreadyResolved)return alreadyResolved=!0,rejectPromise(promise,reason)}}},optimizedThen=function(then,thenable,resolve,reject){then===Promise$prototype$then?_call(then,thenable,resolve,reject,PROMISE_FAKE_CAPABILITY):_call(then,thenable,resolve,reject)},promiseResolveThenableJob=function(promise,thenable,then){var resolvingFunctions=createResolvingFunctions(promise),resolve=resolvingFunctions.resolve,reject=resolvingFunctions.reject;try{optimizedThen(then,thenable,resolve,reject)}catch(e){reject(e)}},Promise=function(){var PromiseShim=function Promise(resolver){if(!(this instanceof PromiseShim))throw new TypeError('Constructor Promise requires "new"');if(this&&this._promise)throw new TypeError("Bad construction");if(!ES.IsCallable(resolver))throw new TypeError("not a valid resolver");var promise=emulateES6construct(this,PromiseShim,Promise$prototype,{_promise:{result:void 0,state:0,reactionLength:0,fulfillReactionHandler0:void 0,rejectReactionHandler0:void 0,reactionCapability0:void 0}}),resolvingFunctions=createResolvingFunctions(promise),reject=resolvingFunctions.reject;try{resolver(resolvingFunctions.resolve,reject)}catch(e){reject(e)}return promise};return PromiseShim}();Promise$prototype=Promise.prototype;var _promiseAllResolver=function(index,values,capability,remaining){var alreadyCalled=!1;return function(x){alreadyCalled||(alreadyCalled=!0,values[index]=x,0==--remaining.count&&(0,capability.resolve)(values))}};return defineProperties(Promise,{all:function all(iterable){var C=this;if(!ES.TypeIsObject(C))throw new TypeError("Promise is not object");var iterator,iteratorRecord,capability=new PromiseCapability(C);try{return function(iteratorRecord,C,resultCapability){for(var next,nextValue,it=iteratorRecord.iterator,values=[],remaining={count:1},index=0;;){try{if(!1===(next=ES.IteratorStep(it))){iteratorRecord.done=!0;break}nextValue=next.value}catch(e){throw iteratorRecord.done=!0,e}values[index]=void 0;var nextPromise=C.resolve(nextValue),resolveElement=_promiseAllResolver(index,values,resultCapability,remaining);remaining.count+=1,optimizedThen(nextPromise.then,nextPromise,resolveElement,resultCapability.reject),index+=1}return 0==--remaining.count&&(0,resultCapability.resolve)(values),resultCapability.promise}(iteratorRecord={iterator:iterator=ES.GetIterator(iterable),done:!1},C,capability)}catch(e){var exception=e;if(iteratorRecord&&!iteratorRecord.done)try{ES.IteratorClose(iterator,!0)}catch(ee){exception=ee}return(0,capability.reject)(exception),capability.promise}},race:function race(iterable){var C=this;if(!ES.TypeIsObject(C))throw new TypeError("Promise is not object");var iterator,iteratorRecord,capability=new PromiseCapability(C);try{return function(iteratorRecord,C,resultCapability){for(var next,nextValue,nextPromise,it=iteratorRecord.iterator;;){try{if(!1===(next=ES.IteratorStep(it))){iteratorRecord.done=!0;break}nextValue=next.value}catch(e){throw iteratorRecord.done=!0,e}nextPromise=C.resolve(nextValue),optimizedThen(nextPromise.then,nextPromise,resultCapability.resolve,resultCapability.reject)}return resultCapability.promise}(iteratorRecord={iterator:iterator=ES.GetIterator(iterable),done:!1},C,capability)}catch(e){var exception=e;if(iteratorRecord&&!iteratorRecord.done)try{ES.IteratorClose(iterator,!0)}catch(ee){exception=ee}return(0,capability.reject)(exception),capability.promise}},reject:function reject(reason){if(!ES.TypeIsObject(this))throw new TypeError("Bad promise constructor");var capability=new PromiseCapability(this);return(0,capability.reject)(reason),capability.promise},resolve:function resolve(v){var C=this;if(!ES.TypeIsObject(C))throw new TypeError("Bad promise constructor");if(ES.IsPromise(v)&&v.constructor===C)return v;var capability=new PromiseCapability(C);return(0,capability.resolve)(v),capability.promise}}),defineProperties(Promise$prototype,{catch:function(onRejected){return this.then(null,onRejected)},then:function then(onFulfilled,onRejected){var promise=this;if(!ES.IsPromise(promise))throw new TypeError("not a promise");var resultCapability,C=ES.SpeciesConstructor(promise,Promise),returnValueIsIgnored=arguments.length>2&&arguments[2]===PROMISE_FAKE_CAPABILITY;resultCapability=returnValueIsIgnored&&C===Promise?PROMISE_FAKE_CAPABILITY:new PromiseCapability(C);var value,fulfillReactionHandler=ES.IsCallable(onFulfilled)?onFulfilled:PROMISE_IDENTITY,rejectReactionHandler=ES.IsCallable(onRejected)?onRejected:PROMISE_THROWER,_promise=promise._promise;if(0===_promise.state){if(0===_promise.reactionLength)_promise.fulfillReactionHandler0=fulfillReactionHandler,_promise.rejectReactionHandler0=rejectReactionHandler,_promise.reactionCapability0=resultCapability;else{var idx=3*(_promise.reactionLength-1);_promise[idx+0]=fulfillReactionHandler,_promise[idx+1]=rejectReactionHandler,_promise[idx+2]=resultCapability}_promise.reactionLength+=1}else if(1===_promise.state)value=_promise.result,enqueuePromiseReactionJob(fulfillReactionHandler,resultCapability,value);else{if(2!==_promise.state)throw new TypeError("unexpected Promise state");value=_promise.result,enqueuePromiseReactionJob(rejectReactionHandler,resultCapability,value)}return resultCapability.promise}}),PROMISE_FAKE_CAPABILITY=new PromiseCapability(Promise),Promise$prototype$then=Promise$prototype.then,Promise}}();if(globals.Promise&&(delete globals.Promise.accept,delete globals.Promise.defer,delete globals.Promise.prototype.chain),"function"==typeof PromiseShim){defineProperties(globals,{Promise:PromiseShim});var promiseSupportsSubclassing=supportsSubclassing(globals.Promise,(function(S){return S.resolve(42).then((function(){}))instanceof S})),promiseIgnoresNonFunctionThenCallbacks=!throwsError((function(){return globals.Promise.reject(42).then(null,5).then(null,noop)})),promiseRequiresObjectContext=throwsError((function(){return globals.Promise.call(3,noop)})),promiseResolveBroken=function(Promise){var p=Promise.resolve(5);p.constructor={};var p2=Promise.resolve(p);try{p2.then(null,noop).then(null,noop)}catch(e){return!0}return p===p2}(globals.Promise),getsThenSynchronously=supportsDescriptors&&(count=0,thenable=Object.defineProperty({},"then",{get:function(){count+=1}}),Promise.resolve(thenable),1===count),BadResolverPromise=function BadResolverPromise(executor){var p=new Promise(executor);executor(3,(function(){})),this.then=p.then,this.constructor=BadResolverPromise};BadResolverPromise.prototype=Promise.prototype,BadResolverPromise.all=Promise.all;var hasBadResolverPromise=valueOrFalseIfThrows((function(){return!!BadResolverPromise.all([1,2])}));if(promiseSupportsSubclassing&&promiseIgnoresNonFunctionThenCallbacks&&promiseRequiresObjectContext&&!promiseResolveBroken&&getsThenSynchronously&&!hasBadResolverPromise||(Promise=PromiseShim,overrideNative(globals,"Promise",PromiseShim)),1!==Promise.all.length){var origAll=Promise.all;overrideNative(Promise,"all",(function all(iterable){return ES.Call(origAll,this,arguments)}))}if(1!==Promise.race.length){var origRace=Promise.race;overrideNative(Promise,"race",(function race(iterable){return ES.Call(origRace,this,arguments)}))}if(1!==Promise.resolve.length){var origResolve=Promise.resolve;overrideNative(Promise,"resolve",(function resolve(x){return ES.Call(origResolve,this,arguments)}))}if(1!==Promise.reject.length){var origReject=Promise.reject;overrideNative(Promise,"reject",(function reject(r){return ES.Call(origReject,this,arguments)}))}ensureEnumerable(Promise,"all"),ensureEnumerable(Promise,"race"),ensureEnumerable(Promise,"resolve"),ensureEnumerable(Promise,"reject"),addDefaultSpecies(Promise)}var s,m,testOrder=function(a){var b=keys(_reduce(a,(function(o,k){return o[k]=!0,o}),{}));return a.join(":")===b.join(":")},preservesInsertionOrder=testOrder(["z","a","bb"]),preservesNumericInsertionOrder=testOrder(["z",1,"a","3",2]);if(supportsDescriptors){var fastkey=function fastkey(key,skipInsertionOrderCheck){return skipInsertionOrderCheck||preservesInsertionOrder?isNullOrUndefined(key)?"^"+ES.ToString(key):"string"==typeof key?"$"+key:"number"==typeof key?preservesNumericInsertionOrder?key:"n"+key:"boolean"==typeof key?"b"+key:null:null},emptyObject=function emptyObject(){return Object.create?Object.create(null):{}},addIterableToMap=function addIterableToMap(MapConstructor,map,iterable){if(isArray(iterable)||Type.string(iterable))_forEach(iterable,(function(entry){if(!ES.TypeIsObject(entry))throw new TypeError("Iterator value "+entry+" is not an entry object");map.set(entry[0],entry[1])}));else if(iterable instanceof MapConstructor)_call(MapConstructor.prototype.forEach,iterable,(function(value,key){map.set(key,value)}));else{var iter,adder;if(!isNullOrUndefined(iterable)){if(adder=map.set,!ES.IsCallable(adder))throw new TypeError("bad map");iter=ES.GetIterator(iterable)}if(void 0!==iter)for(;;){var next=ES.IteratorStep(iter);if(!1===next)break;var nextItem=next.value;try{if(!ES.TypeIsObject(nextItem))throw new TypeError("Iterator value "+nextItem+" is not an entry object");_call(adder,map,nextItem[0],nextItem[1])}catch(e){throw ES.IteratorClose(iter,!0),e}}}},addIterableToSet=function addIterableToSet(SetConstructor,set,iterable){if(isArray(iterable)||Type.string(iterable))_forEach(iterable,(function(value){set.add(value)}));else if(iterable instanceof SetConstructor)_call(SetConstructor.prototype.forEach,iterable,(function(value){set.add(value)}));else{var iter,adder;if(!isNullOrUndefined(iterable)){if(adder=set.add,!ES.IsCallable(adder))throw new TypeError("bad set");iter=ES.GetIterator(iterable)}if(void 0!==iter)for(;;){var next=ES.IteratorStep(iter);if(!1===next)break;var nextValue=next.value;try{_call(adder,set,nextValue)}catch(e){throw ES.IteratorClose(iter,!0),e}}}},collectionShims={Map:function(){var empty={},MapEntry=function MapEntry(key,value){this.key=key,this.value=value,this.next=null,this.prev=null};MapEntry.prototype.isRemoved=function isRemoved(){return this.key===empty};var Map$prototype,requireMapSlot=function requireMapSlot(map,method){if(!ES.TypeIsObject(map)||!function isMap(map){return!!map._es6map}(map))throw new TypeError("Method Map.prototype."+method+" called on incompatible receiver "+ES.ToString(map))},MapIterator=function MapIterator(map,kind){requireMapSlot(map,"[[MapIterator]]"),this.head=map._head,this.i=this.head,this.kind=kind};addIterator(MapIterator.prototype={isMapIterator:!0,next:function next(){if(!this.isMapIterator)throw new TypeError("Not a MapIterator");var result,i=this.i,kind=this.kind,head=this.head;if(void 0===this.i)return iteratorResult();for(;i.isRemoved()&&i!==head;)i=i.prev;for(;i.next!==head;)if(!(i=i.next).isRemoved())return result="key"===kind?i.key:"value"===kind?i.value:[i.key,i.value],this.i=i,iteratorResult(result);return this.i=void 0,iteratorResult()}});var MapShim=function Map(){if(!(this instanceof Map))throw new TypeError('Constructor Map requires "new"');if(this&&this._es6map)throw new TypeError("Bad construction");var map=emulateES6construct(this,Map,Map$prototype,{_es6map:!0,_head:null,_map:OrigMap?new OrigMap:null,_size:0,_storage:emptyObject()}),head=new MapEntry(null,null);return head.next=head.prev=head,map._head=head,arguments.length>0&&addIterableToMap(Map,map,arguments[0]),map};return Map$prototype=MapShim.prototype,Value.getter(Map$prototype,"size",(function(){if(void 0===this._size)throw new TypeError("size method called on incompatible Map");return this._size})),defineProperties(Map$prototype,{get:function get(key){var entry;requireMapSlot(this,"get");var fkey=fastkey(key,!0);if(null!==fkey)return(entry=this._storage[fkey])?entry.value:void 0;if(this._map)return(entry=origMapGet.call(this._map,key))?entry.value:void 0;for(var head=this._head,i=head;(i=i.next)!==head;)if(ES.SameValueZero(i.key,key))return i.value},has:function has(key){requireMapSlot(this,"has");var fkey=fastkey(key,!0);if(null!==fkey)return void 0!==this._storage[fkey];if(this._map)return origMapHas.call(this._map,key);for(var head=this._head,i=head;(i=i.next)!==head;)if(ES.SameValueZero(i.key,key))return!0;return!1},set:function set(key,value){requireMapSlot(this,"set");var entry,head=this._head,i=head,fkey=fastkey(key,!0);if(null!==fkey){if(void 0!==this._storage[fkey])return this._storage[fkey].value=value,this;entry=this._storage[fkey]=new MapEntry(key,value),i=head.prev}else this._map&&(origMapHas.call(this._map,key)?origMapGet.call(this._map,key).value=value:(entry=new MapEntry(key,value),origMapSet.call(this._map,key,entry),i=head.prev));for(;(i=i.next)!==head;)if(ES.SameValueZero(i.key,key))return i.value=value,this;return entry=entry||new MapEntry(key,value),ES.SameValue(-0,key)&&(entry.key=0),entry.next=this._head,entry.prev=this._head.prev,entry.prev.next=entry,entry.next.prev=entry,this._size+=1,this},delete:function(key){requireMapSlot(this,"delete");var head=this._head,i=head,fkey=fastkey(key,!0);if(null!==fkey){if(void 0===this._storage[fkey])return!1;i=this._storage[fkey].prev,delete this._storage[fkey]}else if(this._map){if(!origMapHas.call(this._map,key))return!1;i=origMapGet.call(this._map,key).prev,origMapDelete.call(this._map,key)}for(;(i=i.next)!==head;)if(ES.SameValueZero(i.key,key))return i.key=empty,i.value=empty,i.prev.next=i.next,i.next.prev=i.prev,this._size-=1,!0;return!1},clear:function clear(){requireMapSlot(this,"clear"),this._map=OrigMap?new OrigMap:null,this._size=0,this._storage=emptyObject();for(var head=this._head,i=head,p=i.next;(i=p)!==head;)i.key=empty,i.value=empty,p=i.next,i.next=i.prev=head;head.next=head.prev=head},keys:function keys(){return requireMapSlot(this,"keys"),new MapIterator(this,"key")},values:function values(){return requireMapSlot(this,"values"),new MapIterator(this,"value")},entries:function entries(){return requireMapSlot(this,"entries"),new MapIterator(this,"key+value")},forEach:function forEach(callback){requireMapSlot(this,"forEach");for(var context=arguments.length>1?arguments[1]:null,it=this.entries(),entry=it.next();!entry.done;entry=it.next())context?_call(callback,context,entry.value[1],entry.value[0],this):callback(entry.value[1],entry.value[0],this)}}),addIterator(Map$prototype,Map$prototype.entries),MapShim}(),Set:function(){var Set$prototype,requireSetSlot=function requireSetSlot(set,method){if(!ES.TypeIsObject(set)||!function isSet(set){return set._es6set&&void 0!==set._storage}(set))throw new TypeError("Set.prototype."+method+" called on incompatible receiver "+ES.ToString(set))},SetShim=function Set(){if(!(this instanceof Set))throw new TypeError('Constructor Set requires "new"');if(this&&this._es6set)throw new TypeError("Bad construction");var set=emulateES6construct(this,Set,Set$prototype,{_es6set:!0,"[[SetData]]":null,_storage:emptyObject()});if(!set._es6set)throw new TypeError("bad set");return arguments.length>0&&addIterableToSet(Set,set,arguments[0]),set};Set$prototype=SetShim.prototype;var ensureMap=function ensureMap(set){if(!set["[[SetData]]"]){var m=new collectionShims.Map;set["[[SetData]]"]=m,_forEach(keys(set._storage),(function(key){var k=function(key){var k=key;if("^null"===k)return null;if("^undefined"!==k){var first=k.charAt(0);return"$"===first?_strSlice(k,1):"n"===first?+_strSlice(k,1):"b"===first?"btrue"===k:+k}}(key);m.set(k,k)})),set["[[SetData]]"]=m}set._storage=null};Value.getter(SetShim.prototype,"size",(function(){return requireSetSlot(this,"size"),this._storage?keys(this._storage).length:(ensureMap(this),this["[[SetData]]"].size)})),defineProperties(SetShim.prototype,{has:function has(key){var fkey;return requireSetSlot(this,"has"),this._storage&&null!==(fkey=fastkey(key))?!!this._storage[fkey]:(ensureMap(this),this["[[SetData]]"].has(key))},add:function add(key){var fkey;return requireSetSlot(this,"add"),this._storage&&null!==(fkey=fastkey(key))?(this._storage[fkey]=!0,this):(ensureMap(this),this["[[SetData]]"].set(key,key),this)},delete:function(key){var fkey;if(requireSetSlot(this,"delete"),this._storage&&null!==(fkey=fastkey(key))){var hasFKey=_hasOwnProperty(this._storage,fkey);return delete this._storage[fkey]&&hasFKey}return ensureMap(this),this["[[SetData]]"].delete(key)},clear:function clear(){requireSetSlot(this,"clear"),this._storage&&(this._storage=emptyObject()),this["[[SetData]]"]&&this["[[SetData]]"].clear()},values:function values(){return requireSetSlot(this,"values"),ensureMap(this),new SetIterator(this["[[SetData]]"].values())},entries:function entries(){return requireSetSlot(this,"entries"),ensureMap(this),new SetIterator(this["[[SetData]]"].entries())},forEach:function forEach(callback){requireSetSlot(this,"forEach");var context=arguments.length>1?arguments[1]:null,entireSet=this;ensureMap(entireSet),this["[[SetData]]"].forEach((function(value,key){context?_call(callback,context,key,key,entireSet):callback(key,key,entireSet)}))}}),defineProperty(SetShim.prototype,"keys",SetShim.prototype.values,!0),addIterator(SetShim.prototype,SetShim.prototype.values);var SetIterator=function SetIterator(it){this.it=it};return SetIterator.prototype={isSetIterator:!0,next:function next(){if(!this.isSetIterator)throw new TypeError("Not a SetIterator");return this.it.next()}},addIterator(SetIterator.prototype),SetShim}()},isGoogleTranslate=globals.Set&&!Set.prototype.delete&&Set.prototype.remove&&Set.prototype.items&&Set.prototype.map&&Array.isArray((new Set).keys);if(isGoogleTranslate&&(globals.Set=collectionShims.Set),globals.Map||globals.Set){var mapAcceptsArguments=valueOrFalseIfThrows((function(){return 2===new Map([[1,2]]).get(1)}));mapAcceptsArguments||(globals.Map=function Map(){if(!(this instanceof Map))throw new TypeError('Constructor Map requires "new"');var m=new OrigMap;return arguments.length>0&&addIterableToMap(Map,m,arguments[0]),delete m.constructor,Object.setPrototypeOf(m,globals.Map.prototype),m},globals.Map.prototype=create(OrigMap.prototype),defineProperty(globals.Map.prototype,"constructor",globals.Map,!0),Value.preserveToString(globals.Map,OrigMap));var testMap=new Map,mapUsesSameValueZero=((m=new Map([[1,0],[2,0],[3,0],[4,0]])).set(-0,m),m.get(0)===m&&m.get(-0)===m&&m.has(0)&&m.has(-0)),mapSupportsChaining=testMap.set(1,2)===testMap;mapUsesSameValueZero&&mapSupportsChaining||overrideNative(Map.prototype,"set",(function set(k,v){return _call(origMapSet,this,0===k?0:k,v),this})),mapUsesSameValueZero||(defineProperties(Map.prototype,{get:function get(k){return _call(origMapGet,this,0===k?0:k)},has:function has(k){return _call(origMapHas,this,0===k?0:k)}},!0),Value.preserveToString(Map.prototype.get,origMapGet),Value.preserveToString(Map.prototype.has,origMapHas));var testSet=new Set,setUsesSameValueZero=Set.prototype.delete&&Set.prototype.add&&Set.prototype.has&&((s=testSet).delete(0),s.add(-0),!s.has(0)),setSupportsChaining=testSet.add(1)===testSet;if(!setUsesSameValueZero||!setSupportsChaining){var origSetAdd=Set.prototype.add;Set.prototype.add=function add(v){return _call(origSetAdd,this,0===v?0:v),this},Value.preserveToString(Set.prototype.add,origSetAdd)}if(!setUsesSameValueZero){var origSetHas=Set.prototype.has;Set.prototype.has=function has(v){return _call(origSetHas,this,0===v?0:v)},Value.preserveToString(Set.prototype.has,origSetHas);var origSetDel=Set.prototype.delete;Set.prototype.delete=function SetDelete(v){return _call(origSetDel,this,0===v?0:v)},Value.preserveToString(Set.prototype.delete,origSetDel)}var mapSupportsSubclassing=supportsSubclassing(globals.Map,(function(M){var m=new M([]);return m.set(42,42),m instanceof M})),mapFailsToSupportSubclassing=Object.setPrototypeOf&&!mapSupportsSubclassing,mapRequiresNew=function(){try{return!(globals.Map()instanceof globals.Map)}catch(e){return e instanceof TypeError}}();0===globals.Map.length&&!mapFailsToSupportSubclassing&&mapRequiresNew||(globals.Map=function Map(){if(!(this instanceof Map))throw new TypeError('Constructor Map requires "new"');var m=new OrigMap;return arguments.length>0&&addIterableToMap(Map,m,arguments[0]),delete m.constructor,Object.setPrototypeOf(m,Map.prototype),m},globals.Map.prototype=OrigMap.prototype,defineProperty(globals.Map.prototype,"constructor",globals.Map,!0),Value.preserveToString(globals.Map,OrigMap));var setSupportsSubclassing=supportsSubclassing(globals.Set,(function(S){var s=new S([]);return s.add(42,42),s instanceof S})),setFailsToSupportSubclassing=Object.setPrototypeOf&&!setSupportsSubclassing,setRequiresNew=function(){try{return!(globals.Set()instanceof globals.Set)}catch(e){return e instanceof TypeError}}();if(0!==globals.Set.length||setFailsToSupportSubclassing||!setRequiresNew){var OrigSet=globals.Set;globals.Set=function Set(){if(!(this instanceof Set))throw new TypeError('Constructor Set requires "new"');var s=new OrigSet;return arguments.length>0&&addIterableToSet(Set,s,arguments[0]),delete s.constructor,Object.setPrototypeOf(s,Set.prototype),s},globals.Set.prototype=OrigSet.prototype,defineProperty(globals.Set.prototype,"constructor",globals.Set,!0),Value.preserveToString(globals.Set,OrigSet)}var newMap=new globals.Map,mapIterationThrowsStopIterator=!valueOrFalseIfThrows((function(){return newMap.keys().next().done}));if(("function"!=typeof globals.Map.prototype.clear||0!==(new globals.Set).size||0!==newMap.size||"function"!=typeof globals.Map.prototype.keys||"function"!=typeof globals.Set.prototype.keys||"function"!=typeof globals.Map.prototype.forEach||"function"!=typeof globals.Set.prototype.forEach||isCallableWithoutNew(globals.Map)||isCallableWithoutNew(globals.Set)||"function"!=typeof newMap.keys().next||mapIterationThrowsStopIterator||!mapSupportsSubclassing)&&defineProperties(globals,{Map:collectionShims.Map,Set:collectionShims.Set},!0),globals.Set.prototype.keys!==globals.Set.prototype.values&&defineProperty(globals.Set.prototype,"keys",globals.Set.prototype.values,!0),addIterator(Object.getPrototypeOf((new globals.Map).keys())),addIterator(Object.getPrototypeOf((new globals.Set).keys())),functionsHaveNames&&"has"!==globals.Set.prototype.has.name){var anonymousSetHas=globals.Set.prototype.has;overrideNative(globals.Set.prototype,"has",(function has(key){return _call(anonymousSetHas,this,key)}))}}defineProperties(globals,collectionShims),addDefaultSpecies(globals.Map),addDefaultSpecies(globals.Set)}var throwUnlessTargetIsObject=function throwUnlessTargetIsObject(target){if(!ES.TypeIsObject(target))throw new TypeError("target must be an object")},ReflectShims={apply:function apply(){return ES.Call(ES.Call,null,arguments)},construct:function construct(constructor,args){if(!ES.IsConstructor(constructor))throw new TypeError("First argument must be a constructor.");var newTarget=arguments.length>2?arguments[2]:constructor;if(!ES.IsConstructor(newTarget))throw new TypeError("new.target must be a constructor.");return ES.Construct(constructor,args,newTarget,"internal")},deleteProperty:function deleteProperty(target,key){if(throwUnlessTargetIsObject(target),supportsDescriptors){var desc=Object.getOwnPropertyDescriptor(target,key);if(desc&&!desc.configurable)return!1}return delete target[key]},has:function has(target,key){return throwUnlessTargetIsObject(target),key in target}};Object.getOwnPropertyNames&&Object.assign(ReflectShims,{ownKeys:function ownKeys(target){throwUnlessTargetIsObject(target);var keys=Object.getOwnPropertyNames(target);return ES.IsCallable(Object.getOwnPropertySymbols)&&_pushApply(keys,Object.getOwnPropertySymbols(target)),keys}});var callAndCatchException=function ConvertExceptionToBoolean(func){return!throwsError(func)};if(Object.preventExtensions&&Object.assign(ReflectShims,{isExtensible:function isExtensible(target){return throwUnlessTargetIsObject(target),Object.isExtensible(target)},preventExtensions:function preventExtensions(target){return throwUnlessTargetIsObject(target),callAndCatchException((function(){return Object.preventExtensions(target)}))}}),supportsDescriptors){var internalGet=function get(target,key,receiver){var desc=Object.getOwnPropertyDescriptor(target,key);if(!desc){var parent=Object.getPrototypeOf(target);if(null===parent)return;return internalGet(parent,key,receiver)}return"value"in desc?desc.value:desc.get?ES.Call(desc.get,receiver):void 0},internalSet=function set(target,key,value,receiver){var desc=Object.getOwnPropertyDescriptor(target,key);if(!desc){var parent=Object.getPrototypeOf(target);if(null!==parent)return internalSet(parent,key,value,receiver);desc={value:void 0,writable:!0,enumerable:!0,configurable:!0}}return"value"in desc?!!desc.writable&&!!ES.TypeIsObject(receiver)&&(Object.getOwnPropertyDescriptor(receiver,key)?Reflect.defineProperty(receiver,key,{value:value}):Reflect.defineProperty(receiver,key,{value:value,writable:!0,enumerable:!0,configurable:!0})):!!desc.set&&(_call(desc.set,receiver,value),!0)};Object.assign(ReflectShims,{defineProperty:function defineProperty(target,propertyKey,attributes){return throwUnlessTargetIsObject(target),callAndCatchException((function(){return Object.defineProperty(target,propertyKey,attributes)}))},getOwnPropertyDescriptor:function getOwnPropertyDescriptor(target,propertyKey){return throwUnlessTargetIsObject(target),Object.getOwnPropertyDescriptor(target,propertyKey)},get:function get(target,key){throwUnlessTargetIsObject(target);var receiver=arguments.length>2?arguments[2]:target;return internalGet(target,key,receiver)},set:function set(target,key,value){throwUnlessTargetIsObject(target);var receiver=arguments.length>3?arguments[3]:target;return internalSet(target,key,value,receiver)}})}if(Object.getPrototypeOf){var objectDotGetPrototypeOf=Object.getPrototypeOf;ReflectShims.getPrototypeOf=function getPrototypeOf(target){return throwUnlessTargetIsObject(target),objectDotGetPrototypeOf(target)}}if(Object.setPrototypeOf&&ReflectShims.getPrototypeOf){var willCreateCircularPrototype=function(object,lastProto){for(var proto=lastProto;proto;){if(object===proto)return!0;proto=ReflectShims.getPrototypeOf(proto)}return!1};Object.assign(ReflectShims,{setPrototypeOf:function setPrototypeOf(object,proto){if(throwUnlessTargetIsObject(object),null!==proto&&!ES.TypeIsObject(proto))throw new TypeError("proto must be an object or null");return proto===Reflect.getPrototypeOf(object)||!(Reflect.isExtensible&&!Reflect.isExtensible(object))&&!willCreateCircularPrototype(object,proto)&&(Object.setPrototypeOf(object,proto),!0)}})}var defineOrOverrideReflectProperty=function(key,shim){ES.IsCallable(globals.Reflect[key])?valueOrFalseIfThrows((function(){return globals.Reflect[key](1),globals.Reflect[key](NaN),globals.Reflect[key](!0),!0}))&&overrideNative(globals.Reflect,key,shim):defineProperty(globals.Reflect,key,shim)};Object.keys(ReflectShims).forEach((function(key){defineOrOverrideReflectProperty(key,ReflectShims[key])}));var originalReflectGetProto=globals.Reflect.getPrototypeOf;if(functionsHaveNames&&originalReflectGetProto&&"getPrototypeOf"!==originalReflectGetProto.name&&overrideNative(globals.Reflect,"getPrototypeOf",(function getPrototypeOf(target){return _call(originalReflectGetProto,globals.Reflect,target)})),globals.Reflect.setPrototypeOf&&valueOrFalseIfThrows((function(){return globals.Reflect.setPrototypeOf(1,{}),!0}))&&overrideNative(globals.Reflect,"setPrototypeOf",ReflectShims.setPrototypeOf),globals.Reflect.defineProperty&&(valueOrFalseIfThrows((function(){var basic=!globals.Reflect.defineProperty(1,"test",{value:1}),extensible="function"!=typeof Object.preventExtensions||!globals.Reflect.defineProperty(Object.preventExtensions({}),"test",{});return basic&&extensible}))||overrideNative(globals.Reflect,"defineProperty",ReflectShims.defineProperty)),globals.Reflect.construct&&(valueOrFalseIfThrows((function(){var F=function F(){};return globals.Reflect.construct((function(){}),[],F)instanceof F}))||overrideNative(globals.Reflect,"construct",ReflectShims.construct)),"Invalid Date"!==String(new Date(NaN))){var dateToString=Date.prototype.toString,shimmedDateToString=function toString(){var valueOf=+this;return valueOf!=valueOf?"Invalid Date":ES.Call(dateToString,this)};overrideNative(Date.prototype,"toString",shimmedDateToString)}var stringHTMLshims={anchor:function anchor(name){return ES.CreateHTML(this,"a","name",name)},big:function big(){return ES.CreateHTML(this,"big","","")},blink:function blink(){return ES.CreateHTML(this,"blink","","")},bold:function bold(){return ES.CreateHTML(this,"b","","")},fixed:function fixed(){return ES.CreateHTML(this,"tt","","")},fontcolor:function fontcolor(color){return ES.CreateHTML(this,"font","color",color)},fontsize:function fontsize(size){return ES.CreateHTML(this,"font","size",size)},italics:function italics(){return ES.CreateHTML(this,"i","","")},link:function link(url){return ES.CreateHTML(this,"a","href",url)},small:function small(){return ES.CreateHTML(this,"small","","")},strike:function strike(){return ES.CreateHTML(this,"strike","","")},sub:function sub(){return ES.CreateHTML(this,"sub","","")},sup:function sub(){return ES.CreateHTML(this,"sup","","")}};_forEach(Object.keys(stringHTMLshims),(function(key){var method=String.prototype[key],shouldOverwrite=!1;if(ES.IsCallable(method)){var output=_call(method,"",' " '),quotesCount=_concat([],output.match(/"/g)).length;shouldOverwrite=output!==output.toLowerCase()||quotesCount>2}else shouldOverwrite=!0;shouldOverwrite&&overrideNative(String.prototype,key,stringHTMLshims[key])}));var JSONstringifiesSymbols=function(){if(!hasSymbols)return!1;var stringify="object"==typeof JSON&&"function"==typeof JSON.stringify?JSON.stringify:null;if(!stringify)return!1;if(void 0!==stringify(Symbol()))return!0;if("[null]"!==stringify([Symbol()]))return!0;var obj={a:Symbol()};return obj[Symbol()]=!0,"{}"!==stringify(obj)}(),JSONstringifyAcceptsObjectSymbol=valueOrFalseIfThrows((function(){return!hasSymbols||"{}"===JSON.stringify(Object(Symbol()))&&"[{}]"===JSON.stringify([Object(Symbol())])}));if(JSONstringifiesSymbols||!JSONstringifyAcceptsObjectSymbol){var origStringify=JSON.stringify;overrideNative(JSON,"stringify",(function stringify(value){if("symbol"!=typeof value){var replacer;arguments.length>1&&(replacer=arguments[1]);var args=[value];if(isArray(replacer))args.push(replacer);else{var replaceFn=ES.IsCallable(replacer)?replacer:null,wrappedReplacer=function(key,val){var parsedValue=replaceFn?_call(replaceFn,this,key,val):val;if("symbol"!=typeof parsedValue)return Type.symbol(parsedValue)?assignTo({})(parsedValue):parsedValue};args.push(wrappedReplacer)}return arguments.length>2&&args.push(arguments[2]),origStringify.apply(this,args)}}))}return globals})?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}).call(this,__webpack_require__(20),__webpack_require__(91))},function(module,exports,__webpack_require__){"use strict";var supportsDescriptors=__webpack_require__(9).supportsDescriptors,functionsHaveNames=__webpack_require__(174)(),getPolyfill=__webpack_require__(314),defineProperty=Object.defineProperty,TypeErr=TypeError;module.exports=function shimName(){var polyfill=getPolyfill();if(functionsHaveNames)return polyfill;if(!supportsDescriptors)throw new TypeErr("Shimming Function.prototype.name support requires ES5 property descriptor support.");var functionProto=Function.prototype;return defineProperty(functionProto,"name",{configurable:!0,enumerable:!1,get:function(){var name=polyfill.call(this);return this!==functionProto&&defineProperty(this,"name",{configurable:!0,enumerable:!1,value:name,writable:!1}),name}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var slice=Array.prototype.slice,isArgs=__webpack_require__(173),origKeys=Object.keys,keysShim=origKeys?function keys(o){return origKeys(o)}:__webpack_require__(313),originalKeys=Object.keys;keysShim.shim=function shimObjectKeys(){Object.keys?function(){var args=Object.keys(arguments);return args&&args.length===arguments.length}(1,2)||(Object.keys=function keys(object){return isArgs(object)?originalKeys(slice.call(object)):originalKeys(object)}):Object.keys=keysShim;return Object.keys||keysShim},module.exports=keysShim},function(module,exports,__webpack_require__){"use strict";var keysShim;if(!Object.keys){var has=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,isArgs=__webpack_require__(173),isEnumerable=Object.prototype.propertyIsEnumerable,hasDontEnumBug=!isEnumerable.call({toString:null},"toString"),hasProtoEnumBug=isEnumerable.call((function(){}),"prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],equalsConstructorPrototype=function(o){var ctor=o.constructor;return ctor&&ctor.prototype===o},excludedKeys={$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},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var k in window)try{if(!excludedKeys["$"+k]&&has.call(window,k)&&null!==window[k]&&"object"==typeof window[k])try{equalsConstructorPrototype(window[k])}catch(e){return!0}}catch(e){return!0}return!1}();keysShim=function keys(object){var isObject=null!==object&&"object"==typeof object,isFunction="[object Function]"===toStr.call(object),isArguments=isArgs(object),isString=isObject&&"[object String]"===toStr.call(object),theKeys=[];if(!isObject&&!isFunction&&!isArguments)throw new TypeError("Object.keys called on a non-object");var skipProto=hasProtoEnumBug&&isFunction;if(isString&&object.length>0&&!has.call(object,0))for(var i=0;i<object.length;++i)theKeys.push(String(i));if(isArguments&&object.length>0)for(var j=0;j<object.length;++j)theKeys.push(String(j));else for(var name in object)skipProto&&"prototype"===name||!has.call(object,name)||theKeys.push(String(name));if(hasDontEnumBug)for(var skipConstructor=function(o){if("undefined"==typeof window||!hasAutomationEqualityBug)return equalsConstructorPrototype(o);try{return equalsConstructorPrototype(o)}catch(e){return!1}}(object),k=0;k<dontEnums.length;++k)skipConstructor&&"constructor"===dontEnums[k]||!has.call(object,dontEnums[k])||theKeys.push(dontEnums[k]);return theKeys}}module.exports=keysShim},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(315);module.exports=function getPolyfill(){return implementation}},function(module,exports,__webpack_require__){"use strict";var IsCallable=__webpack_require__(25),functionsHaveNames=__webpack_require__(174)(),callBound=__webpack_require__(6),$functionToString=callBound("Function.prototype.toString"),$stringMatch=callBound("String.prototype.match"),classRegex=/^class /,regex=/\s*function\s+([^(\s]*)\s*/,functionProto=Function.prototype;module.exports=function getName(){if(!function isClassConstructor(fn){if(IsCallable(fn))return!1;if("function"!=typeof fn)return!1;try{return!!$stringMatch($functionToString(fn),classRegex)}catch(e){}return!1}(this)&&!IsCallable(this))throw new TypeError("Function.prototype.name sham getter called on non-function");if(functionsHaveNames)return this.name;if(this===functionProto)return"";var str=$functionToString(this),match=$stringMatch(str,regex);return match&&match[1]}},function(module,exports,__webpack_require__){"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",slice=Array.prototype.slice,toStr=Object.prototype.toString;module.exports=function bind(that){var target=this;if("function"!=typeof target||"[object Function]"!==toStr.call(target))throw new TypeError(ERROR_MESSAGE+target);for(var bound,args=slice.call(arguments,1),binder=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))},boundLength=Math.max(0,target.length-args.length),boundArgs=[],i=0;i<boundLength;i++)boundArgs.push("$"+i);if(bound=Function("binder","return function ("+boundArgs.join(",")+"){ return binder.apply(this,arguments); }")(binder),target.prototype){var Empty=function Empty(){};Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null}return bound}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(318)(),__webpack_require__(331)},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),getPolyfill=__webpack_require__(319);module.exports=function shimArrayPrototypeIncludes(){var polyfill=getPolyfill();return define(Array.prototype,{includes:polyfill},{includes:function(){return Array.prototype.includes!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(320);module.exports=function getPolyfill(){return Array.prototype.includes||implementation}},function(module,exports,__webpack_require__){"use strict";var ToInteger=__webpack_require__(176),ToLength=__webpack_require__(327),ToObject=__webpack_require__(328),SameValueZero=__webpack_require__(330),$isNaN=__webpack_require__(73),$isFinite=__webpack_require__(121),GetIntrinsic=__webpack_require__(1),callBound=__webpack_require__(6),isString=__webpack_require__(123),$charAt=callBound("String.prototype.charAt"),$indexOf=GetIntrinsic("%Array.prototype.indexOf%");module.exports=function includes(searchElement){var fromIndex=arguments.length>1?ToInteger(arguments[1]):0;if($indexOf&&!$isNaN(searchElement)&&$isFinite(fromIndex)&&void 0!==searchElement)return $indexOf.apply(this,arguments)>-1;var O=ToObject(this),length=ToLength(O.length);if(0===length)return!1;for(var k=fromIndex>=0?fromIndex:Math.max(0,length+fromIndex);k<length;){if(SameValueZero(searchElement,isString(O)?$charAt(O,k):O[k]))return!0;k+=1}return!1}},function(module,exports,__webpack_require__){"use strict";module.exports=function ToNumber(value){return+value}},function(module,exports,__webpack_require__){"use strict";module.exports=function sign(number){return number>=0?1:-1}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$TypeError=GetIntrinsic("%TypeError%"),$Number=GetIntrinsic("%Number%"),$RegExp=GetIntrinsic("%RegExp%"),$parseInteger=GetIntrinsic("%parseInt%"),callBound=__webpack_require__(6),regexTester=__webpack_require__(178),isPrimitive=__webpack_require__(122),$strSlice=callBound("String.prototype.slice"),isBinary=regexTester(/^0b[01]+$/i),isOctal=regexTester(/^0o[0-7]+$/i),isInvalidHexLiteral=regexTester(/^[-+]0x[0-9a-f]+$/i),hasNonWS=regexTester(new $RegExp("["+["
","",""].join("")+"]","g")),ws=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),trimRegex=new RegExp("(^["+ws+"]+)|(["+ws+"]+$)","g"),$replace=callBound("String.prototype.replace"),ToPrimitive=__webpack_require__(324);module.exports=function ToNumber(argument){var value=isPrimitive(argument)?argument:ToPrimitive(argument,$Number);if("symbol"==typeof value)throw new $TypeError("Cannot convert a Symbol value to a number");if("string"==typeof value){if(isBinary(value))return ToNumber($parseInteger($strSlice(value,2),2));if(isOctal(value))return ToNumber($parseInteger($strSlice(value,2),8));if(hasNonWS(value)||isInvalidHexLiteral(value))return NaN;var trimmed=function(value){return $replace(value,trimRegex,"")}(value);if(trimmed!==value)return ToNumber(trimmed)}return $Number(value)}},function(module,exports,__webpack_require__){"use strict";var toPrimitive=__webpack_require__(179);module.exports=function ToPrimitive(input){return arguments.length>1?toPrimitive(input,arguments[1]):toPrimitive(input)}},function(module,exports,__webpack_require__){"use strict";module.exports=function isPrimitive(value){return null===value||"function"!=typeof value&&"object"!=typeof value}},function(module,exports,__webpack_require__){"use strict";var getDay=Date.prototype.getDay,toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isDateObject(value){return"object"==typeof value&&null!==value&&(hasToStringTag?function tryDateGetDayCall(value){try{return getDay.call(value),!0}catch(e){return!1}}(value):"[object Date]"===toStr.call(value))}},function(module,exports,__webpack_require__){"use strict";var MAX_SAFE_INTEGER=__webpack_require__(92),ToInteger=__webpack_require__(176);module.exports=function ToLength(argument){var len=ToInteger(argument);return len<=0?0:len>MAX_SAFE_INTEGER?MAX_SAFE_INTEGER:len}},function(module,exports,__webpack_require__){"use strict";var $Object=__webpack_require__(1)("%Object%"),RequireObjectCoercible=__webpack_require__(329);module.exports=function ToObject(value){return RequireObjectCoercible(value),$Object(value)}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(181)},function(module,exports,__webpack_require__){"use strict";var $isNaN=__webpack_require__(73);module.exports=function SameValueZero(x,y){return x===y||$isNaN(x)&&$isNaN(y)}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(332)(),__webpack_require__(335)(),__webpack_require__(338)(),__webpack_require__(341)(),__webpack_require__(344)(),__webpack_require__(355)},function(module,exports,__webpack_require__){"use strict";var getPolyfill=__webpack_require__(333),define=__webpack_require__(9);module.exports=function shimValues(){var polyfill=getPolyfill();return define(Object,{values:polyfill},{values:function testValues(){return Object.values!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(334);module.exports=function getPolyfill(){return"function"==typeof Object.values?Object.values:implementation}},function(module,exports,__webpack_require__){"use strict";var has=__webpack_require__(39),RequireObjectCoercible=__webpack_require__(32),$isEnumerable=__webpack_require__(6)("Object.prototype.propertyIsEnumerable");module.exports=function values(O){var obj=RequireObjectCoercible(O),vals=[];for(var key in obj)has(obj,key)&&$isEnumerable(obj,key)&&vals.push(obj[key]);return vals}},function(module,exports,__webpack_require__){"use strict";var getPolyfill=__webpack_require__(336),define=__webpack_require__(9);module.exports=function shimEntries(){var polyfill=getPolyfill();return define(Object,{entries:polyfill},{entries:function testEntries(){return Object.entries!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(337);module.exports=function getPolyfill(){return"function"==typeof Object.entries?Object.entries:implementation}},function(module,exports,__webpack_require__){"use strict";var RequireObjectCoercible=__webpack_require__(32),has=__webpack_require__(39),isEnumerable=__webpack_require__(72).call(Function.call,Object.prototype.propertyIsEnumerable);module.exports=function entries(O){var obj=RequireObjectCoercible(O),entrys=[];for(var key in obj)has(obj,key)&&isEnumerable(obj,key)&&entrys.push([key,obj[key]]);return entrys}},function(module,exports,__webpack_require__){"use strict";var getPolyfill=__webpack_require__(339),define=__webpack_require__(9);module.exports=function shimPadStart(){var polyfill=getPolyfill();return define(String.prototype,{padStart:polyfill},{padStart:function testPadStart(){return String.prototype.padStart!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(340);module.exports=function getPolyfill(){return"function"==typeof String.prototype.padStart?String.prototype.padStart:implementation}},function(module,exports,__webpack_require__){"use strict";var ToLength=__webpack_require__(51),ToString=__webpack_require__(40),RequireObjectCoercible=__webpack_require__(32),$slice=__webpack_require__(6)("String.prototype.slice");module.exports=function padStart(maxLength){var fillString,O=RequireObjectCoercible(this),S=ToString(O),stringLength=ToLength(S.length);arguments.length>1&&(fillString=arguments[1]);var filler=void 0===fillString?"":ToString(fillString);""===filler&&(filler=" ");var intMaxLength=ToLength(maxLength);if(intMaxLength<=stringLength)return S;for(var fillLen=intMaxLength-stringLength;filler.length<fillLen;){var fLen=filler.length,remainingCodeUnits=fillLen-fLen;filler+=fLen>remainingCodeUnits?$slice(filler,0,remainingCodeUnits):filler}var truncatedStringFiller=filler.length>fillLen?$slice(filler,0,fillLen):filler;return truncatedStringFiller+S}},function(module,exports,__webpack_require__){"use strict";var getPolyfill=__webpack_require__(342),define=__webpack_require__(9);module.exports=function shimPadEnd(){var polyfill=getPolyfill();return define(String.prototype,{padEnd:polyfill},{padEnd:function testPadEnd(){return String.prototype.padEnd!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(343);module.exports=function getPolyfill(){return"function"==typeof String.prototype.padEnd?String.prototype.padEnd:implementation}},function(module,exports,__webpack_require__){"use strict";var ToLength=__webpack_require__(51),ToString=__webpack_require__(40),RequireObjectCoercible=__webpack_require__(32),$slice=__webpack_require__(6)("String.prototype.slice");module.exports=function padEnd(maxLength){var fillString,O=RequireObjectCoercible(this),S=ToString(O),stringLength=ToLength(S.length);arguments.length>1&&(fillString=arguments[1]);var filler=void 0===fillString?"":ToString(fillString);""===filler&&(filler=" ");var intMaxLength=ToLength(maxLength);if(intMaxLength<=stringLength)return S;for(var fillLen=intMaxLength-stringLength;filler.length<fillLen;){var fLen=filler.length,remainingCodeUnits=fillLen-fLen;filler+=fLen>remainingCodeUnits?$slice(filler,0,remainingCodeUnits):filler}var truncatedStringFiller=filler.length>fillLen?$slice(filler,0,fillLen):filler;return S+truncatedStringFiller}},function(module,exports,__webpack_require__){"use strict";var getPolyfill=__webpack_require__(345),define=__webpack_require__(9);module.exports=function shimGetOwnPropertyDescriptors(){var polyfill=getPolyfill();return define(Object,{getOwnPropertyDescriptors:polyfill},{getOwnPropertyDescriptors:function(){return Object.getOwnPropertyDescriptors!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(346);module.exports=function getPolyfill(){return"function"==typeof Object.getOwnPropertyDescriptors?Object.getOwnPropertyDescriptors:implementation}},function(module,exports,__webpack_require__){"use strict";var CreateDataProperty=__webpack_require__(185),IsCallable=__webpack_require__(25),RequireObjectCoercible=__webpack_require__(32),ToObject=__webpack_require__(75),callBound=__webpack_require__(6),$gOPD=Object.getOwnPropertyDescriptor,$getOwnNames=Object.getOwnPropertyNames,$getSymbols=Object.getOwnPropertySymbols,$concat=callBound("Array.prototype.concat"),$reduce=callBound("Array.prototype.reduce"),getAll=$getSymbols?function(obj){return $concat($getOwnNames(obj),$getSymbols(obj))}:$getOwnNames,isES5=IsCallable($gOPD)&&IsCallable($getOwnNames);module.exports=function getOwnPropertyDescriptors(value){if(RequireObjectCoercible(value),!isES5)throw new TypeError("getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor");var O=ToObject(value);return $reduce(getAll(O),(function(acc,key){var descriptor=$gOPD(O,key);return void 0!==descriptor&&CreateDataProperty(acc,key,descriptor),acc}),{})}},function(module,exports,__webpack_require__){"use strict";var $defineProperty=__webpack_require__(1)("%Object.defineProperty%",!0);if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=null}var $isEnumerable=__webpack_require__(6)("Object.prototype.propertyIsEnumerable");module.exports=function DefineOwnProperty(IsDataDescriptor,SameValue,FromPropertyDescriptor,O,P,desc){if(!$defineProperty){if(!IsDataDescriptor(desc))return!1;if(!desc["[[Configurable]]"]||!desc["[[Writable]]"])return!1;if(P in O&&$isEnumerable(O,P)!==!!desc["[[Enumerable]]"])return!1;var V=desc["[[Value]]"];return O[P]=V,SameValue(O[P],V)}return $defineProperty(O,P,FromPropertyDescriptor(desc)),!0}},function(module,exports,__webpack_require__){"use strict";var assertRecord=__webpack_require__(186),Type=__webpack_require__(4);module.exports=function FromPropertyDescriptor(Desc){if(void 0===Desc)return Desc;assertRecord(Type,"Property Descriptor","Desc",Desc);var obj={};return"[[Value]]"in Desc&&(obj.value=Desc["[[Value]]"]),"[[Writable]]"in Desc&&(obj.writable=Desc["[[Writable]]"]),"[[Get]]"in Desc&&(obj.get=Desc["[[Get]]"]),"[[Set]]"in Desc&&(obj.set=Desc["[[Set]]"]),"[[Enumerable]]"in Desc&&(obj.enumerable=Desc["[[Enumerable]]"]),"[[Configurable]]"in Desc&&(obj.configurable=Desc["[[Configurable]]"]),obj}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$gOPD=__webpack_require__(350),$TypeError=GetIntrinsic("%TypeError%"),$isEnumerable=__webpack_require__(6)("Object.prototype.propertyIsEnumerable"),has=__webpack_require__(39),IsArray=__webpack_require__(74),IsPropertyKey=__webpack_require__(33),IsRegExp=__webpack_require__(188),ToPropertyDescriptor=__webpack_require__(351),Type=__webpack_require__(4);module.exports=function OrdinaryGetOwnProperty(O,P){if("Object"!==Type(O))throw new $TypeError("Assertion failed: O must be an Object");if(!IsPropertyKey(P))throw new $TypeError("Assertion failed: P must be a Property Key");if(has(O,P)){if(!$gOPD){var arrayLength=IsArray(O)&&"length"===P,regexLastIndex=IsRegExp(O)&&"lastIndex"===P;return{"[[Configurable]]":!(arrayLength||regexLastIndex),"[[Enumerable]]":$isEnumerable(O,P),"[[Value]]":O[P],"[[Writable]]":!0}}return ToPropertyDescriptor($gOPD(O,P))}}},function(module,exports,__webpack_require__){"use strict";var $gOPD=__webpack_require__(1)("%Object.getOwnPropertyDescriptor%");if($gOPD)try{$gOPD([],"length")}catch(e){$gOPD=null}module.exports=$gOPD},function(module,exports,__webpack_require__){"use strict";var has=__webpack_require__(39),$TypeError=__webpack_require__(1)("%TypeError%"),Type=__webpack_require__(4),ToBoolean=__webpack_require__(124),IsCallable=__webpack_require__(25);module.exports=function ToPropertyDescriptor(Obj){if("Object"!==Type(Obj))throw new $TypeError("ToPropertyDescriptor requires an object");var desc={};if(has(Obj,"enumerable")&&(desc["[[Enumerable]]"]=ToBoolean(Obj.enumerable)),has(Obj,"configurable")&&(desc["[[Configurable]]"]=ToBoolean(Obj.configurable)),has(Obj,"value")&&(desc["[[Value]]"]=Obj.value),has(Obj,"writable")&&(desc["[[Writable]]"]=ToBoolean(Obj.writable)),has(Obj,"get")){var getter=Obj.get;if(void 0!==getter&&!IsCallable(getter))throw new TypeError("getter must be a function");desc["[[Get]]"]=getter}if(has(Obj,"set")){var setter=Obj.set;if(void 0!==setter&&!IsCallable(setter))throw new $TypeError("setter must be a function");desc["[[Set]]"]=setter}if((has(desc,"[[Get]]")||has(desc,"[[Set]]"))&&(has(desc,"[[Value]]")||has(desc,"[[Writable]]")))throw new $TypeError("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return desc}},function(module,exports,__webpack_require__){"use strict";var has=__webpack_require__(39),assertRecord=__webpack_require__(186),Type=__webpack_require__(4);module.exports=function IsDataDescriptor(Desc){return void 0!==Desc&&(assertRecord(Type,"Property Descriptor","Desc",Desc),!(!has(Desc,"[[Value]]")&&!has(Desc,"[[Writable]]")))}},function(module,exports,__webpack_require__){"use strict";var $Object=__webpack_require__(1)("%Object%"),isPrimitive=__webpack_require__(122),$preventExtensions=$Object.preventExtensions,$isExtensible=$Object.isExtensible;module.exports=$preventExtensions?function IsExtensible(obj){return!isPrimitive(obj)&&$isExtensible(obj)}:function IsExtensible(obj){return!isPrimitive(obj)}},function(module,exports,__webpack_require__){"use strict";var $isNaN=__webpack_require__(73);module.exports=function SameValue(x,y){return x===y?0!==x||1/x==1/y:$isNaN(x)&&$isNaN(y)}},function(module,exports,__webpack_require__){"use strict";"function"==typeof Promise&&__webpack_require__(356),__webpack_require__(363)},function(module,exports,__webpack_require__){"use strict";__webpack_require__(357)()},function(module,exports,__webpack_require__){"use strict";var requirePromise=__webpack_require__(125),getPolyfill=__webpack_require__(358),define=__webpack_require__(9);module.exports=function shimPromiseFinally(){requirePromise();var polyfill=getPolyfill();return define(Promise.prototype,{finally:polyfill},{finally:function testFinally(){return Promise.prototype.finally!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var requirePromise=__webpack_require__(125),implementation=__webpack_require__(359);module.exports=function getPolyfill(){return requirePromise(),"function"==typeof Promise.prototype.finally?Promise.prototype.finally:implementation}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(125)();var IsCallable=__webpack_require__(360),SpeciesConstructor=__webpack_require__(361),Type=__webpack_require__(190),promiseResolve=function PromiseResolve(C,value){return new C((function(resolve){resolve(value)}))},OriginalPromise=Promise,promiseFinally=function finally_(onFinally){if("Object"!==Type(this))throw new TypeError("receiver is not an Object");var C=SpeciesConstructor(this,OriginalPromise),thenFinally=onFinally,catchFinally=onFinally;return IsCallable(onFinally)&&(thenFinally=function CreateThenFinally(C,onFinally){return function(value){var result=onFinally();return promiseResolve(C,result).then((function(){return value}))}}(C,onFinally),catchFinally=function CreateCatchFinally(C,onFinally){return function(reason){var result=onFinally();return promiseResolve(C,result).then((function(){throw reason}))}}(C,onFinally)),this.then(thenFinally,catchFinally)};if(Object.getOwnPropertyDescriptor){var descriptor=Object.getOwnPropertyDescriptor(promiseFinally,"name");descriptor&&descriptor.configurable&&Object.defineProperty(promiseFinally,"name",{configurable:!0,value:"finally"})}module.exports=promiseFinally},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(119)},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$species=GetIntrinsic("%Symbol.species%",!0),$TypeError=GetIntrinsic("%TypeError%"),IsConstructor=__webpack_require__(362),Type=__webpack_require__(190);module.exports=function SpeciesConstructor(O,defaultConstructor){if("Object"!==Type(O))throw new $TypeError("Assertion failed: Type(O) is not Object");var C=O.constructor;if(void 0===C)return defaultConstructor;if("Object"!==Type(C))throw new $TypeError("O.constructor is not an Object");var S=$species?C[$species]:void 0;if(null==S)return defaultConstructor;if(IsConstructor(S))return S;throw new $TypeError("no constructor found")}},function(module,exports,__webpack_require__){"use strict";module.exports=function IsConstructor(argument){return"function"==typeof argument&&!!argument.prototype}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(364),__webpack_require__(369),__webpack_require__(373),__webpack_require__(378),__webpack_require__(392)},function(module,exports,__webpack_require__){"use strict";__webpack_require__(365)()},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),getPolyfill=__webpack_require__(366);module.exports=function shimFlat(){var polyfill=getPolyfill();return define(Array.prototype,{flat:polyfill},{flat:function(){return Array.prototype.flat!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(367);module.exports=function getPolyfill(){return Array.prototype.flat||implementation}},function(module,exports,__webpack_require__){"use strict";var ArraySpeciesCreate=__webpack_require__(126),FlattenIntoArray=__webpack_require__(193),Get=__webpack_require__(18),ToInteger=__webpack_require__(182),ToLength=__webpack_require__(51),ToObject=__webpack_require__(75);module.exports=function flat(){var O=ToObject(this),sourceLen=ToLength(Get(O,"length")),depthNum=1;arguments.length>0&&void 0!==arguments[0]&&(depthNum=ToInteger(arguments[0]));var A=ArraySpeciesCreate(O,0);return FlattenIntoArray(A,O,sourceLen,0,depthNum),A}},,function(module,exports,__webpack_require__){"use strict";__webpack_require__(370)()},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),getPolyfill=__webpack_require__(371);module.exports=function shimFlatMap(){var polyfill=getPolyfill();return define(Array.prototype,{flatMap:polyfill},{flatMap:function(){return Array.prototype.flatMap!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(372);module.exports=function getPolyfill(){return Array.prototype.flatMap||implementation}},function(module,exports,__webpack_require__){"use strict";var ArraySpeciesCreate=__webpack_require__(126),FlattenIntoArray=__webpack_require__(193),Get=__webpack_require__(18),IsCallable=__webpack_require__(25),ToLength=__webpack_require__(51),ToObject=__webpack_require__(75);module.exports=function flatMap(mapperFunction){var T,O=ToObject(this),sourceLen=ToLength(Get(O,"length"));if(!IsCallable(mapperFunction))throw new TypeError("mapperFunction must be a function");arguments.length>1&&(T=arguments[1]);var A=ArraySpeciesCreate(O,0);return FlattenIntoArray(A,O,sourceLen,0,1,mapperFunction,T),A}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(374)()},function(module,exports,__webpack_require__){"use strict";var hasSymbols=__webpack_require__(26)(),polyfill=__webpack_require__(375),getInferredName=__webpack_require__(195),gOPD=Object.getOwnPropertyDescriptor,dP=Object.defineProperty,setProto=Object.setPrototypeOf,define=function defineGetter(getter){dP(Symbol.prototype,"description",{configurable:!0,enumerable:!1,get:getter})};module.exports=function shimSymbolDescription(){if(!hasSymbols)return!1;var desc=gOPD(Symbol.prototype,"description"),getter=polyfill(),isMissing=!desc||"function"!=typeof desc.get,isBroken=!isMissing&&(void 0!==Symbol().description||""!==Symbol("").description);if(isMissing||isBroken){if(!getInferredName)return function shimGlobalSymbol(getter){var origSym=Function.apply.bind(Symbol),emptyStrings=Object.create?Object.create(null):{},SymNew=function Symbol(){var sym=origSym(this,arguments);return arguments.length>0&&""===arguments[0]&&(emptyStrings[sym]=!0),sym};SymNew.prototype=Symbol.prototype,setProto(SymNew,Symbol),Symbol=SymNew;var boundGetter=Function.call.bind(getter),wrappedGetter=function description(){var symbolDescription=boundGetter(this);return emptyStrings[this]?"":symbolDescription};return define(wrappedGetter),wrappedGetter}(getter);define(getter)}return getter}},function(module,exports,__webpack_require__){"use strict";var hasSymbols=__webpack_require__(26)(),implementation=__webpack_require__(376),gOPD=Object.getOwnPropertyDescriptor;module.exports=function descriptionPolyfill(){if(!hasSymbols||"function"!=typeof gOPD)return null;var desc=gOPD(Symbol.prototype,"description");if(!desc||"function"!=typeof desc.get)return implementation;var emptySymbolDesc=desc.get.call(Symbol());return(void 0===emptySymbolDesc||""===emptySymbolDesc)&&"a"===desc.get.call(Symbol("a"))?desc.get:implementation}},function(module,exports,__webpack_require__){"use strict";var getSymbolDescription=__webpack_require__(377);module.exports=function description(){return getSymbolDescription(this)}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),callBound=__webpack_require__(6),$SyntaxError=GetIntrinsic("%SyntaxError%"),symToStr=callBound("Symbol.prototype.toString",!0),getInferredName=__webpack_require__(195);module.exports=function getSymbolDescription(symbol){if(!symToStr)throw new $SyntaxError("Symbols are not supported in this environment");var str=symToStr(symbol);if(getInferredName){var name=getInferredName(symbol);if(""===name)return;return name.slice(1,-1)}var desc=str.slice(7,-1);if(desc)return desc}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(379)()},function(module,exports,__webpack_require__){"use strict";var getPolyfill=__webpack_require__(380),define=__webpack_require__(9);module.exports=function shimEntries(){var polyfill=getPolyfill();return define(Object,{fromEntries:polyfill},{fromEntries:function testEntries(){return Object.fromEntries!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(381);module.exports=function getPolyfill(){return"function"==typeof Object.fromEntries?Object.fromEntries:implementation}},function(module,exports,__webpack_require__){"use strict";var AddEntriesFromIterable=__webpack_require__(382),CreateDataPropertyOrThrow=__webpack_require__(127),Get=__webpack_require__(18),IsArray=__webpack_require__(74),RequireObjectCoercible=__webpack_require__(32),ToPropertyKey=__webpack_require__(391),Type=__webpack_require__(4),adder=function addDataProperty(key,value){var propertyKey=ToPropertyKey(key);CreateDataPropertyOrThrow(this,propertyKey,value)},hasSymbols="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");module.exports=function fromEntries(iterable){RequireObjectCoercible(iterable);var obj={};if(!hasSymbols){if(!IsArray(iterable))throw new TypeError("this environment lacks native Symbols, and can not support non-Array iterables");return function assign(obj,entries){for(var i=0;i<entries.length;++i){var entry=entries[i];if("Object"!==Type(entry))throw new TypeError("iterator returned a non-object; entry expected");var key=Get(entry,"0"),value=Get(entry,"1"),propertyKey=ToPropertyKey(key);CreateDataPropertyOrThrow(obj,propertyKey,value)}}(obj,iterable),obj}return AddEntriesFromIterable(obj,iterable,adder)}},function(module,exports,__webpack_require__){"use strict";var inspect=__webpack_require__(93),$TypeError=__webpack_require__(1)("%TypeError%"),Call=__webpack_require__(41),Get=__webpack_require__(18),GetIterator=__webpack_require__(383),IsCallable=__webpack_require__(25),IteratorClose=__webpack_require__(385),IteratorStep=__webpack_require__(386),IteratorValue=__webpack_require__(390),Type=__webpack_require__(4);module.exports=function AddEntriesFromIterable(target,iterable,adder){if(!IsCallable(adder))throw new $TypeError("Assertion failed: `adder` is not callable");if(null==iterable)throw new $TypeError("Assertion failed: `iterable` is present, and not nullish");for(var iteratorRecord=GetIterator(iterable);;){var next=IteratorStep(iteratorRecord);if(!next)return target;var nextItem=IteratorValue(next);if("Object"!==Type(nextItem)){var error=new $TypeError("iterator next must return an Object, got "+inspect(nextItem));return IteratorClose(iteratorRecord,(function(){throw error}))}try{var k=Get(nextItem,"0"),v=Get(nextItem,"1");Call(adder,target,[k,v])}catch(e){return IteratorClose(iteratorRecord,(function(){throw e}))}}}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),getIteratorMethod=__webpack_require__(384),AdvanceStringIndex=__webpack_require__(196),Call=__webpack_require__(41),GetMethod=__webpack_require__(128),IsArray=__webpack_require__(74),Type=__webpack_require__(4);module.exports=function GetIterator(obj,method){var actualMethod=method;arguments.length<2&&(actualMethod=getIteratorMethod({AdvanceStringIndex:AdvanceStringIndex,GetMethod:GetMethod,IsArray:IsArray,Type:Type},obj));var iterator=Call(actualMethod,obj);if("Object"!==Type(iterator))throw new $TypeError("iterator must return an object");return iterator}},function(module,exports,__webpack_require__){"use strict";var hasSymbols=__webpack_require__(26)(),GetIntrinsic=__webpack_require__(1),callBound=__webpack_require__(6),$iterator=GetIntrinsic("%Symbol.iterator%",!0),$stringSlice=callBound("String.prototype.slice");module.exports=function getIteratorMethod(ES,iterable){var usingIterator;return hasSymbols?usingIterator=ES.GetMethod(iterable,$iterator):ES.IsArray(iterable)?usingIterator=function(){var i=-1,arr=this;return{next:function(){return{done:(i+=1)>=arr.length,value:arr[i]}}}}:"String"===ES.Type(iterable)&&(usingIterator=function(){var i=0;return{next:function(){var nextIndex=ES.AdvanceStringIndex(iterable,i,!0),value=$stringSlice(iterable,i,nextIndex);return i=nextIndex,{done:nextIndex>iterable.length,value:value}}}}),usingIterator}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),Call=__webpack_require__(41),GetMethod=__webpack_require__(128),IsCallable=__webpack_require__(25),Type=__webpack_require__(4);module.exports=function IteratorClose(iterator,completion){if("Object"!==Type(iterator))throw new $TypeError("Assertion failed: Type(iterator) is not Object");if(!IsCallable(completion))throw new $TypeError("Assertion failed: completion is not a thunk for a Completion Record");var completionRecord,completionThunk=completion,iteratorReturn=GetMethod(iterator,"return");if(void 0===iteratorReturn)return completionThunk();try{var innerResult=Call(iteratorReturn,iterator,[])}catch(e){throw completionThunk(),completionThunk=null,e}if(completionRecord=completionThunk(),completionThunk=null,"Object"!==Type(innerResult))throw new $TypeError("iterator .return must return an object");return completionRecord}},function(module,exports,__webpack_require__){"use strict";var IteratorComplete=__webpack_require__(387),IteratorNext=__webpack_require__(388);module.exports=function IteratorStep(iterator){var result=IteratorNext(iterator);return!0!==IteratorComplete(result)&&result}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),Get=__webpack_require__(18),ToBoolean=__webpack_require__(124),Type=__webpack_require__(4);module.exports=function IteratorComplete(iterResult){if("Object"!==Type(iterResult))throw new $TypeError("Assertion failed: Type(iterResult) is not Object");return ToBoolean(Get(iterResult,"done"))}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),Invoke=__webpack_require__(389),Type=__webpack_require__(4);module.exports=function IteratorNext(iterator,value){var result=Invoke(iterator,"next",arguments.length<2?[]:[value]);if("Object"!==Type(result))throw new $TypeError("iterator next must return an object");return result}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),$arraySlice=__webpack_require__(6)("Array.prototype.slice"),Call=__webpack_require__(41),GetV=__webpack_require__(197),IsPropertyKey=__webpack_require__(33);module.exports=function Invoke(O,P){if(!IsPropertyKey(P))throw new $TypeError("P must be a Property Key");var argumentsList=$arraySlice(arguments,2),func=GetV(O,P);return Call(func,O,argumentsList)}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),Get=__webpack_require__(18),Type=__webpack_require__(4);module.exports=function IteratorValue(iterResult){if("Object"!==Type(iterResult))throw new $TypeError("Assertion failed: Type(iterResult) is not Object");return Get(iterResult,"value")}},function(module,exports,__webpack_require__){"use strict";var $String=__webpack_require__(1)("%String%"),ToPrimitive=__webpack_require__(184),ToString=__webpack_require__(40);module.exports=function ToPropertyKey(argument){var key=ToPrimitive(argument,$String);return"symbol"==typeof key?key:ToString(key)}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(393),__webpack_require__(406),__webpack_require__(410)},function(module,exports,__webpack_require__){"use strict";__webpack_require__(394)()},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),hasSymbols=__webpack_require__(26)(),getPolyfill=__webpack_require__(395),regexpMatchAllPolyfill=__webpack_require__(201),defineP=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor;module.exports=function shimMatchAll(){var polyfill=getPolyfill();if(define(String.prototype,{matchAll:polyfill},{matchAll:function(){return String.prototype.matchAll!==polyfill}}),hasSymbols){var symbol=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(define(Symbol,{matchAll:symbol},{matchAll:function(){return Symbol.matchAll!==symbol}}),defineP&&gOPD){var desc=gOPD(Symbol,symbol);desc&&!desc.configurable||defineP(Symbol,symbol,{configurable:!1,enumerable:!1,value:symbol,writable:!1})}var regexpMatchAll=regexpMatchAllPolyfill(),func={};func[symbol]=regexpMatchAll;var predicate={};predicate[symbol]=function(){return RegExp.prototype[symbol]!==regexpMatchAll},define(RegExp.prototype,func,predicate)}return polyfill}},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(396);module.exports=function getPolyfill(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(e){return String.prototype.matchAll}return implementation}},function(module,exports,__webpack_require__){"use strict";var Call=__webpack_require__(41),Get=__webpack_require__(18),GetMethod=__webpack_require__(128),IsRegExp=__webpack_require__(188),ToString=__webpack_require__(40),RequireObjectCoercible=__webpack_require__(32),callBound=__webpack_require__(6),hasSymbols=__webpack_require__(26)(),flagsGetter=__webpack_require__(198),$indexOf=callBound("String.prototype.indexOf"),regexpMatchAllPolyfill=__webpack_require__(201),getMatcher=function getMatcher(regexp){var matcherPolyfill=regexpMatchAllPolyfill();if(hasSymbols&&"symbol"==typeof Symbol.matchAll){var matcher=GetMethod(regexp,Symbol.matchAll);return matcher===RegExp.prototype[Symbol.matchAll]&&matcher!==matcherPolyfill?matcherPolyfill:matcher}if(IsRegExp(regexp))return matcherPolyfill};module.exports=function matchAll(regexp){var O=RequireObjectCoercible(this);if(null!=regexp){if(IsRegExp(regexp)){var flags="flags"in regexp?Get(regexp,"flags"):flagsGetter(regexp);if(RequireObjectCoercible(flags),$indexOf(ToString(flags),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var matcher=getMatcher(regexp);if(void 0!==matcher)return Call(matcher,regexp,[O])}var S=ToString(O),rx=new RegExp(regexp,"g");return Call(getMatcher(rx),rx,[S])}},function(module,exports,__webpack_require__){"use strict";var supportsDescriptors=__webpack_require__(9).supportsDescriptors,getPolyfill=__webpack_require__(200),gOPD=Object.getOwnPropertyDescriptor,defineProperty=Object.defineProperty,TypeErr=TypeError,getProto=Object.getPrototypeOf,regex=/a/;module.exports=function shimFlags(){if(!supportsDescriptors||!getProto)throw new TypeErr("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var polyfill=getPolyfill(),proto=getProto(regex),descriptor=gOPD(proto,"flags");return descriptor&&descriptor.get===polyfill||defineProperty(proto,"flags",{configurable:!0,enumerable:!1,get:polyfill}),polyfill}},function(module,exports,__webpack_require__){"use strict";var Get=__webpack_require__(18),Set=__webpack_require__(202),SpeciesConstructor=__webpack_require__(399),ToLength=__webpack_require__(51),ToString=__webpack_require__(40),Type=__webpack_require__(4),flagsGetter=__webpack_require__(198),RegExpStringIterator=__webpack_require__(400),OrigRegExp=RegExp,supportsConstructingWithFlags="flags"in RegExp.prototype,regexMatchAll=function SymbolMatchAll(string){var R=this;if("Object"!==Type(R))throw new TypeError('"this" value must be an Object');var S=ToString(string),tmp=function constructRegex(C,R){var flags="flags"in R?Get(R,"flags"):ToString(flagsGetter(R));return{flags:flags,matcher:new C(supportsConstructingWithFlags&&"string"==typeof flags?R:C===OrigRegExp?R.source:R,flags)}}(SpeciesConstructor(R,OrigRegExp),R),flags=tmp.flags,matcher=tmp.matcher,lastIndex=ToLength(Get(R,"lastIndex"));return Set(matcher,"lastIndex",lastIndex,!0),function CreateRegExpStringIterator(R,S,global,fullUnicode){if("String"!==Type(S))throw new TypeError('"S" value must be a String');if("Boolean"!==Type(global))throw new TypeError('"global" value must be a Boolean');if("Boolean"!==Type(fullUnicode))throw new TypeError('"fullUnicode" value must be a Boolean');return new RegExpStringIterator(R,S,global,fullUnicode)}(matcher,S,flags.indexOf("g")>-1,flags.indexOf("u")>-1)},defineP=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor;if(defineP&&gOPD){var desc=gOPD(regexMatchAll,"name");desc&&desc.configurable&&defineP(regexMatchAll,"name",{value:"[Symbol.matchAll]"})}module.exports=regexMatchAll},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$species=GetIntrinsic("%Symbol.species%",!0),$TypeError=GetIntrinsic("%TypeError%"),IsConstructor=__webpack_require__(191),Type=__webpack_require__(4);module.exports=function SpeciesConstructor(O,defaultConstructor){if("Object"!==Type(O))throw new $TypeError("Assertion failed: Type(O) is not Object");var C=O.constructor;if(void 0===C)return defaultConstructor;if("Object"!==Type(C))throw new $TypeError("O.constructor is not an Object");var S=$species?C[$species]:void 0;if(null==S)return defaultConstructor;if(IsConstructor(S))return S;throw new $TypeError("no constructor found")}},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),AdvanceStringIndex=__webpack_require__(196),CreateIterResultObject=__webpack_require__(401),Get=__webpack_require__(18),GetIntrinsic=__webpack_require__(1),ObjectCreate=__webpack_require__(402),RegExpExec=__webpack_require__(403),Set=__webpack_require__(202),ToLength=__webpack_require__(51),ToString=__webpack_require__(40),Type=__webpack_require__(4),hasSymbols=__webpack_require__(26)(),SLOT=__webpack_require__(404),RegExpStringIterator=function RegExpStringIterator(R,S,global,fullUnicode){if("String"!==Type(S))throw new TypeError("S must be a string");if("Boolean"!==Type(global))throw new TypeError("global must be a boolean");if("Boolean"!==Type(fullUnicode))throw new TypeError("fullUnicode must be a boolean");SLOT.set(this,"[[IteratingRegExp]]",R),SLOT.set(this,"[[IteratedString]]",S),SLOT.set(this,"[[Global]]",global),SLOT.set(this,"[[Unicode]]",fullUnicode),SLOT.set(this,"[[Done]]",!1)},IteratorPrototype=GetIntrinsic("%IteratorPrototype%",!0);if(IteratorPrototype&&(RegExpStringIterator.prototype=ObjectCreate(IteratorPrototype)),define(RegExpStringIterator.prototype,{next:function next(){var O=this;if("Object"!==Type(O))throw new TypeError("receiver must be an object");if(!(O instanceof RegExpStringIterator&&SLOT.has(O,"[[IteratingRegExp]]")&&SLOT.has(O,"[[IteratedString]]")&&SLOT.has(O,"[[Global]]")&&SLOT.has(O,"[[Unicode]]")&&SLOT.has(O,"[[Done]]")))throw new TypeError('"this" value must be a RegExpStringIterator instance');if(SLOT.get(O,"[[Done]]"))return CreateIterResultObject(void 0,!0);var R=SLOT.get(O,"[[IteratingRegExp]]"),S=SLOT.get(O,"[[IteratedString]]"),global=SLOT.get(O,"[[Global]]"),fullUnicode=SLOT.get(O,"[[Unicode]]"),match=RegExpExec(R,S);if(null===match)return SLOT.set(O,"[[Done]]",!0),CreateIterResultObject(void 0,!0);if(global){if(""===ToString(Get(match,"0"))){var thisIndex=ToLength(Get(R,"lastIndex")),nextIndex=AdvanceStringIndex(S,thisIndex,fullUnicode);Set(R,"lastIndex",nextIndex,!0)}return CreateIterResultObject(match,!1)}return SLOT.set(O,"[[Done]]",!0),CreateIterResultObject(match,!1)}}),hasSymbols){var defineP=Object.defineProperty;if(Symbol.toStringTag&&(defineP?defineP(RegExpStringIterator.prototype,Symbol.toStringTag,{configurable:!0,enumerable:!1,value:"RegExp String Iterator",writable:!1}):RegExpStringIterator.prototype[Symbol.toStringTag]="RegExp String Iterator"),!IteratorPrototype&&Symbol.iterator){var func={};func[Symbol.iterator]=RegExpStringIterator.prototype[Symbol.iterator]||function SymbolIterator(){return this};var predicate={};predicate[Symbol.iterator]=function(){return RegExpStringIterator.prototype[Symbol.iterator]!==func[Symbol.iterator]},define(RegExpStringIterator.prototype,func,predicate)}}module.exports=RegExpStringIterator},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),Type=__webpack_require__(4);module.exports=function CreateIterResultObject(value,done){if("Boolean"!==Type(done))throw new $TypeError("Assertion failed: Type(done) is not Boolean");return{value:value,done:done}}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),$ObjectCreate=GetIntrinsic("%Object.create%",!0),$TypeError=GetIntrinsic("%TypeError%"),$SyntaxError=GetIntrinsic("%SyntaxError%"),Type=__webpack_require__(4),hasProto=!({__proto__:null}instanceof Object);module.exports=function ObjectCreate(proto,internalSlotsList){if(null!==proto&&"Object"!==Type(proto))throw new $TypeError("Assertion failed: `proto` must be null or an object");var slots=arguments.length<2?[]:internalSlotsList;if(slots.length>0)throw new $SyntaxError("es-abstract does not yet support internal slots");if($ObjectCreate)return $ObjectCreate(proto);if(hasProto)return{__proto__:proto};if(null===proto)throw new $SyntaxError("native Object.create support is required to create null objects");var T=function T(){};return T.prototype=proto,new T}},function(module,exports,__webpack_require__){"use strict";var $TypeError=__webpack_require__(1)("%TypeError%"),regexExec=__webpack_require__(6)("RegExp.prototype.exec"),Call=__webpack_require__(41),Get=__webpack_require__(18),IsCallable=__webpack_require__(25),Type=__webpack_require__(4);module.exports=function RegExpExec(R,S){if("Object"!==Type(R))throw new $TypeError("Assertion failed: `R` must be an Object");if("String"!==Type(S))throw new $TypeError("Assertion failed: `S` must be a String");var exec=Get(R,"exec");if(IsCallable(exec)){var result=Call(exec,R,[S]);if(null===result||"Object"===Type(result))return result;throw new $TypeError('"exec" method must return `null` or an Object')}return regexExec(R,S)}},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),has=__webpack_require__(39),channel=__webpack_require__(405)(),$TypeError=GetIntrinsic("%TypeError%"),SLOT={assert:function(O,slot){if(!O||"object"!=typeof O&&"function"!=typeof O)throw new $TypeError("`O` is not an object");if("string"!=typeof slot)throw new $TypeError("`slot` must be a string");channel.assert(O)},get:function(O,slot){if(!O||"object"!=typeof O&&"function"!=typeof O)throw new $TypeError("`O` is not an object");if("string"!=typeof slot)throw new $TypeError("`slot` must be a string");var slots=channel.get(O);return slots&&slots["$"+slot]},has:function(O,slot){if(!O||"object"!=typeof O&&"function"!=typeof O)throw new $TypeError("`O` is not an object");if("string"!=typeof slot)throw new $TypeError("`slot` must be a string");var slots=channel.get(O);return!!slots&&has(slots,"$"+slot)},set:function(O,slot,V){if(!O||"object"!=typeof O&&"function"!=typeof O)throw new $TypeError("`O` is not an object");if("string"!=typeof slot)throw new $TypeError("`slot` must be a string");var slots=channel.get(O);slots||(slots={},channel.set(O,slots)),slots["$"+slot]=V}};Object.freeze&&Object.freeze(SLOT),module.exports=SLOT},function(module,exports,__webpack_require__){"use strict";var GetIntrinsic=__webpack_require__(1),callBound=__webpack_require__(6),inspect=__webpack_require__(93),$TypeError=GetIntrinsic("%TypeError%"),$WeakMap=GetIntrinsic("%WeakMap%",!0),$Map=GetIntrinsic("%Map%",!0),$push=callBound("Array.prototype.push"),$weakMapGet=callBound("WeakMap.prototype.get",!0),$weakMapSet=callBound("WeakMap.prototype.set",!0),$weakMapHas=callBound("WeakMap.prototype.has",!0),$mapGet=callBound("Map.prototype.get",!0),$mapSet=callBound("Map.prototype.set",!0),$mapHas=callBound("Map.prototype.has",!0);module.exports=function getSideChannel(){var $wm,$m,$o,channel={assert:function(key){if(!channel.has(key))throw new $TypeError("Side channel does not contain "+inspect(key))},get:function(key){if($WeakMap&&key&&("object"==typeof key||"function"==typeof key)){if($wm)return $weakMapGet($wm,key)}else if($Map){if($m)return $mapGet($m,key)}else if($o)return function(objects,key){for(var i=0;i<objects.length;i+=1)if(objects[i].key===key)return objects[i].value}($o,key)},has:function(key){if($WeakMap&&key&&("object"==typeof key||"function"==typeof key)){if($wm)return $weakMapHas($wm,key)}else if($Map){if($m)return $mapHas($m,key)}else if($o)return function(objects,key){for(var i=0;i<objects.length;i+=1)if(objects[i].key===key)return!0;return!1}($o,key);return!1},set:function(key,value){$WeakMap&&key&&("object"==typeof key||"function"==typeof key)?($wm||($wm=new $WeakMap),$weakMapSet($wm,key,value)):$Map?($m||($m=new $Map),$mapSet($m,key,value)):($o||($o=[]),function(objects,key,value){for(var i=0;i<objects.length;i+=1)if(objects[i].key===key)return void(objects[i].value=value);$push(objects,{key:key,value:value})}($o,key,value))}};return channel}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(407)()},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),getPolyfill=__webpack_require__(408);module.exports=function shimGlobal(){var polyfill=getPolyfill();if(define.supportsDescriptors){var descriptor=Object.getOwnPropertyDescriptor(polyfill,"globalThis");(!descriptor||descriptor.configurable&&(descriptor.enumerable||descriptor.writable||globalThis!==polyfill))&&Object.defineProperty(polyfill,"globalThis",{configurable:!0,enumerable:!1,value:polyfill,writable:!1})}else"object"==typeof globalThis&&globalThis===polyfill||(polyfill.globalThis=polyfill);return polyfill}},function(module,exports,__webpack_require__){"use strict";(function(global){var implementation=__webpack_require__(409);module.exports=function getPolyfill(){return"object"==typeof global&&global&&global.Math===Math&&global.Array===Array?global:implementation}}).call(this,__webpack_require__(20))},function(module,exports,__webpack_require__){"use strict";"undefined"!=typeof self?module.exports=self:"undefined"!=typeof window?module.exports=window:module.exports=Function("return this")()},function(module,exports,__webpack_require__){"use strict";__webpack_require__(411)()},function(module,exports,__webpack_require__){"use strict";var requirePromise=__webpack_require__(129),getPolyfill=__webpack_require__(412),define=__webpack_require__(9);module.exports=function shimAllSettled(){requirePromise();var polyfill=getPolyfill();return define(Promise,{allSettled:polyfill},{allSettled:function testAllSettled(){return Promise.allSettled!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){"use strict";var requirePromise=__webpack_require__(129),implementation=__webpack_require__(413);module.exports=function getPolyfill(){return requirePromise(),"function"==typeof Promise.allSettled?Promise.allSettled:implementation}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(129)();var PromiseResolve=__webpack_require__(414),Type=__webpack_require__(4),iterate=__webpack_require__(415),map=__webpack_require__(422),getIntrinsic=__webpack_require__(1),bind=__webpack_require__(72),all=bind.call(Function.call,getIntrinsic("%Promise_all%")),reject=bind.call(Function.call,getIntrinsic("%Promise_reject%"));module.exports=function allSettled(iterable){var C=this;if("Object"!==Type(C))throw new TypeError("`this` value must be an object");var values=iterate(iterable);return all(C,map(values,(function(item){var itemPromise=PromiseResolve(C,item);try{return itemPromise.then((function(value){return{status:"fulfilled",value:value}}),(function(reason){return{status:"rejected",reason:reason}}))}catch(e){return reject(C,e)}})))}},function(module,exports,__webpack_require__){"use strict";var $PromiseResolve=__webpack_require__(6)("Promise.resolve",!0);module.exports=function PromiseResolve(C,x){if(!$PromiseResolve)throw new SyntaxError("This environment does not support Promises.");return $PromiseResolve(C,x)}},function(module,exports,__webpack_require__){"use strict";var getIterator=__webpack_require__(416),$TypeError=TypeError,iterate=__webpack_require__(421);module.exports=function iterateValue(iterable){var iterator=getIterator(iterable);if(!iterator)throw new $TypeError("non-iterable value provided");return arguments.length>1?iterate(iterator,arguments[1]):iterate(iterator)}},function(module,exports,__webpack_require__){"use strict";(function(process){var isArguments=__webpack_require__(417);if(__webpack_require__(26)()||__webpack_require__(175)()){var $iterator=Symbol.iterator;module.exports=function getIterator(iterable){return null!=iterable&&void 0!==iterable[$iterator]?iterable[$iterator]():isArguments(iterable)?Array.prototype[$iterator].call(iterable):void 0}}else{var isArray=__webpack_require__(418),isString=__webpack_require__(123),GetIntrinsic=__webpack_require__(1),$Map=GetIntrinsic("%Map%",!0),$Set=GetIntrinsic("%Set%",!0),callBound=__webpack_require__(6),$arrayPush=callBound("Array.prototype.push"),$charCodeAt=callBound("String.prototype.charCodeAt"),$stringSlice=callBound("String.prototype.slice"),getArrayIterator=function getArrayIterator(arraylike){var i=0;return{next:function next(){var value,done=i>=arraylike.length;return done||(value=arraylike[i],i+=1),{done:done,value:value}}}},getNonCollectionIterator=function getNonCollectionIterator(iterable){if(isArray(iterable)||isArguments(iterable))return getArrayIterator(iterable);if(isString(iterable)){var i=0;return{next:function next(){var nextIndex=function advanceStringIndex(S,index){if(index+1>=S.length)return index+1;var first=$charCodeAt(S,index);if(first<55296||first>56319)return index+1;var second=$charCodeAt(S,index+1);return second<56320||second>57343?index+1:index+2}(iterable,i),value=$stringSlice(iterable,i,nextIndex);return i=nextIndex,{done:nextIndex>iterable.length,value:value}}}}};if($Map||$Set){var isMap=__webpack_require__(419),isSet=__webpack_require__(420),$mapForEach=callBound("Map.prototype.forEach",!0),$setForEach=callBound("Set.prototype.forEach",!0);if(void 0===process||!process.versions||!process.versions.node)var $mapIterator=callBound("Map.prototype.iterator",!0),$setIterator=callBound("Set.prototype.iterator",!0),getStopIterationIterator=function(iterator){var done=!1;return{next:function next(){try{return{done:done,value:done?void 0:iterator.next()}}catch(e){return done=!0,{done:!0,value:void 0}}}}};var $mapAtAtIterator=callBound("Map.prototype.@@iterator",!0)||callBound("Map.prototype._es6-shim iterator_",!0),$setAtAtIterator=callBound("Set.prototype.@@iterator",!0)||callBound("Set.prototype._es6-shim iterator_",!0);module.exports=function getIterator(iterable){return function getCollectionIterator(iterable){if(isMap(iterable)){if($mapIterator)return getStopIterationIterator($mapIterator(iterable));if($mapAtAtIterator)return $mapAtAtIterator(iterable);if($mapForEach){var entries=[];return $mapForEach(iterable,(function(v,k){$arrayPush(entries,[k,v])})),getArrayIterator(entries)}}if(isSet(iterable)){if($setIterator)return getStopIterationIterator($setIterator(iterable));if($setAtAtIterator)return $setAtAtIterator(iterable);if($setForEach){var values=[];return $setForEach(iterable,(function(v){$arrayPush(values,v)})),getArrayIterator(values)}}}(iterable)||getNonCollectionIterator(iterable)}}else module.exports=getNonCollectionIterator}}).call(this,__webpack_require__(91))},function(module,exports,__webpack_require__){"use strict";var hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,toStr=Object.prototype.toString,isStandardArguments=function isArguments(value){return!(hasToStringTag&&value&&"object"==typeof value&&Symbol.toStringTag in value)&&"[object Arguments]"===toStr.call(value)},isLegacyArguments=function isArguments(value){return!!isStandardArguments(value)||null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&"[object Array]"!==toStr.call(value)&&"[object Function]"===toStr.call(value.callee)},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments,module.exports=supportsStandardArguments?isStandardArguments:isLegacyArguments},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports,__webpack_require__){"use strict";var exported,$Map="function"==typeof Map&&Map.prototype?Map:null,$Set="function"==typeof Set&&Set.prototype?Set:null;$Map||(exported=function isMap(x){return!1});var $mapHas=$Map?Map.prototype.has:null,$setHas=$Set?Set.prototype.has:null;exported||$mapHas||(exported=function isMap(x){return!1}),module.exports=exported||function isMap(x){if(!x||"object"!=typeof x)return!1;try{if($mapHas.call(x),$setHas)try{$setHas.call(x)}catch(e){return!0}return x instanceof $Map}catch(e){}return!1}},function(module,exports,__webpack_require__){"use strict";var exported,$Map="function"==typeof Map&&Map.prototype?Map:null,$Set="function"==typeof Set&&Set.prototype?Set:null;$Set||(exported=function isSet(x){return!1});var $mapHas=$Map?Map.prototype.has:null,$setHas=$Set?Set.prototype.has:null;exported||$setHas||(exported=function isSet(x){return!1}),module.exports=exported||function isSet(x){if(!x||"object"!=typeof x)return!1;try{if($setHas.call(x),$mapHas)try{$mapHas.call(x)}catch(e){return!0}return x instanceof $Set}catch(e){}return!1}},function(module,exports,__webpack_require__){"use strict";var $TypeError=TypeError;module.exports=function iterateIterator(iterator){if(!iterator||"function"!=typeof iterator.next)throw new $TypeError("iterator must be an object with a `next` method");if(arguments.length>1){var callback=arguments[1];if("function"!=typeof callback)throw new $TypeError("`callback`, if provided, must be a function")}for(var result,values=callback||[];(result=iterator.next())&&!result.done;)callback?callback(result.value):values.push(result.value);if(!callback)return values}},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),RequireObjectCoercible=__webpack_require__(32),callBound=__webpack_require__(6),implementation=__webpack_require__(203),getPolyfill=__webpack_require__(204),polyfill=getPolyfill(),shim=__webpack_require__(425),$slice=callBound("Array.prototype.slice"),boundMapShim=function map(array,callbackfn){return RequireObjectCoercible(array),polyfill.apply(array,$slice(arguments,1))};define(boundMapShim,{getPolyfill:getPolyfill,implementation:implementation,shim:shim}),module.exports=boundMapShim},function(module,exports,__webpack_require__){"use strict";var ToNumber=__webpack_require__(183);module.exports=function ToUint32(x){return ToNumber(x)>>>0}},function(module,exports){module.exports=function properlyBoxed(method){var properlyBoxesNonStrict=!0,properlyBoxesStrict=!0,threwException=!1;if("function"==typeof method){try{method.call("f",(function(_,__,O){"object"!=typeof O&&(properlyBoxesNonStrict=!1)})),method.call([null],(function(){"use strict";properlyBoxesStrict="string"==typeof this}),"x")}catch(e){threwException=!0}return!threwException&&properlyBoxesNonStrict&&properlyBoxesStrict}return!1}},function(module,exports,__webpack_require__){"use strict";var define=__webpack_require__(9),getPolyfill=__webpack_require__(204);module.exports=function shimArrayPrototypeMap(){var polyfill=getPolyfill();return define(Array.prototype,{map:polyfill},{map:function(){return Array.prototype.map!==polyfill}}),polyfill}},function(module,exports,__webpack_require__){var parent=__webpack_require__(427);__webpack_require__(445),__webpack_require__(446),__webpack_require__(447),__webpack_require__(448),__webpack_require__(449),module.exports=parent},function(module,exports,__webpack_require__){__webpack_require__(27),__webpack_require__(23),__webpack_require__(29),__webpack_require__(431),__webpack_require__(46),__webpack_require__(432),__webpack_require__(433),__webpack_require__(47),__webpack_require__(434),__webpack_require__(435),__webpack_require__(436),__webpack_require__(437),__webpack_require__(438),__webpack_require__(439),__webpack_require__(440),__webpack_require__(441),__webpack_require__(442),__webpack_require__(443),__webpack_require__(444);var path=__webpack_require__(134);module.exports=path.Symbol},function(module,exports,__webpack_require__){var getBuiltIn=__webpack_require__(60),getOwnPropertyNamesModule=__webpack_require__(98),getOwnPropertySymbolsModule=__webpack_require__(137),anObject=__webpack_require__(15);module.exports=getBuiltIn("Reflect","ownKeys")||function ownKeys(it){var keys=getOwnPropertyNamesModule.f(anObject(it)),getOwnPropertySymbols=getOwnPropertySymbolsModule.f;return getOwnPropertySymbols?keys.concat(getOwnPropertySymbols(it)):keys}},function(module,exports,__webpack_require__){"use strict";var TO_STRING_TAG_SUPPORT=__webpack_require__(142),classof=__webpack_require__(213);module.exports=TO_STRING_TAG_SUPPORT?{}.toString:function toString(){return"[object "+classof(this)+"]"}},function(module,exports,__webpack_require__){var toIndexedObject=__webpack_require__(42),nativeGetOwnPropertyNames=__webpack_require__(98).f,toString={}.toString,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];module.exports.f=function getOwnPropertyNames(it){return windowNames&&"[object Window]"==toString.call(it)?function(it){try{return nativeGetOwnPropertyNames(it)}catch(error){return windowNames.slice()}}(it):nativeGetOwnPropertyNames(toIndexedObject(it))}},function(module,exports,__webpack_require__){__webpack_require__(11)("asyncIterator")},function(module,exports,__webpack_require__){__webpack_require__(11)("hasInstance")},function(module,exports,__webpack_require__){__webpack_require__(11)("isConcatSpreadable")},function(module,exports,__webpack_require__){__webpack_require__(11)("match")},function(module,exports,__webpack_require__){__webpack_require__(11)("matchAll")},function(module,exports,__webpack_require__){__webpack_require__(11)("replace")},function(module,exports,__webpack_require__){__webpack_require__(11)("search")},function(module,exports,__webpack_require__){__webpack_require__(11)("species")},function(module,exports,__webpack_require__){__webpack_require__(11)("split")},function(module,exports,__webpack_require__){__webpack_require__(11)("toPrimitive")},function(module,exports,__webpack_require__){__webpack_require__(11)("toStringTag")},function(module,exports,__webpack_require__){__webpack_require__(11)("unscopables")},function(module,exports,__webpack_require__){__webpack_require__(52)(Math,"Math",!0)},function(module,exports,__webpack_require__){var global=__webpack_require__(3);__webpack_require__(52)(global.JSON,"JSON",!0)},function(module,exports,__webpack_require__){__webpack_require__(11)("asyncDispose")},function(module,exports,__webpack_require__){__webpack_require__(11)("dispose")},function(module,exports,__webpack_require__){__webpack_require__(11)("observable")},function(module,exports,__webpack_require__){__webpack_require__(11)("patternMatch")},function(module,exports,__webpack_require__){__webpack_require__(11)("replaceAll")},function(module,exports,__webpack_require__){"use strict";__webpack_require__(36).window.STORYBOOK_REACT_CLASSES={}},,function(module,exports){module.exports=function(originalModule){if(!originalModule.webpackPolyfill){var module=Object.create(originalModule);module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),Object.defineProperty(module,"exports",{enumerable:!0}),module.webpackPolyfill=1}return module}},function(module,exports,__webpack_require__){"use strict";var IteratorPrototype=__webpack_require__(217).IteratorPrototype,create=__webpack_require__(61),createPropertyDescriptor=__webpack_require__(77),setToStringTag=__webpack_require__(52),Iterators=__webpack_require__(84),returnThis=function(){return this};module.exports=function(IteratorConstructor,NAME,next){var TO_STRING_TAG=NAME+" Iterator";return IteratorConstructor.prototype=create(IteratorPrototype,{next:createPropertyDescriptor(1,next)}),setToStringTag(IteratorConstructor,TO_STRING_TAG,!1,!0),Iterators[TO_STRING_TAG]=returnThis,IteratorConstructor}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8);module.exports=function(it){if(!isObject(it)&&null!==it)throw TypeError("Can't set "+String(it)+" as a prototype");return it}},function(module,exports,__webpack_require__){"use strict";var DESCRIPTORS=__webpack_require__(13),fails=__webpack_require__(5),objectKeys=__webpack_require__(82),getOwnPropertySymbolsModule=__webpack_require__(137),propertyIsEnumerableModule=__webpack_require__(94),toObject=__webpack_require__(22),IndexedObject=__webpack_require__(95),nativeAssign=Object.assign,defineProperty=Object.defineProperty;module.exports=!nativeAssign||fails((function(){if(DESCRIPTORS&&1!==nativeAssign({b:1},nativeAssign(defineProperty({},"a",{enumerable:!0,get:function(){defineProperty(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var A={},B={},symbol=Symbol();return A[symbol]=7,"abcdefghijklmnopqrst".split("").forEach((function(chr){B[chr]=chr})),7!=nativeAssign({},A)[symbol]||"abcdefghijklmnopqrst"!=objectKeys(nativeAssign({},B)).join("")}))?function assign(target,source){for(var T=toObject(target),argumentsLength=arguments.length,index=1,getOwnPropertySymbols=getOwnPropertySymbolsModule.f,propertyIsEnumerable=propertyIsEnumerableModule.f;argumentsLength>index;)for(var key,S=IndexedObject(arguments[index++]),keys=getOwnPropertySymbols?objectKeys(S).concat(getOwnPropertySymbols(S)):objectKeys(S),length=keys.length,j=0;length>j;)key=keys[j++],DESCRIPTORS&&!propertyIsEnumerable.call(S,key)||(T[key]=S[key]);return T}:nativeAssign},function(module,exports,__webpack_require__){var global=__webpack_require__(3);module.exports=global.Promise},function(module,exports,__webpack_require__){var anObject=__webpack_require__(15),aFunction=__webpack_require__(53),SPECIES=__webpack_require__(7)("species");module.exports=function(O,defaultConstructor){var S,C=anObject(O).constructor;return void 0===C||null==(S=anObject(C)[SPECIES])?defaultConstructor:aFunction(S)}},function(module,exports,__webpack_require__){var flush,head,last,notify,toggle,node,promise,then,global=__webpack_require__(3),getOwnPropertyDescriptor=__webpack_require__(76).f,classof=__webpack_require__(34),macrotask=__webpack_require__(150).set,IS_IOS=__webpack_require__(227),MutationObserver=global.MutationObserver||global.WebKitMutationObserver,process=global.process,Promise=global.Promise,IS_NODE="process"==classof(process),queueMicrotaskDescriptor=getOwnPropertyDescriptor(global,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value;queueMicrotask||(flush=function(){var parent,fn;for(IS_NODE&&(parent=process.domain)&&parent.exit();head;){fn=head.fn,head=head.next;try{fn()}catch(error){throw head?notify():last=void 0,error}}last=void 0,parent&&parent.enter()},IS_NODE?notify=function(){process.nextTick(flush)}:MutationObserver&&!IS_IOS?(toggle=!0,node=document.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify=function(){node.data=toggle=!toggle}):Promise&&Promise.resolve?(promise=Promise.resolve(void 0),then=promise.then,notify=function(){then.call(promise,flush)}):notify=function(){macrotask.call(global,flush)}),module.exports=queueMicrotask||function(fn){var task={fn:fn,next:void 0};last&&(last.next=task),head||(head=task,notify()),last=task}},function(module,exports,__webpack_require__){var anObject=__webpack_require__(15),isObject=__webpack_require__(8),newPromiseCapability=__webpack_require__(228);module.exports=function(C,x){if(anObject(C),isObject(x)&&x.constructor===C)return x;var promiseCapability=newPromiseCapability.f(C);return(0,promiseCapability.resolve)(x),promiseCapability.promise}},function(module,exports,__webpack_require__){var global=__webpack_require__(3);module.exports=function(a,b){var console=global.console;console&&console.error&&(1===arguments.length?console.error(a):console.error(a,b))}},function(module,exports){module.exports=function(exec){try{return{error:!1,value:exec()}}catch(error){return{error:!0,value:error}}}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(27),__webpack_require__(108),Object.defineProperty(exports,"__esModule",{value:!0}),exports.makeDecorator=void 0;var _utilDeprecate=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(102));exports.makeDecorator=function makeDecorator(_ref){var name=_ref.name,parameterName=_ref.parameterName,wrapper=_ref.wrapper,_ref$skipIfNoParamete=_ref.skipIfNoParametersOrOptions,skipIfNoParametersOrOptions=void 0!==_ref$skipIfNoParamete&&_ref$skipIfNoParamete,_ref$allowDeprecatedU=_ref.allowDeprecatedUsage,allowDeprecatedUsage=void 0!==_ref$allowDeprecatedU&&_ref$allowDeprecatedU,decorator=function decorator(options){return function(getStory,context){var parameters=context.parameters&&context.parameters[parameterName];return parameters&¶meters.disable?getStory(context):!skipIfNoParametersOrOptions||options||parameters?wrapper(getStory,context,{options:options,parameters:parameters}):getStory(context)}};return function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return"function"==typeof args[0]?decorator().apply(void 0,args):function(){for(var _len2=arguments.length,innerArgs=new Array(_len2),_key2=0;_key2<_len2;_key2++)innerArgs[_key2]=arguments[_key2];if(innerArgs.length>1)return decorator.apply(void 0,args).apply(void 0,innerArgs);if(allowDeprecatedUsage)return(0,_utilDeprecate.default)((function(context){return decorator.apply(void 0,args)(innerArgs[0],context)}),"Passing stories directly into ".concat(name,"() is deprecated,\n instead use addDecorator(").concat(name,") and pass options with the '").concat(parameterName,"' parameter"));throw new Error("Passing stories directly into ".concat(name,"() is not allowed,\n instead use addDecorator(").concat(name,") and pass options with the '").concat(parameterName,"' parameter"))}}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mockChannel=function mockChannel(){return new _channels.default({transport:{setHandler:function setHandler(){},send:function send(){}}})};var _channels=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(230))},function(module,exports,__webpack_require__){(function(global){var scope=void 0!==global&&global||"undefined"!=typeof self&&self||window,apply=Function.prototype.apply;function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,scope,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,scope,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(scope,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout((function onTimeout(){item._onTimeout&&item._onTimeout()}),msecs))},__webpack_require__(465),exports.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==global&&global.setImmediate||this&&this.setImmediate,exports.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==global&&global.clearImmediate||this&&this.clearImmediate}).call(this,__webpack_require__(20))},function(module,exports,__webpack_require__){(function(global,process){!function(global,undefined){"use strict";if(!global.setImmediate){var registerImmediate,nextHandle=1,tasksByHandle={},currentlyRunningATask=!1,doc=global.document,attachTo=Object.getPrototypeOf&&Object.getPrototypeOf(global);attachTo=attachTo&&attachTo.setTimeout?attachTo:global,"[object process]"==={}.toString.call(global.process)?function installNextTickImplementation(){registerImmediate=function(handle){process.nextTick((function(){runIfPresent(handle)}))}}():!function canUsePostMessage(){if(global.postMessage&&!global.importScripts){var postMessageIsAsynchronous=!0,oldOnMessage=global.onmessage;return global.onmessage=function(){postMessageIsAsynchronous=!1},global.postMessage("","*"),global.onmessage=oldOnMessage,postMessageIsAsynchronous}}()?global.MessageChannel?function installMessageChannelImplementation(){var channel=new MessageChannel;channel.port1.onmessage=function(event){runIfPresent(event.data)},registerImmediate=function(handle){channel.port2.postMessage(handle)}}():doc&&"onreadystatechange"in doc.createElement("script")?function installReadyStateChangeImplementation(){var html=doc.documentElement;registerImmediate=function(handle){var script=doc.createElement("script");script.onreadystatechange=function(){runIfPresent(handle),script.onreadystatechange=null,html.removeChild(script),script=null},html.appendChild(script)}}():function installSetTimeoutImplementation(){registerImmediate=function(handle){setTimeout(runIfPresent,0,handle)}}():function installPostMessageImplementation(){var messagePrefix="setImmediate$"+Math.random()+"$",onGlobalMessage=function(event){event.source===global&&"string"==typeof event.data&&0===event.data.indexOf(messagePrefix)&&runIfPresent(+event.data.slice(messagePrefix.length))};global.addEventListener?global.addEventListener("message",onGlobalMessage,!1):global.attachEvent("onmessage",onGlobalMessage),registerImmediate=function(handle){global.postMessage(messagePrefix+handle,"*")}}(),attachTo.setImmediate=function setImmediate(callback){"function"!=typeof callback&&(callback=new Function(""+callback));for(var args=new Array(arguments.length-1),i=0;i<args.length;i++)args[i]=arguments[i+1];var task={callback:callback,args:args};return tasksByHandle[nextHandle]=task,registerImmediate(nextHandle),nextHandle++},attachTo.clearImmediate=clearImmediate}function clearImmediate(handle){delete tasksByHandle[handle]}function runIfPresent(handle){if(currentlyRunningATask)setTimeout(runIfPresent,0,handle);else{var task=tasksByHandle[handle];if(task){currentlyRunningATask=!0;try{!function run(task){var callback=task.callback,args=task.args;switch(args.length){case 0:callback();break;case 1:callback(args[0]);break;case 2:callback(args[0],args[1]);break;case 3:callback(args[0],args[1],args[2]);break;default:callback.apply(void 0,args)}}(task)}finally{clearImmediate(handle),currentlyRunningATask=!1}}}}}("undefined"==typeof self?void 0===global?this:global:self)}).call(this,__webpack_require__(20),__webpack_require__(91))},function(module,exports,__webpack_require__){"use strict";var bind=__webpack_require__(83),toObject=__webpack_require__(22),callWithSafeIterationClosing=__webpack_require__(226),isArrayIteratorMethod=__webpack_require__(224),toLength=__webpack_require__(35),createProperty=__webpack_require__(138),getIteratorMethod=__webpack_require__(225);module.exports=function from(arrayLike){var length,result,step,iterator,next,value,O=toObject(arrayLike),C="function"==typeof this?this:Array,argumentsLength=arguments.length,mapfn=argumentsLength>1?arguments[1]:void 0,mapping=void 0!==mapfn,iteratorMethod=getIteratorMethod(O),index=0;if(mapping&&(mapfn=bind(mapfn,argumentsLength>2?arguments[2]:void 0,2)),null==iteratorMethod||C==Array&&isArrayIteratorMethod(iteratorMethod))for(result=new C(length=toLength(O.length));length>index;index++)value=mapping?mapfn(O[index],index):O[index],createProperty(result,index,value);else for(next=(iterator=iteratorMethod.call(O)).next,result=new C;!(step=next.call(iterator)).done;index++)value=mapping?callWithSafeIterationClosing(iterator,mapfn,[step.value,index],!0):step.value,createProperty(result,index,value);return result.length=index,result}},function(module,exports,__webpack_require__){var $=__webpack_require__(2),global=__webpack_require__(3),task=__webpack_require__(150);$({global:!0,bind:!0,enumerable:!0,forced:!global.setImmediate||!global.clearImmediate},{setImmediate:task.set,clearImmediate:task.clear})},function(module,exports,__webpack_require__){"use strict";__webpack_require__(29),__webpack_require__(46),__webpack_require__(47),__webpack_require__(27),__webpack_require__(234),__webpack_require__(48),__webpack_require__(86),__webpack_require__(469),__webpack_require__(65),__webpack_require__(30),__webpack_require__(85),__webpack_require__(66),__webpack_require__(235),__webpack_require__(108),__webpack_require__(67),__webpack_require__(153),__webpack_require__(55),__webpack_require__(23),__webpack_require__(68),__webpack_require__(471),__webpack_require__(472),__webpack_require__(50),__webpack_require__(476),__webpack_require__(49),__webpack_require__(37),Object.defineProperty(exports,"__esModule",{value:!0}),exports.useMemo=function useMemo(nextCreate,deps){return useMemoLike("useMemo",nextCreate,deps)},exports.useCallback=function useCallback(callback,deps){return useMemoLike("useCallback",(function(){return callback}),deps)},exports.useRef=function useRef(initialValue){return useRefLike("useRef",initialValue)},exports.useState=function useState(initialState){return useStateLike("useState",initialState)},exports.useReducer=function useReducer(reducer,initialArg,init){var _useStateLike2=_slicedToArray(useStateLike("useReducer",null!=init?function(){return init(initialArg)}:initialArg),2),state=_useStateLike2[0],setState=_useStateLike2[1];return[state,function dispatch(action){return setState((function(prevState){return reducer(prevState,action)}))}]},exports.useEffect=useEffect,exports.useChannel=function useChannel(eventMap){var deps=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],channel=_index.addons.getChannel();return useEffect((function(){return Object.entries(eventMap).forEach((function(_ref2){var _ref3=_slicedToArray(_ref2,2),type=_ref3[0],listener=_ref3[1];return channel.on(type,listener)})),function(){Object.entries(eventMap).forEach((function(_ref4){var _ref5=_slicedToArray(_ref4,2),type=_ref5[0],listener=_ref5[1];return channel.removeListener(type,listener)}))}}),[].concat(_toConsumableArray(Object.keys(eventMap)),_toConsumableArray(deps))),channel.emit.bind(channel)},exports.useStoryContext=useStoryContext,exports.useParameter=function useParameter(parameterKey,defaultValue){var parameters=useStoryContext().parameters;if(parameterKey)return parameters[parameterKey]||defaultValue;return},exports.applyHooks=exports.HooksContext=void 0;var _global=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(36)),_clientLogger=__webpack_require__(64),_coreEvents=__webpack_require__(88),_index=__webpack_require__(220);function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}}(arr)||function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||"[object Arguments]"===Object.prototype.toString.call(iter))return Array.from(iter)}(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var RenderEvents=[_coreEvents.STORY_RENDERED,_coreEvents.DOCS_RENDERED],HooksContext=function(){function HooksContext(){var _this=this;!function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,HooksContext),this.hookListsMap=void 0,this.mountedDecorators=void 0,this.prevMountedDecorators=void 0,this.currentHooks=void 0,this.nextHookIndex=void 0,this.currentPhase=void 0,this.currentEffects=void 0,this.prevEffects=void 0,this.currentDecoratorName=void 0,this.hasUpdates=void 0,this.currentContext=void 0,this.renderListener=function(){_this.triggerEffects(),_this.currentContext=null,_this.removeRenderListeners()},this.init()}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(HooksContext,[{key:"init",value:function init(){this.hookListsMap=new WeakMap,this.mountedDecorators=new Set,this.prevMountedDecorators=this.mountedDecorators,this.currentHooks=[],this.nextHookIndex=0,this.currentPhase="NONE",this.currentEffects=[],this.prevEffects=[],this.currentDecoratorName=null,this.hasUpdates=!1,this.currentContext=null}},{key:"clean",value:function clean(){this.prevEffects.forEach((function(effect){effect.destroy&&effect.destroy()})),this.init(),this.removeRenderListeners()}},{key:"getNextHook",value:function getNextHook(){var hook=this.currentHooks[this.nextHookIndex];return this.nextHookIndex+=1,hook}},{key:"triggerEffects",value:function triggerEffects(){var _this2=this;this.prevEffects.forEach((function(effect){!_this2.currentEffects.includes(effect)&&effect.destroy&&effect.destroy()})),this.currentEffects.forEach((function(effect){_this2.prevEffects.includes(effect)||(effect.destroy=effect.create())})),this.prevEffects=this.currentEffects,this.currentEffects=[]}},{key:"addRenderListeners",value:function addRenderListeners(){var _this3=this;this.removeRenderListeners();var channel=_index.addons.getChannel();RenderEvents.forEach((function(e){return channel.on(e,_this3.renderListener)}))}},{key:"removeRenderListeners",value:function removeRenderListeners(){var _this4=this,channel=_index.addons.getChannel();RenderEvents.forEach((function(e){return channel.removeListener(e,_this4.renderListener)}))}}]),HooksContext}();exports.HooksContext=HooksContext;var hookify=function hookify(fn){return function(){var _ref="function"==typeof(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],hooks=_ref.hooks,prevPhase=hooks.currentPhase,prevHooks=hooks.currentHooks,prevNextHookIndex=hooks.nextHookIndex,prevDecoratorName=hooks.currentDecoratorName;hooks.currentDecoratorName=fn.name,hooks.prevMountedDecorators.has(fn)?(hooks.currentPhase="UPDATE",hooks.currentHooks=hooks.hookListsMap.get(fn)||[]):(hooks.currentPhase="MOUNT",hooks.currentHooks=[],hooks.hookListsMap.set(fn,hooks.currentHooks),hooks.prevMountedDecorators.add(fn)),hooks.nextHookIndex=0;var prevContext=_global.default.STORYBOOK_HOOKS_CONTEXT;_global.default.STORYBOOK_HOOKS_CONTEXT=hooks;var result=fn.apply(void 0,arguments);if(_global.default.STORYBOOK_HOOKS_CONTEXT=prevContext,"UPDATE"===hooks.currentPhase&&null!=hooks.getNextHook())throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return hooks.currentPhase=prevPhase,hooks.currentHooks=prevHooks,hooks.nextHookIndex=prevNextHookIndex,hooks.currentDecoratorName=prevDecoratorName,result}},numberOfRenders=0;exports.applyHooks=function applyHooks(applyDecorators){return function(getStory,decorators){var decorated=applyDecorators(hookify(getStory),decorators.map(hookify));return function(context){var hooks=context.hooks;hooks.prevMountedDecorators=hooks.mountedDecorators,hooks.mountedDecorators=new Set([getStory].concat(_toConsumableArray(decorators))),hooks.currentContext=context,hooks.hasUpdates=!1;var result=decorated(context);for(numberOfRenders=1;hooks.hasUpdates;)if(hooks.hasUpdates=!1,hooks.currentEffects=[],result=decorated(context),(numberOfRenders+=1)>25)throw new Error("Too many re-renders. Storybook limits the number of renders to prevent an infinite loop.");return hooks.addRenderListeners(),result}}};var invalidHooksError=function invalidHooksError(){return new Error("Storybook preview hooks can only be called inside decorators and story functions.")};function getHooksContextOrNull(){return _global.default.STORYBOOK_HOOKS_CONTEXT||null}function getHooksContextOrThrow(){var hooks=getHooksContextOrNull();if(null==hooks)throw invalidHooksError();return hooks}function useMemoLike(name,nextCreate,deps){return function useHook(name,callback,deps){var hooks=getHooksContextOrThrow();if("MOUNT"===hooks.currentPhase){null==deps||Array.isArray(deps)||_clientLogger.logger.warn("".concat(name," received a final argument that is not an array (instead, received ").concat(deps,"). When specified, the final argument must be an array."));var _hook={name:name,deps:deps};return hooks.currentHooks.push(_hook),callback(_hook),_hook}if("UPDATE"===hooks.currentPhase){var _hook2=hooks.getNextHook();if(null==_hook2)throw new Error("Rendered more hooks than during the previous render.");return _hook2.name!==name&&_clientLogger.logger.warn("Storybook has detected a change in the order of Hooks".concat(hooks.currentDecoratorName?" called by ".concat(hooks.currentDecoratorName):"",". This will lead to bugs and errors if not fixed.")),null!=deps&&null==_hook2.deps&&_clientLogger.logger.warn("".concat(name," received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.")),null!=deps&&null!=_hook2.deps&&deps.length!==_hook2.deps.length&&_clientLogger.logger.warn("The final argument passed to ".concat(name," changed size between renders. The order and size of this array must remain constant.\nPrevious: ").concat(_hook2.deps,"\nIncoming: ").concat(deps)),null!=deps&&null!=_hook2.deps&&function areDepsEqual(deps,nextDeps){return deps.length===nextDeps.length&&deps.every((function(dep,i){return dep===nextDeps[i]}))}(deps,_hook2.deps)||(callback(_hook2),_hook2.deps=deps),_hook2}throw invalidHooksError()}(name,(function(hook){hook.memoizedState=nextCreate()}),deps).memoizedState}function useRefLike(name,initialValue){return useMemoLike(name,(function(){return{current:initialValue}}),[])}function useStateLike(name,initialState){var stateRef=useRefLike(name,"function"==typeof initialState?initialState():initialState);return[stateRef.current,function setState(update){stateRef.current="function"==typeof update?update(stateRef.current):update,function triggerUpdate(){var hooks=getHooksContextOrNull();if(null!=hooks&&"NONE"!==hooks.currentPhase)hooks.hasUpdates=!0;else try{_index.addons.getChannel().emit(_coreEvents.FORCE_RE_RENDER)}catch(e){_clientLogger.logger.warn("State updates of Storybook preview hooks work only in browser")}}()}]}function useEffect(create,deps){var hooks=getHooksContextOrThrow(),effect=useMemoLike("useEffect",(function(){return{create:create}}),deps);hooks.currentEffects.includes(effect)||hooks.currentEffects.push(effect)}function useStoryContext(){var currentContext=getHooksContextOrThrow().currentContext;if(null==currentContext)throw invalidHooksError();return currentContext}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),$includes=__webpack_require__(135).includes,addToUnscopables=__webpack_require__(143);$({target:"Array",proto:!0,forced:!__webpack_require__(31)("indexOf",{ACCESSORS:!0,1:0})},{includes:function includes(el){return $includes(this,el,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes")},function(module,exports,__webpack_require__){"use strict";var aFunction=__webpack_require__(53),isObject=__webpack_require__(8),slice=[].slice,factories={},construct=function(C,argsLength,args){if(!(argsLength in factories)){for(var list=[],i=0;i<argsLength;i++)list[i]="a["+i+"]";factories[argsLength]=Function("C,a","return new C("+list.join(",")+")")}return factories[argsLength](C,args)};module.exports=Function.bind||function bind(that){var fn=aFunction(this),partArgs=slice.call(arguments,1),boundFunction=function bound(){var args=partArgs.concat(slice.call(arguments));return this instanceof boundFunction?construct(fn,args.length,args):fn.apply(that,args)};return isObject(fn.prototype)&&(boundFunction.prototype=fn.prototype),boundFunction}},function(module,exports,__webpack_require__){"use strict";var collection=__webpack_require__(154),collectionStrong=__webpack_require__(238);module.exports=collection("Set",(function(init){return function Set(){return init(this,arguments.length?arguments[0]:void 0)}}),collectionStrong)},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),notARegExp=__webpack_require__(473),requireObjectCoercible=__webpack_require__(43);$({target:"String",proto:!0,forced:!__webpack_require__(475)("includes")},{includes:function includes(searchString){return!!~String(requireObjectCoercible(this)).indexOf(notARegExp(searchString),arguments.length>1?arguments[1]:void 0)}})},function(module,exports,__webpack_require__){var isRegExp=__webpack_require__(474);module.exports=function(it){if(isRegExp(it))throw TypeError("The method doesn't accept regular expressions");return it}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8),classof=__webpack_require__(34),MATCH=__webpack_require__(7)("match");module.exports=function(it){var isRegExp;return isObject(it)&&(void 0!==(isRegExp=it[MATCH])?!!isRegExp:"RegExp"==classof(it))}},function(module,exports,__webpack_require__){var MATCH=__webpack_require__(7)("match");module.exports=function(METHOD_NAME){var regexp=/./;try{"/./"[METHOD_NAME](regexp)}catch(e){try{return regexp[MATCH]=!1,"/./"[METHOD_NAME](regexp)}catch(f){}}return!1}},function(module,exports,__webpack_require__){"use strict";var InternalWeakMap,global=__webpack_require__(3),redefineAll=__webpack_require__(105),InternalMetadataModule=__webpack_require__(87),collection=__webpack_require__(154),collectionWeak=__webpack_require__(477),isObject=__webpack_require__(8),enforceIternalState=__webpack_require__(44).enforce,NATIVE_WEAK_MAP=__webpack_require__(207),IS_IE11=!global.ActiveXObject&&"ActiveXObject"in global,isExtensible=Object.isExtensible,wrapper=function(init){return function WeakMap(){return init(this,arguments.length?arguments[0]:void 0)}},$WeakMap=module.exports=collection("WeakMap",wrapper,collectionWeak);if(NATIVE_WEAK_MAP&&IS_IE11){InternalWeakMap=collectionWeak.getConstructor(wrapper,"WeakMap",!0),InternalMetadataModule.REQUIRED=!0;var WeakMapPrototype=$WeakMap.prototype,nativeDelete=WeakMapPrototype.delete,nativeHas=WeakMapPrototype.has,nativeGet=WeakMapPrototype.get,nativeSet=WeakMapPrototype.set;redefineAll(WeakMapPrototype,{delete:function(key){if(isObject(key)&&!isExtensible(key)){var state=enforceIternalState(this);return state.frozen||(state.frozen=new InternalWeakMap),nativeDelete.call(this,key)||state.frozen.delete(key)}return nativeDelete.call(this,key)},has:function has(key){if(isObject(key)&&!isExtensible(key)){var state=enforceIternalState(this);return state.frozen||(state.frozen=new InternalWeakMap),nativeHas.call(this,key)||state.frozen.has(key)}return nativeHas.call(this,key)},get:function get(key){if(isObject(key)&&!isExtensible(key)){var state=enforceIternalState(this);return state.frozen||(state.frozen=new InternalWeakMap),nativeHas.call(this,key)?nativeGet.call(this,key):state.frozen.get(key)}return nativeGet.call(this,key)},set:function set(key,value){if(isObject(key)&&!isExtensible(key)){var state=enforceIternalState(this);state.frozen||(state.frozen=new InternalWeakMap),nativeHas.call(this,key)?nativeSet.call(this,key,value):state.frozen.set(key,value)}else nativeSet.call(this,key,value);return this}})}},function(module,exports,__webpack_require__){"use strict";var redefineAll=__webpack_require__(105),getWeakData=__webpack_require__(87).getWeakData,anObject=__webpack_require__(15),isObject=__webpack_require__(8),anInstance=__webpack_require__(106),iterate=__webpack_require__(107),ArrayIterationModule=__webpack_require__(45),$has=__webpack_require__(14),InternalStateModule=__webpack_require__(44),setInternalState=InternalStateModule.set,internalStateGetterFor=InternalStateModule.getterFor,find=ArrayIterationModule.find,findIndex=ArrayIterationModule.findIndex,id=0,uncaughtFrozenStore=function(store){return store.frozen||(store.frozen=new UncaughtFrozenStore)},UncaughtFrozenStore=function(){this.entries=[]},findUncaughtFrozen=function(store,key){return find(store.entries,(function(it){return it[0]===key}))};UncaughtFrozenStore.prototype={get:function(key){var entry=findUncaughtFrozen(this,key);if(entry)return entry[1]},has:function(key){return!!findUncaughtFrozen(this,key)},set:function(key,value){var entry=findUncaughtFrozen(this,key);entry?entry[1]=value:this.entries.push([key,value])},delete:function(key){var index=findIndex(this.entries,(function(it){return it[0]===key}));return~index&&this.entries.splice(index,1),!!~index}},module.exports={getConstructor:function(wrapper,CONSTRUCTOR_NAME,IS_MAP,ADDER){var C=wrapper((function(that,iterable){anInstance(that,C,CONSTRUCTOR_NAME),setInternalState(that,{type:CONSTRUCTOR_NAME,id:id++,frozen:void 0}),null!=iterable&&iterate(iterable,that[ADDER],that,IS_MAP)})),getInternalState=internalStateGetterFor(CONSTRUCTOR_NAME),define=function(that,key,value){var state=getInternalState(that),data=getWeakData(anObject(key),!0);return!0===data?uncaughtFrozenStore(state).set(key,value):data[state.id]=value,that};return redefineAll(C.prototype,{delete:function(key){var state=getInternalState(this);if(!isObject(key))return!1;var data=getWeakData(key);return!0===data?uncaughtFrozenStore(state).delete(key):data&&$has(data,state.id)&&delete data[state.id]},has:function has(key){var state=getInternalState(this);if(!isObject(key))return!1;var data=getWeakData(key);return!0===data?uncaughtFrozenStore(state).has(key):data&&$has(data,state.id)}}),redefineAll(C.prototype,IS_MAP?{get:function get(key){var state=getInternalState(this);if(isObject(key)){var data=getWeakData(key);return!0===data?uncaughtFrozenStore(state).get(key):data?data[state.id]:void 0}},set:function set(key,value){return define(this,key,value)}}:{add:function add(value){return define(this,value,!0)}}),C}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ADDON_ID=void 0;exports.ADDON_ID="storybookjs/options";var _default={SET:"".concat("storybookjs/options","/options-event")};exports.default=_default},function(module,exports,__webpack_require__){"use strict";__webpack_require__(27),Object.defineProperty(exports,"__esModule",{value:!0}),exports.raw=exports.getStorybook=exports.forceReRender=exports.setAddon=exports.clearDecorators=exports.addParameters=exports.addDecorator=exports.configure=exports.storiesOf=void 0;var _client=__webpack_require__(480);__webpack_require__(640);var _render=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(641));var api=(0,_client.start)(_render.default);exports.storiesOf=function storiesOf(kind,m){return api.clientApi.storiesOf(kind,m).addParameters({framework:"react"})};exports.configure=function configure(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return api.configure.apply(api,args.concat(["react"]))};var addDecorator=api.clientApi.addDecorator;exports.addDecorator=addDecorator;var addParameters=api.clientApi.addParameters;exports.addParameters=addParameters;var clearDecorators=api.clientApi.clearDecorators;exports.clearDecorators=clearDecorators;var setAddon=api.clientApi.setAddon;exports.setAddon=setAddon;var forceReRender=api.forceReRender;exports.forceReRender=forceReRender;var getStorybook=api.clientApi.getStorybook;exports.getStorybook=getStorybook;var raw=api.clientApi.raw;exports.raw=raw},function(module,exports,__webpack_require__){module.exports=__webpack_require__(481).default},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(482)).default;exports.default=_default},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _clientApi=__webpack_require__(239),_csf=__webpack_require__(109);var _default={start:function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(617)).default,toId:_csf.toId,ClientApi:_clientApi.ClientApi,ConfigApi:_clientApi.ConfigApi,StoryStore:_clientApi.StoryStore};exports.default=_default},function(module,exports,__webpack_require__){"use strict";__webpack_require__(29),__webpack_require__(46),__webpack_require__(47),__webpack_require__(27),__webpack_require__(151),__webpack_require__(48),__webpack_require__(86),__webpack_require__(65),__webpack_require__(30),__webpack_require__(85),__webpack_require__(240),__webpack_require__(485),__webpack_require__(66),__webpack_require__(63),__webpack_require__(153),__webpack_require__(155),__webpack_require__(55),__webpack_require__(23),__webpack_require__(69),__webpack_require__(68),__webpack_require__(50),__webpack_require__(157),__webpack_require__(49),__webpack_require__(37),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.addParameters=exports.addDecorator=exports.defaultDecorateStory=void 0;var _utilDeprecate=_interopRequireDefault(__webpack_require__(102)),_isPlainObject=_interopRequireDefault(__webpack_require__(675)),_clientLogger=__webpack_require__(64),_addons=_interopRequireDefault(__webpack_require__(103)),_coreEvents=_interopRequireDefault(__webpack_require__(88)),_csf=__webpack_require__(109),_mergeWith=_interopRequireDefault(__webpack_require__(508)),_isEqual=_interopRequireDefault(__webpack_require__(567)),_get=_interopRequireDefault(__webpack_require__(259)),_subscriptions_store=_interopRequireDefault(__webpack_require__(260)),_hooks=__webpack_require__(167);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}}(arr)||function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||"[object Arguments]"===Object.prototype.toString.call(iter))return Array.from(iter)}(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var merge=function merge(a,b){return(0,_mergeWith.default)({},a,b,(function(objValue,srcValue){return Array.isArray(srcValue)&&Array.isArray(objValue)?(srcValue.forEach((function(s){objValue.find((function(o){return o===s||(0,_isEqual.default)(o,s)}))||objValue.push(s)})),objValue):Array.isArray(objValue)?(_clientLogger.logger.log("the types mismatch, picking",objValue),objValue):void 0}))},defaultContext={id:"unspecified",name:"unspecified",kind:"unspecified",parameters:{}},defaultDecorateStory=function defaultDecorateStory(storyFn,decorators){return decorators.reduce((function(decorated,decorator){return function(){var context=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultContext;return decorator((function(p){return decorated(p?Object.assign({},context,{},p,{parameters:Object.assign({},context.parameters,{},p.parameters)}):context)}),context)}}),storyFn)};exports.defaultDecorateStory=defaultDecorateStory;var metaSubscriptionHandler=(0,_utilDeprecate.default)(_subscriptions_store.default.register,"Events.REGISTER_SUBSCRIPTION is deprecated and will be removed in 6.0. Please use useEffect from @storybook/client-api instead."),metaSubscription=function metaSubscription(){return _addons.default.getChannel().on(_coreEvents.default.REGISTER_SUBSCRIPTION,metaSubscriptionHandler),function(){return _addons.default.getChannel().removeListener(_coreEvents.default.REGISTER_SUBSCRIPTION,metaSubscriptionHandler)}},withSubscriptionTracking=function withSubscriptionTracking(storyFn){if(!_addons.default.hasChannel())return storyFn();_subscriptions_store.default.markAllAsUnused(),_subscriptions_store.default.register(metaSubscription);var result=storyFn();return _subscriptions_store.default.clearUnused(),result},_globalDecorators=[],_globalParameters={},addDecorator=function addDecorator(decoratorFn){_globalDecorators.push(decoratorFn)};exports.addDecorator=addDecorator;var addParameters=function addParameters(parameters){_globalParameters=Object.assign({},_globalParameters,{},parameters,{options:Object.assign({},merge((0,_get.default)(_globalParameters,"options",{}),(0,_get.default)(parameters,"options",{}))),docs:Object.assign({},merge((0,_get.default)(_globalParameters,"docs",{}),(0,_get.default)(parameters,"docs",{})))})};exports.addParameters=addParameters;exports.default=function ClientApi(_ref){var _this=this,storyStore=_ref.storyStore,_ref$decorateStory=_ref.decorateStory,decorateStory=void 0===_ref$decorateStory?defaultDecorateStory:_ref$decorateStory;if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ClientApi),this._storyStore=void 0,this._addons=void 0,this._decorateStory=void 0,this.setAddon=function(addon){_this._addons=Object.assign({},_this._addons,{},addon)},this.getSeparators=function(){var _ref2=_globalParameters.options||{},hierarchySeparator=_ref2.hierarchySeparator,hierarchyRootSeparator=_ref2.hierarchyRootSeparator,showRoots=_ref2.showRoots;return void 0!==hierarchySeparator||void 0!==hierarchyRootSeparator?{hierarchySeparator:hierarchySeparator,hierarchyRootSeparator:hierarchyRootSeparator}:void 0===showRoots&&_this.store().getStoryKinds().some((function(kind){return kind.match(/\.|\|/)}))?{hierarchyRootSeparator:"|",hierarchySeparator:/\/|\./}:{hierarchySeparator:"/"}},this.addDecorator=function(decorator){addDecorator(decorator)},this.addParameters=function(parameters){addParameters(parameters)},this.clearDecorators=function(){_globalDecorators=[]},this.clearParameters=function(){_globalParameters={}},this.storiesOf=function(kind,m){if(!kind&&"string"!=typeof kind)throw new Error("Invalid or missing kind provided for stories, should be a string");if(m||_clientLogger.logger.warn("Missing 'module' parameter for story with a kind of '".concat(kind,"'. It will break your HMR")),m){var proto=Object.getPrototypeOf(m);proto.exports&&proto.exports.default&&_clientLogger.logger.error("Illegal mix of CSF default export and storiesOf calls in a single file: ".concat(proto.i))}m&&m.hot&&m.hot.dispose&&m.hot.dispose((function(){var _storyStore=_this._storyStore;_storyStore.removeStoryKind(kind),_storyStore.incrementRevision()}));var localDecorators=[],localParameters={},hasAdded=!1,api={kind:kind.toString(),add:function add(){return api},addDecorator:function addDecorator(){return api},addParameters:function addParameters(){return api}};return Object.keys(_this._addons).forEach((function(name){var addon=_this._addons[name];api[name]=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return addon.apply(api,args),api}})),api.add=function(storyName,storyFn){var parameters=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};hasAdded=!0;var id=parameters.__id||(0,_csf.toId)(kind,storyName);if("string"!=typeof storyName)throw new Error('Invalid or missing storyName provided for a "'.concat(kind,'" story.'));m&&m.hot&&m.hot.dispose&&m.hot.dispose((function(){_this._storyStore.remove(id)}));var fileName=m&&m.id?"".concat(m.id):void 0,allParam=[_globalParameters,localParameters,parameters].reduce((function(acc,p){return p&&Object.entries(p).forEach((function(_ref3){var _ref4=_slicedToArray(_ref3,2),key=_ref4[0],value=_ref4[1],existingValue=acc[key];Array.isArray(value)?acc[key]=value:(0,_isPlainObject.default)(value)&&(0,_isPlainObject.default)(existingValue)?acc[key]=merge(existingValue,value):acc[key]=value})),acc}),{fileName:fileName});return _this._storyStore.addStory({id:id,kind:kind,name:storyName,storyFn:storyFn,parameters:allParam},{applyDecorators:(0,_hooks.applyHooks)(_this._decorateStory),getDecorators:function getDecorators(){return[].concat(_toConsumableArray(allParam.decorators||[]),localDecorators,_toConsumableArray(_globalDecorators),[withSubscriptionTracking])}}),api},api.addDecorator=function(decorator){return hasAdded&&_clientLogger.logger.warn("You have added a decorator to the kind '".concat(kind,"' after a story has already been added.\nIn Storybook 4 this applied the decorator only to subsequent stories. In Storybook 5+ it applies to all stories.\nThis is probably not what you intended. Read more here: https://github.com/storybookjs/storybook/blob/master/MIGRATION.md")),localDecorators.push(decorator),api},api.addParameters=function(parameters){return localParameters=Object.assign({},localParameters,{},parameters),api},api},this.getStorybook=function(){return _this._storyStore.getStoryKinds().map((function(kind){var fileName=_this._storyStore.getStoryFileName(kind),stories=_this._storyStore.getStories(kind).map((function(name){return{name:name,render:_this._storyStore.getStoryWithContext(kind,name)}}));return{kind:kind,fileName:fileName,stories:stories}}))},this.raw=function(){return _this._storyStore.raw()},this.store=function(){return _this._storyStore},this._storyStore=storyStore,this._addons={},this._decorateStory=decorateStory,!storyStore)throw new Error("storyStore is required")}},function(module,exports,__webpack_require__){var aFunction=__webpack_require__(53),toObject=__webpack_require__(22),IndexedObject=__webpack_require__(95),toLength=__webpack_require__(35),createMethod=function(IS_RIGHT){return function(that,callbackfn,argumentsLength,memo){aFunction(callbackfn);var O=toObject(that),self=IndexedObject(O),length=toLength(O.length),index=IS_RIGHT?length-1:0,i=IS_RIGHT?-1:1;if(argumentsLength<2)for(;;){if(index in self){memo=self[index],index+=i;break}if(index+=i,IS_RIGHT?index<0:length<=index)throw TypeError("Reduce of empty array with no initial value")}for(;IS_RIGHT?index>=0:length>index;index+=i)index in self&&(memo=callbackfn(memo,self[index],index,O));return memo}};module.exports={left:createMethod(!1),right:createMethod(!0)}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),$some=__webpack_require__(45).some,arrayMethodIsStrict=__webpack_require__(62),arrayMethodUsesToLength=__webpack_require__(31),STRICT_METHOD=arrayMethodIsStrict("some"),USES_TO_LENGTH=arrayMethodUsesToLength("some");$({target:"Array",proto:!0,forced:!STRICT_METHOD||!USES_TO_LENGTH},{some:function some(callbackfn){return $some(this,callbackfn,arguments.length>1?arguments[1]:void 0)}})},function(module,exports,__webpack_require__){"use strict";var fails=__webpack_require__(5);function RE(s,f){return RegExp(s,f)}exports.UNSUPPORTED_Y=fails((function(){var re=RE("a","y");return re.lastIndex=2,null!=re.exec("abcd")})),exports.BROKEN_CARET=fails((function(){var re=RE("^r","gy");return re.lastIndex=2,null!=re.exec("str")}))},function(module,exports,__webpack_require__){var createCompounder=__webpack_require__(488),upperFirst=__webpack_require__(501),startCase=createCompounder((function(result,word,index){return result+(index?" ":"")+upperFirst(word)}));module.exports=startCase},function(module,exports,__webpack_require__){var arrayReduce=__webpack_require__(489),deburr=__webpack_require__(490),words=__webpack_require__(497),reApos=RegExp("['’]","g");module.exports=function createCompounder(callback){return function(string){return arrayReduce(words(deburr(string).replace(reApos,"")),callback,"")}}},function(module,exports){module.exports=function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}},function(module,exports,__webpack_require__){var deburrLetter=__webpack_require__(491),toString=__webpack_require__(110),reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,reComboMark=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");module.exports=function deburr(string){return(string=toString(string))&&string.replace(reLatin,deburrLetter).replace(reComboMark,"")}},function(module,exports,__webpack_require__){var deburrLetter=__webpack_require__(492)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});module.exports=deburrLetter},function(module,exports){module.exports=function basePropertyOf(object){return function(key){return null==object?void 0:object[key]}}},function(module,exports,__webpack_require__){var Symbol=__webpack_require__(111),arrayMap=__webpack_require__(494),isArray=__webpack_require__(56),isSymbol=__webpack_require__(112),symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;module.exports=function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}},function(module,exports){module.exports=function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}},function(module,exports,__webpack_require__){var Symbol=__webpack_require__(111),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=void 0;var unmasked=!0}catch(e){}var result=nativeObjectToString.call(value);return unmasked&&(isOwn?value[symToStringTag]=tag:delete value[symToStringTag]),result}},function(module,exports){var nativeObjectToString=Object.prototype.toString;module.exports=function objectToString(value){return nativeObjectToString.call(value)}},function(module,exports,__webpack_require__){var asciiWords=__webpack_require__(498),hasUnicodeWord=__webpack_require__(499),toString=__webpack_require__(110),unicodeWords=__webpack_require__(500);module.exports=function words(string,pattern,guard){return string=toString(string),void 0===(pattern=guard?void 0:pattern)?hasUnicodeWord(string)?unicodeWords(string):asciiWords(string):string.match(pattern)||[]}},function(module,exports){var reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;module.exports=function asciiWords(string){return string.match(reAsciiWord)||[]}},function(module,exports){var reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;module.exports=function hasUnicodeWord(string){return reHasUnicodeWord.test(string)}},function(module,exports){var rsBreakRange="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rsBreak="["+rsBreakRange+"]",rsDigits="\\d+",rsDingbat="[\\u2700-\\u27bf]",rsLower="[a-z\\xdf-\\xf6\\xf8-\\xff]",rsMisc="[^\\ud800-\\udfff"+rsBreakRange+rsDigits+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsUpper="[A-Z\\xc0-\\xd6\\xd8-\\xde]",rsMiscLower="(?:"+rsLower+"|"+rsMisc+")",rsMiscUpper="(?:"+rsUpper+"|"+rsMisc+")",reOptMod="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",rsSeq="[\\ufe0e\\ufe0f]?"+reOptMod+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",rsRegional,rsSurrPair].join("|")+")[\\ufe0e\\ufe0f]?"+reOptMod+")*"),rsEmoji="(?:"+[rsDingbat,rsRegional,rsSurrPair].join("|")+")"+rsSeq,reUnicodeWord=RegExp([rsUpper+"?"+rsLower+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[rsBreak,rsUpper,"$"].join("|")+")",rsMiscUpper+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[rsBreak,rsUpper+rsMiscLower,"$"].join("|")+")",rsUpper+"?"+rsMiscLower+"+(?:['’](?:d|ll|m|re|s|t|ve))?",rsUpper+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rsDigits,rsEmoji].join("|"),"g");module.exports=function unicodeWords(string){return string.match(reUnicodeWord)||[]}},function(module,exports,__webpack_require__){var upperFirst=__webpack_require__(502)("toUpperCase");module.exports=upperFirst},function(module,exports,__webpack_require__){var castSlice=__webpack_require__(503),hasUnicode=__webpack_require__(243),stringToArray=__webpack_require__(505),toString=__webpack_require__(110);module.exports=function createCaseFirst(methodName){return function(string){string=toString(string);var strSymbols=hasUnicode(string)?stringToArray(string):void 0,chr=strSymbols?strSymbols[0]:string.charAt(0),trailing=strSymbols?castSlice(strSymbols,1).join(""):string.slice(1);return chr[methodName]()+trailing}}},function(module,exports,__webpack_require__){var baseSlice=__webpack_require__(504);module.exports=function castSlice(array,start,end){var length=array.length;return end=void 0===end?length:end,!start&&end>=length?array:baseSlice(array,start,end)}},function(module,exports){module.exports=function baseSlice(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),(end=end>length?length:end)<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}},function(module,exports,__webpack_require__){var asciiToArray=__webpack_require__(506),hasUnicode=__webpack_require__(243),unicodeToArray=__webpack_require__(507);module.exports=function stringToArray(string){return hasUnicode(string)?unicodeToArray(string):asciiToArray(string)}},function(module,exports){module.exports=function asciiToArray(string){return string.split("")}},function(module,exports){var rsAstral="[\\ud800-\\udfff]",rsCombo="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsNonAstral="[^\\ud800-\\udfff]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",reOptMod="(?:"+rsCombo+"|"+rsFitz+")"+"?",rsSeq="[\\ufe0e\\ufe0f]?"+reOptMod+("(?:\\u200d(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")[\\ufe0e\\ufe0f]?"+reOptMod+")*"),rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g");module.exports=function unicodeToArray(string){return string.match(reUnicode)||[]}},function(module,exports,__webpack_require__){var baseMerge=__webpack_require__(509),mergeWith=__webpack_require__(558)((function(object,source,srcIndex,customizer){baseMerge(object,source,srcIndex,customizer)}));module.exports=mergeWith},function(module,exports,__webpack_require__){var Stack=__webpack_require__(244),assignMergeValue=__webpack_require__(246),baseFor=__webpack_require__(536),baseMergeDeep=__webpack_require__(538),isObject=__webpack_require__(38),keysIn=__webpack_require__(254),safeGet=__webpack_require__(253);module.exports=function baseMerge(object,source,srcIndex,customizer,stack){object!==source&&baseFor(source,(function(srcValue,key){if(stack||(stack=new Stack),isObject(srcValue))baseMergeDeep(object,source,key,srcIndex,baseMerge,customizer,stack);else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+"",object,source,stack):void 0;void 0===newValue&&(newValue=srcValue),assignMergeValue(object,key,newValue)}}),keysIn)}},function(module,exports){module.exports=function listCacheClear(){this.__data__=[],this.size=0}},function(module,exports,__webpack_require__){var assocIndexOf=__webpack_require__(114),splice=Array.prototype.splice;module.exports=function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)}},function(module,exports,__webpack_require__){var assocIndexOf=__webpack_require__(114);module.exports=function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}},function(module,exports,__webpack_require__){var assocIndexOf=__webpack_require__(114);module.exports=function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}},function(module,exports,__webpack_require__){var assocIndexOf=__webpack_require__(114);module.exports=function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}},function(module,exports,__webpack_require__){var ListCache=__webpack_require__(113);module.exports=function stackClear(){this.__data__=new ListCache,this.size=0}},function(module,exports){module.exports=function stackDelete(key){var data=this.__data__,result=data.delete(key);return this.size=data.size,result}},function(module,exports){module.exports=function stackGet(key){return this.__data__.get(key)}},function(module,exports){module.exports=function stackHas(key){return this.__data__.has(key)}},function(module,exports,__webpack_require__){var ListCache=__webpack_require__(113),Map=__webpack_require__(160),MapCache=__webpack_require__(162);module.exports=function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<199)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this}},function(module,exports,__webpack_require__){var isFunction=__webpack_require__(161),isMasked=__webpack_require__(521),isObject=__webpack_require__(38),toSource=__webpack_require__(245),reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");module.exports=function baseIsNative(value){return!(!isObject(value)||isMasked(value))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value))}},function(module,exports,__webpack_require__){var uid,coreJsData=__webpack_require__(522),maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""))?"Symbol(src)_1."+uid:"";module.exports=function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}},function(module,exports,__webpack_require__){var coreJsData=__webpack_require__(24)["__core-js_shared__"];module.exports=coreJsData},function(module,exports){module.exports=function getValue(object,key){return null==object?void 0:object[key]}},function(module,exports,__webpack_require__){var Hash=__webpack_require__(525),ListCache=__webpack_require__(113),Map=__webpack_require__(160);module.exports=function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}},function(module,exports,__webpack_require__){var hashClear=__webpack_require__(526),hashDelete=__webpack_require__(527),hashGet=__webpack_require__(528),hashHas=__webpack_require__(529),hashSet=__webpack_require__(530);function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,module.exports=Hash},function(module,exports,__webpack_require__){var nativeCreate=__webpack_require__(115);module.exports=function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}},function(module,exports){module.exports=function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result}},function(module,exports,__webpack_require__){var nativeCreate=__webpack_require__(115),hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return"__lodash_hash_undefined__"===result?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}},function(module,exports,__webpack_require__){var nativeCreate=__webpack_require__(115),hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function hashHas(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty.call(data,key)}},function(module,exports,__webpack_require__){var nativeCreate=__webpack_require__(115);module.exports=function hashSet(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&void 0===value?"__lodash_hash_undefined__":value,this}},function(module,exports,__webpack_require__){var getMapData=__webpack_require__(116);module.exports=function mapCacheDelete(key){var result=getMapData(this,key).delete(key);return this.size-=result?1:0,result}},function(module,exports){module.exports=function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}},function(module,exports,__webpack_require__){var getMapData=__webpack_require__(116);module.exports=function mapCacheGet(key){return getMapData(this,key).get(key)}},function(module,exports,__webpack_require__){var getMapData=__webpack_require__(116);module.exports=function mapCacheHas(key){return getMapData(this,key).has(key)}},function(module,exports,__webpack_require__){var getMapData=__webpack_require__(116);module.exports=function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this}},function(module,exports,__webpack_require__){var baseFor=__webpack_require__(537)();module.exports=baseFor},function(module,exports){module.exports=function createBaseFor(fromRight){return function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[fromRight?length:++index];if(!1===iteratee(iterable[key],key,iterable))break}return object}}},function(module,exports,__webpack_require__){var assignMergeValue=__webpack_require__(246),cloneBuffer=__webpack_require__(539),cloneTypedArray=__webpack_require__(540),copyArray=__webpack_require__(542),initCloneObject=__webpack_require__(543),isArguments=__webpack_require__(251),isArray=__webpack_require__(56),isArrayLikeObject=__webpack_require__(546),isBuffer=__webpack_require__(165),isFunction=__webpack_require__(161),isObject=__webpack_require__(38),isPlainObject=__webpack_require__(548),isTypedArray=__webpack_require__(166),safeGet=__webpack_require__(253),toPlainObject=__webpack_require__(552);module.exports=function baseMergeDeep(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked)assignMergeValue(object,key,stacked);else{var newValue=customizer?customizer(objValue,srcValue,key+"",object,source,stack):void 0,isCommon=void 0===newValue;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue,isArr||isBuff||isTyped?isArray(objValue)?newValue=objValue:isArrayLikeObject(objValue)?newValue=copyArray(objValue):isBuff?(isCommon=!1,newValue=cloneBuffer(srcValue,!0)):isTyped?(isCommon=!1,newValue=cloneTypedArray(srcValue,!0)):newValue=[]:isPlainObject(srcValue)||isArguments(srcValue)?(newValue=objValue,isArguments(objValue)?newValue=toPlainObject(objValue):isObject(objValue)&&!isFunction(objValue)||(newValue=initCloneObject(srcValue))):isCommon=!1}isCommon&&(stack.set(srcValue,newValue),mergeFunc(newValue,srcValue,srcIndex,customizer,stack),stack.delete(srcValue)),assignMergeValue(object,key,newValue)}}},function(module,exports,__webpack_require__){(function(module){var root=__webpack_require__(24),freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,Buffer=freeModule&&freeModule.exports===freeExports?root.Buffer:void 0,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0;module.exports=function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}}).call(this,__webpack_require__(54)(module))},function(module,exports,__webpack_require__){var cloneArrayBuffer=__webpack_require__(541);module.exports=function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}},function(module,exports,__webpack_require__){var Uint8Array=__webpack_require__(248);module.exports=function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)),result}},function(module,exports){module.exports=function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}},function(module,exports,__webpack_require__){var baseCreate=__webpack_require__(544),getPrototype=__webpack_require__(249),isPrototype=__webpack_require__(164);module.exports=function initCloneObject(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(38),objectCreate=Object.create,baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=void 0,result}}();module.exports=baseCreate},function(module,exports,__webpack_require__){var baseGetTag=__webpack_require__(70),isObjectLike=__webpack_require__(57);module.exports=function baseIsArguments(value){return isObjectLike(value)&&"[object Arguments]"==baseGetTag(value)}},function(module,exports,__webpack_require__){var isArrayLike=__webpack_require__(117),isObjectLike=__webpack_require__(57);module.exports=function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}},function(module,exports){module.exports=function stubFalse(){return!1}},function(module,exports,__webpack_require__){var baseGetTag=__webpack_require__(70),getPrototype=__webpack_require__(249),isObjectLike=__webpack_require__(57),funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);module.exports=function isPlainObject(value){if(!isObjectLike(value)||"[object Object]"!=baseGetTag(value))return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}},function(module,exports,__webpack_require__){var baseGetTag=__webpack_require__(70),isLength=__webpack_require__(252),isObjectLike=__webpack_require__(57),typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1,module.exports=function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]}},function(module,exports){module.exports=function baseUnary(func){return function(value){return func(value)}}},function(module,exports,__webpack_require__){(function(module){var freeGlobal=__webpack_require__(242),freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=freeModule&&freeModule.exports===freeExports&&freeGlobal.process,nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;return types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}();module.exports=nodeUtil}).call(this,__webpack_require__(54)(module))},function(module,exports,__webpack_require__){var copyObject=__webpack_require__(553),keysIn=__webpack_require__(254);module.exports=function toPlainObject(value){return copyObject(value,keysIn(value))}},function(module,exports,__webpack_require__){var assignValue=__webpack_require__(554),baseAssignValue=__webpack_require__(163);module.exports=function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=customizer?customizer(object[key],source[key],key,object,source):void 0;void 0===newValue&&(newValue=source[key]),isNew?baseAssignValue(object,key,newValue):assignValue(object,key,newValue)}return object}},function(module,exports,__webpack_require__){var baseAssignValue=__webpack_require__(163),eq=__webpack_require__(89),hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function assignValue(object,key,value){var objValue=object[key];hasOwnProperty.call(object,key)&&eq(objValue,value)&&(void 0!==value||key in object)||baseAssignValue(object,key,value)}},function(module,exports){module.exports=function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(38),isPrototype=__webpack_require__(164),nativeKeysIn=__webpack_require__(557),hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function baseKeysIn(object){if(!isObject(object))return nativeKeysIn(object);var isProto=isPrototype(object),result=[];for(var key in object)("constructor"!=key||!isProto&&hasOwnProperty.call(object,key))&&result.push(key);return result}},function(module,exports){module.exports=function nativeKeysIn(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}},function(module,exports,__webpack_require__){var baseRest=__webpack_require__(559),isIterateeCall=__webpack_require__(566);module.exports=function createAssigner(assigner){return baseRest((function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++index<length;){var source=sources[index];source&&assigner(object,source,index,customizer)}return object}))}},function(module,exports,__webpack_require__){var identity=__webpack_require__(257),overRest=__webpack_require__(560),setToString=__webpack_require__(562);module.exports=function baseRest(func,start){return setToString(overRest(func,start,identity),func+"")}},function(module,exports,__webpack_require__){var apply=__webpack_require__(561),nativeMax=Math.max;module.exports=function overRest(func,start,transform){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),apply(func,this,otherArgs)}}},function(module,exports){module.exports=function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}},function(module,exports,__webpack_require__){var baseSetToString=__webpack_require__(563),setToString=__webpack_require__(565)(baseSetToString);module.exports=setToString},function(module,exports,__webpack_require__){var constant=__webpack_require__(564),defineProperty=__webpack_require__(247),identity=__webpack_require__(257),baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity;module.exports=baseSetToString},function(module,exports){module.exports=function constant(value){return function(){return value}}},function(module,exports){var nativeNow=Date.now;module.exports=function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=16-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}},function(module,exports,__webpack_require__){var eq=__webpack_require__(89),isArrayLike=__webpack_require__(117),isIndex=__webpack_require__(256),isObject=__webpack_require__(38);module.exports=function isIterateeCall(value,index,object){if(!isObject(object))return!1;var type=typeof index;return!!("number"==type?isArrayLike(object)&&isIndex(index,object.length):"string"==type&&index in object)&&eq(object[index],value)}},function(module,exports,__webpack_require__){var baseIsEqual=__webpack_require__(568);module.exports=function isEqual(value,other){return baseIsEqual(value,other)}},function(module,exports,__webpack_require__){var baseIsEqualDeep=__webpack_require__(569),isObjectLike=__webpack_require__(57);module.exports=function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}},function(module,exports,__webpack_require__){var Stack=__webpack_require__(244),equalArrays=__webpack_require__(258),equalByTag=__webpack_require__(575),equalObjects=__webpack_require__(578),getTag=__webpack_require__(588),isArray=__webpack_require__(56),isBuffer=__webpack_require__(165),isTypedArray=__webpack_require__(166),objectTag="[object Object]",hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?"[object Array]":getTag(object),othTag=othIsArr?"[object Array]":getTag(other),objIsObj=(objTag="[object Arguments]"==objTag?objectTag:objTag)==objectTag,othIsObj=(othTag="[object Arguments]"==othTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),equalObjects(object,other,bitmask,customizer,equalFunc,stack))}},function(module,exports,__webpack_require__){var MapCache=__webpack_require__(162),setCacheAdd=__webpack_require__(571),setCacheHas=__webpack_require__(572);function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,module.exports=SetCache},function(module,exports){module.exports=function setCacheAdd(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this}},function(module,exports){module.exports=function setCacheHas(value){return this.__data__.has(value)}},function(module,exports){module.exports=function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}},function(module,exports){module.exports=function cacheHas(cache,key){return cache.has(key)}},function(module,exports,__webpack_require__){var Symbol=__webpack_require__(111),Uint8Array=__webpack_require__(248),eq=__webpack_require__(89),equalArrays=__webpack_require__(258),mapToArray=__webpack_require__(576),setToArray=__webpack_require__(577),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;module.exports=function equalByTag(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}},function(module,exports){module.exports=function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach((function(value,key){result[++index]=[key,value]})),result}},function(module,exports){module.exports=function setToArray(set){var index=-1,result=Array(set.size);return set.forEach((function(value){result[++index]=value})),result}},function(module,exports,__webpack_require__){var getAllKeys=__webpack_require__(579),hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function equalObjects(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key)))return!1}var stacked=stack.get(object);if(stacked&&stack.get(other))return stacked==other;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!("function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor)&&(result=!1)}return stack.delete(object),stack.delete(other),result}},function(module,exports,__webpack_require__){var baseGetAllKeys=__webpack_require__(580),getSymbols=__webpack_require__(582),keys=__webpack_require__(585);module.exports=function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}},function(module,exports,__webpack_require__){var arrayPush=__webpack_require__(581),isArray=__webpack_require__(56);module.exports=function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}},function(module,exports){module.exports=function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}},function(module,exports,__webpack_require__){var arrayFilter=__webpack_require__(583),stubArray=__webpack_require__(584),propertyIsEnumerable=Object.prototype.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),(function(symbol){return propertyIsEnumerable.call(object,symbol)})))}:stubArray;module.exports=getSymbols},function(module,exports){module.exports=function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}},function(module,exports){module.exports=function stubArray(){return[]}},function(module,exports,__webpack_require__){var arrayLikeKeys=__webpack_require__(255),baseKeys=__webpack_require__(586),isArrayLike=__webpack_require__(117);module.exports=function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}},function(module,exports,__webpack_require__){var isPrototype=__webpack_require__(164),nativeKeys=__webpack_require__(587),hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&"constructor"!=key&&result.push(key);return result}},function(module,exports,__webpack_require__){var nativeKeys=__webpack_require__(250)(Object.keys,Object);module.exports=nativeKeys},function(module,exports,__webpack_require__){var DataView=__webpack_require__(589),Map=__webpack_require__(160),Promise=__webpack_require__(590),Set=__webpack_require__(591),WeakMap=__webpack_require__(592),baseGetTag=__webpack_require__(70),toSource=__webpack_require__(245),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),getTag=baseGetTag;(DataView&&"[object DataView]"!=getTag(new DataView(new ArrayBuffer(1)))||Map&&"[object Map]"!=getTag(new Map)||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&"[object Set]"!=getTag(new Set)||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=baseGetTag(value),Ctor="[object Object]"==result?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return"[object DataView]";case mapCtorString:return"[object Map]";case promiseCtorString:return"[object Promise]";case setCtorString:return"[object Set]";case weakMapCtorString:return"[object WeakMap]"}return result}),module.exports=getTag},function(module,exports,__webpack_require__){var DataView=__webpack_require__(58)(__webpack_require__(24),"DataView");module.exports=DataView},function(module,exports,__webpack_require__){var Promise=__webpack_require__(58)(__webpack_require__(24),"Promise");module.exports=Promise},function(module,exports,__webpack_require__){var Set=__webpack_require__(58)(__webpack_require__(24),"Set");module.exports=Set},function(module,exports,__webpack_require__){var WeakMap=__webpack_require__(58)(__webpack_require__(24),"WeakMap");module.exports=WeakMap},function(module,exports,__webpack_require__){var castPath=__webpack_require__(594),toKey=__webpack_require__(599);module.exports=function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}},function(module,exports,__webpack_require__){var isArray=__webpack_require__(56),isKey=__webpack_require__(595),stringToPath=__webpack_require__(596),toString=__webpack_require__(110);module.exports=function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}},function(module,exports,__webpack_require__){var isArray=__webpack_require__(56),isSymbol=__webpack_require__(112),reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;module.exports=function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}},function(module,exports,__webpack_require__){var memoizeCapped=__webpack_require__(597),rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped((function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,(function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)})),result}));module.exports=stringToPath},function(module,exports,__webpack_require__){var memoize=__webpack_require__(598);module.exports=function memoizeCapped(func){var result=memoize(func,(function(key){return 500===cache.size&&cache.clear(),key})),cache=result.cache;return result}},function(module,exports,__webpack_require__){var MapCache=__webpack_require__(162);function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError("Expected a function");var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache,module.exports=memoize},function(module,exports,__webpack_require__){var isSymbol=__webpack_require__(112);module.exports=function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(29),__webpack_require__(46),__webpack_require__(47),__webpack_require__(152),__webpack_require__(151),__webpack_require__(48),__webpack_require__(65),__webpack_require__(30),__webpack_require__(85),__webpack_require__(240),__webpack_require__(231),__webpack_require__(601),__webpack_require__(66),__webpack_require__(108),__webpack_require__(63),__webpack_require__(262),__webpack_require__(602),__webpack_require__(67),__webpack_require__(153),__webpack_require__(603),__webpack_require__(155),__webpack_require__(55),__webpack_require__(263),__webpack_require__(23),__webpack_require__(148),__webpack_require__(69),__webpack_require__(68),__webpack_require__(50),__webpack_require__(604),__webpack_require__(49),__webpack_require__(37),__webpack_require__(264),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _eventemitter=_interopRequireDefault(__webpack_require__(605)),_memoizerific=_interopRequireDefault(__webpack_require__(265)),_debounce=_interopRequireDefault(__webpack_require__(606)),_tsDedent=_interopRequireDefault(__webpack_require__(609)),_stable=_interopRequireDefault(__webpack_require__(610)),_coreEvents=_interopRequireDefault(__webpack_require__(88)),_clientLogger=__webpack_require__(64),_hooks=__webpack_require__(167);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _templateObject(){var data=function _taggedTemplateLiteral(strings,raw){raw||(raw=strings.slice(0));return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}(["\n Story with id "," already exists in the store!\n\n Perhaps you added the same story twice, or you have a name collision?\n Story ids need to be unique -- ensure you aren't using the same names modulo url-sanitization.\n "]);return _templateObject=function _templateObject(){return data},data}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var toKey=function toKey(input){return input.replace(/[^a-z0-9]+([a-z0-9])/gi,(function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return params[1].toUpperCase()}))},count=0,getId=function getId(){return count+=1},isStoryDocsOnly=function isStoryDocsOnly(parameters){return parameters&¶meters.docsOnly},includeStory=function includeStory(story){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{includeDocsOnly:!1};return!!options.includeDocsOnly||!isStoryDocsOnly(story.parameters)},StoryStore=function(_EventEmitter){function StoryStore(params){var _this;return function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,StoryStore),(_this=function _possibleConstructorReturn(self,call){return!call||"object"!==_typeof(call)&&"function"!=typeof call?_assertThisInitialized(self):call}(this,_getPrototypeOf(StoryStore).call(this)))._error=void 0,_this._channel=void 0,_this._data=void 0,_this._legacyData=void 0,_this._legacydata=void 0,_this._revision=void 0,_this._selection=void 0,_this.setChannel=function(channel){_this._channel=channel},_this.fromId=function(id){try{var data=_this._data[id];return data&&data.getDecorated?data:null}catch(e){return _clientLogger.logger.warn("failed to get story:",_this._data),_clientLogger.logger.error(e),null}},_this.getSelection=function(){return _this._selection},_this.getError=function(){return _this._error},_this.remove=function(id){var _data=_assertThisInitialized(_this)._data,story=_data[id];if(delete _data[id],story){story.hooks.clean();var kind=story.kind,name=story.name,kindData=_this._legacydata[toKey(kind)];kindData&&delete kindData.stories[toKey(name)]}},_this.pushToManager=(0,_debounce.default)((function(){if(_this._channel){var stories=_this.extract({includeDocsOnly:!0});_this._channel.emit(_coreEvents.default.SET_STORIES,{stories:stories})}}),0),_this._legacydata={},_this._data={},_this._revision=0,_this._selection={},_this._channel=params.channel,_this._error=void 0,_this}return function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(StoryStore,_EventEmitter),function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(StoryStore,[{key:"raw",value:function raw(options){var _this2=this;return Object.values(this._data).filter((function(i){return!!i.getDecorated})).filter((function(i){return includeStory(i,options)})).map((function(_ref3){var id=_ref3.id;return _this2.fromId(id)}))}},{key:"extract",value:function extract(options){var _this3=this,stories=Object.entries(this._data);if(Object.values(this._data).length>0){var index=Object.keys(this._data).find((function(key){return!!(_this3._data[key]&&_this3._data[key].parameters&&_this3._data[key].parameters.options)}));if(index&&this._data[index].parameters.options.storySort){var sortFn=this._data[index].parameters.options.storySort;_stable.default.inplace(stories,sortFn)}}return stories.reduce((function(a,_ref4){var _ref5=_slicedToArray(_ref4,2),k=_ref5[0],v=_ref5[1];return includeStory(v,options)?Object.assign(a,_defineProperty({},k,function toExtracted(obj){return Object.entries(obj).reduce((function(acc,_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];return"function"==typeof value||"hooks"===key?acc:Array.isArray(value)?Object.assign(acc,_defineProperty({},key,value.slice().sort())):Object.assign(acc,_defineProperty({},key,value))}),{})}(v))):a}),{})}},{key:"setSelection",value:function setSelection(data,error){var _this4=this;this._selection=void 0===data?this._selection:{storyId:data.storyId,viewMode:data.viewMode},this._error=void 0===error?this._error:error;var isStarted=!1;this._channel&&(this._channel.emit(_coreEvents.default.STORY_RENDER),isStarted=!0),setTimeout((function(){_this4._channel&&!isStarted&&_this4._channel.emit(_coreEvents.default.STORY_RENDER),_this4.emit(_coreEvents.default.STORY_RENDER)}),1)}},{key:"addStory",value:function addStory(_ref6,_ref7){var id=_ref6.id,kind=_ref6.kind,name=_ref6.name,original=_ref6.storyFn,_ref6$parameters=_ref6.parameters,parameters=void 0===_ref6$parameters?{}:_ref6$parameters,getDecorators=_ref7.getDecorators,applyDecorators=_ref7.applyDecorators,_data=this._data;_data[id]&&_clientLogger.logger.warn((0,_tsDedent.default)(_templateObject(),id));var identification={id:id,kind:kind,name:name,story:name},getOriginal=function getOriginal(){return original},getDecorated=(0,_memoizerific.default)(1)((function(){return applyDecorators(getOriginal(),getDecorators())})),hooks=new _hooks.HooksContext,storyFn=function storyFn(p){return getDecorated()(Object.assign({},identification,{},p,{hooks:hooks,parameters:Object.assign({},parameters,{},p&&p.parameters)}))};_data[id]=Object.assign({},identification,{hooks:hooks,getDecorated:getDecorated,getOriginal:getOriginal,storyFn:storyFn,parameters:parameters}),isStoryDocsOnly(parameters)||this.addLegacyStory({kind:kind,name:name,storyFn:storyFn,parameters:parameters}),this.pushToManager()}},{key:"getRevision",value:function getRevision(){return this._revision}},{key:"incrementRevision",value:function incrementRevision(){this._revision+=1}},{key:"addLegacyStory",value:function addLegacyStory(_ref8){var kind=_ref8.kind,name=_ref8.name,storyFn=_ref8.storyFn,parameters=_ref8.parameters,k=toKey(kind);this._legacydata[k]||(this._legacydata[k]={kind:kind,fileName:parameters.fileName,index:getId(),stories:{}}),this._legacydata[k].stories[toKey(name)]={name:name,index:getId(),story:storyFn,parameters:parameters}}},{key:"getStoryKinds",value:function getStoryKinds(){return Object.values(this._legacydata).filter((function(kind){return Object.keys(kind.stories).length>0})).sort((function(info1,info2){return info1.index-info2.index})).map((function(info){return info.kind}))}},{key:"getStories",value:function getStories(kind){var _this5=this,key=toKey(kind);return this._legacydata[key]?Object.keys(this._legacydata[key].stories).map((function(name){return _this5._legacydata[key].stories[name]})).sort((function(info1,info2){return info1.index-info2.index})).map((function(info){return info.name})):[]}},{key:"getStoriesForKind",value:function getStoriesForKind(kind){return this.raw().filter((function(story){return story.kind===kind}))}},{key:"getStoryFileName",value:function getStoryFileName(kind){var key=toKey(kind),storiesKind=this._legacydata[key];return storiesKind?storiesKind.fileName:null}},{key:"getStoryAndParameters",value:function getStoryAndParameters(kind,name){if(!kind||!name)return null;var storiesKind=this._legacydata[toKey(kind)];if(!storiesKind)return null;var storyInfo=storiesKind.stories[toKey(name)];return storyInfo?{story:storyInfo.story,parameters:storyInfo.parameters}:null}},{key:"getStory",value:function getStory(kind,name){var data=this.getStoryAndParameters(kind,name);return data&&data.story}},{key:"getStoryWithContext",value:function getStoryWithContext(kind,name){var data=this.getStoryAndParameters(kind,name);return data?data.story:null}},{key:"removeStoryKind",value:function removeStoryKind(kind){this.hasStoryKind(kind)&&(this._legacydata[toKey(kind)].stories={},this.cleanHooksForKind(kind),this._data=Object.entries(this._data).reduce((function(acc,_ref9){var _ref10=_slicedToArray(_ref9,2),id=_ref10[0],story=_ref10[1];return story.kind!==kind&&Object.assign(acc,_defineProperty({},id,story)),acc}),{}),this.pushToManager())}},{key:"hasStoryKind",value:function hasStoryKind(kind){return Boolean(this._legacydata[toKey(kind)])}},{key:"hasStory",value:function hasStory(kind,name){return Boolean(this.getStory(kind,name))}},{key:"dumpStoryBook",value:function dumpStoryBook(){var _this6=this;return this.getStoryKinds().map((function(kind){return{kind:kind,stories:_this6.getStories(kind)}}))}},{key:"size",value:function size(){return Object.keys(this._legacydata).length}},{key:"clean",value:function clean(){var _this7=this;this.getStoryKinds().forEach((function(kind){return delete _this7._legacydata[toKey(kind)]}))}},{key:"cleanHooks",value:function cleanHooks(id){this._data[id]&&this._data[id].hooks.clean()}},{key:"cleanHooksForKind",value:function cleanHooksForKind(kind){var _this8=this;this.getStoriesForKind(kind).map((function(story){return _this8.cleanHooks(story.id)}))}}]),StoryStore}(_eventemitter.default);exports.default=StoryStore},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(2),aFunction=__webpack_require__(53),toObject=__webpack_require__(22),fails=__webpack_require__(5),arrayMethodIsStrict=__webpack_require__(62),test=[],nativeSort=test.sort,FAILS_ON_UNDEFINED=fails((function(){test.sort(void 0)})),FAILS_ON_NULL=fails((function(){test.sort(null)})),STRICT_METHOD=arrayMethodIsStrict("sort");$({target:"Array",proto:!0,forced:FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD},{sort:function sort(comparefn){return void 0===comparefn?nativeSort.call(toObject(this)):nativeSort.call(toObject(this),aFunction(comparefn))}})},function(module,exports,__webpack_require__){var $=__webpack_require__(2),DESCRIPTORS=__webpack_require__(13);$({target:"Object",stat:!0,forced:!DESCRIPTORS,sham:!DESCRIPTORS},{defineProperties:__webpack_require__(214)})},function(module,exports,__webpack_require__){var $=__webpack_require__(2),FREEZING=__webpack_require__(236),fails=__webpack_require__(5),isObject=__webpack_require__(8),onFreeze=__webpack_require__(87).onFreeze,nativeFreeze=Object.freeze;$({target:"Object",stat:!0,forced:fails((function(){nativeFreeze(1)})),sham:!FREEZING},{freeze:function freeze(it){return nativeFreeze&&isObject(it)?nativeFreeze(onFreeze(it)):it}})},function(module,exports,__webpack_require__){"use strict";var fixRegExpWellKnownSymbolLogic=__webpack_require__(158),anObject=__webpack_require__(15),toObject=__webpack_require__(22),toLength=__webpack_require__(35),toInteger=__webpack_require__(99),requireObjectCoercible=__webpack_require__(43),advanceStringIndex=__webpack_require__(241),regExpExec=__webpack_require__(159),max=Math.max,min=Math.min,floor=Math.floor,SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d\d?|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d\d?)/g;fixRegExpWellKnownSymbolLogic("replace",2,(function(REPLACE,nativeReplace,maybeCallNative,reason){var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,REPLACE_KEEPS_$0=reason.REPLACE_KEEPS_$0,UNSAFE_SUBSTITUTE=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function replace(searchValue,replaceValue){var O=requireObjectCoercible(this),replacer=null==searchValue?void 0:searchValue[REPLACE];return void 0!==replacer?replacer.call(searchValue,O,replaceValue):nativeReplace.call(String(O),searchValue,replaceValue)},function(regexp,replaceValue){if(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE&&REPLACE_KEEPS_$0||"string"==typeof replaceValue&&-1===replaceValue.indexOf(UNSAFE_SUBSTITUTE)){var res=maybeCallNative(nativeReplace,regexp,this,replaceValue);if(res.done)return res.value}var rx=anObject(regexp),S=String(this),functionalReplace="function"==typeof replaceValue;functionalReplace||(replaceValue=String(replaceValue));var global=rx.global;if(global){var fullUnicode=rx.unicode;rx.lastIndex=0}for(var results=[];;){var result=regExpExec(rx,S);if(null===result)break;if(results.push(result),!global)break;""===String(result[0])&&(rx.lastIndex=advanceStringIndex(S,toLength(rx.lastIndex),fullUnicode))}for(var it,accumulatedResult="",nextSourcePosition=0,i=0;i<results.length;i++){result=results[i];for(var matched=String(result[0]),position=max(min(toInteger(result.index),S.length),0),captures=[],j=1;j<result.length;j++)captures.push(void 0===(it=result[j])?it:String(it));var namedCaptures=result.groups;if(functionalReplace){var replacerArgs=[matched].concat(captures,position,S);void 0!==namedCaptures&&replacerArgs.push(namedCaptures);var replacement=String(replaceValue.apply(void 0,replacerArgs))}else replacement=getSubstitution(matched,S,position,captures,namedCaptures,replaceValue);position>=nextSourcePosition&&(accumulatedResult+=S.slice(nextSourcePosition,position)+replacement,nextSourcePosition=position+matched.length)}return accumulatedResult+S.slice(nextSourcePosition)}];function getSubstitution(matched,str,position,captures,namedCaptures,replacement){var tailPos=position+matched.length,m=captures.length,symbols=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==namedCaptures&&(namedCaptures=toObject(namedCaptures),symbols=SUBSTITUTION_SYMBOLS),nativeReplace.call(replacement,symbols,(function(match,ch){var capture;switch(ch.charAt(0)){case"$":return"$";case"&":return matched;case"`":return str.slice(0,position);case"'":return str.slice(tailPos);case"<":capture=namedCaptures[ch.slice(1,-1)];break;default:var n=+ch;if(0===n)return match;if(n>m){var f=floor(n/10);return 0===f?match:f<=m?void 0===captures[f-1]?ch.charAt(1):captures[f-1]+ch.charAt(1):match}capture=captures[n-1]}return void 0===capture?"":capture}))}}))},function(module,exports,__webpack_require__){"use strict";var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}function EE(fn,context,once){this.fn=fn,this.context=context,this.once=once||!1}function addListener(emitter,event,fn,context,once){if("function"!=typeof fn)throw new TypeError("The listener must be a function");var listener=new EE(fn,context||emitter,once),evt=prefix?prefix+event:event;return emitter._events[evt]?emitter._events[evt].fn?emitter._events[evt]=[emitter._events[evt],listener]:emitter._events[evt].push(listener):(emitter._events[evt]=listener,emitter._eventsCount++),emitter}function clearEvent(emitter,evt){0==--emitter._eventsCount?emitter._events=new Events:delete emitter._events[evt]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(prefix=!1)),EventEmitter.prototype.eventNames=function eventNames(){var events,name,names=[];if(0===this._eventsCount)return names;for(name in events=this._events)has.call(events,name)&&names.push(prefix?name.slice(1):name);return Object.getOwnPropertySymbols?names.concat(Object.getOwnPropertySymbols(events)):names},EventEmitter.prototype.listeners=function listeners(event){var evt=prefix?prefix+event:event,handlers=this._events[evt];if(!handlers)return[];if(handlers.fn)return[handlers.fn];for(var i=0,l=handlers.length,ee=new Array(l);i<l;i++)ee[i]=handlers[i].fn;return ee},EventEmitter.prototype.listenerCount=function listenerCount(event){var evt=prefix?prefix+event:event,listeners=this._events[evt];return listeners?listeners.fn?1:listeners.length:0},EventEmitter.prototype.emit=function emit(event,a1,a2,a3,a4,a5){var evt=prefix?prefix+event:event;if(!this._events[evt])return!1;var args,i,listeners=this._events[evt],len=arguments.length;if(listeners.fn){switch(listeners.once&&this.removeListener(event,listeners.fn,void 0,!0),len){case 1:return listeners.fn.call(listeners.context),!0;case 2:return listeners.fn.call(listeners.context,a1),!0;case 3:return listeners.fn.call(listeners.context,a1,a2),!0;case 4:return listeners.fn.call(listeners.context,a1,a2,a3),!0;case 5:return listeners.fn.call(listeners.context,a1,a2,a3,a4),!0;case 6:return listeners.fn.call(listeners.context,a1,a2,a3,a4,a5),!0}for(i=1,args=new Array(len-1);i<len;i++)args[i-1]=arguments[i];listeners.fn.apply(listeners.context,args)}else{var j,length=listeners.length;for(i=0;i<length;i++)switch(listeners[i].once&&this.removeListener(event,listeners[i].fn,void 0,!0),len){case 1:listeners[i].fn.call(listeners[i].context);break;case 2:listeners[i].fn.call(listeners[i].context,a1);break;case 3:listeners[i].fn.call(listeners[i].context,a1,a2);break;case 4:listeners[i].fn.call(listeners[i].context,a1,a2,a3);break;default:if(!args)for(j=1,args=new Array(len-1);j<len;j++)args[j-1]=arguments[j];listeners[i].fn.apply(listeners[i].context,args)}}return!0},EventEmitter.prototype.on=function on(event,fn,context){return addListener(this,event,fn,context,!1)},EventEmitter.prototype.once=function once(event,fn,context){return addListener(this,event,fn,context,!0)},EventEmitter.prototype.removeListener=function removeListener(event,fn,context,once){var evt=prefix?prefix+event:event;if(!this._events[evt])return this;if(!fn)return clearEvent(this,evt),this;var listeners=this._events[evt];if(listeners.fn)listeners.fn!==fn||once&&!listeners.once||context&&listeners.context!==context||clearEvent(this,evt);else{for(var i=0,events=[],length=listeners.length;i<length;i++)(listeners[i].fn!==fn||once&&!listeners[i].once||context&&listeners[i].context!==context)&&events.push(listeners[i]);events.length?this._events[evt]=1===events.length?events[0]:events:clearEvent(this,evt)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(event){var evt;return event?(evt=prefix?prefix+event:event,this._events[evt]&&clearEvent(this,evt)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=prefix,EventEmitter.EventEmitter=EventEmitter,module.exports=EventEmitter},function(module,exports,__webpack_require__){var isObject=__webpack_require__(38),now=__webpack_require__(607),toNumber=__webpack_require__(608),nativeMax=Math.max,nativeMin=Math.min;module.exports=function debounce(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError("Expected a function");function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&time-lastInvokeTime>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,function remainingWait(time){var timeWaiting=wait-(time-lastCallTime);return maxing?nativeMin(timeWaiting,maxWait-(time-lastInvokeTime)):timeWaiting}(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return clearTimeout(timerId),timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxWait=(maxing="maxWait"in options)?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0},debounced.flush=function flush(){return void 0===timerId?result:trailingEdge(now())},debounced}},function(module,exports,__webpack_require__){var root=__webpack_require__(24);module.exports=function(){return root.Date.now()}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(38),isSymbol=__webpack_require__(112),reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;module.exports=function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NaN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NaN:+value}},function(module,exports,__webpack_require__){"use strict";function dedent(templ){for(var values=[],_i=1;_i<arguments.length;_i++)values[_i-1]=arguments[_i];var strings=Array.from("string"==typeof templ?[templ]:templ.raw);strings[strings.length-1]=strings[strings.length-1].replace(/\r?\n([\t ]*)$/,"");var indentLengths=strings.reduce((function(arr,str){var matches=str.match(/\n[\t ]+/g);return matches?arr.concat(matches.map((function(match){return match.length-1}))):arr}),[]);if(indentLengths.length){var pattern_1=new RegExp("\n[\t ]{"+Math.min.apply(Math,indentLengths)+"}","g");strings=strings.map((function(str){return str.replace(pattern_1,"\n")}))}strings[0]=strings[0].replace(/^\r?\n/,"");var string=strings[0];return values.forEach((function(value,i){string+=value+strings[i+1]})),string}Object.defineProperty(exports,"__esModule",{value:!0}),exports.dedent=dedent,exports.default=dedent},function(module,exports,__webpack_require__){module.exports=function(){"use strict";var stable=function(arr,comp){return exec(arr.slice(),comp)};function exec(arr,comp){"function"!=typeof comp&&(comp=function(a,b){return String(a).localeCompare(b)});var len=arr.length;if(len<=1)return arr;for(var buffer=new Array(len),chk=1;chk<len;chk*=2){pass(arr,comp,chk,buffer);var tmp=arr;arr=buffer,buffer=tmp}return arr}stable.inplace=function(arr,comp){var result=exec(arr,comp);return result!==arr&&pass(result,null,arr.length,arr),arr};var pass=function(arr,comp,chk,result){var l,r,e,li,ri,len=arr.length,i=0,dbl=2*chk;for(l=0;l<len;l+=dbl)for(e=(r=l+chk)+chk,r>len&&(r=len),e>len&&(e=len),li=l,ri=r;;)if(li<r&&ri<e)comp(arr[li],arr[ri])<=0?result[i++]=arr[li++]:result[i++]=arr[ri++];else if(li<r)result[i++]=arr[li++];else{if(!(ri<e))break;result[i++]=arr[ri++]}};return stable}()},function(module,exports,__webpack_require__){"use strict";__webpack_require__(67),__webpack_require__(264),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _coreEvents=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(88));function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var ConfigApi=function(){function ConfigApi(_ref){var _this=this,channel=_ref.channel,storyStore=_ref.storyStore,clientApi=_ref.clientApi,clearDecorators=_ref.clearDecorators;!function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ConfigApi),this._channel=void 0,this._storyStore=void 0,this._clearDecorators=void 0,this.clientApi=void 0,this.configure=function(loaders,module){module.hot&&(module.hot.accept(),module._StorybookPreserveDecorators||module.hot.dispose((function(){_this._clearDecorators()}))),_this._channel?(!function render(){var errors=[];try{loaders&&loaders()}catch(e){errors.push(e)}if(!errors.length)try{_this._renderMain()}catch(e){errors.push(e)}if(errors.length)throw _this._storyStore.setSelection(void 0,errors[0]),errors[0];_this._storyStore.setSelection(void 0,null)}(),setTimeout((function(){return _this._channel.emit(_coreEvents.default.STORIES_CONFIGURED)}),0)):loaders()},this._channel=channel,this._storyStore=storyStore,this._clearDecorators=clearDecorators,this.clientApi=clientApi}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(ConfigApi,[{key:"_renderMain",value:function _renderMain(){this._storyStore.emit(_coreEvents.default.STORY_INIT)}},{key:"_renderError",value:function _renderError(err){var error={stack:err.stack,message:err.message};this._storyStore.setSelection(void 0,error)}}]),ConfigApi}();exports.default=ConfigApi},function(module,exports,__webpack_require__){"use strict";__webpack_require__(69),__webpack_require__(157),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function pathToId(path){var match=(path||"").match(/^\/story\/(.+)/);if(!match)throw new Error("Invalid path '".concat(path,"', must start with '/story/'"));return match[1]}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(69),__webpack_require__(266),Object.defineProperty(exports,"__esModule",{value:!0}),exports.getQueryParam=exports.getQueryParams=void 0;var _global=__webpack_require__(36),_qs=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(267));var getQueryParams=function getQueryParams(){return _global.document&&_global.document.location&&_global.document.location.search?_qs.default.parse(_global.document.location.search,{ignoreQueryPrefix:!0}):{}};exports.getQueryParams=getQueryParams;exports.getQueryParam=function getQueryParam(key){return getQueryParams()[key]}},function(module,exports){module.exports=Object.is||function is(x,y){return x===y?0!==x||1/x==1/y:x!=x&&y!=y}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(168),formats=__webpack_require__(268),has=Object.prototype.hasOwnProperty,arrayPrefixGenerators={brackets:function brackets(prefix){return prefix+"[]"},comma:"comma",indices:function indices(prefix,key){return prefix+"["+key+"]"},repeat:function repeat(prefix){return prefix}},isArray=Array.isArray,push=Array.prototype.push,pushToArray=function(arr,valueOrArray){push.apply(arr,isArray(valueOrArray)?valueOrArray:[valueOrArray])},toISO=Date.prototype.toISOString,defaultFormat=formats.default,defaults={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:utils.encode,encodeValuesOnly:!1,format:defaultFormat,formatter:formats.formatters[defaultFormat],indices:!1,serializeDate:function serializeDate(date){return toISO.call(date)},skipNulls:!1,strictNullHandling:!1},stringify=function stringify(object,prefix,generateArrayPrefix,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,formatter,encodeValuesOnly,charset){var obj=object;if("function"==typeof filter?obj=filter(prefix,obj):obj instanceof Date?obj=serializeDate(obj):"comma"===generateArrayPrefix&&isArray(obj)&&(obj=obj.join(",")),null===obj){if(strictNullHandling)return encoder&&!encodeValuesOnly?encoder(prefix,defaults.encoder,charset,"key"):prefix;obj=""}if(function isNonNullishPrimitive(v){return"string"==typeof v||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v}(obj)||utils.isBuffer(obj))return encoder?[formatter(encodeValuesOnly?prefix:encoder(prefix,defaults.encoder,charset,"key"))+"="+formatter(encoder(obj,defaults.encoder,charset,"value"))]:[formatter(prefix)+"="+formatter(String(obj))];var objKeys,values=[];if(void 0===obj)return values;if(isArray(filter))objKeys=filter;else{var keys=Object.keys(obj);objKeys=sort?keys.sort(sort):keys}for(var i=0;i<objKeys.length;++i){var key=objKeys[i];skipNulls&&null===obj[key]||(isArray(obj)?pushToArray(values,stringify(obj[key],"function"==typeof generateArrayPrefix?generateArrayPrefix(prefix,key):prefix,generateArrayPrefix,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,formatter,encodeValuesOnly,charset)):pushToArray(values,stringify(obj[key],prefix+(allowDots?"."+key:"["+key+"]"),generateArrayPrefix,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,formatter,encodeValuesOnly,charset)))}return values};module.exports=function(object,opts){var objKeys,obj=object,options=function normalizeStringifyOptions(opts){if(!opts)return defaults;if(null!==opts.encoder&&void 0!==opts.encoder&&"function"!=typeof opts.encoder)throw new TypeError("Encoder has to be a function.");var charset=opts.charset||defaults.charset;if(void 0!==opts.charset&&"utf-8"!==opts.charset&&"iso-8859-1"!==opts.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var format=formats.default;if(void 0!==opts.format){if(!has.call(formats.formatters,opts.format))throw new TypeError("Unknown format option provided.");format=opts.format}var formatter=formats.formatters[format],filter=defaults.filter;return("function"==typeof opts.filter||isArray(opts.filter))&&(filter=opts.filter),{addQueryPrefix:"boolean"==typeof opts.addQueryPrefix?opts.addQueryPrefix:defaults.addQueryPrefix,allowDots:void 0===opts.allowDots?defaults.allowDots:!!opts.allowDots,charset:charset,charsetSentinel:"boolean"==typeof opts.charsetSentinel?opts.charsetSentinel:defaults.charsetSentinel,delimiter:void 0===opts.delimiter?defaults.delimiter:opts.delimiter,encode:"boolean"==typeof opts.encode?opts.encode:defaults.encode,encoder:"function"==typeof opts.encoder?opts.encoder:defaults.encoder,encodeValuesOnly:"boolean"==typeof opts.encodeValuesOnly?opts.encodeValuesOnly:defaults.encodeValuesOnly,filter:filter,formatter:formatter,serializeDate:"function"==typeof opts.serializeDate?opts.serializeDate:defaults.serializeDate,skipNulls:"boolean"==typeof opts.skipNulls?opts.skipNulls:defaults.skipNulls,sort:"function"==typeof opts.sort?opts.sort:null,strictNullHandling:"boolean"==typeof opts.strictNullHandling?opts.strictNullHandling:defaults.strictNullHandling}}(opts);"function"==typeof options.filter?obj=(0,options.filter)("",obj):isArray(options.filter)&&(objKeys=options.filter);var arrayFormat,keys=[];if("object"!=typeof obj||null===obj)return"";arrayFormat=opts&&opts.arrayFormat in arrayPrefixGenerators?opts.arrayFormat:opts&&"indices"in opts?opts.indices?"indices":"repeat":"indices";var generateArrayPrefix=arrayPrefixGenerators[arrayFormat];objKeys||(objKeys=Object.keys(obj)),options.sort&&objKeys.sort(options.sort);for(var i=0;i<objKeys.length;++i){var key=objKeys[i];options.skipNulls&&null===obj[key]||pushToArray(keys,stringify(obj[key],key,generateArrayPrefix,options.strictNullHandling,options.skipNulls,options.encode?options.encoder:null,options.filter,options.sort,options.allowDots,options.serializeDate,options.formatter,options.encodeValuesOnly,options.charset))}var joined=keys.join(options.delimiter),prefix=!0===options.addQueryPrefix?"?":"";return options.charsetSentinel&&("iso-8859-1"===options.charset?prefix+="utf8=%26%2310003%3B&":prefix+="utf8=%E2%9C%93&"),joined.length>0?prefix+joined:""}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(168),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,defaults={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:utils.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(str){return str.replace(/&#(\d+);/g,(function($0,numberStr){return String.fromCharCode(parseInt(numberStr,10))}))},parseKeys=function parseQueryStringKeys(givenKey,val,options){if(givenKey){var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey,child=/(\[[^[\]]*])/g,segment=options.depth>0&&/(\[[^[\]]*])/.exec(key),parent=segment?key.slice(0,segment.index):key,keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)&&!options.allowPrototypes)return;keys.push(parent)}for(var i=0;options.depth>0&&null!==(segment=child.exec(key))&&i<options.depth;){if(i+=1,!options.plainObjects&&has.call(Object.prototype,segment[1].slice(1,-1))&&!options.allowPrototypes)return;keys.push(segment[1])}return segment&&keys.push("["+key.slice(segment.index)+"]"),function(chain,val,options){for(var leaf=val,i=chain.length-1;i>=0;--i){var obj,root=chain[i];if("[]"===root&&options.parseArrays)obj=[].concat(leaf);else{obj=options.plainObjects?Object.create(null):{};var cleanRoot="["===root.charAt(0)&&"]"===root.charAt(root.length-1)?root.slice(1,-1):root,index=parseInt(cleanRoot,10);options.parseArrays||""!==cleanRoot?!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&options.parseArrays&&index<=options.arrayLimit?(obj=[])[index]=leaf:obj[cleanRoot]=leaf:obj={0:leaf}}leaf=obj}return leaf}(keys,val,options)}};module.exports=function(str,opts){var options=function normalizeParseOptions(opts){if(!opts)return defaults;if(null!==opts.decoder&&void 0!==opts.decoder&&"function"!=typeof opts.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==opts.charset&&"utf-8"!==opts.charset&&"iso-8859-1"!==opts.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var charset=void 0===opts.charset?defaults.charset:opts.charset;return{allowDots:void 0===opts.allowDots?defaults.allowDots:!!opts.allowDots,allowPrototypes:"boolean"==typeof opts.allowPrototypes?opts.allowPrototypes:defaults.allowPrototypes,arrayLimit:"number"==typeof opts.arrayLimit?opts.arrayLimit:defaults.arrayLimit,charset:charset,charsetSentinel:"boolean"==typeof opts.charsetSentinel?opts.charsetSentinel:defaults.charsetSentinel,comma:"boolean"==typeof opts.comma?opts.comma:defaults.comma,decoder:"function"==typeof opts.decoder?opts.decoder:defaults.decoder,delimiter:"string"==typeof opts.delimiter||utils.isRegExp(opts.delimiter)?opts.delimiter:defaults.delimiter,depth:"number"==typeof opts.depth||!1===opts.depth?+opts.depth:defaults.depth,ignoreQueryPrefix:!0===opts.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof opts.interpretNumericEntities?opts.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:"number"==typeof opts.parameterLimit?opts.parameterLimit:defaults.parameterLimit,parseArrays:!1!==opts.parseArrays,plainObjects:"boolean"==typeof opts.plainObjects?opts.plainObjects:defaults.plainObjects,strictNullHandling:"boolean"==typeof opts.strictNullHandling?opts.strictNullHandling:defaults.strictNullHandling}}(opts);if(""===str||null==str)return options.plainObjects?Object.create(null):{};for(var tempObj="string"==typeof str?function parseQueryStringValues(str,options){var i,obj={},cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str,limit=options.parameterLimit===1/0?void 0:options.parameterLimit,parts=cleanStr.split(options.delimiter,limit),skipIndex=-1,charset=options.charset;if(options.charsetSentinel)for(i=0;i<parts.length;++i)0===parts[i].indexOf("utf8=")&&("utf8=%E2%9C%93"===parts[i]?charset="utf-8":"utf8=%26%2310003%3B"===parts[i]&&(charset="iso-8859-1"),skipIndex=i,i=parts.length);for(i=0;i<parts.length;++i)if(i!==skipIndex){var key,val,part=parts[i],bracketEqualsPos=part.indexOf("]="),pos=-1===bracketEqualsPos?part.indexOf("="):bracketEqualsPos+1;-1===pos?(key=options.decoder(part,defaults.decoder,charset,"key"),val=options.strictNullHandling?null:""):(key=options.decoder(part.slice(0,pos),defaults.decoder,charset,"key"),val=options.decoder(part.slice(pos+1),defaults.decoder,charset,"value")),val&&options.interpretNumericEntities&&"iso-8859-1"===charset&&(val=interpretNumericEntities(val)),val&&"string"==typeof val&&options.comma&&val.indexOf(",")>-1&&(val=val.split(",")),part.indexOf("[]=")>-1&&(val=isArray(val)?[val]:val),has.call(obj,key)?obj[key]=utils.combine(obj[key],val):obj[key]=val}return obj}(str,options):str,obj=options.plainObjects?Object.create(null):{},keys=Object.keys(tempObj),i=0;i<keys.length;++i){var key=keys[i],newObj=parseKeys(key,tempObj[key],options);obj=utils.merge(obj,newObj,options)}return utils.compact(obj)}},function(module,exports,__webpack_require__){"use strict";__webpack_require__(29),__webpack_require__(46),__webpack_require__(47),__webpack_require__(27),__webpack_require__(234),__webpack_require__(152),__webpack_require__(48),__webpack_require__(86),__webpack_require__(147),__webpack_require__(65),__webpack_require__(30),__webpack_require__(85),__webpack_require__(66),__webpack_require__(108),__webpack_require__(261),__webpack_require__(63),__webpack_require__(55),__webpack_require__(23),__webpack_require__(104),__webpack_require__(68),__webpack_require__(50),__webpack_require__(49),__webpack_require__(37),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function start(render){var _ref3=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},decorateStory=_ref3.decorateStory,context=getContext(decorateStory),clientApi=context.clientApi,channel=context.channel,configApi=context.configApi,storyStore=context.storyStore,previousKind="",previousStory="",previousRevision=-1,previousViewMode="",previousId=null,renderMain=function renderMain(forceRender){var revision=storyStore.getRevision(),loadError=storyStore.getError(),_storyStore$getSelect=storyStore.getSelection(),storyId=_storyStore$getSelect.storyId,urlViewMode=_storyStore$getSelect.viewMode,data=storyStore.fromId(storyId),_ref4=data||{},kind=_ref4.kind,name=_ref4.name,getDecorated=_ref4.getDecorated,id=_ref4.id,parameters=_ref4.parameters,error=_ref4.error,viewMode=parameters&¶meters.docsOnly?"docs":urlViewMode,renderContext=Object.assign({},context,{},data,{selectedKind:kind,selectedStory:name,parameters:parameters,forceRender:forceRender});if(loadError||error)showErrorDisplay(loadError||error);else if(forceRender||revision!==previousRevision||viewMode!==previousViewMode||kind!==previousKind||name!==previousStory){switch(!forceRender&&previousKind&&previousStory&&_addons.default.getChannel().emit(_coreEvents.default.STORY_CHANGED,id),previousViewMode){case"docs":null==previousKind||kind===previousKind&&viewMode===previousViewMode||(storyStore.cleanHooksForKind(previousKind),_reactDom.default.unmountComponentAtNode(_global.document.getElementById("docs-root")));break;case"story":default:null==previousId||id===previousId&&viewMode===previousViewMode||(storyStore.cleanHooks(previousId),_reactDom.default.unmountComponentAtNode(_global.document.getElementById("root")))}if(viewMode!==previousViewMode)switch(viewMode){case"docs":showMain(),_global.document.getElementById("root").setAttribute("hidden",!0),_global.document.getElementById("docs-root").removeAttribute("hidden");break;case"story":default:"docs"===previousViewMode&&(_global.document.getElementById("docs-root").setAttribute("hidden",!0),_global.document.getElementById("root").removeAttribute("hidden"))}switch(viewMode){case"docs":var docs=parameters&¶meters.docs||{},DocsContainer=docs.container||function(_ref5){var children=_ref5.children;return _react.default.createElement(_react.default.Fragment,null,children)},Page=docs.page||_NoDocs.NoDocs;_reactDom.default.render(_react.default.createElement(DocsContainer,{context:renderContext},_react.default.createElement(Page,null)),_global.document.getElementById("docs-root"),(function(){return _addons.default.getChannel().emit(_coreEvents.default.DOCS_RENDERED,kind)}));break;case"story":default:getDecorated?_asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.prev=0,_context.next=3,render(renderContext);case 3:_addons.default.getChannel().emit(_coreEvents.default.STORY_RENDERED,id),_context.next=9;break;case 6:_context.prev=6,_context.t0=_context.catch(0),showException(_context.t0);case 9:case"end":return _context.stop()}}),_callee,null,[[0,6]])})))():(showNopreview(),_addons.default.getChannel().emit(_coreEvents.default.STORY_MISSING,id))}previousRevision=revision,previousKind=kind,previousStory=name,previousViewMode=viewMode,previousId=id,forceRender||"docs"===viewMode||(_global.document.documentElement.scrollTop=0,_global.document.documentElement.scrollLeft=0)}else _addons.default.getChannel().emit(_coreEvents.default.STORY_UNCHANGED,{id:id,revision:revision,kind:kind,name:name,viewMode:viewMode})},renderUI=function renderUI(forceRender){if(isBrowser)try{renderMain(forceRender)}catch(ex){showException(ex)}},forceReRender=function forceReRender(){return renderUI(!0)};if(isBrowser){var deprecatedToId=(0,_utilDeprecate.default)(_csf.toId,"Passing name+kind to the SET_CURRENT_STORY event is deprecated, use a storyId instead");channel.on(_coreEvents.default.FORCE_RE_RENDER,forceReRender),channel.on(_coreEvents.default.SET_CURRENT_STORY,(function(_ref7){var inputStoryId=_ref7.storyId,name=_ref7.name,kind=_ref7.kind,viewMode=_ref7.viewMode,storyId=inputStoryId;if(!storyId){if(!name||!kind)throw new Error("You should pass `storyId` into SET_CURRENT_STORY");storyId=deprecatedToId(kind,name)}storyStore.setSelection({storyId:storyId,viewMode:viewMode}),(0,_url.setPath)({storyId:storyId,viewMode:viewMode})})),_global.window.onkeydown=function(event){if(!focusInInput(event)){var altKey=event.altKey,ctrlKey=event.ctrlKey,metaKey=event.metaKey,shiftKey=event.shiftKey,key=event.key,code=event.code,keyCode=event.keyCode;channel.emit(_coreEvents.default.PREVIEW_KEYDOWN,{event:{altKey:altKey,ctrlKey:ctrlKey,metaKey:metaKey,shiftKey:shiftKey,key:key,code:code,keyCode:keyCode}})}}}storyStore.on(_coreEvents.default.STORY_INIT,(function(){var _initializePath=(0,_url.initializePath)(),storyId=_initializePath.storyId,viewMode=_initializePath.viewMode;storyStore.setSelection({storyId:storyId,viewMode:viewMode})})),storyStore.on(_coreEvents.default.STORY_RENDER,renderUI),void 0!==_global.window&&(_global.window.__STORYBOOK_CLIENT_API__=clientApi,_global.window.__STORYBOOK_STORY_STORE__=storyStore,_global.window.__STORYBOOK_ADDONS_CHANNEL__=channel);var previousExports=new Map,loadStories=function loadStories(loadable,framework){return function(){var reqs=null;Array.isArray(loadable)?reqs=loadable:loadable.keys&&(reqs=[loadable]);var currentExports=new Map;if(reqs)reqs.forEach((function(req){req.keys().forEach((function(filename){var fileExports=req(filename);currentExports.set(fileExports,"function"==typeof req.resolve?req.resolve(filename):null)}))}));else{var exported=loadable();Array.isArray(exported)&&exported.every((function(obj){return null!=obj.default}))?currentExports=new Map(exported.map((function(fileExports){return[fileExports,null]}))):exported&&_clientLogger.logger.warn("Loader function passed to 'configure' should return void or an array of module exports that all contain a 'default' export. Received: ".concat(JSON.stringify(exported)))}var removed=_toConsumableArray(previousExports.keys()).filter((function(exp){return!currentExports.has(exp)}));removed.forEach((function(exp){exp.default&&storyStore.removeStoryKind(exp.default.title)})),removed.length>0&&storyStore.incrementRevision(),_toConsumableArray(currentExports.keys()).filter((function(exp){return!previousExports.has(exp)})).forEach((function(fileExports){if(fileExports.default){if(!fileExports.default.title)throw new Error("Unexpected default export without title: ".concat(JSON.stringify(fileExports.default)));var meta=fileExports.default,__namedExportsOrder=fileExports.__namedExportsOrder,namedExports=_objectWithoutProperties(fileExports,["default","__namedExportsOrder"]),exports=namedExports;Array.isArray(__namedExportsOrder)&&(exports={},__namedExportsOrder.forEach((function(name){namedExports[name]&&(exports[name]=namedExports[name])})));var kindName=meta.title,componentId=meta.id,params=meta.parameters,decos=meta.decorators,component=meta.component,subcomponents=meta.subcomponents,kind=clientApi.storiesOf(kindName,!0);kind.addParameters(Object.assign({framework:framework,component:component,subcomponents:subcomponents,fileName:currentExports.get(fileExports)},params)),(decos||[]).forEach((function(decorator){kind.addDecorator(decorator)})),Object.keys(exports).forEach((function(key){if((0,_csf.isExportStory)(key,meta)){var storyFn=exports[key],_ref8=storyFn.story||{},name=_ref8.name,parameters=_ref8.parameters,decorators=_ref8.decorators;parameters&¶meters.decorators&&(0,_utilDeprecate.default)((function(){}),"".concat(kindName," => ").concat(name||key,": story.parameters.decorators is deprecated; use story.decorators instead."))();var decoratorParams=decorators?{decorators:decorators}:null,exportName=(0,_csf.storyNameFromExport)(key),idParams={__id:(0,_csf.toId)(componentId||kindName,exportName)};kind.add(name||exportName,storyFn,Object.assign({},parameters,{},decoratorParams,{},idParams))}}))}})),previousExports=currentExports}},loaded=!1,configure=function configure(loadable,m,framework){if("string"==typeof m)throw new Error("Invalid module '".concat(m,"'. Did you forget to pass `module` as the second argument to `configure`\"?"));if(m&&m.hot&&m.hot.dispose){var _ref9$previousExports=(m.hot.data||{}).previousExports;previousExports=void 0===_ref9$previousExports?new Map:_ref9$previousExports,m.hot.dispose((function(data){loaded=!1,data.previousExports=previousExports}))}loaded&&_clientLogger.logger.warn("Unexpected loaded state. Did you call `load` twice?"),loaded=!0,configApi.configure(loadStories(loadable,framework),m)};return{configure:configure,context:context,clientApi:clientApi,configApi:configApi,forceReRender:forceReRender}},exports.getContext=void 0,__webpack_require__(118);var _global=__webpack_require__(36),_react=_interopRequireDefault(__webpack_require__(0)),_reactDom=_interopRequireDefault(__webpack_require__(90)),_utilDeprecate=_interopRequireDefault(__webpack_require__(102)),_ansiToHtml=_interopRequireDefault(__webpack_require__(622)),_addons=_interopRequireDefault(__webpack_require__(103)),_channelPostmessage=_interopRequireDefault(__webpack_require__(629)),_clientApi2=__webpack_require__(239),_csf=__webpack_require__(109),_clientLogger=__webpack_require__(64),_coreEvents=_interopRequireDefault(__webpack_require__(88)),_url=__webpack_require__(638),_NoDocs=__webpack_require__(639);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],excluded.indexOf(key)>=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}}(arr)||function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||"[object Arguments]"===Object.prototype.toString.call(iter))return Array.from(iter)}(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}var ansiConverter=new _ansiToHtml.default({escapeXML:!0}),classes_MAIN="sb-show-main",classes_NOPREVIEW="sb-show-nopreview",classes_ERROR="sb-show-errordisplay";function showMain(){_global.document.body.classList.remove(classes_NOPREVIEW),_global.document.body.classList.remove(classes_ERROR),_global.document.body.classList.add(classes_MAIN)}function showNopreview(){_global.document.body.classList.remove(classes_MAIN),_global.document.body.classList.remove(classes_ERROR),_global.document.body.classList.add(classes_NOPREVIEW)}function showErrorDisplay(_ref){var _ref$message=_ref.message,message=void 0===_ref$message?"":_ref$message,_ref$stack=_ref.stack,stack=void 0===_ref$stack?"":_ref$stack;_global.document.getElementById("error-message").innerHTML=ansiConverter.toHtml(message),_global.document.getElementById("error-stack").innerHTML=ansiConverter.toHtml(stack),_global.document.body.classList.remove(classes_MAIN),_global.document.body.classList.remove(classes_NOPREVIEW),_global.document.body.classList.add(classes_ERROR)}function showError(_ref2){var title=_ref2.title,description=_ref2.description;_addons.default.getChannel().emit(_coreEvents.default.STORY_ERRORED,{title:title,description:description}),showErrorDisplay({message:title,stack:description})}function showException(exception){_addons.default.getChannel().emit(_coreEvents.default.STORY_THREW_EXCEPTION,exception),showErrorDisplay(exception),_clientLogger.logger.error(exception)}var isBrowser=_global.navigator&&_global.navigator.userAgent&&"storyshots"!==_global.navigator.userAgent&&!(_global.navigator.userAgent.indexOf("Node.js")>-1)&&!(_global.navigator.userAgent.indexOf("jsdom")>-1),getContext=function(decorateStory){var storyStore,clientApi,channel=null;if(isBrowser)try{channel=_addons.default.getChannel()}catch(e){channel=(0,_channelPostmessage.default)({page:"preview"}),_addons.default.setChannel(channel)}void 0!==_global.window&&_global.window.__STORYBOOK_CLIENT_API__?storyStore=(clientApi=_global.window.__STORYBOOK_CLIENT_API__)._storyStore:(storyStore=new _clientApi2.StoryStore({channel:channel}),clientApi=new _clientApi2.ClientApi({storyStore:storyStore,decorateStory:decorateStory}));var clearDecorators=clientApi.clearDecorators;return{configApi:new _clientApi2.ConfigApi({clearDecorators:clearDecorators,storyStore:storyStore,channel:channel,clientApi:clientApi}),storyStore:storyStore,channel:channel,clientApi:clientApi,showMain:showMain,showError:showError,showException:showException}};function focusInInput(event){return/input|textarea/i.test(event.target.tagName)||null!==event.target.getAttribute("contenteditable")}exports.getContext=getContext},function(module,exports,__webpack_require__){"use strict";var h=__webpack_require__(269),n="function"==typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.forward_ref"):60112,y=n?Symbol.for("react.suspense"):60113;n&&Symbol.for("react.suspense_list");var z=n?Symbol.for("react.memo"):60115,aa=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");var A="function"==typeof Symbol&&Symbol.iterator;function B(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D={};function E(a,b,c){this.props=a,this.context=b,this.refs=D,this.updater=c||C}function F(){}function G(a,b,c){this.props=a,this.context=b,this.refs=D,this.updater=c||C}E.prototype.isReactComponent={},E.prototype.setState=function(a,b){if("object"!=typeof a&&"function"!=typeof a&&null!=a)throw Error(B(85));this.updater.enqueueSetState(this,a,b,"setState")},E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")},F.prototype=E.prototype;var H=G.prototype=new F;H.constructor=G,h(H,E.prototype),H.isPureReactComponent=!0;var I={current:null},J={current:null},K=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};function M(a,b,c){var e,d={},g=null,l=null;if(null!=b)for(e in void 0!==b.ref&&(l=b.ref),void 0!==b.key&&(g=""+b.key),b)K.call(b,e)&&!L.hasOwnProperty(e)&&(d[e]=b[e]);var f=arguments.length-2;if(1===f)d.children=c;else if(1<f){for(var k=Array(f),m=0;m<f;m++)k[m]=arguments[m+2];d.children=k}if(a&&a.defaultProps)for(e in f=a.defaultProps)void 0===d[e]&&(d[e]=f[e]);return{$$typeof:p,type:a,key:g,ref:l,props:d,_owner:J.current}}function N(a){return"object"==typeof a&&null!==a&&a.$$typeof===p}var O=/\/+/g,P=[];function Q(a,b,c,e){if(P.length){var d=P.pop();return d.result=a,d.keyPrefix=b,d.func=c,d.context=e,d.count=0,d}return{result:a,keyPrefix:b,func:c,context:e,count:0}}function R(a){a.result=null,a.keyPrefix=null,a.func=null,a.context=null,a.count=0,10>P.length&&P.push(a)}function U(a,b,c){return null==a?0:function S(a,b,c,e){var d=typeof a;"undefined"!==d&&"boolean"!==d||(a=null);var g=!1;if(null===a)g=!0;else switch(d){case"string":case"number":g=!0;break;case"object":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,""===b?"."+T(a,0):b),1;if(g=0,b=""===b?".":b+":",Array.isArray(a))for(var l=0;l<a.length;l++){var f=b+T(d=a[l],l);g+=S(d,f,c,e)}else if(null===a||"object"!=typeof a?f=null:f="function"==typeof(f=A&&a[A]||a["@@iterator"])?f:null,"function"==typeof f)for(a=f.call(a),l=0;!(d=a.next()).done;)g+=S(d=d.value,f=b+T(d,l++),c,e);else if("object"===d)throw c=""+a,Error(B(31,"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c,""));return g}(a,"",b,c)}function T(a,b){return"object"==typeof a&&null!==a&&null!=a.key?function escape(a){var b={"=":"=0",":":"=2"};return"$"+(""+a).replace(/[=:]/g,(function(a){return b[a]}))}(a.key):b.toString(36)}function ca(a,b){a.func.call(a.context,b,a.count++)}function da(a,b,c){var e=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++),Array.isArray(a)?V(a,e,c,(function(a){return a})):null!=a&&(N(a)&&(a=function ba(a,b){return{$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}(a,d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+c)),e.push(a))}function V(a,b,c,e,d){var g="";null!=c&&(g=(""+c).replace(O,"$&/")+"/"),U(a,da,b=Q(b,g,e,d)),R(b)}function W(){var a=I.current;if(null===a)throw Error(B(321));return a}var X={Children:{map:function(a,b,c){if(null==a)return a;var e=[];return V(a,e,null,b,c),e},forEach:function(a,b,c){if(null==a)return a;U(a,ca,b=Q(null,null,b,c)),R(b)},count:function(a){return U(a,(function(){return null}),null)},toArray:function(a){var b=[];return V(a,b,null,(function(a){return a})),b},only:function(a){if(!N(a))throw Error(B(143));return a}},createRef:function(){return{current:null}},Component:E,PureComponent:G,createContext:function(a,b){return void 0===b&&(b=null),(a={$$typeof:w,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:v,_context:a},a.Consumer=a},forwardRef:function(a){return{$$typeof:x,render:a}},lazy:function(a){return{$$typeof:aa,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:z,type:a,compare:void 0===b?null:b}},useCallback:function(a,b){return W().useCallback(a,b)},useContext:function(a,b){return W().useContext(a,b)},useEffect:function(a,b){return W().useEffect(a,b)},useImperativeHandle:function(a,b,c){return W().useImperativeHandle(a,b,c)},useDebugValue:function(){},useLayoutEffect:function(a,b){return W().useLayoutEffect(a,b)},useMemo:function(a,b){return W().useMemo(a,b)},useReducer:function(a,b,c){return W().useReducer(a,b,c)},useRef:function(a){return W().useRef(a)},useState:function(a){return W().useState(a)},Fragment:r,Profiler:u,StrictMode:t,Suspense:y,createElement:M,cloneElement:function(a,b,c){if(null==a)throw Error(B(267,a));var e=h({},a.props),d=a.key,g=a.ref,l=a._owner;if(null!=b){if(void 0!==b.ref&&(g=b.ref,l=J.current),void 0!==b.key&&(d=""+b.key),a.type&&a.type.defaultProps)var f=a.type.defaultProps;for(k in b)K.call(b,k)&&!L.hasOwnProperty(k)&&(e[k]=void 0===b[k]&&void 0!==f?f[k]:b[k])}var k=arguments.length-2;if(1===k)e.children=c;else if(1<k){f=Array(k);for(var m=0;m<k;m++)f[m]=arguments[m+2];e.children=f}return{$$typeof:p,type:a.type,key:d,ref:g,props:e,_owner:l}},createFactory:function(a){var b=M.bind(null,a);return b.type=a,b},isValidElement:N,version:"16.12.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:J,IsSomeRendererActing:{current:!1},assign:h}},Y={default:X},Z=Y&&X||Y;module.exports=Z.default||Z},function(module,exports,__webpack_require__){"use strict";var aa=__webpack_require__(0),n=__webpack_require__(269),q=__webpack_require__(620);function u(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!aa)throw Error(u(227));var ba=null,ca={};function da(){if(ba)for(var a in ca){var b=ca[a],c=ba.indexOf(a);if(!(-1<c))throw Error(u(96,a));if(!ea[c]){if(!b.extractEvents)throw Error(u(97,a));for(var d in ea[c]=b,c=b.eventTypes){var e=void 0,f=c[d],g=b,h=d;if(fa.hasOwnProperty(h))throw Error(u(99,h));fa[h]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&ha(k[e],g,h);e=!0}else f.registrationName?(ha(f.registrationName,g,h),e=!0):e=!1;if(!e)throw Error(u(98,d,a))}}}}function ha(a,b,c){if(ia[a])throw Error(u(100,a));ia[a]=b,ja[a]=b.eventTypes[c].dependencies}var ea=[],fa={},ia={},ja={};function ka(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(m){this.onError(m)}}var la=!1,ma=null,na=!1,oa=null,pa={onError:function(a){la=!0,ma=a}};function qa(a,b,c,d,e,f,g,h,k){la=!1,ma=null,ka.apply(pa,arguments)}var sa=null,ua=null,va=null;function wa(a,b,c){var d=a.type||"unknown-event";a.currentTarget=va(c),function ra(a,b,c,d,e,f,g,h,k){if(qa.apply(this,arguments),la){if(!la)throw Error(u(198));var l=ma;la=!1,ma=null,na||(na=!0,oa=l)}}(d,b,void 0,a),a.currentTarget=null}function xa(a,b){if(null==b)throw Error(u(30));return null==a?b:Array.isArray(a)?Array.isArray(b)?(a.push.apply(a,b),a):(a.push(b),a):Array.isArray(b)?[a].concat(b):[a,b]}function ya(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var za=null;function Aa(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;d<b.length&&!a.isPropagationStopped();d++)wa(a,b[d],c[d]);else b&&wa(a,b,c);a._dispatchListeners=null,a._dispatchInstances=null,a.isPersistent()||a.constructor.release(a)}}function Ba(a){if(null!==a&&(za=xa(za,a)),a=za,za=null,a){if(ya(a,Aa),za)throw Error(u(95));if(na)throw a=oa,na=!1,oa=null,a}}var Ca={injectEventPluginOrder:function(a){if(ba)throw Error(u(101));ba=Array.prototype.slice.call(a),da()},injectEventPluginsByName:function(a){var c,b=!1;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!ca.hasOwnProperty(c)||ca[c]!==d){if(ca[c])throw Error(u(102,c));ca[c]=d,b=!0}}b&&da()}};function Da(a,b){var c=a.stateNode;if(!c)return null;var d=sa(c);if(!d)return null;c=d[b];a:switch(b){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(d=!d.disabled)||(d=!("button"===(a=a.type)||"input"===a||"select"===a||"textarea"===a)),a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!=typeof c)throw Error(u(231,b,typeof c));return c}var Ea=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Ea.hasOwnProperty("ReactCurrentDispatcher")||(Ea.ReactCurrentDispatcher={current:null}),Ea.hasOwnProperty("ReactCurrentBatchConfig")||(Ea.ReactCurrentBatchConfig={suspense:null});var Fa=/^(.*)[\\\/]/,w="function"==typeof Symbol&&Symbol.for,Ga=w?Symbol.for("react.element"):60103,Ha=w?Symbol.for("react.portal"):60106,Ia=w?Symbol.for("react.fragment"):60107,Ja=w?Symbol.for("react.strict_mode"):60108,Ka=w?Symbol.for("react.profiler"):60114,La=w?Symbol.for("react.provider"):60109,Ma=w?Symbol.for("react.context"):60110,Na=w?Symbol.for("react.concurrent_mode"):60111,Oa=w?Symbol.for("react.forward_ref"):60112,Pa=w?Symbol.for("react.suspense"):60113,Qa=w?Symbol.for("react.suspense_list"):60120,Ra=w?Symbol.for("react.memo"):60115,Sa=w?Symbol.for("react.lazy"):60116;w&&Symbol.for("react.fundamental"),w&&Symbol.for("react.responder"),w&&Symbol.for("react.scope");var Ta="function"==typeof Symbol&&Symbol.iterator;function Ua(a){return null===a||"object"!=typeof a?null:"function"==typeof(a=Ta&&a[Ta]||a["@@iterator"])?a:null}function Wa(a){if(null==a)return null;if("function"==typeof a)return a.displayName||a.name||null;if("string"==typeof a)return a;switch(a){case Ia:return"Fragment";case Ha:return"Portal";case Ka:return"Profiler";case Ja:return"StrictMode";case Pa:return"Suspense";case Qa:return"SuspenseList"}if("object"==typeof a)switch(a.$$typeof){case Ma:return"Context.Consumer";case La:return"Context.Provider";case Oa:var b=a.render;return b=b.displayName||b.name||"",a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case Ra:return Wa(a.type);case Sa:if(a=1===a._status?a._result:null)return Wa(a)}return null}function Xa(a){var b="";do{a:switch(a.tag){case 3:case 4:case 6:case 7:case 10:case 9:var c="";break a;default:var d=a._debugOwner,e=a._debugSource,f=Wa(a.type);c=null,d&&(c=Wa(d.type)),d=f,f="",e?f=" (at "+e.fileName.replace(Fa,"")+":"+e.lineNumber+")":c&&(f=" (created by "+c+")"),c="\n in "+(d||"Unknown")+f}b+=c,a=a.return}while(a);return b}var Ya=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Za=null,$a=null,ab=null;function bb(a){if(a=ua(a)){if("function"!=typeof Za)throw Error(u(280));var b=sa(a.stateNode);Za(a.stateNode,a.type,b)}}function cb(a){$a?ab?ab.push(a):ab=[a]:$a=a}function db(){if($a){var a=$a,b=ab;if(ab=$a=null,bb(a),b)for(a=0;a<b.length;a++)bb(b[a])}}function eb(a,b){return a(b)}function fb(a,b,c,d){return a(b,c,d)}function gb(){}var hb=eb,ib=!1,jb=!1;function kb(){null===$a&&null===ab||(gb(),db())}new Map;var lb=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,mb=Object.prototype.hasOwnProperty,nb={},ob={};function B(a,b,c,d,e,f){this.acceptsBooleans=2===b||3===b||4===b,this.attributeName=d,this.attributeNamespace=e,this.mustUseProperty=c,this.propertyName=a,this.type=b,this.sanitizeURL=f}var D={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(a){D[a]=new B(a,0,!1,a,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(a){D[a]=new B(a,2,!1,a,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(a){D[a]=new B(a,3,!0,a,null,!1)})),["capture","download"].forEach((function(a){D[a]=new B(a,4,!1,a,null,!1)})),["cols","rows","size","span"].forEach((function(a){D[a]=new B(a,6,!1,a,null,!1)})),["rowSpan","start"].forEach((function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1)}));var sb=/[\-:]([a-z])/g;function tb(a){return a[1].toUpperCase()}function ub(a){switch(typeof a){case"boolean":case"number":case"object":case"string":case"undefined":return a;default:return""}}function vb(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;(null!==e?0===e.type:!d&&(2<b.length&&("o"===b[0]||"O"===b[0])&&("n"===b[1]||"N"===b[1])))||(function rb(a,b,c,d){if(null==b||function qb(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case"function":case"symbol":return!0;case"boolean":return!d&&(null!==c?!c.acceptsBooleans:"data-"!==(a=a.toLowerCase().slice(0,5))&&"aria-"!==a);default:return!1}}(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}(b,c,e,d)&&(c=null),d||null===e?function pb(a){return!!mb.call(ob,a)||!mb.call(nb,a)&&(lb.test(a)?ob[a]=!0:(nb[a]=!0,!1))}(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3!==e.type&&"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(c=3===(e=e.type)||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}function wb(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}function yb(a){a._valueTracker||(a._valueTracker=function xb(a){var b=wb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&void 0!==c&&"function"==typeof c.get&&"function"==typeof c.set){var e=c.get,f=c.set;return Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a,f.call(this,a)}}),Object.defineProperty(a,b,{enumerable:c.enumerable}),{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=null,delete a[b]}}}}(a))}function zb(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue(),d="";return a&&(d=wb(a)?a.checked?"true":"false":a.value),(a=d)!==c&&(b.setValue(a),!0)}function Ab(a,b){var c=b.checked;return n({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Bb(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=ub(null!=b.value?b.value:c),a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function Cb(a,b){null!=(b=b.checked)&&vb(a,"checked",b,!1)}function Eb(a,b){Cb(a,b);var c=ub(b.value),d=b.type;if(null!=c)"number"===d?(0===c&&""===a.value||a.value!=c)&&(a.value=""+c):a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d)return void a.removeAttribute("value");b.hasOwnProperty("value")?Fb(a,b.type,c):b.hasOwnProperty("defaultValue")&&Fb(a,b.type,ub(b.defaultValue)),null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}function Gb(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue,c||b===a.value||(a.value=b),a.defaultValue=b}""!==(c=a.name)&&(a.name=""),a.defaultChecked=!a.defaultChecked,a.defaultChecked=!!a._wrapperState.initialChecked,""!==c&&(a.name=c)}function Fb(a,b,c){"number"===b&&a.ownerDocument.activeElement===a||(null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c))}function Ib(a,b){return a=n({children:void 0},b),(b=function Hb(a){var b="";return aa.Children.forEach(a,(function(a){null!=a&&(b+=a)})),b}(b.children))&&(a.children=b),a}function Jb(a,b,c,d){if(a=a.options,b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{for(c=""+ub(c),b=null,e=0;e<a.length;e++){if(a[e].value===c)return a[e].selected=!0,void(d&&(a[e].defaultSelected=!0));null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}function Kb(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(u(91));return n({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Lb(a,b){var c=b.value;if(null==c){if(c=b.defaultValue,null!=(b=b.children)){if(null!=c)throw Error(u(92));if(Array.isArray(b)){if(!(1>=b.length))throw Error(u(93));b=b[0]}c=b}null==c&&(c="")}a._wrapperState={initialValue:ub(c)}}function Mb(a,b){var c=ub(b.value),d=ub(b.defaultValue);null!=c&&((c=""+c)!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c)),null!=d&&(a.defaultValue=""+d)}function Nb(a){var b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b)}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(a){var b=a.replace(sb,tb);D[b]=new B(b,1,!1,a,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(a){var b=a.replace(sb,tb);D[b]=new B(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(a){var b=a.replace(sb,tb);D[b]=new B(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1)})),D.xlinkHref=new B("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0)}));var Ob_html="http://www.w3.org/1999/xhtml",Ob_svg="http://www.w3.org/2000/svg";function Pb(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qb(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Pb(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}var Rb,Sb=function(a){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction((function(){return a(b,c)}))}:a}((function(a,b){if(a.namespaceURI!==Ob_svg||"innerHTML"in a)a.innerHTML=b;else{for((Rb=Rb||document.createElement("div")).innerHTML="<svg>"+b.valueOf().toString()+"</svg>",b=Rb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}));function Tb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType)return void(c.nodeValue=b)}a.textContent=b}function Ub(a,b){var c={};return c[a.toLowerCase()]=b.toLowerCase(),c["Webkit"+a]="webkit"+b,c["Moz"+a]="moz"+b,c}var Vb={animationend:Ub("Animation","AnimationEnd"),animationiteration:Ub("Animation","AnimationIteration"),animationstart:Ub("Animation","AnimationStart"),transitionend:Ub("Transition","TransitionEnd")},Wb={},Xb={};function Yb(a){if(Wb[a])return Wb[a];if(!Vb[a])return a;var c,b=Vb[a];for(c in b)if(b.hasOwnProperty(c)&&c in Xb)return Wb[a]=b[c];return a}Ya&&(Xb=document.createElement("div").style,"AnimationEvent"in window||(delete Vb.animationend.animation,delete Vb.animationiteration.animation,delete Vb.animationstart.animation),"TransitionEvent"in window||delete Vb.transitionend.transition);var Zb=Yb("animationend"),$b=Yb("animationiteration"),ac=Yb("animationstart"),bc=Yb("transitionend"),cc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" ");function ec(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do{0!=(1026&(b=a).effectTag)&&(c=b.return),a=b.return}while(a)}return 3===b.tag?c:null}function fc(a){if(13===a.tag){var b=a.memoizedState;if(null===b&&(null!==(a=a.alternate)&&(b=a.memoizedState)),null!==b)return b.dehydrated}return null}function gc(a){if(ec(a)!==a)throw Error(u(188))}function ic(a){if(!(a=function hc(a){var b=a.alternate;if(!b){if(null===(b=ec(a)))throw Error(u(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){if(null!==(d=e.return)){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return gc(e),a;if(f===d)return gc(e),b;f=f.sibling}throw Error(u(188))}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0,c=e,d=f;break}if(h===d){g=!0,d=e,c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===c){g=!0,c=f,d=e;break}if(h===d){g=!0,d=f,c=e;break}h=h.sibling}if(!g)throw Error(u(189))}}if(c.alternate!==d)throw Error(u(190))}if(3!==c.tag)throw Error(u(188));return c.stateNode.current===c?a:b}(a)))return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return,b=b.sibling}}return null}var jc,kc,lc,mc=!1,nc=[],oc=null,pc=null,qc=null,rc=new Map,sc=new Map,tc=[],uc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),vc="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function zc(a,b,c,d){return{blockedOn:a,topLevelType:b,eventSystemFlags:32|c,nativeEvent:d}}function Ac(a,b){switch(a){case"focus":case"blur":oc=null;break;case"dragenter":case"dragleave":pc=null;break;case"mouseover":case"mouseout":qc=null;break;case"pointerover":case"pointerout":rc.delete(b.pointerId);break;case"gotpointercapture":case"lostpointercapture":sc.delete(b.pointerId)}}function Bc(a,b,c,d,e){return null===a||a.nativeEvent!==e?(a=zc(b,c,d,e),null!==b&&(null!==(b=Cc(b))&&kc(b)),a):(a.eventSystemFlags|=d,a)}function Ec(a){var b=Fc(a.target);if(null!==b){var c=ec(b);if(null!==c)if(13===(b=c.tag)){if(null!==(b=fc(c)))return a.blockedOn=b,void q.unstable_runWithPriority(a.priority,(function(){lc(c)}))}else if(3===b&&c.stateNode.hydrate)return void(a.blockedOn=3===c.tag?c.stateNode.containerInfo:null)}a.blockedOn=null}function Gc(a){if(null!==a.blockedOn)return!1;var b=Hc(a.topLevelType,a.eventSystemFlags,a.nativeEvent);if(null!==b){var c=Cc(b);return null!==c&&kc(c),a.blockedOn=b,!1}return!0}function Ic(a,b,c){Gc(a)&&c.delete(b)}function Jc(){for(mc=!1;0<nc.length;){var a=nc[0];if(null!==a.blockedOn){null!==(a=Cc(a.blockedOn))&&jc(a);break}var b=Hc(a.topLevelType,a.eventSystemFlags,a.nativeEvent);null!==b?a.blockedOn=b:nc.shift()}null!==oc&&Gc(oc)&&(oc=null),null!==pc&&Gc(pc)&&(pc=null),null!==qc&&Gc(qc)&&(qc=null),rc.forEach(Ic),sc.forEach(Ic)}function Kc(a,b){a.blockedOn===b&&(a.blockedOn=null,mc||(mc=!0,q.unstable_scheduleCallback(q.unstable_NormalPriority,Jc)))}function Lc(a){function b(b){return Kc(b,a)}if(0<nc.length){Kc(nc[0],a);for(var c=1;c<nc.length;c++){var d=nc[c];d.blockedOn===a&&(d.blockedOn=null)}}for(null!==oc&&Kc(oc,a),null!==pc&&Kc(pc,a),null!==qc&&Kc(qc,a),rc.forEach(b),sc.forEach(b),c=0;c<tc.length;c++)(d=tc[c]).blockedOn===a&&(d.blockedOn=null);for(;0<tc.length&&null===(c=tc[0]).blockedOn;)Ec(c),null===c.blockedOn&&tc.shift()}function Mc(a){return(a=a.target||a.srcElement||window).correspondingUseElement&&(a=a.correspondingUseElement),3===a.nodeType?a.parentNode:a}function Nc(a){do{a=a.return}while(a&&5!==a.tag);return a||null}function Oc(a,b,c){(b=Da(a,c.dispatchConfig.phasedRegistrationNames[b]))&&(c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a))}function Pc(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Nc(b);for(b=c.length;0<b--;)Oc(c[b],"captured",a);for(b=0;b<c.length;b++)Oc(c[b],"bubbled",a)}}function Qc(a,b,c){a&&c&&c.dispatchConfig.registrationName&&(b=Da(a,c.dispatchConfig.registrationName))&&(c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a))}function Rc(a){a&&a.dispatchConfig.registrationName&&Qc(a._targetInst,null,a)}function Sc(a){ya(a,Pc)}function Tc(){return!0}function Uc(){return!1}function E(a,b,c,d){for(var e in this.dispatchConfig=a,this._targetInst=b,this.nativeEvent=c,a=this.constructor.Interface)a.hasOwnProperty(e)&&((b=a[e])?this[e]=b(c):"target"===e?this.target=d:this[e]=c[e]);return this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?Tc:Uc,this.isPropagationStopped=Uc,this}function Wc(a,b,c,d){if(this.eventPool.length){var e=this.eventPool.pop();return this.call(e,a,b,c,d),e}return new this(a,b,c,d)}function Xc(a){if(!(a instanceof this))throw Error(u(279));a.destructor(),10>this.eventPool.length&&this.eventPool.push(a)}function Vc(a){a.eventPool=[],a.getPooled=Wc,a.release=Xc}n(E.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!=typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=Tc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!=typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=Tc)},persist:function(){this.isPersistent=Tc},isPersistent:Uc,destructor:function(){var b,a=this.constructor.Interface;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Uc,this._dispatchInstances=this._dispatchListeners=null}}),E.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},E.extend=function(a){function b(){}function c(){return d.apply(this,arguments)}var d=this;b.prototype=d.prototype;var e=new b;return n(e,c.prototype),c.prototype=e,c.prototype.constructor=c,c.Interface=n({},d.Interface,a),c.extend=d.extend,Vc(c),c},Vc(E);var Yc=E.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Zc=E.extend({clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),$c=E.extend({view:null,detail:null}),ad=$c.extend({relatedTarget:null});function bd(a){var b=a.keyCode;return"charCode"in a?0===(a=a.charCode)&&13===b&&(a=13):a=b,10===a&&(a=13),32<=a||13===a?a:0}var cd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dd={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"},ed={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):!!(a=ed[a])&&!!b[a]}function hd(){return gd}for(var id=$c.extend({key:function(a){if(a.key){var b=cd[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?13===(a=bd(a))?"Enter":String.fromCharCode(a):"keydown"===a.type||"keyup"===a.type?dd[a.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:hd,charCode:function(a){return"keypress"===a.type?bd(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?bd(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),jd=0,kd=0,ld=!1,md=!1,nd=$c.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:hd,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)},movementX:function(a){if("movementX"in a)return a.movementX;var b=jd;return jd=a.screenX,ld?"mousemove"===a.type?a.screenX-b:0:(ld=!0,0)},movementY:function(a){if("movementY"in a)return a.movementY;var b=kd;return kd=a.screenY,md?"mousemove"===a.type?a.screenY-b:0:(md=!0,0)}}),od=nd.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),pd=nd.extend({dataTransfer:null}),qd=$c.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:hd}),rd=E.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),sd=nd.extend({deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null}),td=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",2],[Zb,"animationEnd",2],[$b,"animationIteration",2],[ac,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress","progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[bc,"transitionEnd",2],["waiting","waiting",2]],ud={},vd={},wd=0;wd<td.length;wd++){var yd=td[wd],zd=yd[0],Ad=yd[1],Bd=yd[2],Cd="on"+(Ad[0].toUpperCase()+Ad.slice(1)),Dd={phasedRegistrationNames:{bubbled:Cd,captured:Cd+"Capture"},dependencies:[zd],eventPriority:Bd};ud[Ad]=Dd,vd[zd]=Dd}var Ed={eventTypes:ud,getEventPriority:function(a){return void 0!==(a=vd[a])?a.eventPriority:2},extractEvents:function(a,b,c,d){var e=vd[a];if(!e)return null;switch(a){case"keypress":if(0===bd(c))return null;case"keydown":case"keyup":a=id;break;case"blur":case"focus":a=ad;break;case"click":if(2===c.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":a=nd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":a=pd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":a=qd;break;case Zb:case $b:case ac:a=Yc;break;case bc:a=rd;break;case"scroll":a=$c;break;case"wheel":a=sd;break;case"copy":case"cut":case"paste":a=Zc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":a=od;break;default:a=E}return Sc(b=a.getPooled(e,b,c,d)),b}},Fd=q.unstable_UserBlockingPriority,Gd=q.unstable_runWithPriority,Hd=Ed.getEventPriority,Jd=[];function Kd(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d=c;if(3===d.tag)d=d.stateNode.containerInfo;else{for(;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo}if(!d)break;5!==(b=c.tag)&&6!==b||a.ancestors.push(c),c=Fc(d)}while(c);for(c=0;c<a.ancestors.length;c++){b=a.ancestors[c];var e=Mc(a.nativeEvent);d=a.topLevelType;for(var f=a.nativeEvent,g=a.eventSystemFlags,h=null,k=0;k<ea.length;k++){var l=ea[k];l&&(l=l.extractEvents(d,b,f,e,g))&&(h=xa(h,l))}Ba(h)}}var Ld=!0;function F(a,b){Md(b,a,!1)}function Md(a,b,c){switch(Hd(b)){case 0:var d=Nd.bind(null,b,1);break;case 1:d=Od.bind(null,b,1);break;default:d=Pd.bind(null,b,1)}c?a.addEventListener(b,d,!0):a.addEventListener(b,d,!1)}function Nd(a,b,c){ib||gb();var d=Pd,e=ib;ib=!0;try{fb(d,a,b,c)}finally{(ib=e)||kb()}}function Od(a,b,c){Gd(Fd,Pd.bind(null,a,b,c))}function Qd(a,b,c,d){if(Jd.length){var e=Jd.pop();e.topLevelType=a,e.eventSystemFlags=b,e.nativeEvent=c,e.targetInst=d,a=e}else a={topLevelType:a,eventSystemFlags:b,nativeEvent:c,targetInst:d,ancestors:[]};try{if(b=Kd,c=a,jb)b(c,void 0);else{jb=!0;try{hb(b,c,void 0)}finally{jb=!1,kb()}}}finally{a.topLevelType=null,a.nativeEvent=null,a.targetInst=null,a.ancestors.length=0,Jd.length<10&&Jd.push(a)}}function Pd(a,b,c){if(Ld)if(0<nc.length&&-1<uc.indexOf(a))a=zc(null,a,b,c),nc.push(a);else{var d=Hc(a,b,c);null===d?Ac(a,c):-1<uc.indexOf(a)?(a=zc(d,a,b,c),nc.push(a)):function Dc(a,b,c,d){switch(b){case"focus":return oc=Bc(oc,a,b,c,d),!0;case"dragenter":return pc=Bc(pc,a,b,c,d),!0;case"mouseover":return qc=Bc(qc,a,b,c,d),!0;case"pointerover":var e=d.pointerId;return rc.set(e,Bc(rc.get(e)||null,a,b,c,d)),!0;case"gotpointercapture":return e=d.pointerId,sc.set(e,Bc(sc.get(e)||null,a,b,c,d)),!0}return!1}(d,a,b,c)||(Ac(a,c),Qd(a,b,c,null))}}function Hc(a,b,c){var d=Mc(c);if(null!==(d=Fc(d))){var e=ec(d);if(null===e)d=null;else{var f=e.tag;if(13===f){if(null!==(d=fc(e)))return d;d=null}else if(3===f){if(e.stateNode.hydrate)return 3===e.tag?e.stateNode.containerInfo:null;d=null}else e!==d&&(d=null)}}return Qd(a,b,c,d),null}function Rd(a){if(!Ya)return!1;var b=(a="on"+a)in document;return b||((b=document.createElement("div")).setAttribute(a,"return;"),b="function"==typeof b[a]),b}var Sd=new("function"==typeof WeakMap?WeakMap:Map);function xc(a){var b=Sd.get(a);return void 0===b&&(b=new Set,Sd.set(a,b)),b}function yc(a,b,c){if(!c.has(a)){switch(a){case"scroll":Md(b,"scroll",!0);break;case"focus":case"blur":Md(b,"focus",!0),Md(b,"blur",!0),c.add("blur"),c.add("focus");break;case"cancel":case"close":Rd(a)&&Md(b,a,!0);break;case"invalid":case"submit":case"reset":break;default:-1===cc.indexOf(a)&&F(a,b)}c.add(a)}}var Td={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ud=["Webkit","ms","Moz","O"];function Vd(a,b,c){return null==b||"boolean"==typeof b||""===b?"":c||"number"!=typeof b||0===b||Td.hasOwnProperty(a)&&Td[a]?(""+b).trim():b+"px"}function Wd(a,b){for(var c in a=a.style,b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=Vd(c,b[c],d);"float"===c&&(c="cssFloat"),d?a.setProperty(c,e):a[c]=e}}Object.keys(Td).forEach((function(a){Ud.forEach((function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1),Td[b]=Td[a]}))}));var Xd=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yd(a,b){if(b){if(Xd[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(u(137,a,""));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(u(60));if(!("object"==typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML))throw Error(u(61))}if(null!=b.style&&"object"!=typeof b.style)throw Error(u(62,""))}}function Zd(a,b){if(-1===a.indexOf("-"))return"string"==typeof b.is;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function $d(a,b){var c=xc(a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument);b=ja[b];for(var d=0;d<b.length;d++)yc(b[d],a,c)}function ae(){}function be(a){if(void 0===(a=a||("undefined"!=typeof document?document:void 0)))return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ce(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function de(a,b){var d,c=ce(a);for(a=0;c;){if(3===c.nodeType){if(d=a+c.textContent.length,a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=ce(c)}}function fe(){for(var a=window,b=be();b instanceof a.HTMLIFrameElement;){try{var c="string"==typeof b.contentWindow.location.href}catch(d){c=!1}if(!c)break;b=be((a=b.contentWindow).document)}return b}function ge(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}var le=null,me=null;function ne(a,b){switch(a){case"button":case"input":case"select":case"textarea":return!!b.autoFocus}return!1}function oe(a,b){return"textarea"===a||"option"===a||"noscript"===a||"string"==typeof b.children||"number"==typeof b.children||"object"==typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var pe="function"==typeof setTimeout?setTimeout:void 0,qe="function"==typeof clearTimeout?clearTimeout:void 0;function re(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}function se(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if("$"===c||"$!"===c||"$?"===c){if(0===b)return a;b--}else"/$"===c&&b++}a=a.previousSibling}return null}var te=Math.random().toString(36).slice(2),ue="__reactInternalInstance$"+te,ve="__reactEventHandlers$"+te,we="__reactContainere$"+te;function Fc(a){var b=a[ue];if(b)return b;for(var c=a.parentNode;c;){if(b=c[we]||c[ue]){if(c=b.alternate,null!==b.child||null!==c&&null!==c.child)for(a=se(a);null!==a;){if(c=a[ue])return c;a=se(a)}return b}c=(a=c).parentNode}return null}function Cc(a){return!(a=a[ue]||a[we])||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function xe(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(u(33))}function ye(a){return a[ve]||null}var ze=null,Ae=null,Be=null;function Ce(){if(Be)return Be;var a,d,b=Ae,c=b.length,e="value"in ze?ze.value:ze.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return Be=e.slice(a,1<d?1-d:void 0)}var De=E.extend({data:null}),Ee=E.extend({data:null}),Fe=[9,13,27,32],Ge=Ya&&"CompositionEvent"in window,He=null;Ya&&"documentMode"in document&&(He=document.documentMode);var Ie=Ya&&"TextEvent"in window&&!He,Je=Ya&&(!Ge||He&&8<He&&11>=He),Ke=String.fromCharCode(32),Le={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Me=!1;function Ne(a,b){switch(a){case"keyup":return-1!==Fe.indexOf(b.keyCode);case"keydown":return 229!==b.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Oe(a){return"object"==typeof(a=a.detail)&&"data"in a?a.data:null}var Pe=!1;var Se={eventTypes:Le,extractEvents:function(a,b,c,d){var e;if(Ge)b:{switch(a){case"compositionstart":var f=Le.compositionStart;break b;case"compositionend":f=Le.compositionEnd;break b;case"compositionupdate":f=Le.compositionUpdate;break b}f=void 0}else Pe?Ne(a,c)&&(f=Le.compositionEnd):"keydown"===a&&229===c.keyCode&&(f=Le.compositionStart);return f?(Je&&"ko"!==c.locale&&(Pe||f!==Le.compositionStart?f===Le.compositionEnd&&Pe&&(e=Ce()):(Ae="value"in(ze=d)?ze.value:ze.textContent,Pe=!0)),f=De.getPooled(f,b,c,d),e?f.data=e:null!==(e=Oe(c))&&(f.data=e),Sc(f),e=f):e=null,(a=Ie?function Qe(a,b){switch(a){case"compositionend":return Oe(b);case"keypress":return 32!==b.which?null:(Me=!0,Ke);case"textInput":return(a=b.data)===Ke&&Me?null:a;default:return null}}(a,c):function Re(a,b){if(Pe)return"compositionend"===a||!Ge&&Ne(a,b)?(a=Ce(),Be=Ae=ze=null,Pe=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case"compositionend":return Je&&"ko"!==b.locale?null:b.data;default:return null}}(a,c))?((b=Ee.getPooled(Le.beforeInput,b,c,d)).data=a,Sc(b)):b=null,null===e?b:null===b?e:[e,b]}},Te={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ue(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!Te[a.type]:"textarea"===b}var Ve={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function We(a,b,c){return(a=E.getPooled(Ve.change,a,b,c)).type="change",cb(c),Sc(a),a}var Xe=null,Ye=null;function Ze(a){Ba(a)}function $e(a){if(zb(xe(a)))return a}function af(a,b){if("change"===a)return b}var bf=!1;function cf(){Xe&&(Xe.detachEvent("onpropertychange",df),Ye=Xe=null)}function df(a){if("value"===a.propertyName&&$e(Ye))if(a=We(Ye,a,Mc(a)),ib)Ba(a);else{ib=!0;try{eb(Ze,a)}finally{ib=!1,kb()}}}function ef(a,b,c){"focus"===a?(cf(),Ye=c,(Xe=b).attachEvent("onpropertychange",df)):"blur"===a&&cf()}function ff(a){if("selectionchange"===a||"keyup"===a||"keydown"===a)return $e(Ye)}function gf(a,b){if("click"===a)return $e(b)}function hf(a,b){if("input"===a||"change"===a)return $e(b)}Ya&&(bf=Rd("input")&&(!document.documentMode||9<document.documentMode));var lf,jf={eventTypes:Ve,_isInputEventSupported:bf,extractEvents:function(a,b,c,d){var e=b?xe(b):window,f=e.nodeName&&e.nodeName.toLowerCase();if("select"===f||"input"===f&&"file"===e.type)var g=af;else if(Ue(e))if(bf)g=hf;else{g=ff;var h=ef}else(f=e.nodeName)&&"input"===f.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)&&(g=gf);if(g&&(g=g(a,b)))return We(g,c,d);h&&h(a,e,b),"blur"===a&&(a=e._wrapperState)&&a.controlled&&"number"===e.type&&Fb(e,"number",e.value)}},kf={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},mf={eventTypes:kf,extractEvents:function(a,b,c,d,e){var f="mouseover"===a||"pointerover"===a,g="mouseout"===a||"pointerout"===a;if(f&&0==(32&e)&&(c.relatedTarget||c.fromElement)||!g&&!f)return null;if(e=d.window===d?d:(e=d.ownerDocument)?e.defaultView||e.parentWindow:window,g?(g=b,null!==(b=(b=c.relatedTarget||c.toElement)?Fc(b):null)&&(b!==(f=ec(b))||5!==b.tag&&6!==b.tag)&&(b=null)):g=null,g===b)return null;if("mouseout"===a||"mouseover"===a)var h=nd,k=kf.mouseLeave,l=kf.mouseEnter,m="mouse";else"pointerout"!==a&&"pointerover"!==a||(h=od,k=kf.pointerLeave,l=kf.pointerEnter,m="pointer");if(a=null==g?e:xe(g),e=null==b?e:xe(b),(k=h.getPooled(k,g,c,d)).type=m+"leave",k.target=a,k.relatedTarget=e,(d=h.getPooled(l,b,c,d)).type=m+"enter",d.target=e,d.relatedTarget=a,m=b,(h=g)&&m)a:{for(a=m,g=0,b=l=h;b;b=Nc(b))g++;for(b=0,e=a;e;e=Nc(e))b++;for(;0<g-b;)l=Nc(l),g--;for(;0<b-g;)a=Nc(a),b--;for(;g--;){if(l===a||l===a.alternate)break a;l=Nc(l),a=Nc(a)}l=null}else l=null;for(a=l,l=[];h&&h!==a&&(null===(g=h.alternate)||g!==a);)l.push(h),h=Nc(h);for(h=[];m&&m!==a&&(null===(g=m.alternate)||g!==a);)h.push(m),m=Nc(m);for(m=0;m<l.length;m++)Qc(l[m],"bubbled",k);for(m=h.length;0<m--;)Qc(h[m],"captured",d);return c===lf?(lf=null,[k]):(lf=c,[k,d])}};var of="function"==typeof Object.is?Object.is:function nf(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},pf=Object.prototype.hasOwnProperty;function qf(a,b){if(of(a,b))return!0;if("object"!=typeof a||null===a||"object"!=typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!pf.call(b,c[d])||!of(a[c[d]],b[c[d]]))return!1;return!0}var rf=Ya&&"documentMode"in document&&11>=document.documentMode,sf={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},tf=null,uf=null,vf=null,wf=!1;function xf(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;return wf||null==tf||tf!==be(c)?null:("selectionStart"in(c=tf)&&ge(c)?c={start:c.selectionStart,end:c.selectionEnd}:c={anchorNode:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset},vf&&qf(vf,c)?null:(vf=c,(a=E.getPooled(sf.select,uf,a,b)).type="select",a.target=tf,Sc(a),a))}var yf={eventTypes:sf,extractEvents:function(a,b,c,d){var f,e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument;if(!(f=!e)){a:{e=xc(e),f=ja.onSelect;for(var g=0;g<f.length;g++)if(!e.has(f[g])){e=!1;break a}e=!0}f=!e}if(f)return null;switch(e=b?xe(b):window,a){case"focus":(Ue(e)||"true"===e.contentEditable)&&(tf=e,uf=b,vf=null);break;case"blur":vf=uf=tf=null;break;case"mousedown":wf=!0;break;case"contextmenu":case"mouseup":case"dragend":return wf=!1,xf(c,d);case"selectionchange":if(rf)break;case"keydown":case"keyup":return xf(c,d)}return null}};Ca.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),sa=ye,ua=Cc,va=xe,Ca.injectEventPluginsByName({SimpleEventPlugin:Ed,EnterLeaveEventPlugin:mf,ChangeEventPlugin:jf,SelectEventPlugin:yf,BeforeInputEventPlugin:Se}),new Set;var Af=[],Bf=-1;function G(a){0>Bf||(a.current=Af[Bf],Af[Bf]=null,Bf--)}function I(a,b){Bf++,Af[Bf]=a.current,a.current=b}var Cf={},J={current:Cf},K={current:!1},Df=Cf;function Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var f,e={};for(f in c)e[f]=b[f];return d&&((a=a.stateNode).__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e),e}function L(a){return null!=(a=a.childContextTypes)}function Ff(a){G(K),G(J)}function Gf(a){G(K),G(J)}function Hf(a,b,c){if(J.current!==Cf)throw Error(u(168));I(J,b),I(K,c)}function If(a,b,c){var d=a.stateNode;if(a=b.childContextTypes,"function"!=typeof d.getChildContext)return c;for(var e in d=d.getChildContext())if(!(e in a))throw Error(u(108,Wa(b)||"Unknown",e));return n({},c,{},d)}function Jf(a){var b=a.stateNode;return b=b&&b.__reactInternalMemoizedMergedChildContext||Cf,Df=J.current,I(J,b),I(K,K.current),!0}function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(u(169));c?(b=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=b,G(K),G(J),I(J,b)):G(K),I(K,c)}var Lf=q.unstable_runWithPriority,Mf=q.unstable_scheduleCallback,Nf=q.unstable_cancelCallback,Of=q.unstable_shouldYield,Pf=q.unstable_requestPaint,Qf=q.unstable_now,Rf=q.unstable_getCurrentPriorityLevel,Sf=q.unstable_ImmediatePriority,Tf=q.unstable_UserBlockingPriority,Uf=q.unstable_NormalPriority,Vf=q.unstable_LowPriority,Wf=q.unstable_IdlePriority,Xf={},Yf=void 0!==Pf?Pf:function(){},Zf=null,$f=null,ag=!1,bg=Qf(),cg=1e4>bg?Qf:function(){return Qf()-bg};function dg(){switch(Rf()){case Sf:return 99;case Tf:return 98;case Uf:return 97;case Vf:return 96;case Wf:return 95;default:throw Error(u(332))}}function eg(a){switch(a){case 99:return Sf;case 98:return Tf;case 97:return Uf;case 96:return Vf;case 95:return Wf;default:throw Error(u(332))}}function fg(a,b){return a=eg(a),Lf(a,b)}function gg(a,b,c){return a=eg(a),Mf(a,b,c)}function hg(a){return null===Zf?(Zf=[a],$f=Mf(Sf,ig)):Zf.push(a),Xf}function jg(){if(null!==$f){var a=$f;$f=null,Nf(a)}ig()}function ig(){if(!ag&&null!==Zf){ag=!0;var a=0;try{var b=Zf;fg(99,(function(){for(;a<b.length;a++){var c=b[a];do{c=c(!0)}while(null!==c)}})),Zf=null}catch(c){throw null!==Zf&&(Zf=Zf.slice(a+1)),Mf(Sf,jg),c}finally{ag=!1}}}var kg=3;function lg(a,b,c){return 1073741821-(1+((1073741821-a+b/10)/(c/=10)|0))*c}function mg(a,b){if(a&&a.defaultProps)for(var c in b=n({},b),a=a.defaultProps)void 0===b[c]&&(b[c]=a[c]);return b}var ng={current:null},og=null,pg=null,qg=null;function rg(){qg=pg=og=null}function sg(a,b){var c=a.type._context;I(ng,c._currentValue),c._currentValue=b}function tg(a){var b=ng.current;G(ng),a.type._context._currentValue=b}function ug(a,b){for(;null!==a;){var c=a.alternate;if(a.childExpirationTime<b)a.childExpirationTime=b,null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);else{if(!(null!==c&&c.childExpirationTime<b))break;c.childExpirationTime=b}a=a.return}}function vg(a,b){og=a,qg=pg=null,null!==(a=a.dependencies)&&null!==a.firstContext&&(a.expirationTime>=b&&(wg=!0),a.firstContext=null)}function xg(a,b){if(qg!==a&&!1!==b&&0!==b)if("number"==typeof b&&1073741823!==b||(qg=a,b=1073741823),b={context:a,observedBits:b,next:null},null===pg){if(null===og)throw Error(u(308));pg=b,og.dependencies={expirationTime:0,firstContext:b,responders:null}}else pg=pg.next=b;return a._currentValue}var yg=!1;function zg(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Ag(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Bg(a,b){return{expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Cg(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)}function Dg(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue,e=null;null===d&&(d=a.updateQueue=zg(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=zg(a.memoizedState),e=c.updateQueue=zg(c.memoizedState)):d=a.updateQueue=Ag(e):null===e&&(e=c.updateQueue=Ag(d));null===e||d===e?Cg(d,b):null===d.lastUpdate||null===e.lastUpdate?(Cg(d,b),Cg(e,b)):(Cg(d,b),e.lastUpdate=b)}function Eg(a,b){var c=a.updateQueue;null===(c=null===c?a.updateQueue=zg(a.memoizedState):Fg(a,c)).lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function Fg(a,b){var c=a.alternate;return null!==c&&b===c.updateQueue&&(b=a.updateQueue=Ag(b)),b}function Gg(a,b,c,d,e,f){switch(c.tag){case 1:return"function"==typeof(a=c.payload)?a.call(f,d,e):a;case 3:a.effectTag=-4097&a.effectTag|64;case 0:if(null==(e="function"==typeof(a=c.payload)?a.call(f,d,e):a))break;return n({},d,e);case 2:yg=!0}return d}function Hg(a,b,c,d,e){yg=!1;for(var f=(b=Fg(a,b)).baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;m<e?(null===g&&(g=k,f=l),h<m&&(h=m)):(Ig(m,k.suspenseConfig),l=Gg(a,0,k,l,c,d),null!==k.callback&&(a.effectTag|=32,k.nextEffect=null,null===b.lastEffect?b.firstEffect=b.lastEffect=k:(b.lastEffect.nextEffect=k,b.lastEffect=k))),k=k.next}for(m=null,k=b.firstCapturedUpdate;null!==k;){var C=k.expirationTime;C<e?(null===m&&(m=k,null===g&&(f=l)),h<C&&(h=C)):(l=Gg(a,0,k,l,c,d),null!==k.callback&&(a.effectTag|=32,k.nextEffect=null,null===b.lastCapturedEffect?b.firstCapturedEffect=b.lastCapturedEffect=k:(b.lastCapturedEffect.nextEffect=k,b.lastCapturedEffect=k))),k=k.next}null===g&&(b.lastUpdate=null),null===m?b.lastCapturedUpdate=null:a.effectTag|=32,null===g&&null===m&&(f=l),b.baseState=f,b.firstUpdate=g,b.firstCapturedUpdate=m,Jg(h),a.expirationTime=h,a.memoizedState=l}function Kg(a,b,c){null!==b.firstCapturedUpdate&&(null!==b.lastUpdate&&(b.lastUpdate.next=b.firstCapturedUpdate,b.lastUpdate=b.lastCapturedUpdate),b.firstCapturedUpdate=b.lastCapturedUpdate=null),Lg(b.firstEffect,c),b.firstEffect=b.lastEffect=null,Lg(b.firstCapturedEffect,c),b.firstCapturedEffect=b.lastCapturedEffect=null}function Lg(a,b){for(;null!==a;){var c=a.callback;if(null!==c){a.callback=null;var d=b;if("function"!=typeof c)throw Error(u(191,c));c.call(d)}a=a.nextEffect}}var Mg=Ea.ReactCurrentBatchConfig,Ng=(new aa.Component).refs;function Og(a,b,c,d){c=null==(c=c(d,b=a.memoizedState))?b:n({},b,c),a.memoizedState=c,null!==(d=a.updateQueue)&&0===a.expirationTime&&(d.baseState=c)}var Sg={isMounted:function(a){return!!(a=a._reactInternalFiber)&&ec(a)===a},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=Pg(),e=Mg.suspense;(e=Bg(d=Qg(d,a,e),e)).payload=b,null!=c&&(e.callback=c),Dg(a,e),Rg(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=Pg(),e=Mg.suspense;(e=Bg(d=Qg(d,a,e),e)).tag=1,e.payload=b,null!=c&&(e.callback=c),Dg(a,e),Rg(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=Pg(),d=Mg.suspense;(d=Bg(c=Qg(c,a,d),d)).tag=2,null!=b&&(d.callback=b),Dg(a,d),Rg(a,c)}};function Tg(a,b,c,d,e,f,g){return"function"==typeof(a=a.stateNode).shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):!b.prototype||!b.prototype.isPureReactComponent||(!qf(c,d)||!qf(e,f))}function Ug(a,b,c){var d=!1,e=Cf,f=b.contextType;return"object"==typeof f&&null!==f?f=xg(f):(e=L(b)?Df:J.current,f=(d=null!=(d=b.contextTypes))?Ef(a,e):Cf),b=new b(c,f),a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null,b.updater=Sg,a.stateNode=b,b._reactInternalFiber=a,d&&((a=a.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f),b}function Vg(a,b,c,d){a=b.state,"function"==typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d),"function"==typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d),b.state!==a&&Sg.enqueueReplaceState(b,b.state,null)}function Wg(a,b,c,d){var e=a.stateNode;e.props=c,e.state=a.memoizedState,e.refs=Ng;var f=b.contextType;"object"==typeof f&&null!==f?e.context=xg(f):(f=L(b)?Df:J.current,e.context=Ef(a,f)),null!==(f=a.updateQueue)&&(Hg(a,f,c,e,d),e.state=a.memoizedState),"function"==typeof(f=b.getDerivedStateFromProps)&&(Og(a,b,f,c),e.state=a.memoizedState),"function"==typeof b.getDerivedStateFromProps||"function"==typeof e.getSnapshotBeforeUpdate||"function"!=typeof e.UNSAFE_componentWillMount&&"function"!=typeof e.componentWillMount||(b=e.state,"function"==typeof e.componentWillMount&&e.componentWillMount(),"function"==typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Sg.enqueueReplaceState(e,e.state,null),null!==(f=a.updateQueue)&&(Hg(a,f,c,e,d),e.state=a.memoizedState)),"function"==typeof e.componentDidMount&&(a.effectTag|=4)}var Xg=Array.isArray;function Yg(a,b,c){if(null!==(a=c.ref)&&"function"!=typeof a&&"object"!=typeof a){if(c._owner){if(c=c._owner){if(1!==c.tag)throw Error(u(309));var d=c.stateNode}if(!d)throw Error(u(147,a));var e=""+a;return null!==b&&null!==b.ref&&"function"==typeof b.ref&&b.ref._stringRef===e?b.ref:((b=function(a){var b=d.refs;b===Ng&&(b=d.refs={}),null===a?delete b[e]:b[e]=a})._stringRef=e,b)}if("string"!=typeof a)throw Error(u(284));if(!c._owner)throw Error(u(290,a))}return a}function Zg(a,b){if("textarea"!==a.type)throw Error(u(31,"[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,""))}function $g(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c,c.nextEffect=null,c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){return(a=ah(a,b)).index=0,a.sibling=null,a}function f(b,c,d){return b.index=d,a?null!==(d=b.alternate)?(d=d.index)<c?(b.effectTag=2,c):d:(b.effectTag=2,c):c}function g(b){return a&&null===b.alternate&&(b.effectTag=2),b}function h(a,b,c,d){return null===b||6!==b.tag?((b=bh(c,a.mode,d)).return=a,b):((b=e(b,c)).return=a,b)}function k(a,b,c,d){return null!==b&&b.elementType===c.type?((d=e(b,c.props)).ref=Yg(a,b,c),d.return=a,d):((d=ch(c.type,c.key,c.props,null,a.mode,d)).ref=Yg(a,b,c),d.return=a,d)}function l(a,b,c,d){return null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation?((b=dh(c,a.mode,d)).return=a,b):((b=e(b,c.children||[])).return=a,b)}function m(a,b,c,d,f){return null===b||7!==b.tag?((b=eh(c,a.mode,d,f)).return=a,b):((b=e(b,c)).return=a,b)}function C(a,b,c){if("string"==typeof b||"number"==typeof b)return(b=bh(""+b,a.mode,c)).return=a,b;if("object"==typeof b&&null!==b){switch(b.$$typeof){case Ga:return(c=ch(b.type,b.key,b.props,null,a.mode,c)).ref=Yg(a,null,b),c.return=a,c;case Ha:return(b=dh(b,a.mode,c)).return=a,b}if(Xg(b)||Ua(b))return(b=eh(b,a.mode,c,null)).return=a,b;Zg(a,b)}return null}function y(a,b,c,d){var e=null!==b?b.key:null;if("string"==typeof c||"number"==typeof c)return null!==e?null:h(a,b,""+c,d);if("object"==typeof c&&null!==c){switch(c.$$typeof){case Ga:return c.key===e?c.type===Ia?m(a,b,c.props.children,d,e):k(a,b,c,d):null;case Ha:return c.key===e?l(a,b,c,d):null}if(Xg(c)||Ua(c))return null!==e?null:m(a,b,c,d,null);Zg(a,c)}return null}function H(a,b,c,d,e){if("string"==typeof d||"number"==typeof d)return h(b,a=a.get(c)||null,""+d,e);if("object"==typeof d&&null!==d){switch(d.$$typeof){case Ga:return a=a.get(null===d.key?c:d.key)||null,d.type===Ia?m(b,a,d.props.children,e,d.key):k(b,a,d,e);case Ha:return l(b,a=a.get(null===d.key?c:d.key)||null,d,e)}if(Xg(d)||Ua(d))return m(b,a=a.get(c)||null,d,e,null);Zg(b,d)}return null}function z(e,g,h,k){for(var l=null,m=null,r=g,x=g=0,A=null;null!==r&&x<h.length;x++){r.index>x?(A=r,r=null):A=r.sibling;var p=y(e,r,h[x],k);if(null===p){null===r&&(r=A);break}a&&r&&null===p.alternate&&b(e,r),g=f(p,g,x),null===m?l=p:m.sibling=p,m=p,r=A}if(x===h.length)return c(e,r),l;if(null===r){for(;x<h.length;x++)null!==(r=C(e,h[x],k))&&(g=f(r,g,x),null===m?l=r:m.sibling=r,m=r);return l}for(r=d(e,r);x<h.length;x++)null!==(A=H(r,e,x,h[x],k))&&(a&&null!==A.alternate&&r.delete(null===A.key?x:A.key),g=f(A,g,x),null===m?l=A:m.sibling=A,m=A);return a&&r.forEach((function(a){return b(e,a)})),l}function ta(e,g,h,k){var l=Ua(h);if("function"!=typeof l)throw Error(u(150));if(null==(h=l.call(h)))throw Error(u(151));for(var m=l=null,r=g,x=g=0,A=null,p=h.next();null!==r&&!p.done;x++,p=h.next()){r.index>x?(A=r,r=null):A=r.sibling;var z=y(e,r,p.value,k);if(null===z){null===r&&(r=A);break}a&&r&&null===z.alternate&&b(e,r),g=f(z,g,x),null===m?l=z:m.sibling=z,m=z,r=A}if(p.done)return c(e,r),l;if(null===r){for(;!p.done;x++,p=h.next())null!==(p=C(e,p.value,k))&&(g=f(p,g,x),null===m?l=p:m.sibling=p,m=p);return l}for(r=d(e,r);!p.done;x++,p=h.next())null!==(p=H(r,e,x,p.value,k))&&(a&&null!==p.alternate&&r.delete(null===p.key?x:p.key),g=f(p,g,x),null===m?l=p:m.sibling=p,m=p);return a&&r.forEach((function(a){return b(e,a)})),l}return function(a,d,f,h){var k="object"==typeof f&&null!==f&&f.type===Ia&&null===f.key;k&&(f=f.props.children);var l="object"==typeof f&&null!==f;if(l)switch(f.$$typeof){case Ga:a:{for(l=f.key,k=d;null!==k;){if(k.key===l){if(7===k.tag?f.type===Ia:k.elementType===f.type){c(a,k.sibling),(d=e(k,f.type===Ia?f.props.children:f.props)).ref=Yg(a,k,f),d.return=a,a=d;break a}c(a,k);break}b(a,k),k=k.sibling}f.type===Ia?((d=eh(f.props.children,a.mode,h,f.key)).return=a,a=d):((h=ch(f.type,f.key,f.props,null,a.mode,h)).ref=Yg(a,d,f),h.return=a,a=h)}return g(a);case Ha:a:{for(k=f.key;null!==d;){if(d.key===k){if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling),(d=e(d,f.children||[])).return=a,a=d;break a}c(a,d);break}b(a,d),d=d.sibling}(d=dh(f,a.mode,h)).return=a,a=d}return g(a)}if("string"==typeof f||"number"==typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),(d=e(d,f)).return=a,a=d):(c(a,d),(d=bh(f,a.mode,h)).return=a,a=d),g(a);if(Xg(f))return z(a,d,f,h);if(Ua(f))return ta(a,d,f,h);if(l&&Zg(a,f),void 0===f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,Error(u(152,a.displayName||a.name||"Component"))}return c(a,d)}}var fh=$g(!0),gh=$g(!1),hh={},ih={current:hh},jh={current:hh},kh={current:hh};function lh(a){if(a===hh)throw Error(u(174));return a}function mh(a,b){I(kh,b),I(jh,a),I(ih,hh);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Qb(null,"");break;default:b=Qb(b=(c=8===c?b.parentNode:b).namespaceURI||null,c=c.tagName)}G(ih),I(ih,b)}function nh(a){G(ih),G(jh),G(kh)}function oh(a){lh(kh.current);var b=lh(ih.current),c=Qb(b,a.type);b!==c&&(I(jh,a),I(ih,c))}function ph(a){jh.current===a&&(G(ih),G(jh))}var M={current:0};function qh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(null===(c=c.dehydrated)||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!=(64&b.effectTag))return b}else if(null!==b.child){b.child.return=b,b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return,b=b.sibling}return null}function rh(a,b){return{responder:a,props:b}}var sh=Ea.ReactCurrentDispatcher,N=Ea.ReactCurrentBatchConfig,th=0,uh=null,O=null,vh=null,wh=null,P=null,xh=null,yh=0,zh=null,Ah=0,Bh=!1,Ch=null,Gh=0;function Q(){throw Error(u(321))}function Hh(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!of(a[c],b[c]))return!1;return!0}function Ih(a,b,c,d,e,f){if(th=f,uh=b,vh=null!==a?a.memoizedState:null,sh.current=null===vh?Jh:Kh,b=c(d,e),Bh){do{Bh=!1,Gh+=1,vh=null!==a?a.memoizedState:null,xh=wh,zh=P=O=null,sh.current=Kh,b=c(d,e)}while(Bh);Ch=null,Gh=0}if(sh.current=Lh,(a=uh).memoizedState=wh,a.expirationTime=yh,a.updateQueue=zh,a.effectTag|=Ah,a=null!==O&&null!==O.next,th=0,xh=P=wh=vh=O=uh=null,yh=0,zh=null,Ah=0,a)throw Error(u(300));return b}function Mh(){sh.current=Lh,th=0,xh=P=wh=vh=O=uh=null,yh=0,zh=null,Ah=0,Bh=!1,Ch=null,Gh=0}function Nh(){var a={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};return null===P?wh=P=a:P=P.next=a,P}function Oh(){if(null!==xh)xh=(P=xh).next,vh=null!==(O=vh)?O.next:null;else{if(null===vh)throw Error(u(310));var a={memoizedState:(O=vh).memoizedState,baseState:O.baseState,queue:O.queue,baseUpdate:O.baseUpdate,next:null};P=null===P?wh=a:P.next=a,vh=O.next}return P}function Ph(a,b){return"function"==typeof b?b(a):b}function Qh(a){var b=Oh(),c=b.queue;if(null===c)throw Error(u(311));if(c.lastRenderedReducer=a,0<Gh){var d=c.dispatch;if(null!==Ch){var e=Ch.get(c);if(void 0!==e){Ch.delete(c);var f=b.memoizedState;do{f=a(f,e.action),e=e.next}while(null!==e);return of(f,b.memoizedState)||(wg=!0),b.memoizedState=f,b.baseUpdate===c.last&&(b.baseState=f),c.lastRenderedState=f,[f,d]}}return[b.memoizedState,d]}d=c.last;var g=b.baseUpdate;if(f=b.baseState,null!==g?(null!==d&&(d.next=null),d=g.next):d=null!==d?d.next:null,null!==d){var h=e=null,k=d,l=!1;do{var m=k.expirationTime;m<th?(l||(l=!0,h=g,e=f),m>yh&&Jg(yh=m)):(Ig(m,k.suspenseConfig),f=k.eagerReducer===a?k.eagerState:a(f,k.action)),g=k,k=k.next}while(null!==k&&k!==d);l||(h=g,e=f),of(f,b.memoizedState)||(wg=!0),b.memoizedState=f,b.baseUpdate=h,b.baseState=e,c.lastRenderedState=f}return[b.memoizedState,c.dispatch]}function Rh(a){var b=Nh();return"function"==typeof a&&(a=a()),b.memoizedState=b.baseState=a,a=(a=b.queue={last:null,dispatch:null,lastRenderedReducer:Ph,lastRenderedState:a}).dispatch=Sh.bind(null,uh,a),[b.memoizedState,a]}function Th(a){return Qh(Ph)}function Uh(a,b,c,d){return a={tag:a,create:b,destroy:c,deps:d,next:null},null===zh?(zh={lastEffect:null}).lastEffect=a.next=a:null===(b=zh.lastEffect)?zh.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,zh.lastEffect=a),a}function Vh(a,b,c,d){var e=Nh();Ah|=a,e.memoizedState=Uh(b,c,void 0,void 0===d?null:d)}function Wh(a,b,c,d){var e=Oh();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;if(f=g.destroy,null!==d&&Hh(d,g.deps))return void Uh(0,c,f,d)}Ah|=a,e.memoizedState=Uh(b,c,f,d)}function Xh(a,b){return Vh(516,192,a,b)}function Yh(a,b){return Wh(516,192,a,b)}function Zh(a,b){return"function"==typeof b?(a=a(),b(a),function(){b(null)}):null!=b?(a=a(),b.current=a,function(){b.current=null}):void 0}function $h(){}function ai(a,b){return Nh().memoizedState=[a,void 0===b?null:b],a}function bi(a,b){var c=Oh();b=void 0===b?null:b;var d=c.memoizedState;return null!==d&&null!==b&&Hh(b,d[1])?d[0]:(c.memoizedState=[a,b],a)}function Sh(a,b,c){if(!(25>Gh))throw Error(u(301));var d=a.alternate;if(a===uh||null!==d&&d===uh)if(Bh=!0,a={expirationTime:th,suspenseConfig:null,action:c,eagerReducer:null,eagerState:null,next:null},null===Ch&&(Ch=new Map),void 0===(c=Ch.get(b)))Ch.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{var e=Pg(),f=Mg.suspense;f={expirationTime:e=Qg(e,a,f),suspenseConfig:f,action:c,eagerReducer:null,eagerState:null,next:null};var g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h),g.next=f}if(b.last=f,0===a.expirationTime&&(null===d||0===d.expirationTime)&&null!==(d=b.lastRenderedReducer))try{var k=b.lastRenderedState,l=d(k,c);if(f.eagerReducer=d,f.eagerState=l,of(l,k))return}catch(m){}Rg(a,e)}}var Lh={readContext:xg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useResponder:Q,useDeferredValue:Q,useTransition:Q},Jh={readContext:xg,useCallback:ai,useContext:xg,useEffect:Xh,useImperativeHandle:function(a,b,c){return c=null!=c?c.concat([a]):null,Vh(4,36,Zh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Vh(4,36,a,b)},useMemo:function(a,b){var c=Nh();return b=void 0===b?null:b,a=a(),c.memoizedState=[a,b],a},useReducer:function(a,b,c){var d=Nh();return b=void 0!==c?c(b):b,d.memoizedState=d.baseState=b,a=(a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b}).dispatch=Sh.bind(null,uh,a),[d.memoizedState,a]},useRef:function(a){return a={current:a},Nh().memoizedState=a},useState:Rh,useDebugValue:$h,useResponder:rh,useDeferredValue:function(a,b){var c=Rh(a),d=c[0],e=c[1];return Xh((function(){q.unstable_next((function(){var c=N.suspense;N.suspense=void 0===b?null:b;try{e(a)}finally{N.suspense=c}}))}),[a,b]),d},useTransition:function(a){var b=Rh(!1),c=b[0],d=b[1];return[ai((function(b){d(!0),q.unstable_next((function(){var c=N.suspense;N.suspense=void 0===a?null:a;try{d(!1),b()}finally{N.suspense=c}}))}),[a,c]),c]}},Kh={readContext:xg,useCallback:bi,useContext:xg,useEffect:Yh,useImperativeHandle:function(a,b,c){return c=null!=c?c.concat([a]):null,Wh(4,36,Zh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Wh(4,36,a,b)},useMemo:function(a,b){var c=Oh();b=void 0===b?null:b;var d=c.memoizedState;return null!==d&&null!==b&&Hh(b,d[1])?d[0]:(a=a(),c.memoizedState=[a,b],a)},useReducer:Qh,useRef:function(){return Oh().memoizedState},useState:Th,useDebugValue:$h,useResponder:rh,useDeferredValue:function(a,b){var c=Th(),d=c[0],e=c[1];return Yh((function(){q.unstable_next((function(){var c=N.suspense;N.suspense=void 0===b?null:b;try{e(a)}finally{N.suspense=c}}))}),[a,b]),d},useTransition:function(a){var b=Th(),c=b[0],d=b[1];return[bi((function(b){d(!0),q.unstable_next((function(){var c=N.suspense;N.suspense=void 0===a?null:a;try{d(!1),b()}finally{N.suspense=c}}))}),[a,c]),c]}},ci=null,di=null,ei=!1;function fi(a,b){var c=gi(5,null,null,0);c.elementType="DELETED",c.type="DELETED",c.stateNode=b,c.return=a,c.effectTag=8,null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function hi(a,b){switch(a.tag){case 5:var c=a.type;return null!==(b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b)&&(a.stateNode=b,!0);case 6:return null!==(b=""===a.pendingProps||3!==b.nodeType?null:b)&&(a.stateNode=b,!0);case 13:default:return!1}}function ii(a){if(ei){var b=di;if(b){var c=b;if(!hi(a,b)){if(!(b=re(c.nextSibling))||!hi(a,b))return a.effectTag=-1025&a.effectTag|2,ei=!1,void(ci=a);fi(ci,c)}ci=a,di=re(b.firstChild)}else a.effectTag=-1025&a.effectTag|2,ei=!1,ci=a}}function ji(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;ci=a}function ki(a){if(a!==ci)return!1;if(!ei)return ji(a),ei=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!oe(b,a.memoizedProps))for(b=di;b;)fi(a,b),b=re(b.nextSibling);if(ji(a),13===a.tag){if(!(a=null!==(a=a.memoizedState)?a.dehydrated:null))throw Error(u(317));a:{for(a=a.nextSibling,b=0;a;){if(8===a.nodeType){var c=a.data;if("/$"===c){if(0===b){di=re(a.nextSibling);break a}b--}else"$"!==c&&"$!"!==c&&"$?"!==c||b++}a=a.nextSibling}di=null}}else di=ci?re(a.stateNode.nextSibling):null;return!0}function li(){di=ci=null,ei=!1}var mi=Ea.ReactCurrentOwner,wg=!1;function R(a,b,c,d){b.child=null===a?gh(b,null,c,d):fh(b,a.child,c,d)}function ni(a,b,c,d,e){c=c.render;var f=b.ref;return vg(b,e),d=Ih(a,b,c,d,f,e),null===a||wg?(b.effectTag|=1,R(a,b,d,e),b.child):(b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),oi(a,b,e))}function pi(a,b,c,d,e,f){if(null===a){var g=c.type;return"function"!=typeof g||qi(g)||void 0!==g.defaultProps||null!==c.compare||void 0!==c.defaultProps?((a=ch(c.type,null,d,null,b.mode,f)).ref=b.ref,a.return=b,b.child=a):(b.tag=15,b.type=g,ri(a,b,g,d,e,f))}return g=a.child,e<f&&(e=g.memoizedProps,(c=null!==(c=c.compare)?c:qf)(e,d)&&a.ref===b.ref)?oi(a,b,f):(b.effectTag|=1,(a=ah(g,d)).ref=b.ref,a.return=b,b.child=a)}function ri(a,b,c,d,e,f){return null!==a&&qf(a.memoizedProps,d)&&a.ref===b.ref&&(wg=!1,e<f)?oi(a,b,f):si(a,b,c,d,f)}function ti(a,b){var c=b.ref;(null===a&&null!==c||null!==a&&a.ref!==c)&&(b.effectTag|=128)}function si(a,b,c,d,e){var f=L(c)?Df:J.current;return f=Ef(b,f),vg(b,e),c=Ih(a,b,c,d,f,e),null===a||wg?(b.effectTag|=1,R(a,b,c,e),b.child):(b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),oi(a,b,e))}function ui(a,b,c,d,e){if(L(c)){var f=!0;Jf(b)}else f=!1;if(vg(b,e),null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),Ug(b,c,d),Wg(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"==typeof l&&null!==l?l=xg(l):l=Ef(b,l=L(c)?Df:J.current);var m=c.getDerivedStateFromProps,C="function"==typeof m||"function"==typeof g.getSnapshotBeforeUpdate;C||"function"!=typeof g.UNSAFE_componentWillReceiveProps&&"function"!=typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Vg(b,g,d,l),yg=!1;var y=b.memoizedState;k=g.state=y;var H=b.updateQueue;null!==H&&(Hg(b,H,d,g,e),k=b.memoizedState),h!==d||y!==k||K.current||yg?("function"==typeof m&&(Og(b,c,m,d),k=b.memoizedState),(h=yg||Tg(b,c,h,d,y,k,l))?(C||"function"!=typeof g.UNSAFE_componentWillMount&&"function"!=typeof g.componentWillMount||("function"==typeof g.componentWillMount&&g.componentWillMount(),"function"==typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"==typeof g.componentDidMount&&(b.effectTag|=4)):("function"==typeof g.componentDidMount&&(b.effectTag|=4),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"==typeof g.componentDidMount&&(b.effectTag|=4),d=!1)}else g=b.stateNode,h=b.memoizedProps,g.props=b.type===b.elementType?h:mg(b.type,h),k=g.context,"object"==typeof(l=c.contextType)&&null!==l?l=xg(l):l=Ef(b,l=L(c)?Df:J.current),(C="function"==typeof(m=c.getDerivedStateFromProps)||"function"==typeof g.getSnapshotBeforeUpdate)||"function"!=typeof g.UNSAFE_componentWillReceiveProps&&"function"!=typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Vg(b,g,d,l),yg=!1,k=b.memoizedState,y=g.state=k,null!==(H=b.updateQueue)&&(Hg(b,H,d,g,e),y=b.memoizedState),h!==d||k!==y||K.current||yg?("function"==typeof m&&(Og(b,c,m,d),y=b.memoizedState),(m=yg||Tg(b,c,h,d,k,y,l))?(C||"function"!=typeof g.UNSAFE_componentWillUpdate&&"function"!=typeof g.componentWillUpdate||("function"==typeof g.componentWillUpdate&&g.componentWillUpdate(d,y,l),"function"==typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,y,l)),"function"==typeof g.componentDidUpdate&&(b.effectTag|=4),"function"==typeof g.getSnapshotBeforeUpdate&&(b.effectTag|=256)):("function"!=typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!=typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),b.memoizedProps=d,b.memoizedState=y),g.props=d,g.state=y,g.context=l,d=m):("function"!=typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!=typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),d=!1);return vi(a,b,c,d,f,e)}function vi(a,b,c,d,e,f){ti(a,b);var g=0!=(64&b.effectTag);if(!d&&!g)return e&&Kf(b,c,!1),oi(a,b,f);d=b.stateNode,mi.current=b;var h=g&&"function"!=typeof c.getDerivedStateFromError?null:d.render();return b.effectTag|=1,null!==a&&g?(b.child=fh(b,a.child,null,f),b.child=fh(b,null,h,f)):R(a,b,h,f),b.memoizedState=d.state,e&&Kf(b,c,!0),b.child}function wi(a){var b=a.stateNode;b.pendingContext?Hf(0,b.pendingContext,b.pendingContext!==b.context):b.context&&Hf(0,b.context,!1),mh(a,b.containerInfo)}var Hi,Ji,Ki,xi={dehydrated:null,retryTime:0};function yi(a,b,c){var h,d=b.mode,e=b.pendingProps,f=M.current,g=!1;if((h=0!=(64&b.effectTag))||(h=0!=(2&f)&&(null===a||null!==a.memoizedState)),h?(g=!0,b.effectTag&=-65):null!==a&&null===a.memoizedState||void 0===e.fallback||!0===e.unstable_avoidThisFallback||(f|=1),I(M,1&f),null===a){if(void 0!==e.fallback&&ii(b),g){if(g=e.fallback,(e=eh(null,d,0,null)).return=b,0==(2&b.mode))for(a=null!==b.memoizedState?b.child.child:b.child,e.child=a;null!==a;)a.return=e,a=a.sibling;return(c=eh(g,d,c,null)).return=b,e.sibling=c,b.memoizedState=xi,b.child=e,c}return d=e.children,b.memoizedState=null,b.child=gh(b,null,d,c)}if(null!==a.memoizedState){if(d=(a=a.child).sibling,g){if(e=e.fallback,(c=ah(a,a.pendingProps)).return=b,0==(2&b.mode)&&(g=null!==b.memoizedState?b.child.child:b.child)!==a.child)for(c.child=g;null!==g;)g.return=c,g=g.sibling;return(d=ah(d,e,d.expirationTime)).return=b,c.sibling=d,c.childExpirationTime=0,b.memoizedState=xi,b.child=c,d}return c=fh(b,a.child,e.children,c),b.memoizedState=null,b.child=c}if(a=a.child,g){if(g=e.fallback,(e=eh(null,d,0,null)).return=b,e.child=a,null!==a&&(a.return=e),0==(2&b.mode))for(a=null!==b.memoizedState?b.child.child:b.child,e.child=a;null!==a;)a.return=e,a=a.sibling;return(c=eh(g,d,c,null)).return=b,e.sibling=c,c.effectTag|=2,e.childExpirationTime=0,b.memoizedState=xi,b.child=e,c}return b.memoizedState=null,b.child=fh(b,a,e.children,c)}function zi(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b),ug(a.return,b)}function Ai(a,b,c,d,e,f){var g=a.memoizedState;null===g?a.memoizedState={isBackwards:b,rendering:null,last:d,tail:c,tailExpiration:0,tailMode:e,lastEffect:f}:(g.isBackwards=b,g.rendering=null,g.last=d,g.tail=c,g.tailExpiration=0,g.tailMode=e,g.lastEffect=f)}function Bi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;if(R(a,b,d.children,c),0!=(2&(d=M.current)))d=1&d|2,b.effectTag|=64;else{if(null!==a&&0!=(64&a.effectTag))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&zi(a,c);else if(19===a.tag)zi(a,c);else if(null!==a.child){a.child.return=a,a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return,a=a.sibling}d&=1}if(I(M,d),0==(2&b.mode))b.memoizedState=null;else switch(e){case"forwards":for(c=b.child,e=null;null!==c;)null!==(a=c.alternate)&&null===qh(a)&&(e=c),c=c.sibling;null===(c=e)?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null),Ai(b,!1,e,c,f,b.lastEffect);break;case"backwards":for(c=null,e=b.child,b.child=null;null!==e;){if(null!==(a=e.alternate)&&null===qh(a)){b.child=e;break}a=e.sibling,e.sibling=c,c=e,e=a}Ai(b,!0,c,null,f,b.lastEffect);break;case"together":Ai(b,!1,null,null,void 0,b.lastEffect);break;default:b.memoizedState=null}return b.child}function oi(a,b,c){null!==a&&(b.dependencies=a.dependencies);var d=b.expirationTime;if(0!==d&&Jg(d),b.childExpirationTime<c)return null;if(null!==a&&b.child!==a.child)throw Error(u(153));if(null!==b.child){for(c=ah(a=b.child,a.pendingProps,a.expirationTime),b.child=c,c.return=b;null!==a.sibling;)a=a.sibling,(c=c.sibling=ah(a,a.pendingProps,a.expirationTime)).return=b;c.sibling=null}return b.child}function Ci(a){a.effectTag|=4}function Li(a,b){switch(a.tailMode){case"hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function Mi(a){switch(a.tag){case 1:L(a.type)&&Ff();var b=a.effectTag;return 4096&b?(a.effectTag=-4097&b|64,a):null;case 3:if(nh(),Gf(),0!=(64&(b=a.effectTag)))throw Error(u(285));return a.effectTag=-4097&b|64,a;case 5:return ph(a),null;case 13:return G(M),4096&(b=a.effectTag)?(a.effectTag=-4097&b|64,a):null;case 19:return G(M),null;case 4:return nh(),null;case 10:return tg(a),null;default:return null}}function Ni(a,b){return{value:a,source:b,stack:Xa(b)}}Hi=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c,c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},Ji=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var h,k,g=b.stateNode;switch(lh(ih.current),a=null,c){case"input":f=Ab(g,f),d=Ab(g,d),a=[];break;case"option":f=Ib(g,f),d=Ib(g,d),a=[];break;case"select":f=n({},f,{value:void 0}),d=n({},d,{value:void 0}),a=[];break;case"textarea":f=Kb(g,f),d=Kb(g,d),a=[];break;default:"function"!=typeof f.onClick&&"function"==typeof d.onClick&&(g.onclick=ae)}for(h in Yd(c,d),c=null,f)if(!d.hasOwnProperty(h)&&f.hasOwnProperty(h)&&null!=f[h])if("style"===h)for(k in g=f[h])g.hasOwnProperty(k)&&(c||(c={}),c[k]="");else"dangerouslySetInnerHTML"!==h&&"children"!==h&&"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&"autoFocus"!==h&&(ia.hasOwnProperty(h)?a||(a=[]):(a=a||[]).push(h,null));for(h in d){var l=d[h];if(g=null!=f?f[h]:void 0,d.hasOwnProperty(h)&&l!==g&&(null!=l||null!=g))if("style"===h)if(g){for(k in g)!g.hasOwnProperty(k)||l&&l.hasOwnProperty(k)||(c||(c={}),c[k]="");for(k in l)l.hasOwnProperty(k)&&g[k]!==l[k]&&(c||(c={}),c[k]=l[k])}else c||(a||(a=[]),a.push(h,c)),c=l;else"dangerouslySetInnerHTML"===h?(l=l?l.__html:void 0,g=g?g.__html:void 0,null!=l&&g!==l&&(a=a||[]).push(h,""+l)):"children"===h?g===l||"string"!=typeof l&&"number"!=typeof l||(a=a||[]).push(h,""+l):"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&(ia.hasOwnProperty(h)?(null!=l&&$d(e,h),a||g===l||(a=[])):(a=a||[]).push(h,l))}c&&(a=a||[]).push("style",c),e=a,(b.updateQueue=e)&&Ci(b)}},Ki=function(a,b,c,d){c!==d&&Ci(b)};var Oi="function"==typeof WeakSet?WeakSet:Set;function Pi(a,b){var c=b.source,d=b.stack;null===d&&null!==c&&(d=Xa(c)),null!==c&&Wa(c.type),b=b.value,null!==a&&1===a.tag&&Wa(a.type);try{console.error(b)}catch(e){setTimeout((function(){throw e}))}}function Si(a){var b=a.ref;if(null!==b)if("function"==typeof b)try{b(null)}catch(c){Ri(a,c)}else b.current=null}function Ti(a,b){switch(b.tag){case 0:case 11:case 15:Ui(2,0,b);break;case 1:if(256&b.effectTag&&null!==a){var c=a.memoizedProps,d=a.memoizedState;b=(a=b.stateNode).getSnapshotBeforeUpdate(b.elementType===b.type?c:mg(b.type,c),d),a.__reactInternalSnapshotBeforeUpdate=b}break;case 3:case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}function Ui(a,b,c){if(null!==(c=null!==(c=c.updateQueue)?c.lastEffect:null)){var d=c=c.next;do{if(0!=(d.tag&a)){var e=d.destroy;d.destroy=void 0,void 0!==e&&e()}0!=(d.tag&b)&&(e=d.create,d.destroy=e()),d=d.next}while(d!==c)}}function Vi(a,b,c){switch("function"==typeof Wi&&Wi(b),b.tag){case 0:case 11:case 14:case 15:if(null!==(a=b.updateQueue)&&null!==(a=a.lastEffect)){var d=a.next;fg(97<c?97:c,(function(){var a=d;do{var c=a.destroy;if(void 0!==c){var g=b;try{c()}catch(h){Ri(g,h)}}a=a.next}while(a!==d)}))}break;case 1:Si(b),"function"==typeof(c=b.stateNode).componentWillUnmount&&function Qi(a,b){try{b.props=a.memoizedProps,b.state=a.memoizedState,b.componentWillUnmount()}catch(c){Ri(a,c)}}(b,c);break;case 5:Si(b);break;case 4:Xi(a,b,c)}}function Yi(a){var b=a.alternate;a.return=null,a.child=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.alternate=null,a.firstEffect=null,a.lastEffect=null,a.pendingProps=null,a.memoizedProps=null,null!==b&&Yi(b)}function Zi(a){return 5===a.tag||3===a.tag||4===a.tag}function $i(a){a:{for(var b=a.return;null!==b;){if(Zi(b)){var c=b;break a}b=b.return}throw Error(u(160))}switch(b=c.stateNode,c.tag){case 5:var d=!1;break;case 3:case 4:b=b.containerInfo,d=!0;break;default:throw Error(u(161))}16&c.effectTag&&(Tb(b,""),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||Zi(c.return)){c=null;break a}c=c.return}for(c.sibling.return=c.return,c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(2&c.effectTag)continue b;if(null===c.child||4===c.tag)continue b;c.child.return=c,c=c.child}if(!(2&c.effectTag)){c=c.stateNode;break a}}for(var e=a;;){var f=5===e.tag||6===e.tag;if(f){var g=f?e.stateNode:e.stateNode.instance;if(c)if(d){var h=g;g=c,8===(f=b).nodeType?f.parentNode.insertBefore(h,g):f.insertBefore(h,g)}else b.insertBefore(g,c);else d?(8===(h=b).nodeType?(f=h.parentNode).insertBefore(g,h):(f=h).appendChild(g),null!=(h=h._reactRootContainer)||null!==f.onclick||(f.onclick=ae)):b.appendChild(g)}else if(4!==e.tag&&null!==e.child){e.child.return=e,e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e.return||e.return===a)return;e=e.return}e.sibling.return=e.return,e=e.sibling}}function Xi(a,b,c){for(var f,g,d=b,e=!1;;){if(!e){e=d.return;a:for(;;){if(null===e)throw Error(u(160));switch(f=e.stateNode,e.tag){case 5:g=!1;break a;case 3:case 4:f=f.containerInfo,g=!0;break a}e=e.return}e=!0}if(5===d.tag||6===d.tag){a:for(var h=a,k=d,l=c,m=k;;)if(Vi(h,m,l),null!==m.child&&4!==m.tag)m.child.return=m,m=m.child;else{if(m===k)break;for(;null===m.sibling;){if(null===m.return||m.return===k)break a;m=m.return}m.sibling.return=m.return,m=m.sibling}g?(h=f,k=d.stateNode,8===h.nodeType?h.parentNode.removeChild(k):h.removeChild(k)):f.removeChild(d.stateNode)}else if(4===d.tag){if(null!==d.child){f=d.stateNode.containerInfo,g=!0,d.child.return=d,d=d.child;continue}}else if(Vi(a,d,c),null!==d.child){d.child.return=d,d=d.child;continue}if(d===b)break;for(;null===d.sibling;){if(null===d.return||d.return===b)return;4===(d=d.return).tag&&(e=!1)}d.sibling.return=d.return,d=d.sibling}}function aj(a,b){switch(b.tag){case 0:case 11:case 14:case 15:Ui(4,8,b);break;case 1:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps,e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;if(b.updateQueue=null,null!==f){for(c[ve]=d,"input"===a&&"radio"===d.type&&null!=d.name&&Cb(c,d),Zd(a,e),b=Zd(a,d),e=0;e<f.length;e+=2){var g=f[e],h=f[e+1];"style"===g?Wd(c,h):"dangerouslySetInnerHTML"===g?Sb(c,h):"children"===g?Tb(c,h):vb(c,g,h,b)}switch(a){case"input":Eb(c,d);break;case"textarea":Mb(c,d);break;case"select":b=c._wrapperState.wasMultiple,c._wrapperState.wasMultiple=!!d.multiple,null!=(a=d.value)?Jb(c,!!d.multiple,a,!1):b!==!!d.multiple&&(null!=d.defaultValue?Jb(c,!!d.multiple,d.defaultValue,!0):Jb(c,!!d.multiple,d.multiple?[]:"",!1))}}}break;case 6:if(null===b.stateNode)throw Error(u(162));b.stateNode.nodeValue=b.memoizedProps;break;case 3:(b=b.stateNode).hydrate&&(b.hydrate=!1,Lc(b.containerInfo));break;case 12:break;case 13:if(c=b,null===b.memoizedState?d=!1:(d=!0,c=b.child,bj=cg()),null!==c)a:for(a=c;;){if(5===a.tag)f=a.stateNode,d?"function"==typeof(f=f.style).setProperty?f.setProperty("display","none","important"):f.display="none":(f=a.stateNode,e=null!=(e=a.memoizedProps.style)&&e.hasOwnProperty("display")?e.display:null,f.style.display=Vd("display",e));else if(6===a.tag)a.stateNode.nodeValue=d?"":a.memoizedProps;else{if(13===a.tag&&null!==a.memoizedState&&null===a.memoizedState.dehydrated){(f=a.child.sibling).return=a,a=f;continue}if(null!==a.child){a.child.return=a,a=a.child;continue}}if(a===c)break a;for(;null===a.sibling;){if(null===a.return||a.return===c)break a;a=a.return}a.sibling.return=a.return,a=a.sibling}cj(b);break;case 19:cj(b);break;case 17:case 20:case 21:break;default:throw Error(u(163))}}function cj(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Oi),b.forEach((function(b){var d=dj.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))}))}}var ej="function"==typeof WeakMap?WeakMap:Map;function fj(a,b,c){(c=Bg(c,null)).tag=3,c.payload={element:null};var d=b.value;return c.callback=function(){gj||(gj=!0,hj=d),Pi(a,b)},c}function ij(a,b,c){(c=Bg(c,null)).tag=3;var d=a.type.getDerivedStateFromError;if("function"==typeof d){var e=b.value;c.payload=function(){return Pi(a,b),d(e)}}var f=a.stateNode;return null!==f&&"function"==typeof f.componentDidCatch&&(c.callback=function(){"function"!=typeof d&&(null===jj?jj=new Set([this]):jj.add(this),Pi(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})}),c}var gk,kj=Math.ceil,lj=Ea.ReactCurrentDispatcher,mj=Ea.ReactCurrentOwner,T=0,U=null,V=null,W=0,X=0,wj=null,xj=1073741823,yj=1073741823,zj=null,Aj=0,Bj=!1,bj=0,Y=null,gj=!1,hj=null,jj=null,Dj=!1,Ej=null,Fj=90,Gj=null,Hj=0,Ij=null,Jj=0;function Pg(){return 0!=(48&T)?1073741821-(cg()/10|0):0!==Jj?Jj:Jj=1073741821-(cg()/10|0)}function Qg(a,b,c){if(0==(2&(b=b.mode)))return 1073741823;var d=dg();if(0==(4&b))return 99===d?1073741823:1073741822;if(0!=(16&T))return W;if(null!==c)a=lg(a,0|c.timeoutMs||5e3,250);else switch(d){case 99:a=1073741823;break;case 98:a=lg(a,150,100);break;case 97:case 96:a=lg(a,5e3,250);break;case 95:a=2;break;default:throw Error(u(326))}return null!==U&&a===W&&--a,a}function Rg(a,b){if(50<Hj)throw Hj=0,Ij=null,Error(u(185));if(null!==(a=Kj(a,b))){var c=dg();1073741823===b?0!=(8&T)&&0==(48&T)?Lj(a):(Z(a),0===T&&jg()):Z(a),0==(4&T)||98!==c&&99!==c||(null===Gj?Gj=new Map([[a,b]]):(void 0===(c=Gj.get(a))||c>b)&&Gj.set(a,b))}}function Kj(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b);var d=a.return,e=null;if(null===d&&3===a.tag)e=a.stateNode;else for(;null!==d;){if(c=d.alternate,d.childExpirationTime<b&&(d.childExpirationTime=b),null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b),null===d.return&&3===d.tag){e=d.stateNode;break}d=d.return}return null!==e&&(U===e&&(Jg(b),4===X&&Mj(e,W)),Nj(e,b)),e}function Oj(a){var b=a.lastExpiredTime;return 0!==b?b:Pj(a,b=a.firstPendingTime)?(b=a.lastPingedTime)>(a=a.nextKnownPendingLevel)?b:a:b}function Z(a){if(0!==a.lastExpiredTime)a.callbackExpirationTime=1073741823,a.callbackPriority=99,a.callbackNode=hg(Lj.bind(null,a));else{var b=Oj(a),c=a.callbackNode;if(0===b)null!==c&&(a.callbackNode=null,a.callbackExpirationTime=0,a.callbackPriority=90);else{var d=Pg();if(1073741823===b?d=99:1===b||2===b?d=95:d=0>=(d=10*(1073741821-b)-10*(1073741821-d))?99:250>=d?98:5250>=d?97:95,null!==c){var e=a.callbackPriority;if(a.callbackExpirationTime===b&&e>=d)return;c!==Xf&&Nf(c)}a.callbackExpirationTime=b,a.callbackPriority=d,b=1073741823===b?hg(Lj.bind(null,a)):gg(d,Qj.bind(null,a),{timeout:10*(1073741821-b)-cg()}),a.callbackNode=b}}}function Qj(a,b){if(Jj=0,b)return Rj(a,b=Pg()),Z(a),null;var c=Oj(a);if(0!==c){if(b=a.callbackNode,0!=(48&T))throw Error(u(327));if(Sj(),a===U&&c===W||Tj(a,c),null!==V){var d=T;T|=16;for(var e=Uj();;)try{Vj();break}catch(h){Wj(a,h)}if(rg(),T=d,lj.current=e,1===X)throw b=wj,Tj(a,c),Mj(a,c),Z(a),b;if(null===V)switch(e=a.finishedWork=a.current.alternate,a.finishedExpirationTime=c,d=X,U=null,d){case 0:case 1:throw Error(u(345));case 2:Rj(a,2<c?2:c);break;case 3:if(Mj(a,c),c===(d=a.lastSuspendedTime)&&(a.nextKnownPendingLevel=Xj(e)),1073741823===xj&&10<(e=bj+500-cg())){if(Bj){var f=a.lastPingedTime;if(0===f||f>=c){a.lastPingedTime=c,Tj(a,c);break}}if(0!==(f=Oj(a))&&f!==c)break;if(0!==d&&d!==c){a.lastPingedTime=d;break}a.timeoutHandle=pe(Yj.bind(null,a),e);break}Yj(a);break;case 4:if(Mj(a,c),c===(d=a.lastSuspendedTime)&&(a.nextKnownPendingLevel=Xj(e)),Bj&&(0===(e=a.lastPingedTime)||e>=c)){a.lastPingedTime=c,Tj(a,c);break}if(0!==(e=Oj(a))&&e!==c)break;if(0!==d&&d!==c){a.lastPingedTime=d;break}if(1073741823!==yj?d=10*(1073741821-yj)-cg():1073741823===xj?d=0:(d=10*(1073741821-xj)-5e3,0>(d=(e=cg())-d)&&(d=0),(c=10*(1073741821-c)-e)<(d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*kj(d/1960))-d)&&(d=c)),10<d){a.timeoutHandle=pe(Yj.bind(null,a),d);break}Yj(a);break;case 5:if(1073741823!==xj&&null!==zj){f=xj;var g=zj;if(0>=(d=0|g.busyMinDurationMs)?d=0:(e=0|g.busyDelayMs,d=(f=cg()-(10*(1073741821-f)-(0|g.timeoutMs||5e3)))<=e?0:e+d-f),10<d){Mj(a,c),a.timeoutHandle=pe(Yj.bind(null,a),d);break}}Yj(a);break;default:throw Error(u(329))}if(Z(a),a.callbackNode===b)return Qj.bind(null,a)}}return null}function Lj(a){var b=a.lastExpiredTime;if(b=0!==b?b:1073741823,a.finishedExpirationTime===b)Yj(a);else{if(0!=(48&T))throw Error(u(327));if(Sj(),a===U&&b===W||Tj(a,b),null!==V){var c=T;T|=16;for(var d=Uj();;)try{Zj();break}catch(e){Wj(a,e)}if(rg(),T=c,lj.current=d,1===X)throw c=wj,Tj(a,b),Mj(a,b),Z(a),c;if(null!==V)throw Error(u(261));a.finishedWork=a.current.alternate,a.finishedExpirationTime=b,U=null,Yj(a),Z(a)}}return null}function bk(a,b){var c=T;T|=1;try{return a(b)}finally{0===(T=c)&&jg()}}function ck(a,b){var c=T;T&=-2,T|=8;try{return a(b)}finally{0===(T=c)&&jg()}}function Tj(a,b){a.finishedWork=null,a.finishedExpirationTime=0;var c=a.timeoutHandle;if(-1!==c&&(a.timeoutHandle=-1,qe(c)),null!==V)for(c=V.return;null!==c;){var d=c;switch(d.tag){case 1:var e=d.type.childContextTypes;null!=e&&Ff();break;case 3:nh(),Gf();break;case 5:ph(d);break;case 4:nh();break;case 13:case 19:G(M);break;case 10:tg(d)}c=c.return}U=a,V=ah(a.current,null),W=b,X=0,wj=null,yj=xj=1073741823,zj=null,Aj=0,Bj=!1}function Wj(a,b){for(;;){try{if(rg(),Mh(),null===V||null===V.return)return X=1,wj=b,null;a:{var c=a,d=V.return,e=V,f=b;if(b=W,e.effectTag|=2048,e.firstEffect=e.lastEffect=null,null!==f&&"object"==typeof f&&"function"==typeof f.then){var g=f,h=0!=(1&M.current),k=d;do{var l;if(l=13===k.tag){var m=k.memoizedState;if(null!==m)l=null!==m.dehydrated;else{var C=k.memoizedProps;l=void 0!==C.fallback&&(!0!==C.unstable_avoidThisFallback||!h)}}if(l){var y=k.updateQueue;if(null===y){var H=new Set;H.add(g),k.updateQueue=H}else y.add(g);if(0==(2&k.mode)){if(k.effectTag|=64,e.effectTag&=-2981,1===e.tag)if(null===e.alternate)e.tag=17;else{var z=Bg(1073741823,null);z.tag=2,Dg(e,z)}e.expirationTime=1073741823;break a}f=void 0,e=b;var ta=c.pingCache;if(null===ta?(ta=c.pingCache=new ej,f=new Set,ta.set(g,f)):void 0===(f=ta.get(g))&&(f=new Set,ta.set(g,f)),!f.has(e)){f.add(e);var r=dk.bind(null,c,g,e);g.then(r,r)}k.effectTag|=4096,k.expirationTime=b;break a}k=k.return}while(null!==k);f=Error((Wa(e.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+Xa(e))}5!==X&&(X=2),f=Ni(f,e),k=d;do{switch(k.tag){case 3:g=f,k.effectTag|=4096,k.expirationTime=b,Eg(k,fj(k,g,b));break a;case 1:g=f;var A=k.type,p=k.stateNode;if(0==(64&k.effectTag)&&("function"==typeof A.getDerivedStateFromError||null!==p&&"function"==typeof p.componentDidCatch&&(null===jj||!jj.has(p)))){k.effectTag|=4096,k.expirationTime=b,Eg(k,ij(k,g,b));break a}}k=k.return}while(null!==k)}V=ek(V)}catch(v){b=v;continue}break}}function Uj(){var a=lj.current;return lj.current=Lh,null===a?Lh:a}function Ig(a,b){a<xj&&2<a&&(xj=a),null!==b&&a<yj&&2<a&&(yj=a,zj=b)}function Jg(a){a>Aj&&(Aj=a)}function Zj(){for(;null!==V;)V=fk(V)}function Vj(){for(;null!==V&&!Of();)V=fk(V)}function fk(a){var b=gk(a.alternate,a,W);return a.memoizedProps=a.pendingProps,null===b&&(b=ek(a)),mj.current=null,b}function ek(a){V=a;do{var b=V.alternate;if(a=V.return,0==(2048&V.effectTag)){a:{var c=b,d=W,e=(b=V).pendingProps;switch(b.tag){case 2:case 16:break;case 15:case 0:break;case 1:L(b.type)&&Ff();break;case 3:nh(),Gf(),(e=b.stateNode).pendingContext&&(e.context=e.pendingContext,e.pendingContext=null),(null===c||null===c.child)&&ki(b)&&Ci(b);break;case 5:ph(b),d=lh(kh.current);var f=b.type;if(null!==c&&null!=b.stateNode)Ji(c,b,f,e,d),c.ref!==b.ref&&(b.effectTag|=128);else if(e){var g=lh(ih.current);if(ki(b)){var h=(e=b).stateNode;c=e.type;var k=e.memoizedProps,l=d;switch(h[ue]=e,h[ve]=k,f=void 0,d=h,c){case"iframe":case"object":case"embed":F("load",d);break;case"video":case"audio":for(h=0;h<cc.length;h++)F(cc[h],d);break;case"source":F("error",d);break;case"img":case"image":case"link":F("error",d),F("load",d);break;case"form":F("reset",d),F("submit",d);break;case"details":F("toggle",d);break;case"input":Bb(d,k),F("invalid",d),$d(l,"onChange");break;case"select":d._wrapperState={wasMultiple:!!k.multiple},F("invalid",d),$d(l,"onChange");break;case"textarea":Lb(d,k),F("invalid",d),$d(l,"onChange")}for(f in Yd(c,k),h=null,k)k.hasOwnProperty(f)&&(g=k[f],"children"===f?"string"==typeof g?d.textContent!==g&&(h=["children",g]):"number"==typeof g&&d.textContent!==""+g&&(h=["children",""+g]):ia.hasOwnProperty(f)&&null!=g&&$d(l,f));switch(c){case"input":yb(d),Gb(d,k,!0);break;case"textarea":yb(d),Nb(d);break;case"select":case"option":break;default:"function"==typeof k.onClick&&(d.onclick=ae)}f=h,e.updateQueue=f,(e=null!==f)&&Ci(b)}else{c=b,l=f,k=e,h=9===d.nodeType?d:d.ownerDocument,g===Ob_html&&(g=Pb(l)),g===Ob_html?"script"===l?((k=h.createElement("div")).innerHTML="<script><\/script>",h=k.removeChild(k.firstChild)):"string"==typeof k.is?h=h.createElement(l,{is:k.is}):(h=h.createElement(l),"select"===l&&(l=h,k.multiple?l.multiple=!0:k.size&&(l.size=k.size))):h=h.createElementNS(g,l),(k=h)[ue]=c,k[ve]=e,Hi(k,b),b.stateNode=k;var m=d,C=Zd(l=f,c=e);switch(l){case"iframe":case"object":case"embed":F("load",k),d=c;break;case"video":case"audio":for(d=0;d<cc.length;d++)F(cc[d],k);d=c;break;case"source":F("error",k),d=c;break;case"img":case"image":case"link":F("error",k),F("load",k),d=c;break;case"form":F("reset",k),F("submit",k),d=c;break;case"details":F("toggle",k),d=c;break;case"input":Bb(k,c),d=Ab(k,c),F("invalid",k),$d(m,"onChange");break;case"option":d=Ib(k,c);break;case"select":k._wrapperState={wasMultiple:!!c.multiple},d=n({},c,{value:void 0}),F("invalid",k),$d(m,"onChange");break;case"textarea":Lb(k,c),d=Kb(k,c),F("invalid",k),$d(m,"onChange");break;default:d=c}Yd(l,d),h=void 0,g=l;var y=k,H=d;for(h in H)if(H.hasOwnProperty(h)){var z=H[h];"style"===h?Wd(y,z):"dangerouslySetInnerHTML"===h?null!=(z=z?z.__html:void 0)&&Sb(y,z):"children"===h?"string"==typeof z?("textarea"!==g||""!==z)&&Tb(y,z):"number"==typeof z&&Tb(y,""+z):"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&"autoFocus"!==h&&(ia.hasOwnProperty(h)?null!=z&&$d(m,h):null!=z&&vb(y,h,z,C))}switch(l){case"input":yb(k),Gb(k,c,!1);break;case"textarea":yb(k),Nb(k);break;case"option":null!=c.value&&k.setAttribute("value",""+ub(c.value));break;case"select":(d=k).multiple=!!c.multiple,null!=(k=c.value)?Jb(d,!!c.multiple,k,!1):null!=c.defaultValue&&Jb(d,!!c.multiple,c.defaultValue,!0);break;default:"function"==typeof d.onClick&&(k.onclick=ae)}(e=ne(f,e))&&Ci(b)}null!==b.ref&&(b.effectTag|=128)}else if(null===b.stateNode)throw Error(u(166));break;case 6:if(c&&null!=b.stateNode)Ki(0,b,c.memoizedProps,e);else{if("string"!=typeof e&&null===b.stateNode)throw Error(u(166));d=lh(kh.current),lh(ih.current),ki(b)?(f=(e=b).stateNode,d=e.memoizedProps,f[ue]=e,(e=f.nodeValue!==d)&&Ci(b)):(f=b,(e=(9===d.nodeType?d:d.ownerDocument).createTextNode(e))[ue]=f,b.stateNode=e)}break;case 11:break;case 13:if(G(M),e=b.memoizedState,0!=(64&b.effectTag)){b.expirationTime=d;break a}e=null!==e,f=!1,null===c?void 0!==b.memoizedProps.fallback&&ki(b):(f=null!==(d=c.memoizedState),e||null===d||null!==(d=c.child.sibling)&&(null!==(k=b.firstEffect)?(b.firstEffect=d,d.nextEffect=k):(b.firstEffect=b.lastEffect=d,d.nextEffect=null),d.effectTag=8)),e&&!f&&0!=(2&b.mode)&&(null===c&&!0!==b.memoizedProps.unstable_avoidThisFallback||0!=(1&M.current)?0===X&&(X=3):(0!==X&&3!==X||(X=4),0!==Aj&&null!==U&&(Mj(U,W),Nj(U,Aj)))),(e||f)&&(b.effectTag|=4);break;case 7:case 8:case 12:break;case 4:nh();break;case 10:tg(b);break;case 9:case 14:break;case 17:L(b.type)&&Ff();break;case 19:if(G(M),null===(e=b.memoizedState))break;if(f=0!=(64&b.effectTag),null===(k=e.rendering)){if(f)Li(e,!1);else if(0!==X||null!==c&&0!=(64&c.effectTag))for(c=b.child;null!==c;){if(null!==(k=qh(c))){for(b.effectTag|=64,Li(e,!1),null!==(f=k.updateQueue)&&(b.updateQueue=f,b.effectTag|=4),null===e.lastEffect&&(b.firstEffect=null),b.lastEffect=e.lastEffect,e=d,f=b.child;null!==f;)c=e,(d=f).effectTag&=2,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null,null===(k=d.alternate)?(d.childExpirationTime=0,d.expirationTime=c,d.child=null,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null):(d.childExpirationTime=k.childExpirationTime,d.expirationTime=k.expirationTime,d.child=k.child,d.memoizedProps=k.memoizedProps,d.memoizedState=k.memoizedState,d.updateQueue=k.updateQueue,c=k.dependencies,d.dependencies=null===c?null:{expirationTime:c.expirationTime,firstContext:c.firstContext,responders:c.responders}),f=f.sibling;I(M,1&M.current|2),b=b.child;break a}c=c.sibling}}else{if(!f)if(null!==(c=qh(k))){if(b.effectTag|=64,f=!0,null!==(d=c.updateQueue)&&(b.updateQueue=d,b.effectTag|=4),Li(e,!0),null===e.tail&&"hidden"===e.tailMode&&!k.alternate){null!==(b=b.lastEffect=e.lastEffect)&&(b.nextEffect=null);break}}else cg()>e.tailExpiration&&1<d&&(b.effectTag|=64,f=!0,Li(e,!1),b.expirationTime=b.childExpirationTime=d-1);e.isBackwards?(k.sibling=b.child,b.child=k):(null!==(d=e.last)?d.sibling=k:b.child=k,e.last=k)}if(null!==e.tail){0===e.tailExpiration&&(e.tailExpiration=cg()+500),d=e.tail,e.rendering=d,e.tail=d.sibling,e.lastEffect=b.lastEffect,d.sibling=null,e=M.current,I(M,e=f?1&e|2:1&e),b=d;break a}break;case 20:case 21:break;default:throw Error(u(156,b.tag))}b=null}if(e=V,1===W||1!==e.childExpirationTime){for(f=0,d=e.child;null!==d;)(c=d.expirationTime)>f&&(f=c),(k=d.childExpirationTime)>f&&(f=k),d=d.sibling;e.childExpirationTime=f}if(null!==b)return b;null!==a&&0==(2048&a.effectTag)&&(null===a.firstEffect&&(a.firstEffect=V.firstEffect),null!==V.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=V.firstEffect),a.lastEffect=V.lastEffect),1<V.effectTag&&(null!==a.lastEffect?a.lastEffect.nextEffect=V:a.firstEffect=V,a.lastEffect=V))}else{if(null!==(b=Mi(V)))return b.effectTag&=2047,b;null!==a&&(a.firstEffect=a.lastEffect=null,a.effectTag|=2048)}if(null!==(b=V.sibling))return b;V=a}while(null!==V);return 0===X&&(X=5),null}function Xj(a){var b=a.expirationTime;return b>(a=a.childExpirationTime)?b:a}function Yj(a){var b=dg();return fg(99,ik.bind(null,a,b)),null}function ik(a,b){do{Sj()}while(null!==Ej);if(0!=(48&T))throw Error(u(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;if(a.finishedWork=null,a.finishedExpirationTime=0,c===a.current)throw Error(u(177));a.callbackNode=null,a.callbackExpirationTime=0,a.callbackPriority=90,a.nextKnownPendingLevel=0;var e=Xj(c);if(a.firstPendingTime=e,d<=a.lastSuspendedTime?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:d<=a.firstSuspendedTime&&(a.firstSuspendedTime=d-1),d<=a.lastPingedTime&&(a.lastPingedTime=0),d<=a.lastExpiredTime&&(a.lastExpiredTime=0),a===U&&(V=U=null,W=0),1<c.effectTag?null!==c.lastEffect?(c.lastEffect.nextEffect=c,e=c.firstEffect):e=c:e=c.firstEffect,null!==e){var f=T;T|=32,mj.current=null,le=Ld;var g=fe();if(ge(g)){if("selectionStart"in g)var h={start:g.selectionStart,end:g.selectionEnd};else a:{var k=(h=(h=g.ownerDocument)&&h.defaultView||window).getSelection&&h.getSelection();if(k&&0!==k.rangeCount){h=k.anchorNode;var l=k.anchorOffset,m=k.focusNode;k=k.focusOffset;try{h.nodeType,m.nodeType}catch(Db){h=null;break a}var C=0,y=-1,H=-1,z=0,ta=0,r=g,x=null;b:for(;;){for(var A;r!==h||0!==l&&3!==r.nodeType||(y=C+l),r!==m||0!==k&&3!==r.nodeType||(H=C+k),3===r.nodeType&&(C+=r.nodeValue.length),null!==(A=r.firstChild);)x=r,r=A;for(;;){if(r===g)break b;if(x===h&&++z===l&&(y=C),x===m&&++ta===k&&(H=C),null!==(A=r.nextSibling))break;x=(r=x).parentNode}r=A}h=-1===y||-1===H?null:{start:y,end:H}}else h=null}h=h||{start:0,end:0}}else h=null;me={focusedElem:g,selectionRange:h},Ld=!1,Y=e;do{try{jk()}catch(Db){if(null===Y)throw Error(u(330));Ri(Y,Db),Y=Y.nextEffect}}while(null!==Y);Y=e;do{try{for(g=a,h=b;null!==Y;){var p=Y.effectTag;if(16&p&&Tb(Y.stateNode,""),128&p){var t=Y.alternate;if(null!==t){var v=t.ref;null!==v&&("function"==typeof v?v(null):v.current=null)}}switch(1038&p){case 2:$i(Y),Y.effectTag&=-3;break;case 6:$i(Y),Y.effectTag&=-3,aj(Y.alternate,Y);break;case 1024:Y.effectTag&=-1025;break;case 1028:Y.effectTag&=-1025,aj(Y.alternate,Y);break;case 4:aj(Y.alternate,Y);break;case 8:Xi(g,l=Y,h),Yi(l)}Y=Y.nextEffect}}catch(Db){if(null===Y)throw Error(u(330));Ri(Y,Db),Y=Y.nextEffect}}while(null!==Y);if(v=me,t=fe(),p=v.focusedElem,h=v.selectionRange,t!==p&&p&&p.ownerDocument&&function ee(a,b){return!(!a||!b)&&(a===b||(!a||3!==a.nodeType)&&(b&&3===b.nodeType?ee(a,b.parentNode):"contains"in a?a.contains(b):!!a.compareDocumentPosition&&!!(16&a.compareDocumentPosition(b))))}(p.ownerDocument.documentElement,p)){null!==h&&ge(p)&&(t=h.start,void 0===(v=h.end)&&(v=t),"selectionStart"in p?(p.selectionStart=t,p.selectionEnd=Math.min(v,p.value.length)):(v=(t=p.ownerDocument||document)&&t.defaultView||window).getSelection&&(v=v.getSelection(),l=p.textContent.length,g=Math.min(h.start,l),h=void 0===h.end?g:Math.min(h.end,l),!v.extend&&g>h&&(l=h,h=g,g=l),l=de(p,g),m=de(p,h),l&&m&&(1!==v.rangeCount||v.anchorNode!==l.node||v.anchorOffset!==l.offset||v.focusNode!==m.node||v.focusOffset!==m.offset)&&((t=t.createRange()).setStart(l.node,l.offset),v.removeAllRanges(),g>h?(v.addRange(t),v.extend(m.node,m.offset)):(t.setEnd(m.node,m.offset),v.addRange(t))))),t=[];for(v=p;v=v.parentNode;)1===v.nodeType&&t.push({element:v,left:v.scrollLeft,top:v.scrollTop});for("function"==typeof p.focus&&p.focus(),p=0;p<t.length;p++)(v=t[p]).element.scrollLeft=v.left,v.element.scrollTop=v.top}me=null,Ld=!!le,le=null,a.current=c,Y=e;do{try{for(p=d;null!==Y;){var Dh=Y.effectTag;if(36&Dh){var dc=Y.alternate;switch(v=p,(t=Y).tag){case 0:case 11:case 15:Ui(16,32,t);break;case 1:var fd=t.stateNode;if(4&t.effectTag)if(null===dc)fd.componentDidMount();else{var hk=t.elementType===t.type?dc.memoizedProps:mg(t.type,dc.memoizedProps);fd.componentDidUpdate(hk,dc.memoizedState,fd.__reactInternalSnapshotBeforeUpdate)}var Eh=t.updateQueue;null!==Eh&&Kg(0,Eh,fd);break;case 3:var Fh=t.updateQueue;if(null!==Fh){if(g=null,null!==t.child)switch(t.child.tag){case 5:g=t.child.stateNode;break;case 1:g=t.child.stateNode}Kg(0,Fh,g)}break;case 5:var xk=t.stateNode;null===dc&&4&t.effectTag&&ne(t.type,t.memoizedProps)&&xk.focus();break;case 6:case 4:case 12:break;case 13:if(null===t.memoizedState){var Di=t.alternate;if(null!==Di){var Ei=Di.memoizedState;if(null!==Ei){var Fi=Ei.dehydrated;null!==Fi&&Lc(Fi)}}}break;case 19:case 17:case 20:case 21:break;default:throw Error(u(163))}}if(128&Dh){t=void 0;var xd=Y.ref;if(null!==xd){var Gi=Y.stateNode;switch(Y.tag){case 5:t=Gi;break;default:t=Gi}"function"==typeof xd?xd(t):xd.current=t}}Y=Y.nextEffect}}catch(Db){if(null===Y)throw Error(u(330));Ri(Y,Db),Y=Y.nextEffect}}while(null!==Y);Y=null,Yf(),T=f}else a.current=c;if(Dj)Dj=!1,Ej=a,Fj=b;else for(Y=e;null!==Y;)b=Y.nextEffect,Y.nextEffect=null,Y=b;if(0===(b=a.firstPendingTime)&&(jj=null),1073741823===b?a===Ij?Hj++:(Hj=0,Ij=a):Hj=0,"function"==typeof kk&&kk(c.stateNode,d),Z(a),gj)throw gj=!1,a=hj,hj=null,a;return 0!=(8&T)||jg(),null}function jk(){for(;null!==Y;){var a=Y.effectTag;0!=(256&a)&&Ti(Y.alternate,Y),0==(512&a)||Dj||(Dj=!0,gg(97,(function(){return Sj(),null}))),Y=Y.nextEffect}}function Sj(){if(90!==Fj){var a=97<Fj?97:Fj;return Fj=90,fg(a,lk)}}function lk(){if(null===Ej)return!1;var a=Ej;if(Ej=null,0!=(48&T))throw Error(u(331));var b=T;for(T|=32,a=a.current.firstEffect;null!==a;){try{var c=a;if(0!=(512&c.effectTag))switch(c.tag){case 0:case 11:case 15:Ui(128,0,c),Ui(0,64,c)}}catch(d){if(null===a)throw Error(u(330));Ri(a,d)}c=a.nextEffect,a.nextEffect=null,a=c}return T=b,jg(),!0}function mk(a,b,c){Dg(a,b=fj(a,b=Ni(c,b),1073741823)),null!==(a=Kj(a,1073741823))&&Z(a)}function Ri(a,b){if(3===a.tag)mk(a,a,b);else for(var c=a.return;null!==c;){if(3===c.tag){mk(c,a,b);break}if(1===c.tag){var d=c.stateNode;if("function"==typeof c.type.getDerivedStateFromError||"function"==typeof d.componentDidCatch&&(null===jj||!jj.has(d))){Dg(c,a=ij(c,a=Ni(b,a),1073741823)),null!==(c=Kj(c,1073741823))&&Z(c);break}}c=c.return}}function dk(a,b,c){var d=a.pingCache;null!==d&&d.delete(b),U===a&&W===c?4===X||3===X&&1073741823===xj&&cg()-bj<500?Tj(a,W):Bj=!0:Pj(a,c)&&(0!==(b=a.lastPingedTime)&&b<c||(a.lastPingedTime=c,a.finishedExpirationTime===c&&(a.finishedExpirationTime=0,a.finishedWork=null),Z(a)))}function dj(a,b){var c=a.stateNode;null!==c&&c.delete(b),0===(b=0)&&(b=Qg(b=Pg(),a,null)),null!==(a=Kj(a,b))&&Z(a)}gk=function(a,b,c){var d=b.expirationTime;if(null!==a){var e=b.pendingProps;if(a.memoizedProps!==e||K.current)wg=!0;else{if(d<c){switch(wg=!1,b.tag){case 3:wi(b),li();break;case 5:if(oh(b),4&b.mode&&1!==c&&e.hidden)return b.expirationTime=b.childExpirationTime=1,null;break;case 1:L(b.type)&&Jf(b);break;case 4:mh(b,b.stateNode.containerInfo);break;case 10:sg(b,b.memoizedProps.value);break;case 13:if(null!==b.memoizedState)return 0!==(d=b.child.childExpirationTime)&&d>=c?yi(a,b,c):(I(M,1&M.current),null!==(b=oi(a,b,c))?b.sibling:null);I(M,1&M.current);break;case 19:if(d=b.childExpirationTime>=c,0!=(64&a.effectTag)){if(d)return Bi(a,b,c);b.effectTag|=64}if(null!==(e=b.memoizedState)&&(e.rendering=null,e.tail=null),I(M,M.current),!d)return null}return oi(a,b,c)}wg=!1}}else wg=!1;switch(b.expirationTime=0,b.tag){case 2:if(d=b.type,null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),a=b.pendingProps,e=Ef(b,J.current),vg(b,c),e=Ih(null,b,d,a,e,c),b.effectTag|=1,"object"==typeof e&&null!==e&&"function"==typeof e.render&&void 0===e.$$typeof){if(b.tag=1,Mh(),L(d)){var f=!0;Jf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"==typeof g&&Og(b,d,g,a),e.updater=Sg,b.stateNode=e,e._reactInternalFiber=b,Wg(b,d,a,c),b=vi(null,b,d,!0,f,c)}else b.tag=0,R(null,b,e,c),b=b.child;return b;case 16:if(e=b.elementType,null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),a=b.pendingProps,function Va(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b(),a._result=b,b.then((function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)}),(function(b){0===a._status&&(a._status=2,a._result=b)}))}}(e),1!==e._status)throw e._result;switch(e=e._result,b.type=e,f=b.tag=function nk(a){if("function"==typeof a)return qi(a)?1:0;if(null!=a){if((a=a.$$typeof)===Oa)return 11;if(a===Ra)return 14}return 2}(e),a=mg(e,a),f){case 0:b=si(null,b,e,a,c);break;case 1:b=ui(null,b,e,a,c);break;case 11:b=ni(null,b,e,a,c);break;case 14:b=pi(null,b,e,mg(e.type,a),d,c);break;default:throw Error(u(306,e,""))}return b;case 0:return d=b.type,e=b.pendingProps,si(a,b,d,e=b.elementType===d?e:mg(d,e),c);case 1:return d=b.type,e=b.pendingProps,ui(a,b,d,e=b.elementType===d?e:mg(d,e),c);case 3:if(wi(b),null===(d=b.updateQueue))throw Error(u(282));if(e=null!==(e=b.memoizedState)?e.element:null,Hg(b,d,b.pendingProps,null,c),(d=b.memoizedState.element)===e)li(),b=oi(a,b,c);else{if((e=b.stateNode.hydrate)&&(di=re(b.stateNode.containerInfo.firstChild),ci=b,e=ei=!0),e)for(c=gh(b,null,d,c),b.child=c;c;)c.effectTag=-3&c.effectTag|1024,c=c.sibling;else R(a,b,d,c),li();b=b.child}return b;case 5:return oh(b),null===a&&ii(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,oe(d,e)?g=null:null!==f&&oe(d,f)&&(b.effectTag|=16),ti(a,b),4&b.mode&&1!==c&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(R(a,b,g,c),b=b.child),b;case 6:return null===a&&ii(b),null;case 13:return yi(a,b,c);case 4:return mh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=fh(b,null,d,c):R(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,ni(a,b,d,e=b.elementType===d?e:mg(d,e),c);case 7:return R(a,b,b.pendingProps,c),b.child;case 8:case 12:return R(a,b,b.pendingProps.children,c),b.child;case 10:a:{if(d=b.type._context,e=b.pendingProps,g=b.memoizedProps,sg(b,f=e.value),null!==g){var h=g.value;if(0===(f=of(h,f)?0:0|("function"==typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823))){if(g.children===e.children&&!K.current){b=oi(a,b,c);break a}}else for(null!==(h=b.child)&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==k){g=h.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!=(l.observedBits&f)){1===h.tag&&((l=Bg(c,null)).tag=2,Dg(h,l)),h.expirationTime<c&&(h.expirationTime=c),null!==(l=h.alternate)&&l.expirationTime<c&&(l.expirationTime=c),ug(h.return,c),k.expirationTime<c&&(k.expirationTime=c);break}l=l.next}}else g=10===h.tag&&h.type===b.type?null:h.child;if(null!==g)g.return=h;else for(g=h;null!==g;){if(g===b){g=null;break}if(null!==(h=g.sibling)){h.return=g.return,g=h;break}g=g.return}h=g}}R(a,b,e.children,c),b=b.child}return b;case 9:return e=b.type,d=(f=b.pendingProps).children,vg(b,c),d=d(e=xg(e,f.unstable_observedBits)),b.effectTag|=1,R(a,b,d,c),b.child;case 14:return f=mg(e=b.type,b.pendingProps),pi(a,b,e,f=mg(e.type,f),d,c);case 15:return ri(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:mg(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),b.tag=1,L(d)?(a=!0,Jf(b)):a=!1,vg(b,c),Ug(b,d,e),Wg(b,d,e,c),vi(null,b,d,!0,a,c);case 19:return Bi(a,b,c)}throw Error(u(156,b.tag))};var kk=null,Wi=null;function pk(a,b,c,d){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=b,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function gi(a,b,c,d){return new pk(a,b,c,d)}function qi(a){return!(!(a=a.prototype)||!a.isReactComponent)}function ah(a,b){var c=a.alternate;return null===c?((c=gi(a.tag,b,a.key,a.mode)).elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null),c.childExpirationTime=a.childExpirationTime,c.expirationTime=a.expirationTime,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,b=a.dependencies,c.dependencies=null===b?null:{expirationTime:b.expirationTime,firstContext:b.firstContext,responders:b.responders},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c}function ch(a,b,c,d,e,f){var g=2;if(d=a,"function"==typeof a)qi(a)&&(g=1);else if("string"==typeof a)g=5;else a:switch(a){case Ia:return eh(c.children,e,f,b);case Na:g=8,e|=7;break;case Ja:g=8,e|=1;break;case Ka:return(a=gi(12,c,b,8|e)).elementType=Ka,a.type=Ka,a.expirationTime=f,a;case Pa:return(a=gi(13,c,b,e)).type=Pa,a.elementType=Pa,a.expirationTime=f,a;case Qa:return(a=gi(19,c,b,e)).elementType=Qa,a.expirationTime=f,a;default:if("object"==typeof a&&null!==a)switch(a.$$typeof){case La:g=10;break a;case Ma:g=9;break a;case Oa:g=11;break a;case Ra:g=14;break a;case Sa:g=16,d=null;break a}throw Error(u(130,null==a?a:typeof a,""))}return(b=gi(g,c,b,e)).elementType=a,b.type=d,b.expirationTime=f,b}function eh(a,b,c,d){return(a=gi(7,a,d,b)).expirationTime=c,a}function bh(a,b,c){return(a=gi(6,a,null,b)).expirationTime=c,a}function dh(a,b,c){return(b=gi(4,null!==a.children?a.children:[],a.key,b)).expirationTime=c,b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},b}function qk(a,b,c){this.tag=b,this.current=null,this.containerInfo=a,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=c,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Pj(a,b){var c=a.firstSuspendedTime;return a=a.lastSuspendedTime,0!==c&&c>=b&&a<=b}function Mj(a,b){var c=a.firstSuspendedTime,d=a.lastSuspendedTime;c<b&&(a.firstSuspendedTime=b),(d>b||0===c)&&(a.lastSuspendedTime=b),b<=a.lastPingedTime&&(a.lastPingedTime=0),b<=a.lastExpiredTime&&(a.lastExpiredTime=0)}function Nj(a,b){b>a.firstPendingTime&&(a.firstPendingTime=b);var c=a.firstSuspendedTime;0!==c&&(b>=c?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:b>=a.lastSuspendedTime&&(a.lastSuspendedTime=b+1),b>a.nextKnownPendingLevel&&(a.nextKnownPendingLevel=b))}function Rj(a,b){var c=a.lastExpiredTime;(0===c||c>b)&&(a.lastExpiredTime=b)}function rk(a,b,c,d){var e=b.current,f=Pg(),g=Mg.suspense;f=Qg(f,e,g);a:if(c){b:{if(ec(c=c._reactInternalFiber)!==c||1!==c.tag)throw Error(u(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(L(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return}while(null!==h);throw Error(u(171))}if(1===c.tag){var k=c.type;if(L(k)){c=If(c,k,h);break a}}c=h}else c=Cf;return null===b.context?b.context=c:b.pendingContext=c,(b=Bg(f,g)).payload={element:a},null!==(d=void 0===d?null:d)&&(b.callback=d),Dg(e,b),Rg(e,f),f}function sk(a){if(!(a=a.current).child)return null;switch(a.child.tag){case 5:default:return a.child.stateNode}}function tk(a,b){null!==(a=a.memoizedState)&&null!==a.dehydrated&&a.retryTime<b&&(a.retryTime=b)}function uk(a,b){tk(a,b),(a=a.alternate)&&tk(a,b)}function vk(a,b,c){var d=new qk(a,b,c=null!=c&&!0===c.hydrate),e=gi(3,null,null,2===b?7:1===b?3:0);d.current=e,e.stateNode=d,a[we]=d.current,c&&0!==b&&function wc(a){var b=xc(a);uc.forEach((function(c){yc(c,a,b)})),vc.forEach((function(c){yc(c,a,b)}))}(9===a.nodeType?a:a.ownerDocument),this._internalRoot=d}function wk(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function zk(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if("function"==typeof e){var h=e;e=function(){var a=sk(g);h.call(a)}}rk(b,g,a,e)}else{if(f=c._reactRootContainer=function yk(a,b){if(b||(b=!(!(b=a?9===a.nodeType?a.documentElement:a.firstChild:null)||1!==b.nodeType||!b.hasAttribute("data-reactroot"))),!b)for(var c;c=a.lastChild;)a.removeChild(c);return new vk(a,0,b?{hydrate:!0}:void 0)}(c,d),g=f._internalRoot,"function"==typeof e){var k=e;e=function(){var a=sk(g);k.call(a)}}ck((function(){rk(b,g,a,e)}))}return sk(g)}function Ak(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Ha,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}function Bk(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!wk(b))throw Error(u(200));return Ak(a,b,null,c)}vk.prototype.render=function(a,b){rk(a,this._internalRoot,null,void 0===b?null:b)},vk.prototype.unmount=function(a){var b=this._internalRoot,c=void 0===a?null:a,d=b.containerInfo;rk(null,b,null,(function(){d[we]=null,null!==c&&c()}))},jc=function(a){if(13===a.tag){var b=lg(Pg(),150,100);Rg(a,b),uk(a,b)}},kc=function(a){if(13===a.tag){Pg();var b=kg++;Rg(a,b),uk(a,b)}},lc=function(a){if(13===a.tag){var b=Pg();Rg(a,b=Qg(b,a,null)),uk(a,b)}},Za=function(a,b,c){switch(b){case"input":if(Eb(a,c),b=c.name,"radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]'),b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=ye(d);if(!e)throw Error(u(90));zb(d),Eb(d,e)}}}break;case"textarea":Mb(a,c);break;case"select":null!=(b=c.value)&&Jb(a,!!c.multiple,b,!1)}},eb=bk,fb=function(a,b,c,d){var e=T;T|=4;try{return fg(98,a.bind(null,b,c,d))}finally{0===(T=e)&&jg()}},gb=function(){0==(49&T)&&(function ak(){if(null!==Gj){var a=Gj;Gj=null,a.forEach((function(a,c){Rj(c,a),Z(c)})),jg()}}(),Sj())},hb=function(a,b){var c=T;T|=2;try{return a(b)}finally{0===(T=c)&&jg()}};var a,b,Ck={createPortal:Bk,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;if(void 0===b){if("function"==typeof a.render)throw Error(u(188));throw Error(u(268,Object.keys(a)))}return a=null===(a=ic(b))?null:a.stateNode},hydrate:function(a,b,c){if(!wk(b))throw Error(u(200));return zk(null,a,b,!0,c)},render:function(a,b,c){if(!wk(b))throw Error(u(200));return zk(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){if(!wk(c))throw Error(u(200));if(null==a||void 0===a._reactInternalFiber)throw Error(u(38));return zk(a,b,c,!1,d)},unmountComponentAtNode:function(a){if(!wk(a))throw Error(u(40));return!!a._reactRootContainer&&(ck((function(){zk(null,null,a,!1,(function(){a._reactRootContainer=null,a[we]=null}))})),!0)},unstable_createPortal:function(){return Bk.apply(void 0,arguments)},unstable_batchedUpdates:bk,flushSync:function(a,b){if(0!=(48&T))throw Error(u(187));var c=T;T|=1;try{return fg(99,a.bind(null,b))}finally{T=c,jg()}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Cc,xe,ye,Ca.injectEventPluginsByName,fa,Sc,function(a){ya(a,Rc)},cb,db,Pd,Ba,Sj,{current:!1}]}};b=(a={findFiberByHostInstance:Fc,bundleType:0,version:"16.12.0",rendererPackageName:"react-dom"}).findFiberByHostInstance,function ok(a){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);kk=function(a){try{b.onCommitFiberRoot(c,a,void 0,64==(64&a.current.effectTag))}catch(e){}},Wi=function(a){try{b.onCommitFiberUnmount(c,a)}catch(e){}}}catch(d){}return!0}(n({},a,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ea.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return null===(a=ic(a))?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}));var Dk={default:Ck},Ek=Dk&&Ck||Dk;module.exports=Ek.default||Ek},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(621)},function(module,exports,__webpack_require__){"use strict";var f,g,h,k,l;if(Object.defineProperty(exports,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var p=null,q=null,t=function(){if(null!==p)try{var a=exports.unstable_now();p(!0,a),p=null}catch(b){throw setTimeout(t,0),b}},u=Date.now();exports.unstable_now=function(){return Date.now()-u},f=function(a){null!==p?setTimeout(f,0,a):(p=a,setTimeout(t,0))},g=function(a,b){q=setTimeout(a,b)},h=function(){clearTimeout(q)},k=function(){return!1},l=exports.unstable_forceFrameRate=function(){}}else{var w=window.performance,x=window.Date,y=window.setTimeout,z=window.clearTimeout;if("undefined"!=typeof console){var A=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof A&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof w&&"function"==typeof w.now)exports.unstable_now=function(){return w.now()};else{var B=x.now();exports.unstable_now=function(){return x.now()-B}}var C=!1,D=null,E=-1,F=5,G=0;k=function(){return exports.unstable_now()>=G},l=function(){},exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):F=0<a?Math.floor(1e3/a):5};var H=new MessageChannel,I=H.port2;H.port1.onmessage=function(){if(null!==D){var a=exports.unstable_now();G=a+F;try{D(!0,a)?I.postMessage(null):(C=!1,D=null)}catch(b){throw I.postMessage(null),b}}else C=!1},f=function(a){D=a,C||(C=!0,I.postMessage(null))},g=function(a,b){E=y((function(){a(exports.unstable_now())}),b)},h=function(){z(E),E=-1}}function J(a,b){var c=a.length;a.push(b);a:for(;;){var d=Math.floor((c-1)/2),e=a[d];if(!(void 0!==e&&0<K(e,b)))break a;a[d]=b,a[c]=e,c=d}}function L(a){return void 0===(a=a[0])?null:a}function M(a){var b=a[0];if(void 0!==b){var c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length;d<e;){var m=2*(d+1)-1,n=a[m],v=m+1,r=a[v];if(void 0!==n&&0>K(n,c))void 0!==r&&0>K(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else{if(!(void 0!==r&&0>K(r,c)))break a;a[d]=r,a[v]=c,d=v}}}return b}return null}function K(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var N=[],O=[],P=1,Q=null,R=3,S=!1,T=!1,U=!1;function V(a){for(var b=L(O);null!==b;){if(null===b.callback)M(O);else{if(!(b.startTime<=a))break;M(O),b.sortIndex=b.expirationTime,J(N,b)}b=L(O)}}function W(a){if(U=!1,V(a),!T)if(null!==L(N))T=!0,f(X);else{var b=L(O);null!==b&&g(W,b.startTime-a)}}function X(a,b){T=!1,U&&(U=!1,h()),S=!0;var c=R;try{for(V(b),Q=L(N);null!==Q&&(!(Q.expirationTime>b)||a&&!k());){var d=Q.callback;if(null!==d){Q.callback=null,R=Q.priorityLevel;var e=d(Q.expirationTime<=b);b=exports.unstable_now(),"function"==typeof e?Q.callback=e:Q===L(N)&&M(N),V(b)}else M(N);Q=L(N)}if(null!==Q)var m=!0;else{var n=L(O);null!==n&&g(W,n.startTime-b),m=!1}return m}finally{Q=null,R=c,S=!1}}function Y(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var Z=l;exports.unstable_ImmediatePriority=1,exports.unstable_UserBlockingPriority=2,exports.unstable_NormalPriority=3,exports.unstable_IdlePriority=5,exports.unstable_LowPriority=4,exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=R;R=a;try{return b()}finally{R=c}},exports.unstable_next=function(a){switch(R){case 1:case 2:case 3:var b=3;break;default:b=R}var c=R;R=b;try{return a()}finally{R=c}},exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if("object"==typeof c&&null!==c){var e=c.delay;e="number"==typeof e&&0<e?d+e:d,c="number"==typeof c.timeout?c.timeout:Y(a)}else c=Y(a),e=d;return a={id:P++,callback:b,priorityLevel:a,startTime:e,expirationTime:c=e+c,sortIndex:-1},e>d?(a.sortIndex=e,J(O,a),null===L(N)&&a===L(O)&&(U?h():U=!0,g(W,e-d))):(a.sortIndex=c,J(N,a),T||S||(T=!0,f(X))),a},exports.unstable_cancelCallback=function(a){a.callback=null},exports.unstable_wrapCallback=function(a){var b=R;return function(){var c=R;R=b;try{return a.apply(this,arguments)}finally{R=c}}},exports.unstable_getCurrentPriorityLevel=function(){return R},exports.unstable_shouldYield=function(){var a=exports.unstable_now();V(a);var b=L(N);return b!==Q&&null!==Q&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTime<Q.expirationTime||k()},exports.unstable_requestPaint=Z,exports.unstable_continueExecution=function(){T||S||(T=!0,f(X))},exports.unstable_pauseExecution=function(){},exports.unstable_getFirstCallbackNode=function(){return L(N)},exports.unstable_Profiling=null},function(module,exports,__webpack_require__){"use strict";function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var entities=__webpack_require__(623),defaults={fg:"#FFF",bg:"#000",newline:!1,escapeXML:!1,stream:!1,colors:function getDefaultColors(){var colors={0:"#000",1:"#A00",2:"#0A0",3:"#A50",4:"#00A",5:"#A0A",6:"#0AA",7:"#AAA",8:"#555",9:"#F55",10:"#5F5",11:"#FF5",12:"#55F",13:"#F5F",14:"#5FF",15:"#FFF"};return range(0,5).forEach((function(red){range(0,5).forEach((function(green){range(0,5).forEach((function(blue){return function setStyleColor(red,green,blue,colors){var r=red>0?40*red+55:0,g=green>0?40*green+55:0,b=blue>0?40*blue+55:0;colors[16+36*red+6*green+blue]=function toColorHexString(ref){var results=[],_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=ref[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var r=_step.value;results.push(toHexString(r))}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return"#"+results.join("")}([r,g,b])}(red,green,blue,colors)}))}))})),range(0,23).forEach((function(gray){var c=gray+232,l=toHexString(10*gray+8);colors[c]="#"+l+l+l})),colors}()};function toHexString(num){for(var str=num.toString(16);str.length<2;)str="0"+str;return str}function generateOutput(stack,token,data,options){var result;return"text"===token?result=function pushText(text,options){if(options.escapeXML)return entities.encodeXML(text);return text}(data,options):"display"===token?result=function handleDisplay(stack,code,options){code=parseInt(code,10);var result,codeMap={"-1":function _(){return"<br/>"},0:function _(){return stack.length&&resetStyles(stack)},1:function _(){return pushTag(stack,"b")},3:function _(){return pushTag(stack,"i")},4:function _(){return pushTag(stack,"u")},8:function _(){return pushStyle(stack,"display:none")},9:function _(){return pushTag(stack,"strike")},22:function _(){return pushStyle(stack,"font-weight:normal;text-decoration:none;font-style:normal")},23:function _(){return closeTag(stack,"i")},24:function _(){return closeTag(stack,"u")},39:function _(){return pushForegroundColor(stack,options.fg)},49:function _(){return pushBackgroundColor(stack,options.bg)},53:function _(){return pushStyle(stack,"text-decoration:overline")}};codeMap[code]?result=codeMap[code]():4<code&&code<7?result=pushTag(stack,"blink"):29<code&&code<38?result=pushForegroundColor(stack,options.colors[code-30]):39<code&&code<48?result=pushBackgroundColor(stack,options.colors[code-40]):89<code&&code<98?result=pushForegroundColor(stack,options.colors[code-90+8]):99<code&&code<108&&(result=pushBackgroundColor(stack,options.colors[code-100+8]));return result}(stack,data,options):"xterm256"===token?result=pushForegroundColor(stack,options.colors[data]):"rgb"===token&&(result=function handleRgb(stack,data){var operation=+(data=data.substring(2).slice(0,-1)).substr(0,2),rgb=data.substring(5).split(";").map((function(value){return("0"+Number(value).toString(16)).substr(-2)})).join("");return pushStyle(stack,(38===operation?"color:#":"background-color:#")+rgb)}(stack,data)),result}function resetStyles(stack){var stackClone=stack.slice(0);return stack.length=0,stackClone.reverse().map((function(tag){return"</"+tag+">"})).join("")}function range(low,high){for(var results=[],j=low;j<=high;j++)results.push(j);return results}function categoryForCode(code){var result=null;return 0===(code=parseInt(code,10))?result="all":1===code?result="bold":2<code&&code<5?result="underline":4<code&&code<7?result="blink":8===code?result="hide":9===code?result="strike":29<code&&code<38||39===code||89<code&&code<98?result="foreground-color":(39<code&&code<48||49===code||99<code&&code<108)&&(result="background-color"),result}function pushTag(stack,tag,style){return style||(style=""),stack.push(tag),["<"+tag,style?' style="'+style+'"':void 0,">"].join("")}function pushStyle(stack,style){return pushTag(stack,"span",style)}function pushForegroundColor(stack,color){return pushTag(stack,"span","color:"+color)}function pushBackgroundColor(stack,color){return pushTag(stack,"span","background-color:"+color)}function closeTag(stack,style){var last;if(stack.slice(-1)[0]===style&&(last=stack.pop()),last)return"</"+style+">"}var Filter=function(){function Filter(options){!function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Filter),(options=options||{}).colors&&(options.colors=Object.assign({},defaults.colors,options.colors)),this.options=Object.assign({},defaults,options),this.stack=[],this.stickyStack=[]}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(Filter,[{key:"toHtml",value:function toHtml(input){var _this=this;input="string"==typeof input?[input]:input;var stack=this.stack,options=this.options,buf=[];return this.stickyStack.forEach((function(element){var output=generateOutput(stack,element.token,element.data,options);output&&buf.push(output)})),function tokenize(text,options,callback){var ansiMatch=!1;function remove(){return""}function newline(m){return options.newline?callback("display",-1):callback("text",m),""}var tokens=[{pattern:/^\x08+/,sub:remove},{pattern:/^\x1b\[[012]?K/,sub:remove},{pattern:/^\x1b\[\(B/,sub:remove},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:function rgb(m){return callback("rgb",m),""}},{pattern:/^\x1b\[38;5;(\d+)m/,sub:function removeXterm256(m,g1){return callback("xterm256",g1),""}},{pattern:/^\n/,sub:newline},{pattern:/^\r+\n/,sub:newline},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:function ansiMess(m,g1){ansiMatch=!0,0===g1.trim().length&&(g1="0"),g1=g1.trimRight(";").split(";");var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=g1[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){var g=_step2.value;callback("display",g)}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}return""}},{pattern:/^\x1b\[\d?J/,sub:remove},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:remove},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:remove},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:function realText(m){return callback("text",m),""}}];function process(handler,i){i>3&&ansiMatch||(ansiMatch=!1,text=text.replace(handler.pattern,handler.sub))}var results1=[],length=text.length;outer:for(;length>0;){for(var i=0,o=0,len=tokens.length;o<len;i=++o){if(process(tokens[i],i),text.length!==length){length=text.length;continue outer}}if(text.length===length)break;results1.push(0),length=text.length}return results1}(input.join(""),options,(function(token,data){var output=generateOutput(stack,token,data,options);output&&buf.push(output),options.stream&&(_this.stickyStack=function updateStickyStack(stickyStack,token,data){return"text"!==token&&(stickyStack=stickyStack.filter(function notCategory(category){return function(e){return(null===category||e.category!==category)&&"all"!==category}}(categoryForCode(data)))).push({token:token,data:data,category:categoryForCode(data)}),stickyStack}(_this.stickyStack,token,data))})),stack.length&&buf.push(resetStyles(stack)),buf.join("")}}]),Filter}();module.exports=Filter},function(module,exports,__webpack_require__){var encode=__webpack_require__(624),decode=__webpack_require__(625);exports.decode=function(data,level){return(!level||level<=0?decode.XML:decode.HTML)(data)},exports.decodeStrict=function(data,level){return(!level||level<=0?decode.XML:decode.HTMLStrict)(data)},exports.encode=function(data,level){return(!level||level<=0?encode.XML:encode.HTML)(data)},exports.encodeXML=encode.XML,exports.encodeHTML4=exports.encodeHTML5=exports.encodeHTML=encode.HTML,exports.decodeXML=exports.decodeXMLStrict=decode.XML,exports.decodeHTML4=exports.decodeHTML5=exports.decodeHTML=decode.HTML,exports.decodeHTML4Strict=exports.decodeHTML5Strict=exports.decodeHTMLStrict=decode.HTMLStrict,exports.escape=encode.escape},function(module,exports,__webpack_require__){var inverseXML=getInverseObj(__webpack_require__(270)),xmlReplacer=getInverseReplacer(inverseXML);exports.XML=getInverse(inverseXML,xmlReplacer);var inverseHTML=getInverseObj(__webpack_require__(271)),htmlReplacer=getInverseReplacer(inverseHTML);function getInverseObj(obj){return Object.keys(obj).sort().reduce((function(inverse,name){return inverse[obj[name]]="&"+name+";",inverse}),{})}function getInverseReplacer(inverse){var single=[],multiple=[];return Object.keys(inverse).forEach((function(k){1===k.length?single.push("\\"+k):multiple.push(k)})),multiple.unshift("["+single.join("")+"]"),new RegExp(multiple.join("|"),"g")}exports.HTML=getInverse(inverseHTML,htmlReplacer);var re_nonASCII=/[^\0-\x7F]/g,re_astralSymbols=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function singleCharReplacer(c){return"&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"}function astralReplacer(c){return"&#x"+(1024*(c.charCodeAt(0)-55296)+c.charCodeAt(1)-56320+65536).toString(16).toUpperCase()+";"}function getInverse(inverse,re){function func(name){return inverse[name]}return function(data){return data.replace(re,func).replace(re_astralSymbols,astralReplacer).replace(re_nonASCII,singleCharReplacer)}}var re_xmlChars=getInverseReplacer(inverseXML);exports.escape=function escapeXML(data){return data.replace(re_xmlChars,singleCharReplacer).replace(re_astralSymbols,astralReplacer).replace(re_nonASCII,singleCharReplacer)}},function(module,exports,__webpack_require__){var entityMap=__webpack_require__(271),legacyMap=__webpack_require__(626),xmlMap=__webpack_require__(270),decodeCodePoint=__webpack_require__(627),decodeXMLStrict=getStrictDecoder(xmlMap),decodeHTMLStrict=getStrictDecoder(entityMap);function getStrictDecoder(map){var keys=Object.keys(map).join("|"),replace=getReplacer(map),re=new RegExp("&(?:"+(keys+="|#[xX][\\da-fA-F]+|#\\d+")+");","g");return function(str){return String(str).replace(re,replace)}}var decodeHTML=function(){for(var legacy=Object.keys(legacyMap).sort(sorter),keys=Object.keys(entityMap).sort(sorter),i=0,j=0;i<keys.length;i++)legacy[j]===keys[i]?(keys[i]+=";?",j++):keys[i]+=";";var re=new RegExp("&(?:"+keys.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),replace=getReplacer(entityMap);function replacer(str){return";"!==str.substr(-1)&&(str+=";"),replace(str)}return function(str){return String(str).replace(re,replacer)}}();function sorter(a,b){return a<b?1:-1}function getReplacer(map){return function replace(str){return"#"===str.charAt(1)?"X"===str.charAt(2)||"x"===str.charAt(2)?decodeCodePoint(parseInt(str.substr(3),16)):decodeCodePoint(parseInt(str.substr(2),10)):map[str.slice(1,-1)]}}module.exports={XML:decodeXMLStrict,HTML:decodeHTML,HTMLStrict:decodeHTMLStrict}},function(module){module.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},function(module,exports,__webpack_require__){var decodeMap=__webpack_require__(628);module.exports=function decodeCodePoint(codePoint){if(codePoint>=55296&&codePoint<=57343||codePoint>1114111)return"�";codePoint in decodeMap&&(codePoint=decodeMap[codePoint]);var output="";codePoint>65535&&(codePoint-=65536,output+=String.fromCharCode(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint);return output+=String.fromCharCode(codePoint)}},function(module){module.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}')},function(module,exports,__webpack_require__){"use strict";__webpack_require__(29),__webpack_require__(46),__webpack_require__(47),__webpack_require__(27),__webpack_require__(48),__webpack_require__(86),__webpack_require__(65),__webpack_require__(30),__webpack_require__(66),__webpack_require__(235),__webpack_require__(630),__webpack_require__(633),__webpack_require__(67),__webpack_require__(23),__webpack_require__(104),__webpack_require__(68),__webpack_require__(50),__webpack_require__(49),__webpack_require__(37),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function createChannel(_ref2){var page=_ref2.page,transport=new PostmsgTransport({page:page});return new _channels.default({transport:transport})},exports.PostmsgTransport=exports.KEY=void 0;var _global=__webpack_require__(36),_channels=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(230)),_clientLogger=__webpack_require__(64),_telejson=__webpack_require__(635);function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}}(arr)||function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||"[object Arguments]"===Object.prototype.toString.call(iter))return Array.from(iter)}(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var KEY="storybook-channel";exports.KEY=KEY;var PostmsgTransport=function(){function PostmsgTransport(config){if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,PostmsgTransport),this.config=config,this.buffer=void 0,this.handler=void 0,this.connected=void 0,this.buffer=[],this.handler=null,_global.window.addEventListener("message",this.handleEvent.bind(this),!1),"manager"!==config.page&&"preview"!==config.page)throw new Error('postmsg-channel: "config.page" cannot be "'.concat(config.page,'"'))}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(PostmsgTransport,[{key:"setHandler",value:function setHandler(handler){var _this=this;this.handler=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];handler.apply(_this,args),!_this.connected&&_this.getWindow()&&(_this.flush(),_this.connected=!0)}}},{key:"send",value:function send(event,options){var _this2=this,iframeWindow=this.getWindow();if(!iframeWindow)return new Promise((function(resolve,reject){_this2.buffer.push({event:event,resolve:resolve,reject:reject})}));var depth=15,allowFunction=!0;options&&"boolean"==typeof options.allowFunction&&(allowFunction=options.allowFunction),options&&Number.isInteger(options.depth)&&(depth=options.depth);var data=(0,_telejson.stringify)({key:KEY,event:event},{maxDepth:depth,allowFunction:allowFunction});return iframeWindow.postMessage(data,"*"),Promise.resolve(null)}},{key:"flush",value:function flush(){var _this3=this,buffer=this.buffer;this.buffer=[],buffer.forEach((function(item){_this3.send(item.event).then(item.resolve).catch(item.reject)}))}},{key:"getWindow",value:function getWindow(){if("manager"===this.config.page){var iframe=_global.document.getElementById("storybook-preview-iframe");return iframe?iframe.contentWindow:null}return _global.window.parent}},{key:"handleEvent",value:function handleEvent(rawEvent){try{var data=rawEvent.data,_ref="string"==typeof data&&(0,_telejson.isJSON)(data)?(0,_telejson.parse)(data):data,key=_ref.key,event=_ref.event;key===KEY&&(_clientLogger.logger.debug.apply(_clientLogger.logger,["message arrived at ".concat(this.config.page),event.type].concat(_toConsumableArray(event.args))),this.handler(event))}catch(error){_clientLogger.logger.error(error)}}}]),PostmsgTransport}();exports.PostmsgTransport=PostmsgTransport},function(module,exports,__webpack_require__){"use strict";var DESCRIPTORS=__webpack_require__(13),global=__webpack_require__(3),isForced=__webpack_require__(100),redefine=__webpack_require__(21),has=__webpack_require__(14),classof=__webpack_require__(34),inheritIfRequired=__webpack_require__(237),toPrimitive=__webpack_require__(78),fails=__webpack_require__(5),create=__webpack_require__(61),getOwnPropertyNames=__webpack_require__(98).f,getOwnPropertyDescriptor=__webpack_require__(76).f,defineProperty=__webpack_require__(16).f,trim=__webpack_require__(631).trim,NativeNumber=global.Number,NumberPrototype=NativeNumber.prototype,BROKEN_CLASSOF="Number"==classof(create(NumberPrototype)),toNumber=function(argument){var first,third,radix,maxCode,digits,length,index,code,it=toPrimitive(argument,!1);if("string"==typeof it&&it.length>2)if(43===(first=(it=trim(it)).charCodeAt(0))||45===first){if(88===(third=it.charCodeAt(2))||120===third)return NaN}else if(48===first){switch(it.charCodeAt(1)){case 66:case 98:radix=2,maxCode=49;break;case 79:case 111:radix=8,maxCode=55;break;default:return+it}for(length=(digits=it.slice(2)).length,index=0;index<length;index++)if((code=digits.charCodeAt(index))<48||code>maxCode)return NaN;return parseInt(digits,radix)}return+it};if(isForced("Number",!NativeNumber(" 0o1")||!NativeNumber("0b1")||NativeNumber("+0x1"))){for(var key,NumberWrapper=function Number(value){var it=arguments.length<1?0:value,dummy=this;return dummy instanceof NumberWrapper&&(BROKEN_CLASSOF?fails((function(){NumberPrototype.valueOf.call(dummy)})):"Number"!=classof(dummy))?inheritIfRequired(new NativeNumber(toNumber(it)),dummy,NumberWrapper):toNumber(it)},keys=DESCRIPTORS?getOwnPropertyNames(NativeNumber):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),j=0;keys.length>j;j++)has(NativeNumber,key=keys[j])&&!has(NumberWrapper,key)&&defineProperty(NumberWrapper,key,getOwnPropertyDescriptor(NativeNumber,key));NumberWrapper.prototype=NumberPrototype,NumberPrototype.constructor=NumberWrapper,redefine(global,"Number",NumberWrapper)}},function(module,exports,__webpack_require__){var requireObjectCoercible=__webpack_require__(43),whitespace="["+__webpack_require__(632)+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod=function(TYPE){return function($this){var string=String(requireObjectCoercible($this));return 1&TYPE&&(string=string.replace(ltrim,"")),2&TYPE&&(string=string.replace(rtrim,"")),string}};module.exports={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}},function(module,exports){module.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(module,exports,__webpack_require__){__webpack_require__(2)({target:"Number",stat:!0},{isInteger:__webpack_require__(634)})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8),floor=Math.floor;module.exports=function isInteger(it){return!isObject(it)&&isFinite(it)&&floor(it)===it}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.parse=exports.stringify=exports.isJSON=exports.reviver=exports.replacer=void 0;var _isRegex=_interopRequireDefault(__webpack_require__(189)),_isFunction=_interopRequireDefault(__webpack_require__(636)),_isSymbol=_interopRequireDefault(__webpack_require__(180)),_isobject=_interopRequireDefault(__webpack_require__(637)),_get=_interopRequireDefault(__webpack_require__(259)),_memoizerific=_interopRequireDefault(__webpack_require__(265));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){_defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(arr,i){if(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}var isObject=_isobject.default,removeCodeComments=function removeCodeComments(code){var inQuoteChar=null,inBlockComment=!1,inLineComment=!1,inRegexLiteral=!1,newCode="";if(code.indexOf("//")>=0||code.indexOf("/*")>=0)for(var i=0;i<code.length;i+=1)inQuoteChar||inBlockComment||inLineComment||inRegexLiteral?(inQuoteChar&&(code[i]===inQuoteChar&&"\\"!==code[i-1]||"\n"===code[i]&&"`"!==inQuoteChar)&&(inQuoteChar=null),inRegexLiteral&&("/"===code[i]&&"\\"!==code[i-1]||"\n"===code[i])&&(inRegexLiteral=!1),inBlockComment&&"/"===code[i-1]&&"*"===code[i-2]&&(inBlockComment=!1),inLineComment&&"\n"===code[i]&&(inLineComment=!1)):'"'===code[i]||"'"===code[i]||"`"===code[i]?inQuoteChar=code[i]:"/"===code[i]&&"*"===code[i+1]?inBlockComment=!0:"/"===code[i]&&"/"===code[i+1]?inLineComment=!0:"/"===code[i]&&"/"!==code[i+1]&&(inRegexLiteral=!0),inBlockComment||inLineComment||(newCode+=code[i]);else newCode=code;return newCode},cleanCode=(0,_memoizerific.default)(1e4)((function(code){return removeCodeComments(code).replace(/\n\s*/g,"").trim()})),convertShorthandMethods=function convertShorthandMethods(key,stringified){var fnHead=stringified.slice(0,stringified.indexOf("{")),fnBody=stringified.slice(stringified.indexOf("{"));if(fnHead.includes("=>"))return stringified;if(fnHead.includes("function"))return stringified;var modifiedHead=fnHead;return(modifiedHead=modifiedHead.replace(key,"function"))+fnBody},dateFormat=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/,replacer=function replacer(options){var objects,stack,keys;return function replace(key,value){try{if(""===key)return keys=["root"],objects=[{keys:"root",value:value}],stack=[],value;for(;stack.length&&this!==stack[0];)stack.shift(),keys.pop();if((0,_isRegex.default)(value)){if(!options.allowRegExp)return;return"_regexp_".concat(value.flags,"|").concat(value.source)}if((0,_isFunction.default)(value)){if(!options.allowFunction)return;var name=value.name,stringified=value.toString();return stringified.match(/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/)?"_function_".concat(name,"|").concat(function(){}.toString()):"_function_".concat(name,"|").concat(cleanCode(convertShorthandMethods(key,stringified)))}if((0,_isSymbol.default)(value)){if(!options.allowSymbol)return;return"_symbol_".concat(value.toString().slice(7,-1))}if("string"==typeof value&&dateFormat.test(value)){if(!options.allowDate)return;return"_date_".concat(value)}if(void 0===value){if(!options.allowUndefined)return;return"_undefined_"}if("number"==typeof value)return value===-1/0?"_-Infinity_":value===1/0?"_Infinity_":Number.isNaN(value)?"_NaN_":value;if("string"==typeof value)return value;if("boolean"==typeof value)return value;if(stack.length>=options.maxDepth)return Array.isArray(value)?"[Array(".concat(value.length,")]"):"[Object]";var found=objects.find((function(o){return o.value===value}));if(!found){if(value&&isObject(value)&&value.constructor&&value.constructor.name&&"Object"!==value.constructor.name){if(!options.allowClass)return;try{Object.assign(value,{"_constructor-name_":value.constructor.name})}catch(e){}}return keys.push(key),stack.unshift(value),objects.push({keys:keys.join("."),value:value}),value}return"_duplicate_".concat(found.keys)}catch(e){return}}};exports.replacer=replacer;var reviver=function reviver(options){var refs=[],root;return function revive(key,value){if(""===key&&(root=value,refs.forEach((function(_ref){var target=_ref.target,container=_ref.container,replacement=_ref.replacement;container[target]="root"===replacement?root:(0,_get.default)(root,replacement.replace("root.",""))}))),"_constructor-name_"===key)return value;if(isObject(value)&&value["_constructor-name_"]){var name=value["_constructor-name_"];if("Object"!==name){var Fn=new Function("return function ".concat(name,"(){}"))();Object.setPrototypeOf(value,new Fn)}return delete value["_constructor-name_"],value}if("string"==typeof value&&value.startsWith("_function_")){var _ref2=value.match(/_function_([^|]*)\|(.*)/)||[],_ref3=_slicedToArray(_ref2,3),_name=_ref3[1],source=_ref3[2];if(!options.lazyEval)return eval("(".concat(source,")"));var result=function result(){var f=eval("(".concat(source,")"));return f.apply(void 0,arguments)};return Object.defineProperty(result,"toString",{value:function value(){return source}}),Object.defineProperty(result,"name",{value:_name}),result}if("string"==typeof value&&value.startsWith("_regexp_")){var _ref4=value.match(/_regexp_([^|]*)\|(.*)/)||[],_ref5=_slicedToArray(_ref4,3),flags=_ref5[1],_source=_ref5[2];return new RegExp(_source,flags)}return"string"==typeof value&&value.startsWith("_date_")?new Date(value.replace("_date_","")):"string"==typeof value&&value.startsWith("_duplicate_")?(refs.push({target:key,container:this,replacement:value.replace("_duplicate_","")}),null):"string"==typeof value&&value.startsWith("_symbol_")?Symbol(value.replace("_symbol_","")):"string"==typeof value&&"_-Infinity_"===value?-1/0:"string"==typeof value&&"_Infinity_"===value?1/0:"string"==typeof value&&"_NaN_"===value?NaN:value}};exports.reviver=reviver;var isJSON=function isJSON(input){return input.match(/^[\[\{\"\}].*[\]\}\"]$/)};exports.isJSON=isJSON;var defaultOptions={maxDepth:10,space:void 0,allowFunction:!0,allowRegExp:!0,allowDate:!0,allowClass:!0,allowUndefined:!0,allowSymbol:!0,lazyEval:!0},stringify=function stringify(data){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},mergedOptions=_objectSpread({},defaultOptions,{},options);return JSON.stringify(data,replacer(mergedOptions),options.space)};exports.stringify=stringify;var mutator=function mutator(){var mutated=[];return function mutateUndefined(value){isObject(value)&&Object.entries(value).forEach((function(_ref6){var _ref7=_slicedToArray(_ref6,2),k=_ref7[0],v=_ref7[1];"_undefined_"===v?value[k]=void 0:mutated.includes(v)||(mutated.push(v),mutateUndefined(v))})),Array.isArray(value)&&value.forEach((function(v){mutated.push(v),mutateUndefined(v)}))}},parse=function parse(data){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},mergedOptions=_objectSpread({},defaultOptions,{},options),result=JSON.parse(data,reviver(mergedOptions));return mutator()(result),result};exports.parse=parse},function(module,exports){module.exports=function isFunction(fn){var string=toString.call(fn);return"[object Function]"===string||"function"==typeof fn&&"[object RegExp]"!==string||"undefined"!=typeof window&&(fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt)};var toString=Object.prototype.toString},function(module,__webpack_exports__,__webpack_require__){"use strict";function isObject(val){return null!=val&&"object"==typeof val&&!1===Array.isArray(val)}__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"default",(function(){return isObject}))},function(module,exports,__webpack_require__){"use strict";__webpack_require__(29),__webpack_require__(27),__webpack_require__(147),__webpack_require__(63),__webpack_require__(55),__webpack_require__(69),__webpack_require__(157),__webpack_require__(266),Object.defineProperty(exports,"__esModule",{value:!0}),exports.pathToId=pathToId,exports.initializePath=exports.parseQueryParameters=exports.getIdFromLegacyQuery=exports.setPath=void 0;var _global=__webpack_require__(36),_qs=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(267)),_csf=__webpack_require__(109);function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],excluded.indexOf(key)>=0||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function pathToId(path){var match=(path||"").match(/^\/story\/(.+)/);if(!match)throw new Error("Invalid path '".concat(path,"', must start with '/story/'"));return match[1]}var setPath=function setPath(_ref){var storyId=_ref.storyId,viewMode=_ref.viewMode,_qs$parse=_qs.default.parse(_global.document.location.search,{ignoreQueryPrefix:!0}),rest=(_qs$parse.path,_qs$parse.selectedKind,_qs$parse.selectedStory,_objectWithoutProperties(_qs$parse,["path","selectedKind","selectedStory"])),newPath="".concat(_global.document.location.pathname,"?").concat(_qs.default.stringify(Object.assign({},rest,{id:storyId,viewMode:viewMode})));_global.history.replaceState({},"",newPath)};exports.setPath=setPath;var getIdFromLegacyQuery=function getIdFromLegacyQuery(_ref2){var path=_ref2.path,selectedKind=_ref2.selectedKind,selectedStory=_ref2.selectedStory;return path&&pathToId(path)||selectedKind&&selectedStory&&(0,_csf.toId)(selectedKind,selectedStory)};exports.getIdFromLegacyQuery=getIdFromLegacyQuery;exports.parseQueryParameters=function parseQueryParameters(search){return _qs.default.parse(search,{ignoreQueryPrefix:!0}).id};exports.initializePath=function initializePath(){var query=_qs.default.parse(_global.document.location.search,{ignoreQueryPrefix:!0}),storyId=query.id,viewMode=query.viewMode;return storyId||(storyId=getIdFromLegacyQuery(query))&&setPath({storyId:storyId,viewMode:viewMode}),{storyId:storyId,viewMode:viewMode}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NoDocs=void 0;var _react=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(0));var _ref=_react.default.createElement("div",{style:{fontSize:"14px",letterSpacing:"0.2px",margin:"10px 0"},className:"sb-nodocs sb-wrapper"},_react.default.createElement("div",{style:{margin:"auto",padding:30,borderRadius:10,background:"rgba(0,0,0,0.03)"}},_react.default.createElement("h1",{style:{textAlign:"center"}},"No Docs"),_react.default.createElement("p",null,"Sorry, but there are no docs for the selected story. To add them, set the story's ",_react.default.createElement("code",null,"docs")," parameter. If you think this is an error:"),_react.default.createElement("ul",null,_react.default.createElement("li",null,"Please check the story definition."),_react.default.createElement("li",null,"Please check the Storybook config."),_react.default.createElement("li",null,"Try reloading the page.")),_react.default.createElement("p",null,"If the problem persists, check the browser console, or the terminal you've run Storybook from."))),NoDocs=function NoDocs(){return _ref};exports.NoDocs=NoDocs,NoDocs.displayName="NoDocs"},function(module,exports,__webpack_require__){"use strict";var _global=__webpack_require__(36);_global.window&&(_global.window.STORYBOOK_ENV="react")},function(module,exports,__webpack_require__){"use strict";__webpack_require__(29),__webpack_require__(46),__webpack_require__(47),__webpack_require__(27),__webpack_require__(30),__webpack_require__(262),__webpack_require__(67),__webpack_require__(155),__webpack_require__(263),__webpack_require__(23),__webpack_require__(104),__webpack_require__(50),__webpack_require__(37),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function renderMain(_x){return _renderMain.apply(this,arguments)},__webpack_require__(118);var _global=__webpack_require__(36),_react=function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache();if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(__webpack_require__(0)),_reactDom=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(90));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var cache=new WeakMap;return _getRequireWildcardCache=function(){return cache},cache}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(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||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _possibleConstructorReturn(self,call){return!call||"object"!==_typeof(call)&&"function"!=typeof call?function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self):call}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}var rootEl=_global.document?_global.document.getElementById("root"):null,render=function render(node,el){return new Promise((function(resolve){_reactDom.default.render(Object({NODE_ENV:"production",NODE_PATH:"",PUBLIC_URL:"."}).STORYBOOK_EXAMPLE_APP?_react.default.createElement(_react.StrictMode,null,node):node,el,resolve)}))},ErrorBoundary=function(_Component){function ErrorBoundary(){var _getPrototypeOf2,_this;_classCallCheck(this,ErrorBoundary);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_possibleConstructorReturn(this,(_getPrototypeOf2=_getPrototypeOf(ErrorBoundary)).call.apply(_getPrototypeOf2,[this].concat(args)))).state={hasError:!1},_this}return function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(ErrorBoundary,_Component),function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(ErrorBoundary,[{key:"componentDidMount",value:function componentDidMount(){var hasError=this.state.hasError,showMain=this.props.showMain;hasError||showMain()}},{key:"componentDidCatch",value:function componentDidCatch(err){(0,this.props.showException)(err)}},{key:"render",value:function render(){var hasError=this.state.hasError,children=this.props.children;return hasError?null:children}}],[{key:"getDerivedStateFromError",value:function getDerivedStateFromError(){return{hasError:!0}}}]),ErrorBoundary}(_react.Component);function _renderMain(){return(_renderMain=_asyncToGenerator(regeneratorRuntime.mark((function _callee(_ref){var StoryFn,showMain,showException,forceRender,element;return regeneratorRuntime.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:return StoryFn=_ref.storyFn,showMain=_ref.showMain,showException=_ref.showException,forceRender=_ref.forceRender,element=_react.default.createElement(ErrorBoundary,{showMain:showMain,showException:showException},_react.default.createElement(StoryFn,null)),forceRender||_reactDom.default.unmountComponentAtNode(rootEl),_context.next=5,render(element,rootEl);case 5:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}},,,,,function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var b="function"==typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"==typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function z(a){return y(a)===m}exports.typeOf=y,exports.AsyncMode=l,exports.ConcurrentMode=m,exports.ContextConsumer=k,exports.ContextProvider=h,exports.Element=c,exports.ForwardRef=n,exports.Fragment=e,exports.Lazy=t,exports.Memo=r,exports.Portal=d,exports.Profiler=g,exports.StrictMode=f,exports.Suspense=p,exports.isValidElementType=function(a){return"string"==typeof a||"function"==typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"==typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)},exports.isAsyncMode=function(a){return z(a)||y(a)===l},exports.isConcurrentMode=z,exports.isContextConsumer=function(a){return y(a)===k},exports.isContextProvider=function(a){return y(a)===h},exports.isElement=function(a){return"object"==typeof a&&null!==a&&a.$$typeof===c},exports.isForwardRef=function(a){return y(a)===n},exports.isFragment=function(a){return y(a)===e},exports.isLazy=function(a){return y(a)===t},exports.isMemo=function(a){return y(a)===r},exports.isPortal=function(a){return y(a)===d},exports.isProfiler=function(a){return y(a)===g},exports.isStrictMode=function(a){return y(a)===f},exports.isSuspense=function(a){return y(a)===p}},,,,,function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}(__webpack_require__(0));function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter((function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable})))),ownKeys.forEach((function(key){_defineProperty(target,key,source[key])}))}return target}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _possibleConstructorReturn(self,call){return!call||"object"!==_typeof(call)&&"function"!=typeof call?_assertThisInitialized(self):call}function _getPrototypeOf(o){return(_getPrototypeOf=Object.getPrototypeOf||function _getPrototypeOf(o){return o.__proto__})(o)}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var style={position:"absolute",left:0,top:0,right:0,bottom:0,overflow:"hidden",zIndex:-1,visibility:"hidden",pointerEvents:"none"},styleChild={position:"absolute",left:0,top:0,transition:"0s"};function isAncestor(node,ancestor){for(var current=node.parentNode;current;){if(current===ancestor)return!0;current=current.parentNode}return!1}var ResizeObserver=function(_React$Component){function ResizeObserver(){var _getPrototypeOf2,_temp,_this;_classCallCheck(this,ResizeObserver);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _possibleConstructorReturn(_this,(_temp=_this=_possibleConstructorReturn(this,(_getPrototypeOf2=_getPrototypeOf(ResizeObserver)).call.apply(_getPrototypeOf2,[this].concat(args))),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_expandRef",null),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_shrinkRef",null),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_node",null),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_lastWidth",void 0),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_lastHeight",void 0),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_lastRect",void 0),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_hasResize",!1),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_handleScroll",(function(event){(_this.props.onPosition||_this.props.onReflow||_this.props.onResize)&&(_this._globalScollTarget(event.target)||_this._refScrollTarget(event.target)||_this._ancestorScollTarget(event.target))&&_this._reflow()})),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_globalScollTarget",(function(target){return target instanceof Node&&(_this.props.onPosition||_this.props.onReflow)&&(target===document||target===document.documentElement||target===document.body)})),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_refScrollTarget",(function(target){if(target instanceof HTMLElement&&(target===_this._expandRef||target===_this._shrinkRef)){var width=target.offsetWidth,height=target.offsetHeight;if(width!==_this._lastWidth||height!==_this._lastHeight)return _this._lastWidth=width,_this._lastHeight=height,_this._reset(_this._expandRef),_this._reset(_this._shrinkRef),!0}return!1})),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_ancestorScollTarget",(function(target){return target instanceof Node&&(_this.props.onPosition||_this.props.onReflow)&&_this._node&&isAncestor(_this._node,target)})),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_reflow",(function(){if(_this._node&&_this._node.parentNode instanceof Element){var rect=_this._node.parentNode.getBoundingClientRect(),sizeChanged=!0,positionChanged=!0;_this._lastRect&&(sizeChanged=rect.width!==_this._lastRect.width||rect.height!==_this._lastRect.height,positionChanged=rect.top!==_this._lastRect.top||rect.left!==_this._lastRect.left),_this._lastRect=rect,sizeChanged&&_this.props.onResize&&_this.props.onResize(rect),positionChanged&&_this.props.onPosition&&_this.props.onPosition(rect),(sizeChanged||positionChanged)&&_this.props.onReflow&&_this.props.onReflow(rect)}})),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_handleRef",(function(node){_this._node=node})),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_handleExpandRef",(function(node){_this._reset(node),_this._expandRef=node})),_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)),"_handleShrinkRef",(function(node){_this._reset(node),_this._shrinkRef=node})),_temp))}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(ResizeObserver,[{key:"componentDidMount",value:function componentDidMount(){this._reflow(),window.addEventListener("scroll",this._handleScroll,!0),(this.props.onPosition||this.props.onReflow)&&(window.addEventListener("resize",this._reflow,!0),this._hasResize=!0)}},{key:"componentDidUpdate",value:function componentDidUpdate(){!this.props.onPosition&&!this.props.onReflow||this._hasResize?this.props.onPosition||this.props.onReflow||!this._hasResize||(window.removeEventListener("resize",this._reflow,!0),this._hasResize=!1):(window.addEventListener("resize",this._reflow,!0),this._hasResize=!0)}},{key:"componentWillUnmount",value:function componentWillUnmount(){window.removeEventListener("scroll",this._handleScroll,!0),this._hasResize&&window.removeEventListener("resize",this._reflow,!0)}},{key:"_reset",value:function _reset(node){node&&(node.scrollLeft=1e5,node.scrollTop=1e5)}},{key:"render",value:function render(){return this.props.onResize||this.props.onReflow?_react.default.createElement("div",{style:style,ref:this._handleRef},_react.default.createElement("div",{ref:this._handleExpandRef,style:style},_react.default.createElement("div",{style:_objectSpread({},styleChild,{width:1e5,height:1e5})})),_react.default.createElement("div",{ref:this._handleShrinkRef,style:style},_react.default.createElement("div",{style:_objectSpread({},styleChild,{width:"200%",height:"200%"})}))):_react.default.createElement("noscript",{ref:this._handleRef})}}]),function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");_setPrototypeOf(subClass.prototype,superClass&&superClass.prototype),superClass&&_setPrototypeOf(subClass,superClass)}(ResizeObserver,_React$Component),ResizeObserver}(_react.default.Component);_defineProperty(ResizeObserver,"displayName","ResizeObserver");var _default=ResizeObserver;exports.default=_default},,,,,function(module,exports,__webpack_require__){var _nodeId,_clockseq,rng=__webpack_require__(278),bytesToUuid=__webpack_require__(279),_lastMSecs=0,_lastNSecs=0;module.exports=function v1(options,buf,offset){var i=buf&&offset||0,b=buf||[],node=(options=options||{}).node||_nodeId,clockseq=void 0!==options.clockseq?options.clockseq:_clockseq;if(null==node||null==clockseq){var seedBytes=rng();null==node&&(node=_nodeId=[1|seedBytes[0],seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]),null==clockseq&&(clockseq=_clockseq=16383&(seedBytes[6]<<8|seedBytes[7]))}var msecs=void 0!==options.msecs?options.msecs:(new Date).getTime(),nsecs=void 0!==options.nsecs?options.nsecs:_lastNSecs+1,dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&void 0===options.clockseq&&(clockseq=clockseq+1&16383),(dt<0||msecs>_lastMSecs)&&void 0===options.nsecs&&(nsecs=0),nsecs>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=msecs,_lastNSecs=nsecs,_clockseq=clockseq;var tl=(1e4*(268435455&(msecs+=122192928e5))+nsecs)%4294967296;b[i++]=tl>>>24&255,b[i++]=tl>>>16&255,b[i++]=tl>>>8&255,b[i++]=255&tl;var tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255,b[i++]=255&tmh,b[i++]=tmh>>>24&15|16,b[i++]=tmh>>>16&255,b[i++]=clockseq>>>8|128,b[i++]=255&clockseq;for(var n=0;n<6;++n)b[i+n]=node[n];return buf||bytesToUuid(b)}},function(module,exports,__webpack_require__){var rng=__webpack_require__(278),bytesToUuid=__webpack_require__(279);module.exports=function v4(options,buf,offset){var i=buf&&offset||0;"string"==typeof options&&(buf="binary"===options?new Array(16):null,options=null);var rnds=(options=options||{}).random||(options.rng||rng)();if(rnds[6]=15&rnds[6]|64,rnds[8]=63&rnds[8]|128,buf)for(var ii=0;ii<16;++ii)buf[i+ii]=rnds[ii];return buf||bytesToUuid(rnds)}},,,,,,,,,,,,,,,,,,function(module,__webpack_exports__,__webpack_require__){"use strict";function isObjectObject(o){return!0===function isObject(val){return null!=val&&"object"==typeof val&&!1===Array.isArray(val)}(o)&&"[object Object]"===Object.prototype.toString.call(o)}function isPlainObject(o){var ctor,prot;return!1!==isObjectObject(o)&&("function"==typeof(ctor=o.constructor)&&(!1!==isObjectObject(prot=ctor.prototype)&&!1!==prot.hasOwnProperty("isPrototypeOf")))}__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"default",(function(){return isPlainObject}))}]]);
//# sourceMappingURL=vendors~main.1f96e45aeead60dee58a.bundle.js.map
|
"""Azure IoT Hub Device SDK Pipeline
This package provides pipeline objects for use with the Azure IoT Hub Device SDK.
INTERNAL USAGE ONLY
"""
from .pipeline_events_base import PipelineEvent
from .pipeline_ops_base import PipelineOperation
from .pipeline_stages_base import PipelineStage
from .pipeline_exceptions import OperationCancelled
|
module.exports = {
HOST: "localhost",
USER: "root",
PASSWORD: "",
DB: "node"
};
|
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from torch.autograd import Variable
from torchmm.models.fusion.backbone import Vgg, Resnet, Lstm, Gru
from torch.nn.init import xavier_normal
ModelMap = {
'vgg': Vgg,
'resnet': Resnet,
'lstm': Lstm,
'gru': Gru
}
class LMFFusion(nn.Module):
def __init__(self,
image_model,
text_model,
word_dim,
vocab_size,
hidden_dim,
num_labels,
model_name,
finetune,
**kwargs):
super(LMFFusion, self).__init__()
# self.batch_size = kwargs['batch_size']
self.rank = kwargs['rank']
self.num_labels = num_labels
self.image_model = ModelMap[image_model.lower()](hidden_dim, num_labels, model_name, finetune)
self.text_model = ModelMap[text_model.lower()](word_dim, hidden_dim, num_labels, vocab_size, model_name)
self.image_factor = Parameter(torch.Tensor(self.rank, hidden_dim + 1, num_labels))
self.text_factor = Parameter(torch.Tensor(self.rank, hidden_dim + 1, num_labels))
self.fusion_weights = Parameter(torch.Tensor(1, self.rank))
self.fusion_bias = Parameter(torch.Tensor(1, num_labels))
xavier_normal(self.image_factor)
xavier_normal(self.text_factor)
xavier_normal(self.fusion_weights)
self.fusion_bias.data.fill_(0)
self.sigmoid = nn.Sigmoid()
self.criterion = nn.BCELoss()
def forward(self, batch):
DTYPE = torch.cuda.FloatTensor
img_predict = self.image_model(batch)
txt_predict = self.text_model(batch)
batch_size = txt_predict.data.shape[0]
img_predict = torch.cat((Variable(torch.ones(batch_size, 1).type(DTYPE), requires_grad=False), img_predict), dim=1)
txt_predict = torch.cat((Variable(torch.ones(batch_size, 1).type(DTYPE), requires_grad=False), txt_predict), dim=1)
fusion_img = torch.matmul(img_predict, self.image_factor)
fusion_txt = torch.matmul(txt_predict, self.text_factor)
fusion_zy = fusion_img * fusion_txt
predict = torch.matmul(self.fusion_weights, fusion_zy.permute(1, 0, 2)).squeeze() + self.fusion_bias
predict = predict.view(-1, self.num_labels)
predict = self.sigmoid(predict)
loss = self.criterion(predict, batch['label'])
if self.training:
return loss
else:
return loss, predict
|
import { createSelector } from 'reselect';
export function getTasks(state) {
return state.tasks;
}
export function getTaskList(state) {
return getTasks(state).list;
}
export function getTaskFilter(state) {
return getTasks(state).filter;
}
export function getDeletedTask(state) {
return getTasks(state).deleted;
}
export function getRouteFilter(state) {
var pathname = state.routing.locationBeforeTransitions.pathname;
var str = pathname.replace('/', '');
return str.toUpperCase();
}
export function filterTasks(tasks, filter) {
switch (filter) {
case 'active':
return tasks.filter(task => !task.completed);
case 'completed':
return tasks.filter(task => task.completed);
default:
return tasks;
}
}
export function filterRoute(tasks, filter) {
return tasks.filter(task => task.list === filter);
}
//=====================================
// MEMOIZED SELECTORS
//-------------------------------------
export const getVisibleTasks = createSelector(
getTaskList,
getTaskFilter,
getRouteFilter,
(tasks, filter, routeFilter) => {
var filteredTasks = filterTasks(tasks, filter);
return filterRoute(filteredTasks, routeFilter);
}
);
|
export default function cleanApiData(data) {
const cleanApiData = {
curr: {
location: data.current_observation.display_location.full,
conditions: data.current_observation.weather,
temp: data.current_observation.temp_f,
high: data.forecast.simpleforecast.forecastday[0].high.fahrenheit,
low: data.forecast.simpleforecast.forecastday[0].low.fahrenheit,
day: data.forecast.txt_forecast.forecastday[0].title,
month: data.forecast.simpleforecast.forecastday[0].date.monthname,
date: data.forecast.simpleforecast.forecastday[0].date.day,
summary: data.forecast.txt_forecast.forecastday[0].fcttext,
icon: data.current_observation.icon_url
},
seven: data.hourly_forecast.slice(0, 7).map((hour) => {
return {
hour: hour.FCTTIME.civil,
icon: hour.icon_url,
tempF: hour.temp.english
};
}),
ten: data.forecast.simpleforecast.forecastday.map((day) => {
return {
day: day.date.weekday,
icon: day.icon_url,
high: day.high.fahrenheit,
low: day.low.fahrenheit
};
})
};
return cleanApiData;
}
|
""" Mailu config storage model
"""
import os
import smtplib
import json
from datetime import date
from email.mime import text
from itertools import chain
import flask_sqlalchemy
import sqlalchemy
import passlib.context
import passlib.hash
import passlib.registry
import time
import os
import hmac
import smtplib
import idna
import dns
from flask import current_app as app
from sqlalchemy.ext import declarative
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.inspection import inspect
from werkzeug.utils import cached_property
from mailu import dkim, utils
db = flask_sqlalchemy.SQLAlchemy()
class IdnaDomain(db.TypeDecorator):
""" Stores a Unicode string in it's IDNA representation (ASCII only)
"""
impl = db.String(80)
def process_bind_param(self, value, dialect):
""" encode unicode domain name to punycode """
return idna.encode(value.lower()).decode('ascii')
def process_result_value(self, value, dialect):
""" decode punycode domain name to unicode """
return idna.decode(value)
python_type = str
class IdnaEmail(db.TypeDecorator):
""" Stores a Unicode string in it's IDNA representation (ASCII only)
"""
impl = db.String(255)
def process_bind_param(self, value, dialect):
""" encode unicode domain part of email address to punycode """
localpart, domain_name = value.lower().rsplit('@', 1)
if '@' in localpart:
raise ValueError('email local part must not contain "@"')
return f'{localpart}@{idna.encode(domain_name).decode("ascii")}'
def process_result_value(self, value, dialect):
""" decode punycode domain part of email to unicode """
localpart, domain_name = value.rsplit('@', 1)
return f'{localpart}@{idna.decode(domain_name)}'
python_type = str
class CommaSeparatedList(db.TypeDecorator):
""" Stores a list as a comma-separated string, compatible with Postfix.
"""
impl = db.String
def process_bind_param(self, value, dialect):
""" join list of items to comma separated string """
if not isinstance(value, (list, tuple, set)):
raise TypeError('Must be a list of strings')
for item in value:
if ',' in item:
raise ValueError('list item must not contain ","')
return ','.join(sorted(set(value)))
def process_result_value(self, value, dialect):
""" split comma separated string to list """
return list(filter(bool, (item.strip() for item in value.split(',')))) if value else []
python_type = list
class JSONEncoded(db.TypeDecorator):
""" Represents an immutable structure as a json-encoded string.
"""
impl = db.String
def process_bind_param(self, value, dialect):
""" encode data as json """
return json.dumps(value) if value else None
def process_result_value(self, value, dialect):
""" decode json to data """
return json.loads(value) if value else None
python_type = str
class Base(db.Model):
""" Base class for all models
"""
__abstract__ = True
metadata = sqlalchemy.schema.MetaData(
naming_convention={
'fk': '%(table_name)s_%(column_0_name)s_fkey',
'pk': '%(table_name)s_pkey'
}
)
created_at = db.Column(db.Date, nullable=False, default=date.today)
updated_at = db.Column(db.Date, nullable=True, onupdate=date.today)
comment = db.Column(db.String(255), nullable=True, default='')
def __str__(self):
pkey = self.__table__.primary_key.columns.values()[0].name
if pkey == 'email':
# ugly hack for email declared attr. _email is not always up2date
return str(f'{self.localpart}@{self.domain_name}')
return str(getattr(self, pkey))
def __repr__(self):
return f'<{self.__class__.__name__} {str(self)!r}>'
def __eq__(self, other):
if isinstance(other, self.__class__):
pkey = self.__table__.primary_key.columns.values()[0].name
this = getattr(self, pkey, None)
other = getattr(other, pkey, None)
return this is not None and other is not None and str(this) == str(other)
else:
return NotImplemented
# we need hashable instances here for sqlalchemy to update collections
# in collections.bulk_replace, but auto-incrementing don't always have
# a valid primary key, in this case we use the object's id
__hashed = None
def __hash__(self):
if self.__hashed is None:
primary = getattr(self, self.__table__.primary_key.columns.values()[0].name)
self.__hashed = id(self) if primary is None else hash(primary)
return self.__hashed
# Many-to-many association table for domain managers
managers = db.Table('manager', Base.metadata,
db.Column('domain_name', IdnaDomain, db.ForeignKey('domain.name')),
db.Column('user_email', IdnaEmail, db.ForeignKey('user.email'))
)
class Config(Base):
""" In-database configuration values
"""
name = db.Column(db.String(255), primary_key=True, nullable=False)
value = db.Column(JSONEncoded)
def _save_dkim_keys(session):
""" store DKIM keys after commit """
for obj in session.identity_map.values():
if isinstance(obj, Domain):
obj.save_dkim_key()
class Domain(Base):
""" A DNS domain that has mail addresses associated to it.
"""
__tablename__ = 'domain'
name = db.Column(IdnaDomain, primary_key=True, nullable=False)
managers = db.relationship('User', secondary=managers,
backref=db.backref('manager_of'), lazy='dynamic')
max_users = db.Column(db.Integer, nullable=False, default=-1)
max_aliases = db.Column(db.Integer, nullable=False, default=-1)
max_quota_bytes = db.Column(db.BigInteger, nullable=False, default=0)
signup_enabled = db.Column(db.Boolean, nullable=False, default=False)
_dkim_key = None
_dkim_key_on_disk = None
def _dkim_file(self):
""" return filename for active DKIM key """
return app.config['DKIM_PATH'].format(
domain=self.name,
selector=app.config['DKIM_SELECTOR']
)
def save_dkim_key(self):
""" save changed DKIM key to disk """
if self._dkim_key != self._dkim_key_on_disk:
file_path = self._dkim_file()
if self._dkim_key:
with open(file_path, 'wb') as handle:
handle.write(self._dkim_key)
elif os.path.exists(file_path):
os.unlink(file_path)
self._dkim_key_on_disk = self._dkim_key
@property
def dns_mx(self):
""" return MX record for domain """
hostname = app.config['HOSTNAMES'].split(',', 1)[0]
return f'{self.name}. 600 IN MX 10 {hostname}.'
@property
def dns_spf(self):
""" return SPF record for domain """
hostname = app.config['HOSTNAMES'].split(',', 1)[0]
return f'{self.name}. 600 IN TXT "v=spf1 mx a:{hostname} ~all"'
@property
def dns_dkim(self):
""" return DKIM record for domain """
if self.dkim_key:
selector = app.config['DKIM_SELECTOR']
return (
f'{selector}._domainkey.{self.name}. 600 IN TXT'
f'"v=DKIM1; k=rsa; p={self.dkim_publickey}"'
)
@property
def dns_dmarc(self):
""" return DMARC record for domain """
if self.dkim_key:
domain = app.config['DOMAIN']
rua = app.config['DMARC_RUA']
rua = f' rua=mailto:{rua}@{domain};' if rua else ''
ruf = app.config['DMARC_RUF']
ruf = f' ruf=mailto:{ruf}@{domain};' if ruf else ''
return f'_dmarc.{self.name}. 600 IN TXT "v=DMARC1; p=reject;{rua}{ruf} adkim=s; aspf=s"'
@property
def dkim_key(self):
""" return private DKIM key """
if self._dkim_key is None:
file_path = self._dkim_file()
if os.path.exists(file_path):
with open(file_path, 'rb') as handle:
self._dkim_key = self._dkim_key_on_disk = handle.read()
else:
self._dkim_key = self._dkim_key_on_disk = b''
return self._dkim_key if self._dkim_key else None
@dkim_key.setter
def dkim_key(self, value):
""" set private DKIM key """
old_key = self.dkim_key
self._dkim_key = value if value is not None else b''
if self._dkim_key != old_key:
if not sqlalchemy.event.contains(db.session, 'after_commit', _save_dkim_keys):
sqlalchemy.event.listen(db.session, 'after_commit', _save_dkim_keys)
@property
def dkim_publickey(self):
""" return public part of DKIM key """
dkim_key = self.dkim_key
if dkim_key:
return dkim.strip_key(dkim_key).decode('utf8')
def generate_dkim_key(self):
""" generate new DKIM key """
self.dkim_key = dkim.gen_key()
def has_email(self, localpart):
""" checks if localpart is configured for domain """
localpart = localpart.lower()
for email in chain(self.users, self.aliases):
if email.localpart == localpart:
return True
return False
def check_mx(self):
""" checks if MX record for domain points to mailu host """
try:
hostnames = set(app.config['HOSTNAMES'].split(','))
return any(
rset.exchange.to_text().rstrip('.') in hostnames
for rset in dns.resolver.query(self.name, 'MX')
)
except dns.exception.DNSException:
return False
class Alternative(Base):
""" Alternative name for a served domain.
The name "domain alias" was avoided to prevent some confusion.
"""
__tablename__ = 'alternative'
name = db.Column(IdnaDomain, primary_key=True, nullable=False)
domain_name = db.Column(IdnaDomain, db.ForeignKey(Domain.name))
domain = db.relationship(Domain,
backref=db.backref('alternatives', cascade='all, delete-orphan'))
class Relay(Base):
""" Relayed mail domain.
The domain is either relayed publicly or through a specified SMTP host.
"""
__tablename__ = 'relay'
name = db.Column(IdnaDomain, primary_key=True, nullable=False)
smtp = db.Column(db.String(80), nullable=True)
class Email(object):
""" Abstraction for an email address (localpart and domain).
"""
localpart = db.Column(db.String(80), nullable=False)
@declarative.declared_attr
def domain_name(cls):
""" the domain part of the email address """
return db.Column(IdnaDomain, db.ForeignKey(Domain.name),
nullable=False, default=IdnaDomain)
# This field is redundant with both localpart and domain name.
# It is however very useful for quick lookups without joining tables,
# especially when the mail server is reading the database.
@declarative.declared_attr
def _email(cls):
""" the complete email address (localpart@domain) """
def updater(ctx):
key = f'{cls.__tablename__}_email'
if key in ctx.current_parameters:
return ctx.current_parameters[key]
return '{localpart}@{domain_name}'.format_map(ctx.current_parameters)
return db.Column('email', IdnaEmail, primary_key=True, nullable=False, onupdate=updater)
# We need to keep email, localpart and domain_name in sync.
# But IMHO using email as primary key was not a good idea in the first place.
@hybrid_property
def email(self):
""" getter for email - gets _email """
return self._email
@email.setter
def email(self, value):
""" setter for email - sets _email, localpart and domain_name at once """
self._email = value.lower()
self.localpart, self.domain_name = self._email.rsplit('@', 1)
@staticmethod
def _update_localpart(target, value, *_):
if target.domain_name:
target._email = f'{value}@{target.domain_name}'
@staticmethod
def _update_domain_name(target, value, *_):
if target.localpart:
target._email = f'{target.localpart}@{value}'
@classmethod
def __declare_last__(cls):
# gets called after mappings are completed
sqlalchemy.event.listen(cls.localpart, 'set', cls._update_localpart, propagate=True)
sqlalchemy.event.listen(cls.domain_name, 'set', cls._update_domain_name, propagate=True)
def sendmail(self, subject, body):
""" send an email to the address """
f_addr = f'{app.config["POSTMASTER"]}@{idna.encode(app.config["DOMAIN"]).decode("ascii")}'
with smtplib.SMTP(app.config['HOST_AUTHSMTP'], port=10025) as smtp:
to_address = f'{self.localpart}@{idna.encode(self.domain_name).decode("ascii")}'
msg = text.MIMEText(body)
msg['Subject'] = subject
msg['From'] = f_addr
msg['To'] = to_address
smtp.sendmail(f_addr, [to_address], msg.as_string())
@classmethod
def resolve_domain(cls, email):
""" resolves domain alternative to real domain """
localpart, domain_name = email.rsplit('@', 1) if '@' in email else (None, email)
if alternative := Alternative.query.get(domain_name):
domain_name = alternative.domain_name
return (localpart, domain_name)
@classmethod
def resolve_destination(cls, localpart, domain_name, ignore_forward_keep=False):
""" return destination for email address localpart@domain_name """
localpart_stripped = None
stripped_alias = None
delim = os.environ.get('RECIPIENT_DELIMITER')
if delim in localpart:
localpart_stripped = localpart.rsplit(delim, 1)[0]
user = User.query.get(f'{localpart}@{domain_name}')
if not user and localpart_stripped:
user = User.query.get(f'{localpart_stripped}@{domain_name}')
if user:
email = f'{localpart}@{domain_name}'
if user.forward_enabled:
destination = user.forward_destination
if user.forward_keep or ignore_forward_keep:
destination.append(email)
else:
destination = [email]
return destination
pure_alias = Alias.resolve(localpart, domain_name)
if pure_alias and not pure_alias.wildcard:
return pure_alias.destination
if stripped_alias := Alias.resolve(localpart_stripped, domain_name):
return stripped_alias.destination
if pure_alias:
return pure_alias.destination
return None
class User(Base, Email):
""" A user is an email address that has a password to access a mailbox.
"""
__tablename__ = 'user'
_ctx = None
_credential_cache = {}
domain = db.relationship(Domain,
backref=db.backref('users', cascade='all, delete-orphan'))
password = db.Column(db.String(255), nullable=False)
quota_bytes = db.Column(db.BigInteger, nullable=False, default=10**9)
quota_bytes_used = db.Column(db.BigInteger, nullable=False, default=0)
global_admin = db.Column(db.Boolean, nullable=False, default=False)
enabled = db.Column(db.Boolean, nullable=False, default=True)
# Features
enable_imap = db.Column(db.Boolean, nullable=False, default=True)
enable_pop = db.Column(db.Boolean, nullable=False, default=True)
# Filters
forward_enabled = db.Column(db.Boolean, nullable=False, default=False)
forward_destination = db.Column(CommaSeparatedList, nullable=True, default=list)
forward_keep = db.Column(db.Boolean, nullable=False, default=True)
reply_enabled = db.Column(db.Boolean, nullable=False, default=False)
reply_subject = db.Column(db.String(255), nullable=True, default=None)
reply_body = db.Column(db.Text, nullable=True, default=None)
reply_startdate = db.Column(db.Date, nullable=False,
default=date(1900, 1, 1))
reply_enddate = db.Column(db.Date, nullable=False,
default=date(2999, 12, 31))
# Settings
displayed_name = db.Column(db.String(160), nullable=False, default='')
spam_enabled = db.Column(db.Boolean, nullable=False, default=True)
spam_threshold = db.Column(db.Integer, nullable=False, default=80)
# Flask-login attributes
is_authenticated = True
is_active = True
is_anonymous = False
def get_id(self):
""" return users email address """
return self.email
@property
def destination(self):
""" returns comma separated string of destinations """
if self.forward_enabled:
result = list(self.forward_destination)
if self.forward_keep:
result.append(self.email)
return ','.join(result)
else:
return self.email
@property
def reply_active(self):
""" returns status of autoreply function """
now = date.today()
return (
self.reply_enabled and
self.reply_startdate < now and
self.reply_enddate > now
)
@property
def sender_limiter(self):
return utils.limiter.get_limiter(
app.config["MESSAGE_RATELIMIT"], "sender", self.email
)
@classmethod
def get_password_context(cls):
""" create password context for hashing and verification
"""
if cls._ctx:
return cls._ctx
schemes = passlib.registry.list_crypt_handlers()
# scrypt throws a warning if the native wheels aren't found
schemes.remove('scrypt')
# we can't leave plaintext schemes as they will be misidentified
for scheme in schemes:
if scheme.endswith('plaintext'):
schemes.remove(scheme)
cls._ctx = passlib.context.CryptContext(
schemes=schemes,
default='bcrypt_sha256',
bcrypt_sha256__rounds=app.config['CREDENTIAL_ROUNDS'],
deprecated='auto'
)
return cls._ctx
def check_password(self, password):
""" verifies password against stored hash
and updates hash if outdated
"""
cache_result = self._credential_cache.get(self.get_id())
current_salt = self.password.split('$')[3] if len(self.password.split('$')) == 5 else None
if cache_result and current_salt:
cache_salt, cache_hash = cache_result
if cache_salt == current_salt:
return passlib.hash.pbkdf2_sha256.verify(password, cache_hash)
else:
# the cache is local per gunicorn; the password has changed
# so the local cache can be invalidated
del self._credential_cache[self.get_id()]
reference = self.password
# strip {scheme} if that's something mailu has added
# passlib will identify *crypt based hashes just fine
# on its own
if reference.startswith(('{PBKDF2}', '{BLF-CRYPT}', '{SHA512-CRYPT}', '{SHA256-CRYPT}', '{MD5-CRYPT}', '{CRYPT}')):
reference = reference.split('}', 1)[1]
result, new_hash = User.get_password_context().verify_and_update(password, reference)
if new_hash:
self.password = new_hash
db.session.add(self)
db.session.commit()
if result:
"""The credential cache uses a low number of rounds to be fast.
While it's not meant to be persisted to cold-storage, no additional measures
are taken to ensure it isn't (mlock(), encrypted swap, ...) on the basis that
we have little control over GC and string interning anyways.
An attacker that can dump the process' memory is likely to find credentials
in clear-text regardless of the presence of the cache.
"""
self._credential_cache[self.get_id()] = (self.password.split('$')[3], passlib.hash.pbkdf2_sha256.using(rounds=1).hash(password))
return result
def set_password(self, password, raw=False):
""" Set password for user
@password: plain text password to encrypt (or, if raw is True: the hash itself)
"""
self.password = password if raw else User.get_password_context().hash(password)
def get_managed_domains(self):
""" return list of domains this user can manage """
if self.global_admin:
return Domain.query.all()
else:
return self.manager_of
def get_managed_emails(self, include_aliases=True):
""" returns list of email addresses this user can manage """
emails = []
for domain in self.get_managed_domains():
emails.extend(domain.users)
if include_aliases:
emails.extend(domain.aliases)
return emails
def send_welcome(self):
""" send welcome email to user """
if app.config['WELCOME']:
self.sendmail(app.config['WELCOME_SUBJECT'], app.config['WELCOME_BODY'])
@classmethod
def get(cls, email):
""" find user object for email address """
return cls.query.get(email)
@classmethod
def login(cls, email, password):
""" login user when enabled and password is valid """
user = cls.query.get(email)
return user if (user and user.enabled and user.check_password(password)) else None
@classmethod
def get_temp_token(cls, email):
user = cls.query.get(email)
return hmac.new(app.temp_token_key, bytearray("{}|{}".format(time.strftime('%Y%m%d'), email), 'utf-8'), 'sha256').hexdigest() if (user and user.enabled) else None
def verify_temp_token(self, token):
return hmac.compare_digest(self.get_temp_token(self.email), token)
class Alias(Base, Email):
""" An alias is an email address that redirects to some destination.
"""
__tablename__ = 'alias'
domain = db.relationship(Domain,
backref=db.backref('aliases', cascade='all, delete-orphan'))
wildcard = db.Column(db.Boolean, nullable=False, default=False)
destination = db.Column(CommaSeparatedList, nullable=False, default=list)
@classmethod
def resolve(cls, localpart, domain_name):
""" find aliases matching email address localpart@domain_name """
alias_preserve_case = cls.query.filter(
sqlalchemy.and_(cls.domain_name == domain_name,
sqlalchemy.or_(
sqlalchemy.and_(
cls.wildcard == False,
cls.localpart == localpart
), sqlalchemy.and_(
cls.wildcard == True,
sqlalchemy.bindparam('l', localpart).like(cls.localpart)
)
)
)
).order_by(cls.wildcard, sqlalchemy.func.char_length(cls.localpart).desc()).first()
localpart_lower = localpart.lower() if localpart else None
alias_lower_case = cls.query.filter(
sqlalchemy.and_(cls.domain_name == domain_name,
sqlalchemy.or_(
sqlalchemy.and_(
cls.wildcard == False,
sqlalchemy.func.lower(cls.localpart) == localpart_lower
), sqlalchemy.and_(
cls.wildcard == True,
sqlalchemy.bindparam('l', localpart_lower).like(
sqlalchemy.func.lower(cls.localpart))
)
)
)
).order_by(cls.wildcard, sqlalchemy.func.char_length(
sqlalchemy.func.lower(cls.localpart)).desc()).first()
if alias_preserve_case and alias_lower_case:
return alias_lower_case if alias_preserve_case.wildcard else alias_preserve_case
if alias_preserve_case and not alias_lower_case:
return alias_preserve_case
if alias_lower_case and not alias_preserve_case:
return alias_lower_case
return None
class Token(Base):
""" A token is an application password for a given user.
"""
__tablename__ = 'token'
id = db.Column(db.Integer, primary_key=True)
user_email = db.Column(db.String(255), db.ForeignKey(User.email),
nullable=False)
user = db.relationship(User,
backref=db.backref('tokens', cascade='all, delete-orphan'))
password = db.Column(db.String(255), nullable=False)
ip = db.Column(db.String(255))
def check_password(self, password):
""" verifies password against stored hash
and updates hash if outdated
"""
if self.password.startswith("$5$"):
if passlib.hash.sha256_crypt.verify(password, self.password):
self.set_password(password)
db.session.add(self)
db.session.commit()
return True
return False
return passlib.hash.pbkdf2_sha256.verify(password, self.password)
def set_password(self, password):
""" sets password using pbkdf2_sha256 (1 round) """
# tokens have 128bits of entropy, they are not bruteforceable
self.password = passlib.hash.pbkdf2_sha256.using(rounds=1).hash(password)
def __repr__(self):
return f'<Token #{self.id}: {self.comment or self.ip or self.password}>'
class Fetch(Base):
""" A fetched account is a remote POP/IMAP account fetched into a local
account.
"""
__tablename__ = 'fetch'
id = db.Column(db.Integer, primary_key=True)
user_email = db.Column(db.String(255), db.ForeignKey(User.email),
nullable=False)
user = db.relationship(User,
backref=db.backref('fetches', cascade='all, delete-orphan'))
protocol = db.Column(db.Enum('imap', 'pop3'), nullable=False)
host = db.Column(db.String(255), nullable=False)
port = db.Column(db.Integer, nullable=False)
tls = db.Column(db.Boolean, nullable=False, default=False)
username = db.Column(db.String(255), nullable=False)
password = db.Column(db.String(255), nullable=False)
keep = db.Column(db.Boolean, nullable=False, default=False)
last_check = db.Column(db.DateTime, nullable=True)
error = db.Column(db.String(1023), nullable=True)
def __repr__(self):
return (
f'<Fetch #{self.id}: {self.protocol}{"s" if self.tls else ""}:'
f'//{self.username}@{self.host}:{self.port}>'
)
class MailuConfig:
""" Class which joins whole Mailu config for dumping
and loading
"""
class MailuCollection:
""" Provides dict- and list-like access to instances
of a sqlalchemy model
"""
def __init__(self, model : db.Model):
self.model = model
def __repr__(self):
return f'<{self.model.__name__}-Collection>'
@cached_property
def _items(self):
return {
inspect(item).identity: item
for item in self.model.query.all()
}
def __len__(self):
return len(self._items)
def __iter__(self):
return iter(self._items.values())
def __getitem__(self, key):
return self._items[key]
def __setitem__(self, key, item):
if not isinstance(item, self.model):
raise TypeError(f'expected {self.model.name}')
if key != inspect(item).identity:
raise ValueError(f'item identity != key {key!r}')
self._items[key] = item
def __delitem__(self, key):
del self._items[key]
def append(self, item, update=False):
""" list-like append """
if not isinstance(item, self.model):
raise TypeError(f'expected {self.model.name}')
key = inspect(item).identity
if key in self._items:
if not update:
raise ValueError(f'item {key!r} already present in collection')
self._items[key] = item
def extend(self, items, update=False):
""" list-like extend """
add = {}
for item in items:
if not isinstance(item, self.model):
raise TypeError(f'expected {self.model.name}')
key = inspect(item).identity
if not update and key in self._items:
raise ValueError(f'item {key!r} already present in collection')
add[key] = item
self._items.update(add)
def pop(self, *args):
""" list-like (no args) and dict-like (1 or 2 args) pop """
if args:
if len(args) > 2:
raise TypeError(f'pop expected at most 2 arguments, got {len(args)}')
return self._items.pop(*args)
else:
return self._items.popitem()[1]
def popitem(self):
""" dict-like popitem """
return self._items.popitem()
def remove(self, item):
""" list-like remove """
if not isinstance(item, self.model):
raise TypeError(f'expected {self.model.name}')
key = inspect(item).identity
if not key in self._items:
raise ValueError(f'item {key!r} not found in collection')
del self._items[key]
def clear(self):
""" dict-like clear """
while True:
try:
self.pop()
except IndexError:
break
def update(self, items):
""" dict-like update """
for key, item in items:
if not isinstance(item, self.model):
raise TypeError(f'expected {self.model.name}')
if key != inspect(item).identity:
raise ValueError(f'item identity != key {key!r}')
self._items.update(items)
def setdefault(self, key, item=None):
""" dict-like setdefault """
if key in self._items:
return self._items[key]
if item is None:
return None
if not isinstance(item, self.model):
raise TypeError(f'expected {self.model.name}')
if key != inspect(item).identity:
raise ValueError(f'item identity != key {key!r}')
self._items[key] = item
return item
def __init__(self):
# section-name -> attr
self._sections = {
name: getattr(self, name)
for name in dir(self)
if isinstance(getattr(self, name), self.MailuCollection)
}
# known models
self._models = tuple(section.model for section in self._sections.values())
# model -> attr
self._sections.update({
section.model: section for section in self._sections.values()
})
def _get_model(self, section):
if section is None:
return None
model = self._sections.get(section)
if model is None:
raise ValueError(f'Invalid section: {section!r}')
if isinstance(model, self.MailuCollection):
return model.model
return model
def _add(self, items, section, update):
model = self._get_model(section)
if isinstance(items, self._models):
items = [items]
elif not hasattr(items, '__iter__'):
raise ValueError(f'{items!r} is not iterable')
for item in items:
if model is not None and not isinstance(item, model):
what = item.__class__.__name__.capitalize()
raise ValueError(f'{what} can not be added to section {section!r}')
self._sections[type(item)].append(item, update=update)
def add(self, items, section=None):
""" add item to config """
self._add(items, section, update=False)
def update(self, items, section=None):
""" add or replace item in config """
self._add(items, section, update=True)
def remove(self, items, section=None):
""" remove item from config """
model = self._get_model(section)
if isinstance(items, self._models):
items = [items]
elif not hasattr(items, '__iter__'):
raise ValueError(f'{items!r} is not iterable')
for item in items:
if isinstance(item, str):
if section is None:
raise ValueError(f'Cannot remove key {item!r} without section')
del self._sections[model][item]
elif model is not None and not isinstance(item, model):
what = item.__class__.__name__.capitalize()
raise ValueError(f'{what} can not be removed from section {section!r}')
self._sections[type(item)].remove(item,)
def clear(self, models=None):
""" remove complete configuration """
for model in self._models:
if models is None or model in models:
db.session.query(model).delete()
def check(self):
""" check for duplicate domain names """
dup = set()
for fqdn in chain(
db.session.query(Domain.name),
db.session.query(Alternative.name),
db.session.query(Relay.name)
):
if fqdn in dup:
raise ValueError(f'Duplicate domain name: {fqdn}')
dup.add(fqdn)
domain = MailuCollection(Domain)
user = MailuCollection(User)
alias = MailuCollection(Alias)
relay = MailuCollection(Relay)
config = MailuCollection(Config)
|
# IMPORTATION STANDARD
import os
from datetime import datetime
# IMPORTATION THIRDPARTY
import pandas as pd
import pytest
# IMPORTATION INTERNAL
from gamestonk_terminal.stocks.behavioural_analysis import ba_controller
# pylint: disable=E1101
# pylint: disable=W0603
# pylint: disable=E1111
pytest.skip(allow_module_level=True)
empty_df = pd.DataFrame()
@pytest.mark.vcr(record_mode="none")
@pytest.mark.record_stdout
def test_menu_quick_exit(mocker):
mocker.patch("builtins.input", return_value="quit")
mocker.patch("gamestonk_terminal.stocks.behavioural_analysis.ba_controller.session")
mocker.patch(
"gamestonk_terminal.stocks.behavioural_analysis.ba_controller.session.prompt",
return_value="quit",
)
result_menu = ba_controller.menu(
ticker="TSLA",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
assert result_menu
@pytest.mark.vcr(record_mode="none")
@pytest.mark.record_stdout
def test_menu_system_exit(mocker):
class SystemExitSideEffect:
def __init__(self):
self.first_call = True
def __call__(self, *args, **kwargs):
if self.first_call:
self.first_call = False
raise SystemExit()
return True
mock_switch = mocker.Mock(side_effect=SystemExitSideEffect())
mocker.patch("builtins.input", return_value="quit")
mocker.patch("gamestonk_terminal.stocks.behavioural_analysis.ba_controller.session")
mocker.patch(
"gamestonk_terminal.stocks.behavioural_analysis.ba_controller.session.prompt",
return_value="quit",
)
mocker.patch(
"gamestonk_terminal.stocks.behavioural_analysis.ba_controller.BehaviouralAnalysisController.switch",
new=mock_switch,
)
ba_controller.menu(
ticker="TSLA",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
@pytest.mark.vcr(record_mode="none")
@pytest.mark.record_stdout
def test_print_help():
controller = ba_controller.BehaviouralAnalysisController(
ticker="TSLA",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
controller.print_help()
@pytest.mark.vcr(record_mode="none")
def test_switch_empty():
controller = ba_controller.BehaviouralAnalysisController(
ticker="TSLA",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
result = controller.switch(an_input="")
assert result is None
@pytest.mark.vcr(record_mode="none")
@pytest.mark.record_stdout
def test_switch_help():
controller = ba_controller.BehaviouralAnalysisController(
ticker="TSLA",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
result = controller.switch(an_input="?")
assert result is None
@pytest.mark.vcr(record_mode="none")
def test_switch_cls(mocker):
mocker.patch("os.system")
controller = ba_controller.BehaviouralAnalysisController(
ticker="TSLA",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
result = controller.switch(an_input="cls")
assert result is None
os.system.assert_called_once_with("cls||clear")
@pytest.mark.vcr(record_mode="none")
def test_call_q():
controller = ba_controller.BehaviouralAnalysisController(
ticker="TSLA",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
other_args = list()
result = controller.call_q(other_args)
assert result is False
@pytest.mark.vcr(record_mode="none")
def test_call_quit():
controller = ba_controller.BehaviouralAnalysisController(
ticker="TSLA",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
other_args = list()
result = controller.call_quit(other_args)
assert result is True
@pytest.mark.vcr(record_mode="none")
@pytest.mark.parametrize(
"tested_func, mocked_func, other_args, called_with",
[
(
"call_watchlist",
"reddit_view.display_watchlist",
["--limit=2"],
dict(num=2),
),
(
"call_spac",
"reddit_view.display_spac",
["--limit=2"],
dict(limit=2),
),
(
"call_spac_c",
"reddit_view.display_spac_community",
["--limit=5", "--popular"],
dict(
limit=5,
popular=True,
),
),
(
"call_wsb",
"reddit_view.display_wsb_community",
["--limit=5", "--new"],
dict(
limit=5,
new=True,
),
),
(
"call_popular",
"reddit_view.display_popular_tickers",
["--number=5", "--limit=10", "--sub=MOCK_SUB"],
dict(
n_top=5,
posts_to_look_at=10,
subreddits="MOCK_SUB",
),
),
(
"call_bullbear",
"stocktwits_view.display_bullbear",
list(),
dict(
ticker="MOCK_TICKER",
),
),
(
"call_messages",
"stocktwits_view.display_messages",
["--limit=2"],
dict(
ticker="MOCK_TICKER",
limit=2,
),
),
(
"call_trending",
"stocktwits_view.display_trending",
list(),
dict(),
),
(
"call_stalker",
"stocktwits_view.display_stalker",
["--user=MOCK_USER", "--limit=5"],
dict(
user="MOCK_USER",
limit=5,
),
),
(
"call_infer",
"twitter_view.display_inference",
["--num=20"],
dict(
ticker="MOCK_TICKER",
num=20,
),
),
(
"call_sentiment",
"twitter_view.display_sentiment",
["--num=20", "--days=2", "--export=csv"],
dict(
ticker="MOCK_TICKER",
n_tweets=20,
n_days_past=2,
export="csv",
),
),
(
"call_mentions",
"google_view.display_mentions",
["--start=2020-12-02", "--export=csv"],
dict(
ticker="MOCK_TICKER",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
export="csv",
),
),
(
"call_regions",
"google_view.display_regions",
["--num=5", "--export=csv"],
dict(
ticker="MOCK_TICKER",
num=5,
export="csv",
),
),
(
"call_queries",
"google_view.display_queries",
["--num=5", "--export=csv"],
dict(
ticker="MOCK_TICKER",
num=5,
export="csv",
),
),
(
"call_rise",
"google_view.display_rise",
["--num=5", "--export=csv"],
dict(
ticker="MOCK_TICKER",
num=5,
export="csv",
),
),
(
"call_headlines",
"finbrain_view.display_sentiment_analysis",
["--export=csv"],
dict(
ticker="MOCK_TICKER",
export="csv",
),
),
(
"call_stats",
"finnhub_view.display_sentiment_stats",
["--export=csv"],
dict(
ticker="MOCK_TICKER",
export="csv",
),
),
(
"call_metrics",
"sentimentinvestor_view.display_metrics",
list(),
dict(
ticker="MOCK_TICKER",
),
),
(
"call_social",
"sentimentinvestor_view.display_social",
list(),
dict(
ticker="MOCK_TICKER",
),
),
(
"call_historical",
"sentimentinvestor_view.display_historical",
["--sort=date", "--direction=desc", "--metric=sentiment"],
dict(
ticker="MOCK_TICKER",
sort_param="date",
sort_dir="desc",
metric="sentiment",
),
),
(
"call_emerging",
"sentimentinvestor_view.display_top",
["--limit=2"],
dict(
metric="RHI",
limit=2,
),
),
(
"call_popular",
"reddit_view.display_popular_tickers",
["--number=1", "--limit=2", "--sub=MOCK_SUB"],
dict(
n_top=1,
posts_to_look_at=2,
subreddits="MOCK_SUB",
),
),
(
"call_popularsi",
"sentimentinvestor_view.display_top",
["--limit=2"],
dict(
metric="AHI",
limit=2,
),
),
(
"call_getdd",
"reddit_view.display_due_diligence",
["--limit=1", "--days=2", "--all"],
dict(
ticker="MOCK_TICKER",
limit=1,
n_days=2,
show_all_flairs=True,
),
),
],
)
def test_call_func(tested_func, mocked_func, other_args, called_with, mocker):
mock = mocker.Mock()
mocker.patch(
"gamestonk_terminal.stocks.behavioural_analysis.ba_controller." + mocked_func,
new=mock,
)
empty_df.drop(empty_df.index, inplace=True)
controller = ba_controller.BehaviouralAnalysisController(
ticker="MOCK_TICKER",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
getattr(controller, tested_func)(other_args=other_args)
if isinstance(called_with, dict):
mock.assert_called_once_with(**called_with)
elif isinstance(called_with, list):
mock.assert_called_once_with(*called_with)
else:
mock.assert_called_once()
@pytest.mark.vcr(record_mode="none")
@pytest.mark.parametrize(
"func",
[
"call_load",
"call_watchlist",
"call_spac",
"call_spac_c",
"call_wsb",
"call_popular",
"call_bullbear",
"call_messages",
"call_trending",
"call_stalker",
"call_infer",
"call_sentiment",
"call_mentions",
"call_regions",
"call_queries",
"call_rise",
"call_headlines",
"call_stats",
"call_metrics",
"call_social",
"call_historical",
"call_emerging",
"call_popular",
"call_popularsi",
"call_getdd",
],
)
def test_call_func_no_parser(func, mocker):
mocker.patch(
"gamestonk_terminal.stocks.behavioural_analysis.ba_controller.parse_known_args_and_warn",
return_value=None,
)
controller = ba_controller.BehaviouralAnalysisController(
ticker="MOCK_TICKER",
start=datetime.strptime("2020-12-01", "%Y-%m-%d"),
)
func_result = getattr(controller, func)(other_args=list())
assert func_result is None
getattr(ba_controller, "parse_known_args_and_warn").assert_called_once()
|
var growing__season_8_f90 =
[
[ "growing_season_initialize", "growing__season_8_f90.html#add2a4f3df5a65bcd0406e7a24f8493f7", null ],
[ "growing_season_update", "growing__season_8_f90.html#ad7cb4c245fb91db0be4abc2c702c6d5c", null ],
[ "date_delims", "growing__season_8_f90.html#a8ec5e4f76a3fede35eed80990135018f", null ],
[ "first_day_of_growing_season", "growing__season_8_f90.html#a6138044b13e093ac08e7a0938c86fb9b", null ],
[ "gdd_first_day_of_growing_season", "growing__season_8_f90.html#ae264c8ec9e2acf8ae09069ffc4de45dc", null ],
[ "ilandusecodes", "growing__season_8_f90.html#abe50cd85327daede57a790be061bc5ca", null ],
[ "killing_frost_temp_last_day_of_growing_season", "growing__season_8_f90.html#acb5da84831be6fa9339795da2e80b8a4", null ],
[ "last_day_of_growing_season", "growing__season_8_f90.html#a405ec98b0236eeafbe7efd51ee258695", null ],
[ "nodata_value", "growing__season_8_f90.html#ae55f84d1c1c73545d6e54c7b7e2d017a", null ]
];
|
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Oracle nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* This sample implements Java-like try..with..resource construct for nashorn */
if (arguments.length == 0) {
print("Usage: jjs try_with_resource.js -- <file name>");
exit(1);
}
// Object.create accepts prototype and properties object
function With(res) {
return Object.create(With.prototype,
{ res: { value: res } });
}
// reserved words can be used as property names - for example "try"
With.prototype.try = function(callback) {
try {
callback();
} finally {
this.res.close();
}
}
var BufferedReader = Java.type("java.io.BufferedReader");
var FileReader = Java.type("java.io.FileReader");
var r = new BufferedReader(new FileReader(arguments[0]));
// Java-like try..with..resource
With(r).try(function() {
var s;
while ((s = r.readLine()) != null) {
print(s);
}
})
|
import {h, cleanDocumentBody} from '../utils';
import {defaultProps} from '../../src/props';
import {
createPopperElement,
updatePopperElement,
createArrowElement,
getChildren,
addInertia,
removeInertia,
addInteractive,
removeInteractive,
setContent,
isCursorOutsideInteractiveBorder,
getBasePlacement,
updateTheme,
} from '../../src/popper';
import {div} from '../../src/utils';
import {
POPPER_SELECTOR,
BACKDROP_SELECTOR,
ARROW_SELECTOR,
SVG_ARROW_SELECTOR,
} from '../../src/constants';
afterEach(cleanDocumentBody);
describe('createPopperElement', () => {
it('returns an element', () => {
expect(createPopperElement(1, defaultProps) instanceof Element).toBe(true);
});
it('always creates a tooltip element child', () => {
const popper = createPopperElement(1, defaultProps);
expect(getChildren(popper).tooltip).not.toBe(null);
});
it('sets the `id` property correctly', () => {
const id = 1829;
const popper = createPopperElement(id, defaultProps);
expect(getChildren(popper).tooltip.id).toBe(`__NAMESPACE_PREFIX__-${id}`);
});
it('sets the `role` attribute correctly', () => {
const popper = createPopperElement(1, defaultProps);
expect(getChildren(popper).tooltip.getAttribute('role')).toBe('tooltip');
});
it('sets the className property correctly', () => {
const popper = createPopperElement(1, defaultProps);
expect(popper.matches(POPPER_SELECTOR)).toBe(true);
});
it('does not create an arrow element if props.arrow is false', () => {
const popper = createPopperElement(1, {...defaultProps, arrow: false});
expect(popper.querySelector(ARROW_SELECTOR)).toBe(null);
});
it('creates an arrow element if props.arrow is true', () => {
const popper = createPopperElement(1, {...defaultProps, arrow: true});
expect(popper.querySelector(ARROW_SELECTOR)).not.toBe(null);
});
it('sets `[data-interactive]` on the tooltip if props.interactive is true', () => {
const popper = createPopperElement(1, {
...defaultProps,
interactive: true,
});
expect(getChildren(popper).tooltip.hasAttribute('data-interactive')).toBe(
true,
);
});
it('sets the correct data-* attributes on the tooltip based on props', () => {
const popper = createPopperElement(1, {
...defaultProps,
animation: 'scale',
});
expect(getChildren(popper).tooltip.getAttribute('data-animation')).toBe(
'scale',
);
});
it('sets the correct theme class names on the tooltip based on props', () => {
const popper = createPopperElement(1, {
...defaultProps,
theme: 'red firetruck',
});
expect(getChildren(popper).tooltip.classList.contains('red-theme')).toBe(
true,
);
expect(
getChildren(popper).tooltip.classList.contains('firetruck-theme'),
).toBe(true);
});
it('sets [data-state="hidden"] on tooltip and content elements', () => {
const popper = createPopperElement(1, defaultProps);
const {tooltip, content} = getChildren(popper);
expect(tooltip.getAttribute('data-state')).toBe('hidden');
expect(content.getAttribute('data-state')).toBe('hidden');
});
});
describe('updatePopperElement', () => {
it('sets new zIndex', () => {
const popper = createPopperElement(1, defaultProps);
updatePopperElement(popper, defaultProps, {
...defaultProps,
zIndex: 213,
});
expect(popper.style.zIndex).toBe('213');
});
it('updates animation attribute', () => {
const popper = createPopperElement(1, defaultProps);
updatePopperElement(popper, defaultProps, {
...defaultProps,
animation: 'scale',
});
expect(getChildren(popper).tooltip.getAttribute('data-animation')).toBe(
'scale',
);
});
it('sets new content', () => {
const popper = createPopperElement(1, defaultProps);
updatePopperElement(popper, defaultProps, {
...defaultProps,
content: 'hello',
});
expect(getChildren(popper).content.textContent).toBe('hello');
updatePopperElement(popper, defaultProps, {
...defaultProps,
content: '<strong>hello</strong>',
});
expect(getChildren(popper).content.querySelector('strong')).not.toBe(null);
});
describe('diffs the arrow correctly', () => {
it('true -> false', () => {
const props = {...defaultProps, arrow: true};
const popper = createPopperElement(1, props);
updatePopperElement(popper, props, {...defaultProps, arrow: false});
expect(popper.querySelector(ARROW_SELECTOR)).toBe(null);
expect(popper.querySelector(SVG_ARROW_SELECTOR)).toBe(null);
expect(getChildren(popper).tooltip.hasAttribute('data-arrow')).toBe(
false,
);
});
it('false -> true', () => {
const props = {...defaultProps, arrow: false};
const popper = createPopperElement(1, props);
updatePopperElement(popper, props, {...defaultProps, arrow: true});
expect(popper.querySelector(ARROW_SELECTOR)).not.toBe(null);
expect(popper.querySelector(SVG_ARROW_SELECTOR)).toBe(null);
expect(getChildren(popper).tooltip.hasAttribute('data-arrow')).toBe(true);
});
it('false -> "round"', () => {
const props = {...defaultProps, arrow: false};
const popper = createPopperElement(1, props);
updatePopperElement(popper, props, {...defaultProps, arrow: 'round'});
expect(popper.querySelector(ARROW_SELECTOR)).toBe(null);
expect(popper.querySelector(SVG_ARROW_SELECTOR)).not.toBe(null);
expect(getChildren(popper).tooltip.hasAttribute('data-arrow')).toBe(true);
});
it('"round" -> false', () => {
const props = {...defaultProps, arrow: 'round'};
const popper = createPopperElement(1, props);
updatePopperElement(popper, props, {...defaultProps, arrow: false});
expect(popper.querySelector(ARROW_SELECTOR)).toBe(null);
expect(popper.querySelector(SVG_ARROW_SELECTOR)).toBe(null);
expect(getChildren(popper).tooltip.hasAttribute('data-arrow')).toBe(
false,
);
});
it('"round" -> true', () => {
const props = {...defaultProps, arrow: 'round'};
const popper = createPopperElement(1, props);
updatePopperElement(popper, props, {...defaultProps, arrow: true});
expect(popper.querySelector(ARROW_SELECTOR)).not.toBe(null);
expect(popper.querySelector(SVG_ARROW_SELECTOR)).toBe(null);
expect(getChildren(popper).tooltip.hasAttribute('data-arrow')).toBe(true);
});
it('"round" -> custom', () => {
const props = {...defaultProps, arrow: 'round'};
const popper = createPopperElement(1, props);
updatePopperElement(popper, props, {
...defaultProps,
arrow: document.createElement('article'),
});
expect(popper.querySelector(ARROW_SELECTOR)).toBe(null);
expect(popper.querySelector(SVG_ARROW_SELECTOR)).not.toBe(null);
expect(popper.querySelector('article')).not.toBe(null);
expect(getChildren(popper).tooltip.hasAttribute('data-arrow')).toBe(true);
});
});
it('sets interactive attribute', () => {
const popper = createPopperElement(1, defaultProps);
const newProps = {
...defaultProps,
interactive: true,
};
updatePopperElement(popper, defaultProps, newProps);
expect(getChildren(popper).tooltip.hasAttribute('data-interactive')).toBe(
true,
);
updatePopperElement(popper, newProps, {
...newProps,
interactive: false,
});
expect(getChildren(popper).tooltip.hasAttribute('data-interactive')).toBe(
false,
);
});
it('sets inertia attribute', () => {
const popper = createPopperElement(1, defaultProps);
const newProps = {
...defaultProps,
inertia: true,
};
updatePopperElement(popper, defaultProps, newProps);
expect(getChildren(popper).tooltip.hasAttribute('data-inertia')).toBe(true);
updatePopperElement(popper, newProps, {
...newProps,
inertia: false,
});
expect(getChildren(popper).tooltip.hasAttribute('data-inertia')).toBe(
false,
);
});
it('sets new theme', () => {
const popper = createPopperElement(1, defaultProps);
const newProps = {
...defaultProps,
theme: 'my custom themes',
};
const classList = getChildren(popper).tooltip.classList;
updatePopperElement(popper, defaultProps, newProps);
expect(classList.contains('my-theme')).toBe(true);
expect(classList.contains('custom-theme')).toBe(true);
expect(classList.contains('themes-theme')).toBe(true);
updatePopperElement(popper, newProps, {
...newProps,
theme: 'other',
});
expect(classList.contains('my-theme')).toBe(false);
expect(classList.contains('custom-theme')).toBe(false);
expect(classList.contains('themes-theme')).toBe(false);
expect(classList.contains('other-theme')).toBe(true);
});
});
describe('addInteractive', () => {
it('adds interactive attributes', () => {
const tooltip = div();
addInteractive(tooltip);
expect(tooltip.hasAttribute('data-interactive')).toBe(true);
});
});
describe('removeInteractive', () => {
it('removes interactive attributes', () => {
const tooltip = div();
addInteractive(tooltip);
removeInteractive(tooltip);
expect(tooltip.hasAttribute('data-interactive')).toBe(false);
});
});
describe('addInertia', () => {
it('adds inertia attribute', () => {
const tooltip = div();
addInertia(tooltip);
expect(tooltip.hasAttribute('data-inertia')).toBe(true);
});
});
describe('removeInertia', () => {
it('removes inertia attribute', () => {
const tooltip = div();
addInertia(tooltip);
removeInertia(tooltip);
expect(tooltip.hasAttribute('data-ineria')).toBe(false);
});
});
describe('getChildren', () => {
it('returns the children of the popper element, default props', () => {
const popper = createPopperElement(1, defaultProps);
const children = getChildren(popper);
expect(children.tooltip).toBeDefined();
expect(children.content).toBeDefined();
});
it('returns the children of the popper element, with arrow', () => {
const popper = createPopperElement(1, {...defaultProps, arrow: true});
const children = getChildren(popper);
expect(children.tooltip).toBeDefined();
expect(children.content).toBeDefined();
expect(children.arrow).toBeDefined();
});
it('returns the children of the popper element, with round arrow', () => {
const popper = createPopperElement(1, {
...defaultProps,
arrow: 'round',
});
const children = getChildren(popper);
expect(children.tooltip).toBeDefined();
expect(children.content).toBeDefined();
expect(children.arrow).toBeDefined();
});
});
describe('createArrowElement', () => {
it('returns a sharp arrow by default', () => {
const arrow = createArrowElement(defaultProps.arrow);
expect(arrow.matches(ARROW_SELECTOR)).toBe(true);
});
it('returns a round arrow if "round" is passed as argument', () => {
const roundArrow = createArrowElement('round');
expect(roundArrow.matches(SVG_ARROW_SELECTOR)).toBe(true);
});
});
describe('setContent', () => {
it('sets textContent of an element if `props.allowHTML` is `false`', () => {
const ref = h();
const content = 'some content';
setContent(ref, {allowHTML: false, content});
expect(ref.textContent).toBe(content);
expect(ref.querySelector('strong')).toBe(null);
});
it('sets innerHTML of an element if `props.allowHTML` is `true`', () => {
const ref = h();
const content = '<strong>some content</strong>';
setContent(ref, {allowHTML: true, content});
expect(ref.querySelector('strong')).not.toBe(null);
});
});
describe('isCursorOutsideInteractiveBorder', () => {
const distance = 10;
const interactiveBorder = 5;
const popperRect = {top: 100, left: 100, right: 110, bottom: 110};
const base = {popperRect, interactiveBorder};
function getMergedRect(rectA, rectB) {
return {
top: Math.min(rectA.top, rectB.top),
right: Math.max(rectA.right, rectB.right),
bottom: Math.max(rectA.bottom, rectB.bottom),
left: Math.min(rectA.left, rectB.left),
};
}
const data = {
top: {
tooltipRect: {
top: popperRect.top - distance,
left: popperRect.left,
right: popperRect.right,
bottom: popperRect.bottom - distance,
},
},
right: {
tooltipRect: {
top: popperRect.top,
left: popperRect.left + distance,
right: popperRect.right + distance,
bottom: popperRect.bottom,
},
},
bottom: {
tooltipRect: {
top: popperRect.top + distance,
left: popperRect.left,
right: popperRect.right,
bottom: popperRect.bottom + distance,
},
},
left: {
tooltipRect: {
top: popperRect.top,
left: popperRect.left - distance,
right: popperRect.right - distance,
bottom: popperRect.bottom,
},
},
};
Object.values(data).forEach(placementObject => {
const mergedRect = getMergedRect(popperRect, placementObject.tooltipRect);
placementObject.inside = [
{
clientX: mergedRect.left - interactiveBorder,
clientY: mergedRect.top - interactiveBorder,
},
{
clientX: mergedRect.left - interactiveBorder,
clientY: mergedRect.bottom + interactiveBorder,
},
{
clientX: mergedRect.right + interactiveBorder,
clientY: mergedRect.top - interactiveBorder,
},
{
clientX: mergedRect.right + interactiveBorder,
clientY: mergedRect.bottom + interactiveBorder,
},
];
placementObject.outside = [
// All outside
{
clientX: mergedRect.left - interactiveBorder - 1,
clientY: mergedRect.top - interactiveBorder - 1,
},
{
clientX: mergedRect.left - interactiveBorder - 1,
clientY: mergedRect.bottom + interactiveBorder + 1,
},
{
clientX: mergedRect.right + interactiveBorder + 1,
clientY: mergedRect.top - interactiveBorder - 1,
},
{
clientX: mergedRect.right + interactiveBorder + 1,
clientY: mergedRect.bottom + interactiveBorder + 1,
},
// x outside
{
clientX: mergedRect.left - interactiveBorder - 1,
clientY: mergedRect.top - interactiveBorder,
},
{
clientX: mergedRect.left - interactiveBorder - 1,
clientY: mergedRect.bottom + interactiveBorder,
},
{
clientX: mergedRect.right + interactiveBorder + 1,
clientY: mergedRect.top - interactiveBorder,
},
{
clientX: mergedRect.right + interactiveBorder + 1,
clientY: mergedRect.bottom + interactiveBorder,
},
// y outside
{
clientX: mergedRect.left - interactiveBorder,
clientY: mergedRect.top - interactiveBorder - 1,
},
{
clientX: mergedRect.left - interactiveBorder,
clientY: mergedRect.bottom + interactiveBorder + 1,
},
{
clientX: mergedRect.right + interactiveBorder,
clientY: mergedRect.top - interactiveBorder - 1,
},
{
clientX: mergedRect.right + interactiveBorder,
clientY: mergedRect.bottom + interactiveBorder + 1,
},
];
});
it('top inside', () => {
data.top.inside.forEach(coords => {
expect(
isCursorOutsideInteractiveBorder([{...base, ...data.top}], coords),
).toBe(false);
});
});
it('bottom inside', () => {
data.bottom.inside.forEach(coords => {
expect(
isCursorOutsideInteractiveBorder([{...base, ...data.bottom}], coords),
).toBe(false);
});
});
it('left inside', () => {
data.left.inside.forEach(coords => {
expect(
isCursorOutsideInteractiveBorder([{...base, ...data.left}], coords),
).toBe(false);
});
});
it('right inside', () => {
data.right.inside.forEach(coords => {
expect(
isCursorOutsideInteractiveBorder([{...base, ...data.right}], coords),
).toBe(false);
});
});
it('top outside', () => {
data.top.outside.forEach(coords => {
expect(
isCursorOutsideInteractiveBorder([{...base, ...data.top}], coords),
).toBe(true);
});
});
it('bottom outside', () => {
data.bottom.outside.forEach(coords => {
expect(
isCursorOutsideInteractiveBorder([{...base, ...data.bottom}], coords),
).toBe(true);
});
});
it('left outside', () => {
data.left.outside.forEach(coords => {
expect(
isCursorOutsideInteractiveBorder([{...base, ...data.left}], coords),
).toBe(true);
});
});
it('right outside', () => {
data.right.outside.forEach(coords => {
expect(
isCursorOutsideInteractiveBorder([{...base, ...data.right}], coords),
).toBe(true);
});
});
});
describe('getBasePlacement', () => {
it('returns the base value without shifting', () => {
const allPlacements = ['top', 'bottom', 'left', 'right'].reduce(
(acc, basePlacement) => [
...acc,
`${basePlacement}-start`,
`${basePlacement}-end`,
],
);
allPlacements.forEach(placement => {
expect(getBasePlacement(placement).endsWith('-start')).toBe(false);
expect(getBasePlacement(placement).endsWith('-end')).toBe(false);
});
});
it('returns an empty string if there is no placement', () => {
expect(getBasePlacement('')).toBe('');
});
});
describe('updateTheme', () => {
it('updates the theme on an element correctly', () => {
const div = document.createElement('div');
const theme = 'hello world';
updateTheme(div, 'add', theme);
expect(div.className).toBe('hello-theme world-theme');
updateTheme(div, 'remove', theme);
expect(div.className).toBe('');
});
it('does not add a `-theme` class if the theme is an empty string', () => {
const div = document.createElement('div');
updateTheme(div, 'add', '');
expect(div.className).toBe('');
});
it('ignores multiple whitespace characters in-between themes', () => {
const div = document.createElement('div');
const theme = 'hello world';
updateTheme(div, 'add', theme);
expect(div.className).toBe('hello-theme world-theme');
});
});
|
import { Directive, TemplateRef, Optional } from '@angular/core';
/**
* Represents the template for the major-time headers in the **Day** and **Week** views.
* To define the major-time header template, nest an `<ng-template>` tag with the `kendoSchedulerMajorTimeHeaderTemplate`
* directive inside the `<kendo-scheduler>`, or in the `<kendo-scheduler-day-view>` and `<kendo-scheduler-week-view>` components.
*
* The available fields in the template context are:
* - `date`—The date of the header.
*
* {% meta height:500 %}
* {% embed_file templates/major-header/app.component.ts preview %}
* {% embed_file templates/app.module.ts %}
* {% embed_file shared/main.ts %}
* {% embed_file shared/events-utc.ts %}
* {% endmeta %}
*/
var MajorTimeHeaderTemplateDirective = /** @class */ (function () {
function MajorTimeHeaderTemplateDirective(templateRef) {
this.templateRef = templateRef;
}
MajorTimeHeaderTemplateDirective.decorators = [
{ type: Directive, args: [{
selector: '[kendoSchedulerMajorTimeHeaderTemplate]'
},] },
];
/** @nocollapse */
MajorTimeHeaderTemplateDirective.ctorParameters = function () { return [
{ type: TemplateRef, decorators: [{ type: Optional }] }
]; };
return MajorTimeHeaderTemplateDirective;
}());
export { MajorTimeHeaderTemplateDirective };
|
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* This file was added automatically by CKEditor builder.
* You may re-use it at any time to build CKEditor again.
*
* If you would like to build CKEditor online again
* (for example to upgrade), visit one the following links:
*
* (1) http://ckeditor.com/builder
* Visit online builder to build CKEditor from scratch.
*
* (2) http://ckeditor.com/builder/06758509802c844606aeb9ae0b985755
* Visit online builder to build CKEditor, starting with the same setup as before.
*
* (3) http://ckeditor.com/builder/download/06758509802c844606aeb9ae0b985755
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
*
* NOTE:
* This file is not used by CKEditor, you may remove it.
* Changing this file will not change your CKEditor configuration.
*/
var CKBUILDER_CONFIG = {
skin: 'office2013',
preset: 'full',
ignore: [
'.DS_Store',
'.bender',
'.editorconfig',
'.gitattributes',
'.gitignore',
'.idea',
'.jscsrc',
'.jshintignore',
'.jshintrc',
'.mailmap',
'.travis.yml',
'bender-err.log',
'bender-out.log',
'bender.ci.js',
'bender.js',
'dev',
'gruntfile.js',
'less',
'node_modules',
'package.json',
'tests'
],
plugins : {
'a11yhelp' : 1,
'about' : 1,
'basicstyles' : 1,
'bidi' : 1,
'blockquote' : 1,
'clipboard' : 1,
'colorbutton' : 1,
'colordialog' : 1,
'contextmenu' : 1,
'copyformatting' : 1,
'dialogadvtab' : 1,
'div' : 1,
'elementspath' : 1,
'enterkey' : 1,
'entities' : 1,
'filebrowser' : 1,
'find' : 1,
'flash' : 1,
'floatingspace' : 1,
'font' : 1,
'format' : 1,
'forms' : 1,
'horizontalrule' : 1,
'htmlwriter' : 1,
'iframe' : 1,
'image' : 1,
'indentblock' : 1,
'indentlist' : 1,
'justify' : 1,
'language' : 1,
'link' : 1,
'list' : 1,
'liststyle' : 1,
'magicline' : 1,
'maximize' : 1,
'newpage' : 1,
'pagebreak' : 1,
'pastefromword' : 1,
'pastetext' : 1,
'preview' : 1,
'print' : 1,
'removeformat' : 1,
'resize' : 1,
'save' : 1,
'scayt' : 1,
'selectall' : 1,
'showblocks' : 1,
'showborders' : 1,
'smiley' : 1,
'sourcearea' : 1,
'specialchar' : 1,
'stylescombo' : 1,
'tab' : 1,
'table' : 1,
'tableselection' : 1,
'tabletools' : 1,
'templates' : 1,
'toolbar' : 1,
'undo' : 1,
'uploadimage' : 1,
'wsc' : 1,
'wysiwygarea' : 1
},
languages : {
'en' : 1,
'vi' : 1
}
};
|
import React from "react";
import { makeStyles } from "@material-ui/core/styles";
import Grid from "@material-ui/core/Grid";
import AppBar from "@material-ui/core/AppBar";
import Tabs from "@material-ui/core/Tabs";
import Tab from "@material-ui/core/Tab";
import Notifications from "./Notification";
import Mentions from "./Mentions";
import "roboto-fontface";
const useStyles = makeStyles((theme) => ({
root: {
flexGrow: 1,
position: "static",
background: "white",
color: "gray",
marginLeft: "1%",
},
tab: {
fontWeight: 800,
"&:active": {
backgroundColor: "rgba(29,161,242,1.00)",
color: "white",
},
"&:focus": {
color: "rgba(29,161,242,1.00)",
},
},
}));
export default function NotificationsPage() {
const classes = useStyles();
const [value, setValue] = React.useState(0);
const [tab, setTab] = React.useState("notifications");
const handleChange = (event, newValue) => {
setValue(newValue);
};
return (
<Grid container>
<Grid item xs={12}>
<AppBar elevation={1} component="nav" className={classes.root}>
<Tabs
variant="fullWidth"
value={value}
indicatorColor="primary"
onChange={handleChange}
centered
>
<Tab
label="All"
onClick={() => setTab("notifications")}
className={classes.tab}
/>
<Tab
label="Mentions"
onClick={() => setTab("mentions")}
className={classes.tab}
/>
</Tabs>
</AppBar>
</Grid>
<Grid item xs={12}>
{tab === "notifications" && <Notifications />}
{tab === "mentions" && <Mentions />}
</Grid>
</Grid>
);
}
|
"""
Question Source: https://leetcode.com/problems/complement-of-base-10-integer/
Level: Easy
Topic: Bitwise Operation
Solver: Tayyrov
Date: 04.01.2022
"""
# Layman's solution:
def bitwiseComplement1(N: int) -> int:
binary = bin(N)[2:]
bn = ""
for i in binary:
if i == "0":
bn += "1"
else:
bn += "0"
return int(bn, 2)
# better Solution:
def bitwiseComplement2(N: int) -> int:
LEN = len(bin(N)[2:])
# Largest power of 2 that covers most significant bit in N:
largest_power_two = 2**LEN
all_ones = largest_power_two - 1
return all_ones - N # ex if N==5 It is in binary == 101 and 2**3 = 8, 8 -1 = 7 which is 111 in binary and
# 111- 101 = 010 == 2 , which is 7 - 5
def check():
assert bitwiseComplement1(5) == 2
assert bitwiseComplement2(5) == 2
print("All run is OK")
check()
|
import React from 'react';
import { AppBar, Tabs, Tab } from '@material-ui/core'
import { NavLink } from 'react-router-dom';
const Navigation = () => {
return (
<div>
<AppBar position="static" style={{ backgroundColor: "rgba(73, 3, 40, 0.81)"}}>
<Tabs >
<NavLink style={{textDecoration:'none', color: '#fff'}} to="/"><Tab label="Home"/></NavLink>
<NavLink style={{textDecoration:'none', color: '#fff'}} to="/cities"><Tab label="Cities Attractions"/></NavLink>
{/* <NavLink style={{textDecoration:'none', color: '#fff'}} to="/about"><Tab label="About"/></NavLink> */}
</Tabs>
{/* <NavLink to="/">Home</NavLink>
<NavLink to="/flights">Flights</NavLink> */}
{/* <NavLink to="/cities">Cities</NavLink>
<NavLink to="/about">About</NavLink> */}
</AppBar>
</div>
);
}
export default Navigation;
|
import pytz
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.utils import timezone
import bson
import datetime
import calendar
class DatabaseOperations(BaseDatabaseOperations):
def quote_name(self, name):
if name.startswith('"') and name.endswith('"'):
return name
return '"{}"'.format(name)
def adapt_datefield_value(self, value):
if value is None:
return None
if isinstance(value, datetime.datetime) and timezone.is_aware(value):
raise ValueError(
"Djongo backend does not support timezone-aware dates.")
x = calendar.timegm(value.timetuple())
# this is presuming that UTC info is needed; anything after 'replace'
# can be deleted for 'dt' if not.
dt = datetime.datetime(1970, 1, 1).replace(
tzinfo=datetime.timezone.utc)
if x < 0:
return dt + datetime.timedelta(seconds=x)
else:
return datetime.datetime.utcfromtimestamp(calendar.timegm(
value.timetuple()))
def adapt_datetimefield_value(self, value):
if value is None:
return None
if isinstance(value, datetime.datetime) and timezone.is_aware(value):
if settings.USE_TZ:
value = timezone.make_naive(value, self.connection.timezone)
else:
raise ValueError(
"Djongo backend does not support timezone-aware datetimes when USE_TZ is False.")
return value
def adapt_timefield_value(self, value):
if value is None:
return None
if isinstance(value, str):
return datetime.datetime.strptime(value, '%H:%M:%S')
if timezone.is_aware(value):
raise ValueError(
"Djongo backend does not support timezone-aware times.")
return datetime.datetime(1900, 1, 1, value.hour, value.minute,
value.second, value.microsecond)
def adapt_decimalfield_value(self, value, max_digits=None, decimal_places=None):
if value is None:
return None
return bson.Decimal128(super().adapt_decimalfield_value(value, max_digits, decimal_places))
def convert_datefield_value(self, value, expression, connection):
if isinstance(value, datetime.datetime):
if settings.USE_TZ:
value = timezone.make_aware(value, self.connection.timezone)
value = value.date()
return value
def convert_timefield_value(self, value, expression, connection):
if isinstance(value, datetime.datetime):
if settings.USE_TZ:
value = timezone.make_aware(value, self.connection.timezone)
value = value.time()
return value
def convert_datetimefield_value(self, value, expression, connection):
if isinstance(value, datetime.datetime):
if settings.USE_TZ:
value = timezone.make_aware(value, self.connection.timezone)
return value
def get_db_converters(self, expression):
converters = super(DatabaseOperations,
self).get_db_converters(expression)
internal_type = expression.output_field.get_internal_type()
if internal_type == 'DateField':
converters.append(self.convert_datefield_value)
elif internal_type == 'TimeField':
converters.append(self.convert_timefield_value)
elif internal_type == 'DateTimeField':
converters.append(self.convert_datetimefield_value)
return converters
def sql_flush(self, style, tables, reset_sequences, allow_cascade=False):
# TODO: Need to implement this fully
return [f'ALTER TABLE "{table}" FLUSH'
for table in tables]
def max_name_length(self):
return 60
def no_limit_value(self):
return None
def bulk_insert_sql(self, fields, placeholder_rows):
return ' '.join(
'VALUES (%s)' % ', '.join(row)
for row in placeholder_rows
)
def date_extract_sql(self, lookup_type, field_name):
return "EXTRACT('%s' FROM %s)" % (lookup_type, field_name)
def date_trunc_sql(self, lookup_type, field_name):
return "DATE_TRUNC('%s', %s)" % (lookup_type, field_name)
|
let nock = require('nock');
module.exports.hash = "5da92d9d0a0edaf988b521bc719c71e1";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://endpoint:443', {"encodedQueryParams":true})
.delete('/metricsadvisor/v1.0/dataFeeds/3487f956-53b3-4120-ab9d-40f2eaa8f17c')
.reply(204, "", [
'Content-Length',
'0',
'x-request-id',
'f726caff-7571-469b-944b-e695593ab0da',
'x-envoy-upstream-service-time',
'234',
'apim-request-id',
'f726caff-7571-469b-944b-e695593ab0da',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains; preload',
'x-content-type-options',
'nosniff',
'Date',
'Tue, 20 Oct 2020 22:50:47 GMT',
'Connection',
'close'
]);
nock('https://endpoint:443', {"encodedQueryParams":true})
.get('/metricsadvisor/v1.0/dataFeeds/3487f956-53b3-4120-ab9d-40f2eaa8f17c')
.reply(404, {"code":"ERROR_INVALID_PARAMETER","message":"datafeedId is invalid."}, [
'Content-Length',
'69',
'Content-Type',
'application/json; charset=utf-8',
'x-request-id',
'45d8a69e-c330-4834-a491-53af09701b03',
'x-envoy-upstream-service-time',
'46',
'apim-request-id',
'45d8a69e-c330-4834-a491-53af09701b03',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains; preload',
'x-content-type-options',
'nosniff',
'Date',
'Tue, 20 Oct 2020 22:50:48 GMT',
'Connection',
'close'
]);
|
const nodeExternals = require('webpack-node-externals');
const path = require('path');
module.exports = {
/*
** Headers of the page
*/
head: {
title: 'booklist',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Nuxt.js project' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
/*
** Customize the progress bar color
*/
loading: { color: '#3B8070' },
/*
** Build configuration
*/
build: {
vendor: [
'element-ui',
'vue-awesome'
],
extend (config, { isServer }) {
if (isServer) {
config.externals = [
nodeExternals({
// default value for `whitelist` is
// [/es6-promise|\.(?!(?:js|json)$).{1,5}$/i]
whitelist: [/es6-promise|\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/]
})
];
}
}
},
plugins: [
'~/plugins/element-ui.js',
'~/plugins/fa.js'
],
rootDir: path.resolve(__dirname),
dev: process.env.NODE_ENV !== 'production',
css: [
'~/assets/css/main.scss'
]
};
|
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# The sources are kept automatically in sync with BUILD.gn.
{
'variables': {
'v8_code': 1,
'unittests_sources': [ ### gcmole(all) ###
'api/access-check-unittest.cc',
'api/exception-unittest.cc',
'api/interceptor-unittest.cc',
'api/isolate-unittest.cc',
'api/remote-object-unittest.cc',
'api/v8-object-unittest.cc',
'asmjs/asm-scanner-unittest.cc',
'asmjs/asm-types-unittest.cc',
'asmjs/switch-logic-unittest.cc',
'base/atomic-utils-unittest.cc',
'base/bits-unittest.cc',
'base/cpu-unittest.cc',
'base/division-by-constant-unittest.cc',
'base/flags-unittest.cc',
'base/functional-unittest.cc',
'base/ieee754-unittest.cc',
'base/logging-unittest.cc',
'base/macros-unittest.cc',
'base/iterator-unittest.cc',
'base/ostreams-unittest.cc',
'base/platform/condition-variable-unittest.cc',
'base/platform/mutex-unittest.cc',
'base/platform/platform-unittest.cc',
'base/platform/semaphore-unittest.cc',
'base/platform/time-unittest.cc',
'base/sys-info-unittest.cc',
'base/template-utils-unittest.cc',
'base/utils/random-number-generator-unittest.cc',
'bigint-unittest.cc',
'cancelable-tasks-unittest.cc',
'char-predicates-unittest.cc',
"code-stub-assembler-unittest.cc",
"code-stub-assembler-unittest.h",
'compiler/branch-elimination-unittest.cc',
'compiler/bytecode-analysis-unittest.cc',
'compiler/checkpoint-elimination-unittest.cc',
"compiler/code-assembler-unittest.cc",
"compiler/code-assembler-unittest.h",
'compiler/common-operator-reducer-unittest.cc',
'compiler/common-operator-unittest.cc',
'compiler/compiler-test-utils.h',
'compiler/control-equivalence-unittest.cc',
'compiler/control-flow-optimizer-unittest.cc',
'compiler/dead-code-elimination-unittest.cc',
'compiler/diamond-unittest.cc',
'compiler/effect-control-linearizer-unittest.cc',
'compiler/graph-reducer-unittest.cc',
'compiler/graph-reducer-unittest.h',
'compiler/graph-trimmer-unittest.cc',
'compiler/graph-unittest.cc',
'compiler/graph-unittest.h',
'compiler/instruction-unittest.cc',
'compiler/instruction-selector-unittest.cc',
'compiler/instruction-selector-unittest.h',
'compiler/instruction-sequence-unittest.cc',
'compiler/instruction-sequence-unittest.h',
'compiler/int64-lowering-unittest.cc',
'compiler/js-builtin-reducer-unittest.cc',
'compiler/js-create-lowering-unittest.cc',
'compiler/js-intrinsic-lowering-unittest.cc',
'compiler/js-operator-unittest.cc',
'compiler/js-typed-lowering-unittest.cc',
'compiler/linkage-tail-call-unittest.cc',
'compiler/live-range-builder.h',
'compiler/regalloc/live-range-unittest.cc',
'compiler/load-elimination-unittest.cc',
'compiler/loop-peeling-unittest.cc',
'compiler/machine-operator-reducer-unittest.cc',
'compiler/machine-operator-unittest.cc',
'compiler/regalloc/move-optimizer-unittest.cc',
'compiler/node-cache-unittest.cc',
'compiler/node-matchers-unittest.cc',
'compiler/node-properties-unittest.cc',
'compiler/node-test-utils.cc',
'compiler/node-test-utils.h',
'compiler/node-unittest.cc',
'compiler/opcodes-unittest.cc',
'compiler/persistent-unittest.cc',
'compiler/regalloc/register-allocator-unittest.cc',
'compiler/schedule-unittest.cc',
'compiler/scheduler-unittest.cc',
'compiler/scheduler-rpo-unittest.cc',
'compiler/simplified-operator-reducer-unittest.cc',
'compiler/simplified-operator-unittest.cc',
'compiler/state-values-utils-unittest.cc',
'compiler/typed-optimization-unittest.cc',
'compiler/typer-unittest.cc',
'compiler/value-numbering-reducer-unittest.cc',
'compiler/zone-stats-unittest.cc',
'compiler-dispatcher/compiler-dispatcher-tracer-unittest.cc',
'compiler-dispatcher/compiler-dispatcher-unittest.cc',
'compiler-dispatcher/optimizing-compile-dispatcher-unittest.cc',
'compiler-dispatcher/unoptimized-compile-job-unittest.cc',
'counters-unittest.cc',
'detachable-vector-unittest.cc',
'eh-frame-iterator-unittest.cc',
'eh-frame-writer-unittest.cc',
'heap/barrier-unittest.cc',
'heap/bitmap-unittest.cc',
'heap/embedder-tracing-unittest.cc',
'heap/gc-idle-time-handler-unittest.cc',
'heap/gc-tracer-unittest.cc',
'heap/item-parallel-job-unittest.cc',
'heap/marking-unittest.cc',
'heap/memory-reducer-unittest.cc',
'heap/heap-unittest.cc',
'heap/scavenge-job-unittest.cc',
'heap/slot-set-unittest.cc',
'heap/spaces-unittest.cc',
'heap/unmapper-unittest.cc',
'heap/worklist-unittest.cc',
'interpreter/bytecodes-unittest.cc',
'interpreter/bytecode-array-builder-unittest.cc',
'interpreter/bytecode-array-iterator-unittest.cc',
'interpreter/bytecode-array-random-iterator-unittest.cc',
'interpreter/bytecode-array-writer-unittest.cc',
'interpreter/bytecode-decoder-unittest.cc',
'interpreter/bytecode-node-unittest.cc',
'interpreter/bytecode-operands-unittest.cc',
'interpreter/bytecode-register-allocator-unittest.cc',
'interpreter/bytecode-register-optimizer-unittest.cc',
'interpreter/bytecode-source-info-unittest.cc',
'interpreter/bytecode-utils.h',
'interpreter/constant-array-builder-unittest.cc',
'interpreter/interpreter-assembler-unittest.cc',
'interpreter/interpreter-assembler-unittest.h',
'libplatform/default-platform-unittest.cc',
'libplatform/task-queue-unittest.cc',
'libplatform/worker-thread-unittest.cc',
'locked-queue-unittest.cc',
'object-unittest.cc',
'parser/ast-value-unittest.cc',
'parser/preparser-unittest.cc',
'register-configuration-unittest.cc',
'run-all-unittests.cc',
'source-position-table-unittest.cc',
'test-helpers.cc',
'test-helpers.h',
'test-utils.h',
'test-utils.cc',
'unicode-unittest.cc',
'utils-unittest.cc',
'value-serializer-unittest.cc',
'zone/segmentpool-unittest.cc',
'zone/zone-allocator-unittest.cc',
'zone/zone-chunk-list-unittest.cc',
'zone/zone-unittest.cc',
'wasm/control-transfer-unittest.cc',
'wasm/decoder-unittest.cc',
'wasm/function-body-decoder-unittest.cc',
'wasm/wasm-heap-unittest.cc',
'wasm/leb-helper-unittest.cc',
'wasm/loop-assignment-analysis-unittest.cc',
'wasm/module-decoder-unittest.cc',
'wasm/streaming-decoder-unittest.cc',
'wasm/trap-handler-unittest.cc',
'wasm/wasm-macro-gen-unittest.cc',
'wasm/wasm-module-builder-unittest.cc',
'wasm/wasm-opcodes-unittest.cc',
],
'unittests_sources_arm': [ ### gcmole(arch:arm) ###
'compiler/arm/instruction-selector-arm-unittest.cc',
],
'unittests_sources_arm64': [ ### gcmole(arch:arm64) ###
'compiler/arm64/instruction-selector-arm64-unittest.cc',
],
'unittests_sources_ia32': [ ### gcmole(arch:ia32) ###
'compiler/ia32/instruction-selector-ia32-unittest.cc',
],
'unittests_sources_mips': [ ### gcmole(arch:mips) ###
'compiler/mips/instruction-selector-mips-unittest.cc',
],
'unittests_sources_mips64': [ ### gcmole(arch:mips64) ###
'compiler/mips64/instruction-selector-mips64-unittest.cc',
],
'unittests_sources_x64': [ ### gcmole(arch:x64) ###
'compiler/x64/instruction-selector-x64-unittest.cc',
],
'unittests_sources_ppc': [ ### gcmole(arch:ppc) ###
'compiler/ppc/instruction-selector-ppc-unittest.cc',
],
'unittests_sources_s390': [ ### gcmole(arch:s390) ###
'compiler/s390/instruction-selector-s390-unittest.cc',
],
},
'includes': ['../../gypfiles/toolchain.gypi', '../../gypfiles/features.gypi'],
'targets': [
{
'target_name': 'unittests',
'type': 'executable',
'variables': {
'optimize': 'max',
},
'dependencies': [
'../../testing/gmock.gyp:gmock',
'../../testing/gtest.gyp:gtest',
'../../src/v8.gyp:v8',
'../../src/v8.gyp:v8_libbase',
'../../src/v8.gyp:v8_libplatform',
'../../src/v8.gyp:v8_maybe_snapshot',
],
'include_dirs': [
'../..',
],
'sources': [
'<@(unittests_sources)',
],
'conditions': [
['v8_target_arch=="arm"', {
'sources': [
'<@(unittests_sources_arm)',
],
}],
['v8_target_arch=="arm64"', {
'sources': [
'<@(unittests_sources_arm64)',
],
}],
['v8_target_arch=="ia32"', {
'sources': [
'<@(unittests_sources_ia32)',
],
}],
['v8_target_arch=="mips"', {
'sources': [
'<@(unittests_sources_mips)',
],
}],
['v8_target_arch=="mipsel"', {
'sources': [
'<@(unittests_sources_mips)',
],
}],
['v8_target_arch=="mips64"', {
'sources': [
'<@(unittests_sources_mips64)',
],
}],
['v8_target_arch=="mips64el"', {
'sources': [
'<@(unittests_sources_mips64)',
],
}],
['v8_target_arch=="x64"', {
'sources': [
'<@(unittests_sources_x64)',
],
}],
['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
'sources': [
'<@(unittests_sources_ppc)',
],
}],
['v8_target_arch=="s390" or v8_target_arch=="s390x"', {
'sources': [
'<@(unittests_sources_s390)',
],
}],
['OS=="aix"', {
'ldflags': [ '-Wl,-bbigtoc' ],
}],
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
['v8_use_snapshot=="true"', {
'dependencies': ['../../src/v8.gyp:v8_initializers'],
}],
],
},
],
'conditions': [
['test_isolation_mode != "noop"', {
'targets': [
{
'target_name': 'unittests_run',
'type': 'none',
'dependencies': [
'unittests',
],
'includes': [
'../../gypfiles/isolate.gypi',
],
'sources': [
'unittests.isolate',
],
},
],
}],
],
}
|