From ceed2be120231677d3c86fdb91ef6ef874a03769 Mon Sep 17 00:00:00 2001 From: ronreg-ribdev <56719257+ronreg-ribdev@users.noreply.github.com> Date: Sun, 10 May 2020 04:30:23 -0700 Subject: [PATCH] Initial bart-app commit --- .urbitrc | 2 +- dist/index.js | 16 + {full/src => dist}/js/api.js | 6 +- dist/js/components/lib/header-bar.js | 48 + dist/js/components/lib/icons/icon-home.js | 15 + dist/js/components/lib/icons/icon-spinner.js | 9 + dist/js/components/lib/icons/sigil.js | 32 + dist/js/components/root.js | 33 + {full/src => dist}/js/lib/util.js | 0 {full/src => dist}/js/reducers/config.js | 2 +- {full/src => dist}/js/reducers/initial.js | 0 {full/src => dist}/js/reducers/update.js | 0 {full/src => dist}/js/store.js | 0 {full/src => dist}/js/subscription.js | 8 +- {full/src => dist}/js/vendor/sigils-1.2.5.js | 0 dist/tile.js | 20 + full/gulpfile.js | 164 - full/tile/tile.js | 20 - gulpfile.js | 96 +- package-lock.json | 52 +- {full/src => src}/css/custom.css | 0 {full/src => src}/css/fonts.css | 0 {full/src => src}/css/indigo-static.css | 0 {full/src => src}/index.css | 0 {full/src => src}/index.js | 0 src/js/api.js | 49 + .../js/components/lib/header-bar.js | 0 .../js/components/lib/icons/icon-home.js | 2 +- .../js/components/lib/icons/icon-spinner.js | 0 .../js/components/lib/icons/sigil.js | 0 {full/src => src}/js/components/root.js | 6 +- src/js/lib/util.js | 82 + src/js/reducers/config.js | 11 + src/js/reducers/initial.js | 11 + src/js/reducers/update.js | 17 + src/js/store.js | 35 + src/js/subscription.js | 34 + src/js/vendor/sigils-1.2.5.js | 1 + tile/tile.js | 9 +- .../app/smol.hoon => urbit/app/barttile.hoon | 34 +- urbit/app/barttile/css/index.css | 1 + .../smol => urbit/app/barttile}/img/Home.png | Bin .../smol => urbit/app/barttile}/img/Tile.png | Bin .../smol => urbit/app/barttile}/index.html | 6 +- urbit/app/barttile/js/index.js | 57320 ++++++++++++++++ urbit/app/barttile/js/tile.js | 19193 ++++++ urbit/app/smol.hoon | 71 - 47 files changed, 77092 insertions(+), 313 deletions(-) create mode 100644 dist/index.js rename {full/src => dist}/js/api.js (85%) create mode 100644 dist/js/components/lib/header-bar.js create mode 100644 dist/js/components/lib/icons/icon-home.js create mode 100644 dist/js/components/lib/icons/icon-spinner.js create mode 100644 dist/js/components/lib/icons/sigil.js create mode 100644 dist/js/components/root.js rename {full/src => dist}/js/lib/util.js (100%) rename {full/src => dist}/js/reducers/config.js (75%) rename {full/src => dist}/js/reducers/initial.js (100%) rename {full/src => dist}/js/reducers/update.js (100%) rename {full/src => dist}/js/store.js (100%) rename {full/src => dist}/js/subscription.js (74%) rename {full/src => dist}/js/vendor/sigils-1.2.5.js (100%) create mode 100644 dist/tile.js delete mode 100644 full/gulpfile.js delete mode 100644 full/tile/tile.js rename {full/src => src}/css/custom.css (100%) rename {full/src => src}/css/fonts.css (100%) rename {full/src => src}/css/indigo-static.css (100%) rename {full/src => src}/index.css (100%) rename {full/src => src}/index.js (100%) create mode 100644 src/js/api.js rename {full/src => src}/js/components/lib/header-bar.js (100%) rename {full/src => src}/js/components/lib/icons/icon-home.js (88%) rename {full/src => src}/js/components/lib/icons/icon-spinner.js (100%) rename {full/src => src}/js/components/lib/icons/sigil.js (100%) rename {full/src => src}/js/components/root.js (82%) create mode 100644 src/js/lib/util.js create mode 100644 src/js/reducers/config.js create mode 100644 src/js/reducers/initial.js create mode 100644 src/js/reducers/update.js create mode 100644 src/js/store.js create mode 100644 src/js/subscription.js create mode 100644 src/js/vendor/sigils-1.2.5.js rename full/urbit/app/smol.hoon => urbit/app/barttile.hoon (69%) create mode 100644 urbit/app/barttile/css/index.css rename {full/urbit/app/smol => urbit/app/barttile}/img/Home.png (100%) rename {full/urbit/app/smol => urbit/app/barttile}/img/Tile.png (100%) rename {full/urbit/app/smol => urbit/app/barttile}/index.html (68%) create mode 100644 urbit/app/barttile/js/index.js create mode 100644 urbit/app/barttile/js/tile.js delete mode 100644 urbit/app/smol.hoon diff --git a/.urbitrc b/.urbitrc index b53c38e..b99d19b 100644 --- a/.urbitrc +++ b/.urbitrc @@ -1,5 +1,5 @@ module.exports = { URBIT_PIERS: [ - "%URBITPIER%", + "/home/greg/code/zod/home", ] }; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..9fe7ef8 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,16 @@ +const _jsxFileName = "/home/greg/code/bart-tile/src/index.js";import React from 'react'; +import ReactDOM from 'react-dom'; +import { Root } from '/components/root'; +import { api } from '/api'; +import { store } from '/store'; +import { subscription } from "/subscription"; + +api.setAuthTokens({ + ship: window.ship +}); + +subscription.start(); + +ReactDOM.render(( + React.createElement(Root, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 15}} ) +), document.querySelectorAll("#root")[0]); diff --git a/full/src/js/api.js b/dist/js/api.js similarity index 85% rename from full/src/js/api.js rename to dist/js/api.js index 317d454..03aa3b6 100644 --- a/full/src/js/api.js +++ b/dist/js/api.js @@ -8,7 +8,7 @@ class UrbitApi { this.bindPaths = []; } - bind(path, method, ship = this.authTokens.ship, appl = "%APPNAME%", success, fail) { + bind(path, method, ship = this.authTokens.ship, appl = "barttile", success, fail) { this.bindPaths = _.uniq([...this.bindPaths, path]); window.subscriptionId = window.urb.subscribe(ship, appl, path, @@ -29,8 +29,8 @@ class UrbitApi { }); } - %APPNAME%(data) { - this.action("%APPNAME%", "json", data); + barttile(data) { + this.action("barttile", "json", data); } action(appl, mark, data) { diff --git a/dist/js/components/lib/header-bar.js b/dist/js/components/lib/header-bar.js new file mode 100644 index 0000000..d1aa78a --- /dev/null +++ b/dist/js/components/lib/header-bar.js @@ -0,0 +1,48 @@ +const _jsxFileName = "/home/greg/code/bart-tile/src/js/components/lib/header-bar.js";import React, { Component } from "react"; +import { cite } from '../../lib/util'; +import { IconHome } from "/components/lib/icons/icon-home"; +import { Sigil } from "/components/lib/icons/sigil"; + +export class HeaderBar extends Component { + render() { + + let title = document.title === "Home" ? "" : document.title; + + return ( + React.createElement('div', { + className: + "bg-white bg-gray0-d w-100 justify-between relative tc pt3 db" + , + style: { height: 40 }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 12}} + , React.createElement('a', { + className: "dib gray2 f9 inter absolute left-0" , + href: "/", + style: { top: 14 }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 17}} + , React.createElement(IconHome, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 21}}) + , React.createElement('span', { + className: "ml2 white-d v-top lh-title" , + style: { paddingTop: 3 }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 22}}, "Home" + + ) + ) + , React.createElement('span', { + className: "f9 white-d inter dib" , + style: { + verticalAlign: "text-top", + paddingTop: 3 + }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 28}} + , title + ) + , React.createElement('div', { className: "absolute right-0 lh-copy" , style: { top: 8 }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 36}} + , React.createElement(Sigil, { + ship: "~" + window.ship, + classes: "v-mid mix-blend-diff" , + size: 16, + color: "#000000", __self: this, __source: {fileName: _jsxFileName, lineNumber: 37}} + ) + , React.createElement('span', { className: "mono white-d f9 ml2 c-default" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 43}}, cite(window.ship)) + ) + ) + ); + } +} diff --git a/dist/js/components/lib/icons/icon-home.js b/dist/js/components/lib/icons/icon-home.js new file mode 100644 index 0000000..adc8cbb --- /dev/null +++ b/dist/js/components/lib/icons/icon-home.js @@ -0,0 +1,15 @@ +const _jsxFileName = "/home/greg/code/bart-tile/src/js/components/lib/icons/icon-home.js";import React, { Component } from "react"; + +export class IconHome extends Component { + render() { + let classes = !!this.props.classes ? this.props.classes : ""; + return ( + React.createElement('img', { + className: "invert-d " + classes, + src: "/~barttile/img/Home.png", + width: 16, + height: 16, __self: this, __source: {fileName: _jsxFileName, lineNumber: 7}} + ) + ); + } +} diff --git a/dist/js/components/lib/icons/icon-spinner.js b/dist/js/components/lib/icons/icon-spinner.js new file mode 100644 index 0000000..60c5627 --- /dev/null +++ b/dist/js/components/lib/icons/icon-spinner.js @@ -0,0 +1,9 @@ +const _jsxFileName = "/home/greg/code/bart-tile/src/js/components/lib/icons/icon-spinner.js";import React, { Component } from 'react'; + +export class IconSpinner extends Component { + render() { + return ( + React.createElement('div', { className: "spinner-pending", __self: this, __source: {fileName: _jsxFileName, lineNumber: 6}}) + ); + } +} diff --git a/dist/js/components/lib/icons/sigil.js b/dist/js/components/lib/icons/sigil.js new file mode 100644 index 0000000..d848345 --- /dev/null +++ b/dist/js/components/lib/icons/sigil.js @@ -0,0 +1,32 @@ +const _jsxFileName = "/home/greg/code/bart-tile/src/js/components/lib/icons/sigil.js";import React, { Component } from 'react'; +import { sigil, reactRenderer } from 'urbit-sigil-js'; + + +export class Sigil extends Component { + render() { + const { props } = this; + + let classes = props.classes || ""; + + if (props.ship.length > 14) { + return ( + React.createElement('div', { + className: "bg-black dib " + classes, + style: { width: props.size, height: props.size }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 13}} + ) + ); + } else { + return ( + React.createElement('div', { className: "dib " + classes, style: { flexBasis: 32, backgroundColor: props.color }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 20}} + , sigil({ + patp: props.ship, + renderer: reactRenderer, + size: props.size, + colors: [props.color, "white"] + }) + ) + ); + } + } +} + diff --git a/dist/js/components/root.js b/dist/js/components/root.js new file mode 100644 index 0000000..32b5603 --- /dev/null +++ b/dist/js/components/root.js @@ -0,0 +1,33 @@ +const _jsxFileName = "/home/greg/code/bart-tile/src/js/components/root.js";import React, { Component } from 'react'; +import { BrowserRouter, Route } from "react-router-dom"; +import _ from 'lodash'; +import { HeaderBar } from "./lib/header-bar.js" + + +export class Root extends Component { + constructor(props) { + super(props); + } + + render() { + + return ( + React.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 15}} + , React.createElement('div', { className: "absolute h-100 w-100 bg-gray0-d ph4-m ph4-l ph4-xl pb4-m pb4-l pb4-xl" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 16}} + , React.createElement(HeaderBar, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 17}}) + , React.createElement(Route, { exact: true, path: "/~barttile", render: () => { + return ( + React.createElement('div', { className: "cf w-100 flex flex-column pa4 ba-m ba-l ba-xl b--gray2 br1 h-100 h-100-minus-40-s h-100-minus-40-m h-100-minus-40-l h-100-minus-40-xl f9 white-d overflow-x-hidden" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 20}} + , React.createElement('h1', { className: "mt0 f8 fw4" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 21}}, "barttile") + , React.createElement('p', { className: "lh-copy measure pt3" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 22}}, "Welcome to your Landscape application." ) + , React.createElement('p', { className: "lh-copy measure pt3" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 23}}, "To get started, edit " , React.createElement('code', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 23}}, "src/index.js"), ", " , React.createElement('code', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 23}}, "tile/tile.js"), " or " , React.createElement('code', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 23}}, "urbit/app/barttile.hoon"), " and " , React.createElement('code', {__self: this, __source: {fileName: _jsxFileName, lineNumber: 23}}, "|commit %home" ), " on your Urbit ship to see your changes." ) + , React.createElement('a', { className: "black no-underline db f8 pt3" , href: "https://urbit.org/docs", __self: this, __source: {fileName: _jsxFileName, lineNumber: 24}}, "-> Read the docs" ) + ) + )}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 18}} + ) + ) + ) + ) + } +} + diff --git a/full/src/js/lib/util.js b/dist/js/lib/util.js similarity index 100% rename from full/src/js/lib/util.js rename to dist/js/lib/util.js diff --git a/full/src/js/reducers/config.js b/dist/js/reducers/config.js similarity index 75% rename from full/src/js/reducers/config.js rename to dist/js/reducers/config.js index f4ea3a2..98b0ab0 100644 --- a/full/src/js/reducers/config.js +++ b/dist/js/reducers/config.js @@ -3,7 +3,7 @@ import _ from 'lodash'; export class ConfigReducer { reduce(json, state) { - let data = _.get(json, '%APPNAME%', false); + let data = _.get(json, 'barttile', false); if (data) { state.inbox = data.inbox; } diff --git a/full/src/js/reducers/initial.js b/dist/js/reducers/initial.js similarity index 100% rename from full/src/js/reducers/initial.js rename to dist/js/reducers/initial.js diff --git a/full/src/js/reducers/update.js b/dist/js/reducers/update.js similarity index 100% rename from full/src/js/reducers/update.js rename to dist/js/reducers/update.js diff --git a/full/src/js/store.js b/dist/js/store.js similarity index 100% rename from full/src/js/store.js rename to dist/js/store.js diff --git a/full/src/js/subscription.js b/dist/js/subscription.js similarity index 74% rename from full/src/js/subscription.js rename to dist/js/subscription.js index e49306d..483b5fc 100644 --- a/full/src/js/subscription.js +++ b/dist/js/subscription.js @@ -7,14 +7,14 @@ import urbitOb from 'urbit-ob'; export class Subscription { start() { if (api.authTokens) { - // this.initialize%APPNAME%(); + // this.initializebarttile(); } else { console.error("~~~ ERROR: Must set api.authTokens before operation ~~~"); } } - // initialize%APPNAME%() { - // api.bind('/primary', 'PUT', api.authTokens.ship, '%APPNAME%', + // initializebarttile() { + // api.bind('/primary', 'PUT', api.authTokens.ship, 'barttile', // this.handleEvent.bind(this), // this.handleError.bind(this)); // } @@ -25,7 +25,7 @@ export class Subscription { handleError(err) { console.error(err); - api.bind('/primary', 'PUT', api.authTokens.ship, '%APPNAME%', + api.bind('/primary', 'PUT', api.authTokens.ship, 'barttile', this.handleEvent.bind(this), this.handleError.bind(this)); } diff --git a/full/src/js/vendor/sigils-1.2.5.js b/dist/js/vendor/sigils-1.2.5.js similarity index 100% rename from full/src/js/vendor/sigils-1.2.5.js rename to dist/js/vendor/sigils-1.2.5.js diff --git a/dist/tile.js b/dist/tile.js new file mode 100644 index 0000000..401c170 --- /dev/null +++ b/dist/tile.js @@ -0,0 +1,20 @@ +const _jsxFileName = "/home/greg/code/bart-tile/tile/tile.js";import React, { Component } from 'react'; +import _ from 'lodash'; + + +export default class barttileTile extends Component { + + render() { + return ( + React.createElement('div', { className: "w-100 h-100 relative bg-white bg-gray0-d ba b--black b--gray1-d" , __self: this, __source: {fileName: _jsxFileName, lineNumber: 9}} + , React.createElement('a', { className: "w-100 h-100 db pa2 no-underline" , href: "/~barttile", __self: this, __source: {fileName: _jsxFileName, lineNumber: 10}} + , React.createElement('p', { className: "black white-d absolute f9" , style: { left: 8, top: 8 }, __self: this, __source: {fileName: _jsxFileName, lineNumber: 11}}, "barttile") + , React.createElement('img', { className: "absolute", src: "/~barttile/img/Tile.png", style: {top: 39, left: 39}, __self: this, __source: {fileName: _jsxFileName, lineNumber: 12}}) + ) + ) + ); + } + +} + +window.barttileTile = barttileTile; diff --git a/full/gulpfile.js b/full/gulpfile.js deleted file mode 100644 index eb8b6a3..0000000 --- a/full/gulpfile.js +++ /dev/null @@ -1,164 +0,0 @@ -var gulp = require('gulp'); -var cssimport = require('gulp-cssimport'); -var rollup = require('gulp-better-rollup'); -var cssnano = require('cssnano'); -var postcss = require('gulp-postcss'); -var sucrase = require('@sucrase/gulp-plugin'); -var minify = require('gulp-minify'); - -var resolve = require('rollup-plugin-node-resolve'); -var commonjs = require('rollup-plugin-commonjs'); -var rootImport = require('rollup-plugin-root-import'); -var globals = require('rollup-plugin-node-globals'); - -/*** - Main config options -***/ - -var urbitrc = require('./.urbitrc'); - -/*** - End main config options -***/ - -gulp.task('css-bundle', function() { - let plugins = [ - cssnano() - ]; - return gulp - .src('src/index.css') - .pipe(cssimport()) - .pipe(postcss(plugins)) - .pipe(gulp.dest('./urbit/app/%APPNAME%/css')); -}); - -gulp.task('jsx-transform', function(cb) { - return gulp.src('src/**/*.js') - .pipe(sucrase({ - transforms: ['jsx'] - })) - .pipe(gulp.dest('dist')); -}); - -gulp.task('tile-jsx-transform', function(cb) { - return gulp.src('tile/**/*.js') - .pipe(sucrase({ - transforms: ['jsx'] - })) - .pipe(gulp.dest('dist')); -}); - -gulp.task('js-imports', function(cb) { - return gulp.src('dist/index.js') - .pipe(rollup({ - plugins: [ - commonjs({ - namedExports: { - 'node_modules/react/index.js': [ 'Component' ], - 'node_modules/react-is/index.js': [ 'isValidElementType' ], - } - }), - rootImport({ - root: `${__dirname}/dist/js`, - useEntry: 'prepend', - extensions: '.js' - }), - globals(), - resolve() - ] - }, 'umd')) - .on('error', function(e){ - console.log(e); - cb(); - }) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')) - .on('end', cb); -}); - -gulp.task('tile-js-imports', function(cb) { - return gulp.src('dist/tile.js') - .pipe(rollup({ - plugins: [ - commonjs({ - namedExports: { - 'node_modules/react/index.js': [ 'Component' ], - } - }), - rootImport({ - root: `${__dirname}/dist/js`, - useEntry: 'prepend', - extensions: '.js' - }), - globals(), - resolve() - ] - }, 'umd')) - .on('error', function(e){ - console.log(e); - cb(); - }) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')) - .on('end', cb); -}); - - -gulp.task('js-minify', function () { - return gulp.src('./urbit/app/%APPNAME%/js/index.js') - .pipe(minify()) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')); -}); - -gulp.task('tile-js-minify', function () { - return gulp.src('./urbit/app/%APPNAME%/js/tile.js') - .pipe(minify()) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')); -}); - -gulp.task('urbit-copy', function () { - let ret = gulp.src('urbit/**/*'); - - urbitrc.URBIT_PIERS.forEach(function(pier) { - ret = ret.pipe(gulp.dest(pier)); - }); - - return ret; -}); - -gulp.task('js-bundle-dev', gulp.series('jsx-transform', 'js-imports')); -gulp.task('tile-js-bundle-dev', gulp.series('tile-jsx-transform', 'tile-js-imports')); -gulp.task('js-bundle-prod', gulp.series('jsx-transform', 'js-imports', 'js-minify')) -gulp.task('tile-js-bundle-prod', - gulp.series('tile-jsx-transform', 'tile-js-imports', 'tile-js-minify')); - -gulp.task('bundle-dev', - gulp.series( - gulp.parallel( - 'css-bundle', - 'js-bundle-dev', - 'tile-js-bundle-dev' - ), - 'urbit-copy' - ) -); - -gulp.task('bundle-prod', - gulp.series( - gulp.parallel( - 'css-bundle', - 'js-bundle-prod', - 'tile-js-bundle-prod', - ), - 'urbit-copy' - ) -); - -gulp.task('default', gulp.series('bundle-dev')); - -gulp.task('watch', gulp.series('default', function() { - gulp.watch('tile/**/*.js', gulp.parallel('tile-js-bundle-dev')); - - gulp.watch('src/**/*.js', gulp.parallel('js-bundle-dev')); - gulp.watch('src/**/*.css', gulp.parallel('css-bundle')); - - gulp.watch('urbit/**/*', gulp.parallel('urbit-copy')); -})); diff --git a/full/tile/tile.js b/full/tile/tile.js deleted file mode 100644 index 64b2d2c..0000000 --- a/full/tile/tile.js +++ /dev/null @@ -1,20 +0,0 @@ -import React, { Component } from 'react'; -import _ from 'lodash'; - - -export default class %APPNAME%Tile extends Component { - - render() { - return ( -
- -

%APPNAME%

- -
-
- ); - } - -} - -window.%APPNAME%Tile = %APPNAME%Tile; diff --git a/gulpfile.js b/gulpfile.js index 32eaa0f..780e728 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,8 @@ var gulp = require('gulp'); +var cssimport = require('gulp-cssimport'); var rollup = require('gulp-better-rollup'); +var cssnano = require('cssnano'); +var postcss = require('gulp-postcss'); var sucrase = require('@sucrase/gulp-plugin'); var minify = require('gulp-minify'); @@ -18,6 +21,25 @@ var urbitrc = require('./.urbitrc'); End main config options ***/ +gulp.task('css-bundle', function() { + let plugins = [ + cssnano() + ]; + return gulp + .src('src/index.css') + .pipe(cssimport()) + .pipe(postcss(plugins)) + .pipe(gulp.dest('./urbit/app/barttile/css')); +}); + +gulp.task('jsx-transform', function(cb) { + return gulp.src('src/**/*.js') + .pipe(sucrase({ + transforms: ['jsx'] + })) + .pipe(gulp.dest('dist')); +}); + gulp.task('tile-jsx-transform', function(cb) { return gulp.src('tile/**/*.js') .pipe(sucrase({ @@ -26,6 +48,32 @@ gulp.task('tile-jsx-transform', function(cb) { .pipe(gulp.dest('dist')); }); +gulp.task('js-imports', function(cb) { + return gulp.src('dist/index.js') + .pipe(rollup({ + plugins: [ + commonjs({ + namedExports: { + 'node_modules/react/index.js': [ 'Component' ], + 'node_modules/react-is/index.js': [ 'isValidElementType' ], + } + }), + rootImport({ + root: `${__dirname}/dist/js`, + useEntry: 'prepend', + extensions: '.js' + }), + globals(), + resolve() + ] + }, 'umd')) + .on('error', function(e){ + console.log(e); + cb(); + }) + .pipe(gulp.dest('./urbit/app/barttile/js/')) + .on('end', cb); +}); gulp.task('tile-js-imports', function(cb) { return gulp.src('dist/tile.js') @@ -49,14 +97,21 @@ gulp.task('tile-js-imports', function(cb) { console.log(e); cb(); }) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')) + .pipe(gulp.dest('./urbit/app/barttile/js/')) .on('end', cb); }); -gulp.task('tile-js-minify', function () { - return gulp.src('./urbit/app/%APPNAME%/js/tile.js') + +gulp.task('js-minify', function () { + return gulp.src('./urbit/app/barttile/js/index.js') .pipe(minify()) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')); + .pipe(gulp.dest('./urbit/app/barttile/js/')); +}); + +gulp.task('tile-js-minify', function () { + return gulp.src('./urbit/app/barttile/js/tile.js') + .pipe(minify()) + .pipe(gulp.dest('./urbit/app/barttile/js/')); }); gulp.task('urbit-copy', function () { @@ -69,14 +124,41 @@ gulp.task('urbit-copy', function () { return ret; }); +gulp.task('js-bundle-dev', gulp.series('jsx-transform', 'js-imports')); gulp.task('tile-js-bundle-dev', gulp.series('tile-jsx-transform', 'tile-js-imports')); -gulp.task('tile-js-bundle-prod', +gulp.task('js-bundle-prod', gulp.series('jsx-transform', 'js-imports', 'js-minify')) +gulp.task('tile-js-bundle-prod', gulp.series('tile-jsx-transform', 'tile-js-imports', 'tile-js-minify')); -gulp.task('bundle-prod', gulp.series('tile-js-bundle-prod', 'urbit-copy')); +gulp.task('bundle-dev', + gulp.series( + gulp.parallel( + 'css-bundle', + 'js-bundle-dev', + 'tile-js-bundle-dev' + ), + 'urbit-copy' + ) +); + +gulp.task('bundle-prod', + gulp.series( + gulp.parallel( + 'css-bundle', + 'js-bundle-prod', + 'tile-js-bundle-prod', + ), + 'urbit-copy' + ) +); + +gulp.task('default', gulp.series('bundle-dev')); -gulp.task('default', gulp.series('tile-js-bundle-dev', 'urbit-copy')); gulp.task('watch', gulp.series('default', function() { gulp.watch('tile/**/*.js', gulp.parallel('tile-js-bundle-dev')); + + gulp.watch('src/**/*.js', gulp.parallel('js-bundle-dev')); + gulp.watch('src/**/*.css', gulp.parallel('css-bundle')); + gulp.watch('urbit/**/*', gulp.parallel('urbit-copy')); })); diff --git a/package-lock.json b/package-lock.json index eb1a54c..4f86b66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "create-landscape-app", - "version": "2.0.0", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -401,7 +401,8 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } @@ -1480,7 +1481,8 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } @@ -1643,7 +1645,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -1664,12 +1667,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1684,17 +1689,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -1811,7 +1819,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -1823,6 +1832,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -1837,6 +1847,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -1844,12 +1855,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -1868,6 +1881,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -1948,7 +1962,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -1960,6 +1975,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2045,7 +2061,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2081,6 +2098,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2100,6 +2118,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2143,12 +2162,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -5185,7 +5206,8 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } diff --git a/full/src/css/custom.css b/src/css/custom.css similarity index 100% rename from full/src/css/custom.css rename to src/css/custom.css diff --git a/full/src/css/fonts.css b/src/css/fonts.css similarity index 100% rename from full/src/css/fonts.css rename to src/css/fonts.css diff --git a/full/src/css/indigo-static.css b/src/css/indigo-static.css similarity index 100% rename from full/src/css/indigo-static.css rename to src/css/indigo-static.css diff --git a/full/src/index.css b/src/index.css similarity index 100% rename from full/src/index.css rename to src/index.css diff --git a/full/src/index.js b/src/index.js similarity index 100% rename from full/src/index.js rename to src/index.js diff --git a/src/js/api.js b/src/js/api.js new file mode 100644 index 0000000..03aa3b6 --- /dev/null +++ b/src/js/api.js @@ -0,0 +1,49 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import _ from 'lodash'; + +class UrbitApi { + setAuthTokens(authTokens) { + this.authTokens = authTokens; + this.bindPaths = []; + } + + bind(path, method, ship = this.authTokens.ship, appl = "barttile", success, fail) { + this.bindPaths = _.uniq([...this.bindPaths, path]); + + window.subscriptionId = window.urb.subscribe(ship, appl, path, + (err) => { + fail(err); + }, + (event) => { + success({ + data: event, + from: { + ship, + path + } + }); + }, + (err) => { + fail(err); + }); + } + + barttile(data) { + this.action("barttile", "json", data); + } + + action(appl, mark, data) { + return new Promise((resolve, reject) => { + window.urb.poke(ship, appl, mark, data, + (json) => { + resolve(json); + }, + (err) => { + reject(err); + }); + }); + } +} +export let api = new UrbitApi(); +window.api = api; diff --git a/full/src/js/components/lib/header-bar.js b/src/js/components/lib/header-bar.js similarity index 100% rename from full/src/js/components/lib/header-bar.js rename to src/js/components/lib/header-bar.js diff --git a/full/src/js/components/lib/icons/icon-home.js b/src/js/components/lib/icons/icon-home.js similarity index 88% rename from full/src/js/components/lib/icons/icon-home.js rename to src/js/components/lib/icons/icon-home.js index 77c2934..cca5805 100644 --- a/full/src/js/components/lib/icons/icon-home.js +++ b/src/js/components/lib/icons/icon-home.js @@ -6,7 +6,7 @@ export class IconHome extends Component { return ( diff --git a/full/src/js/components/lib/icons/icon-spinner.js b/src/js/components/lib/icons/icon-spinner.js similarity index 100% rename from full/src/js/components/lib/icons/icon-spinner.js rename to src/js/components/lib/icons/icon-spinner.js diff --git a/full/src/js/components/lib/icons/sigil.js b/src/js/components/lib/icons/sigil.js similarity index 100% rename from full/src/js/components/lib/icons/sigil.js rename to src/js/components/lib/icons/sigil.js diff --git a/full/src/js/components/root.js b/src/js/components/root.js similarity index 82% rename from full/src/js/components/root.js rename to src/js/components/root.js index 9b790d2..a65d6ac 100644 --- a/full/src/js/components/root.js +++ b/src/js/components/root.js @@ -15,12 +15,12 @@ export class Root extends Component {
- { + { return (
-

%APPNAME%

+

barttile

Welcome to your Landscape application.

-

To get started, edit src/index.js, tile/tile.js or urbit/app/%APPNAME%.hoon and |commit %home on your Urbit ship to see your changes.

+

To get started, edit src/index.js, tile/tile.js or urbit/app/barttile.hoon and |commit %home on your Urbit ship to see your changes.

-> Read the docs
)}} diff --git a/src/js/lib/util.js b/src/js/lib/util.js new file mode 100644 index 0000000..374f754 --- /dev/null +++ b/src/js/lib/util.js @@ -0,0 +1,82 @@ +import _ from 'lodash'; +import classnames from 'classnames'; + + +export function uuid() { + let str = "0v" + str += Math.ceil(Math.random()*8)+"." + for (var i = 0; i < 5; i++) { + let _str = Math.ceil(Math.random()*10000000).toString(32); + _str = ("00000"+_str).substr(-5,5); + str += _str+"."; + } + + return str.slice(0,-1); +} + +export function isPatTa(str) { + const r = /^[a-z,0-9,\-,\.,_,~]+$/.exec(str) + return !!r; +} + +/* + Goes from: + ~2018.7.17..23.15.09..5be5 // urbit @da + To: + (javascript Date object) +*/ +export function daToDate(st) { + var dub = function(n) { + return parseInt(n) < 10 ? "0" + parseInt(n) : n.toString(); + }; + var da = st.split('..'); + var bigEnd = da[0].split('.'); + var lilEnd = da[1].split('.'); + var ds = `${bigEnd[0].slice(1)}-${dub(bigEnd[1])}-${dub(bigEnd[2])}T${dub(lilEnd[0])}:${dub(lilEnd[1])}:${dub(lilEnd[2])}Z`; + return new Date(ds); +} + +/* + Goes from: + (javascript Date object) + To: + ~2018.7.17..23.15.09..5be5 // urbit @da +*/ + +export function dateToDa(d, mil) { +  var fil = function(n) { +    return n >= 10 ? n : "0" + n; +  }; +  return ( +    `~${d.getUTCFullYear()}.` + +    `${(d.getUTCMonth() + 1)}.` + +    `${fil(d.getUTCDate())}..` + +    `${fil(d.getUTCHours())}.` + +    `${fil(d.getUTCMinutes())}.` + +    `${fil(d.getUTCSeconds())}` + + `${mil ? "..0000" : ""}` +  ); +} + +export function deSig(ship) { + return ship.replace('~', ''); +} + +// trim patps to match dojo, chat-cli +export function cite(ship) { + let patp = ship, shortened = ""; + if (patp.startsWith("~")) { + patp = patp.substr(1); + } + // comet + if (patp.length === 56) { + shortened = "~" + patp.slice(0, 6) + "_" + patp.slice(50, 56); + return shortened; + } + // moon + if (patp.length === 27) { + shortened = "~" + patp.slice(14, 20) + "^" + patp.slice(21, 27); + return shortened; + } + return `~${patp}`; +} \ No newline at end of file diff --git a/src/js/reducers/config.js b/src/js/reducers/config.js new file mode 100644 index 0000000..98b0ab0 --- /dev/null +++ b/src/js/reducers/config.js @@ -0,0 +1,11 @@ +import _ from 'lodash'; + + +export class ConfigReducer { + reduce(json, state) { + let data = _.get(json, 'barttile', false); + if (data) { + state.inbox = data.inbox; + } + } +} diff --git a/src/js/reducers/initial.js b/src/js/reducers/initial.js new file mode 100644 index 0000000..2ba151c --- /dev/null +++ b/src/js/reducers/initial.js @@ -0,0 +1,11 @@ +import _ from 'lodash'; + + +export class InitialReducer { + reduce(json, state) { + let data = _.get(json, 'initial', false); + if (data) { + state.inbox = data.inbox; + } + } +} diff --git a/src/js/reducers/update.js b/src/js/reducers/update.js new file mode 100644 index 0000000..a167c59 --- /dev/null +++ b/src/js/reducers/update.js @@ -0,0 +1,17 @@ +import _ from 'lodash'; + + +export class UpdateReducer { + reduce(json, state) { + let data = _.get(json, 'update', false); + if (data) { + this.reduceInbox(_.get(data, 'inbox', false), state); + } + } + + reduceInbox(inbox, state) { + if (inbox) { + state.inbox = inbox; + } + } +} diff --git a/src/js/store.js b/src/js/store.js new file mode 100644 index 0000000..50da21b --- /dev/null +++ b/src/js/store.js @@ -0,0 +1,35 @@ +import { InitialReducer } from '/reducers/initial'; +import { ConfigReducer } from '/reducers/config'; +import { UpdateReducer } from '/reducers/update'; + + +class Store { + constructor() { + this.state = { + inbox: {} + }; + + this.initialReducer = new InitialReducer(); + this.configReducer = new ConfigReducer(); + this.updateReducer = new UpdateReducer(); + this.setState = () => { }; + } + + setStateHandler(setState) { + this.setState = setState; + } + + handleEvent(data) { + let json = data.data; + + console.log(json); + this.initialReducer.reduce(json, this.state); + this.configReducer.reduce(json, this.state); + this.updateReducer.reduce(json, this.state); + + this.setState(this.state); + } +} + +export let store = new Store(); +window.store = store; \ No newline at end of file diff --git a/src/js/subscription.js b/src/js/subscription.js new file mode 100644 index 0000000..483b5fc --- /dev/null +++ b/src/js/subscription.js @@ -0,0 +1,34 @@ +import { api } from '/api'; +import { store } from '/store'; + +import urbitOb from 'urbit-ob'; + + +export class Subscription { + start() { + if (api.authTokens) { + // this.initializebarttile(); + } else { + console.error("~~~ ERROR: Must set api.authTokens before operation ~~~"); + } + } + + // initializebarttile() { + // api.bind('/primary', 'PUT', api.authTokens.ship, 'barttile', + // this.handleEvent.bind(this), + // this.handleError.bind(this)); + // } + + handleEvent(diff) { + store.handleEvent(diff); + } + + handleError(err) { + console.error(err); + api.bind('/primary', 'PUT', api.authTokens.ship, 'barttile', + this.handleEvent.bind(this), + this.handleError.bind(this)); + } +} + +export let subscription = new Subscription(); diff --git a/src/js/vendor/sigils-1.2.5.js b/src/js/vendor/sigils-1.2.5.js new file mode 100644 index 0000000..cd4881b --- /dev/null +++ b/src/js/vendor/sigils-1.2.5.js @@ -0,0 +1 @@ +function _AwaitValue(a){this.wrapped=a}function _AsyncGenerator(a){function t(a,t){return new Promise(function(r,d){var c={key:a,arg:t,resolve:r,reject:d,next:null};s?s=s.next=c:(b=s=c,e(a,t))})}function e(t,b){try{var s=a[t](b),d=s.value,c=d instanceof _AwaitValue;Promise.resolve(c?d.wrapped:d).then(function(a){if(c)return void e("next",a);r(s.done?"return":"normal",a)},function(a){e("throw",a)})}catch(a){r("throw",a)}}function r(a,t){switch(a){case"return":b.resolve({value:t,done:!0});break;case"throw":b.reject(t);break;default:b.resolve({value:t,done:!1})}(b=b.next)?e(b.key,b.arg):s=null}var b,s;this._invoke=t,"function"!=typeof a.return&&(this.return=void 0)}function _defineProperty(a,t,e){return t in a?Object.defineProperty(a,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[t]=e,a}function _objectSpread(a){for(var t=1;t-1}function listCacheSet(a,t){var e=this.__data__,r=_assocIndexOf(e,a);return r<0?(++this.size,e.push([a,t])):e[r][1]=t,this}function ListCache(a){var t=-1,e=null==a?0:a.length;for(this.clear();++t-1&&a%1==0&&a-1&&a%1==0&&a<=MAX_SAFE_INTEGER$1}function baseIsTypedArray(a){return isObjectLike_1(a)&&isLength_1(a.length)&&!!typedArrayTags[_baseGetTag(a)]}function baseUnary(a){return function(t){return a(t)}}function arrayLikeKeys(a,t){var e=isArray_1(a),r=!e&&isArguments_1(a),b=!e&&!r&&isBuffer_1(a),s=!e&&!r&&!b&&isTypedArray_1(a),d=e||r||b||s,c=d?_baseTimes(a.length,String):[],o=c.length;for(var n in a)!t&&!hasOwnProperty$5.call(a,n)||d&&("length"==n||b&&("offset"==n||"parent"==n)||s&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||_isIndex(n,o))||c.push(n);return c}function isPrototype(a){var t=a&&a.constructor;return a===("function"==typeof t&&t.prototype||objectProto$9)}function overArg(a,t){return function(e){return a(t(e))}}function baseKeys(a){if(!_isPrototype(a))return _nativeKeys(a);var t=[];for(var e in Object(a))hasOwnProperty$7.call(a,e)&&"constructor"!=e&&t.push(e);return t}function isArrayLike(a){return null!=a&&isLength_1(a.length)&&!isFunction_1(a)}function keys(a){return isArrayLike_1(a)?_arrayLikeKeys(a):_baseKeys(a)}function baseAssign(a,t){return a&&_copyObject(t,keys_1(t),a)}function nativeKeysIn(a){var t=[];if(null!=a)for(var e in Object(a))t.push(e);return t}function baseKeysIn(a){if(!isObject_1(a))return _nativeKeysIn(a);var t=_isPrototype(a),e=[];for(var r in a)("constructor"!=r||!t&&hasOwnProperty$8.call(a,r))&&e.push(r);return e}function keysIn$1(a){return isArrayLike_1(a)?_arrayLikeKeys(a,!0):_baseKeysIn(a)}function baseAssignIn(a,t){return a&&_copyObject(t,keysIn_1(t),a)}function copyArray(a,t){var e=-1,r=a.length;for(t||(t=Array(r));++e1&&void 0!==arguments[1]?arguments[1]:0}}function _toConsumableArray$1(a){if(Array.isArray(a)){for(var t=0,e=Array(a.length);t1&&void 0!==arguments[1]?arguments[1]:void 0;return isUndefined$1(t)&&(t=a),{a:a,c:0,e:0,b:0,d:t,f:0}}function toSVG(a){return toString$2(a)}function toString$2(a){return"matrix("+a.a+","+a.b+","+a.c+","+a.d+","+a.e+","+a.f+")"}function setCacheAdd(a){return this.__data__.set(a,HASH_UNDEFINED$2),this}function setCacheHas(a){return this.__data__.has(a)}function SetCache(a){var t=-1,e=null==a?0:a.length;for(this.__data__=new _MapCache;++tc))return!1;var n=s.get(a);if(n&&s.get(t))return n==t;var i=-1,f=!0,l=e&COMPARE_UNORDERED_FLAG$1?new _SetCache:void 0;for(s.set(a,t),s.set(t,a);++ir&&console.warn("sigil-js: margin cannot be larger than sigil size");var b=isNotMarginMode(e),s=b?.08*r:e,d=r-2*s,c=b||t>1?d/2:d,o={le:t,mm:b,tw:r,sw:c,rm:s,rp:c/128*2},n={1:[{x:dc(o),y:dc(o)}],2:[{x:d1(o),y:dc(o)},{x:d2(o),y:dc(o)}],4:[{x:d1(o),y:d1(o)},{x:d2(o),y:d1(o)},{x:d1(o),y:d2(o)},{x:d2(o),y:d2(o)}]};return _objectSpread({},o,{scale:o.sw/128,grid:n[t]})},isNotMarginMode=function(a){return"auto"===a||void 0===a},dc=function(a){var t=a.le,e=a.mm,r=a.tw,b=a.sw,s=a.rm;return t>1||!0===e?r-1.5*b-s:s},d1=function(a){a.tw,a.sw;return a.rm-a.rp/2},d2=function(a){return a.tw-a.sw-a.rm+a.rp/2},CW=[["#fff","#000000"]],prism=function(a,t){return t[0]},dyes=function(a,t,e){return isUndefined_1$1(e)?(e=isUndefined_1$1(t)?CW[0]:prism(t,CW),wash(a,e)):wash(a,e)},applyColor=function(a,t){return"FG"===a?t[0]:"BG"===a?t[1]:"TC"===a?t[2]:"NC"===a?"grey":last(t)},applyStyleAttrs=function(a,t){var e=a.fill;return{fill:applyColor(e,t)}},wash=function a(t,e){var r=get_1$1(t,["meta","style"],!1),b=get_1$1(t,"children",[]),s=get_1$1(t,"attr",{});return _objectSpread({},t,{attr:!1!==r?_objectSpread({},s,applyStyleAttrs(r,e)):_objectSpread({},s),children:b.map(function(t){return a(t,e)})})},HASH_UNDEFINED$2="__lodash_hash_undefined__",_setCacheAdd=setCacheAdd,_setCacheHas=setCacheHas;SetCache.prototype.add=SetCache.prototype.push=_setCacheAdd,SetCache.prototype.has=_setCacheHas;var _SetCache=SetCache,_arraySome=arraySome,_cacheHas=cacheHas,COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG$1=2,_equalArrays=equalArrays,_mapToArray=mapToArray,_setToArray=setToArray,COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$2=2,boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",mapTag$5="[object Map]",numberTag$3="[object Number]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$4="[object String]",symbolTag$3="[object Symbol]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",symbolProto$2=_Symbol?_Symbol.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0,_equalByTag=equalByTag,COMPARE_PARTIAL_FLAG$4=1,objectProto$14=Object.prototype,hasOwnProperty$11=objectProto$14.hasOwnProperty,_equalObjects=equalObjects,COMPARE_PARTIAL_FLAG$1=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$3="[object Object]",objectProto$13=Object.prototype,hasOwnProperty$10=objectProto$13.hasOwnProperty,_baseIsEqualDeep=baseIsEqualDeep,_baseIsEqual=baseIsEqual,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,_baseIsMatch=baseIsMatch,_isStrictComparable=isStrictComparable,_getMatchData=getMatchData,_matchesStrictComparable=matchesStrictComparable,_baseMatches=baseMatches,_baseHasIn=baseHasIn,_hasPath=hasPath,hasIn_1=hasIn,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2,_baseMatchesProperty=baseMatchesProperty,identity_1=identity$1,_baseProperty=baseProperty,_basePropertyDeep=basePropertyDeep,property_1=property,_baseIteratee=baseIteratee,_createBaseFor=createBaseFor,baseFor=_createBaseFor(),_baseFor=baseFor,_baseForOwn=baseForOwn,_createBaseEach=createBaseEach,baseEach=_createBaseEach(_baseForOwn),_baseEach=baseEach,_baseMap=baseMap,map_1=map,appendChildNodes=function(a,t){return map_1(get_1$1(a,"children",[]),function(a){return SVGComponents[a.tag](a)}).forEach(function(a){t.appendChild(a)}),t},createChildNode=function(a,t){var e=document.createElement(t);return Object.keys(a.attr).forEach(function(t){e.setAttribute(t,a.attr[t])}),appendChildNodes(a,e)},SVGComponents={svg:function(a){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("version","1.1"),t.setAttribute("xlmns","http://www.w3.org/2000/svg"),Object.keys(a.attr).forEach(function(e){t.setAttribute(e,a.attr[e])}),appendChildNodes(a,t)},circle:function(a){return createChildNode(a,"circle")},rect:function(a){return createChildNode(a,"rect")},path:function(a){return createChildNode(a,"path")},g:function(a){return createChildNode(a,"g")},polygon:function(a){return createChildNode(a,"polygon")},line:function(a){return createChildNode(a,"line")},polyline:function(a){return createChildNode(a,"polyline")}},p2s=function(a){if(void 0!==a)return Object.entries(a).reduce(function(a,t){var e=_slicedToArray(t,2),r=e[0],b=e[1];return"".concat(a).concat(c2k(r),"='").concat(b,"' ")},"")},c2k=function(a){return a.replace(/(^[A-Z])/,function(a){return _slicedToArray(a,1)[0].toLowerCase()}).replace(/([A-Z])/g,function(a){var t=_slicedToArray(a,1)[0];return"-".concat(t.toLowerCase())})},recurse=function(a){return get_1$1(a,"children",[]).reduce(function(a,t){return"".concat(a," ").concat(PlainSVGStringRenderer[t.tag](t))},"")},PlainSVGStringRenderer={svg:function(a){return"\n ").concat(recurse(a),"\n ")},circle:function(a){return"\n ").concat(recurse(a),"\n ")},rect:function(a){return"\n ").concat(recurse(a),"\n ")},path:function(a){return"\n ").concat(recurse(a),"\n ")},g:function(a){return"\n ").concat(recurse(a),"\n ")},polygon:function(a){return"\n ").concat(recurse(a),"\n ")},line:function(a){return"\n ").concat(recurse(a),"\n ")},polyline:function(a){return"\n ").concat(recurse(a),"\n ")}};export{pour,_pour,SVGComponents,PlainSVGStringRenderer}; diff --git a/tile/tile.js b/tile/tile.js index e15c93a..c40077e 100644 --- a/tile/tile.js +++ b/tile/tile.js @@ -2,16 +2,19 @@ import React, { Component } from 'react'; import _ from 'lodash'; -export default class %APPNAME%Tile extends Component { +export default class barttileTile extends Component { render() { return (
-

%APPNAME%

+ +

barttile

+ +
); } } -window.%APPNAME%Tile = %APPNAME%Tile; +window.barttileTile = barttileTile; diff --git a/full/urbit/app/smol.hoon b/urbit/app/barttile.hoon similarity index 69% rename from full/urbit/app/smol.hoon rename to urbit/app/barttile.hoon index 71fb8ba..3a5037c 100644 --- a/full/urbit/app/smol.hoon +++ b/urbit/app/barttile.hoon @@ -2,34 +2,34 @@ /= index /^ octs /; as-octs:mimes:html - /: /===/app/%APPNAME%/index + /: /===/app/barttile/index /| /html/ /~ ~ == /= tile-js /^ octs /; as-octs:mimes:html - /: /===/app/%APPNAME%/js/tile + /: /===/app/barttile/js/tile /| /js/ /~ ~ == /= script /^ octs /; as-octs:mimes:html - /: /===/app/%APPNAME%/js/index + /: /===/app/barttile/js/index /| /js/ /~ ~ == /= style /^ octs /; as-octs:mimes:html - /: /===/app/%APPNAME%/css/index + /: /===/app/barttile/css/index /| /css/ /~ ~ == -/= %APPNAME%-png +/= barttile-png /^ (map knot @) - /: /===/app/%APPNAME%/img /_ /png/ + /: /===/app/barttile/img /_ /png/ :: |% +$ card card:agent:gall @@ -38,16 +38,16 @@ =< |_ bol=bowl:gall +* this . - %APPNAME%-core +> - cc ~(. %APPNAME%-core bol) + barttile-core +> + cc ~(. barttile-core bol) def ~(. (default-agent this %|) bol) :: ++ on-init ^- (quip card _this) - =/ launcha [%launch-action !>([%add %%APPNAME% / '/~%APPNAME%/js/tile.js'])] + =/ launcha [%launch-action !>([%add %barttile / '/~barttile/js/tile.js'])] :_ this - :~ [%pass / %arvo %e %connect [~ /'~%APPNAME%'] %%APPNAME%] - [%pass /%APPNAME% %agent [our.bol %launch] %poke launcha] + :~ [%pass / %arvo %e %connect [~ /'~barttile'] %barttile] + [%pass /barttile %agent [our.bol %launch] %poke launcha] == ++ on-poke |= [=mark =vase] @@ -96,18 +96,18 @@ ^- simple-payload:http =+ url=(parse-request-line url.request.inbound-request) ?+ site.url not-found:gen - [%'~%APPNAME%' %css %index ~] (css-response:gen style) - [%'~%APPNAME%' %js %tile ~] (js-response:gen tile-js) - [%'~%APPNAME%' %js %index ~] (js-response:gen script) + [%'~barttile' %css %index ~] (css-response:gen style) + [%'~barttile' %js %tile ~] (js-response:gen tile-js) + [%'~barttile' %js %index ~] (js-response:gen script) :: - [%'~%APPNAME%' %img @t *] + [%'~barttile' %img @t *] =/ name=@t i.t.t.site.url - =/ img (~(get by %APPNAME%-png) name) + =/ img (~(get by barttile-png) name) ?~ img not-found:gen (png-response:gen (as-octs:mimes:html u.img)) :: - [%'~%APPNAME%' *] (html-response:gen index) + [%'~barttile' *] (html-response:gen index) == :: -- diff --git a/urbit/app/barttile/css/index.css b/urbit/app/barttile/css/index.css new file mode 100644 index 0000000..00ae9b7 --- /dev/null +++ b/urbit/app/barttile/css/index.css @@ -0,0 +1 @@ +/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}.aspect-ratio{height:0;position:relative}.aspect-ratio--16x9{padding-bottom:56.25%}.aspect-ratio--9x16{padding-bottom:177.77%}.aspect-ratio--4x3{padding-bottom:75%}.aspect-ratio--3x4{padding-bottom:133.33%}.aspect-ratio--6x4{padding-bottom:66.6%}.aspect-ratio--4x6{padding-bottom:150%}.aspect-ratio--8x5{padding-bottom:62.5%}.aspect-ratio--5x8{padding-bottom:160%}.aspect-ratio--7x5{padding-bottom:71.42%}.aspect-ratio--5x7{padding-bottom:140%}.aspect-ratio--1x1{padding-bottom:100%}.aspect-ratio--object{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}.cover{background-size:cover!important}.contain{background-size:contain!important}.bg-center{background-position:50%}.bg-center,.bg-top{background-repeat:no-repeat}.bg-top{background-position:top}.bg-right{background-position:100%}.bg-bottom,.bg-right{background-repeat:no-repeat}.bg-bottom{background-position:bottom}.bg-left{background-repeat:no-repeat;background-position:0}.ba{border-style:solid;border-width:1px}.bt{border-top-style:solid;border-top-width:1px}.br{border-right-style:solid;border-right-width:1px}.bb{border-bottom-style:solid;border-bottom-width:1px}.bl{border-left-style:solid;border-left-width:1px}.bn{border-style:none;border-width:0}.b--black{border-color:#000}.b--white{border-color:#fff}.b--gray0{border-color:#333}.b--gray1{border-color:#4d4d4d}.b--gray2{border-color:#7f7f7f}.b--gray3{border-color:#b1b2b3}.b--gray4{border-color:#e6e6e6}.b--gray5{border-color:#f9f9f9}.b--blue0{border-color:#ecf6ff}.b--blue1{border-color:#b0c7ff}.b--blue2{border-color:#4330fc}.b--blue3{border-color:#190d7b}.b--red0{border-color:#f9d6ce}.b--red1{border-color:#ffa073}.b--red2{border-color:#ee5432}.b--red3{border-color:#c10d30}.b--green0{border-color:#bdebcc}.b--green1{border-color:#2ed196}.b--green2{border-color:#2aa779}.b--green3{border-color:#286e55}.b--yellow0{border-color:#ffefc5}.b--yellow1{border-color:#ffd972}.b--yellow2{border-color:#fcc440}.b--yellow3{border-color:#ee892b}.b--transparent{border-color:transparent}.br0{border-radius:0}.br1{border-radius:.125rem}.br2{border-radius:.25rem}.br3{border-radius:.5rem}.br4{border-radius:1rem}.br-100{border-radius:100%}.br-pill{border-radius:9999px}.br--bottom{border-top-left-radius:0;border-top-right-radius:0}.br--top{border-bottom-right-radius:0}.br--right,.br--top{border-bottom-left-radius:0}.br--right{border-top-left-radius:0}.br--left{border-top-right-radius:0;border-bottom-right-radius:0}.b--dotted{border-style:dotted}.b--dashed{border-style:dashed}.b--solid{border-style:solid}.b--none{border-style:none}.bw0{border-width:0}.bw1{border-width:.125rem}.bw2{border-width:.25rem}.bw3{border-width:.5rem}.bw4{border-width:1rem}.bw5{border-width:2rem}.bt-0{border-top-width:0}.br-0{border-right-width:0}.bb-0{border-bottom-width:0}.bl-0{border-left-width:0}.shadow-1{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.shadow-2{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.shadow-3{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.shadow-4{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.shadow-5{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}.border-box,a,article,aside,blockquote,body,code,dd,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,html,input[type=email],input[type=number],input[type=password],input[type=tel],input[type=text],input[type=url],legend,li,main,nav,ol,p,pre,section,table,td,textarea,th,tr,ul{box-sizing:border-box}.pre{overflow-x:auto;overflow-y:hidden;overflow:scroll}.pa0{padding:0}.ma0,.na0{margin:0}.pl0{padding-left:0}.ml0,.nl0{margin-left:0}.pr0{padding-right:0}.mr0,.nr0{margin-right:0}.pt0{padding-top:0}.mt0,.nt0{margin-top:0}.pb0{padding-bottom:0}.mb0,.nb0{margin-bottom:0}.pv0{padding-top:0;padding-bottom:0}.mv0,.nv0{margin-top:0;margin-bottom:0}.ph0{padding-left:0;padding-right:0}.mh0,.nh0{margin-left:0;margin-right:0}.pa1{padding:.25rem}.ma1{margin:.25rem}.na1{margin:-.25rem}.pl1{padding-left:.25rem}.ml1{margin-left:.25rem}.nl1{margin-left:-.25rem}.pr1{padding-right:.25rem}.mr1{margin-right:.25rem}.nr1{margin-right:-.25rem}.pt1{padding-top:.25rem}.mt1{margin-top:.25rem}.nt1{margin-top:-.25rem}.pb1{padding-bottom:.25rem}.mb1{margin-bottom:.25rem}.nb1{margin-bottom:-.25rem}.pv1{padding-top:.25rem;padding-bottom:.25rem}.mv1{margin-top:.25rem;margin-bottom:.25rem}.nv1{margin-top:-.25rem;margin-bottom:-.25rem}.ph1{padding-left:.25rem;padding-right:.25rem}.mh1{margin-left:.25rem;margin-right:.25rem}.nh1{margin-left:-.25rem;margin-right:-.25rem}.pa2{padding:.5rem}.ma2{margin:.5rem}.na2{margin:-.5rem}.pl2{padding-left:.5rem}.ml2{margin-left:.5rem}.nl2{margin-left:-.5rem}.pr2{padding-right:.5rem}.mr2{margin-right:.5rem}.nr2{margin-right:-.5rem}.pt2{padding-top:.5rem}.mt2{margin-top:.5rem}.nt2{margin-top:-.5rem}.pb2{padding-bottom:.5rem}.mb2{margin-bottom:.5rem}.nb2{margin-bottom:-.5rem}.pv2{padding-top:.5rem;padding-bottom:.5rem}.mv2{margin-top:.5rem;margin-bottom:.5rem}.nv2{margin-top:-.5rem;margin-bottom:-.5rem}.ph2{padding-left:.5rem;padding-right:.5rem}.mh2{margin-left:.5rem;margin-right:.5rem}.nh2{margin-left:-.5rem;margin-right:-.5rem}.pa3{padding:.75rem}.ma3{margin:.75rem}.na3{margin:-.75rem}.pl3{padding-left:.75rem}.ml3{margin-left:.75rem}.nl3{margin-left:-.75rem}.pr3{padding-right:.75rem}.mr3{margin-right:.75rem}.nr3{margin-right:-.75rem}.pt3{padding-top:.75rem}.mt3{margin-top:.75rem}.nt3{margin-top:-.75rem}.pb3{padding-bottom:.75rem}.mb3{margin-bottom:.75rem}.nb3{margin-bottom:-.75rem}.pv3{padding-top:.75rem;padding-bottom:.75rem}.mv3{margin-top:.75rem;margin-bottom:.75rem}.nv3{margin-top:-.75rem;margin-bottom:-.75rem}.ph3{padding-left:.75rem;padding-right:.75rem}.mh3{margin-left:.75rem;margin-right:.75rem}.nh3{margin-left:-.75rem;margin-right:-.75rem}.pa4{padding:1rem}.ma4{margin:1rem}.na4{margin:-1rem}.pl4{padding-left:1rem}.ml4{margin-left:1rem}.nl4{margin-left:-1rem}.pr4{padding-right:1rem}.mr4{margin-right:1rem}.nr4{margin-right:-1rem}.pt4{padding-top:1rem}.mt4{margin-top:1rem}.nt4{margin-top:-1rem}.pb4{padding-bottom:1rem}.mb4{margin-bottom:1rem}.nb4{margin-bottom:-1rem}.pv4{padding-top:1rem;padding-bottom:1rem}.mv4{margin-top:1rem;margin-bottom:1rem}.nv4{margin-top:-1rem;margin-bottom:-1rem}.ph4{padding-left:1rem;padding-right:1rem}.mh4{margin-left:1rem;margin-right:1rem}.nh4{margin-left:-1rem;margin-right:-1rem}.pa5{padding:1.25rem}.ma5{margin:1.25rem}.na5{margin:-1.25rem}.pl5{padding-left:1.25rem}.ml5{margin-left:1.25rem}.nl5{margin-left:-1.25rem}.pr5{padding-right:1.25rem}.mr5{margin-right:1.25rem}.nr5{margin-right:-1.25rem}.pt5{padding-top:1.25rem}.mt5{margin-top:1.25rem}.nt5{margin-top:-1.25rem}.pb5{padding-bottom:1.25rem}.mb5{margin-bottom:1.25rem}.nb5{margin-bottom:-1.25rem}.pv5{padding-top:1.25rem;padding-bottom:1.25rem}.mv5{margin-top:1.25rem;margin-bottom:1.25rem}.nv5{margin-top:-1.25rem;margin-bottom:-1.25rem}.ph5{padding-left:1.25rem;padding-right:1.25rem}.mh5{margin-left:1.25rem;margin-right:1.25rem}.nh5{margin-left:-1.25rem;margin-right:-1.25rem}.pa6{padding:1.5rem}.ma6{margin:1.5rem}.na6{margin:-1.5rem}.pl6{padding-left:1.5rem}.ml6{margin-left:1.5rem}.nl6{margin-left:-1.5rem}.pr6{padding-right:1.5rem}.mr6{margin-right:1.5rem}.nr6{margin-right:-1.5rem}.pt6{padding-top:1.5rem}.mt6{margin-top:1.5rem}.nt6{margin-top:-1.5rem}.pb6{padding-bottom:1.5rem}.mb6{margin-bottom:1.5rem}.nb6{margin-bottom:-1.5rem}.pv6{padding-top:1.5rem;padding-bottom:1.5rem}.mv6{margin-top:1.5rem;margin-bottom:1.5rem}.nv6{margin-top:-1.5rem;margin-bottom:-1.5rem}.ph6{padding-left:1.5rem;padding-right:1.5rem}.mh6{margin-left:1.5rem;margin-right:1.5rem}.nh6{margin-left:-1.5rem;margin-right:-1.5rem}.pa7{padding:2rem}.ma7{margin:2rem}.na7{margin:-2rem}.pl7{padding-left:2rem}.ml7{margin-left:2rem}.nl7{margin-left:-2rem}.pr7{padding-right:2rem}.mr7{margin-right:2rem}.nr7{margin-right:-2rem}.pt7{padding-top:2rem}.mt7{margin-top:2rem}.nt7{margin-top:-2rem}.pb7{padding-bottom:2rem}.mb7{margin-bottom:2rem}.nb7{margin-bottom:-2rem}.pv7{padding-top:2rem;padding-bottom:2rem}.mv7{margin-top:2rem;margin-bottom:2rem}.nv7{margin-top:-2rem;margin-bottom:-2rem}.ph7{padding-left:2rem;padding-right:2rem}.mh7{margin-left:2rem;margin-right:2rem}.nh7{margin-left:-2rem;margin-right:-2rem}.pa8{padding:3rem}.ma8{margin:3rem}.na8{margin:-3rem}.pl8{padding-left:3rem}.ml8{margin-left:3rem}.nl8{margin-left:-3rem}.pr8{padding-right:3rem}.mr8{margin-right:3rem}.nr8{margin-right:-3rem}.pt8{padding-top:3rem}.mt8{margin-top:3rem}.nt8{margin-top:-3rem}.pb8{padding-bottom:3rem}.mb8{margin-bottom:3rem}.nb8{margin-bottom:-3rem}.pv8{padding-top:3rem;padding-bottom:3rem}.mv8{margin-top:3rem;margin-bottom:3rem}.nv8{margin-top:-3rem;margin-bottom:-3rem}.ph8{padding-left:3rem;padding-right:3rem}.mh8{margin-left:3rem;margin-right:3rem}.nh8{margin-left:-3rem;margin-right:-3rem}.pa9{padding:4rem}.ma9{margin:4rem}.na9{margin:-4rem}.pl9{padding-left:4rem}.ml9{margin-left:4rem}.nl9{margin-left:-4rem}.pr9{padding-right:4rem}.mr9{margin-right:4rem}.nr9{margin-right:-4rem}.pt9{padding-top:4rem}.mt9{margin-top:4rem}.nt9{margin-top:-4rem}.pb9{padding-bottom:4rem}.mb9{margin-bottom:4rem}.nb9{margin-bottom:-4rem}.pv9{padding-top:4rem;padding-bottom:4rem}.mv9{margin-top:4rem;margin-bottom:4rem}.nv9{margin-top:-4rem;margin-bottom:-4rem}.ph9{padding-left:4rem;padding-right:4rem}.mh9{margin-left:4rem;margin-right:4rem}.nh9{margin-left:-4rem;margin-right:-4rem}.pa10{padding:6rem}.ma10{margin:6rem}.na10{margin:-6rem}.pl10{padding-left:6rem}.ml10{margin-left:6rem}.nl10{margin-left:-6rem}.pr10{padding-right:6rem}.mr10{margin-right:6rem}.nr10{margin-right:-6rem}.pt10{padding-top:6rem}.mt10{margin-top:6rem}.nt10{margin-top:-6rem}.pb10{padding-bottom:6rem}.mb10{margin-bottom:6rem}.nb10{margin-bottom:-6rem}.pv10{padding-top:6rem;padding-bottom:6rem}.mv10{margin-top:6rem;margin-bottom:6rem}.nv10{margin-top:-6rem;margin-bottom:-6rem}.ph10{padding-left:6rem;padding-right:6rem}.mh10{margin-left:6rem;margin-right:6rem}.nh10{margin-left:-6rem;margin-right:-6rem}.pa11{padding:10rem}.ma11{margin:10rem}.na11{margin:-10rem}.pl11{padding-left:10rem}.ml11{margin-left:10rem}.nl11{margin-left:-10rem}.pr11{padding-right:10rem}.mr11{margin-right:10rem}.nr11{margin-right:-10rem}.pt11{padding-top:10rem}.mt11{margin-top:10rem}.nt11{margin-top:-10rem}.pb11{padding-bottom:10rem}.mb11{margin-bottom:10rem}.nb11{margin-bottom:-10rem}.pv11{padding-top:10rem;padding-bottom:10rem}.mv11{margin-top:10rem;margin-bottom:10rem}.nv11{margin-top:-10rem;margin-bottom:-10rem}.ph11{padding-left:10rem;padding-right:10rem}.mh11{margin-left:10rem;margin-right:10rem}.nh11{margin-left:-10rem;margin-right:-10rem}.pa12{padding:18rem}.ma12{margin:18rem}.na12{margin:-18rem}.pl12{padding-left:18rem}.ml12{margin-left:18rem}.nl12{margin-left:-18rem}.pr12{padding-right:18rem}.mr12{margin-right:18rem}.nr12{margin-right:-18rem}.pt12{padding-top:18rem}.mt12{margin-top:18rem}.nt12{margin-top:-18rem}.pb12{padding-bottom:18rem}.mb12{margin-bottom:18rem}.nb12{margin-bottom:-18rem}.pv12{padding-top:18rem;padding-bottom:18rem}.mv12{margin-top:18rem;margin-bottom:18rem}.nv12{margin-top:-18rem;margin-bottom:-18rem}.ph12{padding-left:18rem;padding-right:18rem}.mh12{margin-left:18rem;margin-right:18rem}.nh12{margin-left:-18rem;margin-right:-18rem}.top-0{top:0}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.top-1{top:1rem}.right-1{right:1rem}.bottom-1{bottom:1rem}.left-1{left:1rem}.top-2{top:2rem}.right-2{right:2rem}.bottom-2{bottom:2rem}.left-2{left:2rem}.top--1{top:-1rem}.right--1{right:-1rem}.bottom--1{bottom:-1rem}.left--1{left:-1rem}.top--2{top:-2rem}.right--2{right:-2rem}.bottom--2{bottom:-2rem}.left--2{left:-2rem}.absolute--fill{top:0;right:0;bottom:0;left:0}.cf:after,.cf:before{content:" ";display:table}.cf:after{clear:both}.cf{*zoom:1}.cl{clear:left}.cr{clear:right}.cb{clear:both}.cn{clear:none}.dn{display:none}.di{display:inline}.db{display:block}.dib{display:inline-block}.dit{display:inline-table}.dt{display:table}.dtc{display:table-cell}.dt-row{display:table-row}.dt-row-group{display:table-row-group}.dt-column{display:table-column}.dt-column-group{display:table-column-group}.dt--fixed{table-layout:fixed;width:100%}.flex{display:flex}.inline-flex{display:inline-flex}.flex-auto{flex:1 1 auto;min-width:0;min-height:0}.flex-none{flex:none}.flex-column{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.flex-wrap-reverse{flex-wrap:wrap-reverse}.flex-column-reverse{flex-direction:column-reverse}.flex-row-reverse{flex-direction:row-reverse}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.self-baseline{align-self:baseline}.self-stretch{align-self:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.content-start{align-content:flex-start}.content-end{align-content:flex-end}.content-center{align-content:center}.content-between{align-content:space-between}.content-around{align-content:space-around}.content-stretch{align-content:stretch}.order-0{order:0}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-8{order:8}.order-last{order:99999}.flex-grow-0{flex-grow:0}.flex-grow-1{flex-grow:1}.flex-shrink-0{flex-shrink:0}.flex-shrink-1{flex-shrink:1}.fl{float:left}.fl,.fr{_display:inline}.fr{float:right}.fn{float:none}.sans-serif{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.serif{font-family:georgia,times,serif}.system-sans-serif{font-family:sans-serif}.system-serif{font-family:serif}.code,code{font-family:Consolas,monaco,monospace}.courier{font-family:Courier Next,courier,monospace}.helvetica{font-family:helvetica neue,helvetica,sans-serif}.avenir{font-family:avenir next,avenir,sans-serif}.athelas{font-family:athelas,georgia,serif}.georgia{font-family:georgia,serif}.times{font-family:times,serif}.bodoni{font-family:Bodoni MT,serif}.calisto{font-family:Calisto MT,serif}.garamond{font-family:garamond,serif}.baskerville{font-family:baskerville,serif}.i{font-style:italic}.fs-normal{font-style:normal}.normal{font-weight:400}.b{font-weight:700}.fw1{font-weight:100}.fw2{font-weight:200}.fw3{font-weight:300}.fw4{font-weight:400}.fw5{font-weight:500}.fw6{font-weight:600}.fw7{font-weight:700}.fw8{font-weight:800}.fw9{font-weight:900}.input-reset{-webkit-appearance:none;-moz-appearance:none}.button-reset::-moz-focus-inner,.input-reset::-moz-focus-inner{border:0;padding:0}.debug *{outline:1px solid gold}.debug-white *{outline:1px solid #fff}.debug-black *{outline:1px solid #000}.debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAFElEQVR4AWPAC97/9x0eCsAEPgwAVLshdpENIxcAAAAASUVORK5CYII=) repeat 0 0}.debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMklEQVR4AWOgCLz/b0epAa6UGuBOqQHOQHLUgFEDnAbcBZ4UGwDOkiCnkIhdgNgNxAYAiYlD+8sEuo8AAAAASUVORK5CYII=) repeat 0 0}.debug-grid-8-solid{background:#fff url(data:image/gif;base64,R0lGODdhCAAIAPEAAADw/wDx/////wAAACwAAAAACAAIAAACDZQvgaeb/lxbAIKA8y0AOw==) repeat 0 0}.debug-grid-16-solid{background:#fff url(data:image/gif;base64,R0lGODdhEAAQAPEAAADw/wDx/xXy/////ywAAAAAEAAQAAACIZyPKckYDQFsb6ZqD85jZ2+BkwiRFKehhqQCQgDHcgwEBQA7) repeat 0 0}.link{text-decoration:none}.link,.link:active,.link:focus,.link:hover,.link:link,.link:visited{transition:color .15s ease-in}.link:focus{outline:1px dotted currentColor}.list{list-style-type:none}.h1{height:1rem}.h2{height:2rem}.h3{height:4rem}.h4{height:8rem}.h5{height:16rem}.h-25{height:25%}.h-50{height:50%}.h-75{height:75%}.h-100{height:100%}.min-h-100{min-height:100%}.vh-25{height:25vh}.vh-50{height:50vh}.vh-75{height:75vh}.vh-100{height:100vh}.min-vh-100{min-height:100vh}.h-auto{height:auto}.h-inherit{height:inherit}.black{color:#000}.white{color:#fff}.gray0{color:#333}.gray1{color:#4d4d4d}.gray2{color:#7f7f7f}.gray3{color:#b1b2b3}.gray4{color:#e6e6e6}.gray5{color:#f9f9f9}.blue0{color:#ecf6ff}.blue1{color:#b0c7ff}.blue2{color:#4330fc}.blue3{color:#190d7b}.red0{color:#f9d6ce}.red1{color:#ffa073}.red2{color:#ee5432}.red3{color:#c10d30}.green0{color:#bdebcc}.green1{color:#2ed196}.green2{color:#2aa779}.green3{color:#286e55}.yellow0{color:#ffefc5}.yellow1{color:#ffd972}.yellow2{color:#fcc440}.yellow3{color:#ee892b}.bg-black{background-color:#000}.bg-white{background-color:#fff}.bg-gray0{background-color:#333}.bg-gray1{background-color:#4d4d4d}.bg-gray2{background-color:#7f7f7f}.bg-gray3{background-color:#b1b2b3}.bg-gray4{background-color:#e6e6e6}.bg-gray5{background-color:#f9f9f9}.bg-blue0{background-color:#ecf6ff}.bg-blue1{background-color:#b0c7ff}.bg-blue2{background-color:#4330fc}.bg-blue3{background-color:#190d7b}.bg-red0{background-color:#f9d6ce}.bg-red1{background-color:#ffa073}.bg-red2{background-color:#ee5432}.bg-red3{background-color:#c10d30}.bg-green0{background-color:#bdebcc}.bg-green1{background-color:#2ed196}.bg-green2{background-color:#2aa779}.bg-green3{background-color:#286e55}.bg-yellow0{background-color:#ffefc5}.bg-yellow1{background-color:#ffd972}.bg-yellow2{background-color:#fcc440}.bg-yellow3{background-color:#ee892b}.bg-transparent{background-color:transparent}.hover-black:focus,.hover-black:hover{color:#000}.hover-white:focus,.hover-white:hover{color:#fff}.hover-gray0:focus,.hover-gray0:hover{color:#333}.hover-gray1:focus,.hover-gray1:hover{color:#4d4d4d}.hover-gray2:focus,.hover-gray2:hover{color:#7f7f7f}.hover-gray3:focus,.hover-gray3:hover{color:#b1b2b3}.hover-gray4:focus,.hover-gray4:hover{color:#e6e6e6}.hover-gray5:focus,.hover-gray5:hover{color:#f9f9f9}.hover-blue0:focus,.hover-blue0:hover{color:#ecf6ff}.hover-blue1:focus,.hover-blue1:hover{color:#b0c7ff}.hover-blue2:focus,.hover-blue2:hover{color:#4330fc}.hover-blue3:focus,.hover-blue3:hover{color:#190d7b}.hover-red0:focus,.hover-red0:hover{color:#f9d6ce}.hover-red1:focus,.hover-red1:hover{color:#ffa073}.hover-red2:focus,.hover-red2:hover{color:#ee5432}.hover-red3:focus,.hover-red3:hover{color:#c10d30}.hover-green0:focus,.hover-green0:hover{color:#bdebcc}.hover-green1:focus,.hover-green1:hover{color:#2ed196}.hover-green2:focus,.hover-green2:hover{color:#2aa779}.hover-green3:focus,.hover-green3:hover{color:#286e55}.hover-yellow0:focus,.hover-yellow0:hover{color:#ffefc5}.hover-yellow1:focus,.hover-yellow1:hover{color:#ffd972}.hover-yellow2:focus,.hover-yellow2:hover{color:#fcc440}.hover-yellow3:focus,.hover-yellow3:hover{color:#ee892b}.hover-bg-black:focus,.hover-bg-black:hover{background-color:#000}.hover-bg-white:focus,.hover-bg-white:hover{background-color:#fff}.hover-bg-gray0:focus,.hover-bg-gray0:hover{background-color:#333}.hover-bg-gray1:focus,.hover-bg-gray1:hover{background-color:#4d4d4d}.hover-bg-gray2:focus,.hover-bg-gray2:hover{background-color:#7f7f7f}.hover-bg-gray3:focus,.hover-bg-gray3:hover{background-color:#b1b2b3}.hover-bg-gray4:focus,.hover-bg-gray4:hover{background-color:#e6e6e6}.hover-bg-gray5:focus,.hover-bg-gray5:hover{background-color:#f9f9f9}.hover-bg-blue0:focus,.hover-bg-blue0:hover{background-color:#ecf6ff}.hover-bg-blue1:focus,.hover-bg-blue1:hover{background-color:#b0c7ff}.hover-bg-blue2:focus,.hover-bg-blue2:hover{background-color:#4330fc}.hover-bg-blue3:focus,.hover-bg-blue3:hover{background-color:#190d7b}.hover-bg-red0:focus,.hover-bg-red0:hover{background-color:#f9d6ce}.hover-bg-red1:focus,.hover-bg-red1:hover{background-color:#ffa073}.hover-bg-red2:focus,.hover-bg-red2:hover{background-color:#ee5432}.hover-bg-red3:focus,.hover-bg-red3:hover{background-color:#c10d30}.hover-bg-green0:focus,.hover-bg-green0:hover{background-color:#bdebcc}.hover-bg-green1:focus,.hover-bg-green1:hover{background-color:#2ed196}.hover-bg-green2:focus,.hover-bg-green2:hover{background-color:#2aa779}.hover-bg-green3:focus,.hover-bg-green3:hover{background-color:#286e55}.hover-bg-yellow0:focus,.hover-bg-yellow0:hover{background-color:#ffefc5}.hover-bg-yellow1:focus,.hover-bg-yellow1:hover{background-color:#ffd972}.hover-bg-yellow2:focus,.hover-bg-yellow2:hover{background-color:#fcc440}.hover-bg-yellow3:focus,.hover-bg-yellow3:hover{background-color:#ee892b}.hover-bg-transparent:focus,.hover-bg-transparent:hover{background-color:transparent}img{max-width:100%}.tracked{letter-spacing:.1em}.tracked-tight{letter-spacing:-.05em}.tracked-mega{letter-spacing:.25em}.lh-solid{line-height:1.333333}.lh-title{line-height:1.5}.lh-copy{line-height:1.666666}.mw1{max-width:1rem}.mw2{max-width:2rem}.mw3{max-width:4rem}.mw4{max-width:8rem}.mw5{max-width:16rem}.mw6{max-width:32rem}.mw7{max-width:48rem}.mw8{max-width:64rem}.mw9{max-width:96rem}.mw-none{max-width:none}.mw-100{max-width:100%}.nested-copy-line-height ol,.nested-copy-line-height p,.nested-copy-line-height ul{line-height:1.5}.nested-headline-line-height h1,.nested-headline-line-height h2,.nested-headline-line-height h3,.nested-headline-line-height h4,.nested-headline-line-height h5,.nested-headline-line-height h6{line-height:1.25}.nested-list-reset ol,.nested-list-reset ul{padding-left:0;margin-left:0;list-style-type:none}.nested-copy-indent p+p{text-indent:1em;margin-top:0;margin-bottom:0}.nested-copy-separator p+p{margin-top:1.5em}.nested-img img{width:100%;max-width:100%;display:block}.nested-links a{color:#357edd;transition:color .15s ease-in}.nested-links a:focus,.nested-links a:hover{color:#96ccff;transition:color .15s ease-in}.dim{opacity:1}.dim,.dim:focus,.dim:hover{transition:opacity .15s ease-in}.dim:focus,.dim:hover{opacity:.5}.dim:active{opacity:.8;transition:opacity .15s ease-out}.glow,.glow:focus,.glow:hover{transition:opacity .15s ease-in}.glow:focus,.glow:hover{opacity:1}.hide-child .child{opacity:0;transition:opacity .15s ease-in}.hide-child:active .child,.hide-child:focus .child,.hide-child:hover .child{opacity:1;transition:opacity .15s ease-in}.underline-hover:focus,.underline-hover:hover{text-decoration:underline}.grow{-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-out;transition:transform .25s ease-out;transition:transform .25s ease-out,-webkit-transform .25s ease-out}.grow:focus,.grow:hover{-webkit-transform:scale(1.05);transform:scale(1.05)}.grow:active{-webkit-transform:scale(.9);transform:scale(.9)}.grow-large{-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-in-out;transition:transform .25s ease-in-out;transition:transform .25s ease-in-out,-webkit-transform .25s ease-in-out}.grow-large:focus,.grow-large:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.grow-large:active{-webkit-transform:scale(.95);transform:scale(.95)}.pointer:hover,.shadow-hover{cursor:pointer}.shadow-hover{position:relative;transition:all .5s cubic-bezier(.165,.84,.44,1)}.shadow-hover:after{content:"";box-shadow:0 0 16px 2px rgba(0,0,0,.2);border-radius:inherit;opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;transition:opacity .5s cubic-bezier(.165,.84,.44,1)}.shadow-hover:focus:after,.shadow-hover:hover:after{opacity:1}.bg-animate,.bg-animate:focus,.bg-animate:hover{transition:background-color .15s ease-in-out}.o-100{opacity:1}.o-90{opacity:.9}.o-80{opacity:.8}.o-70{opacity:.7}.o-60{opacity:.6}.o-50{opacity:.5}.o-40{opacity:.4}.o-30{opacity:.3}.o-20{opacity:.2}.o-10{opacity:.1}.o-05{opacity:.05}.o-025{opacity:.025}.o-0{opacity:0}.rotate-45{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.rotate-135{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rotate-225{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.rotate-315{-webkit-transform:rotate(315deg);transform:rotate(315deg)}.outline{outline:1px solid}.outline-transparent{outline:1px solid transparent}.outline-0{outline:0}.overflow-visible{overflow:visible}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-auto{overflow:auto}.overflow-x-visible{overflow-x:visible}.overflow-x-hidden{overflow-x:hidden}.overflow-x-scroll{overflow-x:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-visible{overflow-y:visible}.overflow-y-hidden{overflow-y:hidden}.overflow-y-scroll{overflow-y:scroll}.overflow-y-auto{overflow-y:auto}.static{position:static}.relative{position:relative}.absolute{position:absolute}.fixed{position:fixed}.collapse{border-collapse:collapse;border-spacing:0}.striped--light-silver:nth-child(odd){background-color:#aaa}.striped--moon-gray:nth-child(odd){background-color:#ccc}.striped--light-gray:nth-child(odd){background-color:#eee}.striped--near-white:nth-child(odd){background-color:#f4f4f4}.stripe-light:nth-child(odd){background-color:hsla(0,0%,100%,.1)}.stripe-dark:nth-child(odd){background-color:rgba(0,0,0,.1)}.strike{text-decoration:line-through}.underline{text-decoration:underline}.no-underline{text-decoration:none}.tl{text-align:left}.tr{text-align:right}.tc{text-align:center}.tj{text-align:justify}.ttc{text-transform:capitalize}.ttl{text-transform:lowercase}.ttu{text-transform:uppercase}.ttn{text-transform:none}.v-base{vertical-align:baseline}.v-mid{vertical-align:middle}.v-top{vertical-align:top}.v-btm{vertical-align:bottom}.f1{font-size:4.5rem}.f2{font-size:4rem}.f3{font-size:3rem}.f4{font-size:2rem}.f5{font-size:1.5rem}.f6{font-size:1.125rem}.f7{font-size:1rem}.f8{font-size:.875rem}.f9{font-size:.75rem}.measure{max-width:30em}.measure-wide{max-width:34em}.measure-narrow{max-width:20em}.small-caps{font-variant:small-caps}.indent{text-indent:1em;margin-top:0;margin-bottom:0}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overflow-container{overflow-y:scroll}.center{margin-left:auto}.center,.mr-auto{margin-right:auto}.ml-auto{margin-left:auto}.clip{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ws-normal{white-space:normal}.nowrap{white-space:nowrap}.pre{white-space:pre}.w1{width:1rem}.w2{width:2rem}.w3{width:4rem}.w4{width:8rem}.w5{width:16rem}.w-10{width:10%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-33{width:33%}.w-34{width:34%}.w-40{width:40%}.w-50{width:50%}.w-60{width:60%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-90{width:90%}.w-100{width:100%}.w-third{width:33.33333%}.w-two-thirds{width:66.66667%}.w-auto{width:auto}.z-0{z-index:0}.z-1{z-index:1}.z-2{z-index:2}.z-3{z-index:3}.z-4{z-index:4}.z-5{z-index:5}.z-999{z-index:999}.z-9999{z-index:9999}.z-max{z-index:2147483647}.z-inherit{z-index:inherit}.z-initial{z-index:auto}.z-unset{z-index:unset}@media screen and (min-width:34.375em) and (max-width:46.875em){.aspect-ratio-m{height:0;position:relative}.aspect-ratio--16x9-m{padding-bottom:56.25%}.aspect-ratio--9x16-m{padding-bottom:177.77%}.aspect-ratio--4x3-m{padding-bottom:75%}.aspect-ratio--3x4-m{padding-bottom:133.33%}.aspect-ratio--6x4-m{padding-bottom:66.6%}.aspect-ratio--4x6-m{padding-bottom:150%}.aspect-ratio--8x5-m{padding-bottom:62.5%}.aspect-ratio--5x8-m{padding-bottom:160%}.aspect-ratio--7x5-m{padding-bottom:71.42%}.aspect-ratio--5x7-m{padding-bottom:140%}.aspect-ratio--1x1-m{padding-bottom:100%}.aspect-ratio--object-m{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}.cover-m{background-size:cover!important}.contain-m{background-size:contain!important}.bg-center-m{background-position:50%}.bg-center-m,.bg-top-m{background-repeat:no-repeat}.bg-top-m{background-position:top}.bg-right-m{background-position:100%}.bg-bottom-m,.bg-right-m{background-repeat:no-repeat}.bg-bottom-m{background-position:bottom}.bg-left-m{background-repeat:no-repeat;background-position:0}.ba-m{border-style:solid;border-width:1px}.bt-m{border-top-style:solid;border-top-width:1px}.br-m{border-right-style:solid;border-right-width:1px}.bb-m{border-bottom-style:solid;border-bottom-width:1px}.bl-m{border-left-style:solid;border-left-width:1px}.bn-m{border-style:none;border-width:0}.br0-m{border-radius:0}.br1-m{border-radius:.125rem}.br2-m{border-radius:.25rem}.br3-m{border-radius:.5rem}.br4-m{border-radius:1rem}.br-100-m{border-radius:100%}.br-pill-m{border-radius:9999px}.br--bottom-m{border-top-left-radius:0;border-top-right-radius:0}.br--top-m{border-bottom-right-radius:0}.br--right-m,.br--top-m{border-bottom-left-radius:0}.br--right-m{border-top-left-radius:0}.br--left-m{border-top-right-radius:0;border-bottom-right-radius:0}.b--dotted-m{border-style:dotted}.b--dashed-m{border-style:dashed}.b--solid-m{border-style:solid}.b--none-m{border-style:none}.bw0-m{border-width:0}.bw1-m{border-width:.125rem}.bw2-m{border-width:.25rem}.bw3-m{border-width:.5rem}.bw4-m{border-width:1rem}.bw5-m{border-width:2rem}.bt-0-m{border-top-width:0}.br-0-m{border-right-width:0}.bb-0-m{border-bottom-width:0}.bl-0-m{border-left-width:0}.shadow-1-m{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.shadow-2-m{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.shadow-3-m{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.shadow-4-m{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.shadow-5-m{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}.pa0-m{padding:0}.ma0-m,.na0-m{margin:0}.pl0-m{padding-left:0}.ml0-m,.nl0-m{margin-left:0}.pr0-m{padding-right:0}.mr0-m,.nr0-m{margin-right:0}.pt0-m{padding-top:0}.mt0-m,.nt0-m{margin-top:0}.pb0-m{padding-bottom:0}.mb0-m,.nb0-m{margin-bottom:0}.pv0-m{padding-top:0;padding-bottom:0}.mv0-m,.nv0-m{margin-top:0;margin-bottom:0}.ph0-m{padding-left:0;padding-right:0}.mh0-m,.nh0-m{margin-left:0;margin-right:0}.pa1-m{padding:.25rem}.ma1-m{margin:.25rem}.na1-m{margin:-.25rem}.pl1-m{padding-left:.25rem}.ml1-m{margin-left:.25rem}.nl1-m{margin-left:-.25rem}.pr1-m{padding-right:.25rem}.mr1-m{margin-right:.25rem}.nr1-m{margin-right:-.25rem}.pt1-m{padding-top:.25rem}.mt1-m{margin-top:.25rem}.nt1-m{margin-top:-.25rem}.pb1-m{padding-bottom:.25rem}.mb1-m{margin-bottom:.25rem}.nb1-m{margin-bottom:-.25rem}.pv1-m{padding-top:.25rem;padding-bottom:.25rem}.mv1-m{margin-top:.25rem;margin-bottom:.25rem}.nv1-m{margin-top:-.25rem;margin-bottom:-.25rem}.ph1-m{padding-left:.25rem;padding-right:.25rem}.mh1-m{margin-left:.25rem;margin-right:.25rem}.nh1-m{margin-left:-.25rem;margin-right:-.25rem}.pa2-m{padding:.5rem}.ma2-m{margin:.5rem}.na2-m{margin:-.5rem}.pl2-m{padding-left:.5rem}.ml2-m{margin-left:.5rem}.nl2-m{margin-left:-.5rem}.pr2-m{padding-right:.5rem}.mr2-m{margin-right:.5rem}.nr2-m{margin-right:-.5rem}.pt2-m{padding-top:.5rem}.mt2-m{margin-top:.5rem}.nt2-m{margin-top:-.5rem}.pb2-m{padding-bottom:.5rem}.mb2-m{margin-bottom:.5rem}.nb2-m{margin-bottom:-.5rem}.pv2-m{padding-top:.5rem;padding-bottom:.5rem}.mv2-m{margin-top:.5rem;margin-bottom:.5rem}.nv2-m{margin-top:-.5rem;margin-bottom:-.5rem}.ph2-m{padding-left:.5rem;padding-right:.5rem}.mh2-m{margin-left:.5rem;margin-right:.5rem}.nh2-m{margin-left:-.5rem;margin-right:-.5rem}.pa3-m{padding:.75rem}.ma3-m{margin:.75rem}.na3-m{margin:-.75rem}.pl3-m{padding-left:.75rem}.ml3-m{margin-left:.75rem}.nl3-m{margin-left:-.75rem}.pr3-m{padding-right:.75rem}.mr3-m{margin-right:.75rem}.nr3-m{margin-right:-.75rem}.pt3-m{padding-top:.75rem}.mt3-m{margin-top:.75rem}.nt3-m{margin-top:-.75rem}.pb3-m{padding-bottom:.75rem}.mb3-m{margin-bottom:.75rem}.nb3-m{margin-bottom:-.75rem}.pv3-m{padding-top:.75rem;padding-bottom:.75rem}.mv3-m{margin-top:.75rem;margin-bottom:.75rem}.nv3-m{margin-top:-.75rem;margin-bottom:-.75rem}.ph3-m{padding-left:.75rem;padding-right:.75rem}.mh3-m{margin-left:.75rem;margin-right:.75rem}.nh3-m{margin-left:-.75rem;margin-right:-.75rem}.pa4-m{padding:1rem}.ma4-m{margin:1rem}.na4-m{margin:-1rem}.pl4-m{padding-left:1rem}.ml4-m{margin-left:1rem}.nl4-m{margin-left:-1rem}.pr4-m{padding-right:1rem}.mr4-m{margin-right:1rem}.nr4-m{margin-right:-1rem}.pt4-m{padding-top:1rem}.mt4-m{margin-top:1rem}.nt4-m{margin-top:-1rem}.pb4-m{padding-bottom:1rem}.mb4-m{margin-bottom:1rem}.nb4-m{margin-bottom:-1rem}.pv4-m{padding-top:1rem;padding-bottom:1rem}.mv4-m{margin-top:1rem;margin-bottom:1rem}.nv4-m{margin-top:-1rem;margin-bottom:-1rem}.ph4-m{padding-left:1rem;padding-right:1rem}.mh4-m{margin-left:1rem;margin-right:1rem}.nh4-m{margin-left:-1rem;margin-right:-1rem}.pa5-m{padding:1.25rem}.ma5-m{margin:1.25rem}.na5-m{margin:-1.25rem}.pl5-m{padding-left:1.25rem}.ml5-m{margin-left:1.25rem}.nl5-m{margin-left:-1.25rem}.pr5-m{padding-right:1.25rem}.mr5-m{margin-right:1.25rem}.nr5-m{margin-right:-1.25rem}.pt5-m{padding-top:1.25rem}.mt5-m{margin-top:1.25rem}.nt5-m{margin-top:-1.25rem}.pb5-m{padding-bottom:1.25rem}.mb5-m{margin-bottom:1.25rem}.nb5-m{margin-bottom:-1.25rem}.pv5-m{padding-top:1.25rem;padding-bottom:1.25rem}.mv5-m{margin-top:1.25rem;margin-bottom:1.25rem}.nv5-m{margin-top:-1.25rem;margin-bottom:-1.25rem}.ph5-m{padding-left:1.25rem;padding-right:1.25rem}.mh5-m{margin-left:1.25rem;margin-right:1.25rem}.nh5-m{margin-left:-1.25rem;margin-right:-1.25rem}.pa6-m{padding:1.5rem}.ma6-m{margin:1.5rem}.na6-m{margin:-1.5rem}.pl6-m{padding-left:1.5rem}.ml6-m{margin-left:1.5rem}.nl6-m{margin-left:-1.5rem}.pr6-m{padding-right:1.5rem}.mr6-m{margin-right:1.5rem}.nr6-m{margin-right:-1.5rem}.pt6-m{padding-top:1.5rem}.mt6-m{margin-top:1.5rem}.nt6-m{margin-top:-1.5rem}.pb6-m{padding-bottom:1.5rem}.mb6-m{margin-bottom:1.5rem}.nb6-m{margin-bottom:-1.5rem}.pv6-m{padding-top:1.5rem;padding-bottom:1.5rem}.mv6-m{margin-top:1.5rem;margin-bottom:1.5rem}.nv6-m{margin-top:-1.5rem;margin-bottom:-1.5rem}.ph6-m{padding-left:1.5rem;padding-right:1.5rem}.mh6-m{margin-left:1.5rem;margin-right:1.5rem}.nh6-m{margin-left:-1.5rem;margin-right:-1.5rem}.pa7-m{padding:2rem}.ma7-m{margin:2rem}.na7-m{margin:-2rem}.pl7-m{padding-left:2rem}.ml7-m{margin-left:2rem}.nl7-m{margin-left:-2rem}.pr7-m{padding-right:2rem}.mr7-m{margin-right:2rem}.nr7-m{margin-right:-2rem}.pt7-m{padding-top:2rem}.mt7-m{margin-top:2rem}.nt7-m{margin-top:-2rem}.pb7-m{padding-bottom:2rem}.mb7-m{margin-bottom:2rem}.nb7-m{margin-bottom:-2rem}.pv7-m{padding-top:2rem;padding-bottom:2rem}.mv7-m{margin-top:2rem;margin-bottom:2rem}.nv7-m{margin-top:-2rem;margin-bottom:-2rem}.ph7-m{padding-left:2rem;padding-right:2rem}.mh7-m{margin-left:2rem;margin-right:2rem}.nh7-m{margin-left:-2rem;margin-right:-2rem}.pa8-m{padding:3rem}.ma8-m{margin:3rem}.na8-m{margin:-3rem}.pl8-m{padding-left:3rem}.ml8-m{margin-left:3rem}.nl8-m{margin-left:-3rem}.pr8-m{padding-right:3rem}.mr8-m{margin-right:3rem}.nr8-m{margin-right:-3rem}.pt8-m{padding-top:3rem}.mt8-m{margin-top:3rem}.nt8-m{margin-top:-3rem}.pb8-m{padding-bottom:3rem}.mb8-m{margin-bottom:3rem}.nb8-m{margin-bottom:-3rem}.pv8-m{padding-top:3rem;padding-bottom:3rem}.mv8-m{margin-top:3rem;margin-bottom:3rem}.nv8-m{margin-top:-3rem;margin-bottom:-3rem}.ph8-m{padding-left:3rem;padding-right:3rem}.mh8-m{margin-left:3rem;margin-right:3rem}.nh8-m{margin-left:-3rem;margin-right:-3rem}.pa9-m{padding:4rem}.ma9-m{margin:4rem}.na9-m{margin:-4rem}.pl9-m{padding-left:4rem}.ml9-m{margin-left:4rem}.nl9-m{margin-left:-4rem}.pr9-m{padding-right:4rem}.mr9-m{margin-right:4rem}.nr9-m{margin-right:-4rem}.pt9-m{padding-top:4rem}.mt9-m{margin-top:4rem}.nt9-m{margin-top:-4rem}.pb9-m{padding-bottom:4rem}.mb9-m{margin-bottom:4rem}.nb9-m{margin-bottom:-4rem}.pv9-m{padding-top:4rem;padding-bottom:4rem}.mv9-m{margin-top:4rem;margin-bottom:4rem}.nv9-m{margin-top:-4rem;margin-bottom:-4rem}.ph9-m{padding-left:4rem;padding-right:4rem}.mh9-m{margin-left:4rem;margin-right:4rem}.nh9-m{margin-left:-4rem;margin-right:-4rem}.pa10-m{padding:6rem}.ma10-m{margin:6rem}.na10-m{margin:-6rem}.pl10-m{padding-left:6rem}.ml10-m{margin-left:6rem}.nl10-m{margin-left:-6rem}.pr10-m{padding-right:6rem}.mr10-m{margin-right:6rem}.nr10-m{margin-right:-6rem}.pt10-m{padding-top:6rem}.mt10-m{margin-top:6rem}.nt10-m{margin-top:-6rem}.pb10-m{padding-bottom:6rem}.mb10-m{margin-bottom:6rem}.nb10-m{margin-bottom:-6rem}.pv10-m{padding-top:6rem;padding-bottom:6rem}.mv10-m{margin-top:6rem;margin-bottom:6rem}.nv10-m{margin-top:-6rem;margin-bottom:-6rem}.ph10-m{padding-left:6rem;padding-right:6rem}.mh10-m{margin-left:6rem;margin-right:6rem}.nh10-m{margin-left:-6rem;margin-right:-6rem}.pa11-m{padding:10rem}.ma11-m{margin:10rem}.na11-m{margin:-10rem}.pl11-m{padding-left:10rem}.ml11-m{margin-left:10rem}.nl11-m{margin-left:-10rem}.pr11-m{padding-right:10rem}.mr11-m{margin-right:10rem}.nr11-m{margin-right:-10rem}.pt11-m{padding-top:10rem}.mt11-m{margin-top:10rem}.nt11-m{margin-top:-10rem}.pb11-m{padding-bottom:10rem}.mb11-m{margin-bottom:10rem}.nb11-m{margin-bottom:-10rem}.pv11-m{padding-top:10rem;padding-bottom:10rem}.mv11-m{margin-top:10rem;margin-bottom:10rem}.nv11-m{margin-top:-10rem;margin-bottom:-10rem}.ph11-m{padding-left:10rem;padding-right:10rem}.mh11-m{margin-left:10rem;margin-right:10rem}.nh11-m{margin-left:-10rem;margin-right:-10rem}.pa12-m{padding:18rem}.ma12-m{margin:18rem}.na12-m{margin:-18rem}.pl12-m{padding-left:18rem}.ml12-m{margin-left:18rem}.nl12-m{margin-left:-18rem}.pr12-m{padding-right:18rem}.mr12-m{margin-right:18rem}.nr12-m{margin-right:-18rem}.pt12-m{padding-top:18rem}.mt12-m{margin-top:18rem}.nt12-m{margin-top:-18rem}.pb12-m{padding-bottom:18rem}.mb12-m{margin-bottom:18rem}.nb12-m{margin-bottom:-18rem}.pv12-m{padding-top:18rem;padding-bottom:18rem}.mv12-m{margin-top:18rem;margin-bottom:18rem}.nv12-m{margin-top:-18rem;margin-bottom:-18rem}.ph12-m{padding-left:18rem;padding-right:18rem}.mh12-m{margin-left:18rem;margin-right:18rem}.nh12-m{margin-left:-18rem;margin-right:-18rem}.top-0-m{top:0}.right-0-m{right:0}.bottom-0-m{bottom:0}.left-0-m{left:0}.top-1-m{top:1rem}.right-1-m{right:1rem}.bottom-1-m{bottom:1rem}.left-1-m{left:1rem}.top-2-m{top:2rem}.right-2-m{right:2rem}.bottom-2-m{bottom:2rem}.left-2-m{left:2rem}.top--1-m{top:-1rem}.right--1-m{right:-1rem}.bottom--1-m{bottom:-1rem}.left--1-m{left:-1rem}.top--2-m{top:-2rem}.right--2-m{right:-2rem}.bottom--2-m{bottom:-2rem}.left--2-m{left:-2rem}.absolute--fill-m{top:0;right:0;bottom:0;left:0}.cf-m:after,.cf-m:before{content:" ";display:table}.cf-m:after{clear:both}.cf-m{*zoom:1}.cl-m{clear:left}.cr-m{clear:right}.cb-m{clear:both}.cn-m{clear:none}.dn-m{display:none}.di-m{display:inline}.db-m{display:block}.dib-m{display:inline-block}.dit-m{display:inline-table}.dt-m{display:table}.dtc-m{display:table-cell}.dt-row-m{display:table-row}.dt-row-group-m{display:table-row-group}.dt-column-m{display:table-column}.dt-column-group-m{display:table-column-group}.dt--fixed-m{table-layout:fixed;width:100%}.flex-m{display:flex}.inline-flex-m{display:inline-flex}.flex-auto-m{flex:1 1 auto;min-width:0;min-height:0}.flex-none-m{flex:none}.flex-column-m{flex-direction:column}.flex-row-m{flex-direction:row}.flex-wrap-m{flex-wrap:wrap}.flex-nowrap-m{flex-wrap:nowrap}.flex-wrap-reverse-m{flex-wrap:wrap-reverse}.flex-column-reverse-m{flex-direction:column-reverse}.flex-row-reverse-m{flex-direction:row-reverse}.items-start-m{align-items:flex-start}.items-end-m{align-items:flex-end}.items-center-m{align-items:center}.items-baseline-m{align-items:baseline}.items-stretch-m{align-items:stretch}.self-start-m{align-self:flex-start}.self-end-m{align-self:flex-end}.self-center-m{align-self:center}.self-baseline-m{align-self:baseline}.self-stretch-m{align-self:stretch}.justify-start-m{justify-content:flex-start}.justify-end-m{justify-content:flex-end}.justify-center-m{justify-content:center}.justify-between-m{justify-content:space-between}.justify-around-m{justify-content:space-around}.content-start-m{align-content:flex-start}.content-end-m{align-content:flex-end}.content-center-m{align-content:center}.content-between-m{align-content:space-between}.content-around-m{align-content:space-around}.content-stretch-m{align-content:stretch}.order-0-m{order:0}.order-1-m{order:1}.order-2-m{order:2}.order-3-m{order:3}.order-4-m{order:4}.order-5-m{order:5}.order-6-m{order:6}.order-7-m{order:7}.order-8-m{order:8}.order-last-m{order:99999}.flex-grow-0-m{flex-grow:0}.flex-grow-1-m{flex-grow:1}.flex-shrink-0-m{flex-shrink:0}.flex-shrink-1-m{flex-shrink:1}.fl-m{float:left}.fl-m,.fr-m{_display:inline}.fr-m{float:right}.fn-m{float:none}.i-m{font-style:italic}.fs-normal-m{font-style:normal}.normal-m{font-weight:400}.b-m{font-weight:700}.fw1-m{font-weight:100}.fw2-m{font-weight:200}.fw3-m{font-weight:300}.fw4-m{font-weight:400}.fw5-m{font-weight:500}.fw6-m{font-weight:600}.fw7-m{font-weight:700}.fw8-m{font-weight:800}.fw9-m{font-weight:900}.h1-m{height:1rem}.h2-m{height:2rem}.h3-m{height:4rem}.h4-m{height:8rem}.h5-m{height:16rem}.h-25-m{height:25%}.h-50-m{height:50%}.h-75-m{height:75%}.h-100-m{height:100%}.min-h-100-m{min-height:100%}.vh-25-m{height:25vh}.vh-50-m{height:50vh}.vh-75-m{height:75vh}.vh-100-m{height:100vh}.min-vh-100-m{min-height:100vh}.h-auto-m{height:auto}.h-inherit-m{height:inherit}.tracked-m{letter-spacing:.1em}.tracked-tight-m{letter-spacing:-.05em}.tracked-mega-m{letter-spacing:.25em}.lh-solid-m{line-height:1.333333}.lh-title-m{line-height:1.5}.lh-copy-m{line-height:1.666666}.mw1-m{max-width:1rem}.mw2-m{max-width:2rem}.mw3-m{max-width:4rem}.mw4-m{max-width:8rem}.mw5-m{max-width:16rem}.mw6-m{max-width:32rem}.mw7-m{max-width:48rem}.mw8-m{max-width:64rem}.mw9-m{max-width:96rem}.mw-none-m{max-width:none}.mw-100-m{max-width:100%}.o-100-m{opacity:1}.o-90-m{opacity:.9}.o-80-m{opacity:.8}.o-70-m{opacity:.7}.o-60-m{opacity:.6}.o-50-m{opacity:.5}.o-40-m{opacity:.4}.o-30-m{opacity:.3}.o-20-m{opacity:.2}.o-10-m{opacity:.1}.o-05-m{opacity:.05}.o-025-m{opacity:.025}.o-0-m{opacity:0}.rotate-45-m{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.rotate-90-m{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.rotate-135-m{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.rotate-180-m{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rotate-225-m{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.rotate-270-m{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.rotate-315-m{-webkit-transform:rotate(315deg);transform:rotate(315deg)}.outline-m{outline:1px solid}.outline-transparent-m{outline:1px solid transparent}.outline-0-m{outline:0}.overflow-visible-m{overflow:visible}.overflow-hidden-m{overflow:hidden}.overflow-scroll-m{overflow:scroll}.overflow-auto-m{overflow:auto}.overflow-x-visible-m{overflow-x:visible}.overflow-x-hidden-m{overflow-x:hidden}.overflow-x-scroll-m{overflow-x:scroll}.overflow-x-auto-m{overflow-x:auto}.overflow-y-visible-m{overflow-y:visible}.overflow-y-hidden-m{overflow-y:hidden}.overflow-y-scroll-m{overflow-y:scroll}.overflow-y-auto-m{overflow-y:auto}.static-m{position:static}.relative-m{position:relative}.absolute-m{position:absolute}.fixed-m{position:fixed}.strike-m{text-decoration:line-through}.underline-m{text-decoration:underline}.no-underline-m{text-decoration:none}.tl-m{text-align:left}.tr-m{text-align:right}.tc-m{text-align:center}.tj-m{text-align:justify}.ttc-m{text-transform:capitalize}.ttl-m{text-transform:lowercase}.ttu-m{text-transform:uppercase}.ttn-m{text-transform:none}.f1-m{font-size:4.5rem}.f2-m{font-size:4rem}.f3-m{font-size:3rem}.f4-m{font-size:2rem}.f5-m{font-size:1.5rem}.f6-m{font-size:1.125rem}.f7-m{font-size:1rem}.f8-m{font-size:.875rem}.f9-m{font-size:.75rem}.measure-m{max-width:30em}.measure-wide-m{max-width:34em}.measure-narrow-m{max-width:20em}.small-caps-m{font-variant:small-caps}.indent-m{text-indent:1em;margin-top:0;margin-bottom:0}.truncate-m{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clip-m{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ws-normal-m{white-space:normal}.nowrap-m{white-space:nowrap}.pre-m{white-space:pre}.w1-m{width:1rem}.w2-m{width:2rem}.w3-m{width:4rem}.w4-m{width:8rem}.w5-m{width:16rem}.w-10-m{width:10%}.w-20-m{width:20%}.w-25-m{width:25%}.w-30-m{width:30%}.w-33-m{width:33%}.w-34-m{width:34%}.w-40-m{width:40%}.w-50-m{width:50%}.w-60-m{width:60%}.w-70-m{width:70%}.w-75-m{width:75%}.w-80-m{width:80%}.w-90-m{width:90%}.w-100-m{width:100%}.w-third-m{width:33.33333%}.w-two-thirds-m{width:66.66667%}.w-auto-m{width:auto}}@media screen and (min-width:46.875em) and (max-width:60em){.aspect-ratio-l{height:0;position:relative}.aspect-ratio--16x9-l{padding-bottom:56.25%}.aspect-ratio--9x16-l{padding-bottom:177.77%}.aspect-ratio--4x3-l{padding-bottom:75%}.aspect-ratio--3x4-l{padding-bottom:133.33%}.aspect-ratio--6x4-l{padding-bottom:66.6%}.aspect-ratio--4x6-l{padding-bottom:150%}.aspect-ratio--8x5-l{padding-bottom:62.5%}.aspect-ratio--5x8-l{padding-bottom:160%}.aspect-ratio--7x5-l{padding-bottom:71.42%}.aspect-ratio--5x7-l{padding-bottom:140%}.aspect-ratio--1x1-l{padding-bottom:100%}.aspect-ratio--object-l{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}.cover-l{background-size:cover!important}.contain-l{background-size:contain!important}.bg-center-l{background-position:50%}.bg-center-l,.bg-top-l{background-repeat:no-repeat}.bg-top-l{background-position:top}.bg-right-l{background-position:100%}.bg-bottom-l,.bg-right-l{background-repeat:no-repeat}.bg-bottom-l{background-position:bottom}.bg-left-l{background-repeat:no-repeat;background-position:0}.ba-l{border-style:solid;border-width:1px}.bt-l{border-top-style:solid;border-top-width:1px}.br-l{border-right-style:solid;border-right-width:1px}.bb-l{border-bottom-style:solid;border-bottom-width:1px}.bl-l{border-left-style:solid;border-left-width:1px}.bn-l{border-style:none;border-width:0}.br0-l{border-radius:0}.br1-l{border-radius:.125rem}.br2-l{border-radius:.25rem}.br3-l{border-radius:.5rem}.br4-l{border-radius:1rem}.br-100-l{border-radius:100%}.br-pill-l{border-radius:9999px}.br--bottom-l{border-top-left-radius:0;border-top-right-radius:0}.br--top-l{border-bottom-right-radius:0}.br--right-l,.br--top-l{border-bottom-left-radius:0}.br--right-l{border-top-left-radius:0}.br--left-l{border-top-right-radius:0;border-bottom-right-radius:0}.b--dotted-l{border-style:dotted}.b--dashed-l{border-style:dashed}.b--solid-l{border-style:solid}.b--none-l{border-style:none}.bw0-l{border-width:0}.bw1-l{border-width:.125rem}.bw2-l{border-width:.25rem}.bw3-l{border-width:.5rem}.bw4-l{border-width:1rem}.bw5-l{border-width:2rem}.bt-0-l{border-top-width:0}.br-0-l{border-right-width:0}.bb-0-l{border-bottom-width:0}.bl-0-l{border-left-width:0}.shadow-1-l{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.shadow-2-l{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.shadow-3-l{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.shadow-4-l{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.shadow-5-l{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}.pa0-l{padding:0}.ma0-l,.na0-l{margin:0}.pl0-l{padding-left:0}.ml0-l,.nl0-l{margin-left:0}.pr0-l{padding-right:0}.mr0-l,.nr0-l{margin-right:0}.pt0-l{padding-top:0}.mt0-l,.nt0-l{margin-top:0}.pb0-l{padding-bottom:0}.mb0-l,.nb0-l{margin-bottom:0}.pv0-l{padding-top:0;padding-bottom:0}.mv0-l,.nv0-l{margin-top:0;margin-bottom:0}.ph0-l{padding-left:0;padding-right:0}.mh0-l,.nh0-l{margin-left:0;margin-right:0}.pa1-l{padding:.25rem}.ma1-l{margin:.25rem}.na1-l{margin:-.25rem}.pl1-l{padding-left:.25rem}.ml1-l{margin-left:.25rem}.nl1-l{margin-left:-.25rem}.pr1-l{padding-right:.25rem}.mr1-l{margin-right:.25rem}.nr1-l{margin-right:-.25rem}.pt1-l{padding-top:.25rem}.mt1-l{margin-top:.25rem}.nt1-l{margin-top:-.25rem}.pb1-l{padding-bottom:.25rem}.mb1-l{margin-bottom:.25rem}.nb1-l{margin-bottom:-.25rem}.pv1-l{padding-top:.25rem;padding-bottom:.25rem}.mv1-l{margin-top:.25rem;margin-bottom:.25rem}.nv1-l{margin-top:-.25rem;margin-bottom:-.25rem}.ph1-l{padding-left:.25rem;padding-right:.25rem}.mh1-l{margin-left:.25rem;margin-right:.25rem}.nh1-l{margin-left:-.25rem;margin-right:-.25rem}.pa2-l{padding:.5rem}.ma2-l{margin:.5rem}.na2-l{margin:-.5rem}.pl2-l{padding-left:.5rem}.ml2-l{margin-left:.5rem}.nl2-l{margin-left:-.5rem}.pr2-l{padding-right:.5rem}.mr2-l{margin-right:.5rem}.nr2-l{margin-right:-.5rem}.pt2-l{padding-top:.5rem}.mt2-l{margin-top:.5rem}.nt2-l{margin-top:-.5rem}.pb2-l{padding-bottom:.5rem}.mb2-l{margin-bottom:.5rem}.nb2-l{margin-bottom:-.5rem}.pv2-l{padding-top:.5rem;padding-bottom:.5rem}.mv2-l{margin-top:.5rem;margin-bottom:.5rem}.nv2-l{margin-top:-.5rem;margin-bottom:-.5rem}.ph2-l{padding-left:.5rem;padding-right:.5rem}.mh2-l{margin-left:.5rem;margin-right:.5rem}.nh2-l{margin-left:-.5rem;margin-right:-.5rem}.pa3-l{padding:.75rem}.ma3-l{margin:.75rem}.na3-l{margin:-.75rem}.pl3-l{padding-left:.75rem}.ml3-l{margin-left:.75rem}.nl3-l{margin-left:-.75rem}.pr3-l{padding-right:.75rem}.mr3-l{margin-right:.75rem}.nr3-l{margin-right:-.75rem}.pt3-l{padding-top:.75rem}.mt3-l{margin-top:.75rem}.nt3-l{margin-top:-.75rem}.pb3-l{padding-bottom:.75rem}.mb3-l{margin-bottom:.75rem}.nb3-l{margin-bottom:-.75rem}.pv3-l{padding-top:.75rem;padding-bottom:.75rem}.mv3-l{margin-top:.75rem;margin-bottom:.75rem}.nv3-l{margin-top:-.75rem;margin-bottom:-.75rem}.ph3-l{padding-left:.75rem;padding-right:.75rem}.mh3-l{margin-left:.75rem;margin-right:.75rem}.nh3-l{margin-left:-.75rem;margin-right:-.75rem}.pa4-l{padding:1rem}.ma4-l{margin:1rem}.na4-l{margin:-1rem}.pl4-l{padding-left:1rem}.ml4-l{margin-left:1rem}.nl4-l{margin-left:-1rem}.pr4-l{padding-right:1rem}.mr4-l{margin-right:1rem}.nr4-l{margin-right:-1rem}.pt4-l{padding-top:1rem}.mt4-l{margin-top:1rem}.nt4-l{margin-top:-1rem}.pb4-l{padding-bottom:1rem}.mb4-l{margin-bottom:1rem}.nb4-l{margin-bottom:-1rem}.pv4-l{padding-top:1rem;padding-bottom:1rem}.mv4-l{margin-top:1rem;margin-bottom:1rem}.nv4-l{margin-top:-1rem;margin-bottom:-1rem}.ph4-l{padding-left:1rem;padding-right:1rem}.mh4-l{margin-left:1rem;margin-right:1rem}.nh4-l{margin-left:-1rem;margin-right:-1rem}.pa5-l{padding:1.25rem}.ma5-l{margin:1.25rem}.na5-l{margin:-1.25rem}.pl5-l{padding-left:1.25rem}.ml5-l{margin-left:1.25rem}.nl5-l{margin-left:-1.25rem}.pr5-l{padding-right:1.25rem}.mr5-l{margin-right:1.25rem}.nr5-l{margin-right:-1.25rem}.pt5-l{padding-top:1.25rem}.mt5-l{margin-top:1.25rem}.nt5-l{margin-top:-1.25rem}.pb5-l{padding-bottom:1.25rem}.mb5-l{margin-bottom:1.25rem}.nb5-l{margin-bottom:-1.25rem}.pv5-l{padding-top:1.25rem;padding-bottom:1.25rem}.mv5-l{margin-top:1.25rem;margin-bottom:1.25rem}.nv5-l{margin-top:-1.25rem;margin-bottom:-1.25rem}.ph5-l{padding-left:1.25rem;padding-right:1.25rem}.mh5-l{margin-left:1.25rem;margin-right:1.25rem}.nh5-l{margin-left:-1.25rem;margin-right:-1.25rem}.pa6-l{padding:1.5rem}.ma6-l{margin:1.5rem}.na6-l{margin:-1.5rem}.pl6-l{padding-left:1.5rem}.ml6-l{margin-left:1.5rem}.nl6-l{margin-left:-1.5rem}.pr6-l{padding-right:1.5rem}.mr6-l{margin-right:1.5rem}.nr6-l{margin-right:-1.5rem}.pt6-l{padding-top:1.5rem}.mt6-l{margin-top:1.5rem}.nt6-l{margin-top:-1.5rem}.pb6-l{padding-bottom:1.5rem}.mb6-l{margin-bottom:1.5rem}.nb6-l{margin-bottom:-1.5rem}.pv6-l{padding-top:1.5rem;padding-bottom:1.5rem}.mv6-l{margin-top:1.5rem;margin-bottom:1.5rem}.nv6-l{margin-top:-1.5rem;margin-bottom:-1.5rem}.ph6-l{padding-left:1.5rem;padding-right:1.5rem}.mh6-l{margin-left:1.5rem;margin-right:1.5rem}.nh6-l{margin-left:-1.5rem;margin-right:-1.5rem}.pa7-l{padding:2rem}.ma7-l{margin:2rem}.na7-l{margin:-2rem}.pl7-l{padding-left:2rem}.ml7-l{margin-left:2rem}.nl7-l{margin-left:-2rem}.pr7-l{padding-right:2rem}.mr7-l{margin-right:2rem}.nr7-l{margin-right:-2rem}.pt7-l{padding-top:2rem}.mt7-l{margin-top:2rem}.nt7-l{margin-top:-2rem}.pb7-l{padding-bottom:2rem}.mb7-l{margin-bottom:2rem}.nb7-l{margin-bottom:-2rem}.pv7-l{padding-top:2rem;padding-bottom:2rem}.mv7-l{margin-top:2rem;margin-bottom:2rem}.nv7-l{margin-top:-2rem;margin-bottom:-2rem}.ph7-l{padding-left:2rem;padding-right:2rem}.mh7-l{margin-left:2rem;margin-right:2rem}.nh7-l{margin-left:-2rem;margin-right:-2rem}.pa8-l{padding:3rem}.ma8-l{margin:3rem}.na8-l{margin:-3rem}.pl8-l{padding-left:3rem}.ml8-l{margin-left:3rem}.nl8-l{margin-left:-3rem}.pr8-l{padding-right:3rem}.mr8-l{margin-right:3rem}.nr8-l{margin-right:-3rem}.pt8-l{padding-top:3rem}.mt8-l{margin-top:3rem}.nt8-l{margin-top:-3rem}.pb8-l{padding-bottom:3rem}.mb8-l{margin-bottom:3rem}.nb8-l{margin-bottom:-3rem}.pv8-l{padding-top:3rem;padding-bottom:3rem}.mv8-l{margin-top:3rem;margin-bottom:3rem}.nv8-l{margin-top:-3rem;margin-bottom:-3rem}.ph8-l{padding-left:3rem;padding-right:3rem}.mh8-l{margin-left:3rem;margin-right:3rem}.nh8-l{margin-left:-3rem;margin-right:-3rem}.pa9-l{padding:4rem}.ma9-l{margin:4rem}.na9-l{margin:-4rem}.pl9-l{padding-left:4rem}.ml9-l{margin-left:4rem}.nl9-l{margin-left:-4rem}.pr9-l{padding-right:4rem}.mr9-l{margin-right:4rem}.nr9-l{margin-right:-4rem}.pt9-l{padding-top:4rem}.mt9-l{margin-top:4rem}.nt9-l{margin-top:-4rem}.pb9-l{padding-bottom:4rem}.mb9-l{margin-bottom:4rem}.nb9-l{margin-bottom:-4rem}.pv9-l{padding-top:4rem;padding-bottom:4rem}.mv9-l{margin-top:4rem;margin-bottom:4rem}.nv9-l{margin-top:-4rem;margin-bottom:-4rem}.ph9-l{padding-left:4rem;padding-right:4rem}.mh9-l{margin-left:4rem;margin-right:4rem}.nh9-l{margin-left:-4rem;margin-right:-4rem}.pa10-l{padding:6rem}.ma10-l{margin:6rem}.na10-l{margin:-6rem}.pl10-l{padding-left:6rem}.ml10-l{margin-left:6rem}.nl10-l{margin-left:-6rem}.pr10-l{padding-right:6rem}.mr10-l{margin-right:6rem}.nr10-l{margin-right:-6rem}.pt10-l{padding-top:6rem}.mt10-l{margin-top:6rem}.nt10-l{margin-top:-6rem}.pb10-l{padding-bottom:6rem}.mb10-l{margin-bottom:6rem}.nb10-l{margin-bottom:-6rem}.pv10-l{padding-top:6rem;padding-bottom:6rem}.mv10-l{margin-top:6rem;margin-bottom:6rem}.nv10-l{margin-top:-6rem;margin-bottom:-6rem}.ph10-l{padding-left:6rem;padding-right:6rem}.mh10-l{margin-left:6rem;margin-right:6rem}.nh10-l{margin-left:-6rem;margin-right:-6rem}.pa11-l{padding:10rem}.ma11-l{margin:10rem}.na11-l{margin:-10rem}.pl11-l{padding-left:10rem}.ml11-l{margin-left:10rem}.nl11-l{margin-left:-10rem}.pr11-l{padding-right:10rem}.mr11-l{margin-right:10rem}.nr11-l{margin-right:-10rem}.pt11-l{padding-top:10rem}.mt11-l{margin-top:10rem}.nt11-l{margin-top:-10rem}.pb11-l{padding-bottom:10rem}.mb11-l{margin-bottom:10rem}.nb11-l{margin-bottom:-10rem}.pv11-l{padding-top:10rem;padding-bottom:10rem}.mv11-l{margin-top:10rem;margin-bottom:10rem}.nv11-l{margin-top:-10rem;margin-bottom:-10rem}.ph11-l{padding-left:10rem;padding-right:10rem}.mh11-l{margin-left:10rem;margin-right:10rem}.nh11-l{margin-left:-10rem;margin-right:-10rem}.pa12-l{padding:18rem}.ma12-l{margin:18rem}.na12-l{margin:-18rem}.pl12-l{padding-left:18rem}.ml12-l{margin-left:18rem}.nl12-l{margin-left:-18rem}.pr12-l{padding-right:18rem}.mr12-l{margin-right:18rem}.nr12-l{margin-right:-18rem}.pt12-l{padding-top:18rem}.mt12-l{margin-top:18rem}.nt12-l{margin-top:-18rem}.pb12-l{padding-bottom:18rem}.mb12-l{margin-bottom:18rem}.nb12-l{margin-bottom:-18rem}.pv12-l{padding-top:18rem;padding-bottom:18rem}.mv12-l{margin-top:18rem;margin-bottom:18rem}.nv12-l{margin-top:-18rem;margin-bottom:-18rem}.ph12-l{padding-left:18rem;padding-right:18rem}.mh12-l{margin-left:18rem;margin-right:18rem}.nh12-l{margin-left:-18rem;margin-right:-18rem}.top-0-l{top:0}.right-0-l{right:0}.bottom-0-l{bottom:0}.left-0-l{left:0}.top-1-l{top:1rem}.right-1-l{right:1rem}.bottom-1-l{bottom:1rem}.left-1-l{left:1rem}.top-2-l{top:2rem}.right-2-l{right:2rem}.bottom-2-l{bottom:2rem}.left-2-l{left:2rem}.top--1-l{top:-1rem}.right--1-l{right:-1rem}.bottom--1-l{bottom:-1rem}.left--1-l{left:-1rem}.top--2-l{top:-2rem}.right--2-l{right:-2rem}.bottom--2-l{bottom:-2rem}.left--2-l{left:-2rem}.absolute--fill-l{top:0;right:0;bottom:0;left:0}.cf-l:after,.cf-l:before{content:" ";display:table}.cf-l:after{clear:both}.cf-l{*zoom:1}.cl-l{clear:left}.cr-l{clear:right}.cb-l{clear:both}.cn-l{clear:none}.dn-l{display:none}.di-l{display:inline}.db-l{display:block}.dib-l{display:inline-block}.dit-l{display:inline-table}.dt-l{display:table}.dtc-l{display:table-cell}.dt-row-l{display:table-row}.dt-row-group-l{display:table-row-group}.dt-column-l{display:table-column}.dt-column-group-l{display:table-column-group}.dt--fixed-l{table-layout:fixed;width:100%}.flex-l{display:flex}.inline-flex-l{display:inline-flex}.flex-auto-l{flex:1 1 auto;min-width:0;min-height:0}.flex-none-l{flex:none}.flex-column-l{flex-direction:column}.flex-row-l{flex-direction:row}.flex-wrap-l{flex-wrap:wrap}.flex-nowrap-l{flex-wrap:nowrap}.flex-wrap-reverse-l{flex-wrap:wrap-reverse}.flex-column-reverse-l{flex-direction:column-reverse}.flex-row-reverse-l{flex-direction:row-reverse}.items-start-l{align-items:flex-start}.items-end-l{align-items:flex-end}.items-center-l{align-items:center}.items-baseline-l{align-items:baseline}.items-stretch-l{align-items:stretch}.self-start-l{align-self:flex-start}.self-end-l{align-self:flex-end}.self-center-l{align-self:center}.self-baseline-l{align-self:baseline}.self-stretch-l{align-self:stretch}.justify-start-l{justify-content:flex-start}.justify-end-l{justify-content:flex-end}.justify-center-l{justify-content:center}.justify-between-l{justify-content:space-between}.justify-around-l{justify-content:space-around}.content-start-l{align-content:flex-start}.content-end-l{align-content:flex-end}.content-center-l{align-content:center}.content-between-l{align-content:space-between}.content-around-l{align-content:space-around}.content-stretch-l{align-content:stretch}.order-0-l{order:0}.order-1-l{order:1}.order-2-l{order:2}.order-3-l{order:3}.order-4-l{order:4}.order-5-l{order:5}.order-6-l{order:6}.order-7-l{order:7}.order-8-l{order:8}.order-last-l{order:99999}.flex-grow-0-l{flex-grow:0}.flex-grow-1-l{flex-grow:1}.flex-shrink-0-l{flex-shrink:0}.flex-shrink-1-l{flex-shrink:1}.fl-l{float:left}.fl-l,.fr-l{_display:inline}.fr-l{float:right}.fn-l{float:none}.i-l{font-style:italic}.fs-normal-l{font-style:normal}.normal-l{font-weight:400}.b-l{font-weight:700}.fw1-l{font-weight:100}.fw2-l{font-weight:200}.fw3-l{font-weight:300}.fw4-l{font-weight:400}.fw5-l{font-weight:500}.fw6-l{font-weight:600}.fw7-l{font-weight:700}.fw8-l{font-weight:800}.fw9-l{font-weight:900}.h1-l{height:1rem}.h2-l{height:2rem}.h3-l{height:4rem}.h4-l{height:8rem}.h5-l{height:16rem}.h-25-l{height:25%}.h-50-l{height:50%}.h-75-l{height:75%}.h-100-l{height:100%}.min-h-100-l{min-height:100%}.vh-25-l{height:25vh}.vh-50-l{height:50vh}.vh-75-l{height:75vh}.vh-100-l{height:100vh}.min-vh-100-l{min-height:100vh}.h-auto-l{height:auto}.h-inherit-l{height:inherit}.tracked-l{letter-spacing:.1em}.tracked-tight-l{letter-spacing:-.05em}.tracked-mega-l{letter-spacing:.25em}.lh-solid-l{line-height:1.333333}.lh-title-l{line-height:1.5}.lh-copy-l{line-height:1.666666}.mw1-l{max-width:1rem}.mw2-l{max-width:2rem}.mw3-l{max-width:4rem}.mw4-l{max-width:8rem}.mw5-l{max-width:16rem}.mw6-l{max-width:32rem}.mw7-l{max-width:48rem}.mw8-l{max-width:64rem}.mw9-l{max-width:96rem}.mw-none-l{max-width:none}.mw-100-l{max-width:100%}.o-100-l{opacity:1}.o-90-l{opacity:.9}.o-80-l{opacity:.8}.o-70-l{opacity:.7}.o-60-l{opacity:.6}.o-50-l{opacity:.5}.o-40-l{opacity:.4}.o-30-l{opacity:.3}.o-20-l{opacity:.2}.o-10-l{opacity:.1}.o-05-l{opacity:.05}.o-025-l{opacity:.025}.o-0-l{opacity:0}.rotate-45-l{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.rotate-90-l{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.rotate-135-l{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.rotate-180-l{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rotate-225-l{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.rotate-270-l{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.rotate-315-l{-webkit-transform:rotate(315deg);transform:rotate(315deg)}.outline-l{outline:1px solid}.outline-transparent-l{outline:1px solid transparent}.outline-0-l{outline:0}.overflow-visible-l{overflow:visible}.overflow-hidden-l{overflow:hidden}.overflow-scroll-l{overflow:scroll}.overflow-auto-l{overflow:auto}.overflow-x-visible-l{overflow-x:visible}.overflow-x-hidden-l{overflow-x:hidden}.overflow-x-scroll-l{overflow-x:scroll}.overflow-x-auto-l{overflow-x:auto}.overflow-y-visible-l{overflow-y:visible}.overflow-y-hidden-l{overflow-y:hidden}.overflow-y-scroll-l{overflow-y:scroll}.overflow-y-auto-l{overflow-y:auto}.static-l{position:static}.relative-l{position:relative}.absolute-l{position:absolute}.fixed-l{position:fixed}.strike-l{text-decoration:line-through}.underline-l{text-decoration:underline}.no-underline-l{text-decoration:none}.tl-l{text-align:left}.tr-l{text-align:right}.tc-l{text-align:center}.tj-l{text-align:justify}.ttc-l{text-transform:capitalize}.ttl-l{text-transform:lowercase}.ttu-l{text-transform:uppercase}.ttn-l{text-transform:none}.f1-l{font-size:4.5rem}.f2-l{font-size:4rem}.f3-l{font-size:3rem}.f4-l{font-size:2rem}.f5-l{font-size:1.5rem}.f6-l{font-size:1.125rem}.f7-l{font-size:1rem}.f8-l{font-size:.875rem}.f9-l{font-size:.75rem}.measure-l{max-width:30em}.measure-wide-l{max-width:34em}.measure-narrow-l{max-width:20em}.small-caps-l{font-variant:small-caps}.indent-l{text-indent:1em;margin-top:0;margin-bottom:0}.truncate-l{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clip-l{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ws-normal-l{white-space:normal}.nowrap-l{white-space:nowrap}.pre-l{white-space:pre}.w1-l{width:1rem}.w2-l{width:2rem}.w3-l{width:4rem}.w4-l{width:8rem}.w5-l{width:16rem}.w-10-l{width:10%}.w-20-l{width:20%}.w-25-l{width:25%}.w-30-l{width:30%}.w-33-l{width:33%}.w-34-l{width:34%}.w-40-l{width:40%}.w-50-l{width:50%}.w-60-l{width:60%}.w-70-l{width:70%}.w-75-l{width:75%}.w-80-l{width:80%}.w-90-l{width:90%}.w-100-l{width:100%}.w-third-l{width:33.33333%}.w-two-thirds-l{width:66.66667%}.w-auto-l{width:auto}}@media screen and (min-width:60em){.aspect-ratio-xl{height:0;position:relative}.aspect-ratio--16x9-xl{padding-bottom:56.25%}.aspect-ratio--9x16-xl{padding-bottom:177.77%}.aspect-ratio--4x3-xl{padding-bottom:75%}.aspect-ratio--3x4-xl{padding-bottom:133.33%}.aspect-ratio--6x4-xl{padding-bottom:66.6%}.aspect-ratio--4x6-xl{padding-bottom:150%}.aspect-ratio--8x5-xl{padding-bottom:62.5%}.aspect-ratio--5x8-xl{padding-bottom:160%}.aspect-ratio--7x5-xl{padding-bottom:71.42%}.aspect-ratio--5x7-xl{padding-bottom:140%}.aspect-ratio--1x1-xl{padding-bottom:100%}.aspect-ratio--object-xl{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}.cover-xl{background-size:cover!important}.contain-xl{background-size:contain!important}.bg-center-xl{background-position:50%}.bg-center-xl,.bg-top-xl{background-repeat:no-repeat}.bg-top-xl{background-position:top}.bg-right-xl{background-position:100%}.bg-bottom-xl,.bg-right-xl{background-repeat:no-repeat}.bg-bottom-xl{background-position:bottom}.bg-left-xl{background-repeat:no-repeat;background-position:0}.ba-xl{border-style:solid;border-width:1px}.bt-xl{border-top-style:solid;border-top-width:1px}.br-xl{border-right-style:solid;border-right-width:1px}.bb-xl{border-bottom-style:solid;border-bottom-width:1px}.bl-xl{border-left-style:solid;border-left-width:1px}.bn-xl{border-style:none;border-width:0}.br0-xl{border-radius:0}.br1-xl{border-radius:.125rem}.br2-xl{border-radius:.25rem}.br3-xl{border-radius:.5rem}.br4-xl{border-radius:1rem}.br-100-xl{border-radius:100%}.br-pill-xl{border-radius:9999px}.br--bottom-xl{border-top-left-radius:0;border-top-right-radius:0}.br--top-xl{border-bottom-right-radius:0}.br--right-xl,.br--top-xl{border-bottom-left-radius:0}.br--right-xl{border-top-left-radius:0}.br--left-xl{border-top-right-radius:0;border-bottom-right-radius:0}.b--dotted-xl{border-style:dotted}.b--dashed-xl{border-style:dashed}.b--solid-xl{border-style:solid}.b--none-xl{border-style:none}.bw0-xl{border-width:0}.bw1-xl{border-width:.125rem}.bw2-xl{border-width:.25rem}.bw3-xl{border-width:.5rem}.bw4-xl{border-width:1rem}.bw5-xl{border-width:2rem}.bt-0-xl{border-top-width:0}.br-0-xl{border-right-width:0}.bb-0-xl{border-bottom-width:0}.bl-0-xl{border-left-width:0}.shadow-1-xl{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.shadow-2-xl{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.shadow-3-xl{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.shadow-4-xl{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.shadow-5-xl{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}.pa0-xl{padding:0}.ma0-xl,.na0-xl{margin:0}.pl0-xl{padding-left:0}.ml0-xl,.nl0-xl{margin-left:0}.pr0-xl{padding-right:0}.mr0-xl,.nr0-xl{margin-right:0}.pt0-xl{padding-top:0}.mt0-xl,.nt0-xl{margin-top:0}.pb0-xl{padding-bottom:0}.mb0-xl,.nb0-xl{margin-bottom:0}.pv0-xl{padding-top:0;padding-bottom:0}.mv0-xl,.nv0-xl{margin-top:0;margin-bottom:0}.ph0-xl{padding-left:0;padding-right:0}.mh0-xl,.nh0-xl{margin-left:0;margin-right:0}.pa1-xl{padding:.25rem}.ma1-xl{margin:.25rem}.na1-xl{margin:-.25rem}.pl1-xl{padding-left:.25rem}.ml1-xl{margin-left:.25rem}.nl1-xl{margin-left:-.25rem}.pr1-xl{padding-right:.25rem}.mr1-xl{margin-right:.25rem}.nr1-xl{margin-right:-.25rem}.pt1-xl{padding-top:.25rem}.mt1-xl{margin-top:.25rem}.nt1-xl{margin-top:-.25rem}.pb1-xl{padding-bottom:.25rem}.mb1-xl{margin-bottom:.25rem}.nb1-xl{margin-bottom:-.25rem}.pv1-xl{padding-top:.25rem;padding-bottom:.25rem}.mv1-xl{margin-top:.25rem;margin-bottom:.25rem}.nv1-xl{margin-top:-.25rem;margin-bottom:-.25rem}.ph1-xl{padding-left:.25rem;padding-right:.25rem}.mh1-xl{margin-left:.25rem;margin-right:.25rem}.nh1-xl{margin-left:-.25rem;margin-right:-.25rem}.pa2-xl{padding:.5rem}.ma2-xl{margin:.5rem}.na2-xl{margin:-.5rem}.pl2-xl{padding-left:.5rem}.ml2-xl{margin-left:.5rem}.nl2-xl{margin-left:-.5rem}.pr2-xl{padding-right:.5rem}.mr2-xl{margin-right:.5rem}.nr2-xl{margin-right:-.5rem}.pt2-xl{padding-top:.5rem}.mt2-xl{margin-top:.5rem}.nt2-xl{margin-top:-.5rem}.pb2-xl{padding-bottom:.5rem}.mb2-xl{margin-bottom:.5rem}.nb2-xl{margin-bottom:-.5rem}.pv2-xl{padding-top:.5rem;padding-bottom:.5rem}.mv2-xl{margin-top:.5rem;margin-bottom:.5rem}.nv2-xl{margin-top:-.5rem;margin-bottom:-.5rem}.ph2-xl{padding-left:.5rem;padding-right:.5rem}.mh2-xl{margin-left:.5rem;margin-right:.5rem}.nh2-xl{margin-left:-.5rem;margin-right:-.5rem}.pa3-xl{padding:.75rem}.ma3-xl{margin:.75rem}.na3-xl{margin:-.75rem}.pl3-xl{padding-left:.75rem}.ml3-xl{margin-left:.75rem}.nl3-xl{margin-left:-.75rem}.pr3-xl{padding-right:.75rem}.mr3-xl{margin-right:.75rem}.nr3-xl{margin-right:-.75rem}.pt3-xl{padding-top:.75rem}.mt3-xl{margin-top:.75rem}.nt3-xl{margin-top:-.75rem}.pb3-xl{padding-bottom:.75rem}.mb3-xl{margin-bottom:.75rem}.nb3-xl{margin-bottom:-.75rem}.pv3-xl{padding-top:.75rem;padding-bottom:.75rem}.mv3-xl{margin-top:.75rem;margin-bottom:.75rem}.nv3-xl{margin-top:-.75rem;margin-bottom:-.75rem}.ph3-xl{padding-left:.75rem;padding-right:.75rem}.mh3-xl{margin-left:.75rem;margin-right:.75rem}.nh3-xl{margin-left:-.75rem;margin-right:-.75rem}.pa4-xl{padding:1rem}.ma4-xl{margin:1rem}.na4-xl{margin:-1rem}.pl4-xl{padding-left:1rem}.ml4-xl{margin-left:1rem}.nl4-xl{margin-left:-1rem}.pr4-xl{padding-right:1rem}.mr4-xl{margin-right:1rem}.nr4-xl{margin-right:-1rem}.pt4-xl{padding-top:1rem}.mt4-xl{margin-top:1rem}.nt4-xl{margin-top:-1rem}.pb4-xl{padding-bottom:1rem}.mb4-xl{margin-bottom:1rem}.nb4-xl{margin-bottom:-1rem}.pv4-xl{padding-top:1rem;padding-bottom:1rem}.mv4-xl{margin-top:1rem;margin-bottom:1rem}.nv4-xl{margin-top:-1rem;margin-bottom:-1rem}.ph4-xl{padding-left:1rem;padding-right:1rem}.mh4-xl{margin-left:1rem;margin-right:1rem}.nh4-xl{margin-left:-1rem;margin-right:-1rem}.pa5-xl{padding:1.25rem}.ma5-xl{margin:1.25rem}.na5-xl{margin:-1.25rem}.pl5-xl{padding-left:1.25rem}.ml5-xl{margin-left:1.25rem}.nl5-xl{margin-left:-1.25rem}.pr5-xl{padding-right:1.25rem}.mr5-xl{margin-right:1.25rem}.nr5-xl{margin-right:-1.25rem}.pt5-xl{padding-top:1.25rem}.mt5-xl{margin-top:1.25rem}.nt5-xl{margin-top:-1.25rem}.pb5-xl{padding-bottom:1.25rem}.mb5-xl{margin-bottom:1.25rem}.nb5-xl{margin-bottom:-1.25rem}.pv5-xl{padding-top:1.25rem;padding-bottom:1.25rem}.mv5-xl{margin-top:1.25rem;margin-bottom:1.25rem}.nv5-xl{margin-top:-1.25rem;margin-bottom:-1.25rem}.ph5-xl{padding-left:1.25rem;padding-right:1.25rem}.mh5-xl{margin-left:1.25rem;margin-right:1.25rem}.nh5-xl{margin-left:-1.25rem;margin-right:-1.25rem}.pa6-xl{padding:1.5rem}.ma6-xl{margin:1.5rem}.na6-xl{margin:-1.5rem}.pl6-xl{padding-left:1.5rem}.ml6-xl{margin-left:1.5rem}.nl6-xl{margin-left:-1.5rem}.pr6-xl{padding-right:1.5rem}.mr6-xl{margin-right:1.5rem}.nr6-xl{margin-right:-1.5rem}.pt6-xl{padding-top:1.5rem}.mt6-xl{margin-top:1.5rem}.nt6-xl{margin-top:-1.5rem}.pb6-xl{padding-bottom:1.5rem}.mb6-xl{margin-bottom:1.5rem}.nb6-xl{margin-bottom:-1.5rem}.pv6-xl{padding-top:1.5rem;padding-bottom:1.5rem}.mv6-xl{margin-top:1.5rem;margin-bottom:1.5rem}.nv6-xl{margin-top:-1.5rem;margin-bottom:-1.5rem}.ph6-xl{padding-left:1.5rem;padding-right:1.5rem}.mh6-xl{margin-left:1.5rem;margin-right:1.5rem}.nh6-xl{margin-left:-1.5rem;margin-right:-1.5rem}.pa7-xl{padding:2rem}.ma7-xl{margin:2rem}.na7-xl{margin:-2rem}.pl7-xl{padding-left:2rem}.ml7-xl{margin-left:2rem}.nl7-xl{margin-left:-2rem}.pr7-xl{padding-right:2rem}.mr7-xl{margin-right:2rem}.nr7-xl{margin-right:-2rem}.pt7-xl{padding-top:2rem}.mt7-xl{margin-top:2rem}.nt7-xl{margin-top:-2rem}.pb7-xl{padding-bottom:2rem}.mb7-xl{margin-bottom:2rem}.nb7-xl{margin-bottom:-2rem}.pv7-xl{padding-top:2rem;padding-bottom:2rem}.mv7-xl{margin-top:2rem;margin-bottom:2rem}.nv7-xl{margin-top:-2rem;margin-bottom:-2rem}.ph7-xl{padding-left:2rem;padding-right:2rem}.mh7-xl{margin-left:2rem;margin-right:2rem}.nh7-xl{margin-left:-2rem;margin-right:-2rem}.pa8-xl{padding:3rem}.ma8-xl{margin:3rem}.na8-xl{margin:-3rem}.pl8-xl{padding-left:3rem}.ml8-xl{margin-left:3rem}.nl8-xl{margin-left:-3rem}.pr8-xl{padding-right:3rem}.mr8-xl{margin-right:3rem}.nr8-xl{margin-right:-3rem}.pt8-xl{padding-top:3rem}.mt8-xl{margin-top:3rem}.nt8-xl{margin-top:-3rem}.pb8-xl{padding-bottom:3rem}.mb8-xl{margin-bottom:3rem}.nb8-xl{margin-bottom:-3rem}.pv8-xl{padding-top:3rem;padding-bottom:3rem}.mv8-xl{margin-top:3rem;margin-bottom:3rem}.nv8-xl{margin-top:-3rem;margin-bottom:-3rem}.ph8-xl{padding-left:3rem;padding-right:3rem}.mh8-xl{margin-left:3rem;margin-right:3rem}.nh8-xl{margin-left:-3rem;margin-right:-3rem}.pa9-xl{padding:4rem}.ma9-xl{margin:4rem}.na9-xl{margin:-4rem}.pl9-xl{padding-left:4rem}.ml9-xl{margin-left:4rem}.nl9-xl{margin-left:-4rem}.pr9-xl{padding-right:4rem}.mr9-xl{margin-right:4rem}.nr9-xl{margin-right:-4rem}.pt9-xl{padding-top:4rem}.mt9-xl{margin-top:4rem}.nt9-xl{margin-top:-4rem}.pb9-xl{padding-bottom:4rem}.mb9-xl{margin-bottom:4rem}.nb9-xl{margin-bottom:-4rem}.pv9-xl{padding-top:4rem;padding-bottom:4rem}.mv9-xl{margin-top:4rem;margin-bottom:4rem}.nv9-xl{margin-top:-4rem;margin-bottom:-4rem}.ph9-xl{padding-left:4rem;padding-right:4rem}.mh9-xl{margin-left:4rem;margin-right:4rem}.nh9-xl{margin-left:-4rem;margin-right:-4rem}.pa10-xl{padding:6rem}.ma10-xl{margin:6rem}.na10-xl{margin:-6rem}.pl10-xl{padding-left:6rem}.ml10-xl{margin-left:6rem}.nl10-xl{margin-left:-6rem}.pr10-xl{padding-right:6rem}.mr10-xl{margin-right:6rem}.nr10-xl{margin-right:-6rem}.pt10-xl{padding-top:6rem}.mt10-xl{margin-top:6rem}.nt10-xl{margin-top:-6rem}.pb10-xl{padding-bottom:6rem}.mb10-xl{margin-bottom:6rem}.nb10-xl{margin-bottom:-6rem}.pv10-xl{padding-top:6rem;padding-bottom:6rem}.mv10-xl{margin-top:6rem;margin-bottom:6rem}.nv10-xl{margin-top:-6rem;margin-bottom:-6rem}.ph10-xl{padding-left:6rem;padding-right:6rem}.mh10-xl{margin-left:6rem;margin-right:6rem}.nh10-xl{margin-left:-6rem;margin-right:-6rem}.pa11-xl{padding:10rem}.ma11-xl{margin:10rem}.na11-xl{margin:-10rem}.pl11-xl{padding-left:10rem}.ml11-xl{margin-left:10rem}.nl11-xl{margin-left:-10rem}.pr11-xl{padding-right:10rem}.mr11-xl{margin-right:10rem}.nr11-xl{margin-right:-10rem}.pt11-xl{padding-top:10rem}.mt11-xl{margin-top:10rem}.nt11-xl{margin-top:-10rem}.pb11-xl{padding-bottom:10rem}.mb11-xl{margin-bottom:10rem}.nb11-xl{margin-bottom:-10rem}.pv11-xl{padding-top:10rem;padding-bottom:10rem}.mv11-xl{margin-top:10rem;margin-bottom:10rem}.nv11-xl{margin-top:-10rem;margin-bottom:-10rem}.ph11-xl{padding-left:10rem;padding-right:10rem}.mh11-xl{margin-left:10rem;margin-right:10rem}.nh11-xl{margin-left:-10rem;margin-right:-10rem}.pa12-xl{padding:18rem}.ma12-xl{margin:18rem}.na12-xl{margin:-18rem}.pl12-xl{padding-left:18rem}.ml12-xl{margin-left:18rem}.nl12-xl{margin-left:-18rem}.pr12-xl{padding-right:18rem}.mr12-xl{margin-right:18rem}.nr12-xl{margin-right:-18rem}.pt12-xl{padding-top:18rem}.mt12-xl{margin-top:18rem}.nt12-xl{margin-top:-18rem}.pb12-xl{padding-bottom:18rem}.mb12-xl{margin-bottom:18rem}.nb12-xl{margin-bottom:-18rem}.pv12-xl{padding-top:18rem;padding-bottom:18rem}.mv12-xl{margin-top:18rem;margin-bottom:18rem}.nv12-xl{margin-top:-18rem;margin-bottom:-18rem}.ph12-xl{padding-left:18rem;padding-right:18rem}.mh12-xl{margin-left:18rem;margin-right:18rem}.nh12-xl{margin-left:-18rem;margin-right:-18rem}.top-0-xl{top:0}.right-0-xl{right:0}.bottom-0-xl{bottom:0}.left-0-xl{left:0}.top-1-xl{top:1rem}.right-1-xl{right:1rem}.bottom-1-xl{bottom:1rem}.left-1-xl{left:1rem}.top-2-xl{top:2rem}.right-2-xl{right:2rem}.bottom-2-xl{bottom:2rem}.left-2-xl{left:2rem}.top--1-xl{top:-1rem}.right--1-xl{right:-1rem}.bottom--1-xl{bottom:-1rem}.left--1-xl{left:-1rem}.top--2-xl{top:-2rem}.right--2-xl{right:-2rem}.bottom--2-xl{bottom:-2rem}.left--2-xl{left:-2rem}.absolute--fill-xl{top:0;right:0;bottom:0;left:0}.cf-xl:after,.cf-xl:before{content:" ";display:table}.cf-xl:after{clear:both}.cf-xl{*zoom:1}.cl-xl{clear:left}.cr-xl{clear:right}.cb-xl{clear:both}.cn-xl{clear:none}.dn-xl{display:none}.di-xl{display:inline}.db-xl{display:block}.dib-xl{display:inline-block}.dit-xl{display:inline-table}.dt-xl{display:table}.dtc-xl{display:table-cell}.dt-row-xl{display:table-row}.dt-row-group-xl{display:table-row-group}.dt-column-xl{display:table-column}.dt-column-group-xl{display:table-column-group}.dt--fixed-xl{table-layout:fixed;width:100%}.flex-xl{display:flex}.inline-flex-xl{display:inline-flex}.flex-auto-xl{flex:1 1 auto;min-width:0;min-height:0}.flex-none-xl{flex:none}.flex-column-xl{flex-direction:column}.flex-row-xl{flex-direction:row}.flex-wrap-xl{flex-wrap:wrap}.flex-nowrap-xl{flex-wrap:nowrap}.flex-wrap-reverse-xl{flex-wrap:wrap-reverse}.flex-column-reverse-xl{flex-direction:column-reverse}.flex-row-reverse-xl{flex-direction:row-reverse}.items-start-xl{align-items:flex-start}.items-end-xl{align-items:flex-end}.items-center-xl{align-items:center}.items-baseline-xl{align-items:baseline}.items-stretch-xl{align-items:stretch}.self-start-xl{align-self:flex-start}.self-end-xl{align-self:flex-end}.self-center-xl{align-self:center}.self-baseline-xl{align-self:baseline}.self-stretch-xl{align-self:stretch}.justify-start-xl{justify-content:flex-start}.justify-end-xl{justify-content:flex-end}.justify-center-xl{justify-content:center}.justify-between-xl{justify-content:space-between}.justify-around-xl{justify-content:space-around}.content-start-xl{align-content:flex-start}.content-end-xl{align-content:flex-end}.content-center-xl{align-content:center}.content-between-xl{align-content:space-between}.content-around-xl{align-content:space-around}.content-stretch-xl{align-content:stretch}.order-0-xl{order:0}.order-1-xl{order:1}.order-2-xl{order:2}.order-3-xl{order:3}.order-4-xl{order:4}.order-5-xl{order:5}.order-6-xl{order:6}.order-7-xl{order:7}.order-8-xl{order:8}.order-last-xl{order:99999}.flex-grow-0-xl{flex-grow:0}.flex-grow-1-xl{flex-grow:1}.flex-shrink-0-xl{flex-shrink:0}.flex-shrink-1-xl{flex-shrink:1}.fl-xl{float:left}.fl-xl,.fr-xl{_display:inline}.fr-xl{float:right}.fn-xl{float:none}.i-xl{font-style:italic}.fs-normal-xl{font-style:normal}.normal-xl{font-weight:400}.b-xl{font-weight:700}.fw1-xl{font-weight:100}.fw2-xl{font-weight:200}.fw3-xl{font-weight:300}.fw4-xl{font-weight:400}.fw5-xl{font-weight:500}.fw6-xl{font-weight:600}.fw7-xl{font-weight:700}.fw8-xl{font-weight:800}.fw9-xl{font-weight:900}.h1-xl{height:1rem}.h2-xl{height:2rem}.h3-xl{height:4rem}.h4-xl{height:8rem}.h5-xl{height:16rem}.h-25-xl{height:25%}.h-50-xl{height:50%}.h-75-xl{height:75%}.h-100-xl{height:100%}.min-h-100-xl{min-height:100%}.vh-25-xl{height:25vh}.vh-50-xl{height:50vh}.vh-75-xl{height:75vh}.vh-100-xl{height:100vh}.min-vh-100-xl{min-height:100vh}.h-auto-xl{height:auto}.h-inherit-xl{height:inherit}.tracked-xl{letter-spacing:.1em}.tracked-tight-xl{letter-spacing:-.05em}.tracked-mega-xl{letter-spacing:.25em}.lh-solid-xl{line-height:1.333333}.lh-title-xl{line-height:1.5}.lh-copy-xl{line-height:1.666666}.mw1-xl{max-width:1rem}.mw2-xl{max-width:2rem}.mw3-xl{max-width:4rem}.mw4-xl{max-width:8rem}.mw5-xl{max-width:16rem}.mw6-xl{max-width:32rem}.mw7-xl{max-width:48rem}.mw8-xl{max-width:64rem}.mw9-xl{max-width:96rem}.mw-none-xl{max-width:none}.mw-100-xl{max-width:100%}.o-100-xl{opacity:1}.o-90-xl{opacity:.9}.o-80-xl{opacity:.8}.o-70-xl{opacity:.7}.o-60-xl{opacity:.6}.o-50-xl{opacity:.5}.o-40-xl{opacity:.4}.o-30-xl{opacity:.3}.o-20-xl{opacity:.2}.o-10-xl{opacity:.1}.o-05-xl{opacity:.05}.o-025-xl{opacity:.025}.o-0-xl{opacity:0}.rotate-45-xl{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.rotate-90-xl{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.rotate-135-xl{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.rotate-180-xl{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rotate-225-xl{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.rotate-270-xl{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.rotate-315-xl{-webkit-transform:rotate(315deg);transform:rotate(315deg)}.outline-xl{outline:1px solid}.outline-transparent-xl{outline:1px solid transparent}.outline-0-xl{outline:0}.overflow-visible-xl{overflow:visible}.overflow-hidden-xl{overflow:hidden}.overflow-scroll-xl{overflow:scroll}.overflow-auto-xl{overflow:auto}.overflow-x-visible-xl{overflow-x:visible}.overflow-x-hidden-xl{overflow-x:hidden}.overflow-x-scroll-xl{overflow-x:scroll}.overflow-x-auto-xl{overflow-x:auto}.overflow-y-visible-xl{overflow-y:visible}.overflow-y-hidden-xl{overflow-y:hidden}.overflow-y-scroll-xl{overflow-y:scroll}.overflow-y-auto-xl{overflow-y:auto}.static-xl{position:static}.relative-xl{position:relative}.absolute-xl{position:absolute}.fixed-xl{position:fixed}.strike-xl{text-decoration:line-through}.underline-xl{text-decoration:underline}.no-underline-xl{text-decoration:none}.tl-xl{text-align:left}.tr-xl{text-align:right}.tc-xl{text-align:center}.tj-xl{text-align:justify}.ttc-xl{text-transform:capitalize}.ttl-xl{text-transform:lowercase}.ttu-xl{text-transform:uppercase}.ttn-xl{text-transform:none}.f1-xl{font-size:4.5rem}.f2-xl{font-size:4rem}.f3-xl{font-size:3rem}.f4-xl{font-size:2rem}.f5-xl{font-size:1.5rem}.f6-xl{font-size:1.125rem}.f7-xl{font-size:1rem}.f8-xl{font-size:.875rem}.f9-xl{font-size:.75rem}.measure-xl{max-width:30em}.measure-wide-xl{max-width:34em}.measure-narrow-xl{max-width:20em}.small-caps-xl{font-variant:small-caps}.indent-xl{text-indent:1em;margin-top:0;margin-bottom:0}.truncate-xl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clip-xl{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ws-normal-xl{white-space:normal}.nowrap-xl{white-space:nowrap}.pre-xl{white-space:pre}.w1-xl{width:1rem}.w2-xl{width:2rem}.w3-xl{width:4rem}.w4-xl{width:8rem}.w5-xl{width:16rem}.w-10-xl{width:10%}.w-20-xl{width:20%}.w-25-xl{width:25%}.w-30-xl{width:30%}.w-33-xl{width:33%}.w-34-xl{width:34%}.w-40-xl{width:40%}.w-50-xl{width:50%}.w-60-xl{width:60%}.w-70-xl{width:70%}.w-75-xl{width:75%}.w-80-xl{width:80%}.w-90-xl{width:90%}.w-100-xl{width:100%}.w-third-xl{width:33.33333%}.w-two-thirds-xl{width:66.66667%}.w-auto-xl{width:auto}}@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(https://media.urbit.org/fonts/Inter-Regular.woff2) format("woff2")}@font-face{font-family:Inter;font-style:italic;font-weight:400;src:url(https://media.urbit.org/fonts/Inter-Italic.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:700;src:url(https://media.urbit.org/fonts/Inter-Bold.woff2) format("woff2")}@font-face{font-family:Inter;font-style:italic;font-weight:700;src:url(https://media.urbit.org/fonts/Inter-BoldItalic.woff2) format("woff2")}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-extralight.woff);font-weight:200}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-light.woff);font-weight:300}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-regular.woff);font-weight:400}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-medium.woff);font-weight:500}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-semibold.woff);font-weight:600}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-bold.woff);font-weight:700}a,button,h1,h2,h3,h4,h5,h6,input,p,textarea{margin-block-end:unset;margin-block-start:unset;-webkit-margin-before:unset;-webkit-margin-after:unset;font-family:Inter,sans-serif}a{color:#000;text-decoration:none}button,input,select,textarea{outline:none;-webkit-appearance:none;border:none;background-color:#fff}.body-regular{font-size:16px;line-height:24px;font-weight:600}.body-large{font-size:20px;line-height:24px}.label-regular{font-size:14px;line-height:24px}.label-small-mono{font-size:12px;line-height:24px;font-family:Source Code Pro,monospace}.body-regular-400{font-size:16px;line-height:24px;font-weight:400}.plus-font{font-size:48px;line-height:24px}.btn-font{font-size:14px;line-height:16px;font-weight:600}.mono{font-family:Source Code Pro,monospace}.inter{font-family:Inter,sans-serif}.mix-blend-diff{mix-blend-mode:difference}@media (prefers-color-scheme:dark){body{background-color:#333}.bg-black-d{background-color:#000}.white-d{color:#fff}.gray1-d{color:#4d4d4d}.gray2-d{color:#7f7f7f}.gray3-d{color:#b1b2b3}.gray4-d{color:#e6e6e6}.bg-gray0-d{background-color:#333}.bg-gray1-d{background-color:#4d4d4d}.b--gray0-d{border-color:#333}.b--gray1-d{border-color:#4d4d4d}.b--gray2-d{border-color:#7f7f7f}.b--white-d{border-color:#fff}.bb-d{border-bottom-width:1px;border-bottom-style:solid}.invert-d{filter:invert(1)}.o-80-d{opacity:.8}.focus-b--white-d:focus{border-color:#fff}a{color:#fff}.hover-bg-gray1-d:hover{color:#4d4d4d}}@media (max-width:34.375em){.h-100-minus-40-s{height:calc(100% - 40px)}}@media (min-width:34.375em) and (max-width:46.875em){.h-100-minus-40-m{height:calc(100% - 40px)}}@media (min-width:46.875em) and (max-width:60em){.h-100-minus-40-l{height:calc(100% - 40px)}}@media (min-width:60em){.h-100-minus-40-xl{height:calc(100% - 40px)}} \ No newline at end of file diff --git a/full/urbit/app/smol/img/Home.png b/urbit/app/barttile/img/Home.png similarity index 100% rename from full/urbit/app/smol/img/Home.png rename to urbit/app/barttile/img/Home.png diff --git a/full/urbit/app/smol/img/Tile.png b/urbit/app/barttile/img/Tile.png similarity index 100% rename from full/urbit/app/smol/img/Tile.png rename to urbit/app/barttile/img/Tile.png diff --git a/full/urbit/app/smol/index.html b/urbit/app/barttile/index.html similarity index 68% rename from full/urbit/app/smol/index.html rename to urbit/app/barttile/index.html index ce9e6c9..6830191 100644 --- a/full/urbit/app/smol/index.html +++ b/urbit/app/barttile/index.html @@ -1,16 +1,16 @@ - %APPNAME% + barttile - +
- + diff --git a/urbit/app/barttile/js/index.js b/urbit/app/barttile/js/index.js new file mode 100644 index 0000000..b9fa889 --- /dev/null +++ b/urbit/app/barttile/js/index.js @@ -0,0 +1,57320 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('buffer')) : + typeof define === 'function' && define.amd ? define('index', ['buffer'], factory) : + (global = global || self, factory(global.buffer)); +}(this, function (buffer) { 'use strict'; + + buffer = buffer && buffer.hasOwnProperty('default') ? buffer['default'] : buffer; + + var global$1 = (typeof global !== "undefined" ? global : + typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : {}); + + if (typeof global$1.setTimeout === 'function') ; + if (typeof global$1.clearTimeout === 'function') ; + + // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js + var performance$1 = global$1.performance || {}; + var performanceNow = + performance$1.now || + performance$1.mozNow || + performance$1.msNow || + performance$1.oNow || + performance$1.webkitNow || + function(){ return (new Date()).getTime() }; + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } + } + + var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; + + function ca(a,b,d,c,e,g,h,f){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[d,c,e,g,h,f],m=0;a=Error(b.replace(/%s/g,function(){return l[m++]}));a.name="Invariant Violation";}a.framesToPop=1;throw a;}} + function B(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!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(undefined, [format].concat(args)); + } + }; + } + + var lowPriorityWarning$1 = lowPriorityWarning; + + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var warningWithoutStack = function () {}; + + { + warningWithoutStack = function (condition, format) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + if (format === undefined) { + throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (args.length > 8) { + // Check before the condition to catch violations early. + throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); + } + if (condition) { + return; + } + if (typeof console !== 'undefined') { + var argsWithFormat = args.map(function (item) { + return '' + item; + }); + argsWithFormat.unshift('Warning: ' + format); + + // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + Function.prototype.apply.call(console.error, console, argsWithFormat); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} + }; + } + + var warningWithoutStack$1 = warningWithoutStack; + + var didWarnStateUpdateForUnmountedComponent = {}; + + function warnNoop(publicInstance, callerName) { + { + var _constructor = publicInstance.constructor; + var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; + var warningKey = componentName + '.' + callerName; + if (didWarnStateUpdateForUnmountedComponent[warningKey]) { + return; + } + warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); + didWarnStateUpdateForUnmountedComponent[warningKey] = true; + } + } + + /** + * This is the abstract API for an update queue. + */ + var ReactNoopUpdateQueue = { + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + return false; + }, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueForceUpdate: function (publicInstance, callback, callerName) { + warnNoop(publicInstance, 'forceUpdate'); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { + warnNoop(publicInstance, 'replaceState'); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @param {?function} callback Called after component is updated. + * @param {?string} Name of the calling function in the public API. + * @internal + */ + enqueueSetState: function (publicInstance, partialState, callback, callerName) { + warnNoop(publicInstance, 'setState'); + } + }; + + var emptyObject = {}; + { + Object.freeze(emptyObject); + } + + /** + * Base class helpers for the updating state of a component. + */ + function Component(props, context, updater) { + this.props = props; + this.context = context; + // If a component has string refs, we will assign a different object later. + this.refs = emptyObject; + // We initialize the default updater but the real one gets injected by the + // renderer. + this.updater = updater || ReactNoopUpdateQueue; + } + + Component.prototype.isReactComponent = {}; + + /** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ + Component.prototype.setState = function (partialState, callback) { + !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0; + this.updater.enqueueSetState(this, partialState, callback, 'setState'); + }; + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ + Component.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); + }; + + /** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */ + { + var deprecatedAPIs = { + isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], + replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] + }; + var defineDeprecationWarning = function (methodName, info) { + Object.defineProperty(Component.prototype, methodName, { + get: function () { + lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + return undefined; + } + }); + }; + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } + } + + function ComponentDummy() {} + ComponentDummy.prototype = Component.prototype; + + /** + * Convenience component with default shallow equality check for sCU. + */ + function PureComponent(props, context, updater) { + this.props = props; + this.context = context; + // If a component has string refs, we will assign a different object later. + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + } + + var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); + pureComponentPrototype.constructor = PureComponent; + // Avoid an extra prototype jump for these methods. + _assign(pureComponentPrototype, Component.prototype); + pureComponentPrototype.isPureReactComponent = true; + + // an immutable object with a single mutable value + function createRef() { + var refObject = { + current: null + }; + { + Object.seal(refObject); + } + return refObject; + } + + /** + * Keeps track of the current dispatcher. + */ + var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + + /** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ + var ReactCurrentOwner = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; + + var describeComponentFrame = function (name, source, ownerName) { + var sourceInfo = ''; + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + if (match) { + var pathBeforeSlash = match[1]; + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + return '\n in ' + (name || 'Unknown') + sourceInfo; + }; + + var Resolved = 1; + + + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName); + } + + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + { + if (typeof type.tag === 'number') { + warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + if (typeof type === 'string') { + return type; + } + switch (type) { + case REACT_CONCURRENT_MODE_TYPE: + return 'ConcurrentMode'; + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + case REACT_PORTAL_TYPE: + return 'Portal'; + case REACT_PROFILER_TYPE: + return 'Profiler'; + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + } + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + case REACT_MEMO_TYPE: + return getComponentName(type.type); + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + } + } + } + return null; + } + + var ReactDebugCurrentFrame = {}; + + var currentlyValidatingElement = null; + + function setCurrentlyValidatingElement(element) { + { + currentlyValidatingElement = element; + } + } + + { + // Stack implementation injected by the current renderer. + ReactDebugCurrentFrame.getCurrentStack = null; + + ReactDebugCurrentFrame.getStackAddendum = function () { + var stack = ''; + + // Add an extra top frame while an element is being validated + if (currentlyValidatingElement) { + var name = getComponentName(currentlyValidatingElement.type); + var owner = currentlyValidatingElement._owner; + stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); + } + + // Delegate to the injected renderer-specific implementation + var impl = ReactDebugCurrentFrame.getCurrentStack; + if (impl) { + stack += impl() || ''; + } + + return stack; + }; + } + + var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentOwner: ReactCurrentOwner, + // Used by renderers to avoid bundling object-assign twice in UMD bundles: + assign: _assign + }; + + { + _assign(ReactSharedInternals, { + // These should not be included in production. + ReactDebugCurrentFrame: ReactDebugCurrentFrame, + // Shim for React DOM 16.0.0 which still destructured (but not used) this. + // TODO: remove in React 17.0. + ReactComponentTreeHook: {} + }); + } + + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var warning = warningWithoutStack$1; + + { + warning = function (condition, format) { + if (condition) { + return; + } + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + // eslint-disable-next-line react-internal/warning-and-invariant-args + + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack])); + }; + } + + var warning$1 = warning; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + + var specialPropKeyWarningShown = void 0; + var specialPropRefWarningShown = void 0; + + function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.ref !== undefined; + } + + function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.key !== undefined; + } + + function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); + } + }; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } + + function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); + } + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } + + /** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, no instanceof check + * will work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} key + * @param {string|object} ref + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @param {*} owner + * @param {*} props + * @internal + */ + var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; + + // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); + // self and source are DEV only properties. + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); + // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; + }; + + /** + * Create and return a new ReactElement of the given type. + * See https://reactjs.org/docs/react-api.html#createelement + */ + function createElement(type, config, children) { + var propName = void 0; + + // Reserved names are extracted + var props = {}; + + var key = null; + var ref = null; + var self = null; + var source = null; + + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + } + if (hasValidKey(config)) { + key = '' + config.key; + } + + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; + // Remaining properties are added to a new props object + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } + + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + { + if (Object.freeze) { + Object.freeze(childArray); + } + } + props.children = childArray; + } + + // Resolve default props + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + { + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } + + /** + * Return a function that produces ReactElements of a given type. + * See https://reactjs.org/docs/react-api.html#createfactory + */ + + + function cloneAndReplaceKey(oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + + return newElement; + } + + /** + * Clone and return a new ReactElement using element as the starting point. + * See https://reactjs.org/docs/react-api.html#cloneelement + */ + function cloneElement(element, config, children) { + !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0; + + var propName = void 0; + + // Original props are copied + var props = _assign({}, element.props); + + // Reserved names are extracted + var key = element.key; + var ref = element.ref; + // Self is preserved since the owner is preserved. + var self = element._self; + // Source is preserved since cloneElement is unlikely to be targeted by a + // transpiler, and the original source is probably a better indicator of the + // true owner. + var source = element._source; + + // Owner will be preserved, unless ref is overridden + var owner = element._owner; + + if (config != null) { + if (hasValidRef(config)) { + // Silently steal the ref from the parent. + ref = config.ref; + owner = ReactCurrentOwner.current; + } + if (hasValidKey(config)) { + key = '' + config.key; + } + + // Remaining properties override existing props + var defaultProps = void 0; + if (element.type && element.type.defaultProps) { + defaultProps = element.type.defaultProps; + } + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + if (config[propName] === undefined && defaultProps !== undefined) { + // Resolve default props + props[propName] = defaultProps[propName]; + } else { + props[propName] = config[propName]; + } + } + } + } + + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + + return ReactElement(element.type, key, ref, self, source, owner, props); + } + + /** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + function isValidElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + + var SEPARATOR = '.'; + var SUBSEPARATOR = ':'; + + /** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = ('' + key).replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + + return '$' + escapedString; + } + + /** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + + var didWarnAboutMaps = false; + + var userProvidedKeyEscapeRegex = /\/+/g; + function escapeUserProvidedKey(text) { + return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); + } + + var POOL_SIZE = 10; + var traverseContextPool = []; + function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) { + if (traverseContextPool.length) { + var traverseContext = traverseContextPool.pop(); + traverseContext.result = mapResult; + traverseContext.keyPrefix = keyPrefix; + traverseContext.func = mapFunction; + traverseContext.context = mapContext; + traverseContext.count = 0; + return traverseContext; + } else { + return { + result: mapResult, + keyPrefix: keyPrefix, + func: mapFunction, + context: mapContext, + count: 0 + }; + } + } + + function releaseTraverseContext(traverseContext) { + traverseContext.result = null; + traverseContext.keyPrefix = null; + traverseContext.func = null; + traverseContext.context = null; + traverseContext.count = 0; + if (traverseContextPool.length < POOL_SIZE) { + traverseContextPool.push(traverseContext); + } + } + + /** + * @param {?*} children Children tree container. + * @param {!string} nameSoFar Name of the key path so far. + * @param {!function} callback Callback to invoke with each child found. + * @param {?*} traverseContext Used to pass information throughout the traversal + * process. + * @return {!number} The number of children in this subtree. + */ + function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + + var invokeCallback = false; + + if (children === null) { + invokeCallback = true; + } else { + switch (type) { + case 'string': + case 'number': + invokeCallback = true; + break; + case 'object': + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = true; + } + } + } + + if (invokeCallback) { + callback(traverseContext, children, + // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows. + nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); + return 1; + } + + var child = void 0; + var nextName = void 0; + var subtreeCount = 0; // Count of children found in the current subtree. + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getComponentKey(child, i); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + var iteratorFn = getIteratorFn(children); + if (typeof iteratorFn === 'function') { + { + // Warn about using Maps as children + if (iteratorFn === children.entries) { + !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0; + didWarnAboutMaps = true; + } + } + + var iterator = iteratorFn.call(children); + var step = void 0; + var ii = 0; + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getComponentKey(child, ii++); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else if (type === 'object') { + var addendum = ''; + { + addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum(); + } + var childrenString = '' + children; + invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum); + } + } + + return subtreeCount; + } + + /** + * Traverses children that are typically specified as `props.children`, but + * might also be specified through attributes: + * + * - `traverseAllChildren(this.props.children, ...)` + * - `traverseAllChildren(this.props.leftPanelChildren, ...)` + * + * The `traverseContext` is an optional argument that is passed through the + * entire traversal. It can be used to store accumulations or anything else that + * the callback might find relevant. + * + * @param {?*} children Children tree object. + * @param {!function} callback To invoke upon traversing each child. + * @param {?*} traverseContext Context for traversal. + * @return {!number} The number of children in this subtree. + */ + function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', callback, traverseContext); + } + + /** + * Generate a key string that identifies a component within a set. + * + * @param {*} component A component that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ + function getComponentKey(component, index) { + // Do some typechecking here since we call this blindly. We want to ensure + // that we don't block potential future ES APIs. + if (typeof component === 'object' && component !== null && component.key != null) { + // Explicit key + return escape(component.key); + } + // Implicit key determined by the index in the set + return index.toString(36); + } + + function forEachSingleChild(bookKeeping, child, name) { + var func = bookKeeping.func, + context = bookKeeping.context; + + func.call(context, child, bookKeeping.count++); + } + + /** + * Iterates through children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenforeach + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ + function forEachChildren(children, forEachFunc, forEachContext) { + if (children == null) { + return children; + } + var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext); + traverseAllChildren(children, forEachSingleChild, traverseContext); + releaseTraverseContext(traverseContext); + } + + function mapSingleChildIntoContext(bookKeeping, child, childKey) { + var result = bookKeeping.result, + keyPrefix = bookKeeping.keyPrefix, + func = bookKeeping.func, + context = bookKeeping.context; + + + var mappedChild = func.call(context, child, bookKeeping.count++); + if (Array.isArray(mappedChild)) { + mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) { + return c; + }); + } else if (mappedChild != null) { + if (isValidElement(mappedChild)) { + mappedChild = cloneAndReplaceKey(mappedChild, + // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); + } + result.push(mappedChild); + } + } + + function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { + var escapedPrefix = ''; + if (prefix != null) { + escapedPrefix = escapeUserProvidedKey(prefix) + '/'; + } + var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context); + traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); + releaseTraverseContext(traverseContext); + } + + /** + * Maps children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenmap + * + * The provided mapFunction(child, key, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ + function mapChildren(children, func, context) { + if (children == null) { + return children; + } + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, func, context); + return result; + } + + /** + * Count the number of children that are typically specified as + * `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrencount + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ + function countChildren(children) { + return traverseAllChildren(children, function () { + return null; + }, null); + } + + /** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + * + * See https://reactjs.org/docs/react-api.html#reactchildrentoarray + */ + function toArray(children) { + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, function (child) { + return child; + }); + return result; + } + + /** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenonly + * + * The current implementation of this function assumes that a single child gets + * passed without a wrapper, but the purpose of this helper function is to + * abstract away the particular structure of children. + * + * @param {?object} children Child collection structure. + * @return {ReactElement} The first and only `ReactElement` contained in the + * structure. + */ + function onlyChild(children) { + !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0; + return children; + } + + function createContext(defaultValue, calculateChangedBits) { + if (calculateChangedBits === undefined) { + calculateChangedBits = null; + } else { + { + !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0; + } + } + + var context = { + $$typeof: REACT_CONTEXT_TYPE, + _calculateChangedBits: calculateChangedBits, + // As a workaround to support multiple concurrent renderers, we categorize + // some renderers as primary and others as secondary. We only expect + // there to be two concurrent renderers at most: React Native (primary) and + // Fabric (secondary); React DOM (primary) and React ART (secondary). + // Secondary renderers store their context values on separate fields. + _currentValue: defaultValue, + _currentValue2: defaultValue, + // Used to track how many concurrent renderers this context currently + // supports within in a single renderer. Such as parallel server rendering. + _threadCount: 0, + // These are circular + Provider: null, + Consumer: null + }; + + context.Provider = { + $$typeof: REACT_PROVIDER_TYPE, + _context: context + }; + + var hasWarnedAboutUsingNestedContextConsumers = false; + var hasWarnedAboutUsingConsumerProvider = false; + + { + // A separate object, but proxies back to the original context object for + // backwards compatibility. It has a different $$typeof, so we can properly + // warn for the incorrect usage of Context as a Consumer. + var Consumer = { + $$typeof: REACT_CONTEXT_TYPE, + _context: context, + _calculateChangedBits: context._calculateChangedBits + }; + // $FlowFixMe: Flow complains about not setting a value, which is intentional here + Object.defineProperties(Consumer, { + Provider: { + get: function () { + if (!hasWarnedAboutUsingConsumerProvider) { + hasWarnedAboutUsingConsumerProvider = true; + warning$1(false, 'Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + return context.Provider; + }, + set: function (_Provider) { + context.Provider = _Provider; + } + }, + _currentValue: { + get: function () { + return context._currentValue; + }, + set: function (_currentValue) { + context._currentValue = _currentValue; + } + }, + _currentValue2: { + get: function () { + return context._currentValue2; + }, + set: function (_currentValue2) { + context._currentValue2 = _currentValue2; + } + }, + _threadCount: { + get: function () { + return context._threadCount; + }, + set: function (_threadCount) { + context._threadCount = _threadCount; + } + }, + Consumer: { + get: function () { + if (!hasWarnedAboutUsingNestedContextConsumers) { + hasWarnedAboutUsingNestedContextConsumers = true; + warning$1(false, 'Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + return context.Consumer; + } + } + }); + // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty + context.Consumer = Consumer; + } + + { + context._currentRenderer = null; + context._currentRenderer2 = null; + } + + return context; + } + + function lazy(ctor) { + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _ctor: ctor, + // React uses these fields to store the result. + _status: -1, + _result: null + }; + + { + // In production, this would just set it on the object. + var defaultProps = void 0; + var propTypes = void 0; + Object.defineProperties(lazyType, { + defaultProps: { + configurable: true, + get: function () { + return defaultProps; + }, + set: function (newDefaultProps) { + warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + defaultProps = newDefaultProps; + // Match production behavior more closely: + Object.defineProperty(lazyType, 'defaultProps', { + enumerable: true + }); + } + }, + propTypes: { + configurable: true, + get: function () { + return propTypes; + }, + set: function (newPropTypes) { + warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + propTypes = newPropTypes; + // Match production behavior more closely: + Object.defineProperty(lazyType, 'propTypes', { + enumerable: true + }); + } + } + }); + } + + return lazyType; + } + + function forwardRef(render) { + { + if (render != null && render.$$typeof === REACT_MEMO_TYPE) { + warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); + } else if (typeof render !== 'function') { + warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); + } else { + !( + // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object + render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0; + } + + if (render != null) { + !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0; + } + } + + return { + $$typeof: REACT_FORWARD_REF_TYPE, + render: render + }; + } + + function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); + } + + function memo(type, compare) { + { + if (!isValidElementType(type)) { + warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); + } + } + return { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: compare === undefined ? null : compare + }; + } + + function resolveDispatcher() { + var dispatcher = ReactCurrentDispatcher.current; + !(dispatcher !== null) ? invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.') : void 0; + return dispatcher; + } + + function useContext(Context, unstable_observedBits) { + var dispatcher = resolveDispatcher(); + { + !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0; + + // TODO: add a more generic warning for invalid values. + if (Context._context !== undefined) { + var realContext = Context._context; + // Don't deduplicate because this legitimately causes bugs + // and nobody should be using this in existing code. + if (realContext.Consumer === Context) { + warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); + } else if (realContext.Provider === Context) { + warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); + } + } + } + return dispatcher.useContext(Context, unstable_observedBits); + } + + function useState(initialState) { + var dispatcher = resolveDispatcher(); + return dispatcher.useState(initialState); + } + + function useReducer(reducer, initialArg, init) { + var dispatcher = resolveDispatcher(); + return dispatcher.useReducer(reducer, initialArg, init); + } + + function useRef(initialValue) { + var dispatcher = resolveDispatcher(); + return dispatcher.useRef(initialValue); + } + + function useEffect(create, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useEffect(create, inputs); + } + + function useLayoutEffect(create, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useLayoutEffect(create, inputs); + } + + function useCallback(callback, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useCallback(callback, inputs); + } + + function useMemo(create, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useMemo(create, inputs); + } + + function useImperativeHandle(ref, create, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useImperativeHandle(ref, create, inputs); + } + + function useDebugValue(value, formatterFn) { + { + var dispatcher = resolveDispatcher(); + return dispatcher.useDebugValue(value, formatterFn); + } + } + + /** + * ReactElementValidator provides a wrapper around a element factory + * which validates the props passed to the element. This is intended to be + * used only in DEV and could be replaced by a static type checker for languages + * that support it. + */ + + var propTypesMisspellWarningShown = void 0; + + { + propTypesMisspellWarningShown = false; + } + + function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = getComponentName(ReactCurrentOwner.current.type); + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + return ''; + } + + function getSourceInfoErrorAddendum(elementProps) { + if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) { + var source = elementProps.__source; + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + return ''; + } + + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + var ownerHasKeyUseWarning = {}; + + function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = '\n\nCheck the top-level render call using <' + parentName + '>.'; + } + } + return info; + } + + /** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; + + // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + var childOwner = ''; + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + // Give the component that originally created this child. + childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.'; + } + + setCurrentlyValidatingElement(element); + { + warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner); + } + setCurrentlyValidatingElement(null); + } + + /** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step = void 0; + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } + + /** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + function validatePropTypes(element) { + var type = element.type; + if (type === null || type === undefined || typeof type === 'string') { + return; + } + var name = getComponentName(type); + var propTypes = void 0; + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || + // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + if (propTypes) { + setCurrentlyValidatingElement(element); + checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum); + setCurrentlyValidatingElement(null); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; + warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); + } + if (typeof type.getDefaultProps === 'function') { + !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; + } + } + + /** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + function validateFragmentProps(fragment) { + setCurrentlyValidatingElement(fragment); + + var keys = Object.keys(fragment.props); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key !== 'children' && key !== 'key') { + warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + break; + } + } + + if (fragment.ref !== null) { + warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.'); + } + + setCurrentlyValidatingElement(null); + } + + function createElementWithValidation(type, props, children) { + var validType = isValidElementType(type); + + // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + if (!validType) { + var info = ''; + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(props); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString = void 0; + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />'; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = createElement.apply(this, arguments); + + // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + if (element == null) { + return element; + } + + // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + + if (type === REACT_FRAGMENT_TYPE) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } + + function createFactoryWithValidation(type) { + var validatedFactory = createElementWithValidation.bind(null, type); + validatedFactory.type = type; + // Legacy hook: remove it + { + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function () { + lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + + return validatedFactory; + } + + function cloneElementWithValidation(element, props, children) { + var newElement = cloneElement.apply(this, arguments); + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + validatePropTypes(newElement); + return newElement; + } + + var React = { + Children: { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray: toArray, + only: onlyChild + }, + + createRef: createRef, + Component: Component, + PureComponent: PureComponent, + + createContext: createContext, + forwardRef: forwardRef, + lazy: lazy, + memo: memo, + + useCallback: useCallback, + useContext: useContext, + useEffect: useEffect, + useImperativeHandle: useImperativeHandle, + useDebugValue: useDebugValue, + useLayoutEffect: useLayoutEffect, + useMemo: useMemo, + useReducer: useReducer, + useRef: useRef, + useState: useState, + + Fragment: REACT_FRAGMENT_TYPE, + StrictMode: REACT_STRICT_MODE_TYPE, + Suspense: REACT_SUSPENSE_TYPE, + + createElement: createElementWithValidation, + cloneElement: cloneElementWithValidation, + createFactory: createFactoryWithValidation, + isValidElement: isValidElement, + + version: ReactVersion, + + unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE, + unstable_Profiler: REACT_PROFILER_TYPE, + + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals + }; + + + + var React$2 = Object.freeze({ + default: React + }); + + var React$3 = ( React$2 && React ) || React$2; + + // TODO: decide on the top-level export form. + // This is hacky but makes it work with both Rollup and Jest. + var react = React$3.default || React$3; + + module.exports = react; + })(); + } + }); + + var react = createCommonjsModule(function (module) { + + { + module.exports = react_development; + } + }); + var react_1 = react.Component; + + var scheduler_production_min = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports,"__esModule",{value:!0});var d=null,e=!1,g=3,k=-1,l=-1,m=!1,n=!1;function p(){if(!m){var a=d.expirationTime;n?q():n=!0;r(t,a);}} + function u(){var a=d,b=d.next;if(d===b)d=null;else{var c=d.previous;d=c.next=b;b.previous=c;}a.next=a.previous=null;c=a.callback;b=a.expirationTime;a=a.priorityLevel;var f=g,Q=l;g=a;l=b;try{var h=c();}finally{g=f,l=Q;}if("function"===typeof h)if(h={callback:h,priorityLevel:a,expirationTime:b,next:null,previous:null},null===d)d=h.next=h.previous=h;else{c=null;a=d;do{if(a.expirationTime>=b){c=a;break}a=a.next;}while(a!==d);null===c?c=d:c===d&&(d=h,p());b=c.previous;b.next=c.previous=h;h.next=c;h.previous= + b;}}function v(){if(-1===k&&null!==d&&1===d.priorityLevel){m=!0;try{do u();while(null!==d&&1===d.priorityLevel)}finally{m=!1,null!==d?p():n=!1;}}}function t(a){m=!0;var b=e;e=a;try{if(a)for(;null!==d;){var c=exports.unstable_now();if(d.expirationTime<=c){do u();while(null!==d&&d.expirationTime<=c)}else break}else if(null!==d){do u();while(null!==d&&!w())}}finally{m=!1,e=b,null!==d?p():n=!1,v();}} + var x=Date,y="function"===typeof setTimeout?setTimeout:void 0,z="function"===typeof clearTimeout?clearTimeout:void 0,A="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,B="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0,C,D;function E(a){C=A(function(b){z(D);a(b);});D=y(function(){B(C);a(exports.unstable_now());},100);} + if("object"===typeof performance&&"function"===typeof performance.now){var F=performance;exports.unstable_now=function(){return F.now()};}else exports.unstable_now=function(){return x.now()};var r,q,w,G=null;"undefined"!==typeof window?G=window:"undefined"!==typeof commonjsGlobal&&(G=commonjsGlobal); + if(G&&G._schedMock){var H=G._schedMock;r=H[0];q=H[1];w=H[2];exports.unstable_now=H[3];}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var I=null,J=function(a){if(null!==I)try{I(a);}finally{I=null;}};r=function(a){null!==I?setTimeout(r,0,a):(I=a,setTimeout(J,0,!1));};q=function(){I=null;};w=function(){return !1};}else{"undefined"!==typeof console&&("function"!==typeof A&&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 K=null,L=!1,M=-1,N=!1,O=!1,P=0,R=33,S=33;w=function(){return P<=exports.unstable_now()};var T=new MessageChannel,U=T.port2;T.port1.onmessage=function(){L=!1;var a=K,b=M;K=null;M=-1;var c=exports.unstable_now(),f=!1;if(0>=P-c)if(-1!==b&&b<=c)f=!0;else{N||(N=!0,E(V));K=a;M=b;return}if(null!==a){O=!0;try{a(f);}finally{O=!1;}}}; + var V=function(a){if(null!==K){E(V);var b=a-P+S;bb&&(b=8),S=bb?U.postMessage(void 0):N||(N=!0,E(V));};q=function(){K=null;L=!1;M=-1;};}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=g,f=k;g=a;k=exports.unstable_now();try{return b()}finally{g=c,k=f,v();}};exports.unstable_next=function(a){switch(g){case 1:case 2:case 3:var b=3;break;default:b=g;}var c=g,f=k;g=b;k=exports.unstable_now();try{return a()}finally{g=c,k=f,v();}}; + exports.unstable_scheduleCallback=function(a,b){var c=-1!==k?k:exports.unstable_now();if("object"===typeof b&&null!==b&&"number"===typeof b.timeout)b=c+b.timeout;else switch(g){case 1:b=c+-1;break;case 2:b=c+250;break;case 5:b=c+1073741823;break;case 4:b=c+1E4;break;default:b=c+5E3;}a={callback:a,priorityLevel:g,expirationTime:b,next:null,previous:null};if(null===d)d=a.next=a.previous=a,p();else{c=null;var f=d;do{if(f.expirationTime>b){c=f;break}f=f.next;}while(f!==d);null===c?c=d:c===d&&(d=a,p()); + b=c.previous;b.next=c.previous=a;a.next=c;a.previous=b;}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)d=null;else{a===d&&(d=b);var c=a.previous;c.next=b;b.previous=c;}a.next=a.previous=null;}};exports.unstable_wrapCallback=function(a){var b=g;return function(){var c=g,f=k;g=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{g=c,k=f,v();}}};exports.unstable_getCurrentPriorityLevel=function(){return g}; + exports.unstable_shouldYield=function(){return !e&&(null!==d&&d.expirationTime= expirationTime) { + // This callback expires at or after the continuation. We will insert + // the continuation *before* this callback. + nextAfterContinuation = node; + break; + } + node = node.next; + } while (node !== firstCallbackNode); + + if (nextAfterContinuation === null) { + // No equal or lower priority callback was found, which means the new + // callback is the lowest priority callback in the list. + nextAfterContinuation = firstCallbackNode; + } else if (nextAfterContinuation === firstCallbackNode) { + // The new callback is the highest priority callback in the list. + firstCallbackNode = continuationNode; + ensureHostCallbackIsScheduled(); + } + + var previous = nextAfterContinuation.previous; + previous.next = nextAfterContinuation.previous = continuationNode; + continuationNode.next = nextAfterContinuation; + continuationNode.previous = previous; + } + } + } + + function flushImmediateWork() { + if ( + // Confirm we've exited the outer most event handler + currentEventStartTime === -1 && firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority) { + isExecutingCallback = true; + try { + do { + flushFirstCallback(); + } while ( + // Keep flushing until there are no more immediate callbacks + firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority); + } finally { + isExecutingCallback = false; + if (firstCallbackNode !== null) { + // There's still work remaining. Request another callback. + ensureHostCallbackIsScheduled(); + } else { + isHostCallbackScheduled = false; + } + } + } + } + + function flushWork(didTimeout) { + + isExecutingCallback = true; + var previousDidTimeout = currentDidTimeout; + currentDidTimeout = didTimeout; + try { + if (didTimeout) { + // Flush all the expired callbacks without yielding. + while (firstCallbackNode !== null && !(enableSchedulerDebugging && isSchedulerPaused)) { + // TODO Wrap in feature flag + // Read the current time. Flush all the callbacks that expire at or + // earlier than that time. Then read the current time again and repeat. + // This optimizes for as few performance.now calls as possible. + var currentTime = exports.unstable_now(); + if (firstCallbackNode.expirationTime <= currentTime) { + do { + flushFirstCallback(); + } while (firstCallbackNode !== null && firstCallbackNode.expirationTime <= currentTime && !(enableSchedulerDebugging && isSchedulerPaused)); + continue; + } + break; + } + } else { + // Keep flushing callbacks until we run out of time in the frame. + if (firstCallbackNode !== null) { + do { + if (enableSchedulerDebugging && isSchedulerPaused) { + break; + } + flushFirstCallback(); + } while (firstCallbackNode !== null && !shouldYieldToHost()); + } + } + } finally { + isExecutingCallback = false; + currentDidTimeout = previousDidTimeout; + if (firstCallbackNode !== null) { + // There's still work remaining. Request another callback. + ensureHostCallbackIsScheduled(); + } else { + isHostCallbackScheduled = false; + } + // Before exiting, flush all the immediate work that was scheduled. + flushImmediateWork(); + } + } + + function unstable_runWithPriority(priorityLevel, eventHandler) { + switch (priorityLevel) { + case ImmediatePriority: + case UserBlockingPriority: + case NormalPriority: + case LowPriority: + case IdlePriority: + break; + default: + priorityLevel = NormalPriority; + } + + var previousPriorityLevel = currentPriorityLevel; + var previousEventStartTime = currentEventStartTime; + currentPriorityLevel = priorityLevel; + currentEventStartTime = exports.unstable_now(); + + try { + return eventHandler(); + } finally { + currentPriorityLevel = previousPriorityLevel; + currentEventStartTime = previousEventStartTime; + + // Before exiting, flush all the immediate work that was scheduled. + flushImmediateWork(); + } + } + + function unstable_next(eventHandler) { + var priorityLevel = void 0; + switch (currentPriorityLevel) { + case ImmediatePriority: + case UserBlockingPriority: + case NormalPriority: + // Shift down to normal priority + priorityLevel = NormalPriority; + break; + default: + // Anything lower than normal priority should remain at the current level. + priorityLevel = currentPriorityLevel; + break; + } + + var previousPriorityLevel = currentPriorityLevel; + var previousEventStartTime = currentEventStartTime; + currentPriorityLevel = priorityLevel; + currentEventStartTime = exports.unstable_now(); + + try { + return eventHandler(); + } finally { + currentPriorityLevel = previousPriorityLevel; + currentEventStartTime = previousEventStartTime; + + // Before exiting, flush all the immediate work that was scheduled. + flushImmediateWork(); + } + } + + function unstable_wrapCallback(callback) { + var parentPriorityLevel = currentPriorityLevel; + return function () { + // This is a fork of runWithPriority, inlined for performance. + var previousPriorityLevel = currentPriorityLevel; + var previousEventStartTime = currentEventStartTime; + currentPriorityLevel = parentPriorityLevel; + currentEventStartTime = exports.unstable_now(); + + try { + return callback.apply(this, arguments); + } finally { + currentPriorityLevel = previousPriorityLevel; + currentEventStartTime = previousEventStartTime; + flushImmediateWork(); + } + }; + } + + function unstable_scheduleCallback(callback, deprecated_options) { + var startTime = currentEventStartTime !== -1 ? currentEventStartTime : exports.unstable_now(); + + var expirationTime; + if (typeof deprecated_options === 'object' && deprecated_options !== null && typeof deprecated_options.timeout === 'number') { + // FIXME: Remove this branch once we lift expiration times out of React. + expirationTime = startTime + deprecated_options.timeout; + } else { + switch (currentPriorityLevel) { + case ImmediatePriority: + expirationTime = startTime + IMMEDIATE_PRIORITY_TIMEOUT; + break; + case UserBlockingPriority: + expirationTime = startTime + USER_BLOCKING_PRIORITY; + break; + case IdlePriority: + expirationTime = startTime + IDLE_PRIORITY; + break; + case LowPriority: + expirationTime = startTime + LOW_PRIORITY_TIMEOUT; + break; + case NormalPriority: + default: + expirationTime = startTime + NORMAL_PRIORITY_TIMEOUT; + } + } + + var newNode = { + callback: callback, + priorityLevel: currentPriorityLevel, + expirationTime: expirationTime, + next: null, + previous: null + }; + + // Insert the new callback into the list, ordered first by expiration, then + // by insertion. So the new callback is inserted any other callback with + // equal expiration. + if (firstCallbackNode === null) { + // This is the first callback in the list. + firstCallbackNode = newNode.next = newNode.previous = newNode; + ensureHostCallbackIsScheduled(); + } else { + var next = null; + var node = firstCallbackNode; + do { + if (node.expirationTime > expirationTime) { + // The new callback expires before this one. + next = node; + break; + } + node = node.next; + } while (node !== firstCallbackNode); + + if (next === null) { + // No callback with a later expiration was found, which means the new + // callback has the latest expiration in the list. + next = firstCallbackNode; + } else if (next === firstCallbackNode) { + // The new callback has the earliest expiration in the entire list. + firstCallbackNode = newNode; + ensureHostCallbackIsScheduled(); + } + + var previous = next.previous; + previous.next = next.previous = newNode; + newNode.next = next; + newNode.previous = previous; + } + + return newNode; + } + + function unstable_pauseExecution() { + isSchedulerPaused = true; + } + + function unstable_continueExecution() { + isSchedulerPaused = false; + if (firstCallbackNode !== null) { + ensureHostCallbackIsScheduled(); + } + } + + function unstable_getFirstCallbackNode() { + return firstCallbackNode; + } + + function unstable_cancelCallback(callbackNode) { + var next = callbackNode.next; + if (next === null) { + // Already cancelled. + return; + } + + if (next === callbackNode) { + // This is the only scheduled callback. Clear the list. + firstCallbackNode = null; + } else { + // Remove the callback from its position in the list. + if (callbackNode === firstCallbackNode) { + firstCallbackNode = next; + } + var previous = callbackNode.previous; + previous.next = next; + next.previous = previous; + } + + callbackNode.next = callbackNode.previous = null; + } + + function unstable_getCurrentPriorityLevel() { + return currentPriorityLevel; + } + + function unstable_shouldYield() { + return !currentDidTimeout && (firstCallbackNode !== null && firstCallbackNode.expirationTime < currentExpirationTime || shouldYieldToHost()); + } + + // The remaining code is essentially a polyfill for requestIdleCallback. It + // works by scheduling a requestAnimationFrame, storing the time for the start + // of the frame, then scheduling a postMessage which gets scheduled after paint. + // Within the postMessage handler do as much work as possible until time + frame + // rate. By separating the idle call into a separate event tick we ensure that + // layout, paint and other browser work is counted against the available time. + // The frame rate is dynamically adjusted. + + // We capture a local reference to any global, in case it gets polyfilled after + // this module is initially evaluated. We want to be using a + // consistent implementation. + var localDate = Date; + + // This initialization code may run even on server environments if a component + // just imports ReactDOM (e.g. for findDOMNode). Some environments might not + // have setTimeout or clearTimeout. However, we always expect them to be defined + // on the client. https://github.com/facebook/react/pull/13088 + var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : undefined; + var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined; + + // We don't expect either of these to necessarily be defined, but we will error + // later if they are missing on the client. + var localRequestAnimationFrame = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : undefined; + var localCancelAnimationFrame = typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame : undefined; + + // requestAnimationFrame does not run when the tab is in the background. If + // we're backgrounded we prefer for that work to happen so that the page + // continues to load in the background. So we also schedule a 'setTimeout' as + // a fallback. + // TODO: Need a better heuristic for backgrounded work. + var ANIMATION_FRAME_TIMEOUT = 100; + var rAFID; + var rAFTimeoutID; + var requestAnimationFrameWithTimeout = function (callback) { + // schedule rAF and also a setTimeout + rAFID = localRequestAnimationFrame(function (timestamp) { + // cancel the setTimeout + localClearTimeout(rAFTimeoutID); + callback(timestamp); + }); + rAFTimeoutID = localSetTimeout(function () { + // cancel the requestAnimationFrame + localCancelAnimationFrame(rAFID); + callback(exports.unstable_now()); + }, ANIMATION_FRAME_TIMEOUT); + }; + + if (hasNativePerformanceNow) { + var Performance = performance; + exports.unstable_now = function () { + return Performance.now(); + }; + } else { + exports.unstable_now = function () { + return localDate.now(); + }; + } + + var requestHostCallback; + var cancelHostCallback; + var shouldYieldToHost; + + var globalValue = null; + if (typeof window !== 'undefined') { + globalValue = window; + } else if (typeof commonjsGlobal !== 'undefined') { + globalValue = commonjsGlobal; + } + + if (globalValue && globalValue._schedMock) { + // Dynamic injection, only for testing purposes. + var globalImpl = globalValue._schedMock; + requestHostCallback = globalImpl[0]; + cancelHostCallback = globalImpl[1]; + shouldYieldToHost = globalImpl[2]; + exports.unstable_now = globalImpl[3]; + } else if ( + // If Scheduler runs in a non-DOM environment, it falls back to a naive + // implementation using setTimeout. + typeof window === 'undefined' || + // Check if MessageChannel is supported, too. + typeof MessageChannel !== 'function') { + // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore, + // fallback to a naive implementation. + var _callback = null; + var _flushCallback = function (didTimeout) { + if (_callback !== null) { + try { + _callback(didTimeout); + } finally { + _callback = null; + } + } + }; + requestHostCallback = function (cb, ms) { + if (_callback !== null) { + // Protect against re-entrancy. + setTimeout(requestHostCallback, 0, cb); + } else { + _callback = cb; + setTimeout(_flushCallback, 0, false); + } + }; + cancelHostCallback = function () { + _callback = null; + }; + shouldYieldToHost = function () { + return false; + }; + } else { + if (typeof console !== 'undefined') { + // TODO: Remove fb.me link + if (typeof localRequestAnimationFrame !== 'function') { + console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); + } + if (typeof localCancelAnimationFrame !== 'function') { + console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); + } + } + + var scheduledHostCallback = null; + var isMessageEventScheduled = false; + var timeoutTime = -1; + + var isAnimationFrameScheduled = false; + + var isFlushingHostCallback = false; + + var frameDeadline = 0; + // We start out assuming that we run at 30fps but then the heuristic tracking + // will adjust this value to a faster fps if we get more frequent animation + // frames. + var previousFrameTime = 33; + var activeFrameTime = 33; + + shouldYieldToHost = function () { + return frameDeadline <= exports.unstable_now(); + }; + + // We use the postMessage trick to defer idle work until after the repaint. + var channel = new MessageChannel(); + var port = channel.port2; + channel.port1.onmessage = function (event) { + isMessageEventScheduled = false; + + var prevScheduledCallback = scheduledHostCallback; + var prevTimeoutTime = timeoutTime; + scheduledHostCallback = null; + timeoutTime = -1; + + var currentTime = exports.unstable_now(); + + var didTimeout = false; + if (frameDeadline - currentTime <= 0) { + // There's no time left in this idle period. Check if the callback has + // a timeout and whether it's been exceeded. + if (prevTimeoutTime !== -1 && prevTimeoutTime <= currentTime) { + // Exceeded the timeout. Invoke the callback even though there's no + // time left. + didTimeout = true; + } else { + // No timeout. + if (!isAnimationFrameScheduled) { + // Schedule another animation callback so we retry later. + isAnimationFrameScheduled = true; + requestAnimationFrameWithTimeout(animationTick); + } + // Exit without invoking the callback. + scheduledHostCallback = prevScheduledCallback; + timeoutTime = prevTimeoutTime; + return; + } + } + + if (prevScheduledCallback !== null) { + isFlushingHostCallback = true; + try { + prevScheduledCallback(didTimeout); + } finally { + isFlushingHostCallback = false; + } + } + }; + + var animationTick = function (rafTime) { + if (scheduledHostCallback !== null) { + // Eagerly schedule the next animation callback at the beginning of the + // frame. If the scheduler queue is not empty at the end of the frame, it + // will continue flushing inside that callback. If the queue *is* empty, + // then it will exit immediately. Posting the callback at the start of the + // frame ensures it's fired within the earliest possible frame. If we + // waited until the end of the frame to post the callback, we risk the + // browser skipping a frame and not firing the callback until the frame + // after that. + requestAnimationFrameWithTimeout(animationTick); + } else { + // No pending work. Exit. + isAnimationFrameScheduled = false; + return; + } + + var nextFrameTime = rafTime - frameDeadline + activeFrameTime; + if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) { + if (nextFrameTime < 8) { + // Defensive coding. We don't support higher frame rates than 120hz. + // If the calculated frame time gets lower than 8, it is probably a bug. + nextFrameTime = 8; + } + // If one frame goes long, then the next one can be short to catch up. + // If two frames are short in a row, then that's an indication that we + // actually have a higher frame rate than what we're currently optimizing. + // We adjust our heuristic dynamically accordingly. For example, if we're + // running on 120hz display or 90hz VR display. + // Take the max of the two in case one of them was an anomaly due to + // missed frame deadlines. + activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime; + } else { + previousFrameTime = nextFrameTime; + } + frameDeadline = rafTime + activeFrameTime; + if (!isMessageEventScheduled) { + isMessageEventScheduled = true; + port.postMessage(undefined); + } + }; + + requestHostCallback = function (callback, absoluteTimeout) { + scheduledHostCallback = callback; + timeoutTime = absoluteTimeout; + if (isFlushingHostCallback || absoluteTimeout < 0) { + // Don't wait for the next frame. Continue working ASAP, in a new event. + port.postMessage(undefined); + } else if (!isAnimationFrameScheduled) { + // If rAF didn't already schedule one, we need to schedule a frame. + // TODO: If this rAF doesn't materialize because the browser throttles, we + // might want to still have setTimeout trigger rIC as a backup to ensure + // that we keep performing work. + isAnimationFrameScheduled = true; + requestAnimationFrameWithTimeout(animationTick); + } + }; + + cancelHostCallback = function () { + scheduledHostCallback = null; + isMessageEventScheduled = false; + timeoutTime = -1; + }; + } + + exports.unstable_ImmediatePriority = ImmediatePriority; + exports.unstable_UserBlockingPriority = UserBlockingPriority; + exports.unstable_NormalPriority = NormalPriority; + exports.unstable_IdlePriority = IdlePriority; + exports.unstable_LowPriority = LowPriority; + exports.unstable_runWithPriority = unstable_runWithPriority; + exports.unstable_next = unstable_next; + exports.unstable_scheduleCallback = unstable_scheduleCallback; + exports.unstable_cancelCallback = unstable_cancelCallback; + exports.unstable_wrapCallback = unstable_wrapCallback; + exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; + exports.unstable_shouldYield = unstable_shouldYield; + exports.unstable_continueExecution = unstable_continueExecution; + exports.unstable_pauseExecution = unstable_pauseExecution; + exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; + })(); + } + }); + + unwrapExports(scheduler_development); + var scheduler_development_1 = scheduler_development.unstable_now; + var scheduler_development_2 = scheduler_development.unstable_ImmediatePriority; + var scheduler_development_3 = scheduler_development.unstable_UserBlockingPriority; + var scheduler_development_4 = scheduler_development.unstable_NormalPriority; + var scheduler_development_5 = scheduler_development.unstable_IdlePriority; + var scheduler_development_6 = scheduler_development.unstable_LowPriority; + var scheduler_development_7 = scheduler_development.unstable_runWithPriority; + var scheduler_development_8 = scheduler_development.unstable_next; + var scheduler_development_9 = scheduler_development.unstable_scheduleCallback; + var scheduler_development_10 = scheduler_development.unstable_cancelCallback; + var scheduler_development_11 = scheduler_development.unstable_wrapCallback; + var scheduler_development_12 = scheduler_development.unstable_getCurrentPriorityLevel; + var scheduler_development_13 = scheduler_development.unstable_shouldYield; + var scheduler_development_14 = scheduler_development.unstable_continueExecution; + var scheduler_development_15 = scheduler_development.unstable_pauseExecution; + var scheduler_development_16 = scheduler_development.unstable_getFirstCallbackNode; + + var scheduler = createCommonjsModule(function (module) { + + { + module.exports = scheduler_development; + } + }); + + function ba(a,b,c,d,e,f,g,h){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[c,d,e,f,g,h],k=0;a=Error(b.replace(/%s/g,function(){return l[k++]}));a.name="Invariant Violation";}a.framesToPop=1;throw a;}} + function x(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;dthis.eventPool.length&&this.eventPool.push(a);} + function hb(a){a.eventPool=[];a.getPooled=ib;a.release=jb;}var kb=y.extend({data:null}),lb=y.extend({data:null}),mb=[9,13,27,32],nb=Ra&&"CompositionEvent"in window,ob=null;Ra&&"documentMode"in document&&(ob=document.documentMode); + var pb=Ra&&"TextEvent"in window&&!ob,qb=Ra&&(!nb||ob&&8=ob),rb=String.fromCharCode(32),sb={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(" ")}},tb=!1; + function ub(a,b){switch(a){case "keyup":return -1!==mb.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return !0;default:return !1}}function vb(a){a=a.detail;return "object"===typeof a&&"data"in a?a.data:null}var wb=!1;function xb(a,b){switch(a){case "compositionend":return vb(b);case "keypress":if(32!==b.which)return null;tb=!0;return rb;case "textInput":return a=b.data,a===rb&&tb?null:a;default:return null}} + function yb(a,b){if(wb)return "compositionend"===a||!nb&&ub(a,b)?(a=eb(),db=cb=bb=null,wb=!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&&1b}return !1}function C$1(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;}var D$1={}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){D$1[a]=new C$1(a,0,!1,a,null);});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];D$1[b]=new C$1(b,1,!1,a[1],null);});["contentEditable","draggable","spellCheck","value"].forEach(function(a){D$1[a]=new C$1(a,2,!1,a.toLowerCase(),null);}); + ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){D$1[a]=new C$1(a,2,!1,a,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(a){D$1[a]=new C$1(a,3,!1,a.toLowerCase(),null);});["checked","multiple","muted","selected"].forEach(function(a){D$1[a]=new C$1(a,3,!0,a,null);}); + ["capture","download"].forEach(function(a){D$1[a]=new C$1(a,4,!1,a,null);});["cols","rows","size","span"].forEach(function(a){D$1[a]=new C$1(a,6,!1,a,null);});["rowSpan","start"].forEach(function(a){D$1[a]=new C$1(a,5,!1,a.toLowerCase(),null);});var rc=/[\-:]([a-z])/g;function sc(a){return a[1].toUpperCase()} + "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(rc, + sc);D$1[b]=new C$1(b,1,!1,a,null);});"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(rc,sc);D$1[b]=new C$1(b,1,!1,a,"http://www.w3.org/1999/xlink");});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(rc,sc);D$1[b]=new C$1(b,1,!1,a,"http://www.w3.org/XML/1998/namespace");});["tabIndex","crossOrigin"].forEach(function(a){D$1[a]=new C$1(a,1,!1,a.toLowerCase(),null);}); + function tc(a,b,c,d){var e=D$1.hasOwnProperty(b)?D$1[b]:null;var f=null!==e?0===e.type:d?!1:!(2zd.length&&zd.push(a);}}}var Fd={},Gd=0,Hd="_reactListenersID"+(""+Math.random()).slice(2); + function Id(a){Object.prototype.hasOwnProperty.call(a,Hd)||(a[Hd]=Gd++,Fd[a[Hd]]={});return Fd[a[Hd]]}function Jd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Kd(a){for(;a&&a.firstChild;)a=a.firstChild;return a} + function Ld(a,b){var c=Kd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(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=Kd(c);}}function Md(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Md(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} + function Nd(){for(var a=window,b=Jd();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href;}catch(d){c=!1;}if(c)a=b.contentWindow;else break;b=Jd(a.document);}return b}function Od(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)} + function Pd(){var a=Nd();if(Od(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType;}catch(A){b=null;break a}var f=0,g=-1,h=-1,l=0,k=0,m=a,p=null;b:for(;;){for(var t;;){m!==b||0!==d&&3!==m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h=f+c);3===m.nodeType&&(f+=m.nodeValue.length); + if(null===(t=m.firstChild))break;p=m;m=t;}for(;;){if(m===a)break b;p===b&&++l===d&&(g=f);p===e&&++k===c&&(h=f);if(null!==(t=m.nextSibling))break;m=p;p=m.parentNode;}m=t;}b=-1===g||-1===h?null:{start:g,end:h};}else b=null;}b=b||{start:0,end:0};}else b=null;return {focusedElem:a,selectionRange:b}} + function Qd(a){var b=Nd(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Md(c.ownerDocument.documentElement,c)){if(null!==d&&Od(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ld(c,f);var g=Ld(c, + d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)));}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Sd={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Td=null,Ud=null,Vd=null,Wd=!1; + function Xd(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(Wd||null==Td||Td!==Jd(c))return null;c=Td;"selectionStart"in c&&Od(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return Vd&&dd(Vd,c)?null:(Vd=c,a=y.getPooled(Sd.select,Ud,a,b),a.type="select",a.target=Td,Qa(a),a)} + var Yd={eventTypes:Sd,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Id(e);f=sa.onSelect;for(var g=0;g=b.length?void 0:x("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:uc(c)};} + function de(a,b){var c=uc(b.value),d=uc(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d);}function ee(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b);}var fe={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; + function ge(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 he(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?ge(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} + var ie=void 0,je=function(a){return "undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)});}:a}(function(a,b){if(a.namespaceURI!==fe.svg||"innerHTML"in a)a.innerHTML=b;else{ie=ie||document.createElement("div");ie.innerHTML=""+b+"";for(b=ie.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild);}}); + function ke(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b;} + var le={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},me=["Webkit","ms","Moz","O"];Object.keys(le).forEach(function(a){me.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);le[b]=le[a];});});function ne(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||le.hasOwnProperty(a)&&le[a]?(""+b).trim():b+"px"} + function oe(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=ne(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e;}}var pe=objectAssign({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 qe(a,b){b&&(pe[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?x("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?x("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:x("61")),null!=b.style&&"object"!==typeof b.style?x("62",""):void 0);} + function re(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 se(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Id(a);b=sa[b];for(var d=0;dGe||(a.current=Fe[Ge],Fe[Ge]=null,Ge--);}function G$1(a,b){Ge++;Fe[Ge]=a.current;a.current=b;}var He={},H$1={current:He},I={current:!1},Ie=He; + function Je(a,b){var c=a.type.contextTypes;if(!c)return He;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function J(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Ke(a){F$1(I);F$1(H$1);}function Le(a){F$1(I);F$1(H$1);} + function Me(a,b,c){H$1.current!==He?x("168"):void 0;G$1(H$1,b);G$1(I,c);}function Ne(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:x("108",ic(b)||"Unknown",e);return objectAssign({},c,d)}function Oe(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||He;Ie=H$1.current;G$1(H$1,b);G$1(I,I.current);return !0} + function Pe(a,b,c){var d=a.stateNode;d?void 0:x("169");c?(b=Ne(a,b,Ie),d.__reactInternalMemoizedMergedChildContext=b,F$1(I),F$1(H$1),G$1(H$1,b)):F$1(I);G$1(I,c);}var Qe=null,Re=null;function Se(a){return function(b){try{return a(b)}catch(c){}}} + function Te(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);Qe=Se(function(a){return b.onCommitFiberRoot(c,a)});Re=Se(function(a){return b.onCommitFiberUnmount(c,a)});}catch(d){}return !0} + function Ue(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.contextDependencies=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 K(a,b,c,d){return new Ue(a,b,c,d)} + function Ve(a){a=a.prototype;return !(!a||!a.isReactComponent)}function We(a){if("function"===typeof a)return Ve(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===cc)return 11;if(a===ec)return 14}return 2} + function Xe(a,b){var c=a.alternate;null===c?(c=K(a.tag,b,a.key,a.mode),c.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;c.contextDependencies=a.contextDependencies;c.sibling=a.sibling; + c.index=a.index;c.ref=a.ref;return c} + function Ye(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)Ve(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case Xb:return Ze(c.children,e,f,b);case bc:return $e(c,e|3,f,b);case Yb:return $e(c,e|2,f,b);case Zb:return a=K(12,c,b,e|4),a.elementType=Zb,a.type=Zb,a.expirationTime=f,a;case dc:return a=K(13,c,b,e),a.elementType=dc,a.type=dc,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case $b:g=10;break a;case ac:g=9;break a;case cc:g=11;break a;case ec:g= + 14;break a;case fc:g=16;d=null;break a}x("130",null==a?a:typeof a,"");}b=K(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function Ze(a,b,c,d){a=K(7,a,d,b);a.expirationTime=c;return a}function $e(a,b,c,d){a=K(8,a,d,b);b=0===(b&1)?Yb:bc;a.elementType=b;a.type=b;a.expirationTime=c;return a}function af(a,b,c){a=K(6,a,null,b);a.expirationTime=c;return a} + function bf(a,b,c){b=K(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function cf(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime=b);df(b,a);} + function ef(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{bb?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime;0===c?cf(a,b):bc&&cf(a,b);}df(0,a);}function ff(a,b){a.didError=!1;a.latestPingedTime>=b&&(a.latestPingedTime=0);var c=a.earliestPendingTime,d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);df(b,a);} + function gf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function df(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a;}function L(a,b){if(a&&a.defaultProps){b=objectAssign({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);}return b} + function hf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=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);});switch(a._status){case 1:return a._result;case 2:throw a._result;}a._result=b;throw b;}}var jf=(new react.Component).refs; + function kf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:objectAssign({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c);} + var tf={isMounted:function(a){return (a=a._reactInternalFiber)?2===ed(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=lf();d=mf(d,a);var e=nf(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);of();pf(a,e);qf(a,d);},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=lf();d=mf(d,a);var e=nf(d);e.tag=rf;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);of();pf(a,e);qf(a,d);},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=lf();c=mf(c,a);var d=nf(c);d.tag= + sf;void 0!==b&&null!==b&&(d.callback=b);of();pf(a,d);qf(a,c);}};function uf(a,b,c,d,e,f,g){a=a.stateNode;return "function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!dd(c,d)||!dd(e,f):!0} + function vf(a,b,c){var d=!1,e=He;var f=b.contextType;"object"===typeof f&&null!==f?f=M(f):(e=J(b)?Ie:H$1.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Je(a,e):He);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=tf;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b} + function wf(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&&tf.enqueueReplaceState(b,b.state,null);} + function xf(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=jf;var f=b.contextType;"object"===typeof f&&null!==f?e.context=M(f):(f=J(b)?Ie:H$1.current,e.context=Je(a,f));f=a.updateQueue;null!==f&&(yf(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(kf(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&&tf.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(yf(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4);}var zf=Array.isArray; + function Af(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!==c.tag?x("309"):void 0,d=c.stateNode);d?void 0:x("147",a);var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===jf&&(b=d.refs={});null===a?delete b[e]:b[e]=a;};b._stringRef=e;return b}"string"!==typeof a?x("284"):void 0;c._owner?void 0:x("290",a);}return a} + function Bf(a,b){"textarea"!==a.type&&x("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"");} + function Cf(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){a=Xe(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,du?(B=q,q=null):B=q.sibling;var w=t(e,q,h[u],k);if(null===w){null===q&&(q=B);break}a&& + q&&null===w.alternate&&b(e,q);g=f(w,g,u);null===m?l=w:m.sibling=w;m=w;q=B;}if(u===h.length)return c(e,q),l;if(null===q){for(;uu?(B=q,q=null):B=q.sibling;var v=t(e,q,w.value,k);if(null===v){q||(q=B);break}a&&q&&null===v.alternate&&b(e,q);g=f(v,g,u);null===m?l=v:m.sibling=v;m=v;q=B;}if(w.done)return c(e,q),l;if(null===q){for(;!w.done;u++,w=h.next())w=p(e,w.value,k),null!==w&&(g=f(w,g,u),null===m?l=w:m.sibling=w,m=w);return l}for(q=d(e,q);!w.done;u++,w=h.next())w=A(q,e,u,w.value,k),null!==w&&(a&&null!==w.alternate&&q.delete(null===w.key?u: + w.key),g=f(w,g,u),null===m?l=w:m.sibling=w,m=w);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===Xb&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Vb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===Xb:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===Xb?f.props.children:f.props);d.ref=Af(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k= + k.sibling;}f.type===Xb?(d=Ze(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ye(f.type,f.key,f.props,null,a.mode,h),h.ref=Af(a,d,f),h.return=a,a=h);}return g(a);case Wb: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||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling;}d=bf(f,a.mode,h);d.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),d.return=a,a=d):(c(a,d),d=af(f,a.mode,h),d.return=a,a=d),g(a);if(zf(f))return v(a,d,f,h);if(hc(f))return R(a,d,f,h);l&&Bf(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,x("152",h.displayName||h.name||"Component");}return c(a,d)}}var Df=Cf(!0),Ef=Cf(!1),Ff={},N={current:Ff},Gf={current:Ff},Hf={current:Ff};function If(a){a===Ff?x("174"):void 0;return a} + function Jf(a,b){G$1(Hf,b);G$1(Gf,a);G$1(N,Ff);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:he(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=he(b,c);}F$1(N);G$1(N,b);}function Kf(a){F$1(N);F$1(Gf);F$1(Hf);}function Lf(a){If(Hf.current);var b=If(N.current);var c=he(b,a.type);b!==c&&(G$1(Gf,a),G$1(N,c));}function Mf(a){Gf.current===a&&(F$1(N),F$1(Gf));} + var Nf=0,Of=2,Pf=4,Qf=8,Rf=16,Sf=32,Tf=64,Uf=128,Vf=Tb.ReactCurrentDispatcher,Wf=0,Xf=null,O=null,P=null,Yf=null,Q=null,Zf=null,$f=0,ag=null,bg=0,cg=!1,dg=null,eg=0;function fg(){x("321");}function gg(a,b){if(null===b)return !1;for(var c=0;c$f&&($f=m)):f=l.eagerReducer===a?l.eagerState:a(f,l.action);g=l;l=l.next;}while(null!==l&&l!==d);k||(h=g,e=f);bd(f,b.memoizedState)||(qg=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f;}return [b.memoizedState,c.dispatch]} + function rg(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===ag?(ag={lastEffect:null},ag.lastEffect=a.next=a):(b=ag.lastEffect,null===b?ag.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,ag.lastEffect=a));return a}function sg(a,b,c,d){var e=mg();bg|=a;e.memoizedState=rg(b,c,void 0,void 0===d?null:d);} + function tg(a,b,c,d){var e=ng();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&gg(d,g.deps)){rg(Nf,c,f,d);return}}bg|=a;e.memoizedState=rg(b,c,f,d);}function ug(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null);};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null;}}function vg(){} + function wg(a,b,c){25>eg?void 0:x("301");var d=a.alternate;if(a===Xf||null!==d&&d===Xf)if(cg=!0,a={expirationTime:Wf,action:c,eagerReducer:null,eagerState:null,next:null},null===dg&&(dg=new Map),c=dg.get(b),void 0===c)dg.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a;}else{of();var e=lf();e=mf(e,a);var f={expirationTime:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h);g.next=f;}b.last=f;if(0===a.expirationTime&&(null=== + d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var l=b.lastRenderedState,k=d(l,c);f.eagerReducer=d;f.eagerState=k;if(bd(k,l))return}catch(m){}finally{}qf(a,e);}} + var kg={readContext:M,useCallback:fg,useContext:fg,useEffect:fg,useImperativeHandle:fg,useLayoutEffect:fg,useMemo:fg,useReducer:fg,useRef:fg,useState:fg,useDebugValue:fg},ig={readContext:M,useCallback:function(a,b){mg().memoizedState=[a,void 0===b?null:b];return a},useContext:M,useEffect:function(a,b){return sg(516,Uf|Tf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return sg(4,Pf|Sf,ug.bind(null,b,a),c)},useLayoutEffect:function(a,b){return sg(4,Pf|Sf,a,b)}, + useMemo:function(a,b){var c=mg();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=mg();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=wg.bind(null,Xf,a);return [d.memoizedState,a]},useRef:function(a){var b=mg();a={current:a};return b.memoizedState=a},useState:function(a){var b=mg();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null, + lastRenderedReducer:og,lastRenderedState:a};a=a.dispatch=wg.bind(null,Xf,a);return [b.memoizedState,a]},useDebugValue:vg},jg={readContext:M,useCallback:function(a,b){var c=ng();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&gg(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:M,useEffect:function(a,b){return tg(516,Uf|Tf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return tg(4,Pf|Sf,ug.bind(null,b,a),c)},useLayoutEffect:function(a, + b){return tg(4,Pf|Sf,a,b)},useMemo:function(a,b){var c=ng();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&gg(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:pg,useRef:function(){return ng().memoizedState},useState:function(a){return pg(og)},useDebugValue:vg},xg=null,yg=null,zg=!1; + function Ag(a,b){var c=K(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 Bg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return !1;default:return !1}} + function Cg(a){if(zg){var b=yg;if(b){var c=b;if(!Bg(a,b)){b=De(c);if(!b||!Bg(a,b)){a.effectTag|=2;zg=!1;xg=a;return}Ag(xg,c);}xg=a;yg=Ee(b);}else a.effectTag|=2,zg=!1,xg=a;}}function Dg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;xg=a;}function Eg(a){if(a!==xg)return !1;if(!zg)return Dg(a),zg=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!xe(b,a.memoizedProps))for(b=yg;b;)Ag(a,b),b=De(b);Dg(a);yg=xg?De(a.stateNode):null;return !0}function Fg(){yg=xg=null;zg=!1;} + var Gg=Tb.ReactCurrentOwner,qg=!1;function S(a,b,c,d){b.child=null===a?Ef(b,null,c,d):Df(b,a.child,c,d);}function Hg(a,b,c,d,e){c=c.render;var f=b.ref;Ig(b,e);d=hg(a,b,c,d,f,e);if(null!==a&&!qg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Jg(a,b,e);b.effectTag|=1;S(a,b,d,e);return b.child} + function Kg(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Ve(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,Lg(a,b,g,d,e,f);a=Ye(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return Sg(a,b,c);b=Jg(a,b,c);return null!==b?b.sibling:null}}return Jg(a,b,c)}}else qg=!1;b.expirationTime=0;switch(b.tag){case 2:d= + b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Je(b,H$1.current);Ig(b,c);e=hg(null,b,d,a,e,c);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;lg();if(J(d)){var f=!0;Oe(b);}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&kf(b,d,g,a);e.updater=tf;b.stateNode=e;e._reactInternalFiber=b;xf(b,d,a,c);b=Qg(null,b,d,!0,f, + c);}else b.tag=0,S(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=hf(e);b.type=a;e=b.tag=We(a);f=L(a,f);g=void 0;switch(e){case 0:g=Mg(null,b,a,f,c);break;case 1:g=Og(null,b,a,f,c);break;case 11:g=Hg(null,b,a,f,c);break;case 14:g=Kg(null,b,a,L(a.type,f),d,c);break;default:x("306",a,"");}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:L(d,e),Mg(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps, + e=b.elementType===d?e:L(d,e),Og(a,b,d,e,c);case 3:Rg(b);d=b.updateQueue;null===d?x("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;yf(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)Fg(),b=Jg(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)yg=Ee(b.stateNode.containerInfo),xg=b,e=zg=!0;e?(b.effectTag|=2,b.child=Ef(b,null,d,c)):(S(a,b,d,c),Fg());b=b.child;}return b;case 5:return Lf(b),null===a&&Cg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null, + g=e.children,xe(d,e)?g=null:null!==f&&xe(d,f)&&(b.effectTag|=16),Ng(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(S(a,b,g,c),b=b.child),b;case 6:return null===a&&Cg(b),null;case 13:return Sg(a,b,c);case 4:return Jf(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Df(b,null,d,c):S(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:L(d,e),Hg(a,b,d,e,c);case 7:return S(a,b,b.pendingProps,c),b.child;case 8:return S(a,b,b.pendingProps.children, + c),b.child;case 12:return S(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;Ug(b,f);if(null!==g){var h=g.value;f=bd(h,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!I.current){b=Jg(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var l=h.contextDependencies;if(null!==l){g=h.child;for(var k=l.first;null!==k;){if(k.context===d&&0!== + (k.observedBits&f)){1===h.tag&&(k=nf(c),k.tag=sf,pf(h,k));h.expirationTime=b&&(qg=!0);a.contextDependencies=null;} + function M(a,b){if(Yg!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)Yg=a,b=1073741823;b={context:a,observedBits:b,next:null};null===Xg?(null===Wg?x("308"):void 0,Xg=b,Wg.contextDependencies={first:b,expirationTime:0}):Xg=Xg.next=b;}return a._currentValue}var $g=0,rf=1,sf=2,ah=3,Pg=!1;function bh(a){return {baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}} + function ch(a){return {baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function nf(a){return {expirationTime:a,tag:$g,payload:null,callback:null,next:null,nextEffect:null}}function dh(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b);} + function pf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=bh(a.memoizedState));}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=bh(a.memoizedState),e=c.updateQueue=bh(c.memoizedState)):d=a.updateQueue=ch(e):null===e&&(e=c.updateQueue=ch(d));null===e||d===e?dh(d,b):null===d.lastUpdate||null===e.lastUpdate?(dh(d,b),dh(e,b)):(dh(d,b),e.lastUpdate=b);} + function eh(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=bh(a.memoizedState):fh(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b);}function fh(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=ch(b));return b} + function gh(a,b,c,d,e,f){switch(c.tag){case rf:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case ah:a.effectTag=a.effectTag&-2049|64;case $g:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return objectAssign({},d,e);case sf:Pg=!0;}return d} + function yf(a,b,c,d,e){Pg=!1;b=fh(a,b);for(var f=b.baseState,g=null,h=0,l=b.firstUpdate,k=f;null!==l;){var m=l.expirationTime;md?e:d);Ih.current=null;d=void 0;1c?b:c;0===b&&(Fh=null);$h(a,b);} + function ai(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){T=a;a:{var e=b;b=a;var f=U;var g=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:J(b.type)&&Ke();break;case 3:Kf();Le();g=b.stateNode;g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null);if(null===e||null===e.child)Eg(b),b.effectTag&=-3;mh(b);break;case 5:Mf(b);var h=If(Hf.current);f=b.type;if(null!==e&&null!=b.stateNode)nh(e,b,f,g,h),e.ref!==b.ref&&(b.effectTag|= + 128);else if(g){var l=If(N.current);if(Eg(b)){g=b;e=g.stateNode;var k=g.type,m=g.memoizedProps,p=h;e[Fa]=g;e[Ga]=m;f=void 0;h=k;switch(h){case "iframe":case "object":E$1("load",e);break;case "video":case "audio":for(k=0;k\x3c/script>",k=e.removeChild(e.firstChild)):"string"===typeof e.is?k=k.createElement(p,{is:e.is}):(k=k.createElement(p),"select"===p&&(p=k,e.multiple?p.multiple=!0:e.size&&(p.size=e.size))):k=k.createElementNS(l,p);e=k;e[Fa]=m;e[Ga]=g;lh(e,b,!1,!1);p=e;k=f;m=g;var t=h,A=re(k,m);switch(k){case "iframe":case "object":E$1("load", + p);h=m;break;case "video":case "audio":for(h=0;hg&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g;}if(null!==T)return T;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&& + (c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1=v)t=0;else if(-1===t||v component higher in the tree to provide a loading indicator or placeholder to display."+jc(k));}Nh=!0;m=jh(m,k);h=l;do{switch(h.tag){case 3:h.effectTag|=2048;h.expirationTime=g;g=Ch(h,m,g);eh(h,g);break a;case 1:if(t=m,A=h.type,k=h.stateNode,0===(h.effectTag&64)&&("function"===typeof A.getDerivedStateFromError||null!==k&&"function"===typeof k.componentDidCatch&&(null===Fh||!Fh.has(k)))){h.effectTag|=2048; + h.expirationTime=g;g=Eh(h,t,g);eh(h,g);break a}}h=h.return;}while(null!==h)}T=ai(f);continue}}}break}while(1);Kh=!1;Hh.current=c;Yg=Xg=Wg=null;lg();if(e)Lh=null,a.finishedWork=null;else if(null!==T)a.finishedWork=null;else{c=a.current.alternate;null===c?x("281"):void 0;Lh=null;if(Nh){e=a.latestPendingTime;f=a.latestSuspendedTime;g=a.latestPingedTime;if(0!==e&&eb?0:b)):(a.pendingCommitExpirationTime=d,a.finishedWork=c);}} + function sh(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Fh||!Fh.has(d))){a=jh(b,a);a=Eh(c,a,1073741823);pf(c,a);qf(c,1073741823);return}break;case 3:a=jh(b,a);a=Ch(c,a,1073741823);pf(c,a);qf(c,1073741823);return}c=c.return;}3===a.tag&&(c=jh(b,a),c=Ch(a,c,1073741823),pf(a,c),qf(a,1073741823));} + function mf(a,b){var c=scheduler.unstable_getCurrentPriorityLevel(),d=void 0;if(0===(b.mode&1))d=1073741823;else if(Kh&&!Oh)d=U;else{switch(c){case scheduler.unstable_ImmediatePriority:d=1073741823;break;case scheduler.unstable_UserBlockingPriority:d=1073741822-10*(((1073741822-a+15)/10|0)+1);break;case scheduler.unstable_NormalPriority:d=1073741822-25*(((1073741822-a+500)/25|0)+1);break;case scheduler.unstable_LowPriority:case scheduler.unstable_IdlePriority:d=1;break;default:x("313");}null!==Lh&&d===U&&--d;}c===scheduler.unstable_UserBlockingPriority&& + (0===gi||d=d){a.didError=!1;b=a.latestPingedTime;if(0===b||b>c)a.latestPingedTime=c;df(c,a);c=a.expirationTime;0!==c&&Xh(a,c);}}function Ah(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=lf();b=mf(b,a);a=hi(a,b);null!==a&&(cf(a,b),b=a.expirationTime,0!==b&&Xh(a,b));} + function hi(a,b){a.expirationTimeU&&Sh(),cf(a,b),Kh&&!Oh&&Lh===a||Xh(a,a.expirationTime),ii>ji&&(ii=0,x("185")));}var li=null,Y=null,mi=0,ni=void 0,W=!1,oi=null,Z=0,gi=0,pi=!1,qi=null,X=!1,ri=!1,si=null,ti=scheduler.unstable_now(),ui=1073741822-(ti/10|0),vi=ui,ji=50,ii=0,wi=null;function xi(){ui=1073741822-((scheduler.unstable_now()-ti)/10|0);} + function yi(a,b){if(0!==mi){if(ba.expirationTime&&(a.expirationTime=b);W||(X?ri&&(oi=a,Z=1073741823,Di(a,1073741823,!1)):1073741823===b?Yh(1073741823,!1):yi(a,b));} + function Ci(){var a=0,b=null;if(null!==Y)for(var c=Y,d=li;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===Y?x("244"):void 0;if(d===d.nextScheduledRoot){li=Y=d.nextScheduledRoot=null;break}else if(d===li)li=e=d.nextScheduledRoot,Y.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===Y){Y=c;Y.nextScheduledRoot=li;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot;}else{e>a&&(a=e,b=d);if(d===Y)break;if(1073741823=== + a)break;c=d;d=d.nextScheduledRoot;}}oi=b;Z=a;}var Ei=!1;function di(){return Ei?!0:scheduler.unstable_shouldYield()?Ei=!0:!1}function zi(){try{if(!di()&&null!==li){xi();var a=li;do{var b=a.expirationTime;0!==b&&ui<=b&&(a.nextExpirationTimeToWorkOn=ui);a=a.nextScheduledRoot;}while(a!==li)}Yh(0,!0);}finally{Ei=!1;}} + function Yh(a,b){Ci();if(b)for(xi(),vi=ui;null!==oi&&0!==Z&&a<=Z&&!(Ei&&ui>Z);)Di(oi,Z,ui>Z),Ci(),xi(),vi=ui;else for(;null!==oi&&0!==Z&&a<=Z;)Di(oi,Z,!1),Ci();b&&(mi=0,ni=null);0!==Z&&yi(oi,Z);ii=0;wi=null;if(null!==si)for(a=si,si=null,b=0;b=c&&(null===si?si=[d]:si.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===wi?ii++:(wi=a,ii=0);scheduler.unstable_runWithPriority(scheduler.unstable_ImmediatePriority,function(){Zh(a,b);});}function Dh(a){null===oi?x("246"):void 0;oi.expirationTime=0;pi||(pi=!0,qi=a);}function Gi(a,b){var c=X;X=!0;try{return a(b)}finally{(X=c)||W||Yh(1073741823,!1);}} + function Ii(a,b,c){X||W||0===gi||(Yh(gi,!1),gi=0);var d=X;X=!0;try{return scheduler.unstable_runWithPriority(scheduler.unstable_UserBlockingPriority,function(){return a(b,c)})}finally{(X=d)||W||Yh(1073741823,!1);}} + Ab=function(a,b,c){switch(b){case "input":yc(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID; + + var interaction = { + __count: 1, + id: interactionIDCounter++, + name: name, + timestamp: timestamp + }; + + var prevInteractions = exports.__interactionsRef.current; + + // Traced interactions should stack/accumulate. + // To do that, clone the current interactions. + // The previous set will be restored upon completion. + var interactions = new Set(prevInteractions); + interactions.add(interaction); + exports.__interactionsRef.current = interactions; + + var subscriber = exports.__subscriberRef.current; + var returnValue = void 0; + + try { + if (subscriber !== null) { + subscriber.onInteractionTraced(interaction); + } + } finally { + try { + if (subscriber !== null) { + subscriber.onWorkStarted(interactions, threadID); + } + } finally { + try { + returnValue = callback(); + } finally { + exports.__interactionsRef.current = prevInteractions; + + try { + if (subscriber !== null) { + subscriber.onWorkStopped(interactions, threadID); + } + } finally { + interaction.__count--; + + // If no async work was scheduled for this interaction, + // Notify subscribers that it's completed. + if (subscriber !== null && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + } + } + } + } + + return returnValue; + } + + function unstable_wrap(callback) { + var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID; + + var wrappedInteractions = exports.__interactionsRef.current; + + var subscriber = exports.__subscriberRef.current; + if (subscriber !== null) { + subscriber.onWorkScheduled(wrappedInteractions, threadID); + } + + // Update the pending async work count for the current interactions. + // Update after calling subscribers in case of error. + wrappedInteractions.forEach(function (interaction) { + interaction.__count++; + }); + + var hasRun = false; + + function wrapped() { + var prevInteractions = exports.__interactionsRef.current; + exports.__interactionsRef.current = wrappedInteractions; + + subscriber = exports.__subscriberRef.current; + + try { + var returnValue = void 0; + + try { + if (subscriber !== null) { + subscriber.onWorkStarted(wrappedInteractions, threadID); + } + } finally { + try { + returnValue = callback.apply(undefined, arguments); + } finally { + exports.__interactionsRef.current = prevInteractions; + + if (subscriber !== null) { + subscriber.onWorkStopped(wrappedInteractions, threadID); + } + } + } + + return returnValue; + } finally { + if (!hasRun) { + // We only expect a wrapped function to be executed once, + // But in the event that it's executed more than once– + // Only decrement the outstanding interaction counts once. + hasRun = true; + + // Update pending async counts for all wrapped interactions. + // If this was the last scheduled async work for any of them, + // Mark them as completed. + wrappedInteractions.forEach(function (interaction) { + interaction.__count--; + + if (subscriber !== null && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + }); + } + } + } + + wrapped.cancel = function cancel() { + subscriber = exports.__subscriberRef.current; + + try { + if (subscriber !== null) { + subscriber.onWorkCanceled(wrappedInteractions, threadID); + } + } finally { + // Update pending async counts for all wrapped interactions. + // If this was the last scheduled async work for any of them, + // Mark them as completed. + wrappedInteractions.forEach(function (interaction) { + interaction.__count--; + + if (subscriber && interaction.__count === 0) { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } + }); + } + }; + + return wrapped; + } + + var subscribers = null; + { + subscribers = new Set(); + } + + function unstable_subscribe(subscriber) { + { + subscribers.add(subscriber); + + if (subscribers.size === 1) { + exports.__subscriberRef.current = { + onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted, + onInteractionTraced: onInteractionTraced, + onWorkCanceled: onWorkCanceled, + onWorkScheduled: onWorkScheduled, + onWorkStarted: onWorkStarted, + onWorkStopped: onWorkStopped + }; + } + } + } + + function unstable_unsubscribe(subscriber) { + { + subscribers.delete(subscriber); + + if (subscribers.size === 0) { + exports.__subscriberRef.current = null; + } + } + } + + function onInteractionTraced(interaction) { + var didCatchError = false; + var caughtError = null; + + subscribers.forEach(function (subscriber) { + try { + subscriber.onInteractionTraced(interaction); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onInteractionScheduledWorkCompleted(interaction) { + var didCatchError = false; + var caughtError = null; + + subscribers.forEach(function (subscriber) { + try { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkScheduled(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkScheduled(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkStarted(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkStarted(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkStopped(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkStopped(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + function onWorkCanceled(interactions, threadID) { + var didCatchError = false; + var caughtError = null; + + subscribers.forEach(function (subscriber) { + try { + subscriber.onWorkCanceled(interactions, threadID); + } catch (error) { + if (!didCatchError) { + didCatchError = true; + caughtError = error; + } + } + }); + + if (didCatchError) { + throw caughtError; + } + } + + exports.unstable_clear = unstable_clear; + exports.unstable_getCurrent = unstable_getCurrent; + exports.unstable_getThreadID = unstable_getThreadID; + exports.unstable_trace = unstable_trace; + exports.unstable_wrap = unstable_wrap; + exports.unstable_subscribe = unstable_subscribe; + exports.unstable_unsubscribe = unstable_unsubscribe; + })(); + } + }); + + unwrapExports(schedulerTracing_development); + var schedulerTracing_development_1 = schedulerTracing_development.__interactionsRef; + var schedulerTracing_development_2 = schedulerTracing_development.__subscriberRef; + var schedulerTracing_development_3 = schedulerTracing_development.unstable_clear; + var schedulerTracing_development_4 = schedulerTracing_development.unstable_getCurrent; + var schedulerTracing_development_5 = schedulerTracing_development.unstable_getThreadID; + var schedulerTracing_development_6 = schedulerTracing_development.unstable_trace; + var schedulerTracing_development_7 = schedulerTracing_development.unstable_wrap; + var schedulerTracing_development_8 = schedulerTracing_development.unstable_subscribe; + var schedulerTracing_development_9 = schedulerTracing_development.unstable_unsubscribe; + + var tracing = createCommonjsModule(function (module) { + + { + module.exports = schedulerTracing_development; + } + }); + + var reactDom_development = createCommonjsModule(function (module) { + + + + { + (function() { + + var React = react; + var _assign = objectAssign; + var checkPropTypes = checkPropTypes_1; + var scheduler$1 = scheduler; + var tracing$1 = tracing; + + /** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + + var validateFormat = function () {}; + + { + validateFormat = function (format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; + } + + function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error = void 0; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } + } + + // Relying on the `invariant()` implementation lets us + // preserve the format and params in the www builds. + + !React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0; + + var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) { + var funcArgs = Array.prototype.slice.call(arguments, 3); + try { + func.apply(context, funcArgs); + } catch (error) { + this.onError(error); + } + }; + + { + // In DEV mode, we swap out invokeGuardedCallback for a special version + // that plays more nicely with the browser's DevTools. The idea is to preserve + // "Pause on exceptions" behavior. Because React wraps all user-provided + // functions in invokeGuardedCallback, and the production version of + // invokeGuardedCallback uses a try-catch, all user exceptions are treated + // like caught exceptions, and the DevTools won't pause unless the developer + // takes the extra step of enabling pause on caught exceptions. This is + // unintuitive, though, because even though React has caught the error, from + // the developer's perspective, the error is uncaught. + // + // To preserve the expected "Pause on exceptions" behavior, we don't use a + // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake + // DOM node, and call the user-provided callback from inside an event handler + // for that fake event. If the callback throws, the error is "captured" using + // a global event handler. But because the error happens in a different + // event loop context, it does not interrupt the normal program flow. + // Effectively, this gives us try-catch behavior without actually using + // try-catch. Neat! + + // Check that the browser supports the APIs we need to implement our special + // DEV version of invokeGuardedCallback + if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { + var fakeNode = document.createElement('react'); + + var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) { + // If document doesn't exist we know for sure we will crash in this method + // when we call document.createEvent(). However this can cause confusing + // errors: https://github.com/facebookincubator/create-react-app/issues/3482 + // So we preemptively throw with a better message instead. + !(typeof document !== 'undefined') ? invariant(false, 'The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.') : void 0; + var evt = document.createEvent('Event'); + + // Keeps track of whether the user-provided callback threw an error. We + // set this to true at the beginning, then set it to false right after + // calling the function. If the function errors, `didError` will never be + // set to false. This strategy works even if the browser is flaky and + // fails to call our global error handler, because it doesn't rely on + // the error event at all. + var didError = true; + + // Keeps track of the value of window.event so that we can reset it + // during the callback to let user code access window.event in the + // browsers that support it. + var windowEvent = window.event; + + // Keeps track of the descriptor of window.event to restore it after event + // dispatching: https://github.com/facebook/react/issues/13688 + var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); + + // Create an event handler for our fake event. We will synchronously + // dispatch our fake event using `dispatchEvent`. Inside the handler, we + // call the user-provided callback. + var funcArgs = Array.prototype.slice.call(arguments, 3); + function callCallback() { + // We immediately remove the callback from event listeners so that + // nested `invokeGuardedCallback` calls do not clash. Otherwise, a + // nested call would trigger the fake event handlers of any call higher + // in the stack. + fakeNode.removeEventListener(evtType, callCallback, false); + + // We check for window.hasOwnProperty('event') to prevent the + // window.event assignment in both IE <= 10 as they throw an error + // "Member not found" in strict mode, and in Firefox which does not + // support window.event. + if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { + window.event = windowEvent; + } + + func.apply(context, funcArgs); + didError = false; + } + + // Create a global error event handler. We use this to capture the value + // that was thrown. It's possible that this error handler will fire more + // than once; for example, if non-React code also calls `dispatchEvent` + // and a handler for that event throws. We should be resilient to most of + // those cases. Even if our error event handler fires more than once, the + // last error event is always used. If the callback actually does error, + // we know that the last error event is the correct one, because it's not + // possible for anything else to have happened in between our callback + // erroring and the code that follows the `dispatchEvent` call below. If + // the callback doesn't error, but the error event was fired, we know to + // ignore it because `didError` will be false, as described above. + var error = void 0; + // Use this to track whether the error event is ever called. + var didSetError = false; + var isCrossOriginError = false; + + function handleWindowError(event) { + error = event.error; + didSetError = true; + if (error === null && event.colno === 0 && event.lineno === 0) { + isCrossOriginError = true; + } + if (event.defaultPrevented) { + // Some other error handler has prevented default. + // Browsers silence the error report if this happens. + // We'll remember this to later decide whether to log it or not. + if (error != null && typeof error === 'object') { + try { + error._suppressLogging = true; + } catch (inner) { + // Ignore. + } + } + } + } + + // Create a fake event type. + var evtType = 'react-' + (name ? name : 'invokeguardedcallback'); + + // Attach our event handlers + window.addEventListener('error', handleWindowError); + fakeNode.addEventListener(evtType, callCallback, false); + + // Synchronously dispatch our fake event. If the user-provided function + // errors, it will trigger our global error handler. + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + + if (windowEventDescriptor) { + Object.defineProperty(window, 'event', windowEventDescriptor); + } + + if (didError) { + if (!didSetError) { + // The callback errored, but the error event never fired. + error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); + } else if (isCrossOriginError) { + error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.'); + } + this.onError(error); + } + + // Remove our event listeners + window.removeEventListener('error', handleWindowError); + }; + + invokeGuardedCallbackImpl = invokeGuardedCallbackDev; + } + } + + var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; + + // Used by Fiber to simulate a try-catch. + var hasError = false; + var caughtError = null; + + // Used by event system to capture/rethrow the first error. + var hasRethrowError = false; + var rethrowError = null; + + var reporter = { + onError: function (error) { + hasError = true; + caughtError = error; + } + }; + + /** + * Call a function while guarding against errors that happens within it. + * Returns an error if it throws, otherwise null. + * + * In production, this is implemented using a try-catch. The reason we don't + * use a try-catch directly is so that we can swap out a different + * implementation in DEV mode. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { + hasError = false; + caughtError = null; + invokeGuardedCallbackImpl$1.apply(reporter, arguments); + } + + /** + * Same as invokeGuardedCallback, but instead of returning an error, it stores + * it in a global so it can be rethrown by `rethrowCaughtError` later. + * TODO: See if caughtError and rethrowError can be unified. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback.apply(this, arguments); + if (hasError) { + var error = clearCaughtError(); + if (!hasRethrowError) { + hasRethrowError = true; + rethrowError = error; + } + } + } + + /** + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. + */ + function rethrowCaughtError() { + if (hasRethrowError) { + var error = rethrowError; + hasRethrowError = false; + rethrowError = null; + throw error; + } + } + + function hasCaughtError() { + return hasError; + } + + function clearCaughtError() { + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + return error; + } else { + invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.'); + } + } + + /** + * Injectable ordering of event plugins. + */ + var eventPluginOrder = null; + + /** + * Injectable mapping from names to event plugin modules. + */ + var namesToPlugins = {}; + + /** + * Recomputes the plugin list using the injected plugins and plugin ordering. + * + * @private + */ + function recomputePluginOrdering() { + if (!eventPluginOrder) { + // Wait until an `eventPluginOrder` is injected. + return; + } + for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); + !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0; + if (plugins[pluginIndex]) { + continue; + } + !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0; + plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + for (var eventName in publishedEvents) { + !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0; + } + } + } + + /** + * Publishes an event so that it can be dispatched by the supplied plugin. + * + * @param {object} dispatchConfig Dispatch configuration for the event. + * @param {object} PluginModule Plugin publishing the event. + * @return {boolean} True if the event was successfully published. + * @private + */ + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0; + eventNameDispatchConfigs[eventName] = dispatchConfig; + + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + } + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; + } + return false; + } + + /** + * Publishes a registration name that is used to identify dispatched events. + * + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private + */ + function publishRegistrationName(registrationName, pluginModule, eventName) { + !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0; + registrationNameModules[registrationName] = pluginModule; + registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + + { + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + + if (registrationName === 'onDoubleClick') { + possibleRegistrationNames.ondblclick = registrationName; + } + } + } + + /** + * Registers plugins so that they can extract and dispatch events. + * + * @see {EventPluginHub} + */ + + /** + * Ordered list of injected plugins. + */ + var plugins = []; + + /** + * Mapping from event name to dispatch config + */ + var eventNameDispatchConfigs = {}; + + /** + * Mapping from registration name to plugin module + */ + var registrationNameModules = {}; + + /** + * Mapping from registration name to event name + */ + var registrationNameDependencies = {}; + + /** + * Mapping from lowercase registration names to the properly cased version, + * used to warn in the case of missing event handlers. Available + * only in true. + * @type {Object} + */ + var possibleRegistrationNames = {}; + // Trust the developer to only use possibleRegistrationNames in true + + /** + * Injects an ordering of plugins (by plugin name). This allows the ordering + * to be decoupled from injection of the actual plugins so that ordering is + * always deterministic regardless of packaging, on-the-fly injection, etc. + * + * @param {array} InjectedEventPluginOrder + * @internal + * @see {EventPluginHub.injection.injectEventPluginOrder} + */ + function injectEventPluginOrder(injectedEventPluginOrder) { + !!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0; + // Clone the ordering so it cannot be dynamically mutated. + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); + } + + /** + * Injects plugins to be used by `EventPluginHub`. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. + * + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + * @internal + * @see {EventPluginHub.injection.injectEventPluginsByName} + */ + function injectEventPluginsByName(injectedNamesToPlugins) { + var isOrderingDirty = false; + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + var pluginModule = injectedNamesToPlugins[pluginName]; + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + !!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0; + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; + } + } + if (isOrderingDirty) { + recomputePluginOrdering(); + } + } + + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var warningWithoutStack = function () {}; + + { + warningWithoutStack = function (condition, format) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + if (format === undefined) { + throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (args.length > 8) { + // Check before the condition to catch violations early. + throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); + } + if (condition) { + return; + } + if (typeof console !== 'undefined') { + var argsWithFormat = args.map(function (item) { + return '' + item; + }); + argsWithFormat.unshift('Warning: ' + format); + + // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + Function.prototype.apply.call(console.error, console, argsWithFormat); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} + }; + } + + var warningWithoutStack$1 = warningWithoutStack; + + var getFiberCurrentPropsFromNode = null; + var getInstanceFromNode = null; + var getNodeFromInstance = null; + + function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { + getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; + getInstanceFromNode = getInstanceFromNodeImpl; + getNodeFromInstance = getNodeFromInstanceImpl; + { + !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; + } + } + + var validateEventDispatches = void 0; + { + validateEventDispatches = function (event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + + var listenersIsArr = Array.isArray(dispatchListeners); + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + + var instancesIsArr = Array.isArray(dispatchInstances); + var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + + !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0; + }; + } + + /** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {function} listener Application-level callback + * @param {*} inst Internal component instance + */ + function executeDispatch(event, listener, inst) { + var type = event.type || 'unknown-event'; + event.currentTarget = getNodeFromInstance(inst); + invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + event.currentTarget = null; + } + + /** + * Standard/simple iteration through an event's collected dispatches. + */ + function executeDispatchesInOrder(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and Instances are two parallel arrays that are always in sync. + executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, dispatchListeners, dispatchInstances); + } + event._dispatchListeners = null; + event._dispatchInstances = null; + } + + /** + * @see executeDispatchesInOrderStopAtTrueImpl + */ + + + /** + * Execution of a "direct" dispatch - there must be at most one dispatch + * accumulated on the event or it is considered an error. It doesn't really make + * sense for an event with multiple dispatches (bubbled) to keep track of the + * return values at each dispatch execution, but it does tend to make sense when + * dealing with "direct" dispatches. + * + * @return {*} The return value of executing the single dispatch. + */ + + + /** + * @param {SyntheticEvent} event + * @return {boolean} True iff number of dispatches accumulated is greater than 0. + */ + + /** + * Accumulates items that must not be null or undefined into the first one. This + * is used to conserve memory by avoiding array allocations, and thus sacrifices + * API cleanness. Since `current` can be null before being passed in and not + * null after this function, make sure to assign it back to `current`: + * + * `a = accumulateInto(a, b);` + * + * This API should be sparingly used. Try `accumulate` for something cleaner. + * + * @return {*|array<*>} An accumulation of items. + */ + + function accumulateInto(current, next) { + !(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0; + + if (current == null) { + return next; + } + + // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + if (Array.isArray(current)) { + if (Array.isArray(next)) { + current.push.apply(current, next); + return current; + } + current.push(next); + return current; + } + + if (Array.isArray(next)) { + // A bit too dangerous to mutate `next`. + return [current].concat(next); + } + + return [current, next]; + } + + /** + * @param {array} arr an "accumulation" of items which is either an Array or + * a single item. Useful when paired with the `accumulate` module. This is a + * simple utility that allows us to reason about a collection of items, but + * handling the case when there is exactly one item (and we do not need to + * allocate an array). + * @param {function} cb Callback invoked with each element or a collection. + * @param {?} [scope] Scope used as `this` in a callback. + */ + function forEachAccumulated(arr, cb, scope) { + if (Array.isArray(arr)) { + arr.forEach(cb, scope); + } else if (arr) { + cb.call(scope, arr); + } + } + + /** + * Internal queue of events that have accumulated their dispatches and are + * waiting to have their dispatches executed. + */ + var eventQueue = null; + + /** + * Dispatches an event and releases it back into the pool, unless persistent. + * + * @param {?object} event Synthetic event to be dispatched. + * @private + */ + var executeDispatchesAndRelease = function (event) { + if (event) { + executeDispatchesInOrder(event); + + if (!event.isPersistent()) { + event.constructor.release(event); + } + } + }; + var executeDispatchesAndReleaseTopLevel = function (e) { + return executeDispatchesAndRelease(e); + }; + + function isInteractive(tag) { + return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; + } + + function shouldPreventMouseEvent(name, type, props) { + switch (name) { + case 'onClick': + case 'onClickCapture': + case 'onDoubleClick': + case 'onDoubleClickCapture': + case 'onMouseDown': + case 'onMouseDownCapture': + case 'onMouseMove': + case 'onMouseMoveCapture': + case 'onMouseUp': + case 'onMouseUpCapture': + return !!(props.disabled && isInteractive(type)); + default: + return false; + } + } + + /** + * This is a unified interface for event plugins to be installed and configured. + * + * Event plugins can implement the following properties: + * + * `extractEvents` {function(string, DOMEventTarget, string, object): *} + * Required. When a top-level event is fired, this method is expected to + * extract synthetic events that will in turn be queued and dispatched. + * + * `eventTypes` {object} + * Optional, plugins that fire events must publish a mapping of registration + * names that are used to register listeners. Values of this mapping must + * be objects that contain `registrationName` or `phasedRegistrationNames`. + * + * `executeDispatch` {function(object, function, string)} + * Optional, allows plugins to override how an event gets dispatched. By + * default, the listener is simply invoked. + * + * Each plugin that is injected into `EventsPluginHub` is immediately operable. + * + * @public + */ + + /** + * Methods for injecting dependencies. + */ + var injection = { + /** + * @param {array} InjectedEventPluginOrder + * @public + */ + injectEventPluginOrder: injectEventPluginOrder, + + /** + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + */ + injectEventPluginsByName: injectEventPluginsByName + }; + + /** + * @param {object} inst The instance, which is the source of events. + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @return {?function} The stored callback. + */ + function getListener(inst, registrationName) { + var listener = void 0; + + // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not + // live here; needs to be moved to a better place soon + var stateNode = inst.stateNode; + if (!stateNode) { + // Work in progress (ex: onload events in incremental mode). + return null; + } + var props = getFiberCurrentPropsFromNode(stateNode); + if (!props) { + // Work in progress. + return null; + } + listener = props[registrationName]; + if (shouldPreventMouseEvent(registrationName, inst.type, props)) { + return null; + } + !(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0; + return listener; + } + + /** + * Allows registered plugins an opportunity to extract events from top-level + * native browser events. + * + * @return {*} An accumulation of synthetic events. + * @internal + */ + function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = null; + for (var i = 0; i < plugins.length; i++) { + // Not every plugin in the ordering may be loaded at runtime. + var possiblePlugin = plugins[i]; + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + if (extractedEvents) { + events = accumulateInto(events, extractedEvents); + } + } + } + return events; + } + + function runEventsInBatch(events) { + if (events !== null) { + eventQueue = accumulateInto(eventQueue, events); + } + + // Set `eventQueue` to null before processing it so that we can tell if more + // events get enqueued while processing. + var processingEventQueue = eventQueue; + eventQueue = null; + + if (!processingEventQueue) { + return; + } + + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0; + // This would be a good time to rethrow if any of the event handlers threw. + rethrowCaughtError(); + } + + function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + runEventsInBatch(events); + } + + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedSuspenseComponent = 18; + + var randomKey = Math.random().toString(36).slice(2); + var internalInstanceKey = '__reactInternalInstance$' + randomKey; + var internalEventHandlersKey = '__reactEventHandlers$' + randomKey; + + function precacheFiberNode(hostInst, node) { + node[internalInstanceKey] = hostInst; + } + + /** + * Given a DOM node, return the closest ReactDOMComponent or + * ReactDOMTextComponent instance ancestor. + */ + function getClosestInstanceFromNode(node) { + if (node[internalInstanceKey]) { + return node[internalInstanceKey]; + } + + while (!node[internalInstanceKey]) { + if (node.parentNode) { + node = node.parentNode; + } else { + // Top of the tree. This node must not be part of a React tree (or is + // unmounted, potentially). + return null; + } + } + + var inst = node[internalInstanceKey]; + if (inst.tag === HostComponent || inst.tag === HostText) { + // In Fiber, this will always be the deepest root. + return inst; + } + + return null; + } + + /** + * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent + * instance, or null if the node was not rendered by this React. + */ + function getInstanceFromNode$1(node) { + var inst = node[internalInstanceKey]; + if (inst) { + if (inst.tag === HostComponent || inst.tag === HostText) { + return inst; + } else { + return null; + } + } + return null; + } + + /** + * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding + * DOM node. + */ + function getNodeFromInstance$1(inst) { + if (inst.tag === HostComponent || inst.tag === HostText) { + // In Fiber this, is just the state node right now. We assume it will be + // a host component or host text. + return inst.stateNode; + } + + // Without this first invariant, passing a non-DOM-component triggers the next + // invariant for a missing parent, which is super confusing. + invariant(false, 'getNodeFromInstance: Invalid argument.'); + } + + function getFiberCurrentPropsFromNode$1(node) { + return node[internalEventHandlersKey] || null; + } + + function updateFiberProps(node, props) { + node[internalEventHandlersKey] = props; + } + + function getParent(inst) { + do { + inst = inst.return; + // TODO: If this is a HostRoot we might want to bail out. + // That is depending on if we want nested subtrees (layers) to bubble + // events to their parent. We could also go through parentNode on the + // host node but that wouldn't work for React Native and doesn't let us + // do the portal feature. + } while (inst && inst.tag !== HostComponent); + if (inst) { + return inst; + } + return null; + } + + /** + * Return the lowest common ancestor of A and B, or null if they are in + * different trees. + */ + function getLowestCommonAncestor(instA, instB) { + var depthA = 0; + for (var tempA = instA; tempA; tempA = getParent(tempA)) { + depthA++; + } + var depthB = 0; + for (var tempB = instB; tempB; tempB = getParent(tempB)) { + depthB++; + } + + // If A is deeper, crawl up. + while (depthA - depthB > 0) { + instA = getParent(instA); + depthA--; + } + + // If B is deeper, crawl up. + while (depthB - depthA > 0) { + instB = getParent(instB); + depthB--; + } + + // Walk in lockstep until we find a match. + var depth = depthA; + while (depth--) { + if (instA === instB || instA === instB.alternate) { + return instA; + } + instA = getParent(instA); + instB = getParent(instB); + } + return null; + } + + /** + * Return if A is an ancestor of B. + */ + + + /** + * Return the parent instance of the passed-in instance. + */ + + + /** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + */ + function traverseTwoPhase(inst, fn, arg) { + var path = []; + while (inst) { + path.push(inst); + inst = getParent(inst); + } + var i = void 0; + for (i = path.length; i-- > 0;) { + fn(path[i], 'captured', arg); + } + for (i = 0; i < path.length; i++) { + fn(path[i], 'bubbled', arg); + } + } + + /** + * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that + * should would receive a `mouseEnter` or `mouseLeave` event. + * + * Does not invoke the callback on the nearest common ancestor because nothing + * "entered" or "left" that element. + */ + function traverseEnterLeave(from, to, fn, argFrom, argTo) { + var common = from && to ? getLowestCommonAncestor(from, to) : null; + var pathFrom = []; + while (true) { + if (!from) { + break; + } + if (from === common) { + break; + } + var alternate = from.alternate; + if (alternate !== null && alternate === common) { + break; + } + pathFrom.push(from); + from = getParent(from); + } + var pathTo = []; + while (true) { + if (!to) { + break; + } + if (to === common) { + break; + } + var _alternate = to.alternate; + if (_alternate !== null && _alternate === common) { + break; + } + pathTo.push(to); + to = getParent(to); + } + for (var i = 0; i < pathFrom.length; i++) { + fn(pathFrom[i], 'bubbled', argFrom); + } + for (var _i = pathTo.length; _i-- > 0;) { + fn(pathTo[_i], 'captured', argTo); + } + } + + /** + * Some event types have a notion of different registration names for different + * "phases" of propagation. This finds listeners by a given phase. + */ + function listenerAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(inst, registrationName); + } + + /** + * A small set of propagation patterns, each of which will accept a small amount + * of information, and generate a set of "dispatch ready event objects" - which + * are sets of events that have already been annotated with a set of dispatched + * listener functions/ids. The API is designed this way to discourage these + * propagation strategies from actually executing the dispatches, since we + * always want to collect the entire set of dispatches before executing even a + * single one. + */ + + /** + * Tags a `SyntheticEvent` with dispatched listeners. Creating this function + * here, allows us to not have to bind or create functions for each event. + * Mutating the event's members allows us to not have to create a wrapping + * "dispatch" object that pairs the event with the listener. + */ + function accumulateDirectionalDispatches(inst, phase, event) { + { + !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0; + } + var listener = listenerAtPhase(inst, event, phase); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } + + /** + * Collect dispatches (must be entirely collected before dispatching - see unit + * tests). Lazily allocate the array to conserve memory. We must loop through + * each event and perform the traversal for each one. We cannot perform a + * single traversal for the entire collection of events because each event may + * have a different target. + */ + function accumulateTwoPhaseDispatchesSingle(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); + } + } + + /** + * Accumulates without regard to direction, does not look for phased + * registration names. Same as `accumulateDirectDispatchesSingle` but without + * requiring that the `dispatchMarker` be the same as the dispatched ID. + */ + function accumulateDispatches(inst, ignoredDirection, event) { + if (inst && event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listener = getListener(inst, registrationName); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } + } + + /** + * Accumulates dispatches on an `SyntheticEvent`, but only for the + * `dispatchMarker`. + * @param {SyntheticEvent} event + */ + function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches(event._targetInst, null, event); + } + } + + function accumulateTwoPhaseDispatches(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); + } + + + + function accumulateEnterLeaveDispatches(leave, enter, from, to) { + traverseEnterLeave(from, to, accumulateDispatches, leave, enter); + } + + function accumulateDirectDispatches(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle); + } + + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + + // Do not uses the below two methods directly! + // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM. + // (It is the only module that is allowed to access these methods.) + + function unsafeCastStringToDOMTopLevelType(topLevelType) { + return topLevelType; + } + + function unsafeCastDOMTopLevelTypeToString(topLevelType) { + return topLevelType; + } + + /** + * Generate a mapping of standard vendor prefixes using the defined style property and event name. + * + * @param {string} styleProp + * @param {string} eventName + * @returns {object} + */ + function makePrefixMap(styleProp, eventName) { + var prefixes = {}; + + prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); + prefixes['Webkit' + styleProp] = 'webkit' + eventName; + prefixes['Moz' + styleProp] = 'moz' + eventName; + + return prefixes; + } + + /** + * A list of event names to a configurable list of vendor prefixes. + */ + var vendorPrefixes = { + animationend: makePrefixMap('Animation', 'AnimationEnd'), + animationiteration: makePrefixMap('Animation', 'AnimationIteration'), + animationstart: makePrefixMap('Animation', 'AnimationStart'), + transitionend: makePrefixMap('Transition', 'TransitionEnd') + }; + + /** + * Event names that have already been detected and prefixed (if applicable). + */ + var prefixedEventNames = {}; + + /** + * Element to check for prefixes on. + */ + var style = {}; + + /** + * Bootstrap if a DOM exists. + */ + if (canUseDOM) { + style = document.createElement('div').style; + + // On some platforms, in particular some releases of Android 4.x, + // the un-prefixed "animation" and "transition" properties are defined on the + // style object but the events that fire will still be prefixed, so we need + // to check if the un-prefixed events are usable, and if not remove them from the map. + if (!('AnimationEvent' in window)) { + delete vendorPrefixes.animationend.animation; + delete vendorPrefixes.animationiteration.animation; + delete vendorPrefixes.animationstart.animation; + } + + // Same as above + if (!('TransitionEvent' in window)) { + delete vendorPrefixes.transitionend.transition; + } + } + + /** + * Attempts to determine the correct vendor prefixed event name. + * + * @param {string} eventName + * @returns {string} + */ + function getVendorPrefixedEventName(eventName) { + if (prefixedEventNames[eventName]) { + return prefixedEventNames[eventName]; + } else if (!vendorPrefixes[eventName]) { + return eventName; + } + + var prefixMap = vendorPrefixes[eventName]; + + for (var styleProp in prefixMap) { + if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { + return prefixedEventNames[eventName] = prefixMap[styleProp]; + } + } + + return eventName; + } + + /** + * To identify top level events in ReactDOM, we use constants defined by this + * module. This is the only module that uses the unsafe* methods to express + * that the constants actually correspond to the browser event names. This lets + * us save some bundle size by avoiding a top level type -> event name map. + * The rest of ReactDOM code should import top level types from this file. + */ + var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort'); + var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend')); + var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration')); + var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart')); + var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur'); + var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay'); + var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough'); + var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel'); + var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change'); + var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click'); + var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close'); + var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend'); + var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart'); + var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate'); + var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu'); + var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy'); + var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut'); + var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick'); + var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick'); + var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag'); + var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend'); + var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter'); + var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit'); + var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave'); + var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover'); + var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart'); + var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop'); + var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange'); + var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied'); + var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted'); + var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended'); + var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error'); + var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus'); + var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture'); + var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input'); + var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid'); + var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown'); + var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress'); + var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup'); + var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load'); + var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart'); + var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata'); + var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata'); + var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture'); + var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown'); + var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove'); + var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout'); + var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover'); + var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup'); + var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste'); + var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause'); + var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play'); + var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing'); + var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel'); + var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown'); + + + var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove'); + var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout'); + var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover'); + var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup'); + var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress'); + var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange'); + var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset'); + var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll'); + var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked'); + var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking'); + var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange'); + var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled'); + var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit'); + var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend'); + var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput'); + var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate'); + var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle'); + var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel'); + var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend'); + var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove'); + var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart'); + var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend')); + var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange'); + var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting'); + var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); + + // List of events that need to be individually attached to media elements. + // Note that events in this list will *not* be listened to at the top level + // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`. + var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING]; + + function getRawEventName(topLevelType) { + return unsafeCastDOMTopLevelTypeToString(topLevelType); + } + + /** + * These variables store information about text content of a target node, + * allowing comparison of content before and after a given event. + * + * Identify the node where selection currently begins, then observe + * both its text content and its current position in the DOM. Since the + * browser may natively replace the target node during composition, we can + * use its position to find its replacement. + * + * + */ + + var root = null; + var startText = null; + var fallbackText = null; + + function initialize(nativeEventTarget) { + root = nativeEventTarget; + startText = getText(); + return true; + } + + function reset() { + root = null; + startText = null; + fallbackText = null; + } + + function getData() { + if (fallbackText) { + return fallbackText; + } + + var start = void 0; + var startValue = startText; + var startLength = startValue.length; + var end = void 0; + var endValue = getText(); + var endLength = endValue.length; + + for (start = 0; start < startLength; start++) { + if (startValue[start] !== endValue[start]) { + break; + } + } + + var minEnd = startLength - start; + for (end = 1; end <= minEnd; end++) { + if (startValue[startLength - end] !== endValue[endLength - end]) { + break; + } + } + + var sliceTail = end > 1 ? 1 - end : undefined; + fallbackText = endValue.slice(start, sliceTail); + return fallbackText; + } + + function getText() { + if ('value' in root) { + return root.value; + } + return root.textContent; + } + + /* eslint valid-typeof: 0 */ + + var EVENT_POOL_SIZE = 10; + + /** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var EventInterface = { + type: null, + target: null, + // currentTarget is set when dispatching; no use in copying it here + currentTarget: function () { + return null; + }, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function (event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null + }; + + function functionThatReturnsTrue() { + return true; + } + + function functionThatReturnsFalse() { + return false; + } + + /** + * Synthetic events are dispatched by event plugins, typically in response to a + * top-level event delegation handler. + * + * These systems should generally use pooling to reduce the frequency of garbage + * collection. The system should check `isPersistent` to determine whether the + * event should be released into the pool after being dispatched. Users that + * need a persisted event should invoke `persist`. + * + * Synthetic events (and subclasses) implement the DOM Level 3 Events API by + * normalizing browser quirks. Subclasses do not necessarily have to implement a + * DOM interface; custom application-specific events can also subclass this. + * + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {*} targetInst Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @param {DOMEventTarget} nativeEventTarget Target node. + */ + function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + { + // these have a getter/setter for warnings + delete this.nativeEvent; + delete this.preventDefault; + delete this.stopPropagation; + delete this.isDefaultPrevented; + delete this.isPropagationStopped; + } + + this.dispatchConfig = dispatchConfig; + this._targetInst = targetInst; + this.nativeEvent = nativeEvent; + + var Interface = this.constructor.Interface; + for (var propName in Interface) { + if (!Interface.hasOwnProperty(propName)) { + continue; + } + { + delete this[propName]; // this has a getter/setter for warnings + } + var normalize = Interface[propName]; + if (normalize) { + this[propName] = normalize(nativeEvent); + } else { + if (propName === 'target') { + this.target = nativeEventTarget; + } else { + this[propName] = nativeEvent[propName]; + } + } + } + + var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; + if (defaultPrevented) { + this.isDefaultPrevented = functionThatReturnsTrue; + } else { + this.isDefaultPrevented = functionThatReturnsFalse; + } + this.isPropagationStopped = functionThatReturnsFalse; + return this; + } + + _assign(SyntheticEvent.prototype, { + preventDefault: function () { + this.defaultPrevented = true; + var event = this.nativeEvent; + if (!event) { + return; + } + + if (event.preventDefault) { + event.preventDefault(); + } else if (typeof event.returnValue !== 'unknown') { + event.returnValue = false; + } + this.isDefaultPrevented = functionThatReturnsTrue; + }, + + stopPropagation: function () { + var event = this.nativeEvent; + if (!event) { + return; + } + + if (event.stopPropagation) { + event.stopPropagation(); + } else if (typeof event.cancelBubble !== 'unknown') { + // The ChangeEventPlugin registers a "propertychange" event for + // IE. This event does not support bubbling or cancelling, and + // any references to cancelBubble throw "Member not found". A + // typeof check of "unknown" circumvents this issue (and is also + // IE specific). + event.cancelBubble = true; + } + + this.isPropagationStopped = functionThatReturnsTrue; + }, + + /** + * We release all dispatched `SyntheticEvent`s after each event loop, adding + * them back into the pool. This allows a way to hold onto a reference that + * won't be added back into the pool. + */ + persist: function () { + this.isPersistent = functionThatReturnsTrue; + }, + + /** + * Checks if this event should be released back into the pool. + * + * @return {boolean} True if this should not be released, false otherwise. + */ + isPersistent: functionThatReturnsFalse, + + /** + * `PooledClass` looks for `destructor` on each instance it releases. + */ + destructor: function () { + var Interface = this.constructor.Interface; + for (var propName in Interface) { + { + Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); + } + } + this.dispatchConfig = null; + this._targetInst = null; + this.nativeEvent = null; + this.isDefaultPrevented = functionThatReturnsFalse; + this.isPropagationStopped = functionThatReturnsFalse; + this._dispatchListeners = null; + this._dispatchInstances = null; + { + Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); + Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse)); + Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse)); + Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {})); + Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {})); + } + } + }); + + SyntheticEvent.Interface = EventInterface; + + /** + * Helper to reduce boilerplate when creating subclasses. + */ + SyntheticEvent.extend = function (Interface) { + var Super = this; + + var E = function () {}; + E.prototype = Super.prototype; + var prototype = new E(); + + function Class() { + return Super.apply(this, arguments); + } + _assign(prototype, Class.prototype); + Class.prototype = prototype; + Class.prototype.constructor = Class; + + Class.Interface = _assign({}, Super.Interface, Interface); + Class.extend = Super.extend; + addEventPoolingTo(Class); + + return Class; + }; + + addEventPoolingTo(SyntheticEvent); + + /** + * Helper to nullify syntheticEvent instance properties when destructing + * + * @param {String} propName + * @param {?object} getVal + * @return {object} defineProperty object + */ + function getPooledWarningPropertyDefinition(propName, getVal) { + var isFunction = typeof getVal === 'function'; + return { + configurable: true, + set: set, + get: get + }; + + function set(val) { + var action = isFunction ? 'setting the method' : 'setting the property'; + warn(action, 'This is effectively a no-op'); + return val; + } + + function get() { + var action = isFunction ? 'accessing the method' : 'accessing the property'; + var result = isFunction ? 'This is a no-op function' : 'This is set to null'; + warn(action, result); + return getVal; + } + + function warn(action, result) { + warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) ; + } + } + + function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { + var EventConstructor = this; + if (EventConstructor.eventPool.length) { + var instance = EventConstructor.eventPool.pop(); + EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); + return instance; + } + return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); + } + + function releasePooledEvent(event) { + var EventConstructor = this; + !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0; + event.destructor(); + if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { + EventConstructor.eventPool.push(event); + } + } + + function addEventPoolingTo(EventConstructor) { + EventConstructor.eventPool = []; + EventConstructor.getPooled = getPooledEvent; + EventConstructor.release = releasePooledEvent; + } + + /** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents + */ + var SyntheticCompositionEvent = SyntheticEvent.extend({ + data: null + }); + + /** + * @interface Event + * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 + * /#events-inputevents + */ + var SyntheticInputEvent = SyntheticEvent.extend({ + data: null + }); + + var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space + var START_KEYCODE = 229; + + var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window; + + var documentMode = null; + if (canUseDOM && 'documentMode' in document) { + documentMode = document.documentMode; + } + + // Webkit offers a very useful `textInput` event that can be used to + // directly represent `beforeInput`. The IE `textinput` event is not as + // useful, so we don't use it. + var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; + + // In IE9+, we have access to composition events, but the data supplied + // by the native compositionend event may be incorrect. Japanese ideographic + // spaces, for instance (\u3000) are not recorded correctly. + var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); + + var SPACEBAR_CODE = 32; + var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); + + // Events and their corresponding property names. + var eventTypes = { + beforeInput: { + phasedRegistrationNames: { + bubbled: 'onBeforeInput', + captured: 'onBeforeInputCapture' + }, + dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE] + }, + compositionEnd: { + phasedRegistrationNames: { + bubbled: 'onCompositionEnd', + captured: 'onCompositionEndCapture' + }, + dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN] + }, + compositionStart: { + phasedRegistrationNames: { + bubbled: 'onCompositionStart', + captured: 'onCompositionStartCapture' + }, + dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN] + }, + compositionUpdate: { + phasedRegistrationNames: { + bubbled: 'onCompositionUpdate', + captured: 'onCompositionUpdateCapture' + }, + dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN] + } + }; + + // Track whether we've ever handled a keypress on the space key. + var hasSpaceKeypress = false; + + /** + * Return whether a native keypress event is assumed to be a command. + * This is required because Firefox fires `keypress` events for key commands + * (cut, copy, select-all, etc.) even though no character is inserted. + */ + function isKeypressCommand(nativeEvent) { + return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && + // ctrlKey && altKey is equivalent to AltGr, and is not a command. + !(nativeEvent.ctrlKey && nativeEvent.altKey); + } + + /** + * Translate native top level events into event types. + * + * @param {string} topLevelType + * @return {object} + */ + function getCompositionEventType(topLevelType) { + switch (topLevelType) { + case TOP_COMPOSITION_START: + return eventTypes.compositionStart; + case TOP_COMPOSITION_END: + return eventTypes.compositionEnd; + case TOP_COMPOSITION_UPDATE: + return eventTypes.compositionUpdate; + } + } + + /** + * Does our fallback best-guess model think this event signifies that + * composition has begun? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ + function isFallbackCompositionStart(topLevelType, nativeEvent) { + return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE; + } + + /** + * Does our fallback mode think that this event is the end of composition? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ + function isFallbackCompositionEnd(topLevelType, nativeEvent) { + switch (topLevelType) { + case TOP_KEY_UP: + // Command keys insert or clear IME input. + return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; + case TOP_KEY_DOWN: + // Expect IME keyCode on each keydown. If we get any other + // code we must have exited earlier. + return nativeEvent.keyCode !== START_KEYCODE; + case TOP_KEY_PRESS: + case TOP_MOUSE_DOWN: + case TOP_BLUR: + // Events are not possible without cancelling IME. + return true; + default: + return false; + } + } + + /** + * Google Input Tools provides composition data via a CustomEvent, + * with the `data` property populated in the `detail` object. If this + * is available on the event object, use it. If not, this is a plain + * composition event and we have nothing special to extract. + * + * @param {object} nativeEvent + * @return {?string} + */ + function getDataFromCustomEvent(nativeEvent) { + var detail = nativeEvent.detail; + if (typeof detail === 'object' && 'data' in detail) { + return detail.data; + } + return null; + } + + /** + * Check if a composition event was triggered by Korean IME. + * Our fallback mode does not work well with IE's Korean IME, + * so just use native composition events when Korean IME is used. + * Although CompositionEvent.locale property is deprecated, + * it is available in IE, where our fallback mode is enabled. + * + * @param {object} nativeEvent + * @return {boolean} + */ + function isUsingKoreanIME(nativeEvent) { + return nativeEvent.locale === 'ko'; + } + + // Track the current IME composition status, if any. + var isComposing = false; + + /** + * @return {?object} A SyntheticCompositionEvent. + */ + function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var eventType = void 0; + var fallbackData = void 0; + + if (canUseCompositionEvent) { + eventType = getCompositionEventType(topLevelType); + } else if (!isComposing) { + if (isFallbackCompositionStart(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionStart; + } + } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionEnd; + } + + if (!eventType) { + return null; + } + + if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) { + // The current composition is stored statically and must not be + // overwritten while composition continues. + if (!isComposing && eventType === eventTypes.compositionStart) { + isComposing = initialize(nativeEventTarget); + } else if (eventType === eventTypes.compositionEnd) { + if (isComposing) { + fallbackData = getData(); + } + } + } + + var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget); + + if (fallbackData) { + // Inject data generated from fallback path into the synthetic event. + // This matches the property of native CompositionEventInterface. + event.data = fallbackData; + } else { + var customData = getDataFromCustomEvent(nativeEvent); + if (customData !== null) { + event.data = customData; + } + } + + accumulateTwoPhaseDispatches(event); + return event; + } + + /** + * @param {TopLevelType} topLevelType Number from `TopLevelType`. + * @param {object} nativeEvent Native browser event. + * @return {?string} The string corresponding to this `beforeInput` event. + */ + function getNativeBeforeInputChars(topLevelType, nativeEvent) { + switch (topLevelType) { + case TOP_COMPOSITION_END: + return getDataFromCustomEvent(nativeEvent); + case TOP_KEY_PRESS: + /** + * If native `textInput` events are available, our goal is to make + * use of them. However, there is a special case: the spacebar key. + * In Webkit, preventing default on a spacebar `textInput` event + * cancels character insertion, but it *also* causes the browser + * to fall back to its default spacebar behavior of scrolling the + * page. + * + * Tracking at: + * https://code.google.com/p/chromium/issues/detail?id=355103 + * + * To avoid this issue, use the keypress event as if no `textInput` + * event is available. + */ + var which = nativeEvent.which; + if (which !== SPACEBAR_CODE) { + return null; + } + + hasSpaceKeypress = true; + return SPACEBAR_CHAR; + + case TOP_TEXT_INPUT: + // Record the characters to be added to the DOM. + var chars = nativeEvent.data; + + // If it's a spacebar character, assume that we have already handled + // it at the keypress level and bail immediately. Android Chrome + // doesn't give us keycodes, so we need to ignore it. + if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { + return null; + } + + return chars; + + default: + // For other native event types, do nothing. + return null; + } + } + + /** + * For browsers that do not provide the `textInput` event, extract the + * appropriate string to use for SyntheticInputEvent. + * + * @param {number} topLevelType Number from `TopLevelEventTypes`. + * @param {object} nativeEvent Native browser event. + * @return {?string} The fallback string for this `beforeInput` event. + */ + function getFallbackBeforeInputChars(topLevelType, nativeEvent) { + // If we are currently composing (IME) and using a fallback to do so, + // try to extract the composed characters from the fallback object. + // If composition event is available, we extract a string only at + // compositionevent, otherwise extract it at fallback events. + if (isComposing) { + if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) { + var chars = getData(); + reset(); + isComposing = false; + return chars; + } + return null; + } + + switch (topLevelType) { + case TOP_PASTE: + // If a paste event occurs after a keypress, throw out the input + // chars. Paste events should not lead to BeforeInput events. + return null; + case TOP_KEY_PRESS: + /** + * As of v27, Firefox may fire keypress events even when no character + * will be inserted. A few possibilities: + * + * - `which` is `0`. Arrow keys, Esc key, etc. + * + * - `which` is the pressed key code, but no char is available. + * Ex: 'AltGr + d` in Polish. There is no modified character for + * this key combination and no character is inserted into the + * document, but FF fires the keypress for char code `100` anyway. + * No `input` event will occur. + * + * - `which` is the pressed key code, but a command combination is + * being used. Ex: `Cmd+C`. No character is inserted, and no + * `input` event will occur. + */ + if (!isKeypressCommand(nativeEvent)) { + // IE fires the `keypress` event when a user types an emoji via + // Touch keyboard of Windows. In such a case, the `char` property + // holds an emoji character like `\uD83D\uDE0A`. Because its length + // is 2, the property `which` does not represent an emoji correctly. + // In such a case, we directly return the `char` property instead of + // using `which`. + if (nativeEvent.char && nativeEvent.char.length > 1) { + return nativeEvent.char; + } else if (nativeEvent.which) { + return String.fromCharCode(nativeEvent.which); + } + } + return null; + case TOP_COMPOSITION_END: + return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data; + default: + return null; + } + } + + /** + * Extract a SyntheticInputEvent for `beforeInput`, based on either native + * `textInput` or fallback behavior. + * + * @return {?object} A SyntheticInputEvent. + */ + function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var chars = void 0; + + if (canUseTextInputEvent) { + chars = getNativeBeforeInputChars(topLevelType, nativeEvent); + } else { + chars = getFallbackBeforeInputChars(topLevelType, nativeEvent); + } + + // If no characters are being inserted, no BeforeInput event should + // be fired. + if (!chars) { + return null; + } + + var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget); + + event.data = chars; + accumulateTwoPhaseDispatches(event); + return event; + } + + /** + * Create an `onBeforeInput` event to match + * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. + * + * This event plugin is based on the native `textInput` event + * available in Chrome, Safari, Opera, and IE. This event fires after + * `onKeyPress` and `onCompositionEnd`, but before `onInput`. + * + * `beforeInput` is spec'd but not implemented in any browsers, and + * the `input` event does not provide any useful information about what has + * actually been added, contrary to the spec. Thus, `textInput` is the best + * available event to identify the characters that have actually been inserted + * into the target node. + * + * This plugin is also responsible for emitting `composition` events, thus + * allowing us to share composition fallback code for both `beforeInput` and + * `composition` event types. + */ + var BeforeInputEventPlugin = { + eventTypes: eventTypes, + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget); + + var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget); + + if (composition === null) { + return beforeInput; + } + + if (beforeInput === null) { + return composition; + } + + return [composition, beforeInput]; + } + }; + + // Use to restore controlled state after a change event has fired. + + var restoreImpl = null; + var restoreTarget = null; + var restoreQueue = null; + + function restoreStateOfTarget(target) { + // We perform this translation at the end of the event loop so that we + // always receive the correct fiber here + var internalInstance = getInstanceFromNode(target); + if (!internalInstance) { + // Unmounted + return; + } + !(typeof restoreImpl === 'function') ? invariant(false, 'setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0; + var props = getFiberCurrentPropsFromNode(internalInstance.stateNode); + restoreImpl(internalInstance.stateNode, internalInstance.type, props); + } + + function setRestoreImplementation(impl) { + restoreImpl = impl; + } + + function enqueueStateRestore(target) { + if (restoreTarget) { + if (restoreQueue) { + restoreQueue.push(target); + } else { + restoreQueue = [target]; + } + } else { + restoreTarget = target; + } + } + + function needsStateRestore() { + return restoreTarget !== null || restoreQueue !== null; + } + + function restoreStateIfNeeded() { + if (!restoreTarget) { + return; + } + var target = restoreTarget; + var queuedTargets = restoreQueue; + restoreTarget = null; + restoreQueue = null; + + restoreStateOfTarget(target); + if (queuedTargets) { + for (var i = 0; i < queuedTargets.length; i++) { + restoreStateOfTarget(queuedTargets[i]); + } + } + } + + // Used as a way to call batchedUpdates when we don't have a reference to + // the renderer. Such as when we're dispatching events or if third party + // libraries need to call batchedUpdates. Eventually, this API will go away when + // everything is batched by default. We'll then have a similar API to opt-out of + // scheduled work and instead do synchronous work. + + // Defaults + var _batchedUpdatesImpl = function (fn, bookkeeping) { + return fn(bookkeeping); + }; + var _interactiveUpdatesImpl = function (fn, a, b) { + return fn(a, b); + }; + var _flushInteractiveUpdatesImpl = function () {}; + + var isBatching = false; + function batchedUpdates(fn, bookkeeping) { + if (isBatching) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(bookkeeping); + } + isBatching = true; + try { + return _batchedUpdatesImpl(fn, bookkeeping); + } finally { + // Here we wait until all updates have propagated, which is important + // when using controlled components within layers: + // https://github.com/facebook/react/issues/1698 + // Then we restore state of any controlled component. + isBatching = false; + var controlledComponentsHavePendingUpdates = needsStateRestore(); + if (controlledComponentsHavePendingUpdates) { + // If a controlled event was fired, we may need to restore the state of + // the DOM node back to the controlled value. This is necessary when React + // bails out of the update without touching the DOM. + _flushInteractiveUpdatesImpl(); + restoreStateIfNeeded(); + } + } + } + + function interactiveUpdates(fn, a, b) { + return _interactiveUpdatesImpl(fn, a, b); + } + + + + function setBatchingImplementation(batchedUpdatesImpl, interactiveUpdatesImpl, flushInteractiveUpdatesImpl) { + _batchedUpdatesImpl = batchedUpdatesImpl; + _interactiveUpdatesImpl = interactiveUpdatesImpl; + _flushInteractiveUpdatesImpl = flushInteractiveUpdatesImpl; + } + + /** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary + */ + var supportedInputTypes = { + color: true, + date: true, + datetime: true, + 'datetime-local': true, + email: true, + month: true, + number: true, + password: true, + range: true, + search: true, + tel: true, + text: true, + time: true, + url: true, + week: true + }; + + function isTextInputElement(elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + + if (nodeName === 'input') { + return !!supportedInputTypes[elem.type]; + } + + if (nodeName === 'textarea') { + return true; + } + + return false; + } + + /** + * HTML nodeType values that represent the type of the node + */ + + var ELEMENT_NODE = 1; + var TEXT_NODE = 3; + var COMMENT_NODE = 8; + var DOCUMENT_NODE = 9; + var DOCUMENT_FRAGMENT_NODE = 11; + + /** + * Gets the target node from a native browser event by accounting for + * inconsistencies in browser DOM APIs. + * + * @param {object} nativeEvent Native browser event. + * @return {DOMEventTarget} Target node. + */ + function getEventTarget(nativeEvent) { + // Fallback to nativeEvent.srcElement for IE9 + // https://github.com/facebook/react/issues/12506 + var target = nativeEvent.target || nativeEvent.srcElement || window; + + // Normalize SVG element events #4963 + if (target.correspondingUseElement) { + target = target.correspondingUseElement; + } + + // Safari may fire events on text nodes (Node.TEXT_NODE is 3). + // @see http://www.quirksmode.org/js/events_properties.html + return target.nodeType === TEXT_NODE ? target.parentNode : target; + } + + /** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ + function isEventSupported(eventNameSuffix) { + if (!canUseDOM) { + return false; + } + + var eventName = 'on' + eventNameSuffix; + var isSupported = eventName in document; + + if (!isSupported) { + var element = document.createElement('div'); + element.setAttribute(eventName, 'return;'); + isSupported = typeof element[eventName] === 'function'; + } + + return isSupported; + } + + function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); + } + + function getTracker(node) { + return node._valueTracker; + } + + function detachTracker(node) { + node._valueTracker = null; + } + + function getValueFromNode(node) { + var value = ''; + if (!node) { + return value; + } + + if (isCheckable(node)) { + value = node.checked ? 'true' : 'false'; + } else { + value = node.value; + } + + return value; + } + + function trackValueOnNode(node) { + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + + var currentValue = '' + node[valueField]; + + // if someone has already defined a value or Safari, then bail + // and don't track value will cause over reporting of changes, + // but it's better then a hard failure + // (needed for certain tests that spyOn input values and Safari) + if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { + return; + } + var get = descriptor.get, + set = descriptor.set; + + Object.defineProperty(node, valueField, { + configurable: true, + get: function () { + return get.call(this); + }, + set: function (value) { + currentValue = '' + value; + set.call(this, value); + } + }); + // We could've passed this the first time + // but it triggers a bug in IE11 and Edge 14/15. + // Calling defineProperty() again should be equivalent. + // https://github.com/facebook/react/issues/11768 + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + + var tracker = { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(node); + delete node[valueField]; + } + }; + return tracker; + } + + function track(node) { + if (getTracker(node)) { + return; + } + + // TODO: Once it's just Fiber we can move this to node._wrapperState + node._valueTracker = trackValueOnNode(node); + } + + function updateValueIfChanged(node) { + if (!node) { + return false; + } + + var tracker = getTracker(node); + // if there is no tracker at this point it's unlikely + // that trying again will succeed + if (!tracker) { + return true; + } + + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(node); + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + return false; + } + + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + + // Prevent newer renderers from RTE when used with older react package versions. + // Current owner and dispatcher used to share the same ref, + // but PR #14548 split them out to better support the react-debug-tools package. + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { + ReactSharedInternals.ReactCurrentDispatcher = { + current: null + }; + } + + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; + + var describeComponentFrame = function (name, source, ownerName) { + var sourceInfo = ''; + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + if (match) { + var pathBeforeSlash = match[1]; + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + return '\n in ' + (name || 'Unknown') + sourceInfo; + }; + + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; + + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + + var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + return null; + } + + var Pending = 0; + var Resolved = 1; + var Rejected = 2; + + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName); + } + + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + { + if (typeof type.tag === 'number') { + warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + if (typeof type === 'string') { + return type; + } + switch (type) { + case REACT_CONCURRENT_MODE_TYPE: + return 'ConcurrentMode'; + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + case REACT_PORTAL_TYPE: + return 'Portal'; + case REACT_PROFILER_TYPE: + return 'Profiler'; + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + } + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + case REACT_MEMO_TYPE: + return getComponentName(type.type); + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + } + } + } + return null; + } + + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostRoot: + case HostPortal: + case HostText: + case Fragment: + case ContextProvider: + case ContextConsumer: + return ''; + default: + var owner = fiber._debugOwner; + var source = fiber._debugSource; + var name = getComponentName(fiber.type); + var ownerName = null; + if (owner) { + ownerName = getComponentName(owner.type); + } + return describeComponentFrame(name, source, ownerName); + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + var info = ''; + var node = workInProgress; + do { + info += describeFiber(node); + node = node.return; + } while (node); + return info; + } + + var current = null; + var phase = null; + + function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + var owner = current._debugOwner; + if (owner !== null && typeof owner !== 'undefined') { + return getComponentName(owner.type); + } + } + return null; + } + + function getCurrentFiberStackInDev() { + { + if (current === null) { + return ''; + } + // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. + return getStackByFiberInDevAndProd(current); + } + return ''; + } + + function resetCurrentFiber() { + { + ReactDebugCurrentFrame.getCurrentStack = null; + current = null; + phase = null; + } + } + + function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + phase = null; + } + } + + function setCurrentPhase(lifeCyclePhase) { + { + phase = lifeCyclePhase; + } + } + + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var warning = warningWithoutStack$1; + + { + warning = function (condition, format) { + if (condition) { + return; + } + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + // eslint-disable-next-line react-internal/warning-and-invariant-args + + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack])); + }; + } + + var warning$1 = warning; + + // A reserved attribute. + // It is handled by React separately and shouldn't be written to the DOM. + var RESERVED = 0; + + // A simple string attribute. + // Attributes that aren't in the whitelist are presumed to have this type. + var STRING = 1; + + // A string attribute that accepts booleans in React. In HTML, these are called + // "enumerated" attributes with "true" and "false" as possible values. + // When true, it should be set to a "true" string. + // When false, it should be set to a "false" string. + var BOOLEANISH_STRING = 2; + + // A real boolean attribute. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + var BOOLEAN = 3; + + // An attribute that can be used as a flag as well as with a value. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + // For any other value, should be present with that value. + var OVERLOADED_BOOLEAN = 4; + + // An attribute that must be numeric or parse as a numeric. + // When falsy, it should be removed. + var NUMERIC = 5; + + // An attribute that must be positive numeric or parse as a positive numeric. + // When falsy, it should be removed. + var POSITIVE_NUMERIC = 6; + + /* eslint-disable max-len */ + var ATTRIBUTE_NAME_START_CHAR = ':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'; + /* eslint-enable max-len */ + var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; + + + var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; + var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var illegalAttributeNameCache = {}; + var validatedAttributeNameCache = {}; + + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { + return true; + } + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { + return false; + } + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + illegalAttributeNameCache[attributeName] = true; + { + warning$1(false, 'Invalid attribute name: `%s`', attributeName); + } + return false; + } + + function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null) { + return propertyInfo.type === RESERVED; + } + if (isCustomComponentTag) { + return false; + } + if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { + return true; + } + return false; + } + + function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null && propertyInfo.type === RESERVED) { + return false; + } + switch (typeof value) { + case 'function': + // $FlowIssue symbol is perfectly valid here + case 'symbol': + // eslint-disable-line + return true; + case 'boolean': + { + if (isCustomComponentTag) { + return false; + } + if (propertyInfo !== null) { + return !propertyInfo.acceptsBooleans; + } else { + var prefix = name.toLowerCase().slice(0, 5); + return prefix !== 'data-' && prefix !== 'aria-'; + } + } + default: + return false; + } + } + + function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { + if (value === null || typeof value === 'undefined') { + return true; + } + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { + return true; + } + if (isCustomComponentTag) { + return false; + } + if (propertyInfo !== null) { + switch (propertyInfo.type) { + case BOOLEAN: + return !value; + case OVERLOADED_BOOLEAN: + return value === false; + case NUMERIC: + return isNaN(value); + case POSITIVE_NUMERIC: + return isNaN(value) || value < 1; + } + } + return false; + } + + function getPropertyInfo(name) { + return properties.hasOwnProperty(name) ? properties[name] : null; + } + + function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) { + this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + this.attributeName = attributeName; + this.attributeNamespace = attributeNamespace; + this.mustUseProperty = mustUseProperty; + this.propertyName = name; + this.type = type; + } + + // When adding attributes to this list, be sure to also add them to + // the `possibleStandardNames` module to ensure casing and incorrect + // name warnings. + var properties = {}; + + // These props are reserved by React. They shouldn't be written to the DOM. + ['children', 'dangerouslySetInnerHTML', + // TODO: This prevents the assignment of defaultValue to regular + // elements (not just inputs). Now that ReactDOMInput assigns to the + // defaultValue property -- do we need this? + 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty + name, // attributeName + null); + } // attributeNamespace + ); + + // A few React string attributes have a different name. + // This is a mapping from React prop names to the attribute names. + [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { + var name = _ref[0], + attributeName = _ref[1]; + + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, // attributeName + null); + } // attributeNamespace + ); + + // These are "enumerated" HTML attributes that accept "true" and "false". + // In React, we let users pass `true` and `false` even though technically + // these aren't boolean attributes (they are coerced to strings). + ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name.toLowerCase(), // attributeName + null); + } // attributeNamespace + ); + + // These are "enumerated" SVG attributes that accept "true" and "false". + // In React, we let users pass `true` and `false` even though technically + // these aren't boolean attributes (they are coerced to strings). + // Since these are SVG attributes, their attribute names are case-sensitive. + ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name, // attributeName + null); + } // attributeNamespace + ); + + // These are HTML boolean attributes. + ['allowFullScreen', 'async', + // Note: there is a special case that prevents it from being written to the DOM + // on the client side because the browsers are inconsistent. Instead we call focus(). + 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', + // Microdata + 'itemScope'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty + name.toLowerCase(), // attributeName + null); + } // attributeNamespace + ); + + // These are the few React props that we set as DOM properties + // rather than attributes. These are all booleans. + ['checked', + // Note: `option.selected` is not updated if `select.multiple` is + // disabled with `removeAttribute`. We have special logic for handling this. + 'multiple', 'muted', 'selected'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty + name, // attributeName + null); + } // attributeNamespace + ); + + // These are HTML attributes that are "overloaded booleans": they behave like + // booleans, but can also accept a string value. + ['capture', 'download'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty + name, // attributeName + null); + } // attributeNamespace + ); + + // These are HTML attributes that must be positive numbers. + ['cols', 'rows', 'size', 'span'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty + name, // attributeName + null); + } // attributeNamespace + ); + + // These are HTML attributes that must be numbers. + ['rowSpan', 'start'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty + name.toLowerCase(), // attributeName + null); + } // attributeNamespace + ); + + var CAMELIZE = /[\-\:]([a-z])/g; + var capitalize = function (token) { + return token[1].toUpperCase(); + }; + + // This is a list of all SVG attributes that need special casing, namespacing, + // or boolean value assignment. Regular attributes that just accept strings + // and have the same names are omitted, just like in the HTML whitelist. + // Some of these attributes can be hard to find. This list was created by + // scrapping the MDN documentation. + ['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'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, null); + } // attributeNamespace + ); + + // String SVG attributes with the xlink namespace. + ['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/1999/xlink'); + }); + + // String SVG attributes with the xml namespace. + ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/XML/1998/namespace'); + }); + + // These attribute exists both in HTML and SVG. + // The attribute name is case-sensitive in SVG so we can't just use + // the React name like we do for attributes that exist only in HTML. + ['tabIndex', 'crossOrigin'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null); + } // attributeNamespace + ); + + /** + * Get the value for a property on a node. Only used in DEV for SSR validation. + * The "expected" argument is used as a hint of what the expected value is. + * Some properties have multiple equivalent values. + */ + function getValueForProperty(node, name, expected, propertyInfo) { + { + if (propertyInfo.mustUseProperty) { + var propertyName = propertyInfo.propertyName; + + return node[propertyName]; + } else { + var attributeName = propertyInfo.attributeName; + + var stringValue = null; + + if (propertyInfo.type === OVERLOADED_BOOLEAN) { + if (node.hasAttribute(attributeName)) { + var value = node.getAttribute(attributeName); + if (value === '') { + return true; + } + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return value; + } + if (value === '' + expected) { + return expected; + } + return value; + } + } else if (node.hasAttribute(attributeName)) { + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + // We had an attribute but shouldn't have had one, so read it + // for the error message. + return node.getAttribute(attributeName); + } + if (propertyInfo.type === BOOLEAN) { + // If this was a boolean, it doesn't matter what the value is + // the fact that we have it is the same as the expected. + return expected; + } + // Even if this property uses a namespace we use getAttribute + // because we assume its namespaced name is the same as our config. + // To use getAttributeNS we need the local name which we don't have + // in our config atm. + stringValue = node.getAttribute(attributeName); + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return stringValue === null ? expected : stringValue; + } else if (stringValue === '' + expected) { + return expected; + } else { + return stringValue; + } + } + } + } + + /** + * Get the value for a attribute on a node. Only used in DEV for SSR validation. + * The third argument is used as a hint of what the expected value is. Some + * attributes have multiple equivalent values. + */ + function getValueForAttribute(node, name, expected) { + { + if (!isAttributeNameSafe(name)) { + return; + } + if (!node.hasAttribute(name)) { + return expected === undefined ? undefined : null; + } + var value = node.getAttribute(name); + if (value === '' + expected) { + return expected; + } + return value; + } + } + + /** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + function setValueForProperty(node, name, value, isCustomComponentTag) { + var propertyInfo = getPropertyInfo(name); + if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { + return; + } + if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { + value = null; + } + // If the prop isn't in the special list, treat it as a simple attribute. + if (isCustomComponentTag || propertyInfo === null) { + if (isAttributeNameSafe(name)) { + var _attributeName = name; + if (value === null) { + node.removeAttribute(_attributeName); + } else { + node.setAttribute(_attributeName, '' + value); + } + } + return; + } + var mustUseProperty = propertyInfo.mustUseProperty; + + if (mustUseProperty) { + var propertyName = propertyInfo.propertyName; + + if (value === null) { + var type = propertyInfo.type; + + node[propertyName] = type === BOOLEAN ? false : ''; + } else { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propertyName] = value; + } + return; + } + // The rest are treated as attributes with special cases. + var attributeName = propertyInfo.attributeName, + attributeNamespace = propertyInfo.attributeNamespace; + + if (value === null) { + node.removeAttribute(attributeName); + } else { + var _type = propertyInfo.type; + + var attributeValue = void 0; + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + attributeValue = ''; + } else { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + attributeValue = '' + value; + } + if (attributeNamespace) { + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } else { + node.setAttribute(attributeName, attributeValue); + } + } + } + + // Flow does not allow string concatenation of most non-string types. To work + // around this limitation, we use an opaque type that can only be obtained by + // passing the value through getToStringValue first. + function toString(value) { + return '' + value; + } + + function getToStringValue(value) { + switch (typeof value) { + case 'boolean': + case 'number': + case 'object': + case 'string': + case 'undefined': + return value; + default: + // function, symbol are assigned as empty strings + return ''; + } + } + + var ReactDebugCurrentFrame$1 = null; + + var ReactControlledValuePropTypes = { + checkPropTypes: null + }; + + { + ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + + var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true + }; + + var propTypes = { + value: function (props, propName, componentName) { + if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) { + return null; + } + return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + checked: function (props, propName, componentName) { + if (props.onChange || props.readOnly || props.disabled || props[propName] == null) { + return null; + } + return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + } + }; + + /** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { + checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$1.getStackAddendum); + }; + } + + // Only used in www builds. + var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false. + + // TODO: direct imports like some-package/src/* are bad. Fix me. + var didWarnValueDefaultValue = false; + var didWarnCheckedDefaultChecked = false; + var didWarnControlledToUncontrolled = false; + var didWarnUncontrolledToControlled = false; + + function isControlled(props) { + var usesChecked = props.type === 'checkbox' || props.type === 'radio'; + return usesChecked ? props.checked != null : props.value != null; + } + + /** + * Implements an host component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. + * + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html + */ + + function getHostProps(element, props) { + var node = element; + var checked = props.checked; + + var hostProps = _assign({}, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: undefined, + checked: checked != null ? checked : node._wrapperState.initialChecked + }); + + return hostProps; + } + + function initWrapperState(element, props) { + { + ReactControlledValuePropTypes.checkPropTypes('input', props); + + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + didWarnCheckedDefaultChecked = true; + } + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + didWarnValueDefaultValue = true; + } + } + + var node = element; + var defaultValue = props.defaultValue == null ? '' : props.defaultValue; + + node._wrapperState = { + initialChecked: props.checked != null ? props.checked : props.defaultChecked, + initialValue: getToStringValue(props.value != null ? props.value : defaultValue), + controlled: isControlled(props) + }; + } + + function updateChecked(element, props) { + var node = element; + var checked = props.checked; + if (checked != null) { + setValueForProperty(node, 'checked', checked, false); + } + } + + function updateWrapper(element, props) { + var node = element; + { + var _controlled = isControlled(props); + + if (!node._wrapperState.controlled && _controlled && !didWarnUncontrolledToControlled) { + warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); + didWarnUncontrolledToControlled = true; + } + if (node._wrapperState.controlled && !_controlled && !didWarnControlledToUncontrolled) { + warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); + didWarnControlledToUncontrolled = true; + } + } + + updateChecked(element, props); + + var value = getToStringValue(props.value); + var type = props.type; + + if (value != null) { + if (type === 'number') { + if (value === 0 && node.value === '' || + // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value) { + node.value = toString(value); + } + } else if (node.value !== toString(value)) { + node.value = toString(value); + } + } else if (type === 'submit' || type === 'reset') { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute('value'); + return; + } + + { + // When syncing the value attribute, the value comes from a cascade of + // properties: + // 1. The value React property + // 2. The defaultValue React property + // 3. Otherwise there should be no change + if (props.hasOwnProperty('value')) { + setDefaultValue(node, props.type, value); + } else if (props.hasOwnProperty('defaultValue')) { + setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); + } + } + + { + // When syncing the checked attribute, it only changes when it needs + // to be removed, such as transitioning from a checkbox into a text input + if (props.checked == null && props.defaultChecked != null) { + node.defaultChecked = !!props.defaultChecked; + } + } + } + + function postMountWrapper(element, props, isHydrating) { + var node = element; + + // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { + var type = props.type; + var isButton = type === 'submit' || type === 'reset'; + + // Avoid setting value attribute on submit/reset inputs as it overrides the + // default value provided by the browser. See: #12872 + if (isButton && (props.value === undefined || props.value === null)) { + return; + } + + var _initialValue = toString(node._wrapperState.initialValue); + + // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + if (!isHydrating) { + { + // When syncing the value attribute, the value property should use + // the wrapperState._initialValue property. This uses: + // + // 1. The value React property when present + // 2. The defaultValue React property when present + // 3. An empty string + if (_initialValue !== node.value) { + node.value = _initialValue; + } + } + } + + { + // Otherwise, the value attribute is synchronized to the property, + // so we assign defaultValue to the same thing as the value property + // assignment step above. + node.defaultValue = _initialValue; + } + } + + // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug + // this is needed to work around a chrome bug where setting defaultChecked + // will sometimes influence the value of checked (even after detachment). + // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 + // We need to temporarily unset name to avoid disrupting radio button groups. + var name = node.name; + if (name !== '') { + node.name = ''; + } + + { + // When syncing the checked attribute, both the checked property and + // attribute are assigned at the same time using defaultChecked. This uses: + // + // 1. The checked React property when present + // 2. The defaultChecked React property when present + // 3. Otherwise, false + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !!node._wrapperState.initialChecked; + } + + if (name !== '') { + node.name = name; + } + } + + function restoreControlledState(element, props) { + var node = element; + updateWrapper(node, props); + updateNamedCousins(node, props); + } + + function updateNamedCousins(rootNode, props) { + var name = props.name; + if (props.type === 'radio' && name != null) { + var queryRoot = rootNode; + + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } + + // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form. It might not even be in the + // document. Let's just use the local `querySelectorAll` to ensure we don't + // miss anything. + var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); + + for (var i = 0; i < group.length; i++) { + var otherNode = group[i]; + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } + // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React radio buttons with non-React ones. + var otherProps = getFiberCurrentPropsFromNode$1(otherNode); + !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0; + + // We need update the tracked value on the named cousin since the value + // was changed but the input saw no event or value set + updateValueIfChanged(otherNode); + + // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + updateWrapper(otherNode, otherProps); + } + } + } + + // In Chrome, assigning defaultValue to certain input types triggers input validation. + // For number inputs, the display value loses trailing decimal points. For email inputs, + // Chrome raises "The specified value is not a valid email address". + // + // Here we check to see if the defaultValue has actually changed, avoiding these problems + // when the user is inputting text + // + // https://github.com/facebook/react/issues/7253 + function setDefaultValue(node, type, value) { + if ( + // Focused number inputs synchronize on blur. See ChangeEventPlugin.js + type !== 'number' || node.ownerDocument.activeElement !== node) { + if (value == null) { + node.defaultValue = toString(node._wrapperState.initialValue); + } else if (node.defaultValue !== toString(value)) { + node.defaultValue = toString(value); + } + } + } + + var eventTypes$1 = { + change: { + phasedRegistrationNames: { + bubbled: 'onChange', + captured: 'onChangeCapture' + }, + dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE] + } + }; + + function createAndAccumulateChangeEvent(inst, nativeEvent, target) { + var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target); + event.type = 'change'; + // Flag this event loop as needing state restore. + enqueueStateRestore(target); + accumulateTwoPhaseDispatches(event); + return event; + } + /** + * For IE shims + */ + var activeElement = null; + var activeElementInst = null; + + /** + * SECTION: handle `change` event + */ + function shouldUseChangeEvent(elem) { + var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; + } + + function manualDispatchChangeEvent(nativeEvent) { + var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); + + // If change and propertychange bubbled, we'd just bind to it like all the + // other events and have it go through ReactBrowserEventEmitter. Since it + // doesn't, we manually listen for the events and so we have to enqueue and + // process the abstract event manually. + // + // Batching is necessary here in order to ensure that all event handlers run + // before the next rerender (including event handlers attached to ancestor + // elements instead of directly on the input). Without this, controlled + // components don't work properly in conjunction with event bubbling because + // the component is rerendered and the value reverted before all the event + // handlers can run. See https://github.com/facebook/react/issues/708. + batchedUpdates(runEventInBatch, event); + } + + function runEventInBatch(event) { + runEventsInBatch(event); + } + + function getInstIfValueChanged(targetInst) { + var targetNode = getNodeFromInstance$1(targetInst); + if (updateValueIfChanged(targetNode)) { + return targetInst; + } + } + + function getTargetInstForChangeEvent(topLevelType, targetInst) { + if (topLevelType === TOP_CHANGE) { + return targetInst; + } + } + + /** + * SECTION: handle `input` event + */ + var isInputEventSupported = false; + if (canUseDOM) { + // IE9 claims to support the input event but fails to trigger it when + // deleting text, so we ignore its input events. + isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9); + } + + /** + * (For IE <=9) Starts tracking propertychange events on the passed-in element + * and override the value property so that we can distinguish user events from + * value changes in JS. + */ + function startWatchingForValueChange(target, targetInst) { + activeElement = target; + activeElementInst = targetInst; + activeElement.attachEvent('onpropertychange', handlePropertyChange); + } + + /** + * (For IE <=9) Removes the event listeners from the currently-tracked element, + * if any exists. + */ + function stopWatchingForValueChange() { + if (!activeElement) { + return; + } + activeElement.detachEvent('onpropertychange', handlePropertyChange); + activeElement = null; + activeElementInst = null; + } + + /** + * (For IE <=9) Handles a propertychange event, sending a `change` event if + * the value of the active element has changed. + */ + function handlePropertyChange(nativeEvent) { + if (nativeEvent.propertyName !== 'value') { + return; + } + if (getInstIfValueChanged(activeElementInst)) { + manualDispatchChangeEvent(nativeEvent); + } + } + + function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) { + if (topLevelType === TOP_FOCUS) { + // In IE9, propertychange fires for most input events but is buggy and + // doesn't fire when text is deleted, but conveniently, selectionchange + // appears to fire in all of the remaining cases so we catch those and + // forward the event if the value has changed + // In either case, we don't want to call the event handler if the value + // is changed from JS so we redefine a setter for `.value` that updates + // our activeElementValue variable, allowing us to ignore those changes + // + // stopWatching() should be a noop here but we call it just in case we + // missed a blur event somehow. + stopWatchingForValueChange(); + startWatchingForValueChange(target, targetInst); + } else if (topLevelType === TOP_BLUR) { + stopWatchingForValueChange(); + } + } + + // For IE8 and IE9. + function getTargetInstForInputEventPolyfill(topLevelType, targetInst) { + if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) { + // On the selectionchange event, the target is just document which isn't + // helpful for us so just check activeElement instead. + // + // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire + // propertychange on the first input event after setting `value` from a + // script and fires only keydown, keypress, keyup. Catching keyup usually + // gets it and catching keydown lets us fire an event for the first + // keystroke if user does a key repeat (it'll be a little delayed: right + // before the second keystroke). Other input methods (e.g., paste) seem to + // fire selectionchange normally. + return getInstIfValueChanged(activeElementInst); + } + } + + /** + * SECTION: handle `click` event + */ + function shouldUseClickEvent(elem) { + // Use the `click` event to detect changes to checkbox and radio inputs. + // This approach works across all browsers, whereas `change` does not fire + // until `blur` in IE8. + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); + } + + function getTargetInstForClickEvent(topLevelType, targetInst) { + if (topLevelType === TOP_CLICK) { + return getInstIfValueChanged(targetInst); + } + } + + function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) { + if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) { + return getInstIfValueChanged(targetInst); + } + } + + function handleControlledInputBlur(node) { + var state = node._wrapperState; + + if (!state || !state.controlled || node.type !== 'number') { + return; + } + + { + // If controlled, assign the value attribute to the current value on blur + setDefaultValue(node, 'number', node.value); + } + } + + /** + * This plugin creates an `onChange` event that normalizes change events + * across form elements. This event fires at a time when it's possible to + * change the element's value without seeing a flicker. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - select + */ + var ChangeEventPlugin = { + eventTypes: eventTypes$1, + + _isInputEventSupported: isInputEventSupported, + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window; + + var getTargetInstFunc = void 0, + handleEventFunc = void 0; + if (shouldUseChangeEvent(targetNode)) { + getTargetInstFunc = getTargetInstForChangeEvent; + } else if (isTextInputElement(targetNode)) { + if (isInputEventSupported) { + getTargetInstFunc = getTargetInstForInputOrChangeEvent; + } else { + getTargetInstFunc = getTargetInstForInputEventPolyfill; + handleEventFunc = handleEventsForInputEventPolyfill; + } + } else if (shouldUseClickEvent(targetNode)) { + getTargetInstFunc = getTargetInstForClickEvent; + } + + if (getTargetInstFunc) { + var inst = getTargetInstFunc(topLevelType, targetInst); + if (inst) { + var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget); + return event; + } + } + + if (handleEventFunc) { + handleEventFunc(topLevelType, targetNode, targetInst); + } + + // When blurring, set the value attribute for number inputs + if (topLevelType === TOP_BLUR) { + handleControlledInputBlur(targetNode); + } + } + }; + + /** + * Module that is injectable into `EventPluginHub`, that specifies a + * deterministic ordering of `EventPlugin`s. A convenient way to reason about + * plugins, without having to package every one of them. This is better than + * having plugins be ordered in the same order that they are injected because + * that ordering would be influenced by the packaging order. + * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that + * preventing default on events is convenient in `SimpleEventPlugin` handlers. + */ + var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; + + var SyntheticUIEvent = SyntheticEvent.extend({ + view: null, + detail: null + }); + + var modifierKeyToProp = { + Alt: 'altKey', + Control: 'ctrlKey', + Meta: 'metaKey', + Shift: 'shiftKey' + }; + + // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support + // getModifierState. If getModifierState is not supported, we map it to a set of + // modifier keys exposed by the event. In this case, Lock-keys are not supported. + /** + * Translation from modifier key to the associated property in the event. + * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers + */ + + function modifierStateGetter(keyArg) { + var syntheticEvent = this; + var nativeEvent = syntheticEvent.nativeEvent; + if (nativeEvent.getModifierState) { + return nativeEvent.getModifierState(keyArg); + } + var keyProp = modifierKeyToProp[keyArg]; + return keyProp ? !!nativeEvent[keyProp] : false; + } + + function getEventModifierState(nativeEvent) { + return modifierStateGetter; + } + + var previousScreenX = 0; + var previousScreenY = 0; + // Use flags to signal movementX/Y has already been set + var isMovementXSet = false; + var isMovementYSet = false; + + /** + * @interface MouseEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var SyntheticMouseEvent = SyntheticUIEvent.extend({ + screenX: null, + screenY: null, + clientX: null, + clientY: null, + pageX: null, + pageY: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + getModifierState: getEventModifierState, + button: null, + buttons: null, + relatedTarget: function (event) { + return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); + }, + movementX: function (event) { + if ('movementX' in event) { + return event.movementX; + } + + var screenX = previousScreenX; + previousScreenX = event.screenX; + + if (!isMovementXSet) { + isMovementXSet = true; + return 0; + } + + return event.type === 'mousemove' ? event.screenX - screenX : 0; + }, + movementY: function (event) { + if ('movementY' in event) { + return event.movementY; + } + + var screenY = previousScreenY; + previousScreenY = event.screenY; + + if (!isMovementYSet) { + isMovementYSet = true; + return 0; + } + + return event.type === 'mousemove' ? event.screenY - screenY : 0; + } + }); + + /** + * @interface PointerEvent + * @see http://www.w3.org/TR/pointerevents/ + */ + var SyntheticPointerEvent = SyntheticMouseEvent.extend({ + pointerId: null, + width: null, + height: null, + pressure: null, + tangentialPressure: null, + tiltX: null, + tiltY: null, + twist: null, + pointerType: null, + isPrimary: null + }); + + var eventTypes$2 = { + mouseEnter: { + registrationName: 'onMouseEnter', + dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER] + }, + mouseLeave: { + registrationName: 'onMouseLeave', + dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER] + }, + pointerEnter: { + registrationName: 'onPointerEnter', + dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER] + }, + pointerLeave: { + registrationName: 'onPointerLeave', + dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER] + } + }; + + var EnterLeaveEventPlugin = { + eventTypes: eventTypes$2, + + /** + * For almost every interaction we care about, there will be both a top-level + * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that + * we do not extract duplicate events. However, moving the mouse into the + * browser from outside will not fire a `mouseout` event. In this case, we use + * the `mouseover` top-level event. + */ + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER; + var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT; + + if (isOverEvent && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { + return null; + } + + if (!isOutEvent && !isOverEvent) { + // Must not be a mouse or pointer in or out - ignoring. + return null; + } + + var win = void 0; + if (nativeEventTarget.window === nativeEventTarget) { + // `nativeEventTarget` is probably a window object. + win = nativeEventTarget; + } else { + // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. + var doc = nativeEventTarget.ownerDocument; + if (doc) { + win = doc.defaultView || doc.parentWindow; + } else { + win = window; + } + } + + var from = void 0; + var to = void 0; + if (isOutEvent) { + from = targetInst; + var related = nativeEvent.relatedTarget || nativeEvent.toElement; + to = related ? getClosestInstanceFromNode(related) : null; + } else { + // Moving to a node from outside the window. + from = null; + to = targetInst; + } + + if (from === to) { + // Nothing pertains to our managed components. + return null; + } + + var eventInterface = void 0, + leaveEventType = void 0, + enterEventType = void 0, + eventTypePrefix = void 0; + + if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) { + eventInterface = SyntheticMouseEvent; + leaveEventType = eventTypes$2.mouseLeave; + enterEventType = eventTypes$2.mouseEnter; + eventTypePrefix = 'mouse'; + } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) { + eventInterface = SyntheticPointerEvent; + leaveEventType = eventTypes$2.pointerLeave; + enterEventType = eventTypes$2.pointerEnter; + eventTypePrefix = 'pointer'; + } + + var fromNode = from == null ? win : getNodeFromInstance$1(from); + var toNode = to == null ? win : getNodeFromInstance$1(to); + + var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget); + leave.type = eventTypePrefix + 'leave'; + leave.target = fromNode; + leave.relatedTarget = toNode; + + var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget); + enter.type = eventTypePrefix + 'enter'; + enter.target = toNode; + enter.relatedTarget = fromNode; + + accumulateEnterLeaveDispatches(leave, enter, from, to); + + return [leave, enter]; + } + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + function is(x, y) { + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare + ; + } + + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + + /** + * Performs equality by iterating through keys on an object and returning false + * when any key has values which are not strictly equal between the arguments. + * Returns true when the values of all keys are strictly equal. + */ + function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; + } + + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + + if (keysA.length !== keysB.length) { + return false; + } + + // Test for A's keys different from B. + for (var i = 0; i < keysA.length; i++) { + if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { + return false; + } + } + + return true; + } + + /** + * `ReactInstanceMap` maintains a mapping from a public facing stateful + * instance (key) and the internal representation (value). This allows public + * methods to accept the user facing instance as an argument and map them back + * to internal methods. + * + * Note that this module is currently shared and assumed to be stateless. + * If this becomes an actual Map, that will break. + */ + + /** + * This API should be called `delete` but we'd have to make sure to always + * transform these to strings for IE support. When this transform is fully + * supported we can rename it. + */ + + + function get(key) { + return key._reactInternalFiber; + } + + function has(key) { + return key._reactInternalFiber !== undefined; + } + + function set(key, value) { + key._reactInternalFiber = value; + } + + // Don't change these two values. They're used by React Dev Tools. + var NoEffect = /* */0; + var PerformedWork = /* */1; + + // You can change the rest (and add more). + var Placement = /* */2; + var Update = /* */4; + var PlacementAndUpdate = /* */6; + var Deletion = /* */8; + var ContentReset = /* */16; + var Callback = /* */32; + var DidCapture = /* */64; + var Ref = /* */128; + var Snapshot = /* */256; + var Passive = /* */512; + + // Passive & Update & Callback & Ref & Snapshot + var LifecycleEffectMask = /* */932; + + // Union of all host effects + var HostEffectMask = /* */1023; + + var Incomplete = /* */1024; + var ShouldCapture = /* */2048; + + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; + + var MOUNTING = 1; + var MOUNTED = 2; + var UNMOUNTED = 3; + + function isFiberMountedImpl(fiber) { + var node = fiber; + if (!fiber.alternate) { + // If there is no alternate, this might be a new tree that isn't inserted + // yet. If it is, then it will have a pending insertion effect on it. + if ((node.effectTag & Placement) !== NoEffect) { + return MOUNTING; + } + while (node.return) { + node = node.return; + if ((node.effectTag & Placement) !== NoEffect) { + return MOUNTING; + } + } + } else { + while (node.return) { + node = node.return; + } + } + if (node.tag === HostRoot) { + // TODO: Check if this was a nested HostRoot when used with + // renderContainerIntoSubtree. + return MOUNTED; + } + // If we didn't hit the root, that means that we're in an disconnected tree + // that has been unmounted. + return UNMOUNTED; + } + + function isFiberMounted(fiber) { + return isFiberMountedImpl(fiber) === MOUNTED; + } + + function isMounted(component) { + { + var owner = ReactCurrentOwner$1.current; + if (owner !== null && owner.tag === ClassComponent) { + var ownerFiber = owner; + var instance = ownerFiber.stateNode; + !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0; + instance._warnedAboutRefsInRender = true; + } + } + + var fiber = get(component); + if (!fiber) { + return false; + } + return isFiberMountedImpl(fiber) === MOUNTED; + } + + function assertIsMounted(fiber) { + !(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0; + } + + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + // If there is no alternate, then we only need to check if it is mounted. + var state = isFiberMountedImpl(fiber); + !(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0; + if (state === MOUNTING) { + return null; + } + return fiber; + } + // If we have two possible branches, we'll walk backwards up to the root + // to see what path the root points to. On the way we may hit one of the + // special cases and we'll deal with them. + var a = fiber; + var b = alternate; + while (true) { + var parentA = a.return; + var parentB = parentA ? parentA.alternate : null; + if (!parentA || !parentB) { + // We're at the root. + break; + } + + // If both copies of the parent fiber point to the same child, we can + // assume that the child is current. This happens when we bailout on low + // priority: the bailed out fiber's child reuses the current child. + if (parentA.child === parentB.child) { + var child = parentA.child; + while (child) { + if (child === a) { + // We've determined that A is the current branch. + assertIsMounted(parentA); + return fiber; + } + if (child === b) { + // We've determined that B is the current branch. + assertIsMounted(parentA); + return alternate; + } + child = child.sibling; + } + // We should never have an alternate for any mounting node. So the only + // way this could possibly happen is if this was unmounted, if at all. + invariant(false, 'Unable to find node on an unmounted component.'); + } + + if (a.return !== b.return) { + // The return pointer of A and the return pointer of B point to different + // fibers. We assume that return pointers never criss-cross, so A must + // belong to the child set of A.return, and B must belong to the child + // set of B.return. + a = parentA; + b = parentB; + } else { + // The return pointers point to the same fiber. We'll have to use the + // default, slow path: scan the child sets of each parent alternate to see + // which child belongs to which set. + // + // Search parent A's child set + var didFindChild = false; + var _child = parentA.child; + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + if (_child === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + // Search parent B's child set + _child = parentB.child; + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + if (_child === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + _child = _child.sibling; + } + !didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0; + } + } + + !(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0; + } + // If the root is not a host container, we're in a disconnected tree. I.e. + // unmounted. + !(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0; + if (a.stateNode.current === a) { + // We've determined that A is the current branch. + return fiber; + } + // Otherwise B has to be current branch. + return alternate; + } + + function findCurrentHostFiber(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + if (!currentParent) { + return null; + } + + // Next we'll drill down this component to find the first HostComponent/Text. + var node = currentParent; + while (true) { + if (node.tag === HostComponent || node.tag === HostText) { + return node; + } else if (node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === currentParent) { + return null; + } + while (!node.sibling) { + if (!node.return || node.return === currentParent) { + return null; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + // Flow needs the return null here, but ESLint complains about it. + // eslint-disable-next-line no-unreachable + return null; + } + + function findCurrentHostFiberWithNoPortals(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + if (!currentParent) { + return null; + } + + // Next we'll drill down this component to find the first HostComponent/Text. + var node = currentParent; + while (true) { + if (node.tag === HostComponent || node.tag === HostText) { + return node; + } else if (node.child && node.tag !== HostPortal) { + node.child.return = node; + node = node.child; + continue; + } + if (node === currentParent) { + return null; + } + while (!node.sibling) { + if (!node.return || node.return === currentParent) { + return null; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + // Flow needs the return null here, but ESLint complains about it. + // eslint-disable-next-line no-unreachable + return null; + } + + function addEventBubbleListener(element, eventType, listener) { + element.addEventListener(eventType, listener, false); + } + + function addEventCaptureListener(element, eventType, listener) { + element.addEventListener(eventType, listener, true); + } + + /** + * @interface Event + * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface + * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent + */ + var SyntheticAnimationEvent = SyntheticEvent.extend({ + animationName: null, + elapsedTime: null, + pseudoElement: null + }); + + /** + * @interface Event + * @see http://www.w3.org/TR/clipboard-apis/ + */ + var SyntheticClipboardEvent = SyntheticEvent.extend({ + clipboardData: function (event) { + return 'clipboardData' in event ? event.clipboardData : window.clipboardData; + } + }); + + /** + * @interface FocusEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var SyntheticFocusEvent = SyntheticUIEvent.extend({ + relatedTarget: null + }); + + /** + * `charCode` represents the actual "character code" and is safe to use with + * `String.fromCharCode`. As such, only keys that correspond to printable + * characters produce a valid `charCode`, the only exception to this is Enter. + * The Tab-key is considered non-printable and does not have a `charCode`, + * presumably because it does not produce a tab-character in browsers. + * + * @param {object} nativeEvent Native browser event. + * @return {number} Normalized `charCode` property. + */ + function getEventCharCode(nativeEvent) { + var charCode = void 0; + var keyCode = nativeEvent.keyCode; + + if ('charCode' in nativeEvent) { + charCode = nativeEvent.charCode; + + // FF does not set `charCode` for the Enter-key, check against `keyCode`. + if (charCode === 0 && keyCode === 13) { + charCode = 13; + } + } else { + // IE8 does not implement `charCode`, but `keyCode` has the correct value. + charCode = keyCode; + } + + // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux) + // report Enter as charCode 10 when ctrl is pressed. + if (charCode === 10) { + charCode = 13; + } + + // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. + // Must not discard the (non-)printable Enter-key. + if (charCode >= 32 || charCode === 13) { + return charCode; + } + + return 0; + } + + /** + * Normalization of deprecated HTML5 `key` values + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ + var normalizeKey = { + Esc: 'Escape', + Spacebar: ' ', + Left: 'ArrowLeft', + Up: 'ArrowUp', + Right: 'ArrowRight', + Down: 'ArrowDown', + Del: 'Delete', + Win: 'OS', + Menu: 'ContextMenu', + Apps: 'ContextMenu', + Scroll: 'ScrollLock', + MozPrintableKey: 'Unidentified' + }; + + /** + * Translation from legacy `keyCode` to HTML5 `key` + * Only special keys supported, all others depend on keyboard layout or browser + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ + var translateToKey = { + '8': 'Backspace', + '9': 'Tab', + '12': 'Clear', + '13': 'Enter', + '16': 'Shift', + '17': 'Control', + '18': 'Alt', + '19': 'Pause', + '20': 'CapsLock', + '27': 'Escape', + '32': ' ', + '33': 'PageUp', + '34': 'PageDown', + '35': 'End', + '36': 'Home', + '37': 'ArrowLeft', + '38': 'ArrowUp', + '39': 'ArrowRight', + '40': 'ArrowDown', + '45': 'Insert', + '46': 'Delete', + '112': 'F1', + '113': 'F2', + '114': 'F3', + '115': 'F4', + '116': 'F5', + '117': 'F6', + '118': 'F7', + '119': 'F8', + '120': 'F9', + '121': 'F10', + '122': 'F11', + '123': 'F12', + '144': 'NumLock', + '145': 'ScrollLock', + '224': 'Meta' + }; + + /** + * @param {object} nativeEvent Native browser event. + * @return {string} Normalized `key` property. + */ + function getEventKey(nativeEvent) { + if (nativeEvent.key) { + // Normalize inconsistent values reported by browsers due to + // implementations of a working draft specification. + + // FireFox implements `key` but returns `MozPrintableKey` for all + // printable characters (normalized to `Unidentified`), ignore it. + var key = normalizeKey[nativeEvent.key] || nativeEvent.key; + if (key !== 'Unidentified') { + return key; + } + } + + // Browser does not implement `key`, polyfill as much of it as we can. + if (nativeEvent.type === 'keypress') { + var charCode = getEventCharCode(nativeEvent); + + // The enter-key is technically both printable and non-printable and can + // thus be captured by `keypress`, no other non-printable key should. + return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); + } + if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { + // While user keyboard layout determines the actual meaning of each + // `keyCode` value, almost all function keys have a universal value. + return translateToKey[nativeEvent.keyCode] || 'Unidentified'; + } + return ''; + } + + /** + * @interface KeyboardEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var SyntheticKeyboardEvent = SyntheticUIEvent.extend({ + key: getEventKey, + location: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + repeat: null, + locale: null, + getModifierState: getEventModifierState, + // Legacy Interface + charCode: function (event) { + // `charCode` is the result of a KeyPress event and represents the value of + // the actual printable character. + + // KeyPress is deprecated, but its replacement is not yet final and not + // implemented in any major browser. Only KeyPress has charCode. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + return 0; + }, + keyCode: function (event) { + // `keyCode` is the result of a KeyDown/Up event and represents the value of + // physical keyboard key. + + // The actual meaning of the value depends on the users' keyboard layout + // which cannot be detected. Assuming that it is a US keyboard layout + // provides a surprisingly accurate mapping for US and European users. + // Due to this, it is left to the user to implement at this time. + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; + }, + which: function (event) { + // `which` is an alias for either `keyCode` or `charCode` depending on the + // type of the event. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; + } + }); + + /** + * @interface DragEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var SyntheticDragEvent = SyntheticMouseEvent.extend({ + dataTransfer: null + }); + + /** + * @interface TouchEvent + * @see http://www.w3.org/TR/touch-events/ + */ + var SyntheticTouchEvent = SyntheticUIEvent.extend({ + touches: null, + targetTouches: null, + changedTouches: null, + altKey: null, + metaKey: null, + ctrlKey: null, + shiftKey: null, + getModifierState: getEventModifierState + }); + + /** + * @interface Event + * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- + * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent + */ + var SyntheticTransitionEvent = SyntheticEvent.extend({ + propertyName: null, + elapsedTime: null, + pseudoElement: null + }); + + /** + * @interface WheelEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + var SyntheticWheelEvent = SyntheticMouseEvent.extend({ + deltaX: function (event) { + return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). + 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; + }, + deltaY: function (event) { + return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). + 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). + 'wheelDelta' in event ? -event.wheelDelta : 0; + }, + + deltaZ: null, + + // Browsers without "deltaMode" is reporting in raw wheel delta where one + // notch on the scroll is always +/- 120, roughly equivalent to pixels. + // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or + // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. + deltaMode: null + }); + + /** + * Turns + * ['abort', ...] + * into + * eventTypes = { + * 'abort': { + * phasedRegistrationNames: { + * bubbled: 'onAbort', + * captured: 'onAbortCapture', + * }, + * dependencies: [TOP_ABORT], + * }, + * ... + * }; + * topLevelEventsToDispatchConfig = new Map([ + * [TOP_ABORT, { sameConfig }], + * ]); + */ + + var interactiveEventTypeNames = [[TOP_BLUR, 'blur'], [TOP_CANCEL, 'cancel'], [TOP_CLICK, 'click'], [TOP_CLOSE, 'close'], [TOP_CONTEXT_MENU, 'contextMenu'], [TOP_COPY, 'copy'], [TOP_CUT, 'cut'], [TOP_AUX_CLICK, 'auxClick'], [TOP_DOUBLE_CLICK, 'doubleClick'], [TOP_DRAG_END, 'dragEnd'], [TOP_DRAG_START, 'dragStart'], [TOP_DROP, 'drop'], [TOP_FOCUS, 'focus'], [TOP_INPUT, 'input'], [TOP_INVALID, 'invalid'], [TOP_KEY_DOWN, 'keyDown'], [TOP_KEY_PRESS, 'keyPress'], [TOP_KEY_UP, 'keyUp'], [TOP_MOUSE_DOWN, 'mouseDown'], [TOP_MOUSE_UP, 'mouseUp'], [TOP_PASTE, 'paste'], [TOP_PAUSE, 'pause'], [TOP_PLAY, 'play'], [TOP_POINTER_CANCEL, 'pointerCancel'], [TOP_POINTER_DOWN, 'pointerDown'], [TOP_POINTER_UP, 'pointerUp'], [TOP_RATE_CHANGE, 'rateChange'], [TOP_RESET, 'reset'], [TOP_SEEKED, 'seeked'], [TOP_SUBMIT, 'submit'], [TOP_TOUCH_CANCEL, 'touchCancel'], [TOP_TOUCH_END, 'touchEnd'], [TOP_TOUCH_START, 'touchStart'], [TOP_VOLUME_CHANGE, 'volumeChange']]; + var nonInteractiveEventTypeNames = [[TOP_ABORT, 'abort'], [TOP_ANIMATION_END, 'animationEnd'], [TOP_ANIMATION_ITERATION, 'animationIteration'], [TOP_ANIMATION_START, 'animationStart'], [TOP_CAN_PLAY, 'canPlay'], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough'], [TOP_DRAG, 'drag'], [TOP_DRAG_ENTER, 'dragEnter'], [TOP_DRAG_EXIT, 'dragExit'], [TOP_DRAG_LEAVE, 'dragLeave'], [TOP_DRAG_OVER, 'dragOver'], [TOP_DURATION_CHANGE, 'durationChange'], [TOP_EMPTIED, 'emptied'], [TOP_ENCRYPTED, 'encrypted'], [TOP_ENDED, 'ended'], [TOP_ERROR, 'error'], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture'], [TOP_LOAD, 'load'], [TOP_LOADED_DATA, 'loadedData'], [TOP_LOADED_METADATA, 'loadedMetadata'], [TOP_LOAD_START, 'loadStart'], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture'], [TOP_MOUSE_MOVE, 'mouseMove'], [TOP_MOUSE_OUT, 'mouseOut'], [TOP_MOUSE_OVER, 'mouseOver'], [TOP_PLAYING, 'playing'], [TOP_POINTER_MOVE, 'pointerMove'], [TOP_POINTER_OUT, 'pointerOut'], [TOP_POINTER_OVER, 'pointerOver'], [TOP_PROGRESS, 'progress'], [TOP_SCROLL, 'scroll'], [TOP_SEEKING, 'seeking'], [TOP_STALLED, 'stalled'], [TOP_SUSPEND, 'suspend'], [TOP_TIME_UPDATE, 'timeUpdate'], [TOP_TOGGLE, 'toggle'], [TOP_TOUCH_MOVE, 'touchMove'], [TOP_TRANSITION_END, 'transitionEnd'], [TOP_WAITING, 'waiting'], [TOP_WHEEL, 'wheel']]; + + var eventTypes$4 = {}; + var topLevelEventsToDispatchConfig = {}; + + function addEventTypeNameToConfig(_ref, isInteractive) { + var topEvent = _ref[0], + event = _ref[1]; + + var capitalizedEvent = event[0].toUpperCase() + event.slice(1); + var onEvent = 'on' + capitalizedEvent; + + var type = { + phasedRegistrationNames: { + bubbled: onEvent, + captured: onEvent + 'Capture' + }, + dependencies: [topEvent], + isInteractive: isInteractive + }; + eventTypes$4[event] = type; + topLevelEventsToDispatchConfig[topEvent] = type; + } + + interactiveEventTypeNames.forEach(function (eventTuple) { + addEventTypeNameToConfig(eventTuple, true); + }); + nonInteractiveEventTypeNames.forEach(function (eventTuple) { + addEventTypeNameToConfig(eventTuple, false); + }); + + // Only used in DEV for exhaustiveness validation. + var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING]; + + var SimpleEventPlugin = { + eventTypes: eventTypes$4, + + isInteractiveTopLevelEventType: function (topLevelType) { + var config = topLevelEventsToDispatchConfig[topLevelType]; + return config !== undefined && config.isInteractive === true; + }, + + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; + if (!dispatchConfig) { + return null; + } + var EventConstructor = void 0; + switch (topLevelType) { + case TOP_KEY_PRESS: + // Firefox creates a keypress event for function keys too. This removes + // the unwanted keypress events. Enter is however both printable and + // non-printable. One would expect Tab to be as well (but it isn't). + if (getEventCharCode(nativeEvent) === 0) { + return null; + } + /* falls through */ + case TOP_KEY_DOWN: + case TOP_KEY_UP: + EventConstructor = SyntheticKeyboardEvent; + break; + case TOP_BLUR: + case TOP_FOCUS: + EventConstructor = SyntheticFocusEvent; + break; + case TOP_CLICK: + // Firefox creates a click event on right mouse clicks. This removes the + // unwanted click events. + if (nativeEvent.button === 2) { + return null; + } + /* falls through */ + case TOP_AUX_CLICK: + case TOP_DOUBLE_CLICK: + case TOP_MOUSE_DOWN: + case TOP_MOUSE_MOVE: + case TOP_MOUSE_UP: + // TODO: Disabled elements should not respond to mouse events + /* falls through */ + case TOP_MOUSE_OUT: + case TOP_MOUSE_OVER: + case TOP_CONTEXT_MENU: + EventConstructor = SyntheticMouseEvent; + break; + case TOP_DRAG: + case TOP_DRAG_END: + case TOP_DRAG_ENTER: + case TOP_DRAG_EXIT: + case TOP_DRAG_LEAVE: + case TOP_DRAG_OVER: + case TOP_DRAG_START: + case TOP_DROP: + EventConstructor = SyntheticDragEvent; + break; + case TOP_TOUCH_CANCEL: + case TOP_TOUCH_END: + case TOP_TOUCH_MOVE: + case TOP_TOUCH_START: + EventConstructor = SyntheticTouchEvent; + break; + case TOP_ANIMATION_END: + case TOP_ANIMATION_ITERATION: + case TOP_ANIMATION_START: + EventConstructor = SyntheticAnimationEvent; + break; + case TOP_TRANSITION_END: + EventConstructor = SyntheticTransitionEvent; + break; + case TOP_SCROLL: + EventConstructor = SyntheticUIEvent; + break; + case TOP_WHEEL: + EventConstructor = SyntheticWheelEvent; + break; + case TOP_COPY: + case TOP_CUT: + case TOP_PASTE: + EventConstructor = SyntheticClipboardEvent; + break; + case TOP_GOT_POINTER_CAPTURE: + case TOP_LOST_POINTER_CAPTURE: + case TOP_POINTER_CANCEL: + case TOP_POINTER_DOWN: + case TOP_POINTER_MOVE: + case TOP_POINTER_OUT: + case TOP_POINTER_OVER: + case TOP_POINTER_UP: + EventConstructor = SyntheticPointerEvent; + break; + default: + { + if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) { + warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType); + } + } + // HTML Events + // @see http://www.w3.org/TR/html5/index.html#events-0 + EventConstructor = SyntheticEvent; + break; + } + var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget); + accumulateTwoPhaseDispatches(event); + return event; + } + }; + + var isInteractiveTopLevelEventType = SimpleEventPlugin.isInteractiveTopLevelEventType; + + + var CALLBACK_BOOKKEEPING_POOL_SIZE = 10; + var callbackBookkeepingPool = []; + + /** + * Find the deepest React component completely containing the root of the + * passed-in instance (for use when entire React trees are nested within each + * other). If React trees are not nested, returns null. + */ + function findRootContainerNode(inst) { + // TODO: It may be a good idea to cache this to prevent unnecessary DOM + // traversal, but caching is difficult to do correctly without using a + // mutation observer to listen for all DOM changes. + while (inst.return) { + inst = inst.return; + } + if (inst.tag !== HostRoot) { + // This can happen if we're in a detached tree. + return null; + } + return inst.stateNode.containerInfo; + } + + // Used to store ancestor hierarchy in top level callback + function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) { + if (callbackBookkeepingPool.length) { + var instance = callbackBookkeepingPool.pop(); + instance.topLevelType = topLevelType; + instance.nativeEvent = nativeEvent; + instance.targetInst = targetInst; + return instance; + } + return { + topLevelType: topLevelType, + nativeEvent: nativeEvent, + targetInst: targetInst, + ancestors: [] + }; + } + + function releaseTopLevelCallbackBookKeeping(instance) { + instance.topLevelType = null; + instance.nativeEvent = null; + instance.targetInst = null; + instance.ancestors.length = 0; + if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) { + callbackBookkeepingPool.push(instance); + } + } + + function handleTopLevel(bookKeeping) { + var targetInst = bookKeeping.targetInst; + + // Loop through the hierarchy, in case there's any nested components. + // It's important that we build the array of ancestors before calling any + // event handlers, because event handlers can modify the DOM, leading to + // inconsistencies with ReactMount's node cache. See #1105. + var ancestor = targetInst; + do { + if (!ancestor) { + bookKeeping.ancestors.push(ancestor); + break; + } + var root = findRootContainerNode(ancestor); + if (!root) { + break; + } + bookKeeping.ancestors.push(ancestor); + ancestor = getClosestInstanceFromNode(root); + } while (ancestor); + + for (var i = 0; i < bookKeeping.ancestors.length; i++) { + targetInst = bookKeeping.ancestors[i]; + runExtractedEventsInBatch(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); + } + } + + // TODO: can we stop exporting these? + var _enabled = true; + + function setEnabled(enabled) { + _enabled = !!enabled; + } + + function isEnabled() { + return _enabled; + } + + /** + * Traps top-level events by using event bubbling. + * + * @param {number} topLevelType Number from `TopLevelEventTypes`. + * @param {object} element Element on which to attach listener. + * @return {?object} An object with a remove function which will forcefully + * remove the listener. + * @internal + */ + function trapBubbledEvent(topLevelType, element) { + if (!element) { + return null; + } + var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent; + + addEventBubbleListener(element, getRawEventName(topLevelType), + // Check if interactive and wrap in interactiveUpdates + dispatch.bind(null, topLevelType)); + } + + /** + * Traps a top-level event by using event capturing. + * + * @param {number} topLevelType Number from `TopLevelEventTypes`. + * @param {object} element Element on which to attach listener. + * @return {?object} An object with a remove function which will forcefully + * remove the listener. + * @internal + */ + function trapCapturedEvent(topLevelType, element) { + if (!element) { + return null; + } + var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent; + + addEventCaptureListener(element, getRawEventName(topLevelType), + // Check if interactive and wrap in interactiveUpdates + dispatch.bind(null, topLevelType)); + } + + function dispatchInteractiveEvent(topLevelType, nativeEvent) { + interactiveUpdates(dispatchEvent, topLevelType, nativeEvent); + } + + function dispatchEvent(topLevelType, nativeEvent) { + if (!_enabled) { + return; + } + + var nativeEventTarget = getEventTarget(nativeEvent); + var targetInst = getClosestInstanceFromNode(nativeEventTarget); + if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { + // If we get an event (ex: img onload) before committing that + // component's mount, ignore it for now (that is, treat it as if it was an + // event on a non-React tree). We might also consider queueing events and + // dispatching them after the mount. + targetInst = null; + } + + var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); + + try { + // Event queue being processed in the same cycle allows + // `preventDefault`. + batchedUpdates(handleTopLevel, bookKeeping); + } finally { + releaseTopLevelCallbackBookKeeping(bookKeeping); + } + } + + /** + * Summary of `ReactBrowserEventEmitter` event handling: + * + * - Top-level delegation is used to trap most native browser events. This + * may only occur in the main thread and is the responsibility of + * ReactDOMEventListener, which is injected and can therefore support + * pluggable event sources. This is the only work that occurs in the main + * thread. + * + * - We normalize and de-duplicate events to account for browser quirks. This + * may be done in the worker thread. + * + * - Forward these native events (with the associated top-level type used to + * trap it) to `EventPluginHub`, which in turn will ask plugins if they want + * to extract any synthetic events. + * + * - The `EventPluginHub` will then process each event by annotating them with + * "dispatches", a sequence of listeners and IDs that care about that event. + * + * - The `EventPluginHub` then dispatches the events. + * + * Overview of React and the event system: + * + * +------------+ . + * | DOM | . + * +------------+ . + * | . + * v . + * +------------+ . + * | ReactEvent | . + * | Listener | . + * +------------+ . +-----------+ + * | . +--------+|SimpleEvent| + * | . | |Plugin | + * +-----|------+ . v +-----------+ + * | | | . +--------------+ +------------+ + * | +-----------.--->|EventPluginHub| | Event | + * | | . | | +-----------+ | Propagators| + * | ReactEvent | . | | |TapEvent | |------------| + * | Emitter | . | |<---+|Plugin | |other plugin| + * | | . | | +-----------+ | utilities | + * | +-----------.--->| | +------------+ + * | | | . +--------------+ + * +-----|------+ . ^ +-----------+ + * | . | |Enter/Leave| + * + . +-------+|Plugin | + * +-------------+ . +-----------+ + * | application | . + * |-------------| . + * | | . + * | | . + * +-------------+ . + * . + * React Core . General Purpose Event Plugin System + */ + + var alreadyListeningTo = {}; + var reactTopListenersCounter = 0; + + /** + * To ensure no conflicts with other potential React instances on the page + */ + var topListenersIDKey = '_reactListenersID' + ('' + Math.random()).slice(2); + + function getListeningForDocument(mountAt) { + // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty` + // directly. + if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) { + mountAt[topListenersIDKey] = reactTopListenersCounter++; + alreadyListeningTo[mountAt[topListenersIDKey]] = {}; + } + return alreadyListeningTo[mountAt[topListenersIDKey]]; + } + + /** + * We listen for bubbled touch events on the document object. + * + * Firefox v8.01 (and possibly others) exhibited strange behavior when + * mounting `onmousemove` events at some node that was not the document + * element. The symptoms were that if your mouse is not moving over something + * contained within that mount point (for example on the background) the + * top-level listeners for `onmousemove` won't be called. However, if you + * register the `mousemove` on the document object, then it will of course + * catch all `mousemove`s. This along with iOS quirks, justifies restricting + * top-level listeners to the document object only, at least for these + * movement types of events and possibly all events. + * + * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html + * + * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but + * they bubble to document. + * + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @param {object} mountAt Container where to mount the listener + */ + function listenTo(registrationName, mountAt) { + var isListening = getListeningForDocument(mountAt); + var dependencies = registrationNameDependencies[registrationName]; + + for (var i = 0; i < dependencies.length; i++) { + var dependency = dependencies[i]; + if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { + switch (dependency) { + case TOP_SCROLL: + trapCapturedEvent(TOP_SCROLL, mountAt); + break; + case TOP_FOCUS: + case TOP_BLUR: + trapCapturedEvent(TOP_FOCUS, mountAt); + trapCapturedEvent(TOP_BLUR, mountAt); + // We set the flag for a single dependency later in this function, + // but this ensures we mark both as attached rather than just one. + isListening[TOP_BLUR] = true; + isListening[TOP_FOCUS] = true; + break; + case TOP_CANCEL: + case TOP_CLOSE: + if (isEventSupported(getRawEventName(dependency))) { + trapCapturedEvent(dependency, mountAt); + } + break; + case TOP_INVALID: + case TOP_SUBMIT: + case TOP_RESET: + // We listen to them on the target DOM elements. + // Some of them bubble so we don't want them to fire twice. + break; + default: + // By default, listen on the top level to all non-media events. + // Media events don't bubble so adding the listener wouldn't do anything. + var isMediaEvent = mediaEventTypes.indexOf(dependency) !== -1; + if (!isMediaEvent) { + trapBubbledEvent(dependency, mountAt); + } + break; + } + isListening[dependency] = true; + } + } + } + + function isListeningToAllDependencies(registrationName, mountAt) { + var isListening = getListeningForDocument(mountAt); + var dependencies = registrationNameDependencies[registrationName]; + for (var i = 0; i < dependencies.length; i++) { + var dependency = dependencies[i]; + if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { + return false; + } + } + return true; + } + + function getActiveElement(doc) { + doc = doc || (typeof document !== 'undefined' ? document : undefined); + if (typeof doc === 'undefined') { + return null; + } + try { + return doc.activeElement || doc.body; + } catch (e) { + return doc.body; + } + } + + /** + * Given any node return the first leaf node without children. + * + * @param {DOMElement|DOMTextNode} node + * @return {DOMElement|DOMTextNode} + */ + function getLeafNode(node) { + while (node && node.firstChild) { + node = node.firstChild; + } + return node; + } + + /** + * Get the next sibling within a container. This will walk up the + * DOM if a node's siblings have been exhausted. + * + * @param {DOMElement|DOMTextNode} node + * @return {?DOMElement|DOMTextNode} + */ + function getSiblingNode(node) { + while (node) { + if (node.nextSibling) { + return node.nextSibling; + } + node = node.parentNode; + } + } + + /** + * Get object describing the nodes which contain characters at offset. + * + * @param {DOMElement|DOMTextNode} root + * @param {number} offset + * @return {?object} + */ + function getNodeForCharacterOffset(root, offset) { + var node = getLeafNode(root); + var nodeStart = 0; + var nodeEnd = 0; + + while (node) { + if (node.nodeType === TEXT_NODE) { + nodeEnd = nodeStart + node.textContent.length; + + if (nodeStart <= offset && nodeEnd >= offset) { + return { + node: node, + offset: offset - nodeStart + }; + } + + nodeStart = nodeEnd; + } + + node = getLeafNode(getSiblingNode(node)); + } + } + + /** + * @param {DOMElement} outerNode + * @return {?object} + */ + function getOffsets(outerNode) { + var ownerDocument = outerNode.ownerDocument; + + var win = ownerDocument && ownerDocument.defaultView || window; + var selection = win.getSelection && win.getSelection(); + + if (!selection || selection.rangeCount === 0) { + return null; + } + + var anchorNode = selection.anchorNode, + anchorOffset = selection.anchorOffset, + focusNode = selection.focusNode, + focusOffset = selection.focusOffset; + + // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the + // up/down buttons on an . Anonymous divs do not seem to + // expose properties, triggering a "Permission denied error" if any of its + // properties are accessed. The only seemingly possible way to avoid erroring + // is to access a property that typically works for non-anonymous divs and + // catch any error that may otherwise arise. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=208427 + + try { + /* eslint-disable no-unused-expressions */ + anchorNode.nodeType; + focusNode.nodeType; + /* eslint-enable no-unused-expressions */ + } catch (e) { + return null; + } + + return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset); + } + + /** + * Returns {start, end} where `start` is the character/codepoint index of + * (anchorNode, anchorOffset) within the textContent of `outerNode`, and + * `end` is the index of (focusNode, focusOffset). + * + * Returns null if you pass in garbage input but we should probably just crash. + * + * Exported only for testing. + */ + function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) { + var length = 0; + var start = -1; + var end = -1; + var indexWithinAnchor = 0; + var indexWithinFocus = 0; + var node = outerNode; + var parentNode = null; + + outer: while (true) { + var next = null; + + while (true) { + if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) { + start = length + anchorOffset; + } + if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) { + end = length + focusOffset; + } + + if (node.nodeType === TEXT_NODE) { + length += node.nodeValue.length; + } + + if ((next = node.firstChild) === null) { + break; + } + // Moving from `node` to its first child `next`. + parentNode = node; + node = next; + } + + while (true) { + if (node === outerNode) { + // If `outerNode` has children, this is always the second time visiting + // it. If it has no children, this is still the first loop, and the only + // valid selection is anchorNode and focusNode both equal to this node + // and both offsets 0, in which case we will have handled above. + break outer; + } + if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) { + start = length; + } + if (parentNode === focusNode && ++indexWithinFocus === focusOffset) { + end = length; + } + if ((next = node.nextSibling) !== null) { + break; + } + node = parentNode; + parentNode = node.parentNode; + } + + // Moving from `node` to its next sibling `next`. + node = next; + } + + if (start === -1 || end === -1) { + // This should never happen. (Would happen if the anchor/focus nodes aren't + // actually inside the passed-in node.) + return null; + } + + return { + start: start, + end: end + }; + } + + /** + * In modern non-IE browsers, we can support both forward and backward + * selections. + * + * Note: IE10+ supports the Selection object, but it does not support + * the `extend` method, which means that even in modern IE, it's not possible + * to programmatically create a backward selection. Thus, for all IE + * versions, we use the old IE API to create our selections. + * + * @param {DOMElement|DOMTextNode} node + * @param {object} offsets + */ + function setOffsets(node, offsets) { + var doc = node.ownerDocument || document; + var win = doc && doc.defaultView || window; + + // Edge fails with "Object expected" in some scenarios. + // (For instance: TinyMCE editor used in a list component that supports pasting to add more, + // fails when pasting 100+ items) + if (!win.getSelection) { + return; + } + + var selection = win.getSelection(); + var length = node.textContent.length; + var start = Math.min(offsets.start, length); + var end = offsets.end === undefined ? start : Math.min(offsets.end, length); + + // IE 11 uses modern selection, but doesn't support the extend method. + // Flip backward selections, so we can set with a single range. + if (!selection.extend && start > end) { + var temp = end; + end = start; + start = temp; + } + + var startMarker = getNodeForCharacterOffset(node, start); + var endMarker = getNodeForCharacterOffset(node, end); + + if (startMarker && endMarker) { + if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) { + return; + } + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + + if (start > end) { + selection.addRange(range); + selection.extend(endMarker.node, endMarker.offset); + } else { + range.setEnd(endMarker.node, endMarker.offset); + selection.addRange(range); + } + } + } + + function isTextNode(node) { + return node && node.nodeType === TEXT_NODE; + } + + function containsNode(outerNode, innerNode) { + if (!outerNode || !innerNode) { + return false; + } else if (outerNode === innerNode) { + return true; + } else if (isTextNode(outerNode)) { + return false; + } else if (isTextNode(innerNode)) { + return containsNode(outerNode, innerNode.parentNode); + } else if ('contains' in outerNode) { + return outerNode.contains(innerNode); + } else if (outerNode.compareDocumentPosition) { + return !!(outerNode.compareDocumentPosition(innerNode) & 16); + } else { + return false; + } + } + + function isInDocument(node) { + return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node); + } + + function isSameOriginFrame(iframe) { + try { + // Accessing the contentDocument of a HTMLIframeElement can cause the browser + // to throw, e.g. if it has a cross-origin src attribute. + // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g: + // iframe.contentDocument.defaultView; + // A safety way is to access one of the cross origin properties: Window or Location + // Which might result in "SecurityError" DOM Exception and it is compatible to Safari. + // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl + + return typeof iframe.contentWindow.location.href === 'string'; + } catch (err) { + return false; + } + } + + function getActiveElementDeep() { + var win = window; + var element = getActiveElement(); + while (element instanceof win.HTMLIFrameElement) { + if (isSameOriginFrame(element)) { + win = element.contentWindow; + } else { + return element; + } + element = getActiveElement(win.document); + } + return element; + } + + /** + * @ReactInputSelection: React input selection module. Based on Selection.js, + * but modified to be suitable for react and has a couple of bug fixes (doesn't + * assume buttons have range selections allowed). + * Input selection module for React. + */ + + /** + * @hasSelectionCapabilities: we get the element types that support selection + * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart` + * and `selectionEnd` rows. + */ + function hasSelectionCapabilities(elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true'); + } + + function getSelectionInformation() { + var focusedElem = getActiveElementDeep(); + return { + focusedElem: focusedElem, + selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null + }; + } + + /** + * @restoreSelection: If any selection information was potentially lost, + * restore it. This is useful when performing operations that could remove dom + * nodes and place them back in, resulting in focus being lost. + */ + function restoreSelection(priorSelectionInformation) { + var curFocusedElem = getActiveElementDeep(); + var priorFocusedElem = priorSelectionInformation.focusedElem; + var priorSelectionRange = priorSelectionInformation.selectionRange; + if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { + if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) { + setSelection(priorFocusedElem, priorSelectionRange); + } + + // Focusing a node can change the scroll position, which is undesirable + var ancestors = []; + var ancestor = priorFocusedElem; + while (ancestor = ancestor.parentNode) { + if (ancestor.nodeType === ELEMENT_NODE) { + ancestors.push({ + element: ancestor, + left: ancestor.scrollLeft, + top: ancestor.scrollTop + }); + } + } + + if (typeof priorFocusedElem.focus === 'function') { + priorFocusedElem.focus(); + } + + for (var i = 0; i < ancestors.length; i++) { + var info = ancestors[i]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + } + + /** + * @getSelection: Gets the selection bounds of a focused textarea, input or + * contentEditable node. + * -@input: Look up selection bounds of this input + * -@return {start: selectionStart, end: selectionEnd} + */ + function getSelection$1(input) { + var selection = void 0; + + if ('selectionStart' in input) { + // Modern browser with input or textarea. + selection = { + start: input.selectionStart, + end: input.selectionEnd + }; + } else { + // Content editable or old IE textarea. + selection = getOffsets(input); + } + + return selection || { start: 0, end: 0 }; + } + + /** + * @setSelection: Sets the selection bounds of a textarea or input and focuses + * the input. + * -@input Set selection bounds of this input or textarea + * -@offsets Object of same form that is returned from get* + */ + function setSelection(input, offsets) { + var start = offsets.start, + end = offsets.end; + + if (end === undefined) { + end = start; + } + + if ('selectionStart' in input) { + input.selectionStart = start; + input.selectionEnd = Math.min(end, input.value.length); + } else { + setOffsets(input, offsets); + } + } + + var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11; + + var eventTypes$3 = { + select: { + phasedRegistrationNames: { + bubbled: 'onSelect', + captured: 'onSelectCapture' + }, + dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE] + } + }; + + var activeElement$1 = null; + var activeElementInst$1 = null; + var lastSelection = null; + var mouseDown = false; + + /** + * Get an object which is a unique representation of the current selection. + * + * The return value will not be consistent across nodes or browsers, but + * two identical selections on the same node will return identical objects. + * + * @param {DOMElement} node + * @return {object} + */ + function getSelection(node) { + if ('selectionStart' in node && hasSelectionCapabilities(node)) { + return { + start: node.selectionStart, + end: node.selectionEnd + }; + } else { + var win = node.ownerDocument && node.ownerDocument.defaultView || window; + var selection = win.getSelection(); + return { + anchorNode: selection.anchorNode, + anchorOffset: selection.anchorOffset, + focusNode: selection.focusNode, + focusOffset: selection.focusOffset + }; + } + } + + /** + * Get document associated with the event target. + * + * @param {object} nativeEventTarget + * @return {Document} + */ + function getEventTargetDocument(eventTarget) { + return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument; + } + + /** + * Poll selection to see whether it's changed. + * + * @param {object} nativeEvent + * @param {object} nativeEventTarget + * @return {?SyntheticEvent} + */ + function constructSelectEvent(nativeEvent, nativeEventTarget) { + // Ensure we have the right element, and that the user is not dragging a + // selection (this matches native `select` event behavior). In HTML5, select + // fires only on input and textarea thus if there's no focused element we + // won't dispatch. + var doc = getEventTargetDocument(nativeEventTarget); + + if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) { + return null; + } + + // Only fire when selection has actually changed. + var currentSelection = getSelection(activeElement$1); + if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { + lastSelection = currentSelection; + + var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget); + + syntheticEvent.type = 'select'; + syntheticEvent.target = activeElement$1; + + accumulateTwoPhaseDispatches(syntheticEvent); + + return syntheticEvent; + } + + return null; + } + + /** + * This plugin creates an `onSelect` event that normalizes select events + * across form elements. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - contentEditable + * + * This differs from native browser implementations in the following ways: + * - Fires on contentEditable fields as well as inputs. + * - Fires for collapsed selection. + * - Fires after user input. + */ + var SelectEventPlugin = { + eventTypes: eventTypes$3, + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var doc = getEventTargetDocument(nativeEventTarget); + // Track whether all listeners exists for this plugin. If none exist, we do + // not extract events. See #3639. + if (!doc || !isListeningToAllDependencies('onSelect', doc)) { + return null; + } + + var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window; + + switch (topLevelType) { + // Track the input node that has focus. + case TOP_FOCUS: + if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') { + activeElement$1 = targetNode; + activeElementInst$1 = targetInst; + lastSelection = null; + } + break; + case TOP_BLUR: + activeElement$1 = null; + activeElementInst$1 = null; + lastSelection = null; + break; + // Don't fire the event while the user is dragging. This matches the + // semantics of the native select event. + case TOP_MOUSE_DOWN: + mouseDown = true; + break; + case TOP_CONTEXT_MENU: + case TOP_MOUSE_UP: + case TOP_DRAG_END: + mouseDown = false; + return constructSelectEvent(nativeEvent, nativeEventTarget); + // Chrome and IE fire non-standard event when selection is changed (and + // sometimes when it hasn't). IE's event fires out of order with respect + // to key and input events on deletion, so we discard it. + // + // Firefox doesn't support selectionchange, so check selection status + // after each key entry. The selection changes after keydown and before + // keyup, but we check on keydown as well in the case of holding down a + // key, when multiple keydown events are fired but only one keyup is. + // This is also our approach for IE handling, for the reason above. + case TOP_SELECTION_CHANGE: + if (skipSelectionChangeEvent) { + break; + } + // falls through + case TOP_KEY_DOWN: + case TOP_KEY_UP: + return constructSelectEvent(nativeEvent, nativeEventTarget); + } + + return null; + } + }; + + /** + * Inject modules for resolving DOM hierarchy and plugin ordering. + */ + injection.injectEventPluginOrder(DOMEventPluginOrder); + setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1); + + /** + * Some important event plugins included by default (without having to require + * them). + */ + injection.injectEventPluginsByName({ + SimpleEventPlugin: SimpleEventPlugin, + EnterLeaveEventPlugin: EnterLeaveEventPlugin, + ChangeEventPlugin: ChangeEventPlugin, + SelectEventPlugin: SelectEventPlugin, + BeforeInputEventPlugin: BeforeInputEventPlugin + }); + + var didWarnSelectedSetOnOption = false; + var didWarnInvalidChild = false; + + function flattenChildren(children) { + var content = ''; + + // Flatten children. We'll warn if they are invalid + // during validateProps() which runs for hydration too. + // Note that this would throw on non-element objects. + // Elements are stringified (which is normally irrelevant + // but matters for ). + React.Children.forEach(children, function (child) { + if (child == null) { + return; + } + content += child; + // Note: we don't warn about invalid children here. + // Instead, this is done separately below so that + // it happens during the hydration codepath too. + }); + + return content; + } + + /** + * Implements an